Explorar o código

Fixed coarse model issues

David Sehnal %!s(int64=7) %!d(string=hai) anos
pai
achega
226121a9f4

+ 1 - 2
src/mol-geo/representation/structure/spacefill.ts

@@ -17,7 +17,6 @@ import { MeshBuilder } from '../../shape/mesh-builder';
 import { createTransforms, createColors } from './utils';
 import { ColorTheme } from '../../theme';
 import VertexMap from '../../shape/vertex-map';
-import CoarseGrained from 'mol-model/structure/model/properties/coarse-grained';
 import { icosahedronVertexCount } from '../../primitive/icosahedron';
 
 export const DefaultSpacefillProps = {
@@ -38,7 +37,7 @@ function createSpacefillMesh(unit: Unit, elementGroup: ElementGroup, detail: num
         let radius: Element.Property<number>
         if (Unit.isAtomic(unit)) {
             radius = Queries.props.atom.vdw_radius
-        } else if (Unit.isCoarse(unit) && unit.elementType === CoarseGrained.ElementType.Sphere) {
+        } else if (Unit.isSpheres(unit)) {
             radius = Queries.props.coarse_grained.sphere_radius
         } else {
             console.warn('Unsupported unit type')

+ 2 - 2
src/mol-geo/theme/structure/color/chain-id.ts

@@ -21,8 +21,8 @@ function createChainIdMap(unit: Unit) {
         asym_id = unit.hierarchy.chains.label_asym_id
         count = unit.hierarchy.chains._rowCount
     } else if (Unit.isCoarse(unit)) {
-        asym_id = unit.siteBases.asym_id
-        count = unit.siteBases.count
+        asym_id = unit.sites.asym_id
+        count = unit.sites.count
     } else {
         console.warn('Unknown unit type')
         return { map, count: index }

+ 1 - 2
src/mol-geo/theme/structure/size/element.ts

@@ -5,7 +5,6 @@
  */
 
 import { ElementGroup, Element, Unit, Queries } from 'mol-model/structure';
-import CoarseGrained from 'mol-model/structure/model/properties/coarse-grained';
 import { StructureSizeDataProps } from '.';
 import { createAttributeSize } from '../../../util/size-data';
 
@@ -16,7 +15,7 @@ export function elementSizeData(props: StructureSizeDataProps) {
     let radius: Element.Property<number>
     if (Unit.isAtomic(unit)) {
         radius = Queries.props.atom.vdw_radius
-    } else if (Unit.isCoarse(unit) && unit.elementType === CoarseGrained.ElementType.Sphere) {
+    } else if (Unit.isSpheres(unit)) {
         radius = Queries.props.coarse_grained.sphere_radius
     }
     const l = Element.Location()