UNPKG

molstar

Version:

A comprehensive macromolecular library.

71 lines (70 loc) 3.98 kB
/** * Copyright (c) 2018-2025 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 type VolumeKey = { volume: Volume; key: number; }; export interface VolumeVisual<P extends VolumeParams> extends Visual<VolumeKey, P> { } interface VolumeVisualBuilder<P extends VolumeParams, G extends Geometry> { defaultProps: PD.Values<P>; createGeometry(ctx: VisualContext, volume: Volume, key: number, theme: Theme, props: PD.Values<P>, geometry?: G): Promise<G> | G; createLocationIterator(volume: Volume, key: number): LocationIterator; getLoci(pickingId: PickingId, volume: Volume, key: number, props: PD.Values<P>, id: number): Loci; eachLocation(loci: Loci, volume: Volume, key: number, 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?: (volumeKey: VolumeKey, 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 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<"auto" | "medium" | "high" | "low" | "custom" | "highest" | "higher" | "lower" | "lowest">; material: PD.Group<PD.Normalize<{ metalness: number; roughness: number; bumpiness: number; }>>; clip: PD.Group<PD.Normalize<{ variant: import("../../mol-util/clip").Clip.Variant; objects: PD.Normalize<{ type: /*elided*/ any; invert: /*elided*/ any; position: /*elided*/ any; rotation: /*elided*/ any; scale: /*elided*/ any; transform: /*elided*/ any; }>[]; }>>; emissive: PD.Numeric; density: PD.Numeric; instanceGranularity: PD.BooleanParam; lod: PD.Vec3; cellSize: PD.Numeric; batchSize: PD.Numeric; }; export type VolumeParams = typeof VolumeParams; export declare function VolumeRepresentation<P extends VolumeParams>(label: string, ctx: RepresentationContext, getParams: RepresentationParamsGetter<Volume, P>, visualCtor: (materialId: number, volume: Volume, key: number, props: PD.Values<P>, webgl?: WebGLContext) => VolumeVisual<P>, getLoci: (volume: Volume, props: PD.Values<P>) => Loci, getKeys?: (props: PD.Values<P>) => ArrayLike<number>): VolumeRepresentation<P>; export {};