model.ts 888 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. /**
  2. * Copyright (c) 2017 mol* contributors, licensed under MIT, See LICENSE file for more info.
  3. *
  4. * @author David Sehnal <david.sehnal@gmail.com>
  5. */
  6. import UUID from 'mol-util/uuid'
  7. import Format from './format'
  8. import HierarchyProperties from './properties/hierarchy'
  9. import ConformationProperties from './properties/conformation'
  10. import from_mmCIF from './formats/mmcif'
  11. /**
  12. * Interface to the "source data" of the molecule.
  13. *
  14. * "Atoms" are integers in the range [0, atomCount).
  15. */
  16. interface Model extends Readonly<{
  17. id: UUID,
  18. modelNum: number,
  19. sourceData: Format,
  20. hierarchy: HierarchyProperties,
  21. conformation: ConformationProperties,
  22. atomCount: number
  23. }> { }
  24. namespace Model {
  25. export function create(format: Format) {
  26. switch (format.kind) {
  27. case 'mmCIF': return from_mmCIF(format);
  28. }
  29. }
  30. }
  31. export default Model