molstar 3.26.0 → 3.28.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +20 -20
- package/README.md +202 -202
- package/build/viewer/embedded.html +52 -52
- package/build/viewer/index.html +115 -115
- package/build/viewer/molstar.css +1 -1
- package/build/viewer/molstar.js +1 -1
- package/lib/apps/docking-viewer/index.html +36 -36
- package/lib/apps/docking-viewer/viewport.d.ts +2 -0
- package/lib/apps/docking-viewer/viewport.js +1 -0
- package/lib/apps/viewer/app.d.ts +3 -1
- package/lib/apps/viewer/app.js +4 -0
- package/lib/apps/viewer/embedded.html +52 -52
- package/lib/apps/viewer/index.html +115 -115
- package/lib/cli/structure-info/volume.js +1 -1
- package/lib/commonjs/apps/docking-viewer/viewport.d.ts +2 -0
- package/lib/commonjs/apps/docking-viewer/viewport.js +1 -0
- package/lib/commonjs/apps/viewer/app.d.ts +3 -1
- package/lib/commonjs/apps/viewer/app.js +4 -0
- package/lib/commonjs/cli/structure-info/volume.js +1 -1
- package/lib/commonjs/examples/lighting/index.js +1 -1
- package/lib/commonjs/extensions/anvil/behavior.d.ts +1 -0
- package/lib/commonjs/extensions/cellpack/model.js +2 -1
- package/lib/commonjs/extensions/dnatco/confal-pyramids/behavior.d.ts +1 -0
- package/lib/commonjs/extensions/meshes/choice.d.ts +26 -0
- package/lib/commonjs/extensions/meshes/choice.js +31 -0
- package/lib/commonjs/extensions/meshes/examples.d.ts +26 -0
- package/lib/commonjs/extensions/meshes/examples.js +337 -0
- package/lib/commonjs/extensions/meshes/mesh-cif-schema.d.ts +29 -0
- package/lib/commonjs/extensions/meshes/mesh-cif-schema.js +34 -0
- package/lib/commonjs/extensions/meshes/mesh-extension.d.ts +66 -0
- package/lib/commonjs/extensions/meshes/mesh-extension.js +221 -0
- package/lib/commonjs/extensions/meshes/mesh-streaming/behavior.d.ts +105 -0
- package/lib/commonjs/extensions/meshes/mesh-streaming/behavior.js +379 -0
- package/lib/commonjs/extensions/meshes/mesh-streaming/server-info.d.ts +54 -0
- package/lib/commonjs/extensions/meshes/mesh-streaming/server-info.js +30 -0
- package/lib/commonjs/extensions/meshes/mesh-streaming/transformers.d.ts +42 -0
- package/lib/commonjs/extensions/meshes/mesh-streaming/transformers.js +273 -0
- package/lib/commonjs/extensions/meshes/mesh-utils.d.ts +41 -0
- package/lib/commonjs/extensions/meshes/mesh-utils.js +357 -0
- package/lib/commonjs/extensions/meshes/metadata.d.ts +108 -0
- package/lib/commonjs/extensions/meshes/metadata.js +72 -0
- package/lib/commonjs/extensions/model-archive/quality-assessment/behavior.d.ts +2 -0
- package/lib/commonjs/extensions/model-archive/quality-assessment/prop.d.ts +1 -0
- package/lib/commonjs/extensions/model-archive/quality-assessment/prop.js +16 -4
- package/lib/commonjs/extensions/rcsb/assembly-symmetry/behavior.d.ts +4 -2
- package/lib/commonjs/extensions/rcsb/validation-report/behavior.d.ts +3 -0
- package/lib/commonjs/extensions/volumes-and-segmentations/entry-meshes.d.ts +17 -0
- package/lib/commonjs/extensions/volumes-and-segmentations/entry-meshes.js +156 -0
- package/lib/commonjs/extensions/volumes-and-segmentations/entry-models.d.ts +12 -0
- package/lib/commonjs/extensions/volumes-and-segmentations/entry-models.js +96 -0
- package/lib/commonjs/extensions/volumes-and-segmentations/entry-root.d.ts +122 -0
- package/lib/commonjs/extensions/volumes-and-segmentations/entry-root.js +576 -0
- package/lib/commonjs/extensions/volumes-and-segmentations/entry-segmentation.d.ts +20 -0
- package/lib/commonjs/extensions/volumes-and-segmentations/entry-segmentation.js +200 -0
- package/lib/commonjs/extensions/volumes-and-segmentations/entry-state.d.ts +88 -0
- package/lib/commonjs/extensions/volumes-and-segmentations/entry-state.js +32 -0
- package/lib/commonjs/extensions/volumes-and-segmentations/entry-volume.d.ts +35 -0
- package/lib/commonjs/extensions/volumes-and-segmentations/entry-volume.js +234 -0
- package/lib/commonjs/extensions/volumes-and-segmentations/external-api.d.ts +11 -0
- package/lib/commonjs/extensions/volumes-and-segmentations/external-api.js +85 -0
- package/lib/commonjs/extensions/volumes-and-segmentations/global-state.d.ts +51 -0
- package/lib/commonjs/extensions/volumes-and-segmentations/global-state.js +83 -0
- package/lib/commonjs/extensions/volumes-and-segmentations/helpers.d.ts +56 -0
- package/lib/commonjs/extensions/volumes-and-segmentations/helpers.js +171 -0
- package/lib/commonjs/extensions/volumes-and-segmentations/index.d.ts +20 -0
- package/lib/commonjs/extensions/volumes-and-segmentations/index.js +130 -0
- package/lib/commonjs/extensions/volumes-and-segmentations/transformers.d.ts +33 -0
- package/lib/commonjs/extensions/volumes-and-segmentations/transformers.js +85 -0
- package/lib/commonjs/extensions/volumes-and-segmentations/ui.d.ts +29 -0
- package/lib/commonjs/extensions/volumes-and-segmentations/ui.js +232 -0
- package/lib/commonjs/extensions/volumes-and-segmentations/volseg-api/api.d.ts +22 -0
- package/lib/commonjs/extensions/volumes-and-segmentations/volseg-api/api.js +83 -0
- package/lib/commonjs/extensions/volumes-and-segmentations/volseg-api/data.d.ts +92 -0
- package/lib/commonjs/extensions/volumes-and-segmentations/volseg-api/data.js +7 -0
- package/lib/commonjs/extensions/volumes-and-segmentations/volseg-api/utils.d.ts +23 -0
- package/lib/commonjs/extensions/volumes-and-segmentations/volseg-api/utils.js +78 -0
- package/lib/commonjs/mol-canvas3d/canvas3d.d.ts +2 -0
- package/lib/commonjs/mol-canvas3d/passes/draw.js +3 -3
- package/lib/commonjs/mol-canvas3d/passes/image.d.ts +1 -0
- package/lib/commonjs/mol-canvas3d/passes/postprocessing.d.ts +2 -1
- package/lib/commonjs/mol-canvas3d/passes/postprocessing.js +27 -13
- package/lib/commonjs/mol-geo/geometry/cylinders/cylinders.d.ts +2 -1
- package/lib/commonjs/mol-geo/geometry/cylinders/cylinders.js +3 -2
- package/lib/commonjs/mol-geo/geometry/lines/lines.d.ts +0 -1
- package/lib/commonjs/mol-geo/geometry/points/points.d.ts +1 -1
- package/lib/commonjs/mol-geo/geometry/spheres/spheres.d.ts +1 -0
- package/lib/commonjs/mol-geo/geometry/spheres/spheres.js +3 -2
- package/lib/commonjs/mol-gl/compute/histogram-pyramid/reduction.js +1 -2
- package/lib/commonjs/mol-gl/compute/marching-cubes/isosurface.js +4 -6
- package/lib/commonjs/mol-gl/renderable/cylinders.d.ts +1 -0
- package/lib/commonjs/mol-gl/renderable/cylinders.js +1 -1
- package/lib/commonjs/mol-gl/renderable/spheres.d.ts +1 -0
- package/lib/commonjs/mol-gl/renderable/spheres.js +1 -1
- package/lib/commonjs/mol-gl/shader/chunks/apply-light-color.glsl.d.ts +1 -1
- package/lib/commonjs/mol-gl/shader/chunks/apply-light-color.glsl.js +1 -1
- package/lib/commonjs/mol-gl/shader/chunks/clip-instance.glsl.d.ts +1 -1
- package/lib/commonjs/mol-gl/shader/chunks/clip-instance.glsl.js +1 -1
- package/lib/commonjs/mol-gl/shader/chunks/clip-pixel.glsl.d.ts +1 -1
- package/lib/commonjs/mol-gl/shader/chunks/clip-pixel.glsl.js +1 -1
- package/lib/commonjs/mol-gl/shader/chunks/common-clip.glsl.d.ts +2 -2
- package/lib/commonjs/mol-gl/shader/chunks/common-clip.glsl.js +2 -2
- package/lib/commonjs/mol-gl/shader/cylinders.frag.d.ts +1 -1
- package/lib/commonjs/mol-gl/shader/cylinders.frag.js +1 -1
- package/lib/commonjs/mol-gl/shader/cylinders.vert.d.ts +2 -2
- package/lib/commonjs/mol-gl/shader/cylinders.vert.js +2 -2
- package/lib/commonjs/mol-gl/shader/direct-volume.frag.d.ts +1 -1
- package/lib/commonjs/mol-gl/shader/direct-volume.frag.js +1 -1
- package/lib/commonjs/mol-gl/shader/outlines.frag.d.ts +1 -1
- package/lib/commonjs/mol-gl/shader/outlines.frag.js +1 -1
- package/lib/commonjs/mol-gl/shader/postprocessing.frag.d.ts +1 -1
- package/lib/commonjs/mol-gl/shader/postprocessing.frag.js +1 -1
- package/lib/commonjs/mol-gl/shader/spheres.frag.d.ts +1 -1
- package/lib/commonjs/mol-gl/shader/spheres.frag.js +1 -1
- package/lib/commonjs/mol-gl/shader/spheres.vert.d.ts +2 -2
- package/lib/commonjs/mol-gl/shader/spheres.vert.js +2 -2
- package/lib/commonjs/mol-gl/webgl/renderbuffer.d.ts +1 -1
- package/lib/commonjs/mol-gl/webgl/renderbuffer.js +15 -0
- package/lib/commonjs/mol-gl/webgl/state.d.ts +12 -0
- package/lib/commonjs/mol-gl/webgl/state.js +136 -0
- package/lib/commonjs/mol-io/reader/cif/schema/segmentation.d.ts +38 -0
- package/lib/commonjs/mol-io/reader/cif/schema/segmentation.js +22 -0
- package/lib/commonjs/mol-io/reader/cif.d.ts +3 -1
- package/lib/commonjs/mol-io/reader/cif.js +3 -1
- package/lib/commonjs/mol-model/location.d.ts +2 -1
- package/lib/commonjs/mol-model/loci.d.ts +11 -11
- package/lib/commonjs/mol-model/loci.js +13 -1
- package/lib/commonjs/mol-model/sequence/alignment/sequence.d.ts +4 -1
- package/lib/commonjs/mol-model/sequence/alignment/sequence.js +4 -1
- package/lib/commonjs/mol-model/structure/model/properties/atomic/hierarchy.d.ts +6 -0
- package/lib/commonjs/mol-model/structure/model/properties/utils/atomic-index.js +8 -0
- package/lib/commonjs/mol-model/structure/structure/unit/bonds/inter-compute.js +21 -5
- package/lib/commonjs/mol-model/structure/structure/util/superposition.d.ts +1 -0
- package/lib/commonjs/mol-model/structure/structure/util/superposition.js +2 -1
- package/lib/commonjs/mol-model/volume/volume.d.ts +35 -2
- package/lib/commonjs/mol-model/volume/volume.js +77 -2
- package/lib/commonjs/mol-model-formats/volume/segmentation.d.ts +23 -0
- package/lib/commonjs/mol-model-formats/volume/segmentation.js +138 -0
- package/lib/commonjs/mol-plugin/behavior/dynamic/representation.d.ts +2 -2
- package/lib/commonjs/mol-plugin/behavior/dynamic/selection/structure-focus-representation.d.ts +1 -0
- package/lib/commonjs/mol-plugin/behavior/dynamic/selection/structure-focus-representation.js +2 -1
- package/lib/commonjs/mol-plugin/behavior/dynamic/volume-streaming/model.d.ts +2 -3
- package/lib/commonjs/mol-plugin/commands.d.ts +1 -0
- package/lib/commonjs/mol-plugin-state/animation/built-in/model-index.js +4 -1
- package/lib/commonjs/mol-plugin-state/builder/structure/hierarchy-preset.d.ts +2 -0
- package/lib/commonjs/mol-plugin-state/builder/structure/hierarchy.d.ts +1 -0
- package/lib/commonjs/mol-plugin-state/builder/structure/representation-preset.d.ts +13 -4
- package/lib/commonjs/mol-plugin-state/builder/structure/representation-preset.js +6 -1
- package/lib/commonjs/mol-plugin-state/builder/structure/representation.d.ts +1 -0
- package/lib/commonjs/mol-plugin-state/formats/provider.d.ts +2 -2
- package/lib/commonjs/mol-plugin-state/formats/provider.js +11 -3
- package/lib/commonjs/mol-plugin-state/formats/registry.js +6 -5
- package/lib/commonjs/mol-plugin-state/formats/volume.d.ts +27 -0
- package/lib/commonjs/mol-plugin-state/formats/volume.js +65 -1
- package/lib/commonjs/mol-plugin-state/manager/structure/component.d.ts +1 -1
- package/lib/commonjs/mol-plugin-state/manager/structure/component.js +18 -13
- package/lib/commonjs/mol-plugin-state/transforms/representation.d.ts +1 -2
- package/lib/commonjs/mol-plugin-state/transforms/representation.js +5 -6
- package/lib/commonjs/mol-plugin-state/transforms/volume.d.ts +11 -1
- package/lib/commonjs/mol-plugin-state/transforms/volume.js +55 -2
- package/lib/commonjs/mol-plugin-ui/controls/line-graph/line-graph-component.d.ts +1 -0
- package/lib/commonjs/mol-plugin-ui/controls/line-graph/line-graph-component.js +33 -13
- package/lib/commonjs/mol-plugin-ui/controls/parameters.d.ts +1 -0
- package/lib/commonjs/mol-plugin-ui/controls/parameters.js +22 -5
- package/lib/commonjs/mol-plugin-ui/sequence/sequence.d.ts +25 -17
- package/lib/commonjs/mol-plugin-ui/sequence.d.ts +19 -1
- package/lib/commonjs/mol-plugin-ui/sequence.js +8 -1
- package/lib/commonjs/mol-plugin-ui/state/apply-action.d.ts +2 -10
- package/lib/commonjs/mol-plugin-ui/state/apply-action.js +2 -2
- package/lib/commonjs/mol-plugin-ui/structure/quick-styles.js +2 -2
- package/lib/commonjs/mol-plugin-ui/structure/superposition.d.ts +1 -1
- package/lib/commonjs/mol-plugin-ui/structure/volume.d.ts +1 -1
- package/lib/commonjs/mol-plugin-ui/structure/volume.js +3 -2
- package/lib/commonjs/mol-repr/structure/complex-visual.d.ts +1 -0
- package/lib/commonjs/mol-repr/structure/params.d.ts +2 -0
- package/lib/commonjs/mol-repr/structure/registry.d.ts +12 -0
- package/lib/commonjs/mol-repr/structure/representation/backbone.d.ts +3 -0
- package/lib/commonjs/mol-repr/structure/representation/ball-and-stick.d.ts +6 -0
- package/lib/commonjs/mol-repr/structure/representation/ellipsoid.d.ts +6 -0
- package/lib/commonjs/mol-repr/structure/representation/gaussian-surface.d.ts +3 -0
- package/lib/commonjs/mol-repr/structure/representation/gaussian-volume.d.ts +3 -0
- package/lib/commonjs/mol-repr/structure/representation/line.d.ts +3 -0
- package/lib/commonjs/mol-repr/structure/representation/molecular-surface.d.ts +3 -0
- package/lib/commonjs/mol-repr/structure/representation/point.d.ts +3 -0
- package/lib/commonjs/mol-repr/structure/representation/spacefill.d.ts +6 -0
- package/lib/commonjs/mol-repr/structure/units-visual.d.ts +2 -0
- package/lib/commonjs/mol-repr/structure/visual/bond-inter-unit-cylinder.d.ts +4 -0
- package/lib/commonjs/mol-repr/structure/visual/bond-inter-unit-cylinder.js +2 -0
- package/lib/commonjs/mol-repr/structure/visual/bond-inter-unit-line.d.ts +1 -0
- package/lib/commonjs/mol-repr/structure/visual/bond-inter-unit-line.js +1 -0
- package/lib/commonjs/mol-repr/structure/visual/bond-intra-unit-cylinder.d.ts +4 -0
- package/lib/commonjs/mol-repr/structure/visual/bond-intra-unit-cylinder.js +2 -0
- package/lib/commonjs/mol-repr/structure/visual/bond-intra-unit-line.d.ts +1 -0
- package/lib/commonjs/mol-repr/structure/visual/bond-intra-unit-line.js +1 -0
- package/lib/commonjs/mol-repr/structure/visual/element-cross.d.ts +1 -0
- package/lib/commonjs/mol-repr/structure/visual/element-cross.js +2 -1
- package/lib/commonjs/mol-repr/structure/visual/element-point.d.ts +1 -0
- package/lib/commonjs/mol-repr/structure/visual/element-point.js +2 -1
- package/lib/commonjs/mol-repr/structure/visual/element-sphere.d.ts +4 -0
- package/lib/commonjs/mol-repr/structure/visual/element-sphere.js +3 -1
- package/lib/commonjs/mol-repr/structure/visual/gaussian-density-volume.d.ts +2 -0
- package/lib/commonjs/mol-repr/structure/visual/gaussian-density-volume.js +6 -2
- package/lib/commonjs/mol-repr/structure/visual/gaussian-surface-mesh.d.ts +4 -0
- package/lib/commonjs/mol-repr/structure/visual/gaussian-surface-mesh.js +9 -1
- package/lib/commonjs/mol-repr/structure/visual/gaussian-surface-wireframe.d.ts +1 -0
- package/lib/commonjs/mol-repr/structure/visual/gaussian-surface-wireframe.js +3 -1
- package/lib/commonjs/mol-repr/structure/visual/molecular-surface-mesh.d.ts +1 -0
- package/lib/commonjs/mol-repr/structure/visual/molecular-surface-mesh.js +4 -0
- package/lib/commonjs/mol-repr/structure/visual/molecular-surface-wireframe.d.ts +1 -0
- package/lib/commonjs/mol-repr/structure/visual/molecular-surface-wireframe.js +2 -0
- package/lib/commonjs/mol-repr/structure/visual/polymer-backbone-cylinder.d.ts +2 -0
- package/lib/commonjs/mol-repr/structure/visual/polymer-backbone-sphere.d.ts +2 -0
- package/lib/commonjs/mol-repr/structure/visual/util/bond.d.ts +7 -0
- package/lib/commonjs/mol-repr/structure/visual/util/bond.js +18 -7
- package/lib/commonjs/mol-repr/structure/visual/util/common.d.ts +4 -1
- package/lib/commonjs/mol-repr/structure/visual/util/common.js +10 -6
- package/lib/commonjs/mol-repr/structure/visual/util/element.d.ts +1 -0
- package/lib/commonjs/mol-repr/structure/visual/util/element.js +2 -3
- package/lib/commonjs/mol-repr/structure/visual/util/gaussian.d.ts +2 -0
- package/lib/commonjs/mol-repr/volume/direct-volume.d.ts +4 -4
- package/lib/commonjs/mol-repr/volume/direct-volume.js +8 -6
- package/lib/commonjs/mol-repr/volume/isosurface.d.ts +4 -4
- package/lib/commonjs/mol-repr/volume/isosurface.js +17 -16
- package/lib/commonjs/mol-repr/volume/registry.d.ts +54 -1
- package/lib/commonjs/mol-repr/volume/registry.js +3 -1
- package/lib/commonjs/mol-repr/volume/representation.d.ts +11 -7
- package/lib/commonjs/mol-repr/volume/representation.js +142 -47
- package/lib/commonjs/mol-repr/volume/segment.d.ts +291 -0
- package/lib/commonjs/mol-repr/volume/segment.js +289 -0
- package/lib/commonjs/mol-repr/volume/slice.d.ts +2 -2
- package/lib/commonjs/mol-repr/volume/slice.js +5 -5
- package/lib/commonjs/mol-repr/volume/util.d.ts +12 -3
- package/lib/commonjs/mol-repr/volume/util.js +72 -6
- package/lib/commonjs/mol-script/language/builder.d.ts +1 -0
- package/lib/commonjs/mol-theme/color/volume-segment.d.ts +41 -0
- package/lib/commonjs/mol-theme/color/volume-segment.js +58 -0
- package/lib/commonjs/mol-theme/color/volume-value.js +2 -1
- package/lib/commonjs/mol-theme/color.d.ts +15 -0
- package/lib/commonjs/mol-theme/color.js +2 -0
- package/lib/commonjs/mol-theme/label.d.ts +1 -1
- package/lib/commonjs/mol-theme/label.js +13 -1
- package/lib/commonjs/mol-util/param-definition.d.ts +4 -1
- package/lib/commonjs/mol-util/param-definition.js +5 -2
- package/lib/examples/alpha-orbitals/index.html +72 -72
- package/lib/examples/basic-wrapper/index.html +137 -137
- package/lib/examples/lighting/index.html +88 -88
- package/lib/examples/lighting/index.js +1 -1
- package/lib/examples/proteopedia-wrapper/index.html +236 -236
- package/lib/extensions/anvil/behavior.d.ts +1 -0
- package/lib/extensions/cellpack/model.js +2 -1
- package/lib/extensions/dnatco/confal-pyramids/behavior.d.ts +1 -0
- package/lib/extensions/meshes/choice.d.ts +26 -0
- package/lib/extensions/meshes/choice.js +28 -0
- package/lib/extensions/meshes/examples.d.ts +26 -0
- package/lib/extensions/meshes/examples.js +325 -0
- package/lib/extensions/meshes/mesh-cif-schema.d.ts +29 -0
- package/lib/extensions/meshes/mesh-cif-schema.js +30 -0
- package/lib/extensions/meshes/mesh-extension.d.ts +66 -0
- package/lib/extensions/meshes/mesh-extension.js +218 -0
- package/lib/extensions/meshes/mesh-streaming/behavior.d.ts +105 -0
- package/lib/extensions/meshes/mesh-streaming/behavior.js +375 -0
- package/lib/extensions/meshes/mesh-streaming/server-info.d.ts +54 -0
- package/lib/extensions/meshes/mesh-streaming/server-info.js +26 -0
- package/lib/extensions/meshes/mesh-streaming/transformers.d.ts +42 -0
- package/lib/extensions/meshes/mesh-streaming/transformers.js +270 -0
- package/lib/extensions/meshes/mesh-utils.d.ts +41 -0
- package/lib/extensions/meshes/mesh-utils.js +346 -0
- package/lib/extensions/meshes/metadata.d.ts +108 -0
- package/lib/extensions/meshes/metadata.js +69 -0
- package/lib/extensions/model-archive/quality-assessment/behavior.d.ts +2 -0
- package/lib/extensions/model-archive/quality-assessment/prop.d.ts +1 -0
- package/lib/extensions/model-archive/quality-assessment/prop.js +16 -4
- package/lib/extensions/rcsb/assembly-symmetry/behavior.d.ts +4 -2
- package/lib/extensions/rcsb/validation-report/behavior.d.ts +3 -0
- package/lib/extensions/volumes-and-segmentations/entry-meshes.d.ts +17 -0
- package/lib/extensions/volumes-and-segmentations/entry-meshes.js +153 -0
- package/lib/extensions/volumes-and-segmentations/entry-models.d.ts +12 -0
- package/lib/extensions/volumes-and-segmentations/entry-models.js +93 -0
- package/lib/extensions/volumes-and-segmentations/entry-root.d.ts +122 -0
- package/lib/extensions/volumes-and-segmentations/entry-root.js +571 -0
- package/lib/extensions/volumes-and-segmentations/entry-segmentation.d.ts +20 -0
- package/lib/extensions/volumes-and-segmentations/entry-segmentation.js +197 -0
- package/lib/extensions/volumes-and-segmentations/entry-state.d.ts +88 -0
- package/lib/extensions/volumes-and-segmentations/entry-state.js +29 -0
- package/lib/extensions/volumes-and-segmentations/entry-volume.d.ts +35 -0
- package/lib/extensions/volumes-and-segmentations/entry-volume.js +231 -0
- package/lib/extensions/volumes-and-segmentations/external-api.d.ts +11 -0
- package/lib/extensions/volumes-and-segmentations/external-api.js +80 -0
- package/lib/extensions/volumes-and-segmentations/global-state.d.ts +51 -0
- package/lib/extensions/volumes-and-segmentations/global-state.js +80 -0
- package/lib/extensions/volumes-and-segmentations/helpers.d.ts +56 -0
- package/lib/extensions/volumes-and-segmentations/helpers.js +163 -0
- package/lib/extensions/volumes-and-segmentations/index.d.ts +20 -0
- package/lib/extensions/volumes-and-segmentations/index.js +127 -0
- package/lib/extensions/volumes-and-segmentations/transformers.d.ts +33 -0
- package/lib/extensions/volumes-and-segmentations/transformers.js +82 -0
- package/lib/extensions/volumes-and-segmentations/ui.d.ts +29 -0
- package/lib/extensions/volumes-and-segmentations/ui.js +229 -0
- package/lib/extensions/volumes-and-segmentations/volseg-api/api.d.ts +22 -0
- package/lib/extensions/volumes-and-segmentations/volseg-api/api.js +80 -0
- package/lib/extensions/volumes-and-segmentations/volseg-api/data.d.ts +92 -0
- package/lib/extensions/volumes-and-segmentations/volseg-api/data.js +6 -0
- package/lib/extensions/volumes-and-segmentations/volseg-api/utils.d.ts +23 -0
- package/lib/extensions/volumes-and-segmentations/volseg-api/utils.js +75 -0
- package/lib/mol-canvas3d/canvas3d.d.ts +2 -0
- package/lib/mol-canvas3d/passes/draw.js +3 -3
- package/lib/mol-canvas3d/passes/image.d.ts +1 -0
- package/lib/mol-canvas3d/passes/postprocessing.d.ts +2 -1
- package/lib/mol-canvas3d/passes/postprocessing.js +27 -13
- package/lib/mol-geo/geometry/cylinders/cylinders.d.ts +2 -1
- package/lib/mol-geo/geometry/cylinders/cylinders.js +3 -2
- package/lib/mol-geo/geometry/lines/lines.d.ts +0 -1
- package/lib/mol-geo/geometry/points/points.d.ts +1 -1
- package/lib/mol-geo/geometry/spheres/spheres.d.ts +1 -0
- package/lib/mol-geo/geometry/spheres/spheres.js +3 -2
- package/lib/mol-gl/compute/histogram-pyramid/reduction.js +1 -2
- package/lib/mol-gl/compute/marching-cubes/isosurface.js +4 -6
- package/lib/mol-gl/renderable/cylinders.d.ts +1 -0
- package/lib/mol-gl/renderable/cylinders.js +1 -1
- package/lib/mol-gl/renderable/spheres.d.ts +1 -0
- package/lib/mol-gl/renderable/spheres.js +1 -1
- package/lib/mol-gl/shader/chunks/apply-light-color.glsl.d.ts +1 -1
- package/lib/mol-gl/shader/chunks/apply-light-color.glsl.js +1 -1
- package/lib/mol-gl/shader/chunks/clip-instance.glsl.d.ts +1 -1
- package/lib/mol-gl/shader/chunks/clip-instance.glsl.js +1 -1
- package/lib/mol-gl/shader/chunks/clip-pixel.glsl.d.ts +1 -1
- package/lib/mol-gl/shader/chunks/clip-pixel.glsl.js +1 -1
- package/lib/mol-gl/shader/chunks/common-clip.glsl.d.ts +2 -2
- package/lib/mol-gl/shader/chunks/common-clip.glsl.js +2 -2
- package/lib/mol-gl/shader/cylinders.frag.d.ts +1 -1
- package/lib/mol-gl/shader/cylinders.frag.js +1 -1
- package/lib/mol-gl/shader/cylinders.vert.d.ts +2 -2
- package/lib/mol-gl/shader/cylinders.vert.js +2 -2
- package/lib/mol-gl/shader/direct-volume.frag.d.ts +1 -1
- package/lib/mol-gl/shader/direct-volume.frag.js +1 -1
- package/lib/mol-gl/shader/outlines.frag.d.ts +1 -1
- package/lib/mol-gl/shader/outlines.frag.js +1 -1
- package/lib/mol-gl/shader/postprocessing.frag.d.ts +1 -1
- package/lib/mol-gl/shader/postprocessing.frag.js +1 -1
- package/lib/mol-gl/shader/spheres.frag.d.ts +1 -1
- package/lib/mol-gl/shader/spheres.frag.js +1 -1
- package/lib/mol-gl/shader/spheres.vert.d.ts +2 -2
- package/lib/mol-gl/shader/spheres.vert.js +2 -2
- package/lib/mol-gl/webgl/renderbuffer.d.ts +1 -1
- package/lib/mol-gl/webgl/renderbuffer.js +15 -0
- package/lib/mol-gl/webgl/state.d.ts +12 -0
- package/lib/mol-gl/webgl/state.js +136 -0
- package/lib/mol-io/reader/cif/schema/segmentation.d.ts +38 -0
- package/lib/mol-io/reader/cif/schema/segmentation.js +19 -0
- package/lib/mol-io/reader/cif.d.ts +3 -1
- package/lib/mol-io/reader/cif.js +3 -1
- package/lib/mol-model/location.d.ts +2 -1
- package/lib/mol-model/loci.d.ts +11 -11
- package/lib/mol-model/loci.js +13 -1
- package/lib/mol-model/sequence/alignment/sequence.d.ts +4 -1
- package/lib/mol-model/sequence/alignment/sequence.js +3 -2
- package/lib/mol-model/structure/model/properties/atomic/hierarchy.d.ts +6 -0
- package/lib/mol-model/structure/model/properties/utils/atomic-index.js +8 -0
- package/lib/mol-model/structure/structure/unit/bonds/inter-compute.js +21 -5
- package/lib/mol-model/structure/structure/util/superposition.d.ts +1 -0
- package/lib/mol-model/structure/structure/util/superposition.js +1 -1
- package/lib/mol-model/volume/volume.d.ts +35 -2
- package/lib/mol-model/volume/volume.js +79 -4
- package/lib/mol-model-formats/volume/segmentation.d.ts +23 -0
- package/lib/mol-model-formats/volume/segmentation.js +135 -0
- package/lib/mol-plugin/behavior/dynamic/representation.d.ts +2 -2
- package/lib/mol-plugin/behavior/dynamic/selection/structure-focus-representation.d.ts +1 -0
- package/lib/mol-plugin/behavior/dynamic/selection/structure-focus-representation.js +2 -1
- package/lib/mol-plugin/behavior/dynamic/volume-streaming/model.d.ts +2 -3
- package/lib/mol-plugin/commands.d.ts +1 -0
- package/lib/mol-plugin/version.js +2 -2
- package/lib/mol-plugin-state/animation/built-in/model-index.js +4 -1
- package/lib/mol-plugin-state/builder/structure/hierarchy-preset.d.ts +2 -0
- package/lib/mol-plugin-state/builder/structure/hierarchy.d.ts +1 -0
- package/lib/mol-plugin-state/builder/structure/representation-preset.d.ts +13 -4
- package/lib/mol-plugin-state/builder/structure/representation-preset.js +6 -1
- package/lib/mol-plugin-state/builder/structure/representation.d.ts +1 -0
- package/lib/mol-plugin-state/formats/provider.d.ts +2 -2
- package/lib/mol-plugin-state/formats/provider.js +11 -3
- package/lib/mol-plugin-state/formats/registry.js +6 -5
- package/lib/mol-plugin-state/formats/volume.d.ts +27 -0
- package/lib/mol-plugin-state/formats/volume.js +64 -0
- package/lib/mol-plugin-state/manager/structure/component.d.ts +1 -1
- package/lib/mol-plugin-state/manager/structure/component.js +18 -13
- package/lib/mol-plugin-state/transforms/representation.d.ts +1 -2
- package/lib/mol-plugin-state/transforms/representation.js +5 -6
- package/lib/mol-plugin-state/transforms/volume.d.ts +11 -1
- package/lib/mol-plugin-state/transforms/volume.js +54 -1
- package/lib/mol-plugin-ui/controls/line-graph/line-graph-component.d.ts +1 -0
- package/lib/mol-plugin-ui/controls/line-graph/line-graph-component.js +33 -13
- package/lib/mol-plugin-ui/controls/parameters.d.ts +1 -0
- package/lib/mol-plugin-ui/controls/parameters.js +22 -5
- package/lib/mol-plugin-ui/sequence/sequence.d.ts +25 -17
- package/lib/mol-plugin-ui/sequence.d.ts +19 -1
- package/lib/mol-plugin-ui/sequence.js +7 -7
- package/lib/mol-plugin-ui/skin/base/base.scss +32 -32
- package/lib/mol-plugin-ui/skin/base/components/controls-base.scss +333 -333
- package/lib/mol-plugin-ui/skin/base/components/controls.scss +418 -418
- package/lib/mol-plugin-ui/skin/base/components/help.scss +27 -27
- package/lib/mol-plugin-ui/skin/base/components/line-graph.scss +67 -67
- package/lib/mol-plugin-ui/skin/base/components/log.scss +100 -100
- package/lib/mol-plugin-ui/skin/base/components/misc.scss +643 -643
- package/lib/mol-plugin-ui/skin/base/components/sequence.scss +125 -125
- package/lib/mol-plugin-ui/skin/base/components/slider.scss +165 -165
- package/lib/mol-plugin-ui/skin/base/components/tasks.scss +99 -99
- package/lib/mol-plugin-ui/skin/base/components/toast.scss +83 -83
- package/lib/mol-plugin-ui/skin/base/components/transformer.scss +163 -163
- package/lib/mol-plugin-ui/skin/base/components/viewport.scss +137 -128
- package/lib/mol-plugin-ui/skin/base/layout/common.scss +71 -71
- package/lib/mol-plugin-ui/skin/base/layout/controls-landscape.scss +89 -89
- package/lib/mol-plugin-ui/skin/base/layout/controls-outside.scss +98 -98
- package/lib/mol-plugin-ui/skin/base/layout/controls-portrait.scss +108 -108
- package/lib/mol-plugin-ui/skin/base/layout.scss +40 -40
- package/lib/mol-plugin-ui/skin/base/logo.scss +12 -12
- package/lib/mol-plugin-ui/skin/base/normalize.scss +209 -209
- package/lib/mol-plugin-ui/skin/base/ui.scss +40 -40
- package/lib/mol-plugin-ui/skin/base/variables.scss +85 -85
- package/lib/mol-plugin-ui/skin/blue.scss +1 -1
- package/lib/mol-plugin-ui/skin/colors/blue.scss +23 -23
- package/lib/mol-plugin-ui/skin/colors/dark.scss +23 -23
- package/lib/mol-plugin-ui/skin/colors/light.scss +29 -29
- package/lib/mol-plugin-ui/skin/dark.scss +1 -1
- package/lib/mol-plugin-ui/skin/light.scss +1 -1
- package/lib/mol-plugin-ui/state/apply-action.d.ts +2 -10
- package/lib/mol-plugin-ui/state/apply-action.js +2 -2
- package/lib/mol-plugin-ui/structure/quick-styles.js +2 -2
- package/lib/mol-plugin-ui/structure/superposition.d.ts +1 -1
- package/lib/mol-plugin-ui/structure/volume.d.ts +1 -1
- package/lib/mol-plugin-ui/structure/volume.js +3 -2
- package/lib/mol-repr/structure/complex-visual.d.ts +1 -0
- package/lib/mol-repr/structure/params.d.ts +2 -0
- package/lib/mol-repr/structure/registry.d.ts +12 -0
- package/lib/mol-repr/structure/representation/backbone.d.ts +3 -0
- package/lib/mol-repr/structure/representation/ball-and-stick.d.ts +6 -0
- package/lib/mol-repr/structure/representation/ellipsoid.d.ts +6 -0
- package/lib/mol-repr/structure/representation/gaussian-surface.d.ts +3 -0
- package/lib/mol-repr/structure/representation/gaussian-volume.d.ts +3 -0
- package/lib/mol-repr/structure/representation/line.d.ts +3 -0
- package/lib/mol-repr/structure/representation/molecular-surface.d.ts +3 -0
- package/lib/mol-repr/structure/representation/point.d.ts +3 -0
- package/lib/mol-repr/structure/representation/spacefill.d.ts +6 -0
- package/lib/mol-repr/structure/units-visual.d.ts +2 -0
- package/lib/mol-repr/structure/visual/bond-inter-unit-cylinder.d.ts +4 -0
- package/lib/mol-repr/structure/visual/bond-inter-unit-cylinder.js +2 -0
- package/lib/mol-repr/structure/visual/bond-inter-unit-line.d.ts +1 -0
- package/lib/mol-repr/structure/visual/bond-inter-unit-line.js +1 -0
- package/lib/mol-repr/structure/visual/bond-intra-unit-cylinder.d.ts +4 -0
- package/lib/mol-repr/structure/visual/bond-intra-unit-cylinder.js +2 -0
- package/lib/mol-repr/structure/visual/bond-intra-unit-line.d.ts +1 -0
- package/lib/mol-repr/structure/visual/bond-intra-unit-line.js +1 -0
- package/lib/mol-repr/structure/visual/element-cross.d.ts +1 -0
- package/lib/mol-repr/structure/visual/element-cross.js +2 -1
- package/lib/mol-repr/structure/visual/element-point.d.ts +1 -0
- package/lib/mol-repr/structure/visual/element-point.js +2 -1
- package/lib/mol-repr/structure/visual/element-sphere.d.ts +4 -0
- package/lib/mol-repr/structure/visual/element-sphere.js +3 -1
- package/lib/mol-repr/structure/visual/gaussian-density-volume.d.ts +2 -0
- package/lib/mol-repr/structure/visual/gaussian-density-volume.js +6 -2
- package/lib/mol-repr/structure/visual/gaussian-surface-mesh.d.ts +4 -0
- package/lib/mol-repr/structure/visual/gaussian-surface-mesh.js +9 -1
- package/lib/mol-repr/structure/visual/gaussian-surface-wireframe.d.ts +1 -0
- package/lib/mol-repr/structure/visual/gaussian-surface-wireframe.js +3 -1
- package/lib/mol-repr/structure/visual/molecular-surface-mesh.d.ts +1 -0
- package/lib/mol-repr/structure/visual/molecular-surface-mesh.js +4 -0
- package/lib/mol-repr/structure/visual/molecular-surface-wireframe.d.ts +1 -0
- package/lib/mol-repr/structure/visual/molecular-surface-wireframe.js +2 -0
- package/lib/mol-repr/structure/visual/polymer-backbone-cylinder.d.ts +2 -0
- package/lib/mol-repr/structure/visual/polymer-backbone-sphere.d.ts +2 -0
- package/lib/mol-repr/structure/visual/util/bond.d.ts +7 -0
- package/lib/mol-repr/structure/visual/util/bond.js +19 -8
- package/lib/mol-repr/structure/visual/util/common.d.ts +4 -1
- package/lib/mol-repr/structure/visual/util/common.js +10 -6
- package/lib/mol-repr/structure/visual/util/element.d.ts +1 -0
- package/lib/mol-repr/structure/visual/util/element.js +3 -4
- package/lib/mol-repr/structure/visual/util/gaussian.d.ts +2 -0
- package/lib/mol-repr/volume/direct-volume.d.ts +4 -4
- package/lib/mol-repr/volume/direct-volume.js +8 -6
- package/lib/mol-repr/volume/isosurface.d.ts +4 -4
- package/lib/mol-repr/volume/isosurface.js +17 -16
- package/lib/mol-repr/volume/registry.d.ts +54 -1
- package/lib/mol-repr/volume/registry.js +3 -1
- package/lib/mol-repr/volume/representation.d.ts +11 -7
- package/lib/mol-repr/volume/representation.js +144 -49
- package/lib/mol-repr/volume/segment.d.ts +291 -0
- package/lib/mol-repr/volume/segment.js +279 -0
- package/lib/mol-repr/volume/slice.d.ts +2 -2
- package/lib/mol-repr/volume/slice.js +5 -5
- package/lib/mol-repr/volume/util.d.ts +12 -3
- package/lib/mol-repr/volume/util.js +71 -6
- package/lib/mol-script/language/builder.d.ts +1 -0
- package/lib/mol-theme/color/volume-segment.d.ts +41 -0
- package/lib/mol-theme/color/volume-segment.js +53 -0
- package/lib/mol-theme/color/volume-value.js +2 -1
- package/lib/mol-theme/color.d.ts +15 -0
- package/lib/mol-theme/color.js +2 -0
- package/lib/mol-theme/label.d.ts +1 -1
- package/lib/mol-theme/label.js +13 -1
- package/lib/mol-util/param-definition.d.ts +4 -1
- package/lib/mol-util/param-definition.js +5 -2
- package/package.json +169 -168
|
@@ -0,0 +1,221 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Copyright (c) 2018-2022 mol* contributors, licensed under MIT, See LICENSE file for more info.
|
|
4
|
+
*
|
|
5
|
+
* @author Adam Midlik <midlik@gmail.com>
|
|
6
|
+
*/
|
|
7
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
+
exports.MeshShapeTransformer = exports.ParseMeshlistTransformer = exports.MeshlistStateObject = exports.MeshlistData = exports.VolsegTransform = void 0;
|
|
9
|
+
var tslib_1 = require("tslib");
|
|
10
|
+
/** Defines new types of State tree transformers for dealing with mesh data. */
|
|
11
|
+
var base_1 = require("../../mol-geo/geometry/base");
|
|
12
|
+
var mesh_1 = require("../../mol-geo/geometry/mesh/mesh");
|
|
13
|
+
var geometry_1 = require("../../mol-math/geometry");
|
|
14
|
+
var linear_algebra_1 = require("../../mol-math/linear-algebra");
|
|
15
|
+
var shape_1 = require("../../mol-model/shape");
|
|
16
|
+
var objects_1 = require("../../mol-plugin-state/objects");
|
|
17
|
+
var mol_state_1 = require("../../mol-state");
|
|
18
|
+
var mol_task_1 = require("../../mol-task");
|
|
19
|
+
var material_1 = require("../../mol-util/material");
|
|
20
|
+
var param_definition_1 = require("../../mol-util/param-definition");
|
|
21
|
+
var MeshUtils = tslib_1.__importStar(require("./mesh-utils"));
|
|
22
|
+
exports.VolsegTransform = mol_state_1.StateTransformer.builderFactory('volseg');
|
|
23
|
+
var MeshlistData;
|
|
24
|
+
(function (MeshlistData) {
|
|
25
|
+
function empty() {
|
|
26
|
+
return {
|
|
27
|
+
segmentId: 0,
|
|
28
|
+
segmentName: 'Empty',
|
|
29
|
+
detail: 0,
|
|
30
|
+
meshIds: [],
|
|
31
|
+
mesh: mesh_1.Mesh.createEmpty(),
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
MeshlistData.empty = empty;
|
|
35
|
+
;
|
|
36
|
+
function fromCIF(data, segmentId, segmentName, detail) {
|
|
37
|
+
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
38
|
+
var _a, mesh, meshIds;
|
|
39
|
+
return tslib_1.__generator(this, function (_b) {
|
|
40
|
+
switch (_b.label) {
|
|
41
|
+
case 0: return [4 /*yield*/, MeshUtils.meshFromCif(data)];
|
|
42
|
+
case 1:
|
|
43
|
+
_a = _b.sent(), mesh = _a.mesh, meshIds = _a.meshIds;
|
|
44
|
+
return [2 /*return*/, {
|
|
45
|
+
segmentId: segmentId,
|
|
46
|
+
segmentName: segmentName,
|
|
47
|
+
detail: detail,
|
|
48
|
+
meshIds: meshIds,
|
|
49
|
+
mesh: mesh,
|
|
50
|
+
}];
|
|
51
|
+
}
|
|
52
|
+
});
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
MeshlistData.fromCIF = fromCIF;
|
|
56
|
+
function stats(meshListData) {
|
|
57
|
+
return "Meshlist \"".concat(meshListData.segmentName, "\" (detail ").concat(meshListData.detail, "): ").concat(meshListData.meshIds.length, " meshes, ").concat(meshListData.mesh.vertexCount, " vertices, ").concat(meshListData.mesh.triangleCount, " triangles");
|
|
58
|
+
}
|
|
59
|
+
MeshlistData.stats = stats;
|
|
60
|
+
function getShape(data, color) {
|
|
61
|
+
var mesh = data.mesh;
|
|
62
|
+
var meshShape = shape_1.Shape.create(data.segmentName, data, mesh, function () { return color; }, function () { return 1; },
|
|
63
|
+
// group => `${data.segmentName} | Segment ${data.segmentId} | Detail ${data.detail} | Mesh ${group}`,
|
|
64
|
+
function (group) { return data.segmentName; });
|
|
65
|
+
return meshShape;
|
|
66
|
+
}
|
|
67
|
+
MeshlistData.getShape = getShape;
|
|
68
|
+
function combineBBoxes(boxes) {
|
|
69
|
+
var result = null;
|
|
70
|
+
for (var _i = 0, boxes_1 = boxes; _i < boxes_1.length; _i++) {
|
|
71
|
+
var box = boxes_1[_i];
|
|
72
|
+
if (!box)
|
|
73
|
+
continue;
|
|
74
|
+
if (result) {
|
|
75
|
+
linear_algebra_1.Vec3.min(result.min, result.min, box.min);
|
|
76
|
+
linear_algebra_1.Vec3.max(result.max, result.max, box.max);
|
|
77
|
+
}
|
|
78
|
+
else {
|
|
79
|
+
result = geometry_1.Box3D.zero();
|
|
80
|
+
geometry_1.Box3D.copy(result, box);
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
return result;
|
|
84
|
+
}
|
|
85
|
+
MeshlistData.combineBBoxes = combineBBoxes;
|
|
86
|
+
function bbox(data) {
|
|
87
|
+
return MeshUtils.bbox(data.mesh);
|
|
88
|
+
}
|
|
89
|
+
MeshlistData.bbox = bbox;
|
|
90
|
+
function allVerticesUsed(data) {
|
|
91
|
+
var unusedVertices = new Set();
|
|
92
|
+
for (var i = 0; i < data.mesh.vertexCount; i++) {
|
|
93
|
+
unusedVertices.add(i);
|
|
94
|
+
}
|
|
95
|
+
for (var i = 0; i < 3 * data.mesh.triangleCount; i++) {
|
|
96
|
+
var v = data.mesh.vertexBuffer.ref.value[i];
|
|
97
|
+
unusedVertices.delete(v);
|
|
98
|
+
}
|
|
99
|
+
return unusedVertices.size === 0;
|
|
100
|
+
}
|
|
101
|
+
MeshlistData.allVerticesUsed = allVerticesUsed;
|
|
102
|
+
})(MeshlistData = exports.MeshlistData || (exports.MeshlistData = {}));
|
|
103
|
+
// // // // // // // // // // // // // // // // // // // // // // // //
|
|
104
|
+
// Raw Data -> Parsed data
|
|
105
|
+
var MeshlistStateObject = /** @class */ (function (_super) {
|
|
106
|
+
tslib_1.__extends(MeshlistStateObject, _super);
|
|
107
|
+
function MeshlistStateObject() {
|
|
108
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
109
|
+
}
|
|
110
|
+
return MeshlistStateObject;
|
|
111
|
+
}(objects_1.PluginStateObject.Create({ name: 'Parsed Meshlist', typeClass: 'Object' })));
|
|
112
|
+
exports.MeshlistStateObject = MeshlistStateObject;
|
|
113
|
+
// QUESTION: is typeClass just for color, or does do something?
|
|
114
|
+
exports.ParseMeshlistTransformer = (0, exports.VolsegTransform)({
|
|
115
|
+
name: 'meshlist-from-string',
|
|
116
|
+
from: objects_1.PluginStateObject.Format.Cif,
|
|
117
|
+
to: MeshlistStateObject,
|
|
118
|
+
params: {
|
|
119
|
+
label: param_definition_1.ParamDefinition.Text(MeshlistStateObject.type.name, { isHidden: true }),
|
|
120
|
+
segmentId: param_definition_1.ParamDefinition.Numeric(1, {}, { isHidden: true }),
|
|
121
|
+
segmentName: param_definition_1.ParamDefinition.Text('Segment'),
|
|
122
|
+
detail: param_definition_1.ParamDefinition.Numeric(1, {}, { isHidden: true }),
|
|
123
|
+
/** Reference to the object which manages this meshlist (e.g. `MeshStreaming.Behavior`) */
|
|
124
|
+
ownerId: param_definition_1.ParamDefinition.Text('', { isHidden: true }),
|
|
125
|
+
}
|
|
126
|
+
})({
|
|
127
|
+
apply: function (_a, globalCtx) {
|
|
128
|
+
var _this = this;
|
|
129
|
+
var a = _a.a, params = _a.params;
|
|
130
|
+
return mol_task_1.Task.create('Create Parsed Meshlist', function (ctx) { return tslib_1.__awaiter(_this, void 0, void 0, function () {
|
|
131
|
+
var meshlistData, es;
|
|
132
|
+
return tslib_1.__generator(this, function (_a) {
|
|
133
|
+
switch (_a.label) {
|
|
134
|
+
case 0: return [4 /*yield*/, MeshlistData.fromCIF(a.data, params.segmentId, params.segmentName, params.detail)];
|
|
135
|
+
case 1:
|
|
136
|
+
meshlistData = _a.sent();
|
|
137
|
+
meshlistData.ownerId = params.ownerId;
|
|
138
|
+
es = meshlistData.meshIds.length === 1 ? '' : 'es';
|
|
139
|
+
return [2 /*return*/, new MeshlistStateObject(meshlistData, { label: params.label, description: "".concat(meshlistData.segmentName, " (").concat(meshlistData.meshIds.length, " mesh").concat(es, ")") })];
|
|
140
|
+
}
|
|
141
|
+
});
|
|
142
|
+
}); });
|
|
143
|
+
}
|
|
144
|
+
});
|
|
145
|
+
var MeshShapeProvider;
|
|
146
|
+
(function (MeshShapeProvider) {
|
|
147
|
+
function fromMeshlistData(meshlist, color) {
|
|
148
|
+
var theColor = color !== null && color !== void 0 ? color : MeshUtils.ColorGenerator.next().value;
|
|
149
|
+
return {
|
|
150
|
+
label: 'Mesh',
|
|
151
|
+
data: meshlist,
|
|
152
|
+
params: meshParamDef,
|
|
153
|
+
geometryUtils: mesh_1.Mesh.Utils,
|
|
154
|
+
getShape: function (ctx, data) { return MeshlistData.getShape(data, theColor); },
|
|
155
|
+
};
|
|
156
|
+
}
|
|
157
|
+
MeshShapeProvider.fromMeshlistData = fromMeshlistData;
|
|
158
|
+
})(MeshShapeProvider || (MeshShapeProvider = {}));
|
|
159
|
+
/** Params for MeshShapeTransformer */
|
|
160
|
+
var meshShapeParamDef = {
|
|
161
|
+
color: param_definition_1.ParamDefinition.Value(undefined), // undefined means random color
|
|
162
|
+
};
|
|
163
|
+
var meshParamDef = {
|
|
164
|
+
// These are basically original MS.Mesh.Params:
|
|
165
|
+
// BaseGeometry.Params
|
|
166
|
+
alpha: param_definition_1.ParamDefinition.Numeric(1, { min: 0, max: 1, step: 0.01 }, { label: 'Opacity', isEssential: true, description: 'How opaque/transparent the representation is rendered.' }),
|
|
167
|
+
quality: param_definition_1.ParamDefinition.Select('custom', base_1.VisualQualityOptions, { isEssential: true, description: 'Visual/rendering quality of the representation.' }),
|
|
168
|
+
material: material_1.Material.getParam(),
|
|
169
|
+
clip: mesh_1.Mesh.Params.clip,
|
|
170
|
+
instanceGranularity: param_definition_1.ParamDefinition.Boolean(false, { description: 'Use instance granularity for marker, transparency, clipping, overpaint, substance data to save memory.' }),
|
|
171
|
+
// Mesh.Params
|
|
172
|
+
doubleSided: param_definition_1.ParamDefinition.Boolean(true, base_1.BaseGeometry.CustomQualityParamInfo),
|
|
173
|
+
flipSided: param_definition_1.ParamDefinition.Boolean(false, base_1.BaseGeometry.ShadingCategory),
|
|
174
|
+
flatShaded: param_definition_1.ParamDefinition.Boolean(false, base_1.BaseGeometry.ShadingCategory),
|
|
175
|
+
ignoreLight: param_definition_1.ParamDefinition.Boolean(false, base_1.BaseGeometry.ShadingCategory),
|
|
176
|
+
xrayShaded: param_definition_1.ParamDefinition.Boolean(false, base_1.BaseGeometry.ShadingCategory),
|
|
177
|
+
transparentBackfaces: param_definition_1.ParamDefinition.Select('off', param_definition_1.ParamDefinition.arrayToOptions(['off', 'on', 'opaque']), base_1.BaseGeometry.ShadingCategory),
|
|
178
|
+
bumpFrequency: param_definition_1.ParamDefinition.Numeric(0, { min: 0, max: 10, step: 0.1 }, base_1.BaseGeometry.ShadingCategory),
|
|
179
|
+
bumpAmplitude: param_definition_1.ParamDefinition.Numeric(1, { min: 0, max: 5, step: 0.1 }, base_1.BaseGeometry.ShadingCategory),
|
|
180
|
+
// TODO when I change values here, it has effect, but not if I change them in GUI
|
|
181
|
+
};
|
|
182
|
+
exports.MeshShapeTransformer = (0, exports.VolsegTransform)({
|
|
183
|
+
name: 'shape-from-meshlist',
|
|
184
|
+
display: { name: 'Shape from Meshlist', description: 'Create Shape from Meshlist data' },
|
|
185
|
+
from: MeshlistStateObject,
|
|
186
|
+
to: objects_1.PluginStateObject.Shape.Provider,
|
|
187
|
+
params: meshShapeParamDef
|
|
188
|
+
})({
|
|
189
|
+
apply: function (_a) {
|
|
190
|
+
var a = _a.a, params = _a.params;
|
|
191
|
+
// you can look for example at ShapeFromPly in mol-plugin-state/tansforms/model.ts as an example
|
|
192
|
+
var shapeProvider = MeshShapeProvider.fromMeshlistData(a.data, params.color);
|
|
193
|
+
return new objects_1.PluginStateObject.Shape.Provider(shapeProvider, { label: objects_1.PluginStateObject.Shape.Provider.type.name, description: a.description });
|
|
194
|
+
}
|
|
195
|
+
});
|
|
196
|
+
// // // // // // // // // // // // // // // // // // // // // // // //
|
|
197
|
+
// Shape -> Repr
|
|
198
|
+
// type MeshRepr = MS.PluginStateObject.Representation3DData<MS.ShapeRepresentation<MS.ShapeProvider<any,any,any>, MS.Mesh, MS.Mesh.Params>, any>;
|
|
199
|
+
// export const CustomMeshReprTransformer = VolsegTransform({
|
|
200
|
+
// name: 'custom-repr',
|
|
201
|
+
// from: MS.PluginStateObject.Shape.Provider, // later we can change this
|
|
202
|
+
// to: MS.PluginStateObject.Shape.Representation3D,
|
|
203
|
+
// })({
|
|
204
|
+
// apply({ a }, globalCtx) {
|
|
205
|
+
// const repr: MeshRepr = createRepr(a.data); // TODO implement createRepr
|
|
206
|
+
// // have a look at MS.StateTransforms.Representation.ShapeRepresentation3D if you want to try implementing yourself
|
|
207
|
+
// return new MS.PluginStateObject.Shape.Representation3D(repr)
|
|
208
|
+
// },
|
|
209
|
+
// })
|
|
210
|
+
// export async function createMeshRepr(plugin: MS.PluginContext, data: any) {
|
|
211
|
+
// await plugin.build()
|
|
212
|
+
// .toRoot()
|
|
213
|
+
// .apply(CreateMyShapeTransformer, { data })
|
|
214
|
+
// .apply(MS.StateTransforms.Representation.ShapeRepresentation3D) // this should work
|
|
215
|
+
// // or .apply(CustomMeshRepr)
|
|
216
|
+
// .commit();
|
|
217
|
+
// }
|
|
218
|
+
// export function createRepr(reprData: MS.ShapeProvider<any,any,any>): MeshRepr {
|
|
219
|
+
// throw new Error('NotImplemented');
|
|
220
|
+
// return {} as MeshRepr;
|
|
221
|
+
// }
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2018-2022 mol* contributors, licensed under MIT, See LICENSE file for more info.
|
|
3
|
+
*
|
|
4
|
+
* @author Adam Midlik <midlik@gmail.com>
|
|
5
|
+
*/
|
|
6
|
+
import { PluginStateObject } from '../../../mol-plugin-state/objects';
|
|
7
|
+
import { PluginBehavior } from '../../../mol-plugin/behavior';
|
|
8
|
+
import { PluginContext } from '../../../mol-plugin/context';
|
|
9
|
+
import { UUID } from '../../../mol-util';
|
|
10
|
+
import { Color } from '../../../mol-util/color';
|
|
11
|
+
import { ParamDefinition as PD } from '../../../mol-util/param-definition';
|
|
12
|
+
import { Choice } from '../choice';
|
|
13
|
+
import { MeshlistData } from '../mesh-extension';
|
|
14
|
+
import { MeshServerInfo } from './server-info';
|
|
15
|
+
export declare const NO_SEGMENT = -1;
|
|
16
|
+
/** Segments whose bounding box volume is above this value (relative to the overall bounding box) are considered as background segments */
|
|
17
|
+
export declare const BACKGROUND_SEGMENT_VOLUME_THRESHOLD = 0.5;
|
|
18
|
+
declare const MeshStreaming_base: {
|
|
19
|
+
new (data: MeshStreaming.Behavior, props?: {
|
|
20
|
+
label: string;
|
|
21
|
+
description?: string | undefined;
|
|
22
|
+
} | undefined): {
|
|
23
|
+
id: UUID;
|
|
24
|
+
type: PluginStateObject.TypeInfo;
|
|
25
|
+
label: string;
|
|
26
|
+
description?: string | undefined;
|
|
27
|
+
data: MeshStreaming.Behavior;
|
|
28
|
+
};
|
|
29
|
+
type: PluginStateObject.TypeInfo;
|
|
30
|
+
is(obj?: import("../../../mol-state/object").StateObject<any, import("../../../mol-state/object").StateObject.Type<any>> | undefined): obj is {
|
|
31
|
+
id: UUID;
|
|
32
|
+
type: PluginStateObject.TypeInfo;
|
|
33
|
+
label: string;
|
|
34
|
+
description?: string | undefined;
|
|
35
|
+
data: MeshStreaming.Behavior;
|
|
36
|
+
};
|
|
37
|
+
};
|
|
38
|
+
export declare class MeshStreaming extends MeshStreaming_base {
|
|
39
|
+
}
|
|
40
|
+
export declare namespace MeshStreaming {
|
|
41
|
+
namespace Params {
|
|
42
|
+
const ViewTypeChoice: Choice<"all" | "select" | "off", "select">;
|
|
43
|
+
type ViewType = Choice.Values<typeof ViewTypeChoice>;
|
|
44
|
+
function create(options: MeshServerInfo.Data): {
|
|
45
|
+
view: PD.Mapped<PD.NamedParams<PD.Normalize<unknown>, "off"> | PD.NamedParams<PD.Normalize<{
|
|
46
|
+
detail: number;
|
|
47
|
+
}>, "all"> | PD.NamedParams<PD.Normalize<{
|
|
48
|
+
baseDetail: number;
|
|
49
|
+
focusDetail: number;
|
|
50
|
+
selectedSegment: number;
|
|
51
|
+
}>, "select">>;
|
|
52
|
+
};
|
|
53
|
+
type Definition = ReturnType<typeof create>;
|
|
54
|
+
type Values = PD.Values<Definition>;
|
|
55
|
+
function copyValues(params: Values): Values;
|
|
56
|
+
function valuesEqual(p: Values, q: Values): boolean;
|
|
57
|
+
function detailsEqual(p: Values, q: Values): boolean;
|
|
58
|
+
}
|
|
59
|
+
interface VisualInfo {
|
|
60
|
+
tag: string;
|
|
61
|
+
segmentId: number;
|
|
62
|
+
segmentName: string;
|
|
63
|
+
detailType: VisualInfo.DetailType;
|
|
64
|
+
detail: number;
|
|
65
|
+
color: Color;
|
|
66
|
+
visible: boolean;
|
|
67
|
+
data?: MeshlistData;
|
|
68
|
+
}
|
|
69
|
+
namespace VisualInfo {
|
|
70
|
+
type DetailType = 'low' | 'high';
|
|
71
|
+
const DetailTypes: DetailType[];
|
|
72
|
+
function tagFor(segmentId: number, detail: DetailType): string;
|
|
73
|
+
}
|
|
74
|
+
class Behavior extends PluginBehavior.WithSubscribers<Params.Values> {
|
|
75
|
+
private id;
|
|
76
|
+
private ref;
|
|
77
|
+
parentData: MeshServerInfo.Data;
|
|
78
|
+
private metadata?;
|
|
79
|
+
visuals?: {
|
|
80
|
+
[tag: string]: VisualInfo;
|
|
81
|
+
};
|
|
82
|
+
backgroundSegments: {
|
|
83
|
+
[segmentId: number]: boolean;
|
|
84
|
+
};
|
|
85
|
+
private focusObservable;
|
|
86
|
+
private focusSubscription?;
|
|
87
|
+
private backgroundSegmentsInitialized;
|
|
88
|
+
constructor(plugin: PluginContext, data: MeshServerInfo.Data, params: Params.Values);
|
|
89
|
+
register(ref: string): void;
|
|
90
|
+
unregister(): void;
|
|
91
|
+
selectSegment(segmentId: number): void;
|
|
92
|
+
update(params: Params.Values): Promise<boolean>;
|
|
93
|
+
private getMetadataUrl;
|
|
94
|
+
private getMeshUrl;
|
|
95
|
+
private initVisualInfos;
|
|
96
|
+
private updateVisualInfoDetails;
|
|
97
|
+
private enableVisuals;
|
|
98
|
+
private disableVisuals;
|
|
99
|
+
/** Fetch data in current `visual.detail`, or return already fetched data (if available in the correct detail). */
|
|
100
|
+
private getMeshData;
|
|
101
|
+
private guessBackgroundSegments;
|
|
102
|
+
getDescription(): string;
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
export {};
|