registry.ts 1.0 KB

12345678910111213141516171819202122232425
  1. /**
  2. * Copyright (c) 2018 mol* contributors, licensed under MIT, See LICENSE file for more info.
  3. *
  4. * @author Alexander Rose <alexander.rose@weirdbyte.de>
  5. */
  6. import { RepresentationProvider, RepresentationRegistry } from '../representation';
  7. import { VolumeData } from 'mol-model/volume';
  8. export class VolumeRepresentationRegistry extends RepresentationRegistry<VolumeData> {
  9. constructor() {
  10. super()
  11. Object.keys(BuiltInVolumeRepresentations).forEach(name => {
  12. const p = (BuiltInVolumeRepresentations as { [k: string]: RepresentationProvider<VolumeData, any> })[name]
  13. this.add(name, p.factory, p.getParams)
  14. })
  15. }
  16. }
  17. export const BuiltInVolumeRepresentations = {
  18. // TODO
  19. }
  20. export type BuiltInVolumeRepresentationsName = keyof typeof BuiltInVolumeRepresentations
  21. export const BuiltInVolumeRepresentationsNames = Object.keys(BuiltInVolumeRepresentations)
  22. export const BuiltInVolumeRepresentationsOptions = BuiltInVolumeRepresentationsNames.map(n => [n, n] as [BuiltInVolumeRepresentationsName, string])