Browse Source

removed gaussian density ignoreCache param

Alexander Rose 6 years ago
parent
commit
4c5eb4a93f

+ 0 - 1
src/mol-repr/structure/visual/gaussian-density-point.ts

@@ -67,7 +67,6 @@ export function GaussianDensityPointVisual(): UnitsVisual<GaussianDensityPointPa
             if (newProps.radiusOffset !== currentProps.radiusOffset) state.createGeometry = true
             if (newProps.smoothness !== currentProps.smoothness) state.createGeometry = true
             if (newProps.useGpu !== currentProps.useGpu) state.createGeometry = true
-            if (newProps.ignoreCache !== currentProps.ignoreCache) state.createGeometry = true
         }
     })
 }

+ 0 - 1
src/mol-repr/structure/visual/gaussian-surface-mesh.ts

@@ -52,7 +52,6 @@ export function GaussianSurfaceVisual(): UnitsVisual<GaussianSurfaceParams> {
             if (newProps.radiusOffset !== currentProps.radiusOffset) state.createGeometry = true
             if (newProps.smoothness !== currentProps.smoothness) state.createGeometry = true
             if (newProps.useGpu !== currentProps.useGpu) state.createGeometry = true
-            if (newProps.ignoreCache !== currentProps.ignoreCache) state.createGeometry = true
         }
     })
 }

+ 0 - 1
src/mol-repr/structure/visual/gaussian-surface-wireframe.ts

@@ -51,7 +51,6 @@ export function GaussianWireframeVisual(): UnitsVisual<GaussianWireframeParams>
             if (newProps.radiusOffset !== currentProps.radiusOffset) state.createGeometry = true
             if (newProps.smoothness !== currentProps.smoothness) state.createGeometry = true
             if (newProps.useGpu !== currentProps.useGpu) state.createGeometry = true
-            if (newProps.ignoreCache !== currentProps.ignoreCache) state.createGeometry = true
         }
     })
 }

+ 1 - 12
src/mol-repr/structure/visual/util/gaussian.ts

@@ -6,8 +6,7 @@
 
 import { Unit, StructureElement, ElementIndex, Structure } from 'mol-model/structure';
 import { GaussianDensity } from 'mol-math/geometry/gaussian-density';
-import { Task, RuntimeContext } from 'mol-task';
-import { DensityData } from 'mol-math/geometry';
+import { Task } from 'mol-task';
 import { ParamDefinition as PD } from 'mol-util/param-definition';
 import { GaussianDensityTexture } from 'mol-math/geometry/gaussian-density/gpu';
 import { Texture } from 'mol-gl/webgl/texture';
@@ -20,7 +19,6 @@ export const GaussianDensityParams = {
     radiusOffset: PD.Numeric(0, { min: 0, max: 10, step: 0.1 }),
     smoothness: PD.Numeric(1.5, { min: 0.5, max: 2.5, step: 0.1 }),
     useGpu: PD.Boolean(false),
-    ignoreCache: PD.Boolean(false),
 }
 export const DefaultGaussianDensityProps = PD.getDefaultValues(GaussianDensityParams)
 export type GaussianDensityProps = typeof DefaultGaussianDensityProps
@@ -67,15 +65,6 @@ export function computeUnitGaussianDensityTexture(unit: Unit, props: GaussianDen
     });
 }
 
-export async function computeUnitGaussianDensityCached(unit: Unit, props: GaussianDensityProps, cache: Map<string, DensityData>, ctx: RuntimeContext, webgl?: WebGLContext) {
-    const key = `${props.radiusOffset}|${props.resolution}|${props.smoothness}`
-    let density = cache.get(key)
-    if (density && !props.ignoreCache) return density
-    density = await computeUnitGaussianDensity(unit, props, webgl).runInContext(ctx)
-    if (!props.ignoreCache) cache.set(key, density)
-    return density
-}
-
 //
 
 function getStructureConformationAndRadius(structure: Structure) {