@xtctwins/tctwins-core 1.0.30 → 1.0.32
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/tctwins-core.es.js +41031 -29284
- package/dist/tctwins-core.min.es.js +5639 -36
- package/dist/web-ifc-api.js +74136 -0
- package/package.json +2 -2
- package/types/extras/PointerLens/PointerLens.d.ts +100 -98
- package/types/plugins/AngleMeasurementsPlugin/AngleMeasurementsMouseControl.d.ts +4 -4
- package/types/plugins/AngleMeasurementsPlugin/AngleMeasurementsTouchControl.d.ts +4 -4
- package/types/plugins/WebIFCLoaderPlugin/WebIFCLoaderPlugin.d.ts +217 -211
- package/types/plugins/XTCLoaderPlugin/XTCLoaderPlugin.d.ts +287 -0
- package/types/plugins/XTCLoaderPlugin/index.d.ts +1 -0
- package/types/plugins/index.d.ts +12 -12
- package/types/viewer/Plugin.d.ts +54 -54
- package/types/viewer/Viewer.d.ts +2 -0
- package/types/viewer/metadata/MetaModel.d.ts +63 -63
- package/types/viewer/scene/Entity.d.ts +392 -392
- package/types/viewer/scene/LineSet/LineSet.d.ts +55 -58
- package/types/viewer/scene/models/SceneModelEntity.d.ts +408 -409
- package/types/viewer/scene/scene/Scene.d.ts +893 -893
- package/types/plugins/XKTLoaderPlugin/XKTLoaderPlugin.d.ts +0 -281
- package/types/plugins/XKTLoaderPlugin/index.d.ts +0 -1
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xtctwins/tctwins-core",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.32",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Web Programming Toolkit for 3D/2D BIM and CAD",
|
|
6
6
|
"module": "./dist/tctwins-core.es.js",
|
|
7
7
|
"main": "./dist/tctwins-core.cjs.js",
|
|
8
8
|
"types": "./types/index.d.ts",
|
|
9
9
|
"scripts": {
|
|
10
|
-
"build": "rollup --config rollup.config.js &&
|
|
10
|
+
"build": "rollup --config rollup.config.js && webpack --config webpack.min.config.js",
|
|
11
11
|
"dev": "rollup --config rollup.dev.config.js; cp node_modules/web-ifc/web-ifc.wasm dist/.",
|
|
12
12
|
"test": "percy exec -- node ./snapshots.js",
|
|
13
13
|
"docs": "rm -Rf ./docs/*; ./node_modules/.bin/esdoc",
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import {Viewer} from "../../viewer";
|
|
1
|
+
import { Viewer } from "../../viewer";
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* A PointerLens shows a magnified view of a {@link Viewer}'s canvas, centered at the position of the
|
|
5
5
|
* mouse or touch pointer.
|
|
6
6
|
*
|
|
7
7
|
* @example
|
|
8
|
-
* import { Viewer,
|
|
8
|
+
* import { Viewer, XTCLoaderPlugin, AngleMeasurementsPlugin, AngleMeasurementsMouseControl, PointerLens } from "../../dist/xeokit-sdk.es.js";
|
|
9
9
|
*
|
|
10
10
|
* const viewer = new Viewer({
|
|
11
11
|
* canvasId: "myCanvas",
|
|
@@ -16,11 +16,11 @@ import {Viewer} from "../../viewer";
|
|
|
16
16
|
* viewer.camera.look = [4.40, 3.72, 8.89];
|
|
17
17
|
* viewer.camera.up = [-0.01, 0.99, 0.039];
|
|
18
18
|
*
|
|
19
|
-
* const
|
|
19
|
+
* const xtcLoader = new XTCLoaderPlugin(viewer);
|
|
20
20
|
*
|
|
21
|
-
* const sceneModel =
|
|
21
|
+
* const sceneModel = xtcLoader.load({
|
|
22
22
|
* id: "myModel",
|
|
23
|
-
* src: "../../assets/models/
|
|
23
|
+
* src: "../../assets/models/xtc/v10/glTF-Embedded/Duplex_A_20110505.glTFEmbedded.xtc",
|
|
24
24
|
* edges: true
|
|
25
25
|
* });
|
|
26
26
|
*
|
|
@@ -35,110 +35,112 @@ import {Viewer} from "../../viewer";
|
|
|
35
35
|
* angleMeasurementsMouseControl.activate();
|
|
36
36
|
*/
|
|
37
37
|
export class PointerLens {
|
|
38
|
+
/**
|
|
39
|
+
* Constructs a new PointerLens.
|
|
40
|
+
*
|
|
41
|
+
* @param {Viewer} viewer The Viewer instance.
|
|
42
|
+
* @param {Object} [cfg] PointerLens configuration.
|
|
43
|
+
* @param {boolean} [cfg.active=true] Whether PointerLens is active. The PointerLens can only be shown when this is `true` (default).
|
|
44
|
+
* @param {number} [cfg.zoomFactor=2] The zoom factor for the lens.
|
|
45
|
+
*/
|
|
46
|
+
constructor(
|
|
47
|
+
viewer: Viewer,
|
|
48
|
+
cfg?: {
|
|
49
|
+
active?: boolean;
|
|
50
|
+
zoomFactor?: number;
|
|
51
|
+
}
|
|
52
|
+
);
|
|
38
53
|
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
constructor(viewer: Viewer, cfg?: {
|
|
48
|
-
active?: boolean;
|
|
49
|
-
zoomFactor?: number;
|
|
50
|
-
});
|
|
54
|
+
/**
|
|
55
|
+
* Sets the zoom factor for the lens.
|
|
56
|
+
*
|
|
57
|
+
* This is `2` by default.
|
|
58
|
+
*
|
|
59
|
+
* @param {number} zoomFactor The zoom factor for the lens.
|
|
60
|
+
*/
|
|
61
|
+
set zoomFactor(zoomFactor: number);
|
|
51
62
|
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
63
|
+
/**
|
|
64
|
+
* Gets the zoom factor for the lens.
|
|
65
|
+
*
|
|
66
|
+
* This is `2` by default.
|
|
67
|
+
*
|
|
68
|
+
* @returns {number} The zoom factor for the lens.
|
|
69
|
+
*/
|
|
70
|
+
get zoomFactor(): number;
|
|
60
71
|
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
*/
|
|
68
|
-
get zoomFactor(): number;
|
|
72
|
+
/**
|
|
73
|
+
* Sets the canvas central position of the lens.
|
|
74
|
+
*
|
|
75
|
+
* @param {number[]} centerPos The canvas central position of the lens.
|
|
76
|
+
*/
|
|
77
|
+
set centerPos(centerPos: number[]);
|
|
69
78
|
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
79
|
+
/**
|
|
80
|
+
* Gets the canvas central position of the lens.
|
|
81
|
+
*
|
|
82
|
+
* @returns {number[]} The canvas central position of the lens.
|
|
83
|
+
*/
|
|
84
|
+
get centerPos(): number[];
|
|
76
85
|
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
86
|
+
/**
|
|
87
|
+
* Sets the canvas coordinates of the pointer.
|
|
88
|
+
*
|
|
89
|
+
* @param {number[]} cursorPos The canvas coordinates of the pointer.
|
|
90
|
+
*/
|
|
91
|
+
set cursorPos(cursorPos: number[]);
|
|
83
92
|
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
93
|
+
/**
|
|
94
|
+
* Gets the canvas coordinates of the pointer.
|
|
95
|
+
*
|
|
96
|
+
* @returns {number[]} The canvas coordinates of the pointer.
|
|
97
|
+
*/
|
|
98
|
+
get cursorPos(): number[];
|
|
90
99
|
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
100
|
+
/**
|
|
101
|
+
* Sets whether the cursor has snapped to anything.
|
|
102
|
+
*
|
|
103
|
+
* @param {boolean} snapped Whether the cursor has snapped to anything.
|
|
104
|
+
*/
|
|
105
|
+
set snapped(snapped: boolean);
|
|
97
106
|
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
107
|
+
/**
|
|
108
|
+
* Gets whether the cursor has snapped to anything.
|
|
109
|
+
*
|
|
110
|
+
* @returns {boolean} Whether the cursor has snapped to anything.
|
|
111
|
+
*/
|
|
112
|
+
get snapped(): boolean;
|
|
104
113
|
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
114
|
+
/**
|
|
115
|
+
* Sets if this PointerLens is active.
|
|
116
|
+
*
|
|
117
|
+
* @param {boolean} active Whether this PointerLens is active.
|
|
118
|
+
*/
|
|
119
|
+
set active(active: boolean);
|
|
111
120
|
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
121
|
+
/**
|
|
122
|
+
* Gets if this PointerLens is active.
|
|
123
|
+
*
|
|
124
|
+
* @returns {boolean} Whether this PointerLens is active.
|
|
125
|
+
*/
|
|
126
|
+
get active(): boolean;
|
|
118
127
|
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
128
|
+
/**
|
|
129
|
+
* Sets if this PointerLens is visible.
|
|
130
|
+
*
|
|
131
|
+
* @param {boolean} visible Whether this PointerLens is visible.
|
|
132
|
+
*/
|
|
133
|
+
set visible(visible: boolean);
|
|
125
134
|
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
135
|
+
/**
|
|
136
|
+
* Gets if this PointerLens is visible.
|
|
137
|
+
*
|
|
138
|
+
* @returns {boolean} Whether this PointerLens is visible.
|
|
139
|
+
*/
|
|
140
|
+
get visible(): boolean;
|
|
132
141
|
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
*/
|
|
138
|
-
get visible(): boolean;
|
|
139
|
-
|
|
140
|
-
/**
|
|
141
|
-
* Destroys this PointerLens.
|
|
142
|
-
*/
|
|
143
|
-
destroy(): void;
|
|
142
|
+
/**
|
|
143
|
+
* Destroys this PointerLens.
|
|
144
|
+
*/
|
|
145
|
+
destroy(): void;
|
|
144
146
|
}
|
|
@@ -7,7 +7,7 @@ import { PointerLens } from "../../extras/PointerLens/PointerLens";
|
|
|
7
7
|
* Creates {@link AngleMeasurement}s in an {@link AngleMeasurementsPlugin} from mouse input.
|
|
8
8
|
*
|
|
9
9
|
* @example
|
|
10
|
-
* import { Viewer,
|
|
10
|
+
* import { Viewer, XTCLoaderPlugin, AngleMeasurementsPlugin, AngleMeasurementsMouseControl, PointerLens } from "xeokit-sdk.es.js";
|
|
11
11
|
*
|
|
12
12
|
* const viewer = new Viewer({
|
|
13
13
|
* canvasId: "myCanvas",
|
|
@@ -17,11 +17,11 @@ import { PointerLens } from "../../extras/PointerLens/PointerLens";
|
|
|
17
17
|
* viewer.camera.look = [4.40, 3.72, 8.89];
|
|
18
18
|
* viewer.camera.up = [-0.01, 0.99, 0.039];
|
|
19
19
|
*
|
|
20
|
-
* const
|
|
20
|
+
* const xtcLoader = new XTCLoaderPlugin(viewer);
|
|
21
21
|
*
|
|
22
|
-
* const sceneModel =
|
|
22
|
+
* const sceneModel = xtcLoader.load({
|
|
23
23
|
* id: "myModel",
|
|
24
|
-
* src: "Duplex.
|
|
24
|
+
* src: "Duplex.xtc"
|
|
25
25
|
* });
|
|
26
26
|
*
|
|
27
27
|
* const angleMeasurements = new AngleMeasurementsPlugin(viewer);
|
|
@@ -6,7 +6,7 @@ import { PointerCircle } from "../../extras/PointerCircle/PointerCircle.js";
|
|
|
6
6
|
* Creates {@link AngleMeasurement}s in an {@link AngleMeasurementsPlugin} from mouse input.
|
|
7
7
|
*
|
|
8
8
|
* @example
|
|
9
|
-
* import { Viewer,
|
|
9
|
+
* import { Viewer, XTCLoaderPlugin, AngleMeasurementsPlugin, AngleMeasurementsMouseControl, PointerLens } from "xeokit-sdk.es.js";
|
|
10
10
|
*
|
|
11
11
|
* const viewer = new Viewer({
|
|
12
12
|
* canvasId: "myCanvas",
|
|
@@ -16,11 +16,11 @@ import { PointerCircle } from "../../extras/PointerCircle/PointerCircle.js";
|
|
|
16
16
|
* viewer.camera.look = [4.40, 3.72, 8.89];
|
|
17
17
|
* viewer.camera.up = [-0.01, 0.99, 0.039];
|
|
18
18
|
*
|
|
19
|
-
* const
|
|
19
|
+
* const xtcLoader = new XTCLoaderPlugin(viewer);
|
|
20
20
|
*
|
|
21
|
-
* const sceneModel =
|
|
21
|
+
* const sceneModel = xtcLoader.load({
|
|
22
22
|
* id: "myModel",
|
|
23
|
-
* src: "Duplex.
|
|
23
|
+
* src: "Duplex.xtc"
|
|
24
24
|
* });
|
|
25
25
|
*
|
|
26
26
|
* const angleMeasurements = new AngleMeasurementsPlugin(viewer);
|