UNPKG

molstar

Version:

A comprehensive macromolecular library.

99 lines (98 loc) 3.7 kB
/** * Copyright (c) 2018-2021 mol* contributors, licensed under MIT, See LICENSE file for more info. * * @author Alexander Rose <alexander.rose@weirdbyte.de> */ 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 { 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; }; 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; }>; export declare 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 declare 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) => 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 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; }; /** * 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; };