@inweb/viewer-three 26.10.5 → 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/viewer-three.js +8 -2
- package/dist/viewer-three.js.map +1 -1
- package/dist/viewer-three.min.js +1 -1
- package/dist/viewer-three.module.js +9 -3
- package/dist/viewer-three.module.js.map +1 -1
- package/lib/Viewer/draggers/OrbitDragger.d.ts +3 -0
- package/package.json +5 -5
- package/src/Viewer/components/HighlighterComponent.ts +5 -3
- package/src/Viewer/draggers/OrbitDragger.ts +6 -0
|
@@ -10,6 +10,9 @@ export declare class OrbitDragger implements IDragger {
|
|
|
10
10
|
dispose(): void;
|
|
11
11
|
updateControls: () => void;
|
|
12
12
|
updateControlsCamera: () => void;
|
|
13
|
+
optionsChange: ({ data: options }: {
|
|
14
|
+
data: any;
|
|
15
|
+
}) => void;
|
|
13
16
|
controlsStart: () => void;
|
|
14
17
|
controlsChange: () => void;
|
|
15
18
|
stopContextMenu: (event: PointerEvent) => void;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@inweb/viewer-three",
|
|
3
|
-
"version": "26.10.
|
|
3
|
+
"version": "26.10.6",
|
|
4
4
|
"description": "JavaScript library for rendering CAD and BIM files in a browser using Three.js",
|
|
5
5
|
"homepage": "https://cloud.opendesign.com/docs/index.html",
|
|
6
6
|
"license": "SEE LICENSE IN LICENSE",
|
|
@@ -35,10 +35,10 @@
|
|
|
35
35
|
"docs": "typedoc"
|
|
36
36
|
},
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"@inweb/client": "~26.10.
|
|
39
|
-
"@inweb/eventemitter2": "~26.10.
|
|
40
|
-
"@inweb/markup": "~26.10.
|
|
41
|
-
"@inweb/viewer-core": "~26.10.
|
|
38
|
+
"@inweb/client": "~26.10.6",
|
|
39
|
+
"@inweb/eventemitter2": "~26.10.6",
|
|
40
|
+
"@inweb/markup": "~26.10.6",
|
|
41
|
+
"@inweb/viewer-core": "~26.10.6"
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|
|
44
44
|
"@types/three": "^0.180.0",
|
|
@@ -35,7 +35,7 @@ import { LineSegmentsGeometry } from "three/examples/jsm/lines/LineSegmentsGeome
|
|
|
35
35
|
import { Wireframe } from "three/examples/jsm/lines/Wireframe.js";
|
|
36
36
|
import { LineMaterial } from "three/examples/jsm/lines/LineMaterial.js";
|
|
37
37
|
|
|
38
|
-
import { IComponent, ResizeEvent } from "@inweb/viewer-core";
|
|
38
|
+
import { IComponent, Options, ResizeEvent } from "@inweb/viewer-core";
|
|
39
39
|
import { Viewer } from "../Viewer";
|
|
40
40
|
import { HighlighterUtils } from "./HighlighterUtils";
|
|
41
41
|
|
|
@@ -178,8 +178,10 @@ export class HighlighterComponent implements IComponent {
|
|
|
178
178
|
};
|
|
179
179
|
|
|
180
180
|
syncHighlightColors() {
|
|
181
|
-
const
|
|
182
|
-
|
|
181
|
+
const options = this.viewer.options.enableCustomHighlight ? this.viewer.options : Options.defaults();
|
|
182
|
+
|
|
183
|
+
const { facesColor, facesTransparancy, facesOverlap } = options;
|
|
184
|
+
const { edgesColor, edgesVisibility, edgesOverlap } = options;
|
|
183
185
|
|
|
184
186
|
this.facesMaterial.color.setRGB(facesColor.r / 255, facesColor.g / 255, facesColor.b / 255);
|
|
185
187
|
this.facesMaterial.opacity = (255 - facesTransparancy) / 255;
|
|
@@ -47,6 +47,7 @@ export class OrbitDragger implements IDragger {
|
|
|
47
47
|
this.viewer.addEventListener("zoom", this.updateControls);
|
|
48
48
|
this.viewer.addEventListener("drawviewpoint", this.updateControls);
|
|
49
49
|
this.viewer.addEventListener("changecameramode", this.updateControlsCamera);
|
|
50
|
+
this.viewer.addEventListener("optionschange", this.optionsChange);
|
|
50
51
|
this.viewer.addEventListener("contextmenu", this.stopContextMenu);
|
|
51
52
|
this.updateControls();
|
|
52
53
|
}
|
|
@@ -59,6 +60,7 @@ export class OrbitDragger implements IDragger {
|
|
|
59
60
|
this.viewer.removeEventListener("zoom", this.updateControls);
|
|
60
61
|
this.viewer.removeEventListener("drawviewpoint", this.updateControls);
|
|
61
62
|
this.viewer.removeEventListener("changecameramode", this.updateControlsCamera);
|
|
63
|
+
this.viewer.removeEventListener("optionschange", this.optionsChange);
|
|
62
64
|
this.viewer.removeEventListener("contextmenu", this.stopContextMenu);
|
|
63
65
|
|
|
64
66
|
this.orbit.removeEventListener("start", this.controlsStart);
|
|
@@ -78,6 +80,10 @@ export class OrbitDragger implements IDragger {
|
|
|
78
80
|
this.orbit.update();
|
|
79
81
|
};
|
|
80
82
|
|
|
83
|
+
optionsChange = ({ data: options }) => {
|
|
84
|
+
this.orbit.zoomSpeed = Math.abs(this.orbit.zoomSpeed) * (options.reverseZoomWheel ? -1 : 1);
|
|
85
|
+
};
|
|
86
|
+
|
|
81
87
|
controlsStart = () => {
|
|
82
88
|
this.changed = false;
|
|
83
89
|
};
|