@inweb/viewer-three 27.12.4 → 27.12.5
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.map +1 -1
- package/dist/viewer-three.module.js.map +1 -1
- package/lib/Viewer/loaders/DynamicGltfLoader/DynamicModelImpl.d.ts +1 -1
- package/lib/Viewer/models/Highlighter.types.d.ts +57 -1
- package/lib/Viewer/models/ModelImpl.d.ts +2 -2
- package/lib/Viewer/models/ModelImpl.types.d.ts +2 -58
- package/lib/index.d.ts +1 -0
- package/package.json +5 -5
- package/src/Viewer/loaders/DynamicGltfLoader/DynamicModelImpl.ts +1 -1
- package/src/Viewer/models/Highlighter.types.ts +67 -1
- package/src/Viewer/models/ModelImpl.ts +2 -2
- package/src/Viewer/models/ModelImpl.types.ts +2 -68
- package/src/index.ts +1 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Box3, Object3D } from "three";
|
|
2
2
|
import { IInfo } from "@inweb/viewer-core";
|
|
3
3
|
import { ModelImpl } from "../../models/ModelImpl";
|
|
4
|
-
import { IHighlightStyle } from "../../models/
|
|
4
|
+
import { IHighlightStyle } from "../../models/Highlighter.types";
|
|
5
5
|
import { DynamicGltfLoader } from "./DynamicGltfLoader.js";
|
|
6
6
|
export declare class DynamicModelImpl extends ModelImpl {
|
|
7
7
|
gltfLoader: DynamicGltfLoader;
|
|
@@ -1,5 +1,61 @@
|
|
|
1
|
-
import { Object3D } from "three";
|
|
1
|
+
import { ColorRepresentation, Object3D } from "three";
|
|
2
2
|
export interface IHighlighter {
|
|
3
3
|
highlightObjects(objects: Object3D[]): void;
|
|
4
4
|
unhighlightObjects(objects: Object3D[]): void;
|
|
5
5
|
}
|
|
6
|
+
/**
|
|
7
|
+
* Highlight style of a model, see {@link IModelImpl.setHighlightStyle}. Unset settings take their default
|
|
8
|
+
* values.
|
|
9
|
+
*
|
|
10
|
+
* The style applies to the faces, lines and points of the highlighted objects (fill settings) and to
|
|
11
|
+
* their edges, the model edges drawn with the `edgeModel` option (line settings).
|
|
12
|
+
*/
|
|
13
|
+
export interface IHighlightStyle {
|
|
14
|
+
/**
|
|
15
|
+
* Fill color. Default is `0x4aa9fa`.
|
|
16
|
+
*/
|
|
17
|
+
fillColor?: ColorRepresentation;
|
|
18
|
+
/**
|
|
19
|
+
* Blend of the object color with the fill color, from `0` (object color) to `1` (fill color). Default
|
|
20
|
+
* is `1`.
|
|
21
|
+
*/
|
|
22
|
+
fillMix?: number;
|
|
23
|
+
/**
|
|
24
|
+
* Opacity of the highlighted objects, from `0` to `1`, or `-1` to keep the opacity of their materials.
|
|
25
|
+
* Default is `-1`.
|
|
26
|
+
*/
|
|
27
|
+
fillOpacity?: number;
|
|
28
|
+
/**
|
|
29
|
+
* Edge color. Default is the fill color.
|
|
30
|
+
*/
|
|
31
|
+
lineColor?: ColorRepresentation;
|
|
32
|
+
/**
|
|
33
|
+
* Blend of the edge color with the line color, from `0` (edge color) to `1` (line color). Default is
|
|
34
|
+
* `1`.
|
|
35
|
+
*/
|
|
36
|
+
lineMix?: number;
|
|
37
|
+
/**
|
|
38
|
+
* Intensity of the fill color added on top of the lighting, a glow. Default is `0`.
|
|
39
|
+
*/
|
|
40
|
+
emissiveIntensity?: number;
|
|
41
|
+
/**
|
|
42
|
+
* Sets both {@link facesOverlay} and {@link edgesOverlay}.
|
|
43
|
+
*/
|
|
44
|
+
overlay?: boolean;
|
|
45
|
+
/**
|
|
46
|
+
* Draws the faces, lines and points of the highlighted objects once more, in the fill color with the
|
|
47
|
+
* {@link overlayOpacity}, over all other geometry. The objects themselves then keep their colors.
|
|
48
|
+
* Default is `true`.
|
|
49
|
+
*/
|
|
50
|
+
facesOverlay?: boolean;
|
|
51
|
+
/**
|
|
52
|
+
* Draws the edges of the highlighted objects once more, in the line color with the
|
|
53
|
+
* {@link overlayOpacity}, over all other geometry. The edges themselves then keep their colors. Default
|
|
54
|
+
* is `true`.
|
|
55
|
+
*/
|
|
56
|
+
edgesOverlay?: boolean;
|
|
57
|
+
/**
|
|
58
|
+
* Opacity of the geometry drawn over all other geometry, from `0` to `1`. Default is `1`.
|
|
59
|
+
*/
|
|
60
|
+
overlayOpacity?: number;
|
|
61
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Box3, Object3D } from "three";
|
|
2
2
|
import { IInfo } from "@inweb/viewer-core";
|
|
3
|
-
import {
|
|
4
|
-
import { IHighlighter } from "./Highlighter.types";
|
|
3
|
+
import { IModelImpl } from "./ModelImpl.types";
|
|
4
|
+
import { IHighlighter, IHighlightStyle } from "./Highlighter.types";
|
|
5
5
|
export declare class ModelImpl implements IModelImpl {
|
|
6
6
|
id: string;
|
|
7
7
|
scene: Object3D;
|
|
@@ -1,62 +1,6 @@
|
|
|
1
|
-
import { Box3,
|
|
1
|
+
import { Box3, Object3D } from "three";
|
|
2
2
|
import { IInfo, IModel } from "@inweb/viewer-core";
|
|
3
|
-
import { IHighlighter } from "./Highlighter.types";
|
|
4
|
-
/**
|
|
5
|
-
* Highlight style of a model, see {@link IModelImpl.setHighlightStyle}. Unset settings take their default
|
|
6
|
-
* values.
|
|
7
|
-
*
|
|
8
|
-
* The style applies to the faces, lines and points of the highlighted objects (fill settings) and to
|
|
9
|
-
* their edges, the model edges drawn with the `edgeModel` option (line settings).
|
|
10
|
-
*/
|
|
11
|
-
export interface IHighlightStyle {
|
|
12
|
-
/**
|
|
13
|
-
* Fill color. Default is `0x4aa9fa`.
|
|
14
|
-
*/
|
|
15
|
-
fillColor?: ColorRepresentation;
|
|
16
|
-
/**
|
|
17
|
-
* Blend of the object color with the fill color, from `0` (object color) to `1` (fill color). Default
|
|
18
|
-
* is `1`.
|
|
19
|
-
*/
|
|
20
|
-
fillMix?: number;
|
|
21
|
-
/**
|
|
22
|
-
* Opacity of the highlighted objects, from `0` to `1`, or `-1` to keep the opacity of their materials.
|
|
23
|
-
* Default is `-1`.
|
|
24
|
-
*/
|
|
25
|
-
fillOpacity?: number;
|
|
26
|
-
/**
|
|
27
|
-
* Edge color. Default is the fill color.
|
|
28
|
-
*/
|
|
29
|
-
lineColor?: ColorRepresentation;
|
|
30
|
-
/**
|
|
31
|
-
* Blend of the edge color with the line color, from `0` (edge color) to `1` (line color). Default is
|
|
32
|
-
* `1`.
|
|
33
|
-
*/
|
|
34
|
-
lineMix?: number;
|
|
35
|
-
/**
|
|
36
|
-
* Intensity of the fill color added on top of the lighting, a glow. Default is `0`.
|
|
37
|
-
*/
|
|
38
|
-
emissiveIntensity?: number;
|
|
39
|
-
/**
|
|
40
|
-
* Sets both {@link facesOverlay} and {@link edgesOverlay}.
|
|
41
|
-
*/
|
|
42
|
-
overlay?: boolean;
|
|
43
|
-
/**
|
|
44
|
-
* Draws the faces, lines and points of the highlighted objects once more, in the fill color with the
|
|
45
|
-
* {@link overlayOpacity}, over all other geometry. The objects themselves then keep their colors.
|
|
46
|
-
* Default is `true`.
|
|
47
|
-
*/
|
|
48
|
-
facesOverlay?: boolean;
|
|
49
|
-
/**
|
|
50
|
-
* Draws the edges of the highlighted objects once more, in the line color with the
|
|
51
|
-
* {@link overlayOpacity}, over all other geometry. The edges themselves then keep their colors. Default
|
|
52
|
-
* is `true`.
|
|
53
|
-
*/
|
|
54
|
-
edgesOverlay?: boolean;
|
|
55
|
-
/**
|
|
56
|
-
* Opacity of the geometry drawn over all other geometry, from `0` to `1`. Default is `1`.
|
|
57
|
-
*/
|
|
58
|
-
overlayOpacity?: number;
|
|
59
|
-
}
|
|
3
|
+
import { IHighlighter, IHighlightStyle } from "./Highlighter.types";
|
|
60
4
|
/**
|
|
61
5
|
* Basic model implementation.
|
|
62
6
|
*/
|
package/lib/index.d.ts
CHANGED
|
@@ -4,6 +4,7 @@ export * from "./Viewer/components";
|
|
|
4
4
|
export * from "./Viewer/loaders";
|
|
5
5
|
export * from "./Viewer/loaders/GLTFLoadingManager";
|
|
6
6
|
export * from "./Viewer/models/ModelImpl.types";
|
|
7
|
+
export type { IHighlightStyle } from "./Viewer/models/Highlighter.types";
|
|
7
8
|
export * from "./Viewer/models/ModelImpl";
|
|
8
9
|
export * from "./Viewer/Viewer";
|
|
9
10
|
export * from "@inweb/viewer-core";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@inweb/viewer-three",
|
|
3
|
-
"version": "27.12.
|
|
3
|
+
"version": "27.12.5",
|
|
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": "~27.12.
|
|
39
|
-
"@inweb/eventemitter2": "~27.12.
|
|
40
|
-
"@inweb/markup": "~27.12.
|
|
41
|
-
"@inweb/viewer-core": "~27.12.
|
|
38
|
+
"@inweb/client": "~27.12.5",
|
|
39
|
+
"@inweb/eventemitter2": "~27.12.5",
|
|
40
|
+
"@inweb/markup": "~27.12.5",
|
|
41
|
+
"@inweb/viewer-core": "~27.12.5"
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|
|
44
44
|
"@streamparser/json": "^0.0.22",
|
|
@@ -25,7 +25,7 @@ import { Box3, Matrix4, Object3D, Vector3 } from "three";
|
|
|
25
25
|
import { IInfo, Info } from "@inweb/viewer-core";
|
|
26
26
|
|
|
27
27
|
import { ModelImpl } from "../../models/ModelImpl";
|
|
28
|
-
import { IHighlightStyle } from "../../models/
|
|
28
|
+
import { IHighlightStyle } from "../../models/Highlighter.types";
|
|
29
29
|
import { DynamicGltfLoader } from "./DynamicGltfLoader.js";
|
|
30
30
|
|
|
31
31
|
// Dynamic model implementation.
|
|
@@ -21,10 +21,76 @@
|
|
|
21
21
|
// acknowledge and accept the above terms.
|
|
22
22
|
///////////////////////////////////////////////////////////////////////////////
|
|
23
23
|
|
|
24
|
-
import { Object3D } from "three";
|
|
24
|
+
import { ColorRepresentation, Object3D } from "three";
|
|
25
25
|
|
|
26
26
|
export interface IHighlighter {
|
|
27
27
|
highlightObjects(objects: Object3D[]): void;
|
|
28
28
|
|
|
29
29
|
unhighlightObjects(objects: Object3D[]): void;
|
|
30
30
|
}
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Highlight style of a model, see {@link IModelImpl.setHighlightStyle}. Unset settings take their default
|
|
34
|
+
* values.
|
|
35
|
+
*
|
|
36
|
+
* The style applies to the faces, lines and points of the highlighted objects (fill settings) and to
|
|
37
|
+
* their edges, the model edges drawn with the `edgeModel` option (line settings).
|
|
38
|
+
*/
|
|
39
|
+
export interface IHighlightStyle {
|
|
40
|
+
/**
|
|
41
|
+
* Fill color. Default is `0x4aa9fa`.
|
|
42
|
+
*/
|
|
43
|
+
fillColor?: ColorRepresentation;
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* Blend of the object color with the fill color, from `0` (object color) to `1` (fill color). Default
|
|
47
|
+
* is `1`.
|
|
48
|
+
*/
|
|
49
|
+
fillMix?: number;
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* Opacity of the highlighted objects, from `0` to `1`, or `-1` to keep the opacity of their materials.
|
|
53
|
+
* Default is `-1`.
|
|
54
|
+
*/
|
|
55
|
+
fillOpacity?: number;
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* Edge color. Default is the fill color.
|
|
59
|
+
*/
|
|
60
|
+
lineColor?: ColorRepresentation;
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* Blend of the edge color with the line color, from `0` (edge color) to `1` (line color). Default is
|
|
64
|
+
* `1`.
|
|
65
|
+
*/
|
|
66
|
+
lineMix?: number;
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* Intensity of the fill color added on top of the lighting, a glow. Default is `0`.
|
|
70
|
+
*/
|
|
71
|
+
emissiveIntensity?: number;
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* Sets both {@link facesOverlay} and {@link edgesOverlay}.
|
|
75
|
+
*/
|
|
76
|
+
overlay?: boolean;
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* Draws the faces, lines and points of the highlighted objects once more, in the fill color with the
|
|
80
|
+
* {@link overlayOpacity}, over all other geometry. The objects themselves then keep their colors.
|
|
81
|
+
* Default is `true`.
|
|
82
|
+
*/
|
|
83
|
+
facesOverlay?: boolean;
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* Draws the edges of the highlighted objects once more, in the line color with the
|
|
87
|
+
* {@link overlayOpacity}, over all other geometry. The edges themselves then keep their colors. Default
|
|
88
|
+
* is `true`.
|
|
89
|
+
*/
|
|
90
|
+
edgesOverlay?: boolean;
|
|
91
|
+
|
|
92
|
+
/**
|
|
93
|
+
* Opacity of the geometry drawn over all other geometry, from `0` to `1`. Default is `1`.
|
|
94
|
+
*/
|
|
95
|
+
overlayOpacity?: number;
|
|
96
|
+
}
|
|
@@ -24,8 +24,8 @@
|
|
|
24
24
|
import { Box3, Object3D, Vector3 } from "three";
|
|
25
25
|
import { IInfo, Info } from "@inweb/viewer-core";
|
|
26
26
|
|
|
27
|
-
import {
|
|
28
|
-
import { IHighlighter } from "./Highlighter.types";
|
|
27
|
+
import { IModelImpl } from "./ModelImpl.types";
|
|
28
|
+
import { IHighlighter, IHighlightStyle } from "./Highlighter.types";
|
|
29
29
|
import { convertUnits } from "../measurement/UnitConverter";
|
|
30
30
|
import { getDisplayUnit } from "../measurement/UnitFormatter";
|
|
31
31
|
|
|
@@ -21,76 +21,10 @@
|
|
|
21
21
|
// acknowledge and accept the above terms.
|
|
22
22
|
///////////////////////////////////////////////////////////////////////////////
|
|
23
23
|
|
|
24
|
-
import { Box3,
|
|
24
|
+
import { Box3, Object3D } from "three";
|
|
25
25
|
import { IInfo, IModel } from "@inweb/viewer-core";
|
|
26
26
|
|
|
27
|
-
import { IHighlighter } from "./Highlighter.types";
|
|
28
|
-
|
|
29
|
-
/**
|
|
30
|
-
* Highlight style of a model, see {@link IModelImpl.setHighlightStyle}. Unset settings take their default
|
|
31
|
-
* values.
|
|
32
|
-
*
|
|
33
|
-
* The style applies to the faces, lines and points of the highlighted objects (fill settings) and to
|
|
34
|
-
* their edges, the model edges drawn with the `edgeModel` option (line settings).
|
|
35
|
-
*/
|
|
36
|
-
export interface IHighlightStyle {
|
|
37
|
-
/**
|
|
38
|
-
* Fill color. Default is `0x4aa9fa`.
|
|
39
|
-
*/
|
|
40
|
-
fillColor?: ColorRepresentation;
|
|
41
|
-
|
|
42
|
-
/**
|
|
43
|
-
* Blend of the object color with the fill color, from `0` (object color) to `1` (fill color). Default
|
|
44
|
-
* is `1`.
|
|
45
|
-
*/
|
|
46
|
-
fillMix?: number;
|
|
47
|
-
|
|
48
|
-
/**
|
|
49
|
-
* Opacity of the highlighted objects, from `0` to `1`, or `-1` to keep the opacity of their materials.
|
|
50
|
-
* Default is `-1`.
|
|
51
|
-
*/
|
|
52
|
-
fillOpacity?: number;
|
|
53
|
-
|
|
54
|
-
/**
|
|
55
|
-
* Edge color. Default is the fill color.
|
|
56
|
-
*/
|
|
57
|
-
lineColor?: ColorRepresentation;
|
|
58
|
-
|
|
59
|
-
/**
|
|
60
|
-
* Blend of the edge color with the line color, from `0` (edge color) to `1` (line color). Default is
|
|
61
|
-
* `1`.
|
|
62
|
-
*/
|
|
63
|
-
lineMix?: number;
|
|
64
|
-
|
|
65
|
-
/**
|
|
66
|
-
* Intensity of the fill color added on top of the lighting, a glow. Default is `0`.
|
|
67
|
-
*/
|
|
68
|
-
emissiveIntensity?: number;
|
|
69
|
-
|
|
70
|
-
/**
|
|
71
|
-
* Sets both {@link facesOverlay} and {@link edgesOverlay}.
|
|
72
|
-
*/
|
|
73
|
-
overlay?: boolean;
|
|
74
|
-
|
|
75
|
-
/**
|
|
76
|
-
* Draws the faces, lines and points of the highlighted objects once more, in the fill color with the
|
|
77
|
-
* {@link overlayOpacity}, over all other geometry. The objects themselves then keep their colors.
|
|
78
|
-
* Default is `true`.
|
|
79
|
-
*/
|
|
80
|
-
facesOverlay?: boolean;
|
|
81
|
-
|
|
82
|
-
/**
|
|
83
|
-
* Draws the edges of the highlighted objects once more, in the line color with the
|
|
84
|
-
* {@link overlayOpacity}, over all other geometry. The edges themselves then keep their colors. Default
|
|
85
|
-
* is `true`.
|
|
86
|
-
*/
|
|
87
|
-
edgesOverlay?: boolean;
|
|
88
|
-
|
|
89
|
-
/**
|
|
90
|
-
* Opacity of the geometry drawn over all other geometry, from `0` to `1`. Default is `1`.
|
|
91
|
-
*/
|
|
92
|
-
overlayOpacity?: number;
|
|
93
|
-
}
|
|
27
|
+
import { IHighlighter, IHighlightStyle } from "./Highlighter.types";
|
|
94
28
|
|
|
95
29
|
/**
|
|
96
30
|
* Basic model implementation.
|
package/src/index.ts
CHANGED
|
@@ -27,6 +27,7 @@ export * from "./Viewer/components";
|
|
|
27
27
|
export * from "./Viewer/loaders";
|
|
28
28
|
export * from "./Viewer/loaders/GLTFLoadingManager";
|
|
29
29
|
export * from "./Viewer/models/ModelImpl.types";
|
|
30
|
+
export type { IHighlightStyle } from "./Viewer/models/Highlighter.types";
|
|
30
31
|
export * from "./Viewer/models/ModelImpl";
|
|
31
32
|
export * from "./Viewer/Viewer";
|
|
32
33
|
|