dsehnal 2 years ago
parent
commit
305ca05f04
3 changed files with 8 additions and 3 deletions
  1. 3 1
      src/mol-model/loci.ts
  2. 1 1
      src/mol-model/volume/volume.ts
  3. 4 1
      src/mol-repr/volume/isosurface.ts

+ 3 - 1
src/mol-model/loci.ts

@@ -241,7 +241,9 @@ namespace Loci {
                 ? Structure.toStructureElementLoci(loci.structure)
                 : ShapeGroup.isLoci(loci)
                     ? Shape.Loci(loci.shape)
-                    : loci;
+                    : Volume.Cell.isLoci(loci)
+                        ? Volume.Loci(loci.volume)
+                        : loci;
         },
         'elementInstances': (loci: Loci) => {
             return StructureElement.Loci.is(loci)

+ 1 - 1
src/mol-model/volume/volume.ts

@@ -220,7 +220,7 @@ export namespace Volume {
         }
     }
 
-    export type PickingGranularity = 'surface' | 'voxel';
+    export type PickingGranularity = 'volume' | 'surface' | 'voxel';
     export const PickingGranularity = {
         set(volume: Volume, granularity: PickingGranularity) {
             volume._propertyData['__picking_granularity__'] = granularity;

+ 4 - 1
src/mol-repr/volume/isosurface.ts

@@ -68,7 +68,10 @@ function getIsosurfaceLoci(pickingId: PickingId, volume: Volume, props: VolumeIs
     const { objectId, groupId } = pickingId;
 
     if (id === objectId) {
-        if (Volume.PickingGranuality.get(volume) === 'surface') {
+        const granuality = Volume.PickingGranularity.get(volume);
+        if (granuality === 'volume') {
+            return Volume.Loci(volume);
+        } else if (granuality === 'surface') {
             return Volume.Isosurface.Loci(volume, props.isoValue);
         } else {
             return Volume.Cell.Loci(volume, Interval.ofSingleton(groupId as Volume.CellIndex));