@inweb/viewer-three 26.6.0 → 26.6.2
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/dist/plugins/components/LightHelperComponent.js +9 -3
- package/dist/plugins/components/LightHelperComponent.js.map +1 -1
- package/dist/plugins/components/LightHelperComponent.min.js +1 -1
- package/dist/plugins/components/LightHelperComponent.module.js +5 -4
- package/dist/plugins/components/LightHelperComponent.module.js.map +1 -1
- package/dist/plugins/components/RoomEnvironmentComponent.js +178 -0
- package/dist/plugins/components/RoomEnvironmentComponent.js.map +1 -0
- package/dist/plugins/components/RoomEnvironmentComponent.min.js +1 -0
- package/dist/plugins/components/RoomEnvironmentComponent.module.js +21 -0
- package/dist/plugins/components/RoomEnvironmentComponent.module.js.map +1 -0
- package/dist/plugins/loaders/IFCXLoader.js +21 -27
- package/dist/plugins/loaders/IFCXLoader.js.map +1 -1
- package/dist/plugins/loaders/IFCXLoader.min.js +1 -1
- package/dist/plugins/loaders/IFCXLoader.module.js +7 -18
- package/dist/plugins/loaders/IFCXLoader.module.js.map +1 -1
- package/dist/viewer-three.js +1162 -231
- package/dist/viewer-three.js.map +1 -1
- package/dist/viewer-three.min.js +2 -2
- package/dist/viewer-three.module.js +180 -39
- package/dist/viewer-three.module.js.map +1 -1
- package/lib/Viewer/Viewer.d.ts +1 -1
- package/lib/Viewer/components/HighlighterComponent.d.ts +18 -0
- package/lib/Viewer/components/HighlighterUtils.d.ts +6 -0
- package/lib/Viewer/components/LightComponent.d.ts +3 -1
- package/lib/Viewer/components/SelectionComponent.d.ts +5 -4
- package/package.json +5 -5
- package/plugins/components/LightHelperComponent.ts +10 -5
- package/{src/Viewer → plugins}/components/RoomEnvironmentComponent.ts +4 -4
- package/plugins/loaders/IFCX/render.js +26 -21
- package/src/Viewer/Viewer.ts +4 -4
- package/src/Viewer/components/HighlighterComponent.ts +159 -0
- package/src/Viewer/components/HighlighterUtils.ts +116 -0
- package/src/Viewer/components/LightComponent.ts +33 -4
- package/src/Viewer/components/SelectionComponent.ts +10 -22
- package/src/Viewer/components/index.ts +2 -2
- package/lib/Viewer/components/RoomEnvironmentComponent.d.ts +0 -7
|
@@ -2,11 +2,15 @@ import { draggersRegistry, commandsRegistry, componentsRegistry, Loader, loaders
|
|
|
2
2
|
|
|
3
3
|
export * from "@inweb/viewer-core";
|
|
4
4
|
|
|
5
|
-
import { Line, Vector3, BufferGeometry, Float32BufferAttribute, LineBasicMaterial, Mesh, MeshBasicMaterial, DoubleSide, EventDispatcher, MOUSE, TOUCH, Spherical, Quaternion, Vector2, Plane, Object3D, Matrix4, Vector4, Raycaster, Controls, Clock, Box3, Sphere, MathUtils, Color,
|
|
5
|
+
import { Line, Vector3, BufferGeometry, Float32BufferAttribute, LineBasicMaterial, Mesh, MeshBasicMaterial, DoubleSide, EventDispatcher, MOUSE, TOUCH, Spherical, Quaternion, Vector2, Plane, Object3D, Matrix4, Vector4, Raycaster, Controls, Clock, Box3, Sphere, MathUtils, Color, AmbientLight, DirectionalLight, HemisphereLight, EdgesGeometry, OrthographicCamera, CylinderGeometry, Sprite, CanvasTexture, SRGBColorSpace, SpriteMaterial, LoadingManager, LoaderUtils, Scene, PerspectiveCamera, WebGLRenderer, LinearToneMapping } from "three";
|
|
6
6
|
|
|
7
7
|
import { TransformControls } from "three/examples/jsm/controls/TransformControls.js";
|
|
8
8
|
|
|
9
|
-
import {
|
|
9
|
+
import { LineSegmentsGeometry } from "three/examples/jsm/lines/LineSegmentsGeometry.js";
|
|
10
|
+
|
|
11
|
+
import { Wireframe } from "three/examples/jsm/lines/Wireframe.js";
|
|
12
|
+
|
|
13
|
+
import { LineMaterial } from "three/examples/jsm/lines/LineMaterial.js";
|
|
10
14
|
|
|
11
15
|
import { GLTFLoader } from "three/examples/jsm/loaders/GLTFLoader.js";
|
|
12
16
|
|
|
@@ -1662,31 +1666,22 @@ class SelectionComponent {
|
|
|
1662
1666
|
if (event.button !== 0) return;
|
|
1663
1667
|
this.viewer.executeCommand("zoomToSelected");
|
|
1664
1668
|
};
|
|
1665
|
-
this.
|
|
1666
|
-
|
|
1667
|
-
this.facesMaterial.color.setRGB(facesColor.r / 255, facesColor.g / 255, facesColor.b / 255);
|
|
1668
|
-
this.facesMaterial.opacity = (255 - facesTransparancy) / 255;
|
|
1669
|
-
this.viewer.update();
|
|
1669
|
+
this.initHighlighter = () => {
|
|
1670
|
+
this.highlighter = this.viewer.getComponent("HighlighterComponent");
|
|
1670
1671
|
};
|
|
1671
1672
|
this.viewer = viewer;
|
|
1672
1673
|
this.raycaster = new Raycaster;
|
|
1673
1674
|
this.downPosition = new Vector2;
|
|
1674
|
-
const {facesColor: facesColor, facesTransparancy: facesTransparancy} = this.viewer.options;
|
|
1675
|
-
this.facesMaterial = new MeshBasicMaterial;
|
|
1676
|
-
this.facesMaterial.color.setRGB(facesColor.r / 255, facesColor.g / 255, facesColor.b / 255);
|
|
1677
|
-
this.facesMaterial.opacity = (255 - facesTransparancy) / 255;
|
|
1678
|
-
this.facesMaterial.transparent = true;
|
|
1679
1675
|
this.viewer.addEventListener("pointerdown", this.onPointerDown);
|
|
1680
1676
|
this.viewer.addEventListener("pointerup", this.onPointerUp);
|
|
1681
1677
|
this.viewer.addEventListener("dblclick", this.onDoubleClick);
|
|
1682
|
-
this.viewer.addEventListener("
|
|
1678
|
+
this.viewer.addEventListener("initialize", this.initHighlighter);
|
|
1683
1679
|
}
|
|
1684
1680
|
dispose() {
|
|
1685
|
-
this.facesMaterial.dispose();
|
|
1686
1681
|
this.viewer.removeEventListener("pointerdown", this.onPointerDown);
|
|
1687
1682
|
this.viewer.removeEventListener("pointerup", this.onPointerUp);
|
|
1688
1683
|
this.viewer.removeEventListener("dblclick", this.onDoubleClick);
|
|
1689
|
-
this.viewer.removeEventListener("
|
|
1684
|
+
this.viewer.removeEventListener("initialize", this.initHighlighter);
|
|
1690
1685
|
}
|
|
1691
1686
|
getMousePosition(event, target) {
|
|
1692
1687
|
return target.set(event.clientX, event.clientY);
|
|
@@ -1718,14 +1713,13 @@ class SelectionComponent {
|
|
|
1718
1713
|
select(object) {
|
|
1719
1714
|
if (object.isSelected) return;
|
|
1720
1715
|
object.isSelected = true;
|
|
1721
|
-
|
|
1722
|
-
object.material = this.facesMaterial;
|
|
1716
|
+
this.highlighter.highlight(object);
|
|
1723
1717
|
this.viewer.selected.push(object);
|
|
1724
1718
|
}
|
|
1725
1719
|
clearSelection() {
|
|
1726
1720
|
this.viewer.selected.forEach((object => {
|
|
1727
1721
|
object.isSelected = false;
|
|
1728
|
-
|
|
1722
|
+
this.highlighter.unhighlight(object);
|
|
1729
1723
|
}));
|
|
1730
1724
|
this.viewer.selected.length = 0;
|
|
1731
1725
|
}
|
|
@@ -1957,19 +1951,6 @@ class BackgroundComponent {
|
|
|
1957
1951
|
}
|
|
1958
1952
|
}
|
|
1959
1953
|
|
|
1960
|
-
class RoomEnvironmentComponent {
|
|
1961
|
-
constructor(viewer) {
|
|
1962
|
-
this.viewer = viewer;
|
|
1963
|
-
const environment = new RoomEnvironment;
|
|
1964
|
-
const pmremGenerator = new PMREMGenerator(this.viewer.renderer);
|
|
1965
|
-
this.viewer.scene.environment = pmremGenerator.fromScene(environment).texture;
|
|
1966
|
-
environment.dispose();
|
|
1967
|
-
}
|
|
1968
|
-
dispose() {
|
|
1969
|
-
this.viewer.scene.environment = undefined;
|
|
1970
|
-
}
|
|
1971
|
-
}
|
|
1972
|
-
|
|
1973
1954
|
class CameraComponent {
|
|
1974
1955
|
constructor(viewer) {
|
|
1975
1956
|
this.geometryEnd = () => {
|
|
@@ -2043,20 +2024,33 @@ class LightComponent {
|
|
|
2043
2024
|
this.geometryEnd = () => {
|
|
2044
2025
|
this.ambientLight.removeFromParent();
|
|
2045
2026
|
this.directionalLight.removeFromParent();
|
|
2027
|
+
this.frontLight.removeFromParent();
|
|
2028
|
+
this.hemisphereLight.removeFromParent();
|
|
2046
2029
|
if (this.viewer.extents.isEmpty()) return;
|
|
2047
2030
|
const extentsCenter = this.viewer.extents.getCenter(new Vector3);
|
|
2048
|
-
const extentsSize = this.viewer.extents.getBoundingSphere(new Sphere).radius
|
|
2049
|
-
this.directionalLight.position.set(.5, 0, .866).multiplyScalar(extentsSize).add(extentsCenter);
|
|
2031
|
+
const extentsSize = this.viewer.extents.getBoundingSphere(new Sphere).radius;
|
|
2032
|
+
this.directionalLight.position.set(.5, 0, .866).multiplyScalar(extentsSize * 2).add(extentsCenter);
|
|
2050
2033
|
this.directionalLight.target.position.copy(extentsCenter);
|
|
2034
|
+
this.frontLight.position.set(0, extentsSize * 2, 0).add(extentsCenter);
|
|
2035
|
+
this.frontLight.target.position.copy(extentsCenter);
|
|
2036
|
+
this.hemisphereLight.position.set(0, extentsSize * 3, 0).add(extentsCenter);
|
|
2051
2037
|
this.viewer.scene.add(this.ambientLight);
|
|
2052
2038
|
this.viewer.scene.add(this.directionalLight);
|
|
2039
|
+
this.viewer.scene.add(this.frontLight);
|
|
2040
|
+
this.viewer.scene.add(this.hemisphereLight);
|
|
2053
2041
|
};
|
|
2054
2042
|
this.viewer = viewer;
|
|
2055
|
-
this.ambientLight = new AmbientLight(16777215,
|
|
2043
|
+
this.ambientLight = new AmbientLight(16777215, 1);
|
|
2056
2044
|
this.viewer.scene.add(this.ambientLight);
|
|
2057
2045
|
this.directionalLight = new DirectionalLight(16777215, 1);
|
|
2058
2046
|
this.directionalLight.position.set(.5, 0, .866);
|
|
2059
2047
|
this.viewer.scene.add(this.directionalLight);
|
|
2048
|
+
this.frontLight = new DirectionalLight(16777215, 1.25);
|
|
2049
|
+
this.frontLight.position.set(0, 1, 0);
|
|
2050
|
+
this.viewer.scene.add(this.frontLight);
|
|
2051
|
+
this.hemisphereLight = new HemisphereLight(16777215, 4473924, 1.25);
|
|
2052
|
+
this.hemisphereLight.position.set(0, 0, 1);
|
|
2053
|
+
this.viewer.scene.add(this.hemisphereLight);
|
|
2060
2054
|
this.viewer.addEventListener("databasechunk", this.geometryEnd);
|
|
2061
2055
|
this.viewer.addEventListener("clear", this.geometryEnd);
|
|
2062
2056
|
}
|
|
@@ -2065,6 +2059,10 @@ class LightComponent {
|
|
|
2065
2059
|
this.ambientLight.dispose();
|
|
2066
2060
|
this.directionalLight.removeFromParent();
|
|
2067
2061
|
this.directionalLight.dispose();
|
|
2062
|
+
this.frontLight.removeFromParent();
|
|
2063
|
+
this.frontLight.dispose();
|
|
2064
|
+
this.hemisphereLight.removeFromParent();
|
|
2065
|
+
this.hemisphereLight.dispose();
|
|
2068
2066
|
this.viewer.removeEventListener("databasechunk", this.geometryEnd);
|
|
2069
2067
|
this.viewer.removeEventListener("clear", this.geometryEnd);
|
|
2070
2068
|
}
|
|
@@ -2117,6 +2115,149 @@ class ResizeCanvasComponent {
|
|
|
2117
2115
|
}
|
|
2118
2116
|
}
|
|
2119
2117
|
|
|
2118
|
+
class HighlighterUtils {
|
|
2119
|
+
static isBreak(positions, i) {
|
|
2120
|
+
return isNaN(positions[i]) || isNaN(positions[i + 1]) || isNaN(positions[i + 2]) || positions[i] === Infinity || positions[i] === -Infinity || positions[i + 1] === Infinity || positions[i + 1] === -Infinity || positions[i + 2] === Infinity || positions[i + 2] === -Infinity;
|
|
2121
|
+
}
|
|
2122
|
+
static fromIndexedLine(positions, indices) {
|
|
2123
|
+
const lineGeometry = new LineSegmentsGeometry;
|
|
2124
|
+
const segments = [];
|
|
2125
|
+
for (let i = 0; i < indices.length; i += 2) {
|
|
2126
|
+
const idx1 = indices[i] * 3;
|
|
2127
|
+
const idx2 = indices[i + 1] * 3;
|
|
2128
|
+
if (indices[i] === -1 || indices[i + 1] === -1) {
|
|
2129
|
+
continue;
|
|
2130
|
+
}
|
|
2131
|
+
segments.push(positions[idx1], positions[idx1 + 1], positions[idx1 + 2], positions[idx2], positions[idx2 + 1], positions[idx2 + 2]);
|
|
2132
|
+
}
|
|
2133
|
+
if (segments.length === 0) return null;
|
|
2134
|
+
lineGeometry.setPositions(segments);
|
|
2135
|
+
return lineGeometry;
|
|
2136
|
+
}
|
|
2137
|
+
static fromNonIndexedLine(positions, isLineSegments) {
|
|
2138
|
+
const lineGeometry = new LineSegmentsGeometry;
|
|
2139
|
+
const segments = [];
|
|
2140
|
+
if (isLineSegments) {
|
|
2141
|
+
for (let i = 0; i < positions.length; i += 6) {
|
|
2142
|
+
if (i + 5 >= positions.length) break;
|
|
2143
|
+
if (HighlighterUtils.isBreak(positions, i) || HighlighterUtils.isBreak(positions, i + 3)) continue;
|
|
2144
|
+
segments.push(positions[i], positions[i + 1], positions[i + 2], positions[i + 3], positions[i + 4], positions[i + 5]);
|
|
2145
|
+
}
|
|
2146
|
+
} else {
|
|
2147
|
+
let lastValidIndex = -1;
|
|
2148
|
+
for (let i = 0; i < positions.length; i += 3) {
|
|
2149
|
+
if (HighlighterUtils.isBreak(positions, i)) {
|
|
2150
|
+
lastValidIndex = -1;
|
|
2151
|
+
continue;
|
|
2152
|
+
}
|
|
2153
|
+
if (lastValidIndex !== -1) {
|
|
2154
|
+
segments.push(positions[lastValidIndex], positions[lastValidIndex + 1], positions[lastValidIndex + 2], positions[i], positions[i + 1], positions[i + 2]);
|
|
2155
|
+
}
|
|
2156
|
+
lastValidIndex = i;
|
|
2157
|
+
}
|
|
2158
|
+
}
|
|
2159
|
+
if (segments.length === 0) return null;
|
|
2160
|
+
lineGeometry.setPositions(segments);
|
|
2161
|
+
return lineGeometry;
|
|
2162
|
+
}
|
|
2163
|
+
}
|
|
2164
|
+
|
|
2165
|
+
class HighlighterComponent {
|
|
2166
|
+
constructor(viewer) {
|
|
2167
|
+
this.geometryEnd = () => {
|
|
2168
|
+
const {facesColor: facesColor, facesTransparancy: facesTransparancy, edgesColor: edgesColor} = this.viewer.options;
|
|
2169
|
+
this.highlightMaterial = new MeshBasicMaterial({
|
|
2170
|
+
color: new Color(facesColor.r / 255, facesColor.g / 255, facesColor.b / 255),
|
|
2171
|
+
transparent: true,
|
|
2172
|
+
opacity: (255 - facesTransparancy) / 255,
|
|
2173
|
+
depthTest: false,
|
|
2174
|
+
depthWrite: false
|
|
2175
|
+
});
|
|
2176
|
+
this.outlineMaterial = new LineMaterial({
|
|
2177
|
+
color: new Color(edgesColor.r / 255, edgesColor.g / 255, edgesColor.b / 255),
|
|
2178
|
+
linewidth: 1.5,
|
|
2179
|
+
depthTest: false,
|
|
2180
|
+
depthWrite: false,
|
|
2181
|
+
resolution: new Vector2(window.innerWidth, window.innerHeight)
|
|
2182
|
+
});
|
|
2183
|
+
this.highlightLineMaterial = new LineBasicMaterial({
|
|
2184
|
+
color: new Color(facesColor.r / 255, facesColor.g / 255, facesColor.b / 255),
|
|
2185
|
+
depthTest: false,
|
|
2186
|
+
depthWrite: false
|
|
2187
|
+
});
|
|
2188
|
+
this.highlightLineGlowMaterial = new LineMaterial({
|
|
2189
|
+
color: new Color(facesColor.r / 255, facesColor.g / 255, facesColor.b / 255),
|
|
2190
|
+
linewidth: 5,
|
|
2191
|
+
transparent: true,
|
|
2192
|
+
opacity: .8,
|
|
2193
|
+
depthTest: true,
|
|
2194
|
+
depthWrite: true,
|
|
2195
|
+
resolution: new Vector2(window.innerWidth, window.innerHeight)
|
|
2196
|
+
});
|
|
2197
|
+
};
|
|
2198
|
+
this.optionsChange = () => {
|
|
2199
|
+
const {facesColor: facesColor, facesTransparancy: facesTransparancy, edgesColor: edgesColor} = this.viewer.options;
|
|
2200
|
+
this.highlightMaterial.color.setRGB(facesColor.r / 255, facesColor.g / 255, facesColor.b / 255);
|
|
2201
|
+
this.highlightMaterial.opacity = (255 - facesTransparancy) / 255;
|
|
2202
|
+
this.outlineMaterial.color.setRGB(edgesColor.r / 255, edgesColor.g / 255, edgesColor.b / 255);
|
|
2203
|
+
this.highlightLineMaterial.color.setRGB(facesColor.r / 255, facesColor.g / 255, facesColor.b / 255);
|
|
2204
|
+
this.highlightLineGlowMaterial.color.setRGB(facesColor.r / 255, facesColor.g / 255, facesColor.b / 255);
|
|
2205
|
+
this.viewer.update();
|
|
2206
|
+
};
|
|
2207
|
+
this.viewer = viewer;
|
|
2208
|
+
this.viewer.addEventListener("databasechunk", this.geometryEnd);
|
|
2209
|
+
this.viewer.addEventListener("optionschange", this.optionsChange);
|
|
2210
|
+
this.viewer.addEventListener("resize", this.viewerResize);
|
|
2211
|
+
this.geometryEnd();
|
|
2212
|
+
}
|
|
2213
|
+
dispose() {
|
|
2214
|
+
this.viewer.removeEventListener("databasechunk", this.geometryEnd);
|
|
2215
|
+
this.viewer.removeEventListener("optionschange", this.optionsChange);
|
|
2216
|
+
this.viewer.removeEventListener("resize", this.viewerResize);
|
|
2217
|
+
}
|
|
2218
|
+
highlight(object) {
|
|
2219
|
+
if (object.isHighlighted) return;
|
|
2220
|
+
if (object.isLine || object.isLineSegments) {
|
|
2221
|
+
const positions = object.geometry.attributes.position.array;
|
|
2222
|
+
const indices = object.geometry.index ? object.geometry.index.array : null;
|
|
2223
|
+
const lineGeometry = indices ? HighlighterUtils.fromIndexedLine(positions, indices) : HighlighterUtils.fromNonIndexedLine(positions, object.isLineSegments);
|
|
2224
|
+
const wireframe = new Wireframe(lineGeometry, this.highlightLineGlowMaterial);
|
|
2225
|
+
wireframe.position.copy(object.position);
|
|
2226
|
+
wireframe.rotation.copy(object.rotation);
|
|
2227
|
+
wireframe.scale.copy(object.scale);
|
|
2228
|
+
object.parent.add(wireframe);
|
|
2229
|
+
object.userData.highlightwireframe = wireframe;
|
|
2230
|
+
object.userData.originalMaterial = object.material;
|
|
2231
|
+
object.material = this.highlightLineMaterial;
|
|
2232
|
+
object.isHighlighted = true;
|
|
2233
|
+
} else if (object.isMesh) {
|
|
2234
|
+
const edgesGeometry = new EdgesGeometry(object.geometry, 30);
|
|
2235
|
+
const lineGeometry = (new LineSegmentsGeometry).fromEdgesGeometry(edgesGeometry);
|
|
2236
|
+
const wireframe = new Wireframe(lineGeometry, this.outlineMaterial);
|
|
2237
|
+
wireframe.position.copy(object.position);
|
|
2238
|
+
wireframe.rotation.copy(object.rotation);
|
|
2239
|
+
wireframe.scale.copy(object.scale);
|
|
2240
|
+
object.parent.add(wireframe);
|
|
2241
|
+
object.userData.highlightwireframe = wireframe;
|
|
2242
|
+
object.userData.originalMaterial = object.material;
|
|
2243
|
+
object.material = this.highlightMaterial;
|
|
2244
|
+
object.isHighlighted = true;
|
|
2245
|
+
}
|
|
2246
|
+
}
|
|
2247
|
+
unhighlight(object) {
|
|
2248
|
+
if (!object.isHighlighted) return;
|
|
2249
|
+
object.isHighlighted = false;
|
|
2250
|
+
object.material = object.userData.originalMaterial;
|
|
2251
|
+
object.userData.highlightwireframe.removeFromParent();
|
|
2252
|
+
delete object.userData.originalMaterial;
|
|
2253
|
+
delete object.userData.highlightwireframe;
|
|
2254
|
+
}
|
|
2255
|
+
viewerResize(event) {
|
|
2256
|
+
if (!this.outlineMaterial) return;
|
|
2257
|
+
this.outlineMaterial.resolution.set(event.width, event.height);
|
|
2258
|
+
}
|
|
2259
|
+
}
|
|
2260
|
+
|
|
2120
2261
|
class WCSHelper extends Object3D {
|
|
2121
2262
|
constructor(camera) {
|
|
2122
2263
|
super();
|
|
@@ -2230,14 +2371,14 @@ components.registerComponent("CameraComponent", (viewer => new CameraComponent(v
|
|
|
2230
2371
|
|
|
2231
2372
|
components.registerComponent("BackgroundComponent", (viewer => new BackgroundComponent(viewer)));
|
|
2232
2373
|
|
|
2233
|
-
components.registerComponent("RoomEnvironmentComponent", (viewer => new RoomEnvironmentComponent(viewer)));
|
|
2234
|
-
|
|
2235
2374
|
components.registerComponent("LightComponent", (viewer => new LightComponent(viewer)));
|
|
2236
2375
|
|
|
2237
2376
|
components.registerComponent("ResizeCanvasComponent", (viewer => new ResizeCanvasComponent(viewer)));
|
|
2238
2377
|
|
|
2239
2378
|
components.registerComponent("RenderLoopComponent", (viewer => new RenderLoopComponent(viewer)));
|
|
2240
2379
|
|
|
2380
|
+
components.registerComponent("HighlighterComponent", (viewer => new HighlighterComponent(viewer)));
|
|
2381
|
+
|
|
2241
2382
|
components.registerComponent("SelectionComponent", (viewer => new SelectionComponent(viewer)));
|
|
2242
2383
|
|
|
2243
2384
|
components.registerComponent("WCSHelperComponent", (viewer => new WCSHelperComponent(viewer)));
|
|
@@ -2670,6 +2811,9 @@ class Viewer extends EventEmitter2 {
|
|
|
2670
2811
|
this.setActiveDragger(dragger.name);
|
|
2671
2812
|
}
|
|
2672
2813
|
}
|
|
2814
|
+
getComponent(name) {
|
|
2815
|
+
return this._components.find((component => component.name === name));
|
|
2816
|
+
}
|
|
2673
2817
|
is3D() {
|
|
2674
2818
|
return true;
|
|
2675
2819
|
}
|
|
@@ -2715,9 +2859,6 @@ class Viewer extends EventEmitter2 {
|
|
|
2715
2859
|
executeCommand(id, ...args) {
|
|
2716
2860
|
return commands.executeCommand(id, this, ...args);
|
|
2717
2861
|
}
|
|
2718
|
-
getComponent(name) {
|
|
2719
|
-
return this._components.find((component => component.name === name));
|
|
2720
|
-
}
|
|
2721
2862
|
drawViewpoint(viewpoint) {
|
|
2722
2863
|
var _a, _b, _c;
|
|
2723
2864
|
if (!this.renderer) return;
|