molstar 2.4.1 → 3.0.0-dev.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/build/viewer/molstar.js +1 -1
- package/lib/apps/docking-viewer/viewport.js +14 -14
- package/lib/apps/docking-viewer/viewport.js.map +1 -1
- package/lib/commonjs/apps/docking-viewer/viewport.js +14 -14
- package/lib/commonjs/apps/docking-viewer/viewport.js.map +1 -1
- package/lib/commonjs/extensions/anvil/behavior.d.ts +1 -0
- package/lib/commonjs/extensions/anvil/representation.d.ts +20 -0
- package/lib/commonjs/extensions/cellpack/representation.d.ts +4 -0
- package/lib/commonjs/extensions/dnatco/confal-pyramids/representation.d.ts +12 -0
- package/lib/commonjs/extensions/geo-export/controls.js +15 -17
- package/lib/commonjs/extensions/geo-export/controls.js.map +1 -1
- package/lib/commonjs/extensions/geo-export/glb-exporter.d.ts +4 -3
- package/lib/commonjs/extensions/geo-export/glb-exporter.js +23 -11
- package/lib/commonjs/extensions/geo-export/glb-exporter.js.map +1 -1
- package/lib/commonjs/extensions/geo-export/usdz-exporter.d.ts +2 -5
- package/lib/commonjs/extensions/geo-export/usdz-exporter.js +14 -15
- package/lib/commonjs/extensions/geo-export/usdz-exporter.js.map +1 -1
- package/lib/commonjs/extensions/rcsb/assembly-symmetry/behavior.d.ts +3 -2
- package/lib/commonjs/extensions/rcsb/assembly-symmetry/representation.d.ts +4 -0
- package/lib/commonjs/extensions/rcsb/validation-report/representation.d.ts +20 -0
- package/lib/commonjs/mol-canvas3d/canvas3d.d.ts +18 -14
- package/lib/commonjs/mol-canvas3d/helper/camera-helper.d.ts +1 -0
- package/lib/commonjs/mol-canvas3d/helper/handle-helper.d.ts +1 -0
- package/lib/commonjs/mol-canvas3d/helper/helper.d.ts +2 -0
- package/lib/commonjs/mol-canvas3d/passes/image.d.ts +1 -0
- package/lib/commonjs/mol-geo/geometry/base.d.ts +11 -2
- package/lib/commonjs/mol-geo/geometry/base.js +14 -4
- package/lib/commonjs/mol-geo/geometry/base.js.map +1 -1
- package/lib/commonjs/mol-geo/geometry/cylinders/cylinders.d.ts +4 -0
- package/lib/commonjs/mol-geo/geometry/cylinders/cylinders.js +3 -1
- package/lib/commonjs/mol-geo/geometry/cylinders/cylinders.js.map +1 -1
- package/lib/commonjs/mol-geo/geometry/direct-volume/direct-volume.d.ts +4 -0
- package/lib/commonjs/mol-geo/geometry/direct-volume/direct-volume.js +4 -3
- package/lib/commonjs/mol-geo/geometry/direct-volume/direct-volume.js.map +1 -1
- package/lib/commonjs/mol-geo/geometry/image/image.d.ts +4 -0
- package/lib/commonjs/mol-geo/geometry/image/image.js +3 -1
- package/lib/commonjs/mol-geo/geometry/image/image.js.map +1 -1
- package/lib/commonjs/mol-geo/geometry/lines/lines.d.ts +4 -0
- package/lib/commonjs/mol-geo/geometry/lines/lines.js +3 -1
- package/lib/commonjs/mol-geo/geometry/lines/lines.js.map +1 -1
- package/lib/commonjs/mol-geo/geometry/mesh/color-smoothing.d.ts +1 -0
- package/lib/commonjs/mol-geo/geometry/mesh/color-smoothing.js +35 -1
- package/lib/commonjs/mol-geo/geometry/mesh/color-smoothing.js.map +1 -1
- package/lib/commonjs/mol-geo/geometry/mesh/mesh.d.ts +4 -0
- package/lib/commonjs/mol-geo/geometry/mesh/mesh.js +3 -1
- package/lib/commonjs/mol-geo/geometry/mesh/mesh.js.map +1 -1
- package/lib/commonjs/mol-geo/geometry/points/points.d.ts +4 -0
- package/lib/commonjs/mol-geo/geometry/points/points.js +3 -1
- package/lib/commonjs/mol-geo/geometry/points/points.js.map +1 -1
- package/lib/commonjs/mol-geo/geometry/spheres/spheres.d.ts +4 -0
- package/lib/commonjs/mol-geo/geometry/spheres/spheres.js +3 -1
- package/lib/commonjs/mol-geo/geometry/spheres/spheres.js.map +1 -1
- package/lib/commonjs/mol-geo/geometry/substance-data.d.ts +23 -0
- package/lib/commonjs/mol-geo/geometry/substance-data.js +68 -0
- package/lib/commonjs/mol-geo/geometry/substance-data.js.map +1 -0
- package/lib/commonjs/mol-geo/geometry/text/text.d.ts +4 -0
- package/lib/commonjs/mol-geo/geometry/text/text.js +3 -1
- package/lib/commonjs/mol-geo/geometry/text/text.js.map +1 -1
- package/lib/commonjs/mol-geo/geometry/texture-mesh/color-smoothing.d.ts +1 -0
- package/lib/commonjs/mol-geo/geometry/texture-mesh/color-smoothing.js +33 -1
- package/lib/commonjs/mol-geo/geometry/texture-mesh/color-smoothing.js.map +1 -1
- package/lib/commonjs/mol-geo/geometry/texture-mesh/texture-mesh.d.ts +4 -0
- package/lib/commonjs/mol-geo/geometry/texture-mesh/texture-mesh.js +3 -1
- package/lib/commonjs/mol-geo/geometry/texture-mesh/texture-mesh.js.map +1 -1
- package/lib/commonjs/mol-gl/_spec/renderer.spec.js +1 -1
- package/lib/commonjs/mol-gl/renderable/cylinders.d.ts +10 -0
- package/lib/commonjs/mol-gl/renderable/direct-volume.d.ts +10 -0
- package/lib/commonjs/mol-gl/renderable/image.d.ts +10 -0
- package/lib/commonjs/mol-gl/renderable/lines.d.ts +10 -0
- package/lib/commonjs/mol-gl/renderable/mesh.d.ts +10 -0
- package/lib/commonjs/mol-gl/renderable/points.d.ts +10 -0
- package/lib/commonjs/mol-gl/renderable/points.js +1 -2
- package/lib/commonjs/mol-gl/renderable/points.js.map +1 -1
- package/lib/commonjs/mol-gl/renderable/schema.d.ts +24 -5
- package/lib/commonjs/mol-gl/renderable/schema.js +15 -11
- package/lib/commonjs/mol-gl/renderable/schema.js.map +1 -1
- package/lib/commonjs/mol-gl/renderable/spheres.d.ts +10 -0
- package/lib/commonjs/mol-gl/renderable/text.d.ts +10 -0
- package/lib/commonjs/mol-gl/renderable/texture-mesh.d.ts +10 -0
- package/lib/commonjs/mol-gl/renderer.d.ts +9 -15
- package/lib/commonjs/mol-gl/renderer.js +53 -61
- package/lib/commonjs/mol-gl/renderer.js.map +1 -1
- package/lib/commonjs/mol-gl/shader/chunks/apply-light-color.glsl.d.ts +3 -3
- package/lib/commonjs/mol-gl/shader/chunks/apply-light-color.glsl.js +3 -3
- package/lib/commonjs/mol-gl/shader/chunks/apply-light-color.glsl.js.map +1 -1
- package/lib/commonjs/mol-gl/shader/chunks/assign-color-varying.glsl.d.ts +1 -1
- package/lib/commonjs/mol-gl/shader/chunks/assign-color-varying.glsl.js +1 -1
- package/lib/commonjs/mol-gl/shader/chunks/assign-color-varying.glsl.js.map +1 -1
- package/lib/commonjs/mol-gl/shader/chunks/assign-material-color.glsl.d.ts +1 -1
- package/lib/commonjs/mol-gl/shader/chunks/assign-material-color.glsl.js +1 -1
- package/lib/commonjs/mol-gl/shader/chunks/assign-material-color.glsl.js.map +1 -1
- package/lib/commonjs/mol-gl/shader/chunks/color-frag-params.glsl.d.ts +1 -1
- package/lib/commonjs/mol-gl/shader/chunks/color-frag-params.glsl.js +1 -1
- package/lib/commonjs/mol-gl/shader/chunks/color-frag-params.glsl.js.map +1 -1
- package/lib/commonjs/mol-gl/shader/chunks/color-vert-params.glsl.d.ts +1 -1
- package/lib/commonjs/mol-gl/shader/chunks/color-vert-params.glsl.js +1 -1
- package/lib/commonjs/mol-gl/shader/chunks/color-vert-params.glsl.js.map +1 -1
- package/lib/commonjs/mol-gl/shader/chunks/common-clip.glsl.d.ts +1 -1
- package/lib/commonjs/mol-gl/shader/chunks/common-clip.glsl.js +1 -1
- package/lib/commonjs/mol-gl/shader/chunks/common-clip.glsl.js.map +1 -1
- package/lib/commonjs/mol-gl/shader/chunks/light-frag-params.glsl.d.ts +3 -3
- package/lib/commonjs/mol-gl/shader/chunks/light-frag-params.glsl.js +3 -3
- package/lib/commonjs/mol-gl/shader/chunks/light-frag-params.glsl.js.map +1 -1
- 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/direct-volume.frag.js.map +1 -1
- package/lib/commonjs/mol-gl/shader/mesh.frag.d.ts +1 -1
- package/lib/commonjs/mol-gl/shader/mesh.frag.js +1 -1
- package/lib/commonjs/mol-gl/shader/mesh.frag.js.map +1 -1
- package/lib/commonjs/mol-gl/shader-code.d.ts +0 -1
- package/lib/commonjs/mol-gl/shader-code.js +31 -13
- package/lib/commonjs/mol-gl/shader-code.js.map +1 -1
- package/lib/commonjs/mol-gl/webgl/extensions.js +2 -4
- package/lib/commonjs/mol-gl/webgl/extensions.js.map +1 -1
- package/lib/commonjs/mol-math/linear-algebra/3d/vec3.d.ts +6 -0
- package/lib/commonjs/mol-math/linear-algebra/3d/vec3.js +9 -0
- package/lib/commonjs/mol-math/linear-algebra/3d/vec3.js.map +1 -1
- package/lib/commonjs/mol-model/loci.d.ts +18 -18
- package/lib/commonjs/mol-model-formats/shape/ply.d.ts +8 -0
- package/lib/commonjs/mol-model-props/computed/representations/interactions-inter-unit-cylinder.d.ts +4 -0
- package/lib/commonjs/mol-model-props/computed/representations/interactions-intra-unit-cylinder.d.ts +4 -0
- package/lib/commonjs/mol-model-props/computed/representations/interactions.d.ts +12 -0
- package/lib/commonjs/mol-model-props/integrative/cross-link-restraint/representation.d.ts +16 -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 +5 -0
- package/lib/commonjs/mol-plugin/behavior/dynamic/selection/structure-focus-representation.js +4 -2
- package/lib/commonjs/mol-plugin/behavior/dynamic/selection/structure-focus-representation.js.map +1 -1
- package/lib/commonjs/mol-plugin/commands.d.ts +9 -7
- package/lib/commonjs/mol-plugin/spec.js +1 -0
- package/lib/commonjs/mol-plugin/spec.js.map +1 -1
- package/lib/commonjs/mol-plugin/util/viewport-screenshot.d.ts +3 -0
- package/lib/commonjs/mol-plugin-state/builder/structure/representation-preset.d.ts +4 -4
- package/lib/commonjs/mol-plugin-state/helpers/structure-substance.d.ts +13 -0
- package/lib/commonjs/mol-plugin-state/helpers/structure-substance.js +126 -0
- package/lib/commonjs/mol-plugin-state/helpers/structure-substance.js.map +1 -0
- package/lib/commonjs/mol-plugin-state/manager/structure/component.d.ts +9 -2
- package/lib/commonjs/mol-plugin-state/manager/structure/component.js +44 -22
- package/lib/commonjs/mol-plugin-state/manager/structure/component.js.map +1 -1
- package/lib/commonjs/mol-plugin-state/transforms/representation.d.ts +31 -4
- package/lib/commonjs/mol-plugin-state/transforms/representation.js +120 -1
- package/lib/commonjs/mol-plugin-state/transforms/representation.js.map +1 -1
- package/lib/commonjs/mol-plugin-ui/viewport/simple-settings.js +2 -5
- package/lib/commonjs/mol-plugin-ui/viewport/simple-settings.js.map +1 -1
- package/lib/commonjs/mol-repr/representation.d.ts +3 -0
- package/lib/commonjs/mol-repr/representation.js +7 -1
- package/lib/commonjs/mol-repr/representation.js.map +1 -1
- package/lib/commonjs/mol-repr/shape/loci/angle.d.ts +5 -1
- package/lib/commonjs/mol-repr/shape/loci/common.d.ts +5 -1
- package/lib/commonjs/mol-repr/shape/loci/dihedral.d.ts +5 -1
- package/lib/commonjs/mol-repr/shape/loci/distance.d.ts +5 -1
- package/lib/commonjs/mol-repr/shape/loci/label.d.ts +5 -1
- package/lib/commonjs/mol-repr/shape/loci/orientation.d.ts +4 -0
- package/lib/commonjs/mol-repr/shape/loci/plane.d.ts +4 -0
- package/lib/commonjs/mol-repr/shape/model/unitcell.d.ts +4 -0
- package/lib/commonjs/mol-repr/shape/representation.js +3 -0
- package/lib/commonjs/mol-repr/shape/representation.js.map +1 -1
- package/lib/commonjs/mol-repr/structure/complex-representation.js +6 -0
- package/lib/commonjs/mol-repr/structure/complex-representation.js.map +1 -1
- package/lib/commonjs/mol-repr/structure/complex-visual.d.ts +25 -1
- package/lib/commonjs/mol-repr/structure/complex-visual.js +4 -0
- package/lib/commonjs/mol-repr/structure/complex-visual.js.map +1 -1
- package/lib/commonjs/mol-repr/structure/params.d.ts +33 -1
- package/lib/commonjs/mol-repr/structure/registry.d.ts +57 -1
- package/lib/commonjs/mol-repr/structure/representation/backbone.d.ts +12 -0
- package/lib/commonjs/mol-repr/structure/representation/ball-and-stick.d.ts +12 -0
- package/lib/commonjs/mol-repr/structure/representation/carbohydrate.d.ts +12 -0
- package/lib/commonjs/mol-repr/structure/representation/cartoon.d.ts +12 -0
- package/lib/commonjs/mol-repr/structure/representation/ellipsoid.d.ts +12 -0
- package/lib/commonjs/mol-repr/structure/representation/gaussian-surface.d.ts +12 -0
- package/lib/commonjs/mol-repr/structure/representation/gaussian-volume.d.ts +12 -0
- package/lib/commonjs/mol-repr/structure/representation/label.d.ts +15 -3
- package/lib/commonjs/mol-repr/structure/representation/line.d.ts +12 -0
- package/lib/commonjs/mol-repr/structure/representation/molecular-surface.d.ts +12 -0
- package/lib/commonjs/mol-repr/structure/representation/orientation.d.ts +12 -0
- package/lib/commonjs/mol-repr/structure/representation/point.d.ts +12 -0
- package/lib/commonjs/mol-repr/structure/representation/putty.d.ts +12 -0
- package/lib/commonjs/mol-repr/structure/representation/spacefill.d.ts +12 -0
- package/lib/commonjs/mol-repr/structure/units-representation.js +8 -2
- package/lib/commonjs/mol-repr/structure/units-representation.js.map +1 -1
- package/lib/commonjs/mol-repr/structure/units-visual.d.ts +33 -1
- package/lib/commonjs/mol-repr/structure/units-visual.js +4 -0
- package/lib/commonjs/mol-repr/structure/units-visual.js.map +1 -1
- package/lib/commonjs/mol-repr/structure/visual/bond-inter-unit-cylinder.d.ts +8 -0
- package/lib/commonjs/mol-repr/structure/visual/bond-inter-unit-line.d.ts +4 -0
- package/lib/commonjs/mol-repr/structure/visual/bond-intra-unit-cylinder.d.ts +8 -0
- package/lib/commonjs/mol-repr/structure/visual/bond-intra-unit-line.d.ts +4 -0
- package/lib/commonjs/mol-repr/structure/visual/carbohydrate-link-cylinder.d.ts +4 -0
- package/lib/commonjs/mol-repr/structure/visual/carbohydrate-symbol-mesh.d.ts +4 -0
- package/lib/commonjs/mol-repr/structure/visual/carbohydrate-terminal-link-cylinder.d.ts +4 -0
- package/lib/commonjs/mol-repr/structure/visual/element-cross.d.ts +4 -0
- package/lib/commonjs/mol-repr/structure/visual/element-point.d.ts +4 -0
- package/lib/commonjs/mol-repr/structure/visual/element-sphere.d.ts +8 -0
- package/lib/commonjs/mol-repr/structure/visual/ellipsoid-mesh.d.ts +4 -0
- package/lib/commonjs/mol-repr/structure/visual/gaussian-density-volume.d.ts +8 -0
- package/lib/commonjs/mol-repr/structure/visual/gaussian-surface-mesh.d.ts +16 -0
- package/lib/commonjs/mol-repr/structure/visual/gaussian-surface-wireframe.d.ts +4 -0
- package/lib/commonjs/mol-repr/structure/visual/label-text.d.ts +5 -1
- package/lib/commonjs/mol-repr/structure/visual/molecular-surface-mesh.d.ts +4 -0
- package/lib/commonjs/mol-repr/structure/visual/molecular-surface-wireframe.d.ts +4 -0
- package/lib/commonjs/mol-repr/structure/visual/nucleotide-block-mesh.d.ts +4 -0
- package/lib/commonjs/mol-repr/structure/visual/nucleotide-ring-mesh.d.ts +4 -0
- package/lib/commonjs/mol-repr/structure/visual/orientation-ellipsoid-mesh.d.ts +4 -0
- package/lib/commonjs/mol-repr/structure/visual/polymer-backbone-cylinder.d.ts +8 -0
- package/lib/commonjs/mol-repr/structure/visual/polymer-backbone-sphere.d.ts +8 -0
- package/lib/commonjs/mol-repr/structure/visual/polymer-direction-wedge.d.ts +4 -0
- package/lib/commonjs/mol-repr/structure/visual/polymer-gap-cylinder.d.ts +4 -0
- package/lib/commonjs/mol-repr/structure/visual/polymer-trace-mesh.d.ts +4 -0
- package/lib/commonjs/mol-repr/structure/visual/polymer-tube-mesh.d.ts +4 -0
- package/lib/commonjs/mol-repr/visual.d.ts +3 -0
- package/lib/commonjs/mol-repr/visual.js +53 -2
- package/lib/commonjs/mol-repr/visual.js.map +1 -1
- package/lib/commonjs/mol-repr/volume/direct-volume.d.ts +12 -0
- package/lib/commonjs/mol-repr/volume/isosurface.d.ts +24 -0
- package/lib/commonjs/mol-repr/volume/registry.d.ts +12 -0
- package/lib/commonjs/mol-repr/volume/representation.d.ts +4 -0
- package/lib/commonjs/mol-repr/volume/representation.js +3 -0
- package/lib/commonjs/mol-repr/volume/representation.js.map +1 -1
- package/lib/commonjs/mol-repr/volume/slice.d.ts +12 -0
- package/lib/commonjs/mol-theme/overpaint.js +1 -1
- package/lib/commonjs/mol-theme/overpaint.js.map +1 -1
- package/lib/commonjs/mol-theme/substance.d.ts +43 -0
- package/lib/commonjs/mol-theme/substance.js +132 -0
- package/lib/commonjs/mol-theme/substance.js.map +1 -0
- package/lib/commonjs/mol-util/material.d.ts +32 -0
- package/lib/commonjs/mol-util/material.js +51 -0
- package/lib/commonjs/mol-util/material.js.map +1 -0
- package/lib/commonjs/mol-util/number.d.ts +1 -0
- package/lib/commonjs/mol-util/number.js +5 -1
- package/lib/commonjs/mol-util/number.js.map +1 -1
- package/lib/extensions/anvil/behavior.d.ts +1 -0
- package/lib/extensions/anvil/representation.d.ts +20 -0
- package/lib/extensions/cellpack/representation.d.ts +4 -0
- package/lib/extensions/dnatco/confal-pyramids/representation.d.ts +12 -0
- package/lib/extensions/geo-export/controls.js +15 -17
- package/lib/extensions/geo-export/controls.js.map +1 -1
- package/lib/extensions/geo-export/glb-exporter.d.ts +4 -3
- package/lib/extensions/geo-export/glb-exporter.js +23 -11
- package/lib/extensions/geo-export/glb-exporter.js.map +1 -1
- package/lib/extensions/geo-export/usdz-exporter.d.ts +2 -5
- package/lib/extensions/geo-export/usdz-exporter.js +14 -15
- package/lib/extensions/geo-export/usdz-exporter.js.map +1 -1
- package/lib/extensions/rcsb/assembly-symmetry/behavior.d.ts +3 -2
- package/lib/extensions/rcsb/assembly-symmetry/representation.d.ts +4 -0
- package/lib/extensions/rcsb/validation-report/representation.d.ts +20 -0
- package/lib/mol-canvas3d/canvas3d.d.ts +18 -14
- package/lib/mol-canvas3d/helper/camera-helper.d.ts +1 -0
- package/lib/mol-canvas3d/helper/handle-helper.d.ts +1 -0
- package/lib/mol-canvas3d/helper/helper.d.ts +2 -0
- package/lib/mol-canvas3d/passes/image.d.ts +1 -0
- package/lib/mol-geo/geometry/base.d.ts +11 -2
- package/lib/mol-geo/geometry/base.js +14 -4
- package/lib/mol-geo/geometry/base.js.map +1 -1
- package/lib/mol-geo/geometry/cylinders/cylinders.d.ts +4 -0
- package/lib/mol-geo/geometry/cylinders/cylinders.js +3 -1
- package/lib/mol-geo/geometry/cylinders/cylinders.js.map +1 -1
- package/lib/mol-geo/geometry/direct-volume/direct-volume.d.ts +4 -0
- package/lib/mol-geo/geometry/direct-volume/direct-volume.js +4 -3
- package/lib/mol-geo/geometry/direct-volume/direct-volume.js.map +1 -1
- package/lib/mol-geo/geometry/image/image.d.ts +4 -0
- package/lib/mol-geo/geometry/image/image.js +3 -1
- package/lib/mol-geo/geometry/image/image.js.map +1 -1
- package/lib/mol-geo/geometry/lines/lines.d.ts +4 -0
- package/lib/mol-geo/geometry/lines/lines.js +3 -1
- package/lib/mol-geo/geometry/lines/lines.js.map +1 -1
- package/lib/mol-geo/geometry/mesh/color-smoothing.d.ts +1 -0
- package/lib/mol-geo/geometry/mesh/color-smoothing.js +33 -0
- package/lib/mol-geo/geometry/mesh/color-smoothing.js.map +1 -1
- package/lib/mol-geo/geometry/mesh/mesh.d.ts +4 -0
- package/lib/mol-geo/geometry/mesh/mesh.js +3 -1
- package/lib/mol-geo/geometry/mesh/mesh.js.map +1 -1
- package/lib/mol-geo/geometry/points/points.d.ts +4 -0
- package/lib/mol-geo/geometry/points/points.js +3 -1
- package/lib/mol-geo/geometry/points/points.js.map +1 -1
- package/lib/mol-geo/geometry/spheres/spheres.d.ts +4 -0
- package/lib/mol-geo/geometry/spheres/spheres.js +3 -1
- package/lib/mol-geo/geometry/spheres/spheres.js.map +1 -1
- package/lib/mol-geo/geometry/substance-data.d.ts +23 -0
- package/lib/mol-geo/geometry/substance-data.js +61 -0
- package/lib/mol-geo/geometry/substance-data.js.map +1 -0
- package/lib/mol-geo/geometry/text/text.d.ts +4 -0
- package/lib/mol-geo/geometry/text/text.js +3 -1
- package/lib/mol-geo/geometry/text/text.js.map +1 -1
- package/lib/mol-geo/geometry/texture-mesh/color-smoothing.d.ts +1 -0
- package/lib/mol-geo/geometry/texture-mesh/color-smoothing.js +31 -0
- package/lib/mol-geo/geometry/texture-mesh/color-smoothing.js.map +1 -1
- package/lib/mol-geo/geometry/texture-mesh/texture-mesh.d.ts +4 -0
- package/lib/mol-geo/geometry/texture-mesh/texture-mesh.js +3 -1
- package/lib/mol-geo/geometry/texture-mesh/texture-mesh.js.map +1 -1
- package/lib/mol-gl/_spec/renderer.spec.js +1 -1
- package/lib/mol-gl/renderable/cylinders.d.ts +10 -0
- package/lib/mol-gl/renderable/direct-volume.d.ts +10 -0
- package/lib/mol-gl/renderable/image.d.ts +10 -0
- package/lib/mol-gl/renderable/lines.d.ts +10 -0
- package/lib/mol-gl/renderable/mesh.d.ts +10 -0
- package/lib/mol-gl/renderable/points.d.ts +10 -0
- package/lib/mol-gl/renderable/points.js +1 -2
- package/lib/mol-gl/renderable/points.js.map +1 -1
- package/lib/mol-gl/renderable/schema.d.ts +24 -5
- package/lib/mol-gl/renderable/schema.js +14 -10
- package/lib/mol-gl/renderable/schema.js.map +1 -1
- package/lib/mol-gl/renderable/spheres.d.ts +10 -0
- package/lib/mol-gl/renderable/text.d.ts +10 -0
- package/lib/mol-gl/renderable/texture-mesh.d.ts +10 -0
- package/lib/mol-gl/renderer.d.ts +9 -15
- package/lib/mol-gl/renderer.js +52 -59
- package/lib/mol-gl/renderer.js.map +1 -1
- package/lib/mol-gl/shader/chunks/apply-light-color.glsl.d.ts +3 -3
- package/lib/mol-gl/shader/chunks/apply-light-color.glsl.js +3 -3
- package/lib/mol-gl/shader/chunks/apply-light-color.glsl.js.map +1 -1
- package/lib/mol-gl/shader/chunks/assign-color-varying.glsl.d.ts +1 -1
- package/lib/mol-gl/shader/chunks/assign-color-varying.glsl.js +1 -1
- package/lib/mol-gl/shader/chunks/assign-color-varying.glsl.js.map +1 -1
- package/lib/mol-gl/shader/chunks/assign-material-color.glsl.d.ts +1 -1
- package/lib/mol-gl/shader/chunks/assign-material-color.glsl.js +1 -1
- package/lib/mol-gl/shader/chunks/assign-material-color.glsl.js.map +1 -1
- package/lib/mol-gl/shader/chunks/color-frag-params.glsl.d.ts +1 -1
- package/lib/mol-gl/shader/chunks/color-frag-params.glsl.js +1 -1
- package/lib/mol-gl/shader/chunks/color-frag-params.glsl.js.map +1 -1
- package/lib/mol-gl/shader/chunks/color-vert-params.glsl.d.ts +1 -1
- package/lib/mol-gl/shader/chunks/color-vert-params.glsl.js +1 -1
- package/lib/mol-gl/shader/chunks/color-vert-params.glsl.js.map +1 -1
- package/lib/mol-gl/shader/chunks/common-clip.glsl.d.ts +1 -1
- package/lib/mol-gl/shader/chunks/common-clip.glsl.js +1 -1
- package/lib/mol-gl/shader/chunks/common-clip.glsl.js.map +1 -1
- package/lib/mol-gl/shader/chunks/light-frag-params.glsl.d.ts +3 -3
- package/lib/mol-gl/shader/chunks/light-frag-params.glsl.js +3 -3
- package/lib/mol-gl/shader/chunks/light-frag-params.glsl.js.map +1 -1
- 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/direct-volume.frag.js.map +1 -1
- package/lib/mol-gl/shader/mesh.frag.d.ts +1 -1
- package/lib/mol-gl/shader/mesh.frag.js +1 -1
- package/lib/mol-gl/shader/mesh.frag.js.map +1 -1
- package/lib/mol-gl/shader-code.d.ts +0 -1
- package/lib/mol-gl/shader-code.js +31 -13
- package/lib/mol-gl/shader-code.js.map +1 -1
- package/lib/mol-gl/webgl/extensions.js +2 -4
- package/lib/mol-gl/webgl/extensions.js.map +1 -1
- package/lib/mol-math/linear-algebra/3d/vec3.d.ts +6 -0
- package/lib/mol-math/linear-algebra/3d/vec3.js +9 -0
- package/lib/mol-math/linear-algebra/3d/vec3.js.map +1 -1
- package/lib/mol-model/loci.d.ts +18 -18
- package/lib/mol-model-formats/shape/ply.d.ts +8 -0
- package/lib/mol-model-props/computed/representations/interactions-inter-unit-cylinder.d.ts +4 -0
- package/lib/mol-model-props/computed/representations/interactions-intra-unit-cylinder.d.ts +4 -0
- package/lib/mol-model-props/computed/representations/interactions.d.ts +12 -0
- package/lib/mol-model-props/integrative/cross-link-restraint/representation.d.ts +16 -0
- package/lib/mol-plugin/behavior/dynamic/representation.d.ts +2 -2
- package/lib/mol-plugin/behavior/dynamic/selection/structure-focus-representation.d.ts +5 -0
- package/lib/mol-plugin/behavior/dynamic/selection/structure-focus-representation.js +4 -2
- package/lib/mol-plugin/behavior/dynamic/selection/structure-focus-representation.js.map +1 -1
- package/lib/mol-plugin/commands.d.ts +9 -7
- package/lib/mol-plugin/spec.js +1 -0
- package/lib/mol-plugin/spec.js.map +1 -1
- package/lib/mol-plugin/util/viewport-screenshot.d.ts +3 -0
- package/lib/mol-plugin/version.js +2 -2
- package/lib/mol-plugin-state/builder/structure/representation-preset.d.ts +4 -4
- package/lib/mol-plugin-state/helpers/structure-substance.d.ts +13 -0
- package/lib/mol-plugin-state/helpers/structure-substance.js +121 -0
- package/lib/mol-plugin-state/helpers/structure-substance.js.map +1 -0
- package/lib/mol-plugin-state/manager/structure/component.d.ts +9 -2
- package/lib/mol-plugin-state/manager/structure/component.js +44 -22
- package/lib/mol-plugin-state/manager/structure/component.js.map +1 -1
- package/lib/mol-plugin-state/transforms/representation.d.ts +31 -4
- package/lib/mol-plugin-state/transforms/representation.js +119 -0
- package/lib/mol-plugin-state/transforms/representation.js.map +1 -1
- package/lib/mol-plugin-ui/viewport/simple-settings.js +2 -5
- package/lib/mol-plugin-ui/viewport/simple-settings.js.map +1 -1
- package/lib/mol-repr/representation.d.ts +3 -0
- package/lib/mol-repr/representation.js +7 -1
- package/lib/mol-repr/representation.js.map +1 -1
- package/lib/mol-repr/shape/loci/angle.d.ts +5 -1
- package/lib/mol-repr/shape/loci/common.d.ts +5 -1
- package/lib/mol-repr/shape/loci/dihedral.d.ts +5 -1
- package/lib/mol-repr/shape/loci/distance.d.ts +5 -1
- package/lib/mol-repr/shape/loci/label.d.ts +5 -1
- package/lib/mol-repr/shape/loci/orientation.d.ts +4 -0
- package/lib/mol-repr/shape/loci/plane.d.ts +4 -0
- package/lib/mol-repr/shape/model/unitcell.d.ts +4 -0
- package/lib/mol-repr/shape/representation.js +3 -0
- package/lib/mol-repr/shape/representation.js.map +1 -1
- package/lib/mol-repr/structure/complex-representation.js +6 -0
- package/lib/mol-repr/structure/complex-representation.js.map +1 -1
- package/lib/mol-repr/structure/complex-visual.d.ts +25 -1
- package/lib/mol-repr/structure/complex-visual.js +4 -0
- package/lib/mol-repr/structure/complex-visual.js.map +1 -1
- package/lib/mol-repr/structure/params.d.ts +33 -1
- package/lib/mol-repr/structure/registry.d.ts +57 -1
- package/lib/mol-repr/structure/representation/backbone.d.ts +12 -0
- package/lib/mol-repr/structure/representation/ball-and-stick.d.ts +12 -0
- package/lib/mol-repr/structure/representation/carbohydrate.d.ts +12 -0
- package/lib/mol-repr/structure/representation/cartoon.d.ts +12 -0
- package/lib/mol-repr/structure/representation/ellipsoid.d.ts +12 -0
- package/lib/mol-repr/structure/representation/gaussian-surface.d.ts +12 -0
- package/lib/mol-repr/structure/representation/gaussian-volume.d.ts +12 -0
- package/lib/mol-repr/structure/representation/label.d.ts +15 -3
- package/lib/mol-repr/structure/representation/line.d.ts +12 -0
- package/lib/mol-repr/structure/representation/molecular-surface.d.ts +12 -0
- package/lib/mol-repr/structure/representation/orientation.d.ts +12 -0
- package/lib/mol-repr/structure/representation/point.d.ts +12 -0
- package/lib/mol-repr/structure/representation/putty.d.ts +12 -0
- package/lib/mol-repr/structure/representation/spacefill.d.ts +12 -0
- package/lib/mol-repr/structure/units-representation.js +8 -2
- package/lib/mol-repr/structure/units-representation.js.map +1 -1
- package/lib/mol-repr/structure/units-visual.d.ts +33 -1
- package/lib/mol-repr/structure/units-visual.js +4 -0
- package/lib/mol-repr/structure/units-visual.js.map +1 -1
- package/lib/mol-repr/structure/visual/bond-inter-unit-cylinder.d.ts +8 -0
- package/lib/mol-repr/structure/visual/bond-inter-unit-line.d.ts +4 -0
- package/lib/mol-repr/structure/visual/bond-intra-unit-cylinder.d.ts +8 -0
- package/lib/mol-repr/structure/visual/bond-intra-unit-line.d.ts +4 -0
- package/lib/mol-repr/structure/visual/carbohydrate-link-cylinder.d.ts +4 -0
- package/lib/mol-repr/structure/visual/carbohydrate-symbol-mesh.d.ts +4 -0
- package/lib/mol-repr/structure/visual/carbohydrate-terminal-link-cylinder.d.ts +4 -0
- package/lib/mol-repr/structure/visual/element-cross.d.ts +4 -0
- package/lib/mol-repr/structure/visual/element-point.d.ts +4 -0
- package/lib/mol-repr/structure/visual/element-sphere.d.ts +8 -0
- package/lib/mol-repr/structure/visual/ellipsoid-mesh.d.ts +4 -0
- package/lib/mol-repr/structure/visual/gaussian-density-volume.d.ts +8 -0
- package/lib/mol-repr/structure/visual/gaussian-surface-mesh.d.ts +16 -0
- package/lib/mol-repr/structure/visual/gaussian-surface-wireframe.d.ts +4 -0
- package/lib/mol-repr/structure/visual/label-text.d.ts +5 -1
- package/lib/mol-repr/structure/visual/molecular-surface-mesh.d.ts +4 -0
- package/lib/mol-repr/structure/visual/molecular-surface-wireframe.d.ts +4 -0
- package/lib/mol-repr/structure/visual/nucleotide-block-mesh.d.ts +4 -0
- package/lib/mol-repr/structure/visual/nucleotide-ring-mesh.d.ts +4 -0
- package/lib/mol-repr/structure/visual/orientation-ellipsoid-mesh.d.ts +4 -0
- package/lib/mol-repr/structure/visual/polymer-backbone-cylinder.d.ts +8 -0
- package/lib/mol-repr/structure/visual/polymer-backbone-sphere.d.ts +8 -0
- package/lib/mol-repr/structure/visual/polymer-direction-wedge.d.ts +4 -0
- package/lib/mol-repr/structure/visual/polymer-gap-cylinder.d.ts +4 -0
- package/lib/mol-repr/structure/visual/polymer-trace-mesh.d.ts +4 -0
- package/lib/mol-repr/structure/visual/polymer-tube-mesh.d.ts +4 -0
- package/lib/mol-repr/visual.d.ts +3 -0
- package/lib/mol-repr/visual.js +55 -4
- package/lib/mol-repr/visual.js.map +1 -1
- package/lib/mol-repr/volume/direct-volume.d.ts +12 -0
- package/lib/mol-repr/volume/isosurface.d.ts +24 -0
- package/lib/mol-repr/volume/registry.d.ts +12 -0
- package/lib/mol-repr/volume/representation.d.ts +4 -0
- package/lib/mol-repr/volume/representation.js +3 -0
- package/lib/mol-repr/volume/representation.js.map +1 -1
- package/lib/mol-repr/volume/slice.d.ts +12 -0
- package/lib/mol-theme/overpaint.js +1 -1
- package/lib/mol-theme/overpaint.js.map +1 -1
- package/lib/mol-theme/substance.d.ts +43 -0
- package/lib/mol-theme/substance.js +128 -0
- package/lib/mol-theme/substance.js.map +1 -0
- package/lib/mol-util/material.d.ts +32 -0
- package/lib/mol-util/material.js +47 -0
- package/lib/mol-util/material.js.map +1 -0
- package/lib/mol-util/number.d.ts +1 -0
- package/lib/mol-util/number.js +3 -0
- package/lib/mol-util/number.js.map +1 -1
- package/lib/tsconfig.commonjs.tsbuildinfo +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Copyright (c) 2021 mol* contributors, licensed under MIT, See LICENSE file for more info.
|
|
4
|
+
*
|
|
5
|
+
* @author Alexander Rose <alexander.rose@weirdbyte.de>
|
|
6
|
+
*/
|
|
7
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
+
exports.Substance = void 0;
|
|
9
|
+
var loci_1 = require("../mol-model/loci");
|
|
10
|
+
var structure_1 = require("../mol-model/structure");
|
|
11
|
+
var script_1 = require("../mol-script/script");
|
|
12
|
+
var material_1 = require("../mol-util/material");
|
|
13
|
+
function Substance(layers) {
|
|
14
|
+
return { layers: layers };
|
|
15
|
+
}
|
|
16
|
+
exports.Substance = Substance;
|
|
17
|
+
(function (Substance) {
|
|
18
|
+
Substance.Empty = { layers: [] };
|
|
19
|
+
function areEqual(sA, sB) {
|
|
20
|
+
if (sA.layers.length === 0 && sB.layers.length === 0)
|
|
21
|
+
return true;
|
|
22
|
+
if (sA.layers.length !== sB.layers.length)
|
|
23
|
+
return false;
|
|
24
|
+
for (var i = 0, il = sA.layers.length; i < il; ++i) {
|
|
25
|
+
if (sA.layers[i].clear !== sB.layers[i].clear)
|
|
26
|
+
return false;
|
|
27
|
+
if (sA.layers[i].material !== sB.layers[i].material)
|
|
28
|
+
return false;
|
|
29
|
+
if (!loci_1.Loci.areEqual(sA.layers[i].loci, sB.layers[i].loci))
|
|
30
|
+
return false;
|
|
31
|
+
}
|
|
32
|
+
return true;
|
|
33
|
+
}
|
|
34
|
+
Substance.areEqual = areEqual;
|
|
35
|
+
function isEmpty(overpaint) {
|
|
36
|
+
return overpaint.layers.length === 0;
|
|
37
|
+
}
|
|
38
|
+
Substance.isEmpty = isEmpty;
|
|
39
|
+
function remap(substance, structure) {
|
|
40
|
+
var layers = [];
|
|
41
|
+
for (var _i = 0, _a = substance.layers; _i < _a.length; _i++) {
|
|
42
|
+
var layer = _a[_i];
|
|
43
|
+
var loci = layer.loci, material = layer.material, clear = layer.clear;
|
|
44
|
+
loci = structure_1.StructureElement.Loci.remap(loci, structure);
|
|
45
|
+
if (!structure_1.StructureElement.Loci.isEmpty(loci)) {
|
|
46
|
+
layers.push({ loci: loci, material: material, clear: clear });
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
return { layers: layers };
|
|
50
|
+
}
|
|
51
|
+
Substance.remap = remap;
|
|
52
|
+
function merge(substance) {
|
|
53
|
+
if (isEmpty(substance))
|
|
54
|
+
return substance;
|
|
55
|
+
var structure = substance.layers[0].loci.structure;
|
|
56
|
+
var map = new Map();
|
|
57
|
+
var shadowed = structure_1.StructureElement.Loci.none(structure);
|
|
58
|
+
for (var i = 0, il = substance.layers.length; i < il; ++i) {
|
|
59
|
+
var _a = substance.layers[il - i - 1], loci = _a.loci, material = _a.material, clear = _a.clear; // process from end
|
|
60
|
+
loci = structure_1.StructureElement.Loci.subtract(loci, shadowed);
|
|
61
|
+
shadowed = structure_1.StructureElement.Loci.union(loci, shadowed);
|
|
62
|
+
if (!structure_1.StructureElement.Loci.isEmpty(loci)) {
|
|
63
|
+
var materialOrClear = clear ? -1 : material;
|
|
64
|
+
if (map.has(materialOrClear)) {
|
|
65
|
+
loci = structure_1.StructureElement.Loci.union(loci, map.get(materialOrClear));
|
|
66
|
+
}
|
|
67
|
+
map.set(materialOrClear, loci);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
var layers = [];
|
|
71
|
+
map.forEach(function (loci, materialOrClear) {
|
|
72
|
+
var clear = materialOrClear === -1;
|
|
73
|
+
var material = clear ? (0, material_1.Material)(0) : materialOrClear;
|
|
74
|
+
layers.push({ loci: loci, material: material, clear: clear });
|
|
75
|
+
});
|
|
76
|
+
return { layers: layers };
|
|
77
|
+
}
|
|
78
|
+
Substance.merge = merge;
|
|
79
|
+
function filter(substance, filter) {
|
|
80
|
+
if (isEmpty(substance))
|
|
81
|
+
return substance;
|
|
82
|
+
var structure = substance.layers[0].loci.structure;
|
|
83
|
+
var layers = [];
|
|
84
|
+
for (var _i = 0, _a = substance.layers; _i < _a.length; _i++) {
|
|
85
|
+
var layer = _a[_i];
|
|
86
|
+
var loci = layer.loci, material = layer.material, clear = layer.clear;
|
|
87
|
+
// filter by first map to the `filter` structure and
|
|
88
|
+
// then map back to the original structure of the substance loci
|
|
89
|
+
var filtered = structure_1.StructureElement.Loci.remap(loci, filter);
|
|
90
|
+
loci = structure_1.StructureElement.Loci.remap(filtered, structure);
|
|
91
|
+
if (!structure_1.StructureElement.Loci.isEmpty(loci)) {
|
|
92
|
+
layers.push({ loci: loci, material: material, clear: clear });
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
return { layers: layers };
|
|
96
|
+
}
|
|
97
|
+
Substance.filter = filter;
|
|
98
|
+
function ofScript(scriptLayers, structure) {
|
|
99
|
+
var layers = [];
|
|
100
|
+
for (var i = 0, il = scriptLayers.length; i < il; ++i) {
|
|
101
|
+
var _a = scriptLayers[i], script = _a.script, material = _a.material, clear = _a.clear;
|
|
102
|
+
var loci = script_1.Script.toLoci(script, structure);
|
|
103
|
+
if (!structure_1.StructureElement.Loci.isEmpty(loci)) {
|
|
104
|
+
layers.push({ loci: loci, material: material, clear: clear });
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
return { layers: layers };
|
|
108
|
+
}
|
|
109
|
+
Substance.ofScript = ofScript;
|
|
110
|
+
function ofBundle(bundleLayers, structure) {
|
|
111
|
+
var layers = [];
|
|
112
|
+
for (var i = 0, il = bundleLayers.length; i < il; ++i) {
|
|
113
|
+
var _a = bundleLayers[i], bundle = _a.bundle, material = _a.material, clear = _a.clear;
|
|
114
|
+
var loci = structure_1.StructureElement.Bundle.toLoci(bundle, structure.root);
|
|
115
|
+
layers.push({ loci: loci, material: material, clear: clear });
|
|
116
|
+
}
|
|
117
|
+
return { layers: layers };
|
|
118
|
+
}
|
|
119
|
+
Substance.ofBundle = ofBundle;
|
|
120
|
+
function toBundle(overpaint) {
|
|
121
|
+
var layers = [];
|
|
122
|
+
for (var i = 0, il = overpaint.layers.length; i < il; ++i) {
|
|
123
|
+
var _a = overpaint.layers[i], loci = _a.loci, material = _a.material, clear = _a.clear;
|
|
124
|
+
var bundle = structure_1.StructureElement.Bundle.fromLoci(loci);
|
|
125
|
+
layers.push({ bundle: bundle, material: material, clear: clear });
|
|
126
|
+
}
|
|
127
|
+
return { layers: layers };
|
|
128
|
+
}
|
|
129
|
+
Substance.toBundle = toBundle;
|
|
130
|
+
})(Substance || (Substance = {}));
|
|
131
|
+
exports.Substance = Substance;
|
|
132
|
+
//# sourceMappingURL=substance.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"substance.js","sourceRoot":"","sources":["../../../src/mol-theme/substance.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;AAEH,0CAAyC;AACzC,oDAAqE;AACrE,+CAA8C;AAC9C,iDAAgD;AAMhD,SAAS,S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D,MAAM,CAAC,IAAI,CAAC,EAAE,MAAM,QAAA,EAAE,QAAQ,UAAA,EAAE,KAAK,OAAA,EAAE,CAAC,CAAC;SAC5C;QACD,OAAO,EAAE,MAAM,QAAA,EAAE,CAAC;IACtB,CAAC;IARe,kBAAQ,WAQvB,CAAA;AACL,CAAC,EA3GS,SAAS,KAAT,SAAS,QA2GlB;AAnHQ,8BAAS"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2021 mol* contributors, licensed under MIT, See LICENSE file for more info.
|
|
3
|
+
*
|
|
4
|
+
* @author Alexander Rose <alexander.rose@weirdbyte.de>
|
|
5
|
+
*/
|
|
6
|
+
import { NumberArray } from './type-helpers';
|
|
7
|
+
import { ParamDefinition as PD } from './param-definition';
|
|
8
|
+
/** Material properties expressed as a single number */
|
|
9
|
+
export declare type Material = {
|
|
10
|
+
readonly '@type': 'material';
|
|
11
|
+
} & number;
|
|
12
|
+
export declare function Material(hex: number): Material;
|
|
13
|
+
export declare namespace Material {
|
|
14
|
+
function fromNormalized(metalness: number, roughness: number): Material;
|
|
15
|
+
function fromObjectNormalized(v: {
|
|
16
|
+
metalness: number;
|
|
17
|
+
roughness: number;
|
|
18
|
+
}): Material;
|
|
19
|
+
function toObjectNormalized(material: Material, fractionDigits?: number): {
|
|
20
|
+
metalness: number;
|
|
21
|
+
roughness: number;
|
|
22
|
+
};
|
|
23
|
+
function toArray(material: Material, array: NumberArray, offset: number): NumberArray;
|
|
24
|
+
function toString(material: Material): string;
|
|
25
|
+
function getParam(info?: {
|
|
26
|
+
isExpanded?: boolean;
|
|
27
|
+
isFlat?: boolean;
|
|
28
|
+
}): PD.Converted<Material, PD.Normalize<{
|
|
29
|
+
metalness: number;
|
|
30
|
+
roughness: number;
|
|
31
|
+
}>>;
|
|
32
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Copyright (c) 2021 mol* contributors, licensed under MIT, See LICENSE file for more info.
|
|
4
|
+
*
|
|
5
|
+
* @author Alexander Rose <alexander.rose@weirdbyte.de>
|
|
6
|
+
*/
|
|
7
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
+
exports.Material = void 0;
|
|
9
|
+
var param_definition_1 = require("./param-definition");
|
|
10
|
+
var number_1 = require("./number");
|
|
11
|
+
function Material(hex) { return hex; }
|
|
12
|
+
exports.Material = Material;
|
|
13
|
+
(function (Material) {
|
|
14
|
+
function fromNormalized(metalness, roughness) {
|
|
15
|
+
return (((metalness * 255) << 16) | ((roughness * 255) << 8));
|
|
16
|
+
}
|
|
17
|
+
Material.fromNormalized = fromNormalized;
|
|
18
|
+
function fromObjectNormalized(v) {
|
|
19
|
+
return fromNormalized(v.metalness, v.roughness);
|
|
20
|
+
}
|
|
21
|
+
Material.fromObjectNormalized = fromObjectNormalized;
|
|
22
|
+
function toObjectNormalized(material, fractionDigits) {
|
|
23
|
+
var metalness = (material >> 16 & 255) / 255;
|
|
24
|
+
var roughness = (material >> 8 & 255) / 255;
|
|
25
|
+
return {
|
|
26
|
+
metalness: fractionDigits ? (0, number_1.toFixed)(metalness, fractionDigits) : metalness,
|
|
27
|
+
roughness: fractionDigits ? (0, number_1.toFixed)(roughness, fractionDigits) : roughness
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
Material.toObjectNormalized = toObjectNormalized;
|
|
31
|
+
function toArray(material, array, offset) {
|
|
32
|
+
array[offset] = (material >> 16 & 255);
|
|
33
|
+
array[offset + 1] = (material >> 8 & 255);
|
|
34
|
+
return array;
|
|
35
|
+
}
|
|
36
|
+
Material.toArray = toArray;
|
|
37
|
+
function toString(material) {
|
|
38
|
+
var metalness = (material >> 16 & 255) / 255;
|
|
39
|
+
var roughness = (material >> 8 & 255) / 255;
|
|
40
|
+
return "M ".concat(metalness, " | R ").concat(roughness);
|
|
41
|
+
}
|
|
42
|
+
Material.toString = toString;
|
|
43
|
+
function getParam(info) {
|
|
44
|
+
return param_definition_1.ParamDefinition.Converted(function (v) { return toObjectNormalized(v, 2); }, function (v) { return fromObjectNormalized(v); }, param_definition_1.ParamDefinition.Group({
|
|
45
|
+
metalness: param_definition_1.ParamDefinition.Numeric(0, { min: 0, max: 1, step: 0.01 }),
|
|
46
|
+
roughness: param_definition_1.ParamDefinition.Numeric(1, { min: 0, max: 1, step: 0.01 }),
|
|
47
|
+
}, info));
|
|
48
|
+
}
|
|
49
|
+
Material.getParam = getParam;
|
|
50
|
+
})(Material = exports.Material || (exports.Material = {}));
|
|
51
|
+
//# sourceMappingURL=material.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"material.js","sourceRoot":"","sources":["../../../src/mol-util/material.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;AAGH,uDAA2D;AAC3D,mCAAmC;AAKnC,SAAgB,QAAQ,CAAC,GAAW,IAAI,OAAO,GAAe,CAAC,CAAC,CAAC;AAAjE,4BAAiE;AAEjE,WAAiB,QAAQ;IACrB,SAAgB,cAAc,CAAC,SAAiB,EAAE,SAAiB;QAC/D,OAAO,CAAC,CAAC,CAAC,SAAS,GAAG,GAAG,CAAC,IAAI,EAAE,CAAC,GAAG,CAAC,CAAC,SAAS,GAAG,GAAG,CAAC,IAAI,CAAC,CAAC,CAAa,CAAC;IAC9E,CAAC;IAFe,uBAAc,iBAE7B,CAAA;IAED,SAAgB,oBAAoB,CAAC,CAA2C;QAC5E,OAAO,cAAc,CAAC,CAAC,CAAC,SAAS,EAAE,CAAC,CAAC,SAAS,CAAC,CAAC;IACpD,CAAC;IAFe,6BAAoB,uBAEnC,CAAA;IAED,SAAgB,kBAAkB,CAAC,QAAkB,EAAE,cAAuB;QAC1E,IAAM,SAAS,GAAG,CAAC,QAAQ,IAAI,EAAE,GAAG,GAAG,CAAC,GAAG,GAAG,CAAC;QAC/C,IAAM,SAAS,GAAG,CAAC,QAAQ,IAAI,CAAC,GAAG,GAAG,CAAC,GAAG,GA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G,EAAE,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;YACxD,SAAS,EAAE,kCAAE,CAAC,OAAO,CAAC,CAAC,EAAE,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;SAC3D,EAAE,IAAI,CAAC,CACX,CAAC;IACN,CAAC;IATe,iBAAQ,WASvB,CAAA;AACL,CAAC,EAxCgB,QAAQ,GAAR,gBAAQ,KAAR,gBAAQ,QAwCxB"}
|
|
@@ -23,3 +23,4 @@ export declare function getArrayDigitCount(xs: ArrayLike<number>, maxDigits: num
|
|
|
23
23
|
export declare function isInteger(s: string): boolean;
|
|
24
24
|
export declare function getPrecision(v: number): number;
|
|
25
25
|
export declare function toPrecision(v: number, precision: number): number;
|
|
26
|
+
export declare function toFixed(v: number, fractionDigits: number): number;
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* @author Alexander Rose <alexander.rose@weirdbyte.de>
|
|
7
7
|
*/
|
|
8
8
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
-
exports.toPrecision = exports.getPrecision = exports.isInteger = exports.getArrayDigitCount = exports.integerDigitCount = exports.getMantissaMultiplier = void 0;
|
|
9
|
+
exports.toFixed = exports.toPrecision = exports.getPrecision = exports.isInteger = exports.getArrayDigitCount = exports.integerDigitCount = exports.getMantissaMultiplier = void 0;
|
|
10
10
|
/**
|
|
11
11
|
* Determine the number of digits in a floating point number
|
|
12
12
|
* Find a number M such that round(M * v) - M * v <= delta.
|
|
@@ -78,4 +78,8 @@ function toPrecision(v, precision) {
|
|
|
78
78
|
return parseFloat(v.toPrecision(precision));
|
|
79
79
|
}
|
|
80
80
|
exports.toPrecision = toPrecision;
|
|
81
|
+
function toFixed(v, fractionDigits) {
|
|
82
|
+
return parseFloat(v.toFixed(fractionDigits));
|
|
83
|
+
}
|
|
84
|
+
exports.toFixed = toFixed;
|
|
81
85
|
//# sourceMappingURL=number.js.map
|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C,GAAG,CAAC,CAAC;IACV,OAAO,IAAI,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE;QAChC,CAAC,IAAI,EAAE,CAAC;QACR,EAAE,CAAC,CAAC;KACP;IACD,OAAO,CAAC,CAAC;AACb,CAAC;AATD,oCASC;AAED,SAAgB,WAAW,CAAC,CAAS,EAAE,SAAiB;IACpD,OAAO,UAAU,CAAC,CAAC,CAAC,WAAW,CAAC,SAAS,CAAC,CAAC,CAAC;AAChD,CAAC;AAFD,kCAEC;AAED,SAAgB,OAAO,CAAC,CAAS,EAAE,cAAsB;IACrD,OAAO,UAAU,CAAC,CAAC,CAAC,OAAO,CAAC,cAAc,CAAC,CAAC,CAAC;AACjD,CAAC;AAFD,0BAEC"}
|
|
@@ -27,6 +27,7 @@ declare const MembraneOrientation3D: StateTransformer<PluginStateObject.Molecule
|
|
|
27
27
|
sizeFactor: number;
|
|
28
28
|
alpha: number;
|
|
29
29
|
quality: "auto" | "medium" | "high" | "low" | "custom" | "highest" | "higher" | "lower" | "lowest";
|
|
30
|
+
material: import("../../mol-util/material").Material;
|
|
30
31
|
sectorOpacity: number;
|
|
31
32
|
doubleSided: boolean;
|
|
32
33
|
flipSided: boolean;
|
|
@@ -20,6 +20,10 @@ declare const BilayerPlanesParams: {
|
|
|
20
20
|
xrayShaded: PD.BooleanParam;
|
|
21
21
|
alpha: PD.Numeric;
|
|
22
22
|
quality: PD.Select<"auto" | "medium" | "high" | "low" | "custom" | "highest" | "higher" | "lower" | "lowest">;
|
|
23
|
+
material: PD.Converted<import("../../mol-util/material").Material, PD.Normalize<{
|
|
24
|
+
metalness: number;
|
|
25
|
+
roughness: number;
|
|
26
|
+
}>>;
|
|
23
27
|
};
|
|
24
28
|
export declare type BilayerPlanesParams = typeof BilayerPlanesParams;
|
|
25
29
|
export declare type BilayerPlanesProps = PD.Values<BilayerPlanesParams>;
|
|
@@ -32,6 +36,10 @@ declare const BilayerRimsParams: {
|
|
|
32
36
|
sizeFactor: PD.Numeric;
|
|
33
37
|
alpha: PD.Numeric;
|
|
34
38
|
quality: PD.Select<"auto" | "medium" | "high" | "low" | "custom" | "highest" | "higher" | "lower" | "lowest">;
|
|
39
|
+
material: PD.Converted<import("../../mol-util/material").Material, PD.Normalize<{
|
|
40
|
+
metalness: number;
|
|
41
|
+
roughness: number;
|
|
42
|
+
}>>;
|
|
35
43
|
};
|
|
36
44
|
export declare type BilayerRimsParams = typeof BilayerRimsParams;
|
|
37
45
|
export declare type BilayerRimsProps = PD.Values<BilayerRimsParams>;
|
|
@@ -45,6 +53,10 @@ export declare const MembraneOrientationParams: {
|
|
|
45
53
|
sizeFactor: PD.Numeric;
|
|
46
54
|
alpha: PD.Numeric;
|
|
47
55
|
quality: PD.Select<"auto" | "medium" | "high" | "low" | "custom" | "highest" | "higher" | "lower" | "lowest">;
|
|
56
|
+
material: PD.Converted<import("../../mol-util/material").Material, PD.Normalize<{
|
|
57
|
+
metalness: number;
|
|
58
|
+
roughness: number;
|
|
59
|
+
}>>;
|
|
48
60
|
sectorOpacity: PD.Numeric;
|
|
49
61
|
doubleSided: PD.BooleanParam;
|
|
50
62
|
flipSided: PD.BooleanParam;
|
|
@@ -64,6 +76,10 @@ export declare function getMembraneOrientationParams(ctx: ThemeRegistryContext,
|
|
|
64
76
|
sizeFactor: PD.Numeric;
|
|
65
77
|
alpha: PD.Numeric;
|
|
66
78
|
quality: PD.Select<"auto" | "medium" | "high" | "low" | "custom" | "highest" | "higher" | "lower" | "lowest">;
|
|
79
|
+
material: PD.Converted<import("../../mol-util/material").Material, PD.Normalize<{
|
|
80
|
+
metalness: number;
|
|
81
|
+
roughness: number;
|
|
82
|
+
}>>;
|
|
67
83
|
sectorOpacity: PD.Numeric;
|
|
68
84
|
doubleSided: PD.BooleanParam;
|
|
69
85
|
flipSided: PD.BooleanParam;
|
|
@@ -83,6 +99,10 @@ export declare const MembraneOrientationRepresentationProvider: StructureReprese
|
|
|
83
99
|
sizeFactor: PD.Numeric;
|
|
84
100
|
alpha: PD.Numeric;
|
|
85
101
|
quality: PD.Select<"auto" | "medium" | "high" | "low" | "custom" | "highest" | "higher" | "lower" | "lowest">;
|
|
102
|
+
material: PD.Converted<import("../../mol-util/material").Material, PD.Normalize<{
|
|
103
|
+
metalness: number;
|
|
104
|
+
roughness: number;
|
|
105
|
+
}>>;
|
|
86
106
|
sectorOpacity: PD.Numeric;
|
|
87
107
|
doubleSided: PD.BooleanParam;
|
|
88
108
|
flipSided: PD.BooleanParam;
|
|
@@ -45,6 +45,10 @@ export declare const MBParams: {
|
|
|
45
45
|
ignoreLight: PD.BooleanParam;
|
|
46
46
|
xrayShaded: PD.BooleanParam;
|
|
47
47
|
alpha: PD.Numeric;
|
|
48
|
+
material: PD.Converted<import("../../mol-util/material").Material, PD.Normalize<{
|
|
49
|
+
metalness: number;
|
|
50
|
+
roughness: number;
|
|
51
|
+
}>>;
|
|
48
52
|
};
|
|
49
53
|
export declare type MBParams = typeof MBParams;
|
|
50
54
|
export declare type UnitcellProps = PD.Values<MBParams>;
|
|
@@ -19,6 +19,10 @@ export declare const ConfalPyramidsParams: {
|
|
|
19
19
|
xrayShaded: PD.BooleanParam;
|
|
20
20
|
alpha: PD.Numeric;
|
|
21
21
|
quality: PD.Select<"auto" | "medium" | "high" | "low" | "custom" | "highest" | "higher" | "lower" | "lowest">;
|
|
22
|
+
material: PD.Converted<import("../../../mol-util/material").Material, PD.Normalize<{
|
|
23
|
+
metalness: number;
|
|
24
|
+
roughness: number;
|
|
25
|
+
}>>;
|
|
22
26
|
};
|
|
23
27
|
export declare type ConfalPyramidsParams = typeof ConfalPyramidsParams;
|
|
24
28
|
export declare function getConfalPyramidsParams(ctx: ThemeRegistryContext, structure: Structure): {
|
|
@@ -31,6 +35,10 @@ export declare function getConfalPyramidsParams(ctx: ThemeRegistryContext, struc
|
|
|
31
35
|
xrayShaded: PD.BooleanParam;
|
|
32
36
|
alpha: PD.Numeric;
|
|
33
37
|
quality: PD.Select<"auto" | "medium" | "high" | "low" | "custom" | "highest" | "higher" | "lower" | "lowest">;
|
|
38
|
+
material: PD.Converted<import("../../../mol-util/material").Material, PD.Normalize<{
|
|
39
|
+
metalness: number;
|
|
40
|
+
roughness: number;
|
|
41
|
+
}>>;
|
|
34
42
|
};
|
|
35
43
|
export declare type ConfalPyramidsRepresentation = StructureRepresentation<ConfalPyramidsParams>;
|
|
36
44
|
export declare function ConfalPyramidsRepresentation(ctx: RepresentationContext, getParams: RepresentationParamsGetter<Structure, ConfalPyramidsParams>): ConfalPyramidsRepresentation;
|
|
@@ -44,4 +52,8 @@ export declare const ConfalPyramidsRepresentationProvider: StructureRepresentati
|
|
|
44
52
|
xrayShaded: PD.BooleanParam;
|
|
45
53
|
alpha: PD.Numeric;
|
|
46
54
|
quality: PD.Select<"auto" | "medium" | "high" | "low" | "custom" | "highest" | "higher" | "lower" | "lowest">;
|
|
55
|
+
material: PD.Converted<import("../../../mol-util/material").Material, PD.Normalize<{
|
|
56
|
+
metalness: number;
|
|
57
|
+
roughness: number;
|
|
58
|
+
}>>;
|
|
47
59
|
}, "confal-pyramids">;
|
|
@@ -4,7 +4,6 @@
|
|
|
4
4
|
* @author Sukolsak Sakshuwong <sukolsak@stanford.edu>
|
|
5
5
|
*/
|
|
6
6
|
import { __awaiter, __extends, __generator } from "tslib";
|
|
7
|
-
import { getStyle } from '../../mol-gl/renderer';
|
|
8
7
|
import { Box3D } from '../../mol-math/geometry';
|
|
9
8
|
import { PluginComponent } from '../../mol-plugin-state/component';
|
|
10
9
|
import { Task } from '../../mol-task';
|
|
@@ -44,21 +43,20 @@ var GeometryControls = /** @class */ (function (_super) {
|
|
|
44
43
|
GeometryControls.prototype.exportGeometry = function () {
|
|
45
44
|
var _this = this;
|
|
46
45
|
var task = Task.create('Export Geometry', function (ctx) { return __awaiter(_this, void 0, void 0, function () {
|
|
47
|
-
var renderObjects, filename,
|
|
48
|
-
var _a, _b, _c
|
|
49
|
-
return __generator(this, function (
|
|
50
|
-
switch (
|
|
46
|
+
var renderObjects, filename, boundingSphere, boundingBox, renderObjectExporter, i, il, blob, e_1;
|
|
47
|
+
var _a, _b, _c;
|
|
48
|
+
return __generator(this, function (_d) {
|
|
49
|
+
switch (_d.label) {
|
|
51
50
|
case 0:
|
|
52
|
-
|
|
51
|
+
_d.trys.push([0, 7, , 8]);
|
|
53
52
|
renderObjects = (_a = this.plugin.canvas3d) === null || _a === void 0 ? void 0 : _a.getRenderObjects();
|
|
54
53
|
filename = this.getFilename();
|
|
55
|
-
|
|
56
|
-
boundingSphere = (_c = this.plugin.canvas3d) === null || _c === void 0 ? void 0 : _c.boundingSphereVisible;
|
|
54
|
+
boundingSphere = (_b = this.plugin.canvas3d) === null || _b === void 0 ? void 0 : _b.boundingSphereVisible;
|
|
57
55
|
boundingBox = Box3D.fromSphere3D(Box3D(), boundingSphere);
|
|
58
56
|
renderObjectExporter = void 0;
|
|
59
57
|
switch (this.behaviors.params.value.format) {
|
|
60
58
|
case 'glb':
|
|
61
|
-
renderObjectExporter = new GlbExporter(
|
|
59
|
+
renderObjectExporter = new GlbExporter(boundingBox);
|
|
62
60
|
break;
|
|
63
61
|
case 'obj':
|
|
64
62
|
renderObjectExporter = new ObjExporter(filename, boundingBox);
|
|
@@ -67,33 +65,33 @@ var GeometryControls = /** @class */ (function (_super) {
|
|
|
67
65
|
renderObjectExporter = new StlExporter(boundingBox);
|
|
68
66
|
break;
|
|
69
67
|
case 'usdz':
|
|
70
|
-
renderObjectExporter = new UsdzExporter(
|
|
68
|
+
renderObjectExporter = new UsdzExporter(boundingBox, boundingSphere.radius);
|
|
71
69
|
break;
|
|
72
70
|
default: throw new Error('Unsupported format.');
|
|
73
71
|
}
|
|
74
72
|
i = 0, il = renderObjects.length;
|
|
75
|
-
|
|
73
|
+
_d.label = 1;
|
|
76
74
|
case 1:
|
|
77
75
|
if (!(i < il)) return [3 /*break*/, 5];
|
|
78
76
|
return [4 /*yield*/, ctx.update({ message: "Exporting object ".concat(i, "/").concat(il) })];
|
|
79
77
|
case 2:
|
|
80
|
-
|
|
81
|
-
return [4 /*yield*/, renderObjectExporter.add(renderObjects[i], (
|
|
78
|
+
_d.sent();
|
|
79
|
+
return [4 /*yield*/, renderObjectExporter.add(renderObjects[i], (_c = this.plugin.canvas3d) === null || _c === void 0 ? void 0 : _c.webgl, ctx)];
|
|
82
80
|
case 3:
|
|
83
|
-
|
|
84
|
-
|
|
81
|
+
_d.sent();
|
|
82
|
+
_d.label = 4;
|
|
85
83
|
case 4:
|
|
86
84
|
++i;
|
|
87
85
|
return [3 /*break*/, 1];
|
|
88
86
|
case 5: return [4 /*yield*/, renderObjectExporter.getBlob(ctx)];
|
|
89
87
|
case 6:
|
|
90
|
-
blob =
|
|
88
|
+
blob = _d.sent();
|
|
91
89
|
return [2 /*return*/, {
|
|
92
90
|
blob: blob,
|
|
93
91
|
filename: filename + '.' + renderObjectExporter.fileExtension
|
|
94
92
|
}];
|
|
95
93
|
case 7:
|
|
96
|
-
e_1 =
|
|
94
|
+
e_1 = _d.sent();
|
|
97
95
|
this.plugin.log.error('Error during geometry export');
|
|
98
96
|
throw e_1;
|
|
99
97
|
case 8: return [2 /*return*/];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"controls.js","sourceRoot":"","sources":["../../../src/extensions/geo-export/controls.ts"],"names":[],"mappings":"AAAA;;;;GAIG;;AAEH,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"controls.js","sourceRoot":"","sources":["../../../src/extensions/geo-export/controls.ts"],"names":[],"mappings":"AAAA;;;;GAIG;;AAEH,OAAO,EAAE,KAAK,EAAE,MAAM,yBAAyB,CAAC;AAChD,OAAO,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAC;AAEnE,OAAO,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAC;AACtC,OAAO,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAC;AACnE,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB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yBACnD;wBAEQ,CAAC,GAAG,CAAC,EAAE,EAAE,GAAG,aAAa,CAAC,MAAM;;;6BAAE,CAAA,CAAC,GAAG,EAAE,CAAA;wBAC7C,qBAAM,GAAG,CAAC,MAAM,CAAC,EAAE,OAAO,EAAE,2BAAoB,CAAC,cAAI,EAAE,CAAE,EAAE,CAAC,EAAA;;wBAA5D,SAA4D,CAAC;wBAC7D,qBAAM,oBAAoB,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC,CAAC,EAAE,MAAA,IAAI,CAAC,MAAM,CAAC,QAAQ,0CAAE,KAAM,EAAE,GAAG,CAAC,EAAA;;wBAAnF,SAAmF,CAAC;;;wBAFrC,EAAE,CAAC,CAAA;;4BAKzC,qBAAM,oBAAoB,CAAC,OAAO,CAAC,GAAG,CAAC,EAAA;;wBAA9C,IAAI,GAAG,SAAuC;wBACpD,sBAAO;gCACH,IAAI,MAAA;gCACJ,QAAQ,EAAE,QAAQ,GAAG,GAAG,GAAG,oBAAoB,CAAC,aAAa;6BAChE,EAAC;;;wBAEF,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,8BAA8B,CAAC,CAAC;wBACtD,MAAM,GAAC,CAAC;;;;aAEf,CAAC,CAAC;QAEH,OAAO,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,CAAC,CAAC;IAC3D,CAAC;IAKL,uBAAC;AAAD,CAAC,AA5DD,CAAsC,eAAe,GA4DpD"}
|
|
@@ -4,7 +4,6 @@
|
|
|
4
4
|
* @author Sukolsak Sakshuwong <sukolsak@stanford.edu>
|
|
5
5
|
* @author Alexander Rose <alexander.rose@weirdbyte.de>
|
|
6
6
|
*/
|
|
7
|
-
import { Style } from '../../mol-gl/renderer';
|
|
8
7
|
import { Box3D } from '../../mol-math/geometry';
|
|
9
8
|
import { RuntimeContext } from '../../mol-task';
|
|
10
9
|
import { MeshExporter, AddMeshInput } from './mesh-exporter';
|
|
@@ -12,10 +11,11 @@ export declare type GlbData = {
|
|
|
12
11
|
glb: Uint8Array;
|
|
13
12
|
};
|
|
14
13
|
export declare class GlbExporter extends MeshExporter<GlbData> {
|
|
15
|
-
private style;
|
|
16
14
|
readonly fileExtension = "glb";
|
|
17
15
|
private nodes;
|
|
18
16
|
private meshes;
|
|
17
|
+
private materials;
|
|
18
|
+
private materialMap;
|
|
19
19
|
private accessors;
|
|
20
20
|
private bufferViews;
|
|
21
21
|
private binaryBuffer;
|
|
@@ -25,10 +25,11 @@ export declare class GlbExporter extends MeshExporter<GlbData> {
|
|
|
25
25
|
private addBuffer;
|
|
26
26
|
private addGeometryBuffers;
|
|
27
27
|
private addColorBuffer;
|
|
28
|
+
private addMaterial;
|
|
28
29
|
protected addMeshWithColors(input: AddMeshInput): Promise<void>;
|
|
29
30
|
getData(): Promise<{
|
|
30
31
|
glb: Uint8Array;
|
|
31
32
|
}>;
|
|
32
33
|
getBlob(ctx: RuntimeContext): Promise<Blob>;
|
|
33
|
-
constructor(
|
|
34
|
+
constructor(boundingBox: Box3D);
|
|
34
35
|
}
|
|
@@ -29,12 +29,13 @@ var JSON_PAD_CHAR = 0x20;
|
|
|
29
29
|
var BIN_PAD_CHAR = 0x00;
|
|
30
30
|
var GlbExporter = /** @class */ (function (_super) {
|
|
31
31
|
__extends(GlbExporter, _super);
|
|
32
|
-
function GlbExporter(
|
|
32
|
+
function GlbExporter(boundingBox) {
|
|
33
33
|
var _this = _super.call(this) || this;
|
|
34
|
-
_this.style = style;
|
|
35
34
|
_this.fileExtension = 'glb';
|
|
36
35
|
_this.nodes = [];
|
|
37
36
|
_this.meshes = [];
|
|
37
|
+
_this.materials = [];
|
|
38
|
+
_this.materialMap = new Map();
|
|
38
39
|
_this.accessors = [];
|
|
39
40
|
_this.bufferViews = [];
|
|
40
41
|
_this.binaryBuffer = [];
|
|
@@ -134,9 +135,23 @@ var GlbExporter = /** @class */ (function (_super) {
|
|
|
134
135
|
}
|
|
135
136
|
return this.addBuffer(colorBuffer, UNSIGNED_BYTE, 'VEC4', vertexCount, ARRAY_BUFFER, undefined, undefined, true);
|
|
136
137
|
};
|
|
138
|
+
GlbExporter.prototype.addMaterial = function (metalness, roughness) {
|
|
139
|
+
var hash = "".concat(metalness, "|").concat(roughness);
|
|
140
|
+
if (!this.materialMap.has(hash)) {
|
|
141
|
+
this.materialMap.set(hash, this.materials.length);
|
|
142
|
+
this.materials.push({
|
|
143
|
+
pbrMetallicRoughness: {
|
|
144
|
+
baseColorFactor: [1, 1, 1, 1],
|
|
145
|
+
metallicFactor: metalness,
|
|
146
|
+
roughnessFactor: roughness
|
|
147
|
+
}
|
|
148
|
+
});
|
|
149
|
+
}
|
|
150
|
+
return this.materialMap.get(hash);
|
|
151
|
+
};
|
|
137
152
|
GlbExporter.prototype.addMeshWithColors = function (input) {
|
|
138
153
|
return __awaiter(this, void 0, void 0, function () {
|
|
139
|
-
var mesh, values, isGeoTexture, webgl, ctx, t, colorType, overpaintType, transparencyType, dTransparency, aTransform, instanceCount, interpolatedColors, stride, interpolatedOverpaint, stride, interpolatedTransparency, stride, sameGeometryBuffers, sameColorBuffer, vertexAccessorIndex, normalAccessorIndex, indexAccessorIndex, colorAccessorIndex, meshIndex, instanceIndex, _a, vertices, normals, indices, groups, vertexCount, drawCount, accessorIndices, node;
|
|
154
|
+
var mesh, values, isGeoTexture, webgl, ctx, t, colorType, overpaintType, transparencyType, dTransparency, aTransform, instanceCount, metalness, roughness, material, interpolatedColors, stride, interpolatedOverpaint, stride, interpolatedTransparency, stride, sameGeometryBuffers, sameColorBuffer, vertexAccessorIndex, normalAccessorIndex, indexAccessorIndex, colorAccessorIndex, meshIndex, instanceIndex, _a, vertices, normals, indices, groups, vertexCount, drawCount, accessorIndices, node;
|
|
140
155
|
return __generator(this, function (_b) {
|
|
141
156
|
switch (_b.label) {
|
|
142
157
|
case 0:
|
|
@@ -148,6 +163,9 @@ var GlbExporter = /** @class */ (function (_super) {
|
|
|
148
163
|
dTransparency = values.dTransparency.ref.value;
|
|
149
164
|
aTransform = values.aTransform.ref.value;
|
|
150
165
|
instanceCount = values.uInstanceCount.ref.value;
|
|
166
|
+
metalness = values.uMetalness.ref.value;
|
|
167
|
+
roughness = values.uRoughness.ref.value;
|
|
168
|
+
material = this.addMaterial(metalness, roughness);
|
|
151
169
|
if (colorType === 'volume' || colorType === 'volumeInstance') {
|
|
152
170
|
stride = isGeoTexture ? 4 : 3;
|
|
153
171
|
interpolatedColors = GlbExporter.getInterpolatedColors(webgl, { vertices: mesh.vertices, vertexCount: mesh.vertexCount, values: values, stride: stride, colorType: colorType });
|
|
@@ -199,7 +217,7 @@ var GlbExporter = /** @class */ (function (_super) {
|
|
|
199
217
|
COLOR_0: colorAccessorIndex
|
|
200
218
|
},
|
|
201
219
|
indices: indexAccessorIndex,
|
|
202
|
-
material:
|
|
220
|
+
material: material
|
|
203
221
|
}]
|
|
204
222
|
});
|
|
205
223
|
}
|
|
@@ -240,13 +258,7 @@ var GlbExporter = /** @class */ (function (_super) {
|
|
|
240
258
|
}],
|
|
241
259
|
bufferViews: this.bufferViews,
|
|
242
260
|
accessors: this.accessors,
|
|
243
|
-
materials:
|
|
244
|
-
pbrMetallicRoughness: {
|
|
245
|
-
baseColorFactor: [1, 1, 1, 1],
|
|
246
|
-
metallicFactor: this.style.metalness,
|
|
247
|
-
roughnessFactor: this.style.roughness
|
|
248
|
-
}
|
|
249
|
-
}]
|
|
261
|
+
materials: this.materials
|
|
250
262
|
};
|
|
251
263
|
createChunk = function (chunkType, data, byteLength, padChar) {
|
|
252
264
|
var padding = null;
|