molstar
Version:
A comprehensive macromolecular library.
45 lines (44 loc) • 3.19 kB
TypeScript
/**
* Copyright (c) 2018-2020 mol* contributors, licensed under MIT, See LICENSE file for more info.
*
* @author Alexander Rose <alexander.rose@weirdbyte.de>
*/
import { ParamDefinition as PD } from '../../mol-util/param-definition';
import { Visual, VisualContext } from '../visual';
import { Volume } from '../../mol-model/volume';
import { Geometry, GeometryUtils } from '../../mol-geo/geometry/geometry';
import { LocationIterator } from '../../mol-geo/util/location-iterator';
import { Theme } from '../../mol-theme/theme';
import { PickingId } from '../../mol-geo/geometry/picking';
import { Loci } from '../../mol-model/loci';
import { Interval } from '../../mol-data/int';
import { VisualUpdateState } from '../util';
import { Representation, RepresentationProvider, RepresentationContext, RepresentationParamsGetter } from '../representation';
import { WebGLContext } from '../../mol-gl/webgl/context';
export interface VolumeVisual<P extends VolumeParams> extends Visual<Volume, P> {
}
interface VolumeVisualBuilder<P extends VolumeParams, G extends Geometry> {
defaultProps: PD.Values<P>;
createGeometry(ctx: VisualContext, volume: Volume, theme: Theme, props: PD.Values<P>, geometry?: G): Promise<G> | G;
createLocationIterator(volume: Volume): LocationIterator;
getLoci(pickingId: PickingId, volume: Volume, props: PD.Values<P>, id: number): Loci;
eachLocation(loci: Loci, volume: Volume, props: PD.Values<P>, apply: (interval: Interval) => boolean): boolean;
setUpdateState(state: VisualUpdateState, volume: Volume, newProps: PD.Values<P>, currentProps: PD.Values<P>, newTheme: Theme, currentTheme: Theme): void;
mustRecreate?: (volume: Volume, props: PD.Values<P>) => boolean;
dispose?: (geometry: G) => void;
}
interface VolumeVisualGeometryBuilder<P extends VolumeParams, G extends Geometry> extends VolumeVisualBuilder<P, G> {
geometryUtils: GeometryUtils<G>;
}
export declare function VolumeVisual<G extends Geometry, P extends VolumeParams & Geometry.Params<G>>(builder: VolumeVisualGeometryBuilder<P, G>, materialId: number): VolumeVisual<P>;
export interface VolumeRepresentation<P extends VolumeParams> extends Representation<Volume, P> {
}
export declare type VolumeRepresentationProvider<P extends VolumeParams, Id extends string = string> = RepresentationProvider<Volume, P, Representation.State, Id>;
export declare function VolumeRepresentationProvider<P extends VolumeParams, Id extends string>(p: VolumeRepresentationProvider<P, Id>): VolumeRepresentationProvider<P, Id>;
export declare const VolumeParams: {
alpha: PD.Numeric;
quality: PD.Select<"custom" | "auto" | "highest" | "higher" | "high" | "medium" | "low" | "lower" | "lowest">;
};
export declare type VolumeParams = typeof VolumeParams;
export declare function VolumeRepresentation<P extends VolumeParams>(label: string, ctx: RepresentationContext, getParams: RepresentationParamsGetter<Volume, P>, visualCtor: (materialId: number, volume: Volume, props: PD.Values<P>, webgl?: WebGLContext) => VolumeVisual<P>, getLoci: (volume: Volume, props: PD.Values<P>) => Loci): VolumeRepresentation<P>;
export {};