|
@@ -11,7 +11,7 @@ import { ParamDefinition as PD } from '../../../../mol-util/param-definition';
|
|
|
import { GaussianDensityTexture, GaussianDensityTexture2d } from '../../../../mol-math/geometry/gaussian-density/gpu';
|
|
|
import { Texture } from '../../../../mol-gl/webgl/texture';
|
|
|
import { WebGLContext } from '../../../../mol-gl/webgl/context';
|
|
|
-import { getUnitConformationAndRadius, getStructureConformationAndRadius, CommonSurfaceParams } from './common';
|
|
|
+import { getUnitConformationAndRadius, getStructureConformationAndRadius, CommonSurfaceParams, ensureReasonableResolution } from './common';
|
|
|
import { BaseGeometry } from '../../../../mol-geo/geometry/base';
|
|
|
|
|
|
const SharedGaussianDensityParams = {
|
|
@@ -37,38 +37,48 @@ export type GaussianDensityTextureProps = typeof DefaultGaussianDensityTexturePr
|
|
|
//
|
|
|
|
|
|
export function computeUnitGaussianDensity(structure: Structure, unit: Unit, props: GaussianDensityProps, webgl?: WebGLContext) {
|
|
|
- const { position, radius } = getUnitConformationAndRadius(structure, unit, props);
|
|
|
+ const { box } = unit.lookup3d.boundary;
|
|
|
+ const p = ensureReasonableResolution(box, props);
|
|
|
+ const { position, radius } = getUnitConformationAndRadius(structure, unit, p);
|
|
|
return Task.create('Gaussian Density', async ctx => {
|
|
|
- return await GaussianDensity(ctx, position, unit.lookup3d.boundary.box, radius, props, webgl);
|
|
|
+ return await GaussianDensity(ctx, position, box, radius, p, webgl);
|
|
|
});
|
|
|
}
|
|
|
|
|
|
export function computeUnitGaussianDensityTexture(structure: Structure, unit: Unit, props: GaussianDensityTextureProps, webgl: WebGLContext, texture?: Texture) {
|
|
|
- const { position, radius } = getUnitConformationAndRadius(structure, unit, props);
|
|
|
+ const { box } = unit.lookup3d.boundary;
|
|
|
+ const p = ensureReasonableResolution(box, props);
|
|
|
+ const { position, radius } = getUnitConformationAndRadius(structure, unit, p);
|
|
|
return Task.create('Gaussian Density', async ctx => {
|
|
|
- return GaussianDensityTexture(webgl, position, unit.lookup3d.boundary.box, radius, props, texture);
|
|
|
+ return GaussianDensityTexture(webgl, position, box, radius, p, texture);
|
|
|
});
|
|
|
}
|
|
|
|
|
|
export function computeUnitGaussianDensityTexture2d(structure: Structure, unit: Unit, props: GaussianDensityTextureProps, webgl: WebGLContext, texture?: Texture) {
|
|
|
- const { position, radius } = getUnitConformationAndRadius(structure, unit, props);
|
|
|
+ const { box } = unit.lookup3d.boundary;
|
|
|
+ const p = ensureReasonableResolution(box, props);
|
|
|
+ const { position, radius } = getUnitConformationAndRadius(structure, unit, p);
|
|
|
return Task.create('Gaussian Density', async ctx => {
|
|
|
- return GaussianDensityTexture2d(webgl, position, unit.lookup3d.boundary.box, radius, props, texture);
|
|
|
+ return GaussianDensityTexture2d(webgl, position, box, radius, p, texture);
|
|
|
});
|
|
|
}
|
|
|
|
|
|
//
|
|
|
|
|
|
export function computeStructureGaussianDensity(structure: Structure, props: GaussianDensityProps, webgl?: WebGLContext) {
|
|
|
+ const { box } = structure.lookup3d.boundary;
|
|
|
+ const p = ensureReasonableResolution(box, props);
|
|
|
const { position, radius } = getStructureConformationAndRadius(structure, props.ignoreHydrogens, props.traceOnly);
|
|
|
return Task.create('Gaussian Density', async ctx => {
|
|
|
- return await GaussianDensity(ctx, position, structure.lookup3d.boundary.box, radius, props, webgl);
|
|
|
+ return await GaussianDensity(ctx, position, box, radius, p, webgl);
|
|
|
});
|
|
|
}
|
|
|
|
|
|
export function computeStructureGaussianDensityTexture(structure: Structure, props: GaussianDensityTextureProps, webgl: WebGLContext, texture?: Texture) {
|
|
|
+ const { box } = structure.lookup3d.boundary;
|
|
|
+ const p = ensureReasonableResolution(box, props);
|
|
|
const { position, radius } = getStructureConformationAndRadius(structure, props.ignoreHydrogens, props.traceOnly);
|
|
|
return Task.create('Gaussian Density', async ctx => {
|
|
|
- return GaussianDensityTexture(webgl, position, structure.lookup3d.boundary.box, radius, props, texture);
|
|
|
+ return GaussianDensityTexture(webgl, position, box, radius, p, texture);
|
|
|
});
|
|
|
}
|