@inweb/viewer-three 26.10.4 → 26.10.6
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/loaders/GLTFCloudLoader.js +3 -1
- package/dist/plugins/loaders/GLTFCloudLoader.js.map +1 -1
- package/dist/plugins/loaders/GLTFCloudLoader.min.js +1 -1
- package/dist/plugins/loaders/IFCXLoader.js.map +1 -1
- package/dist/plugins/loaders/IFCXLoader.module.js.map +1 -1
- package/dist/viewer-three.js +11557 -12148
- package/dist/viewer-three.js.map +1 -1
- package/dist/viewer-three.min.js +3 -3
- package/dist/viewer-three.module.js +17 -9
- package/dist/viewer-three.module.js.map +1 -1
- package/lib/Viewer/draggers/OrbitDragger.d.ts +3 -0
- package/package.json +9 -9
- package/plugins/loaders/IFCX/render.js +1 -1
- package/src/Viewer/components/HighlighterComponent.ts +5 -3
- package/src/Viewer/controls/OrbitControls.js +0 -1
- package/src/Viewer/draggers/MeasureLineDragger.ts +9 -6
- package/src/Viewer/draggers/OrbitDragger.ts +6 -0
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
// acknowledge and accept the above terms.
|
|
22
22
|
///////////////////////////////////////////////////////////////////////////////
|
|
23
23
|
|
|
24
|
-
import { draggersRegistry, commandsRegistry, componentsRegistry, Loader, loadersRegistry,
|
|
24
|
+
import { draggersRegistry, commandsRegistry, Options, componentsRegistry, Loader, loadersRegistry, CANVAS_EVENTS } from '@inweb/viewer-core';
|
|
25
25
|
export * from '@inweb/viewer-core';
|
|
26
26
|
import { Line, Vector3, BufferGeometry, Float32BufferAttribute, LineBasicMaterial, Mesh, MeshBasicMaterial, DoubleSide, EventDispatcher, MOUSE, TOUCH, Spherical, Quaternion, Vector2, Plane, Object3D, Line3, Matrix4, Vector4, MathUtils, Raycaster, EdgesGeometry, Controls, Clock, Sphere, Box3, Color, PerspectiveCamera, OrthographicCamera, AmbientLight, DirectionalLight, HemisphereLight, MeshPhongMaterial, WebGLRenderTarget, UnsignedByteType, RGBAFormat, CylinderGeometry, Sprite, CanvasTexture, SRGBColorSpace, SpriteMaterial, LoadingManager, LoaderUtils, TextureLoader, BufferAttribute, PointsMaterial, Points, TriangleStripDrawMode, TriangleFanDrawMode, LineSegments, LineLoop, Group, NormalBlending, UniformsUtils, ShaderMaterial, AdditiveBlending, HalfFloatType, Scene, WebGLRenderer, LinearSRGBColorSpace } from 'three';
|
|
27
27
|
import { TransformControls } from 'three/examples/jsm/controls/TransformControls.js';
|
|
@@ -752,6 +752,9 @@ class OrbitDragger {
|
|
|
752
752
|
this.orbit.object = this.viewer.camera;
|
|
753
753
|
this.orbit.update();
|
|
754
754
|
};
|
|
755
|
+
this.optionsChange = ({ data: options }) => {
|
|
756
|
+
this.orbit.zoomSpeed = Math.abs(this.orbit.zoomSpeed) * (options.reverseZoomWheel ? -1 : 1);
|
|
757
|
+
};
|
|
755
758
|
this.controlsStart = () => {
|
|
756
759
|
this.changed = false;
|
|
757
760
|
};
|
|
@@ -807,6 +810,7 @@ class OrbitDragger {
|
|
|
807
810
|
this.viewer.addEventListener("zoom", this.updateControls);
|
|
808
811
|
this.viewer.addEventListener("drawviewpoint", this.updateControls);
|
|
809
812
|
this.viewer.addEventListener("changecameramode", this.updateControlsCamera);
|
|
813
|
+
this.viewer.addEventListener("optionschange", this.optionsChange);
|
|
810
814
|
this.viewer.addEventListener("contextmenu", this.stopContextMenu);
|
|
811
815
|
this.updateControls();
|
|
812
816
|
}
|
|
@@ -817,6 +821,7 @@ class OrbitDragger {
|
|
|
817
821
|
this.viewer.removeEventListener("zoom", this.updateControls);
|
|
818
822
|
this.viewer.removeEventListener("drawviewpoint", this.updateControls);
|
|
819
823
|
this.viewer.removeEventListener("changecameramode", this.updateControlsCamera);
|
|
824
|
+
this.viewer.removeEventListener("optionschange", this.optionsChange);
|
|
820
825
|
this.viewer.removeEventListener("contextmenu", this.stopContextMenu);
|
|
821
826
|
this.orbit.removeEventListener("start", this.controlsStart);
|
|
822
827
|
this.orbit.removeEventListener("change", this.controlsChange);
|
|
@@ -1126,12 +1131,14 @@ class MeasureSnapper {
|
|
|
1126
1131
|
class MeasureOverlay {
|
|
1127
1132
|
constructor(camera, canvas) {
|
|
1128
1133
|
this.lines = [];
|
|
1129
|
-
this.resizeContainer = (
|
|
1130
|
-
const {
|
|
1131
|
-
if (!
|
|
1134
|
+
this.resizeContainer = () => {
|
|
1135
|
+
const { offsetLeft, offsetTop, offsetWidth, offsetHeight } = this.canvas;
|
|
1136
|
+
if (!offsetWidth || !offsetHeight)
|
|
1132
1137
|
return;
|
|
1133
|
-
this.container.style.
|
|
1134
|
-
this.container.style.
|
|
1138
|
+
this.container.style.left = `${offsetLeft}px`;
|
|
1139
|
+
this.container.style.top = `${offsetTop}px`;
|
|
1140
|
+
this.container.style.width = `${offsetWidth}px`;
|
|
1141
|
+
this.container.style.height = `${offsetHeight}px`;
|
|
1135
1142
|
};
|
|
1136
1143
|
this.camera = camera;
|
|
1137
1144
|
this.canvas = canvas;
|
|
@@ -1148,7 +1155,7 @@ class MeasureOverlay {
|
|
|
1148
1155
|
if (!this.canvas.parentElement)
|
|
1149
1156
|
return;
|
|
1150
1157
|
this.canvas.parentElement.appendChild(this.container);
|
|
1151
|
-
this.resizeObserver.observe(this.canvas
|
|
1158
|
+
this.resizeObserver.observe(this.canvas);
|
|
1152
1159
|
}
|
|
1153
1160
|
dispose() {
|
|
1154
1161
|
this.clear();
|
|
@@ -2701,8 +2708,9 @@ class HighlighterComponent {
|
|
|
2701
2708
|
});
|
|
2702
2709
|
}
|
|
2703
2710
|
syncHighlightColors() {
|
|
2704
|
-
const
|
|
2705
|
-
const {
|
|
2711
|
+
const options = this.viewer.options.enableCustomHighlight ? this.viewer.options : Options.defaults();
|
|
2712
|
+
const { facesColor, facesTransparancy, facesOverlap } = options;
|
|
2713
|
+
const { edgesColor, edgesVisibility, edgesOverlap } = options;
|
|
2706
2714
|
this.facesMaterial.color.setRGB(facesColor.r / 255, facesColor.g / 255, facesColor.b / 255);
|
|
2707
2715
|
this.facesMaterial.opacity = (255 - facesTransparancy) / 255;
|
|
2708
2716
|
this.facesMaterial.depthTest = !facesOverlap;
|