From 226121a9f4533c0d71b160f53bbeb75d1dd20cb1 Mon Sep 17 00:00:00 2001
From: David Sehnal <david.sehnal@gmail.com>
Date: Mon, 7 May 2018 14:51:52 +0200
Subject: [PATCH] Fixed coarse model issues

---
 src/mol-geo/representation/structure/spacefill.ts | 3 +--
 src/mol-geo/theme/structure/color/chain-id.ts     | 4 ++--
 src/mol-geo/theme/structure/size/element.ts       | 3 +--
 3 files changed, 4 insertions(+), 6 deletions(-)

diff --git a/src/mol-geo/representation/structure/spacefill.ts b/src/mol-geo/representation/structure/spacefill.ts
index 689f2bfc9..2d9b3c1a9 100644
--- a/src/mol-geo/representation/structure/spacefill.ts
+++ b/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')
diff --git a/src/mol-geo/theme/structure/color/chain-id.ts b/src/mol-geo/theme/structure/color/chain-id.ts
index 43dfc0db6..fec2d8f8a 100644
--- a/src/mol-geo/theme/structure/color/chain-id.ts
+++ b/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 }
diff --git a/src/mol-geo/theme/structure/size/element.ts b/src/mol-geo/theme/structure/size/element.ts
index 699bc071a..d18238c12 100644
--- a/src/mol-geo/theme/structure/size/element.ts
+++ b/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()
-- 
GitLab