Browse Source

lookup3d, expose transient result property

Alexander Rose 6 years ago
parent
commit
e87abc47b9

+ 2 - 0
src/mol-math/geometry/lookup3d/common.ts

@@ -33,4 +33,6 @@ export interface Lookup3D<T = number> {
     find(x: number, y: number, z: number, radius: number): Result<T>,
     check(x: number, y: number, z: number, radius: number): boolean,
     readonly boundary: { readonly box: Box3D, readonly sphere: Sphere3D }
+    /** transient result */
+    readonly result: Result<T>
 }

+ 2 - 0
src/mol-math/geometry/lookup3d/grid.ts

@@ -27,6 +27,7 @@ class GridLookup3DImpl implements GridLookup3D<number> {
     private ctx: QueryContext;
     boundary: Lookup3D['boundary'];
     buckets: GridLookup3D['buckets'];
+    result: Result<number>
 
     find(x: number, y: number, z: number, radius: number): Result<number> {
         this.ctx.x = x;
@@ -52,6 +53,7 @@ class GridLookup3DImpl implements GridLookup3D<number> {
         this.ctx = createContext(structure);
         this.boundary = { box: structure.boundingBox, sphere: structure.boundingSphere };
         this.buckets = { offset: structure.bucketOffset, count: structure.bucketCounts, array: structure.bucketArray };
+        this.result = this.ctx.result
     }
 }