diff --git a/README.md b/README.md index 888aafbe96f2f40f68004d110642eaf7de32a811..4a7966fc35b4431ba72406d172a4f47042a2a2c7 100644 --- a/README.md +++ b/README.md @@ -19,9 +19,10 @@ The core of Mol* currently consists of these modules: - `mol-model` Data structures and algorithms (such as querying) for representing molecular data (including coordinate, experimental/map, and annotation data). - `mol-model-props` Common "custom properties". - `mol-script` A scriting language for creating representations/scenes and querying (includes the [MolQL query language](https://molql.github.io)). -- `mol-geo` Creating molecular geometries. +- `mol-geo` Creating (molecular) geometries. - `mol-theme` Molecular representation themeing. -- `mol-gl` A lightweight wrapper around WebGL. +- `mol-repr` Molecular representations. +- `mol-gl` A wrapper around WebGL. - `mol-canvas3d` A low level 3d view component. Uses `mol-geo` to generate geometries. - `mol-state` State representation tree with state saving and automatic updates. - `mol-app` Components for builduing UIs. diff --git a/package.json b/package.json index c3d686a95f3b090aab06a8db8d32c98b2cb37e2f..2a8e33f0618a18dee2d3a64009f085d4f5e82f8b 100644 --- a/package.json +++ b/package.json @@ -52,17 +52,18 @@ "mol-app($|/.*)": "<rootDir>/src/mol-app$1", "mol-data($|/.*)": "<rootDir>/src/mol-data$1", "mol-geo($|/.*)": "<rootDir>/src/mol-geo$1", - "mol-theme($|/.*)": "<rootDir>/src/mol-theme$1", "mol-gl($|/.*)": "<rootDir>/src/mol-gl$1", "mol-io($|/.*)": "<rootDir>/src/mol-io$1", "mol-math($|/.*)": "<rootDir>/src/mol-math$1", "mol-model($|/.*)": "<rootDir>/src/mol-model$1", "mol-model-props($|/.*)": "<rootDir>/src/mol-model-props$1", + "mol-plugin($|/.*)": "<rootDir>/src/mol-plugin$1", "mol-ql($|/.*)": "<rootDir>/src/mol-ql$1", + "mol-repr($|/.*)": "<rootDir>/src/mol-repr$1", "mol-script($|/.*)": "<rootDir>/src/mol-script$1", - "mol-task($|/.*)": "<rootDir>/src/mol-task$1", "mol-state($|/.*)": "<rootDir>/src/mol-state$1", - "mol-plugin($|/.*)": "<rootDir>/src/mol-plugin$1", + "mol-task($|/.*)": "<rootDir>/src/mol-task$1", + "mol-theme($|/.*)": "<rootDir>/src/mol-theme$1", "mol-util($|/.*)": "<rootDir>/src/mol-util$1", "mol-canvas3d($|/.*)": "<rootDir>/src/mol-canvas3d$1" }, diff --git a/src/apps/canvas/component/representation.tsx b/src/apps/canvas/component/representation.tsx index cca0ca103bb3e0c91eec71aea8445e02073e2bd9..02fcdea19363ea0b39cc1db364d986908efd46a0 100644 --- a/src/apps/canvas/component/representation.tsx +++ b/src/apps/canvas/component/representation.tsx @@ -8,7 +8,7 @@ import * as React from 'react' import Canvas3D from 'mol-canvas3d/canvas3d'; import { App } from '../app'; import { Params } from 'mol-util/parameter'; -import { Representation } from 'mol-geo/representation'; +import { Representation } from 'mol-repr'; import { ParametersComponent } from 'mol-app/component/parameters'; import { ColorTheme } from 'mol-theme/color'; import { getColorThemeProps } from 'mol-geo/geometry/color-data'; diff --git a/src/apps/canvas/component/structure-view.tsx b/src/apps/canvas/component/structure-view.tsx index d987ec1fe9e5a0839d243c4855bc03253b06ef9b..9b8fd7d785b34911588028d951b22b6224668994 100644 --- a/src/apps/canvas/component/structure-view.tsx +++ b/src/apps/canvas/component/structure-view.tsx @@ -6,9 +6,9 @@ import * as React from 'react' import { StructureView } from '../structure-view'; -import { StructureRepresentation } from 'mol-geo/representation/structure'; import { RepresentationComponent } from './representation'; -import { Representation } from 'mol-geo/representation'; +import { Representation } from 'mol-repr'; +import { StructureRepresentation } from 'mol-repr/structure/index'; export interface StructureViewComponentProps { structureView: StructureView diff --git a/src/apps/canvas/component/volume-view.tsx b/src/apps/canvas/component/volume-view.tsx index d7b596500b82a4b8f2465b7f313acf950dcf0502..159a0d2176dc108377d34cfa1147038d75bbb852 100644 --- a/src/apps/canvas/component/volume-view.tsx +++ b/src/apps/canvas/component/volume-view.tsx @@ -6,9 +6,9 @@ import * as React from 'react' import { RepresentationComponent } from './representation'; -import { Representation } from 'mol-geo/representation'; +import { Representation } from 'mol-repr'; import { VolumeView } from '../volume-view'; -import { VolumeRepresentation } from 'mol-geo/representation/volume'; +import { VolumeRepresentation } from 'mol-repr/volume/index'; export interface VolumeViewComponentProps { volumeView: VolumeView diff --git a/src/apps/canvas/structure-view.ts b/src/apps/canvas/structure-view.ts index 6d2313897c0aa3e7dbc00f2c6257848083295541..80bcac4134052e676c5ef77439c9131291fdb244 100644 --- a/src/apps/canvas/structure-view.ts +++ b/src/apps/canvas/structure-view.ts @@ -5,27 +5,27 @@ */ import { Model, Structure } from 'mol-model/structure'; -import { CartoonRepresentation } from 'mol-geo/representation/structure/representation/cartoon'; -import { BallAndStickRepresentation } from 'mol-geo/representation/structure/representation/ball-and-stick'; import { getStructureFromModel } from './util'; import { AssemblySymmetry } from 'mol-model-props/rcsb/symmetry'; -import { ShapeRepresentation, ShapeProps } from 'mol-geo/representation/shape'; import { getAxesShape } from './assembly-symmetry'; import Canvas3D from 'mol-canvas3d/canvas3d'; -import { CarbohydrateRepresentation } from 'mol-geo/representation/structure/representation/carbohydrate'; // import { MeshBuilder } from 'mol-geo/mesh/mesh-builder'; // import { addSphere } from 'mol-geo/mesh/builder/sphere'; // import { Shape } from 'mol-model/shape'; // import { Color } from 'mol-util/color'; // import { computeUnitBoundary } from 'mol-model/structure/structure/util/boundary'; // import { addBoundingBox } from 'mol-geo/mesh/builder/bounding-box'; -import { PointRepresentation } from 'mol-geo/representation/structure/representation/point'; -import { StructureRepresentation } from 'mol-geo/representation/structure'; import { BehaviorSubject } from 'rxjs'; -import { SpacefillRepresentation } from 'mol-geo/representation/structure/representation/spacefill'; -import { DistanceRestraintRepresentation } from 'mol-geo/representation/structure/representation/distance-restraint'; -import { MolecularSurfaceRepresentation } from 'mol-geo/representation/structure/representation/molecular-surface'; import { App } from './app'; +import { StructureRepresentation } from 'mol-repr/structure/index'; +import { ShapeRepresentation, ShapeProps } from 'mol-repr/shape/index'; +import { CartoonRepresentation } from 'mol-repr/structure/representation/cartoon'; +import { MolecularSurfaceRepresentation } from 'mol-repr/structure/representation/molecular-surface'; +import { PointRepresentation } from 'mol-repr/structure/representation/point'; +import { BallAndStickRepresentation } from 'mol-repr/structure/representation/ball-and-stick'; +import { CarbohydrateRepresentation } from 'mol-repr/structure/representation/carbohydrate'; +import { SpacefillRepresentation } from 'mol-repr/structure/representation/spacefill'; +import { DistanceRestraintRepresentation } from 'mol-repr/structure/representation/distance-restraint'; export interface StructureView { readonly app: App diff --git a/src/apps/canvas/volume-view.ts b/src/apps/canvas/volume-view.ts index 0f17a5c9db43bf3019b4946365e97eedd04a967b..bfe46d0e444d3047eea21886908b1d1b7ffba373 100644 --- a/src/apps/canvas/volume-view.ts +++ b/src/apps/canvas/volume-view.ts @@ -8,9 +8,9 @@ import Canvas3D from 'mol-canvas3d/canvas3d'; import { BehaviorSubject } from 'rxjs'; import { App } from './app'; import { VolumeData } from 'mol-model/volume'; -import { VolumeRepresentation } from 'mol-geo/representation/volume'; -import { IsosurfaceRepresentation } from 'mol-geo/representation/volume/isosurface-mesh'; -import { DirectVolumeRepresentation } from 'mol-geo/representation/volume/direct-volume'; +import { VolumeRepresentation } from 'mol-repr/volume/index'; +import { IsosurfaceRepresentation } from 'mol-repr/volume/isosurface-mesh'; +import { DirectVolumeRepresentation } from 'mol-repr/volume/direct-volume'; export interface VolumeView { readonly app: App diff --git a/src/apps/structure-info/volume.ts b/src/apps/structure-info/volume.ts index 790d4f8a91979cdb2767550ee4ad6c4f264b2946..cef34b843df44abd69285594d324c16b91c4465f 100644 --- a/src/apps/structure-info/volume.ts +++ b/src/apps/structure-info/volume.ts @@ -13,9 +13,9 @@ import { downloadCif } from './helpers' import CIF from 'mol-io/reader/cif' import { DensityServer_Data_Database } from 'mol-io/reader/cif/schema/density-server'; import { Table } from 'mol-data/db'; -import { createVolumeSurface } from 'mol-geo/representation/volume/isosurface-mesh'; import { StringBuilder } from 'mol-util'; import { Task } from 'mol-task'; +import { createVolumeSurface } from 'mol-repr/volume/isosurface-mesh'; require('util.promisify').shim(); const writeFileAsync = util.promisify(fs.writeFile); diff --git a/src/mol-canvas3d/canvas3d.ts b/src/mol-canvas3d/canvas3d.ts index 78befa72d895ba5a282d520e458bba73d803863c..0d21ff0bebd0beaaf279e0a18f2b6c0bb5562fc6 100644 --- a/src/mol-canvas3d/canvas3d.ts +++ b/src/mol-canvas3d/canvas3d.ts @@ -16,7 +16,7 @@ import TrackballControls from './controls/trackball' import { Viewport } from './camera/util' import { resizeCanvas } from './util'; import { createContext, getGLContext, WebGLContext } from 'mol-gl/webgl/context'; -import { Representation } from 'mol-geo/representation'; +import { Representation } from 'mol-repr'; import { createRenderTarget } from 'mol-gl/webgl/render-target'; import Scene from 'mol-gl/scene'; import { RenderVariant } from 'mol-gl/webgl/render-item'; diff --git a/src/mol-plugin/state/objects.ts b/src/mol-plugin/state/objects.ts index 6550334a3c43ba9db8f3c1516dc94fcc35b51300..c5082458aeec58b855edbfa6d5e81a7e526e4c30 100644 --- a/src/mol-plugin/state/objects.ts +++ b/src/mol-plugin/state/objects.ts @@ -7,7 +7,7 @@ import { PluginStateObject } from './base'; import { CifFile } from 'mol-io/reader/cif'; import { Model as _Model, Structure as _Structure } from 'mol-model/structure' -import { StructureRepresentation } from 'mol-geo/representation/structure'; +import { StructureRepresentation } from 'mol-repr/structure/index'; const _create = PluginStateObject.Create diff --git a/src/mol-plugin/state/transforms/visuals.ts b/src/mol-plugin/state/transforms/visuals.ts index b1c521865dadc512fb63915ed93f1fc225edc84f..9da25b631f8e6a6d03a2408c82d5fcc8c9d17a6b 100644 --- a/src/mol-plugin/state/transforms/visuals.ts +++ b/src/mol-plugin/state/transforms/visuals.ts @@ -4,11 +4,11 @@ * @author David Sehnal <david.sehnal@gmail.com> */ -import { CartoonRepresentation, DefaultCartoonProps } from 'mol-geo/representation/structure/representation/cartoon'; import { Transformer } from 'mol-state'; import { Task } from 'mol-task'; import { PluginStateTransform } from '../base'; import { PluginStateObjects as SO } from '../objects'; +import { CartoonRepresentation, DefaultCartoonProps } from 'mol-repr/structure/representation/cartoon'; export const CreateStructureRepresentation = PluginStateTransform.Create<SO.Structure, SO.StructureRepresentation3D, { }>({ name: 'create-structure-representation', diff --git a/src/mol-geo/representation/index.ts b/src/mol-repr/index.ts similarity index 90% rename from src/mol-geo/representation/index.ts rename to src/mol-repr/index.ts index e9ca9e4c26f503cf30a186fa3e4fbf96394c1ce7..447aba5461ffe173aa1c476dbb8ffc27e8fac8b1 100644 --- a/src/mol-geo/representation/index.ts +++ b/src/mol-repr/index.ts @@ -6,9 +6,9 @@ import { Task, RuntimeContext } from 'mol-task' import { RenderObject } from 'mol-gl/render-object' -import { PickingId } from '../geometry/picking'; +import { PickingId } from '../mol-geo/geometry/picking'; import { Loci } from 'mol-model/loci'; -import { MarkerAction } from '../geometry/marker-data'; +import { MarkerAction } from '../mol-geo/geometry/marker-data'; import { Params } from 'mol-util/parameter'; export interface RepresentationProps {} diff --git a/src/mol-geo/representation/structure/visual/polymer-backbone-sphere.ts b/src/mol-repr/shape.ts similarity index 100% rename from src/mol-geo/representation/structure/visual/polymer-backbone-sphere.ts rename to src/mol-repr/shape.ts diff --git a/src/mol-geo/representation/shape/index.ts b/src/mol-repr/shape/index.ts similarity index 91% rename from src/mol-geo/representation/shape/index.ts rename to src/mol-repr/shape/index.ts index 529b67b8d78047da60a2177e1d8fdac288b6ad80..a953f8ecc75edb35c2504a38412bfe3372fea80c 100644 --- a/src/mol-geo/representation/shape/index.ts +++ b/src/mol-repr/shape/index.ts @@ -7,18 +7,18 @@ import { Task } from 'mol-task' import { RenderObject, createMeshRenderObject, MeshRenderObject } from 'mol-gl/render-object'; import { RepresentationProps, Representation } from '..'; -import { PickingId } from '../../geometry/picking'; import { Loci, EmptyLoci, isEveryLoci } from 'mol-model/loci'; -import { MarkerAction, applyMarkerAction } from '../../geometry/marker-data'; import { ValueCell } from 'mol-util'; import { ColorThemeName, ColorThemeOptions } from 'mol-theme/color'; import { Shape } from 'mol-model/shape'; -import { LocationIterator } from '../../util/location-iterator'; import { OrderedSet, Interval } from 'mol-data/int'; -import { createIdentityTransform } from '../../geometry/transform-data'; -import { createRenderableState } from '../../geometry/geometry'; -import { Mesh } from '../../geometry/mesh/mesh'; import { paramDefaultValues, SelectParam } from 'mol-util/parameter'; +import { Mesh } from 'mol-geo/geometry/mesh/mesh'; +import { createIdentityTransform } from 'mol-geo/geometry/transform-data'; +import { createRenderableState } from 'mol-geo/geometry/geometry'; +import { PickingId } from 'mol-geo/geometry/picking'; +import { MarkerAction, applyMarkerAction } from 'mol-geo/geometry/marker-data'; +import { LocationIterator } from 'mol-geo/util/location-iterator'; export interface ShapeRepresentation<P extends RepresentationProps = {}> extends Representation<Shape, P> { } diff --git a/src/mol-repr/structure.ts b/src/mol-repr/structure.ts new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/mol-geo/representation/structure/complex-representation.ts b/src/mol-repr/structure/complex-representation.ts similarity index 92% rename from src/mol-geo/representation/structure/complex-representation.ts rename to src/mol-repr/structure/complex-representation.ts index cf59bb872b50a527109d3eabeb41cdc8b6bbeda9..77dc1ac957bf8bdc3f8697fe096748ae47746ed2 100644 --- a/src/mol-geo/representation/structure/complex-representation.ts +++ b/src/mol-repr/structure/complex-representation.ts @@ -7,11 +7,11 @@ import { Structure } from 'mol-model/structure'; import { Task } from 'mol-task' -import { PickingId } from '../../geometry/picking'; import { Loci, EmptyLoci } from 'mol-model/loci'; -import { MarkerAction } from '../../geometry/marker-data'; -import { StructureProps, StructureRepresentation, StructureParams } from '.'; +import { StructureProps, StructureRepresentation, StructureParams } from './index'; import { ComplexVisual } from './complex-visual'; +import { PickingId } from 'mol-geo/geometry/picking'; +import { MarkerAction } from 'mol-geo/geometry/marker-data'; export function ComplexRepresentation<P extends StructureProps>(label: string, visualCtor: () => ComplexVisual<P>): StructureRepresentation<P> { let visual: ComplexVisual<P> | undefined diff --git a/src/mol-geo/representation/structure/complex-visual.ts b/src/mol-repr/structure/complex-visual.ts similarity index 94% rename from src/mol-geo/representation/structure/complex-visual.ts rename to src/mol-repr/structure/complex-visual.ts index aac01779c41a402b9e710bda94e7d9390152a064..a07cc0ded2c3bedd23a0a9b0806240a057277ace 100644 --- a/src/mol-geo/representation/structure/complex-visual.ts +++ b/src/mol-repr/structure/complex-visual.ts @@ -7,21 +7,21 @@ import { Structure } from 'mol-model/structure'; import { Visual } from '..'; import { MeshRenderObject, LinesRenderObject, PointsRenderObject, DirectVolumeRenderObject } from 'mol-gl/render-object'; -import { Mesh } from '../../geometry/mesh/mesh'; import { RuntimeContext } from 'mol-task'; -import { LocationIterator } from '../../util/location-iterator'; import { createComplexMeshRenderObject, sizeChanged, colorChanged, UnitKind, UnitKindOptions } from './visual/util/common'; -import { StructureProps, VisualUpdateState, StructureMeshParams, StructureParams } from '.'; +import { StructureProps, VisualUpdateState, StructureMeshParams, StructureParams } from './index'; import { deepEqual, ValueCell } from 'mol-util'; -import { PickingId } from '../../geometry/picking'; import { Loci, isEveryLoci, EmptyLoci } from 'mol-model/loci'; -import { MarkerAction, applyMarkerAction } from '../../geometry/marker-data'; import { Interval } from 'mol-data/int'; -import { updateRenderableState, Geometry } from '../../geometry/geometry'; -import { createColors } from '../../geometry/color-data'; import { MultiSelectParam, paramDefaultValues } from 'mol-util/parameter'; import { RenderableValues } from 'mol-gl/renderable/schema'; import { createSizes } from 'mol-geo/geometry/size-data'; +import { Geometry, updateRenderableState } from 'mol-geo/geometry/geometry'; +import { LocationIterator } from 'mol-geo/util/location-iterator'; +import { PickingId } from 'mol-geo/geometry/picking'; +import { createColors } from 'mol-geo/geometry/color-data'; +import { MarkerAction, applyMarkerAction } from 'mol-geo/geometry/marker-data'; +import { Mesh } from 'mol-geo/geometry/mesh/mesh'; export interface ComplexVisual<P extends StructureProps> extends Visual<Structure, P> { } diff --git a/src/mol-geo/representation/structure/index.ts b/src/mol-repr/structure/index.ts similarity index 87% rename from src/mol-geo/representation/structure/index.ts rename to src/mol-repr/structure/index.ts index d58caef4549e1bb1c98dfff2a1aff0616ee0cd56..07692cf84a17f3c068f1eefb8673d18b28583c36 100644 --- a/src/mol-geo/representation/structure/index.ts +++ b/src/mol-repr/structure/index.ts @@ -9,15 +9,18 @@ import { Structure } from 'mol-model/structure'; import { ColorThemeName, ColorThemeOptions } from 'mol-theme/color'; import { SizeThemeName, SizeThemeOptions } from 'mol-theme/size'; import { Representation, RepresentationProps } from '..'; -import { Geometry } from '../../geometry/geometry'; -import { Mesh } from '../../geometry/mesh/mesh'; -import { Points } from '../../geometry/points/points'; -import { Lines } from '../../geometry/lines/lines'; import { SelectParam, paramDefaultValues } from 'mol-util/parameter'; -import { DirectVolume } from '../../geometry/direct-volume/direct-volume'; +import { Geometry } from 'mol-geo/geometry/geometry'; +import { Mesh } from 'mol-geo/geometry/mesh/mesh'; +import { Points } from 'mol-geo/geometry/points/points'; +import { Lines } from 'mol-geo/geometry/lines/lines'; +import { DirectVolume } from 'mol-geo/geometry/direct-volume/direct-volume'; export interface StructureRepresentation<P extends RepresentationProps = {}> extends Representation<Structure, P> { } +// export interface StructureVisual<P extends RepresentationProps = {}> extends Visual<Structure, P> { } + + export const StructureParams = { ...Geometry.Params, colorTheme: SelectParam<ColorThemeName>('Color Theme', '', 'polymer-index', ColorThemeOptions), diff --git a/src/mol-geo/representation/structure/representation/backbone.ts b/src/mol-repr/structure/representation/backbone.ts similarity index 89% rename from src/mol-geo/representation/structure/representation/backbone.ts rename to src/mol-repr/structure/representation/backbone.ts index ecfa4da0454e3e770b62462e23dd27fdf36724fb..8c82b62289b13e8f36d1e458eda2cae6cd628350 100644 --- a/src/mol-geo/representation/structure/representation/backbone.ts +++ b/src/mol-repr/structure/representation/backbone.ts @@ -4,15 +4,16 @@ * @author Alexander Rose <alexander.rose@weirdbyte.de> */ -import { StructureRepresentation, UnitsRepresentation } from '..'; -import { PickingId } from '../../../geometry/picking'; import { Structure } from 'mol-model/structure'; import { Task } from 'mol-task'; import { Loci } from 'mol-model/loci'; -import { MarkerAction } from '../../../geometry/marker-data'; import { PolymerBackboneVisual, PolymerBackboneParams } from '../visual/polymer-backbone-cylinder'; import { getQualityProps } from '../../util'; import { paramDefaultValues } from 'mol-util/parameter'; +import { UnitsRepresentation } from '../units-representation'; +import { PickingId } from 'mol-geo/geometry/picking'; +import { MarkerAction } from 'mol-geo/geometry/marker-data'; +import { StructureRepresentation } from '../index'; export const BackboneParams = { ...PolymerBackboneParams diff --git a/src/mol-geo/representation/structure/representation/ball-and-stick.ts b/src/mol-repr/structure/representation/ball-and-stick.ts similarity index 92% rename from src/mol-geo/representation/structure/representation/ball-and-stick.ts rename to src/mol-repr/structure/representation/ball-and-stick.ts index c66376dafe6e723f682efe9f0bed2fb70e7d3540..493815b9cba8150ce7cad4961716c8d249ae3b28 100644 --- a/src/mol-geo/representation/structure/representation/ball-and-stick.ts +++ b/src/mol-repr/structure/representation/ball-and-stick.ts @@ -4,19 +4,21 @@ * @author Alexander Rose <alexander.rose@weirdbyte.de> */ -import { ComplexRepresentation, StructureRepresentation, UnitsRepresentation } from '..'; import { ElementSphereVisual, ElementSphereParams } from '../visual/element-sphere'; import { IntraUnitLinkVisual, IntraUnitLinkParams } from '../visual/intra-unit-link-cylinder'; -import { PickingId } from '../../../geometry/picking'; import { Structure } from 'mol-model/structure'; import { Task } from 'mol-task'; import { Loci, isEmptyLoci } from 'mol-model/loci'; -import { MarkerAction } from '../../../geometry/marker-data'; import { InterUnitLinkVisual } from '../visual/inter-unit-link-cylinder'; import { SizeThemeName, SizeThemeOptions } from 'mol-theme/size'; import { getQualityProps } from '../../util'; import { paramDefaultValues, SelectParam, NumberParam, MultiSelectParam } from 'mol-util/parameter'; import { UnitKind, UnitKindOptions } from '../visual/util/common'; +import { UnitsRepresentation } from '../units-representation'; +import { PickingId } from 'mol-geo/geometry/picking'; +import { MarkerAction } from 'mol-geo/geometry/marker-data'; +import { ComplexRepresentation } from '../complex-representation'; +import { StructureRepresentation } from '../index'; export const BallAndStickParams = { ...ElementSphereParams, diff --git a/src/mol-geo/representation/structure/representation/carbohydrate.ts b/src/mol-repr/structure/representation/carbohydrate.ts similarity index 93% rename from src/mol-geo/representation/structure/representation/carbohydrate.ts rename to src/mol-repr/structure/representation/carbohydrate.ts index e9580f4e0e2c0145d048afadbc25c7af961e6be0..4fc4cb1cc3f92f1a1343fa22ffe415857871af44 100644 --- a/src/mol-geo/representation/structure/representation/carbohydrate.ts +++ b/src/mol-repr/structure/representation/carbohydrate.ts @@ -4,17 +4,18 @@ * @author Alexander Rose <alexander.rose@weirdbyte.de> */ -import { ComplexRepresentation, StructureRepresentation } from '..'; -import { PickingId } from '../../../geometry/picking'; import { Structure } from 'mol-model/structure'; import { Task } from 'mol-task'; import { Loci, isEmptyLoci } from 'mol-model/loci'; -import { MarkerAction } from '../../../geometry/marker-data'; import { CarbohydrateSymbolVisual, CarbohydrateSymbolParams } from '../visual/carbohydrate-symbol-mesh'; import { CarbohydrateLinkVisual, CarbohydrateLinkParams } from '../visual/carbohydrate-link-cylinder'; import { SizeThemeName, SizeThemeOptions } from 'mol-theme/size'; import { getQualityProps } from '../../util'; import { paramDefaultValues, SelectParam, NumberParam } from 'mol-util/parameter'; +import { PickingId } from 'mol-geo/geometry/picking'; +import { MarkerAction } from 'mol-geo/geometry/marker-data'; +import { ComplexRepresentation } from '../complex-representation'; +import { StructureRepresentation } from '../index'; export const CarbohydrateParams = { ...CarbohydrateSymbolParams, diff --git a/src/mol-geo/representation/structure/representation/cartoon.ts b/src/mol-repr/structure/representation/cartoon.ts similarity index 94% rename from src/mol-geo/representation/structure/representation/cartoon.ts rename to src/mol-repr/structure/representation/cartoon.ts index 6083f02330a5136166860fbb7a26fcf088951063..b4c5fa65748982b5278e76c3134763dc4916cf8f 100644 --- a/src/mol-geo/representation/structure/representation/cartoon.ts +++ b/src/mol-repr/structure/representation/cartoon.ts @@ -4,18 +4,19 @@ * @author Alexander Rose <alexander.rose@weirdbyte.de> */ -import { StructureRepresentation, UnitsRepresentation } from '..'; -import { PickingId } from '../../../geometry/picking'; import { Structure } from 'mol-model/structure'; import { Task } from 'mol-task'; import { Loci, isEmptyLoci } from 'mol-model/loci'; -import { MarkerAction } from '../../../geometry/marker-data'; import { PolymerTraceVisual, PolymerTraceParams } from '../visual/polymer-trace-mesh'; import { PolymerGapVisual, PolymerGapParams } from '../visual/polymer-gap-cylinder'; import { NucleotideBlockVisual, NucleotideBlockParams } from '../visual/nucleotide-block-mesh'; import { SizeThemeName, SizeThemeOptions } from 'mol-theme/size'; import { getQualityProps } from '../../util'; import { paramDefaultValues, SelectParam, NumberParam } from 'mol-util/parameter'; +import { UnitsRepresentation } from '../units-representation'; +import { PickingId } from 'mol-geo/geometry/picking'; +import { MarkerAction } from 'mol-geo/geometry/marker-data'; +import { StructureRepresentation } from '../index'; // import { PolymerDirectionVisual, DefaultPolymerDirectionProps } from '../visual/polymer-direction-wedge'; export const CartoonParams = { diff --git a/src/mol-geo/representation/structure/representation/distance-restraint.ts b/src/mol-repr/structure/representation/distance-restraint.ts similarity index 91% rename from src/mol-geo/representation/structure/representation/distance-restraint.ts rename to src/mol-repr/structure/representation/distance-restraint.ts index d0f5ef74be21df241d0d8507daec121093bc83ae..aec99db93f07894afb598e066c0123d7a85755df 100644 --- a/src/mol-geo/representation/structure/representation/distance-restraint.ts +++ b/src/mol-repr/structure/representation/distance-restraint.ts @@ -4,16 +4,17 @@ * @author Alexander Rose <alexander.rose@weirdbyte.de> */ -import { ComplexRepresentation, StructureRepresentation } from '..'; -import { PickingId } from '../../../geometry/picking'; import { Structure } from 'mol-model/structure'; import { Task } from 'mol-task'; import { Loci } from 'mol-model/loci'; -import { MarkerAction } from '../../../geometry/marker-data'; import { CrossLinkRestraintVisual, CrossLinkRestraintParams } from '../visual/cross-link-restraint-cylinder'; import { SizeThemeName, SizeThemeOptions } from 'mol-theme/size'; import { getQualityProps } from '../../util'; import { paramDefaultValues, SelectParam, NumberParam } from 'mol-util/parameter'; +import { ComplexRepresentation } from '../complex-representation'; +import { PickingId } from 'mol-geo/geometry/picking'; +import { MarkerAction } from 'mol-geo/geometry/marker-data'; +import { StructureRepresentation } from '../index'; export const DistanceRestraintParams = { ...CrossLinkRestraintParams, diff --git a/src/mol-geo/representation/structure/representation/molecular-surface.ts b/src/mol-repr/structure/representation/molecular-surface.ts similarity index 95% rename from src/mol-geo/representation/structure/representation/molecular-surface.ts rename to src/mol-repr/structure/representation/molecular-surface.ts index 355a95d6ea152cb17f760e8314322ca930925789..9d68f2e44c147d35a22d256d2ec28b39dedfaa56 100644 --- a/src/mol-geo/representation/structure/representation/molecular-surface.ts +++ b/src/mol-repr/structure/representation/molecular-surface.ts @@ -4,19 +4,19 @@ * @author Alexander Rose <alexander.rose@weirdbyte.de> */ -import { UnitsRepresentation } from '..'; import { GaussianSurfaceVisual, GaussianSurfaceParams } from '../visual/gaussian-surface-mesh'; -import { StructureRepresentation } from '../units-representation'; +import { UnitsRepresentation } from '../units-representation'; import { Structure } from 'mol-model/structure'; -import { MarkerAction } from '../../../geometry/marker-data'; import { Loci, isEmptyLoci } from 'mol-model/loci'; -import { PickingId } from '../../../geometry/picking'; import { Task } from 'mol-task'; import { GaussianWireframeVisual, GaussianWireframeParams } from '../visual/gaussian-surface-wireframe'; import { getQualityProps } from '../../util'; import { paramDefaultValues, MultiSelectParam, SelectParam } from 'mol-util/parameter'; import { GaussianDensityVolumeParams, GaussianDensityVolumeVisual } from '../visual/gaussian-density-volume'; import { SizeThemeName, SizeThemeOptions } from 'mol-theme/size'; +import { PickingId } from 'mol-geo/geometry/picking'; +import { MarkerAction } from 'mol-geo/geometry/marker-data'; +import { StructureRepresentation } from '../index'; const VisualOptions = [['surface', 'Surface'], ['wireframe', 'Wireframe'], ['volume', 'Volume']] as [string, string][] diff --git a/src/mol-geo/representation/structure/representation/point.ts b/src/mol-repr/structure/representation/point.ts similarity index 87% rename from src/mol-geo/representation/structure/representation/point.ts rename to src/mol-repr/structure/representation/point.ts index 2992e750372136140837430c8b448cb6c1ae1cbb..f0c70da1dec3c5f46e51885aca3aca192ce21d3b 100644 --- a/src/mol-geo/representation/structure/representation/point.ts +++ b/src/mol-repr/structure/representation/point.ts @@ -4,14 +4,14 @@ * @author Alexander Rose <alexander.rose@weirdbyte.de> */ -import { UnitsRepresentation } from '..'; import { ElementPointVisual, ElementPointParams } from '../visual/element-point'; -import { StructureRepresentation } from '../units-representation'; +import { UnitsRepresentation } from '../units-representation'; import { Structure } from 'mol-model/structure'; -import { MarkerAction } from '../../../geometry/marker-data'; import { Loci } from 'mol-model/loci'; -import { PickingId } from '../../../geometry/picking'; import { paramDefaultValues } from 'mol-util/parameter'; +import { PickingId } from 'mol-geo/geometry/picking'; +import { MarkerAction } from 'mol-geo/geometry/marker-data'; +import { StructureRepresentation } from '../index'; export const PointParams = { ...ElementPointParams, diff --git a/src/mol-geo/representation/structure/representation/spacefill.ts b/src/mol-repr/structure/representation/spacefill.ts similarity index 88% rename from src/mol-geo/representation/structure/representation/spacefill.ts rename to src/mol-repr/structure/representation/spacefill.ts index c79ece3e06d47525775ba60cdd35a3fbed168201..2c5531f4a8ba5145ecd2964c42baa422e0558d3c 100644 --- a/src/mol-geo/representation/structure/representation/spacefill.ts +++ b/src/mol-repr/structure/representation/spacefill.ts @@ -4,15 +4,15 @@ * @author Alexander Rose <alexander.rose@weirdbyte.de> */ -import { UnitsRepresentation } from '..'; import { ElementSphereVisual, ElementSphereParams } from '../visual/element-sphere'; -import { StructureRepresentation } from '../units-representation'; +import { UnitsRepresentation } from '../units-representation'; import { Structure } from 'mol-model/structure'; -import { PickingId } from '../../../geometry/picking'; -import { MarkerAction } from '../../../geometry/marker-data'; import { Loci } from 'mol-model/loci'; import { getQualityProps } from '../../util'; import { paramDefaultValues } from 'mol-util/parameter'; +import { PickingId } from 'mol-geo/geometry/picking'; +import { MarkerAction } from 'mol-geo/geometry/marker-data'; +import { StructureRepresentation } from '../index'; export const SpacefillParams = { ...ElementSphereParams diff --git a/src/mol-geo/representation/structure/units-representation.ts b/src/mol-repr/structure/units-representation.ts similarity index 93% rename from src/mol-geo/representation/structure/units-representation.ts rename to src/mol-repr/structure/units-representation.ts index c2be322d7d5976c9fa1a3f47a3e8b45736423c90..d0694f68ab48a9c4a9ead72c3ae11904c602032d 100644 --- a/src/mol-geo/representation/structure/units-representation.ts +++ b/src/mol-repr/structure/units-representation.ts @@ -8,17 +8,14 @@ import { Structure, Unit } from 'mol-model/structure'; import { Task } from 'mol-task' import { RenderObject } from 'mol-gl/render-object'; -import { Representation, RepresentationProps, Visual } from '..'; -import { PickingId } from '../../geometry/picking'; +import { RepresentationProps, Visual } from '..'; import { Loci, EmptyLoci, isEmptyLoci } from 'mol-model/loci'; -import { MarkerAction } from '../../geometry/marker-data'; -import { StructureProps, StructureParams } from '.'; import { StructureGroup } from './units-visual'; +import { StructureProps, StructureParams, StructureRepresentation } from './index'; +import { PickingId } from 'mol-geo/geometry/picking'; +import { MarkerAction } from 'mol-geo/geometry/marker-data'; export interface UnitsVisual<P extends RepresentationProps = {}> extends Visual<StructureGroup, P> { } -export interface StructureVisual<P extends RepresentationProps = {}> extends Visual<Structure, P> { } - -export interface StructureRepresentation<P extends RepresentationProps = {}> extends Representation<Structure, P> { } export function UnitsRepresentation<P extends StructureProps>(label: string, visualCtor: () => UnitsVisual<P>): StructureRepresentation<P> { let visuals = new Map<number, { group: Unit.SymmetryGroup, visual: UnitsVisual<P> }>() diff --git a/src/mol-geo/representation/structure/units-visual.ts b/src/mol-repr/structure/units-visual.ts similarity index 94% rename from src/mol-geo/representation/structure/units-visual.ts rename to src/mol-repr/structure/units-visual.ts index bef61d53306551b03c7e018873286aa8dbf67d03..b79db06aa682797ed0b1d015a66d67687a159ea4 100644 --- a/src/mol-geo/representation/structure/units-visual.ts +++ b/src/mol-repr/structure/units-visual.ts @@ -6,25 +6,25 @@ import { Unit, Structure } from 'mol-model/structure'; import { RepresentationProps, Visual } from '../'; -import { VisualUpdateState, StructureMeshParams, StructurePointsParams, StructureLinesParams, StructureDirectVolumeParams, StructureParams } from '.'; +import { VisualUpdateState, StructureMeshParams, StructurePointsParams, StructureLinesParams, StructureDirectVolumeParams, StructureParams } from './index'; import { RuntimeContext } from 'mol-task'; -import { PickingId } from '../../geometry/picking'; -import { LocationIterator } from '../../util/location-iterator'; -import { Mesh } from '../../geometry/mesh/mesh'; -import { MarkerAction, applyMarkerAction, createMarkers } from '../../geometry/marker-data'; import { Loci, isEveryLoci, EmptyLoci } from 'mol-model/loci'; import { MeshRenderObject, PointsRenderObject, LinesRenderObject, DirectVolumeRenderObject } from 'mol-gl/render-object'; import { createUnitsMeshRenderObject, createUnitsPointsRenderObject, createUnitsTransform, createUnitsLinesRenderObject, createUnitsDirectVolumeRenderObject, UnitKind, UnitKindOptions, includesUnitKind, colorChanged, sizeChanged } from './visual/util/common'; import { deepEqual, ValueCell, UUID } from 'mol-util'; import { Interval } from 'mol-data/int'; -import { Points } from '../../geometry/points/points'; -import { updateRenderableState, Geometry } from '../../geometry/geometry'; -import { createColors } from '../../geometry/color-data'; -import { createSizes } from '../../geometry/size-data'; -import { Lines } from '../../geometry/lines/lines'; import { MultiSelectParam, paramDefaultValues } from 'mol-util/parameter'; -import { DirectVolume } from '../../geometry/direct-volume/direct-volume'; import { RenderableValues } from 'mol-gl/renderable/schema'; +import { Geometry, updateRenderableState } from 'mol-geo/geometry/geometry'; +import { LocationIterator } from 'mol-geo/util/location-iterator'; +import { PickingId } from 'mol-geo/geometry/picking'; +import { createMarkers, MarkerAction, applyMarkerAction } from 'mol-geo/geometry/marker-data'; +import { createSizes } from 'mol-geo/geometry/size-data'; +import { createColors } from 'mol-geo/geometry/color-data'; +import { Mesh } from 'mol-geo/geometry/mesh/mesh'; +import { Points } from 'mol-geo/geometry/points/points'; +import { Lines } from 'mol-geo/geometry/lines/lines'; +import { DirectVolume } from 'mol-geo/geometry/direct-volume/direct-volume'; export type StructureGroup = { structure: Structure, group: Unit.SymmetryGroup } diff --git a/src/mol-geo/representation/structure/visual/carbohydrate-link-cylinder.ts b/src/mol-repr/structure/visual/carbohydrate-link-cylinder.ts similarity index 95% rename from src/mol-geo/representation/structure/visual/carbohydrate-link-cylinder.ts rename to src/mol-repr/structure/visual/carbohydrate-link-cylinder.ts index acfb00dc090a69f2bdb30239f95513db302f9e91..fd904a2806895f367bdf5e354fc3b823dcbd74fb 100644 --- a/src/mol-geo/representation/structure/visual/carbohydrate-link-cylinder.ts +++ b/src/mol-repr/structure/visual/carbohydrate-link-cylinder.ts @@ -5,21 +5,21 @@ */ import { Structure, Link, StructureElement } from 'mol-model/structure'; -import { ComplexVisual, VisualUpdateState } from '..'; import { RuntimeContext } from 'mol-task' -import { Mesh } from '../../../geometry/mesh/mesh'; -import { PickingId } from '../../../geometry/picking'; import { Loci, EmptyLoci } from 'mol-model/loci'; import { Vec3 } from 'mol-math/linear-algebra'; -import { LocationIterator } from '../../../util/location-iterator'; import { createLinkCylinderMesh, LinkCylinderProps, LinkCylinderParams } from './util/link'; import { OrderedSet, Interval } from 'mol-data/int'; -import { ComplexMeshVisual } from '../complex-visual'; +import { ComplexMeshVisual, ComplexVisual } from '../complex-visual'; import { SizeTheme, SizeThemeName, SizeThemeOptions } from 'mol-theme/size'; import { LinkType } from 'mol-model/structure/model/types'; import { BitFlags } from 'mol-util'; import { UnitsMeshParams } from '../units-visual'; import { SelectParam, NumberParam, paramDefaultValues } from 'mol-util/parameter'; +import { Mesh } from 'mol-geo/geometry/mesh/mesh'; +import { VisualUpdateState } from '../index'; +import { LocationIterator } from 'mol-geo/util/location-iterator'; +import { PickingId } from 'mol-geo/geometry/picking'; // TODO create seperate visual // for (let i = 0, il = carbohydrates.terminalLinks.length; i < il; ++i) { diff --git a/src/mol-geo/representation/structure/visual/carbohydrate-symbol-mesh.ts b/src/mol-repr/structure/visual/carbohydrate-symbol-mesh.ts similarity index 89% rename from src/mol-geo/representation/structure/visual/carbohydrate-symbol-mesh.ts rename to src/mol-repr/structure/visual/carbohydrate-symbol-mesh.ts index b6f6b0e29e54f3b113f34b0ec729875be9f99f29..2e760c9a52112cc97fba50f2f5e1ac4569e3f0ce 100644 --- a/src/mol-geo/representation/structure/visual/carbohydrate-symbol-mesh.ts +++ b/src/mol-repr/structure/visual/carbohydrate-symbol-mesh.ts @@ -4,26 +4,26 @@ * @author Alexander Rose <alexander.rose@weirdbyte.de> */ +import { Mat4, Vec3 } from 'mol-math/linear-algebra'; +import { Box, PerforatedBox } from 'mol-geo/primitive/box'; +import { OctagonalPyramid, PerforatedOctagonalPyramid } from 'mol-geo/primitive/pyramid'; +import { Star } from 'mol-geo/primitive/star'; +import { Octahedron, PerforatedOctahedron } from 'mol-geo/primitive/octahedron'; +import { DiamondPrism, PentagonalPrism, HexagonalPrism } from 'mol-geo/primitive/prism'; +import { RuntimeContext } from 'mol-task'; import { Structure, StructureElement } from 'mol-model/structure'; -import { ComplexVisual, VisualUpdateState } from '..'; -import { RuntimeContext } from 'mol-task' -import { Mesh } from '../../../geometry/mesh/mesh'; -import { PickingId } from '../../../geometry/picking'; -import { Loci, EmptyLoci } from 'mol-model/loci'; -import { MeshBuilder } from '../../../geometry/mesh/mesh-builder'; -import { Vec3, Mat4 } from 'mol-math/linear-algebra'; -import { getSaccharideShape, SaccharideShapes } from 'mol-model/structure/structure/carbohydrates/constants'; -import { LocationIterator } from '../../../util/location-iterator'; -import { OrderedSet, Interval } from 'mol-data/int'; -import { ComplexMeshVisual, ComplexMeshParams } from '../complex-visual'; +import { Mesh } from 'mol-geo/geometry/mesh/mesh'; +import { MeshBuilder } from 'mol-geo/geometry/mesh/mesh-builder'; import { SizeTheme, SizeThemeName, SizeThemeOptions } from 'mol-theme/size'; -import { addSphere } from '../../../geometry/mesh/builder/sphere'; -import { Box, PerforatedBox } from '../../../primitive/box'; -import { OctagonalPyramid, PerforatedOctagonalPyramid } from '../../../primitive/pyramid'; -import { Star } from '../../../primitive/star'; -import { Octahedron, PerforatedOctahedron } from '../../../primitive/octahedron'; -import { DiamondPrism, PentagonalPrism, HexagonalPrism } from '../../../primitive/prism'; +import { getSaccharideShape, SaccharideShapes } from 'mol-model/structure/structure/carbohydrates/constants'; +import { addSphere } from 'mol-geo/geometry/mesh/builder/sphere'; +import { ComplexMeshParams, ComplexMeshVisual } from '../complex-visual'; import { SelectParam, NumberParam, paramDefaultValues } from 'mol-util/parameter'; +import { ComplexVisual, VisualUpdateState } from '../index'; +import { LocationIterator } from 'mol-geo/util/location-iterator'; +import { PickingId } from 'mol-geo/geometry/picking'; +import { OrderedSet, Interval } from 'mol-data/int'; +import { EmptyLoci, Loci } from 'mol-model/loci'; const t = Mat4.identity() const sVec = Vec3.zero() diff --git a/src/mol-geo/representation/structure/visual/cross-link-restraint-cylinder.ts b/src/mol-repr/structure/visual/cross-link-restraint-cylinder.ts similarity index 95% rename from src/mol-geo/representation/structure/visual/cross-link-restraint-cylinder.ts rename to src/mol-repr/structure/visual/cross-link-restraint-cylinder.ts index 21eb9879542cf73d60fdf782745fa77fd567505c..c84541454eae8313b28397042bb16370eed3b2aa 100644 --- a/src/mol-geo/representation/structure/visual/cross-link-restraint-cylinder.ts +++ b/src/mol-repr/structure/visual/cross-link-restraint-cylinder.ts @@ -5,20 +5,20 @@ */ import { Link, Structure, StructureElement } from 'mol-model/structure'; -import { ComplexVisual, VisualUpdateState } from '..'; +import { ComplexVisual, VisualUpdateState } from '../index'; import { RuntimeContext } from 'mol-task' import { LinkCylinderProps, createLinkCylinderMesh, LinkCylinderParams } from './util/link'; -import { Mesh } from '../../../geometry/mesh/mesh'; -import { PickingId } from '../../../geometry/picking'; import { Vec3 } from 'mol-math/linear-algebra'; import { Loci, EmptyLoci } from 'mol-model/loci'; import { ComplexMeshVisual, ComplexMeshParams } from '../complex-visual'; -import { LocationIterator } from '../../../util/location-iterator'; import { Interval } from 'mol-data/int'; import { SizeTheme, SizeThemeOptions, SizeThemeName } from 'mol-theme/size'; import { BitFlags } from 'mol-util'; import { LinkType } from 'mol-model/structure/model/types'; import { SelectParam, NumberParam, paramDefaultValues } from 'mol-util/parameter'; +import { Mesh } from 'mol-geo/geometry/mesh/mesh'; +import { LocationIterator } from 'mol-geo/util/location-iterator'; +import { PickingId } from 'mol-geo/geometry/picking'; async function createCrossLinkRestraintCylinderMesh(ctx: RuntimeContext, structure: Structure, props: LinkCylinderProps, mesh?: Mesh) { diff --git a/src/mol-geo/representation/structure/visual/element-point.ts b/src/mol-repr/structure/visual/element-point.ts similarity index 92% rename from src/mol-geo/representation/structure/visual/element-point.ts rename to src/mol-repr/structure/visual/element-point.ts index 5bbb7f4fec3b054a26e64b839864226f037a7c00..09abfc3aae34c4a1a77c21c439acaad99dd26782 100644 --- a/src/mol-geo/representation/structure/visual/element-point.ts +++ b/src/mol-repr/structure/visual/element-point.ts @@ -6,14 +6,14 @@ import { Unit, Structure } from 'mol-model/structure'; import { RuntimeContext } from 'mol-task' -import { UnitsVisual, VisualUpdateState } from '..'; +import { UnitsVisual, VisualUpdateState } from '../index'; import { getElementLoci, StructureElementIterator, markElement } from './util/element'; import { Vec3 } from 'mol-math/linear-algebra'; import { SizeThemeOptions, SizeThemeName } from 'mol-theme/size'; import { UnitsPointsVisual, UnitsPointsParams } from '../units-visual'; -import { Points } from '../../../geometry/points/points'; -import { PointsBuilder } from '../../../geometry/points/points-builder'; import { SelectParam, NumberParam, BooleanParam, paramDefaultValues } from 'mol-util/parameter'; +import { Points } from 'mol-geo/geometry/points/points'; +import { PointsBuilder } from 'mol-geo/geometry/points/points-builder'; export const ElementPointParams = { ...UnitsPointsParams, diff --git a/src/mol-geo/representation/structure/visual/element-sphere.ts b/src/mol-repr/structure/visual/element-sphere.ts similarity index 96% rename from src/mol-geo/representation/structure/visual/element-sphere.ts rename to src/mol-repr/structure/visual/element-sphere.ts index 5d8cbbb8b9a568b63b07064fd418bf953513d2b8..8be9d0086f434b2f14109d7bc69b1b8bc77a6e18 100644 --- a/src/mol-geo/representation/structure/visual/element-sphere.ts +++ b/src/mol-repr/structure/visual/element-sphere.ts @@ -5,7 +5,7 @@ * @author David Sehnal <david.sehnal@gmail.com> */ -import { UnitsVisual, VisualUpdateState } from '..'; +import { UnitsVisual, VisualUpdateState } from '../index'; import { createElementSphereMesh, markElement, getElementLoci, StructureElementIterator } from './util/element'; import { UnitsMeshVisual, UnitsMeshParams } from '../units-visual'; import { NumberParam, paramDefaultValues, SelectParam } from 'mol-util/parameter'; diff --git a/src/mol-geo/representation/structure/visual/gaussian-density-point.ts b/src/mol-repr/structure/visual/gaussian-density-point.ts similarity index 94% rename from src/mol-geo/representation/structure/visual/gaussian-density-point.ts rename to src/mol-repr/structure/visual/gaussian-density-point.ts index a6a1ec839ad90b00f0107a20de788d2489ae1964..807469abcaaab827026e458c7028f67e985e22c5 100644 --- a/src/mol-geo/representation/structure/visual/gaussian-density-point.ts +++ b/src/mol-repr/structure/visual/gaussian-density-point.ts @@ -6,16 +6,16 @@ import { Unit, Structure } from 'mol-model/structure'; import { RuntimeContext } from 'mol-task' -import { UnitsVisual, VisualUpdateState } from '..'; +import { UnitsVisual, VisualUpdateState } from '../index'; import { StructureElementIterator } from './util/element'; import { EmptyLoci } from 'mol-model/loci'; import { Vec3 } from 'mol-math/linear-algebra'; import { UnitsPointsVisual, UnitsPointsParams } from '../units-visual'; -import { Points } from '../../../geometry/points/points'; -import { PointsBuilder } from '../../../geometry/points/points-builder'; import { SizeThemeOptions, SizeThemeName } from 'mol-theme/size'; import { GaussianDensityProps, GaussianDensityParams } from 'mol-model/structure/structure/unit/gaussian-density'; import { paramDefaultValues, SelectParam, NumberParam, BooleanParam } from 'mol-util/parameter'; +import { Points } from 'mol-geo/geometry/points/points'; +import { PointsBuilder } from 'mol-geo/geometry/points/points-builder'; export const GaussianDensityPointParams = { ...UnitsPointsParams, diff --git a/src/mol-geo/representation/structure/visual/gaussian-density-volume.ts b/src/mol-repr/structure/visual/gaussian-density-volume.ts similarity index 95% rename from src/mol-geo/representation/structure/visual/gaussian-density-volume.ts rename to src/mol-repr/structure/visual/gaussian-density-volume.ts index 912c07dff46006c4f74baebb03f9ef1c38257ad2..00697e7979c11ee90a01d4b312a5ca68ad4e11b6 100644 --- a/src/mol-geo/representation/structure/visual/gaussian-density-volume.ts +++ b/src/mol-repr/structure/visual/gaussian-density-volume.ts @@ -5,13 +5,13 @@ */ import { Unit, Structure } from 'mol-model/structure'; -import { UnitsVisual, VisualUpdateState } from '..'; +import { UnitsVisual, VisualUpdateState } from '../index'; import { RuntimeContext } from 'mol-task' import { UnitsDirectVolumeVisual, UnitsDirectVolumeParams } from '../units-visual'; import { StructureElementIterator, getElementLoci, markElement } from './util/element'; import { GaussianDensityProps, GaussianDensityParams, computeUnitGaussianDensityTexture } from 'mol-model/structure/structure/unit/gaussian-density'; import { paramDefaultValues } from 'mol-util/parameter'; -import { DirectVolume } from '../../../geometry/direct-volume/direct-volume'; +import { DirectVolume } from 'mol-geo/geometry/direct-volume/direct-volume'; async function createGaussianDensityVolume(ctx: RuntimeContext, unit: Unit, structure: Structure, props: GaussianDensityProps, directVolume?: DirectVolume): Promise<DirectVolume> { const { webgl } = props diff --git a/src/mol-geo/representation/structure/visual/gaussian-surface-mesh.ts b/src/mol-repr/structure/visual/gaussian-surface-mesh.ts similarity index 92% rename from src/mol-geo/representation/structure/visual/gaussian-surface-mesh.ts rename to src/mol-repr/structure/visual/gaussian-surface-mesh.ts index 8faf356ab1290a11f262fed6744dba611f506e89..ccbfab83e54bc76c5eac9ba09938b771f3b4eac8 100644 --- a/src/mol-geo/representation/structure/visual/gaussian-surface-mesh.ts +++ b/src/mol-repr/structure/visual/gaussian-surface-mesh.ts @@ -5,14 +5,14 @@ */ import { Unit, Structure } from 'mol-model/structure'; -import { UnitsVisual, VisualUpdateState } from '..'; +import { UnitsVisual, VisualUpdateState } from '../index'; import { RuntimeContext } from 'mol-task' -import { Mesh } from '../../../geometry/mesh/mesh'; import { UnitsMeshVisual, UnitsMeshParams } from '../units-visual'; import { StructureElementIterator, getElementLoci, markElement } from './util/element'; -import { computeMarchingCubesMesh } from '../../../util/marching-cubes/algorithm'; import { GaussianDensityProps, GaussianDensityParams } from 'mol-model/structure/structure/unit/gaussian-density'; import { paramDefaultValues } from 'mol-util/parameter'; +import { Mesh } from 'mol-geo/geometry/mesh/mesh'; +import { computeMarchingCubesMesh } from 'mol-geo/util/marching-cubes/algorithm'; async function createGaussianSurfaceMesh(ctx: RuntimeContext, unit: Unit, structure: Structure, props: GaussianDensityProps, mesh?: Mesh): Promise<Mesh> { const { smoothness } = props diff --git a/src/mol-geo/representation/structure/visual/gaussian-surface-wireframe.ts b/src/mol-repr/structure/visual/gaussian-surface-wireframe.ts similarity index 93% rename from src/mol-geo/representation/structure/visual/gaussian-surface-wireframe.ts rename to src/mol-repr/structure/visual/gaussian-surface-wireframe.ts index c59b4bcf2f40d726c077c96ef8e772c2b877458d..56cc5b6cbdc37e2da59deda59546e83a0ebc90e8 100644 --- a/src/mol-geo/representation/structure/visual/gaussian-surface-wireframe.ts +++ b/src/mol-repr/structure/visual/gaussian-surface-wireframe.ts @@ -5,15 +5,15 @@ */ import { Unit, Structure } from 'mol-model/structure'; -import { UnitsVisual, VisualUpdateState } from '..'; +import { UnitsVisual, VisualUpdateState } from '../index'; import { RuntimeContext } from 'mol-task' import { UnitsLinesVisual, UnitsLinesParams } from '../units-visual'; import { StructureElementIterator, getElementLoci, markElement } from './util/element'; -import { computeMarchingCubesLines } from '../../../util/marching-cubes/algorithm'; -import { Lines } from '../../../geometry/lines/lines'; import { GaussianDensityProps, GaussianDensityParams } from 'mol-model/structure/structure/unit/gaussian-density'; import { paramDefaultValues, SelectParam, NumberParam, BooleanParam } from 'mol-util/parameter'; import { SizeThemeName, SizeThemeOptions } from 'mol-theme/size'; +import { Lines } from 'mol-geo/geometry/lines/lines'; +import { computeMarchingCubesLines } from 'mol-geo/util/marching-cubes/algorithm'; async function createGaussianWireframe(ctx: RuntimeContext, unit: Unit, structure: Structure, props: GaussianDensityProps, lines?: Lines): Promise<Lines> { const { smoothness } = props diff --git a/src/mol-geo/representation/structure/visual/inter-unit-link-cylinder.ts b/src/mol-repr/structure/visual/inter-unit-link-cylinder.ts similarity index 95% rename from src/mol-geo/representation/structure/visual/inter-unit-link-cylinder.ts rename to src/mol-repr/structure/visual/inter-unit-link-cylinder.ts index bf4c66294f8267aec5f566498e7fa66ac126321c..2f4abc28209c10416e8d02cf0e9418702aa5c518 100644 --- a/src/mol-geo/representation/structure/visual/inter-unit-link-cylinder.ts +++ b/src/mol-repr/structure/visual/inter-unit-link-cylinder.ts @@ -5,11 +5,9 @@ */ import { Link, Structure, StructureElement } from 'mol-model/structure'; -import { ComplexVisual, VisualUpdateState } from '..'; +import { ComplexVisual, VisualUpdateState } from '../index'; import { RuntimeContext } from 'mol-task' import { LinkCylinderProps, createLinkCylinderMesh, LinkIterator, LinkCylinderParams } from './util/link'; -import { Mesh } from '../../../geometry/mesh/mesh'; -import { PickingId } from '../../../geometry/picking'; import { Vec3 } from 'mol-math/linear-algebra'; import { Loci, EmptyLoci } from 'mol-model/loci'; import { ComplexMeshVisual, ComplexMeshParams } from '../complex-visual'; @@ -17,6 +15,8 @@ import { Interval } from 'mol-data/int'; import { SizeTheme, SizeThemeName, SizeThemeOptions } from 'mol-theme/size'; import { BitFlags } from 'mol-util'; import { SelectParam, NumberParam, paramDefaultValues } from 'mol-util/parameter'; +import { Mesh } from 'mol-geo/geometry/mesh/mesh'; +import { PickingId } from 'mol-geo/geometry/picking'; async function createInterUnitLinkCylinderMesh(ctx: RuntimeContext, structure: Structure, props: LinkCylinderProps, mesh?: Mesh) { const links = structure.links diff --git a/src/mol-geo/representation/structure/visual/intra-unit-link-cylinder.ts b/src/mol-repr/structure/visual/intra-unit-link-cylinder.ts similarity index 96% rename from src/mol-geo/representation/structure/visual/intra-unit-link-cylinder.ts rename to src/mol-repr/structure/visual/intra-unit-link-cylinder.ts index f3a19843a6266ea9ca125d14a010b3ec7bff74a3..bb3c4898ebdef81bcdf26a91fbfcf4567572adc4 100644 --- a/src/mol-geo/representation/structure/visual/intra-unit-link-cylinder.ts +++ b/src/mol-repr/structure/visual/intra-unit-link-cylinder.ts @@ -6,11 +6,9 @@ */ import { Unit, Link, StructureElement, Structure } from 'mol-model/structure'; -import { UnitsVisual, VisualUpdateState } from '..'; +import { UnitsVisual, VisualUpdateState } from '../index'; import { RuntimeContext } from 'mol-task' import { LinkCylinderProps, createLinkCylinderMesh, LinkIterator, LinkCylinderParams } from './util/link'; -import { Mesh } from '../../../geometry/mesh/mesh'; -import { PickingId } from '../../../geometry/picking'; import { Vec3 } from 'mol-math/linear-algebra'; import { Loci, EmptyLoci } from 'mol-model/loci'; import { UnitsMeshVisual, UnitsMeshParams } from '../units-visual'; @@ -18,6 +16,8 @@ import { Interval } from 'mol-data/int'; import { SizeTheme, SizeThemeName, SizeThemeOptions } from 'mol-theme/size'; import { BitFlags } from 'mol-util'; import { SelectParam, NumberParam, paramDefaultValues } from 'mol-util/parameter'; +import { Mesh } from 'mol-geo/geometry/mesh/mesh'; +import { PickingId } from 'mol-geo/geometry/picking'; async function createIntraUnitLinkCylinderMesh(ctx: RuntimeContext, unit: Unit, structure: Structure, props: LinkCylinderProps, mesh?: Mesh) { if (!Unit.isAtomic(unit)) return Mesh.createEmpty(mesh) diff --git a/src/mol-geo/representation/structure/visual/nucleotide-block-mesh.ts b/src/mol-repr/structure/visual/nucleotide-block-mesh.ts similarity index 95% rename from src/mol-geo/representation/structure/visual/nucleotide-block-mesh.ts rename to src/mol-repr/structure/visual/nucleotide-block-mesh.ts index 0f80fb2687375a1027fa9fdef5e71088c34bf7ac..f7c0aa0a32a29330c4b2ebf8e2a82d19f2b40296 100644 --- a/src/mol-geo/representation/structure/visual/nucleotide-block-mesh.ts +++ b/src/mol-repr/structure/visual/nucleotide-block-mesh.ts @@ -5,19 +5,19 @@ */ import { Unit, Structure } from 'mol-model/structure'; -import { UnitsVisual } from '..'; +import { UnitsVisual } from '../index'; import { RuntimeContext } from 'mol-task' -import { Mesh } from '../../../geometry/mesh/mesh'; -import { MeshBuilder } from '../../../geometry/mesh/mesh-builder'; import { Vec3, Mat4 } from 'mol-math/linear-algebra'; import { Segmentation } from 'mol-data/int'; import { MoleculeType, isNucleic, isPurinBase, isPyrimidineBase } from 'mol-model/structure/model/types'; import { getElementIndexForAtomRole } from 'mol-model/structure/util'; import { UnitsMeshVisual, UnitsMeshParams } from '../units-visual'; -import { addCylinder } from '../../../geometry/mesh/builder/cylinder'; -import { Box } from '../../../primitive/box'; import { NucleotideLocationIterator, markNucleotideElement, getNucleotideElementLoci } from './util/nucleotide'; import { paramDefaultValues } from 'mol-util/parameter'; +import { Box } from 'mol-geo/primitive/box'; +import { Mesh } from 'mol-geo/geometry/mesh/mesh'; +import { MeshBuilder } from 'mol-geo/geometry/mesh/mesh-builder'; +import { addCylinder } from 'mol-geo/geometry/mesh/builder/cylinder'; const p1 = Vec3.zero() const p2 = Vec3.zero() diff --git a/src/mol-geo/representation/structure/visual/polymer-backbone-cylinder.ts b/src/mol-repr/structure/visual/polymer-backbone-cylinder.ts similarity index 92% rename from src/mol-geo/representation/structure/visual/polymer-backbone-cylinder.ts rename to src/mol-repr/structure/visual/polymer-backbone-cylinder.ts index 95ccb9311063f615e627de3896a3b4ce57a59eef..ba556c24c0adf3f85e9404d1a200ab607a3cd5b2 100644 --- a/src/mol-geo/representation/structure/visual/polymer-backbone-cylinder.ts +++ b/src/mol-repr/structure/visual/polymer-backbone-cylinder.ts @@ -5,19 +5,19 @@ */ import { Unit, Structure } from 'mol-model/structure'; -import { UnitsVisual, VisualUpdateState } from '..'; +import { UnitsVisual, VisualUpdateState } from '../index'; import { RuntimeContext } from 'mol-task' -import { Mesh } from '../../../geometry/mesh/mesh'; -import { MeshBuilder } from '../../../geometry/mesh/mesh-builder'; import { PolymerBackboneIterator } from './util/polymer'; import { getElementLoci, markElement, StructureElementIterator } from './util/element'; import { Vec3 } from 'mol-math/linear-algebra'; import { UnitsMeshVisual, UnitsMeshParams } from '../units-visual'; import { SizeTheme, SizeThemeOptions, SizeThemeName } from 'mol-theme/size'; -import { CylinderProps } from '../../../primitive/cylinder'; import { OrderedSet } from 'mol-data/int'; -import { addCylinder } from '../../../geometry/mesh/builder/cylinder'; import { paramDefaultValues, NumberParam, SelectParam } from 'mol-util/parameter'; +import { Mesh } from 'mol-geo/geometry/mesh/mesh'; +import { MeshBuilder } from 'mol-geo/geometry/mesh/mesh-builder'; +import { CylinderProps } from 'mol-geo/primitive/cylinder'; +import { addCylinder } from 'mol-geo/geometry/mesh/builder/cylinder'; export const PolymerBackboneCylinderParams = { sizeTheme: SelectParam<SizeThemeName>('Size Theme', '', 'uniform', SizeThemeOptions), diff --git a/src/mol-repr/structure/visual/polymer-backbone-sphere.ts b/src/mol-repr/structure/visual/polymer-backbone-sphere.ts new file mode 100644 index 0000000000000000000000000000000000000000..0ffdd02fcbce683e436c0030ffe0517135c6ceda --- /dev/null +++ b/src/mol-repr/structure/visual/polymer-backbone-sphere.ts @@ -0,0 +1 @@ +// TODO \ No newline at end of file diff --git a/src/mol-geo/representation/structure/visual/polymer-direction-wedge.ts b/src/mol-repr/structure/visual/polymer-direction-wedge.ts similarity index 95% rename from src/mol-geo/representation/structure/visual/polymer-direction-wedge.ts rename to src/mol-repr/structure/visual/polymer-direction-wedge.ts index eb2a9f926323c661c565422cf67ff41d0228741a..68049ec37d1758e163325661e536927721b7d7b7 100644 --- a/src/mol-geo/representation/structure/visual/polymer-direction-wedge.ts +++ b/src/mol-repr/structure/visual/polymer-direction-wedge.ts @@ -5,17 +5,17 @@ */ import { Unit, Structure } from 'mol-model/structure'; -import { UnitsVisual } from '..'; +import { UnitsVisual } from '../index'; import { RuntimeContext } from 'mol-task' -import { Mesh } from '../../../geometry/mesh/mesh'; -import { MeshBuilder } from '../../../geometry/mesh/mesh-builder'; import { PolymerTraceIterator, createCurveSegmentState, interpolateCurveSegment, PolymerLocationIterator, getPolymerElementLoci, markPolymerElement } from './util/polymer'; import { Vec3, Mat4 } from 'mol-math/linear-algebra'; import { SecondaryStructureType, isNucleic } from 'mol-model/structure/model/types'; import { UnitsMeshVisual, UnitsMeshParams } from '../units-visual'; import { SizeTheme, SizeThemeName, SizeThemeOptions } from 'mol-theme/size'; -import { Wedge } from '../../../primitive/wedge'; import { SelectParam, NumberParam, paramDefaultValues } from 'mol-util/parameter'; +import { Wedge } from 'mol-geo/primitive/wedge'; +import { Mesh } from 'mol-geo/geometry/mesh/mesh'; +import { MeshBuilder } from 'mol-geo/geometry/mesh/mesh-builder'; const t = Mat4.identity() const sVec = Vec3.zero() diff --git a/src/mol-geo/representation/structure/visual/polymer-gap-cylinder.ts b/src/mol-repr/structure/visual/polymer-gap-cylinder.ts similarity index 91% rename from src/mol-geo/representation/structure/visual/polymer-gap-cylinder.ts rename to src/mol-repr/structure/visual/polymer-gap-cylinder.ts index b4539c32463d5b4a6c0ab6801846d3e04f4769fe..1e295ee14027f4c5bc1ec43f142a793ba9d0fb62 100644 --- a/src/mol-geo/representation/structure/visual/polymer-gap-cylinder.ts +++ b/src/mol-repr/structure/visual/polymer-gap-cylinder.ts @@ -5,19 +5,19 @@ */ import { Unit, Structure } from 'mol-model/structure'; -import { UnitsVisual, VisualUpdateState } from '..'; +import { UnitsVisual, VisualUpdateState } from '../index'; import { RuntimeContext } from 'mol-task' -import { Mesh } from '../../../geometry/mesh/mesh'; -import { MeshBuilder } from '../../../geometry/mesh/mesh-builder'; import { PolymerGapIterator, PolymerGapLocationIterator, markPolymerGapElement, getPolymerGapElementLoci } from './util/polymer'; import { Vec3 } from 'mol-math/linear-algebra'; import { UnitsMeshVisual, UnitsMeshParams } from '../units-visual'; import { SizeTheme, SizeThemeOptions, SizeThemeName } from 'mol-theme/size'; -import { CylinderProps } from '../../../primitive/cylinder'; -import { addSphere } from '../../../geometry/mesh/builder/sphere'; -import { addFixedCountDashedCylinder } from '../../../geometry/mesh/builder/cylinder'; import { SelectParam, NumberParam, paramDefaultValues } from 'mol-util/parameter'; import { LinkCylinderParams } from './util/link'; +import { Mesh } from 'mol-geo/geometry/mesh/mesh'; +import { MeshBuilder } from 'mol-geo/geometry/mesh/mesh-builder'; +import { CylinderProps } from 'mol-geo/primitive/cylinder'; +import { addSphere } from 'mol-geo/geometry/mesh/builder/sphere'; +import { addFixedCountDashedCylinder } from 'mol-geo/geometry/mesh/builder/cylinder'; const segmentCount = 10 diff --git a/src/mol-geo/representation/structure/visual/polymer-trace-mesh.ts b/src/mol-repr/structure/visual/polymer-trace-mesh.ts similarity index 94% rename from src/mol-geo/representation/structure/visual/polymer-trace-mesh.ts rename to src/mol-repr/structure/visual/polymer-trace-mesh.ts index 390a757fec5cdfaef0998a16c0923b4f72381093..47d0ca82c617cc0ab73c9b077cd0b5f7e79451fa 100644 --- a/src/mol-geo/representation/structure/visual/polymer-trace-mesh.ts +++ b/src/mol-repr/structure/visual/polymer-trace-mesh.ts @@ -5,17 +5,17 @@ */ import { Unit, Structure } from 'mol-model/structure'; -import { UnitsVisual, VisualUpdateState } from '..'; +import { UnitsVisual, VisualUpdateState } from '../index'; import { RuntimeContext } from 'mol-task' -import { Mesh } from '../../../geometry/mesh/mesh'; -import { MeshBuilder } from '../../../geometry/mesh/mesh-builder'; import { PolymerTraceIterator, createCurveSegmentState, interpolateCurveSegment, PolymerLocationIterator, getPolymerElementLoci, markPolymerElement } from './util/polymer'; import { SecondaryStructureType, isNucleic } from 'mol-model/structure/model/types'; import { UnitsMeshVisual, UnitsMeshParams } from '../units-visual'; import { SizeTheme, SizeThemeName, SizeThemeOptions } from 'mol-theme/size'; -import { addSheet } from '../../../geometry/mesh/builder/sheet'; -import { addTube } from '../../../geometry/mesh/builder/tube'; import { SelectParam, NumberParam, paramDefaultValues } from 'mol-util/parameter'; +import { Mesh } from 'mol-geo/geometry/mesh/mesh'; +import { MeshBuilder } from 'mol-geo/geometry/mesh/mesh-builder'; +import { addSheet } from 'mol-geo/geometry/mesh/builder/sheet'; +import { addTube } from 'mol-geo/geometry/mesh/builder/tube'; export const PolymerTraceMeshParams = { sizeTheme: SelectParam<SizeThemeName>('Size Theme', '', 'physical', SizeThemeOptions), diff --git a/src/mol-geo/representation/structure/visual/util/common.ts b/src/mol-repr/structure/visual/util/common.ts similarity index 89% rename from src/mol-geo/representation/structure/visual/util/common.ts rename to src/mol-repr/structure/visual/util/common.ts index cadf7fef3acfa3d5e50d5ae02b2600809db40edf..56e9f0e8e7f8bcb7710679cbc9abb2519dc06ae9 100644 --- a/src/mol-geo/representation/structure/visual/util/common.ts +++ b/src/mol-repr/structure/visual/util/common.ts @@ -5,19 +5,19 @@ */ import { Unit, Structure } from 'mol-model/structure'; -import { LocationIterator } from '../../../../util/location-iterator'; -import { Mesh } from '../../../../geometry/mesh/mesh'; -import { StructureProps } from '../..'; +import { StructureProps } from '../../index'; import { createMeshRenderObject, createPointsRenderObject, createLinesRenderObject, createDirectVolumeRenderObject } from 'mol-gl/render-object'; import { RuntimeContext } from 'mol-task'; -import { TransformData, createIdentityTransform, createTransform } from '../../../../geometry/transform-data'; -import { Points } from '../../../../geometry/points/points'; -import { createRenderableState } from '../../../../geometry/geometry'; import { Mat4 } from 'mol-math/linear-algebra'; -import { Lines } from '../../../../geometry/lines/lines'; -import { DirectVolume } from '../../../../geometry/direct-volume/direct-volume'; import { SizeProps } from 'mol-geo/geometry/size-data'; import { ColorProps } from 'mol-geo/geometry/color-data'; +import { TransformData, createTransform, createIdentityTransform } from 'mol-geo/geometry/transform-data'; +import { Mesh } from 'mol-geo/geometry/mesh/mesh'; +import { LocationIterator } from 'mol-geo/util/location-iterator'; +import { createRenderableState } from 'mol-geo/geometry/geometry'; +import { Points } from 'mol-geo/geometry/points/points'; +import { Lines } from 'mol-geo/geometry/lines/lines'; +import { DirectVolume } from 'mol-geo/geometry/direct-volume/direct-volume'; export function createUnitsTransform({ units }: Unit.SymmetryGroup, transformData?: TransformData) { const unitCount = units.length diff --git a/src/mol-geo/representation/structure/visual/util/element.ts b/src/mol-repr/structure/visual/util/element.ts similarity index 90% rename from src/mol-geo/representation/structure/visual/util/element.ts rename to src/mol-repr/structure/visual/util/element.ts index dfd6cf68c30a4725eec1f2c301c0dd249cbb8b57..4c1362033225ef4a8c9d1cbbacfe465d08bfda6e 100644 --- a/src/mol-geo/representation/structure/visual/util/element.ts +++ b/src/mol-repr/structure/visual/util/element.ts @@ -7,15 +7,15 @@ import { Vec3 } from 'mol-math/linear-algebra'; import { Unit, StructureElement, Structure } from 'mol-model/structure'; import { RuntimeContext } from 'mol-task'; -import { sphereVertexCount } from '../../../../primitive/sphere'; -import { Mesh } from '../../../../geometry/mesh/mesh'; -import { MeshBuilder } from '../../../../geometry/mesh/mesh-builder'; import { Loci, EmptyLoci } from 'mol-model/loci'; import { Interval, OrderedSet } from 'mol-data/int'; -import { PickingId } from '../../../../geometry/picking'; import { SizeTheme, SizeThemeName } from 'mol-theme/size'; -import { LocationIterator } from '../../../../util/location-iterator'; -import { addSphere } from '../../../../geometry/mesh/builder/sphere'; +import { Mesh } from 'mol-geo/geometry/mesh/mesh'; +import { sphereVertexCount } from 'mol-geo/primitive/sphere'; +import { MeshBuilder } from 'mol-geo/geometry/mesh/mesh-builder'; +import { addSphere } from 'mol-geo/geometry/mesh/builder/sphere'; +import { PickingId } from 'mol-geo/geometry/picking'; +import { LocationIterator } from 'mol-geo/util/location-iterator'; export interface ElementSphereMeshProps { sizeTheme: SizeThemeName, diff --git a/src/mol-geo/representation/structure/visual/util/gaussian.ts b/src/mol-repr/structure/visual/util/gaussian.ts similarity index 100% rename from src/mol-geo/representation/structure/visual/util/gaussian.ts rename to src/mol-repr/structure/visual/util/gaussian.ts diff --git a/src/mol-geo/representation/structure/visual/util/link.ts b/src/mol-repr/structure/visual/util/link.ts similarity index 95% rename from src/mol-geo/representation/structure/visual/util/link.ts rename to src/mol-repr/structure/visual/util/link.ts index a5aa876861ec1c9ec4774c84a220274945f9c41a..53d9688bcbd168100046207df44a5c80160a2c4b 100644 --- a/src/mol-geo/representation/structure/visual/util/link.ts +++ b/src/mol-repr/structure/visual/util/link.ts @@ -6,15 +6,15 @@ import { Vec3 } from 'mol-math/linear-algebra'; import { RuntimeContext } from 'mol-task'; -import { Mesh } from '../../../../geometry/mesh/mesh'; -import { MeshBuilder } from '../../../../geometry/mesh/mesh-builder'; import { LinkType } from 'mol-model/structure/model/types'; import { SizeThemeName, SizeThemeOptions } from 'mol-theme/size'; -import { CylinderProps } from '../../../../primitive/cylinder'; -import { LocationIterator } from '../../../../util/location-iterator'; import { Unit, StructureElement, Structure, Link } from 'mol-model/structure'; -import { addFixedCountDashedCylinder, addCylinder, addDoubleCylinder } from '../../../../geometry/mesh/builder/cylinder'; import { SelectParam, RangeParam, NumberParam, paramDefaultValues } from 'mol-util/parameter'; +import { Mesh } from 'mol-geo/geometry/mesh/mesh'; +import { MeshBuilder } from 'mol-geo/geometry/mesh/mesh-builder'; +import { CylinderProps } from 'mol-geo/primitive/cylinder'; +import { addFixedCountDashedCylinder, addCylinder, addDoubleCylinder } from 'mol-geo/geometry/mesh/builder/cylinder'; +import { LocationIterator } from 'mol-geo/util/location-iterator'; export const LinkCylinderParams = { sizeTheme: SelectParam<SizeThemeName>('Size Theme', '', 'uniform', SizeThemeOptions), diff --git a/src/mol-geo/representation/structure/visual/util/nucleotide.ts b/src/mol-repr/structure/visual/util/nucleotide.ts similarity index 96% rename from src/mol-geo/representation/structure/visual/util/nucleotide.ts rename to src/mol-repr/structure/visual/util/nucleotide.ts index de9e17a157236fd056b208724b428ebfc81f1a79..2ce7b7cb97e55d11c9d6c4f2f500590ed3283206 100644 --- a/src/mol-geo/representation/structure/visual/util/nucleotide.ts +++ b/src/mol-repr/structure/visual/util/nucleotide.ts @@ -5,11 +5,11 @@ */ import { Unit, StructureElement } from 'mol-model/structure'; -import { LocationIterator } from '../../../../util/location-iterator'; import { getNucleotideElements } from 'mol-model/structure/structure/util/nucleotide'; -import { PickingId } from '../../../../geometry/picking'; import { Loci, EmptyLoci } from 'mol-model/loci'; import { OrderedSet, Interval } from 'mol-data/int'; +import { LocationIterator } from 'mol-geo/util/location-iterator'; +import { PickingId } from 'mol-geo/geometry/picking'; export namespace NucleotideLocationIterator { export function fromGroup(group: Unit.SymmetryGroup): LocationIterator { diff --git a/src/mol-geo/representation/structure/visual/util/polymer.ts b/src/mol-repr/structure/visual/util/polymer.ts similarity index 97% rename from src/mol-geo/representation/structure/visual/util/polymer.ts rename to src/mol-repr/structure/visual/util/polymer.ts index a2739dfa392c350ee5a695eead128e21142fcc03..80ff883ab70a95da86bf43de69a4f738a96e73a0 100644 --- a/src/mol-geo/representation/structure/visual/util/polymer.ts +++ b/src/mol-repr/structure/visual/util/polymer.ts @@ -6,10 +6,10 @@ import { Unit, ElementIndex, StructureElement, Link } from 'mol-model/structure'; import SortedRanges from 'mol-data/int/sorted-ranges'; -import { LocationIterator } from '../../../../util/location-iterator'; -import { PickingId } from '../../../../geometry/picking'; import { OrderedSet, Interval } from 'mol-data/int'; import { EmptyLoci, Loci } from 'mol-model/loci'; +import { LocationIterator } from 'mol-geo/util/location-iterator'; +import { PickingId } from 'mol-geo/geometry/picking'; export * from './polymer/backbone-iterator' export * from './polymer/gap-iterator' diff --git a/src/mol-geo/representation/structure/visual/util/polymer/backbone-iterator.ts b/src/mol-repr/structure/visual/util/polymer/backbone-iterator.ts similarity index 100% rename from src/mol-geo/representation/structure/visual/util/polymer/backbone-iterator.ts rename to src/mol-repr/structure/visual/util/polymer/backbone-iterator.ts diff --git a/src/mol-geo/representation/structure/visual/util/polymer/curve-segment.ts b/src/mol-repr/structure/visual/util/polymer/curve-segment.ts similarity index 100% rename from src/mol-geo/representation/structure/visual/util/polymer/curve-segment.ts rename to src/mol-repr/structure/visual/util/polymer/curve-segment.ts diff --git a/src/mol-geo/representation/structure/visual/util/polymer/gap-iterator.ts b/src/mol-repr/structure/visual/util/polymer/gap-iterator.ts similarity index 100% rename from src/mol-geo/representation/structure/visual/util/polymer/gap-iterator.ts rename to src/mol-repr/structure/visual/util/polymer/gap-iterator.ts diff --git a/src/mol-geo/representation/structure/visual/util/polymer/trace-iterator.ts b/src/mol-repr/structure/visual/util/polymer/trace-iterator.ts similarity index 100% rename from src/mol-geo/representation/structure/visual/util/polymer/trace-iterator.ts rename to src/mol-repr/structure/visual/util/polymer/trace-iterator.ts diff --git a/src/mol-geo/representation/util.ts b/src/mol-repr/util.ts similarity index 97% rename from src/mol-geo/representation/util.ts rename to src/mol-repr/util.ts index c8a83cf50beb2a7186c793b003a97bf10f03f844..e227c24f81adb3bbc39fd47d6061c77a66f88471 100644 --- a/src/mol-geo/representation/util.ts +++ b/src/mol-repr/util.ts @@ -6,7 +6,7 @@ import { defaults } from 'mol-util'; import { Structure } from 'mol-model/structure'; -import { VisualQuality } from '../geometry/geometry'; +import { VisualQuality } from '../mol-geo/geometry/geometry'; export interface QualityProps { quality: VisualQuality diff --git a/src/mol-repr/volume.ts b/src/mol-repr/volume.ts new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/src/mol-geo/representation/volume/direct-volume.ts b/src/mol-repr/volume/direct-volume.ts similarity index 96% rename from src/mol-geo/representation/volume/direct-volume.ts rename to src/mol-repr/volume/direct-volume.ts index 0654ab5304a192cf694864cd52264244f7ce3b18..5ec65ef71512ba9a5d0f93c7abaeb4dfad9f8809 100644 --- a/src/mol-geo/representation/volume/direct-volume.ts +++ b/src/mol-repr/volume/direct-volume.ts @@ -6,14 +6,10 @@ import { VolumeData } from 'mol-model/volume' import { RuntimeContext } from 'mol-task' -import { VolumeVisual, VolumeRepresentation } from '.'; +import { VolumeVisual, VolumeRepresentation } from './index'; import { DirectVolumeRenderObject, createDirectVolumeRenderObject } from 'mol-gl/render-object'; -import { PickingId } from '../../geometry/picking'; -import { MarkerAction } from '../../geometry/marker-data'; import { Loci, EmptyLoci } from 'mol-model/loci'; -import { createRenderableState, updateRenderableState, Geometry } from '../../geometry/geometry'; import { paramDefaultValues } from 'mol-util/parameter'; -import { DirectVolume } from '../../geometry/direct-volume/direct-volume'; import { Vec3, Mat4 } from 'mol-math/linear-algebra'; import { Box3D } from 'mol-math/geometry'; import { WebGLContext } from 'mol-gl/webgl/context'; @@ -21,6 +17,10 @@ import { createTexture } from 'mol-gl/webgl/texture'; import { LocationIterator } from 'mol-geo/util/location-iterator'; import { NullLocation } from 'mol-model/location'; import { createIdentityTransform } from 'mol-geo/geometry/transform-data'; +import { DirectVolume } from 'mol-geo/geometry/direct-volume/direct-volume'; +import { Geometry, createRenderableState, updateRenderableState } from 'mol-geo/geometry/geometry'; +import { PickingId } from 'mol-geo/geometry/picking'; +import { MarkerAction } from 'mol-geo/geometry/marker-data'; function getBoundingBox(gridDimension: Vec3, transform: Mat4) { const bbox = Box3D.empty() diff --git a/src/mol-geo/representation/volume/index.ts b/src/mol-repr/volume/index.ts similarity index 93% rename from src/mol-geo/representation/volume/index.ts rename to src/mol-repr/volume/index.ts index dcb95d81aa6007052dbf12b82586e119dfb6c681..16192970f28738098255ffad5c96f71cbcd02db2 100644 --- a/src/mol-geo/representation/volume/index.ts +++ b/src/mol-repr/volume/index.ts @@ -7,11 +7,11 @@ import { Task } from 'mol-task' import { RepresentationProps, Representation, Visual } from '..'; import { VolumeData } from 'mol-model/volume'; -import { PickingId } from '../../geometry/picking'; import { Loci, EmptyLoci } from 'mol-model/loci'; -import { MarkerAction } from '../../geometry/marker-data'; -import { Geometry } from '../../geometry/geometry'; import { paramDefaultValues } from 'mol-util/parameter'; +import { Geometry } from 'mol-geo/geometry/geometry'; +import { PickingId } from 'mol-geo/geometry/picking'; +import { MarkerAction } from 'mol-geo/geometry/marker-data'; export interface VolumeVisual<P extends RepresentationProps = {}> extends Visual<VolumeData, P> { } diff --git a/src/mol-geo/representation/volume/isosurface-mesh.ts b/src/mol-repr/volume/isosurface-mesh.ts similarity index 91% rename from src/mol-geo/representation/volume/isosurface-mesh.ts rename to src/mol-repr/volume/isosurface-mesh.ts index acff269e697040063011363c958f61be524e8f26..152cb3a8bfd06f7b7f618b95509de5b5a259cfca 100644 --- a/src/mol-geo/representation/volume/isosurface-mesh.ts +++ b/src/mol-repr/volume/isosurface-mesh.ts @@ -7,19 +7,19 @@ import { VolumeData, VolumeIsoValue } from 'mol-model/volume' import { RuntimeContext } from 'mol-task' -import { computeMarchingCubesMesh } from '../../util/marching-cubes/algorithm'; -import { Mesh } from '../../geometry/mesh/mesh'; -import { VolumeVisual, VolumeRepresentation } from '.'; +import { VolumeVisual, VolumeRepresentation } from './index'; import { createMeshRenderObject, MeshRenderObject } from 'mol-gl/render-object'; -import { PickingId } from '../../geometry/picking'; -import { MarkerAction } from '../../geometry/marker-data'; import { Loci, EmptyLoci } from 'mol-model/loci'; -import { LocationIterator } from '../../util/location-iterator'; import { NullLocation } from 'mol-model/location'; -import { createIdentityTransform } from '../../geometry/transform-data'; -import { createRenderableState, updateRenderableState } from '../../geometry/geometry'; import { paramDefaultValues, RangeParam } from 'mol-util/parameter'; import { ValueCell } from 'mol-util'; +import { Mesh } from 'mol-geo/geometry/mesh/mesh'; +import { computeMarchingCubesMesh } from 'mol-geo/util/marching-cubes/algorithm'; +import { LocationIterator } from 'mol-geo/util/location-iterator'; +import { createIdentityTransform } from 'mol-geo/geometry/transform-data'; +import { createRenderableState, updateRenderableState } from 'mol-geo/geometry/geometry'; +import { PickingId } from 'mol-geo/geometry/picking'; +import { MarkerAction } from 'mol-geo/geometry/marker-data'; export async function createVolumeSurface(ctx: RuntimeContext, volume: VolumeData, isoValueAbsolute: number, mesh?: Mesh) { ctx.update({ message: 'Marching cubes...' }); diff --git a/tsconfig.json b/tsconfig.json index e82eb6af14db2e816708e40e12621ac9d93074dd..acb69eee3adf78ff9690fd1c7837fddae3c8c7a9 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -17,17 +17,18 @@ "mol-app": ["./mol-app"], "mol-data": ["./mol-data", "./mol-data/index.ts"], "mol-geo": ["./mol-geo"], - "mol-theme": ["./mol-theme"], "mol-gl": ["./mol-gl"], "mol-io": ["./mol-io"], "mol-math": ["./mol-math"], "mol-model": ["./mol-model"], "mol-model-props": ["./mol-model-props", "./mol-model-props/index.ts"], "mol-ql": ["./mol-ql"], + "mol-repr": ["./mol-repr"], "mol-script": ["./mol-script"], "mol-state": ["./mol-state", "./mol-state/index.ts"], "mol-plugin": ["./mol-plugin", "./mol-plugin/index.ts"], "mol-task": ["./mol-task", "./mol-task/index.ts"], + "mol-theme": ["./mol-theme"], "mol-util": ["./mol-util", "./mol-util/index.ts"], "mol-canvas3d": ["./mol-view"] }