From 4c5eb4a93f28d0e9b47992db5f063b622924d8cc Mon Sep 17 00:00:00 2001 From: Alexander Rose <alexander.rose@weirdbyte.de> Date: Sun, 24 Feb 2019 13:30:44 -0800 Subject: [PATCH] removed gaussian density ignoreCache param --- .../structure/visual/gaussian-density-point.ts | 1 - .../structure/visual/gaussian-surface-mesh.ts | 1 - .../structure/visual/gaussian-surface-wireframe.ts | 1 - src/mol-repr/structure/visual/util/gaussian.ts | 13 +------------ 4 files changed, 1 insertion(+), 15 deletions(-) diff --git a/src/mol-repr/structure/visual/gaussian-density-point.ts b/src/mol-repr/structure/visual/gaussian-density-point.ts index c61ae5745..3e260df8c 100644 --- a/src/mol-repr/structure/visual/gaussian-density-point.ts +++ b/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 } }) } \ No newline at end of file diff --git a/src/mol-repr/structure/visual/gaussian-surface-mesh.ts b/src/mol-repr/structure/visual/gaussian-surface-mesh.ts index e39766fd4..9dc645bbc 100644 --- a/src/mol-repr/structure/visual/gaussian-surface-mesh.ts +++ b/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 } }) } \ No newline at end of file diff --git a/src/mol-repr/structure/visual/gaussian-surface-wireframe.ts b/src/mol-repr/structure/visual/gaussian-surface-wireframe.ts index 68c31c56f..a292ff3e5 100644 --- a/src/mol-repr/structure/visual/gaussian-surface-wireframe.ts +++ b/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 } }) } \ No newline at end of file diff --git a/src/mol-repr/structure/visual/util/gaussian.ts b/src/mol-repr/structure/visual/util/gaussian.ts index 2f268c983..a648e2bb6 100644 --- a/src/mol-repr/structure/visual/util/gaussian.ts +++ b/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) { -- GitLab