UNPKG

@rcsb/rcsb-saguaro-3d

Version:
91 lines (90 loc) 5.72 kB
import { SaguaroChain, SaguaroPosition, SaguaroRange, ViewerActionManagerInterface, ViewerModelMapManagerInterface } from "../../StructureViewerInterface"; import { Viewer } from "@rcsb/rcsb-molstar/build/src/viewer"; import { DataContainer } from "../../../Utils/DataContainer"; import { ColorTheme } from "molstar/lib/mol-theme/color"; import { StructureRepresentationRegistry } from "molstar/lib/mol-repr/structure/registry"; import { PresetProps } from "@rcsb/rcsb-molstar/build/src/viewer/helpers/preset"; import { Mat4 } from "molstar/lib/mol-math/linear-algebra"; import { BuiltInTrajectoryFormat } from "molstar/lib/mol-plugin-state/formats/trajectory"; import { PluginState } from "molstar/lib/mol-plugin/state"; import { TrajectoryHierarchyPresetProvider } from "molstar/lib/mol-plugin-state/builder/structure/hierarchy-preset"; import { StateObject, StateObjectSelector } from "molstar/lib/mol-state"; import { PluginStateObject } from "molstar/lib/mol-plugin-state/objects"; import { StateTransformer } from "molstar/lib/mol-state/transformer"; import { StructureRepresentationPresetProvider } from "molstar/lib/mol-plugin-state/builder/structure/representation-preset"; export declare enum LoadMethod { loadPdbId = "loadPdbId", loadStructureFromUrl = "loadStructureFromUrl", loadSnapshotFromUrl = "loadSnapshotFromUrl", loadStructureFromData = "loadStructureFromData" } export interface LoadMolstarInterface<P, L> { loadMethod: LoadMethod; loadParams: LoadParams<P, L>; } export type LoadMolstarReturnType = { model?: StateObjectSelector<PluginStateObject.Molecule.Model, StateTransformer<StateObject<any, StateObject.Type<any>>, StateObject<any, StateObject.Type<any>>, any>>; modelProperties?: StateObjectSelector<PluginStateObject.Molecule.Model, StateTransformer<StateObject<any, StateObject.Type<any>>, StateObject<any, StateObject.Type<any>>, any>>; structure?: StateObjectSelector<PluginStateObject.Molecule.Structure, StateTransformer<StateObject<any, StateObject.Type<any>>, StateObject<any, StateObject.Type<any>>, any>>; structureProperties?: StateObjectSelector<PluginStateObject.Molecule.Structure, StateTransformer<StateObject<any, StateObject.Type<any>>, StateObject<any, StateObject.Type<any>>, any>>; representation?: StructureRepresentationPresetProvider.Result; }; interface LoadParams<P, L> { entryId?: string; props?: PresetProps; matrix?: Mat4; url?: string; format?: BuiltInTrajectoryFormat; isBinary?: boolean; type?: PluginState.SnapshotType; data?: string | number[]; id?: string; reprProvider?: TrajectoryHierarchyPresetProvider<P, L>; params?: P; } export declare class MolstarActionManager<P, L> implements ViewerActionManagerInterface<LoadMolstarInterface<P, L>, L> { private readonly viewer; private readonly innerSelectionFlag; private readonly innerReprChangeFlag; private readonly modelMapManager; private readonly loadingFlag; constructor(config: { viewer: Viewer; modelMapManager: ViewerModelMapManagerInterface<LoadMolstarInterface<P, L>, L>; innerSelectionFlag: DataContainer<boolean>; innerReprChangeFlag: DataContainer<boolean>; loadingFlag: DataContainer<boolean>; }); load(loadConfig: LoadMolstarInterface<P, L>): Promise<L | undefined>; load(loadConfig: LoadMolstarInterface<P, L>[]): Promise<(L | undefined)[]>; removeStructure(loadConfig: LoadMolstarInterface<P, L> | Array<LoadMolstarInterface<P, L>>): Promise<void>; select(modelId: string, labelAsymId: string, begin: number, end: number, mode: 'select' | 'hover', operation: 'add' | 'set', operatorName?: string): void; select(selection: Array<SaguaroPosition>, mode: 'select' | 'hover', operation: 'add' | 'set'): void; select(selection: Array<SaguaroRange>, mode: 'select' | 'hover', operation: 'add' | 'set'): void; private selectRange; private selectSet; private selectMultipleRanges; clear(): Promise<void>; clearSelection(mode: 'select' | 'hover', option?: SaguaroChain): void; setFocus(modelId: string, labelAsymId: string, begin: number, end: number, operatorName?: string): void; clearFocus(): void; cameraFocus(modelId: string, labelAsymId: string, positions: Array<number>, operatorName?: string): void; cameraFocus(modelId: string, labelAsymId: string, begin: number, end: number, operatorName?: string): void; private focusRange; private focusPositions; createComponent(componentLabel: string, modelId: string, labelAsymId: string, begin: number, end: number, representationType: StructureRepresentationRegistry.BuiltIn, operatorName?: string): Promise<void>; createComponent(componentLabel: string, modelId: string, labelAsymId: string, representationType: StructureRepresentationRegistry.BuiltIn, operatorName?: string): Promise<void>; createComponent(componentLabel: string, residues: Array<SaguaroPosition>, representationType: StructureRepresentationRegistry.BuiltIn): Promise<void>; createComponent(componentLabel: string, residues: Array<SaguaroRange>, representationType: StructureRepresentationRegistry.BuiltIn): Promise<void>; isComponent(componentLabel: string): boolean; colorComponent(componentLabel: string, color: ColorTheme.BuiltIn): Promise<void>; getComponentSet(): Set<string>; removeComponent(componentLabel?: string): Promise<void>; displayComponent(componentLabel: string): boolean; displayComponent(componentLabel: string, visibilityFlag: boolean): void; private changeComponentDisplay; private getComponentDisplay; resetCamera(): void; exportLoadedStructures(): Promise<void>; } export {};