UNPKG

molstar

Version:

A comprehensive macromolecular library.

122 lines (121 loc) 4.5 kB
/** * Copyright (c) 2018-2025 mol* contributors, licensed under MIT, See LICENSE file for more info. * * @author Alexander Rose <alexander.rose@weirdbyte.de> * @author Zhenyu Zhang <jump2cn@gmail.com> * @author Gianluca Tomasello <giagitom@gmail.com> * @author David Sehnal <david.sehnal@gmail.com> * @author Herman Bergwerf <post@hbergwerf.nl> */ import { Vec3 } from '../../../../mol-math/linear-algebra'; import { ParamDefinition as PD } from '../../../../mol-util/param-definition'; import { Mesh } from '../../../../mol-geo/geometry/mesh/mesh'; import { MeshBuilder } from '../../../../mol-geo/geometry/mesh/mesh-builder'; import { VisualContext } from '../../../visual'; import { Lines } from '../../../../mol-geo/geometry/lines/lines'; import { Cylinders } from '../../../../mol-geo/geometry/cylinders/cylinders'; import { Sphere3D } from '../../../../mol-math/geometry/primitives/sphere3d'; export declare const LinkCylinderParams: { linkScale: PD.Numeric; linkSpacing: PD.Numeric; linkCap: PD.BooleanParam; aromaticScale: PD.Numeric; aromaticSpacing: PD.Numeric; aromaticDashCount: PD.Numeric; dashCount: PD.Numeric; dashScale: PD.Numeric; dashCap: PD.BooleanParam; stubCap: PD.BooleanParam; radialSegments: PD.Numeric; colorMode: PD.Select<"default" | "interpolate">; }; export declare const DefaultLinkCylinderProps: PD.Values<{ linkScale: PD.Numeric; linkSpacing: PD.Numeric; linkCap: PD.BooleanParam; aromaticScale: PD.Numeric; aromaticSpacing: PD.Numeric; aromaticDashCount: PD.Numeric; dashCount: PD.Numeric; dashScale: PD.Numeric; dashCap: PD.BooleanParam; stubCap: PD.BooleanParam; radialSegments: PD.Numeric; colorMode: PD.Select<"default" | "interpolate">; }>; export type LinkCylinderProps = typeof DefaultLinkCylinderProps; export declare const LinkLineParams: { linkScale: PD.Numeric; linkSpacing: PD.Numeric; aromaticDashCount: PD.Numeric; dashCount: PD.Numeric; }; export declare const DefaultLinkLineProps: PD.Values<{ linkScale: PD.Numeric; linkSpacing: PD.Numeric; aromaticDashCount: PD.Numeric; dashCount: PD.Numeric; }>; export type LinkLineProps = typeof DefaultLinkLineProps; /** Calculate 'shift' direction that is perpendiculat to v1 - v2 and goes through v3 */ export declare function calculateShiftDir(out: Vec3, v1: Vec3, v2: Vec3, v3: Vec3 | null): Vec3; export interface LinkBuilderProps { linkCount: number; position: (posA: Vec3, posB: Vec3, edgeIndex: number, adjust: boolean) => void; radius: (edgeIndex: number) => number; referencePosition?: (edgeIndex: number) => Vec3 | null; style?: (edgeIndex: number) => LinkStyle; ignore?: (edgeIndex: number) => boolean; stub?: (edgeIndex: number) => boolean; } export declare const EmptyLinkBuilderProps: LinkBuilderProps; export declare const enum LinkStyle { Solid = 0, Dashed = 1, Double = 2, OffsetDouble = 3, Triple = 4, OffsetTriple = 5, Disk = 6, Aromatic = 7, MirroredAromatic = 8 } /** * Each edge is included twice to allow for coloring/picking * the half closer to the first vertex, i.e. vertex a. */ export declare function createLinkCylinderMesh(ctx: VisualContext, linkBuilder: LinkBuilderProps, props: LinkCylinderProps, mesh?: Mesh): { mesh: Mesh; boundingSphere?: Sphere3D; }; export interface AddLinkOptions { builderState: MeshBuilder.State; props: LinkCylinderProps; assignNonAdjustedPosition?: (posA: Vec3, posB: Vec3) => void; referencePosition?: () => Vec3 | null; } export interface AddLinkParams { linkStub: boolean; linkRadius: number; linkStyle: LinkStyle; a: Vec3; b: Vec3; group: number; } export declare function addLinkCylinderMesh(options: AddLinkOptions, params: AddLinkParams): void; /** * Each edge is included twice to allow for coloring/picking * the half closer to the first vertex, i.e. vertex a. */ export declare function createLinkCylinderImpostors(ctx: VisualContext, linkBuilder: LinkBuilderProps, props: LinkCylinderProps, cylinders?: Cylinders): { cylinders: Cylinders; boundingSphere?: Sphere3D; }; /** * Each edge is included twice to allow for coloring/picking * the half closer to the first vertex, i.e. vertex a. */ export declare function createLinkLines(ctx: VisualContext, linkBuilder: LinkBuilderProps, props: LinkLineProps, lines?: Lines): { lines: Lines; boundingSphere?: Sphere3D; };