@xtctwins/tctwins-core 1.0.27 → 1.0.29
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/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xtctwins/tctwins-core",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.29",
|
|
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 && rollup --config rollup.minified.config.js
|
|
10
|
+
"build": "rollup --config rollup.config.js && rollup --config rollup.minified.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",
|
|
@@ -61,6 +61,7 @@
|
|
|
61
61
|
"eslint": "^8.13.0",
|
|
62
62
|
"parse5": "^7.0.0",
|
|
63
63
|
"rollup": "^2.70.2",
|
|
64
|
+
"rollup-plugin-livereload": "^2.0.5",
|
|
64
65
|
"rollup-plugin-terser": "^7.0.2",
|
|
65
66
|
"typedoc": "^0.22.15"
|
|
66
67
|
},
|
|
@@ -2,102 +2,132 @@ import { Plugin, Viewer } from "../../viewer";
|
|
|
2
2
|
import { SectionPlane } from "../../viewer/scene/sectionPlane";
|
|
3
3
|
|
|
4
4
|
export declare type SectionPlanesPluginConfiguration = {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
5
|
+
/** Optional ID for this plugin, so that we can find it within {@link Viewer.plugins}. */
|
|
6
|
+
id?: string;
|
|
7
|
+
/** ID of a canvas element to display the overview. */
|
|
8
|
+
overviewCanvasId?: string;
|
|
9
|
+
/** Initial visibility of the overview canvas. */
|
|
10
|
+
overviewVisible?: boolean;
|
|
11
11
|
};
|
|
12
12
|
|
|
13
13
|
/**
|
|
14
14
|
* SectionPlanesPlugin is a {@link Viewer} plugin that manages {@link SectionPlane}s.
|
|
15
15
|
*/
|
|
16
16
|
export declare class SectionPlanesPlugin extends Plugin {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
17
|
+
/**
|
|
18
|
+
* @constructor
|
|
19
|
+
* @param {Viewer} viewer The Viewer.
|
|
20
|
+
* @param {SectionPlanesPluginConfiguration} cfg Plugin configuration.
|
|
21
|
+
*/
|
|
22
|
+
constructor(viewer: Viewer, cfg?: SectionPlanesPluginConfiguration);
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Sets if the overview canvas is visible.
|
|
26
|
+
*
|
|
27
|
+
* @param {Boolean} visible Whether or not the overview canvas is visible.
|
|
28
|
+
*/
|
|
29
|
+
setOverviewVisible(visible: boolean): void;
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Gets if the overview canvas is visible.
|
|
33
|
+
*
|
|
34
|
+
* @return {Boolean} True when the overview canvas is visible.
|
|
35
|
+
*/
|
|
36
|
+
getOverviewVisible(): boolean;
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Returns a map of the {@link SectionPlane}s created by this SectionPlanesPlugin.
|
|
40
|
+
*
|
|
41
|
+
* @returns {{String:SectionPlane}} A map containing the {@link SectionPlane}s, each mapped to its {@link SectionPlane.id}.
|
|
42
|
+
*/
|
|
43
|
+
get sectionPlanes(): { [key: string]: SectionPlane };
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* 设置是否是触屏模式
|
|
47
|
+
* @param {boolean} touch
|
|
48
|
+
*/
|
|
49
|
+
set isTouch(touch: boolean);
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* 设置剖切方式
|
|
53
|
+
* @param {string} way
|
|
54
|
+
*/
|
|
55
|
+
set sectionWay(way: string);
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* 设置剖切面方向
|
|
59
|
+
* @param {number} direction
|
|
60
|
+
*/
|
|
61
|
+
set sectionDirection(direction: number);
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* 设置剖切对象样式
|
|
65
|
+
* @param {any} cfg
|
|
66
|
+
* @param {number} cfg.planeSize?
|
|
67
|
+
* @param {number} cfg.controlSize?
|
|
68
|
+
* @param {number} cfg.planeOpacity?
|
|
69
|
+
* @param {number[]} cfg.controlFillColor?
|
|
70
|
+
* @param {number[]} cfg.controlEdgeColor?
|
|
71
|
+
*/
|
|
72
|
+
set sectionConfigs(cfg: any);
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* 设置剖切面位置
|
|
76
|
+
* @param pos
|
|
77
|
+
*/
|
|
78
|
+
setControlPos(posRate: number): void;
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* Creates a {@link SectionPlane}.
|
|
82
|
+
*
|
|
83
|
+
* The {@link SectionPlane} will be registered by {@link SectionPlane.id} in {@link SectionPlanesPlugin.sectionPlanes}.
|
|
84
|
+
*
|
|
85
|
+
* @param {Object} params {@link SectionPlane} configuration.
|
|
86
|
+
* @param {String} [params.id] Unique ID to assign to the {@link SectionPlane}. Must be unique among all components in the {@link Viewer}'s {@link Scene}. Auto-generated when omitted.
|
|
87
|
+
* @param {Number[]} [params.pos=[0,0,0]] World-space position of the {@link SectionPlane}.
|
|
88
|
+
* @param {Number[]} [params.dir=[0,0,-1]] World-space vector indicating the orientation of the {@link SectionPlane}.
|
|
89
|
+
* @param {Boolean} [params.active=true] Whether the {@link SectionPlane} is initially active. Only clips while this is true.
|
|
90
|
+
* @returns {SectionPlane} The new {@link SectionPlane}.
|
|
91
|
+
*/
|
|
92
|
+
createSectionPlane(params?: { id?: string; pos?: number[]; dir?: number[]; active?: boolean }): SectionPlane;
|
|
93
|
+
|
|
94
|
+
/**
|
|
95
|
+
* Inverts the direction of {@link SectionPlane.dir} on every existing SectionPlane.
|
|
96
|
+
*
|
|
97
|
+
* Inverts all SectionPlanes, including those that were not created with SectionPlanesPlugin.
|
|
98
|
+
*/
|
|
99
|
+
flipSectionPlanes(): void;
|
|
100
|
+
|
|
101
|
+
/**
|
|
102
|
+
* Shows the 3D editing gizmo for a {@link SectionPlane}.
|
|
103
|
+
*
|
|
104
|
+
* @param {String} id ID of the {@link SectionPlane}.
|
|
105
|
+
*/
|
|
106
|
+
showControl(id: string): void;
|
|
107
|
+
|
|
108
|
+
/**
|
|
109
|
+
* Gets the ID of the {@link SectionPlane} that the 3D editing gizmo is shown for.
|
|
110
|
+
*
|
|
111
|
+
* Returns ````null```` when the editing gizmo is not shown.
|
|
112
|
+
*
|
|
113
|
+
* @returns {String} ID of the the {@link SectionPlane} that the 3D editing gizmo is shown for, if shown, else ````null````.
|
|
114
|
+
*/
|
|
115
|
+
getShownControl(): string;
|
|
116
|
+
|
|
117
|
+
/**
|
|
118
|
+
* Hides the 3D {@link SectionPlane} editing gizmo if shown.
|
|
119
|
+
*/
|
|
120
|
+
hideControl(): void;
|
|
121
|
+
|
|
122
|
+
/**
|
|
123
|
+
* Destroys a {@link SectionPlane} created by this SectionPlanesPlugin.
|
|
124
|
+
*
|
|
125
|
+
* @param {String} id ID of the {@link SectionPlane}.
|
|
126
|
+
*/
|
|
127
|
+
destroySectionPlane(id: string): void;
|
|
128
|
+
|
|
129
|
+
/**
|
|
130
|
+
* Destroys all {@link SectionPlane}s created by this SectionPlanesPlugin.
|
|
131
|
+
*/
|
|
132
|
+
clear(): void;
|
|
103
133
|
}
|
|
@@ -109,6 +109,34 @@ export declare class Scene extends Component {
|
|
|
109
109
|
*/
|
|
110
110
|
get dtxEnabled(): boolean;
|
|
111
111
|
|
|
112
|
+
/**
|
|
113
|
+
* Sets whether physically-based rendering is enabled.
|
|
114
|
+
* Default is ````false````.
|
|
115
|
+
* @param {boolean} pbrEnabled
|
|
116
|
+
*/
|
|
117
|
+
set pbrEnabled(pbrEnabled: boolean);
|
|
118
|
+
|
|
119
|
+
/**
|
|
120
|
+
* Gets whether physically-based rendering is enabled.
|
|
121
|
+
* Default is ````false````.
|
|
122
|
+
* @returns {Boolean} True if quality rendering is enabled.
|
|
123
|
+
*/
|
|
124
|
+
get pbrEnabled(): boolean;
|
|
125
|
+
|
|
126
|
+
/**+
|
|
127
|
+
* Sets whether environment light rendering is enabled.
|
|
128
|
+
* Default is ````false````.
|
|
129
|
+
* @param {boolean} saoEnabled
|
|
130
|
+
*/
|
|
131
|
+
set saoEnabled(saoEnabled: boolean);
|
|
132
|
+
|
|
133
|
+
/**
|
|
134
|
+
* Gets whether environment light rendering is enabled.
|
|
135
|
+
* Default is ````false````.
|
|
136
|
+
* @returns {boolean}
|
|
137
|
+
*/
|
|
138
|
+
get saoEnabled(): boolean;
|
|
139
|
+
|
|
112
140
|
/**
|
|
113
141
|
* set showedges enable
|
|
114
142
|
* @param {boolean} edgesEnabled
|
|
@@ -120,6 +148,24 @@ export declare class Scene extends Component {
|
|
|
120
148
|
*/
|
|
121
149
|
get edgesEnabled(): boolean;
|
|
122
150
|
|
|
151
|
+
/**
|
|
152
|
+
* Sets whether basic color texture rendering is enabled.
|
|
153
|
+
*
|
|
154
|
+
* Default is ````true````.
|
|
155
|
+
*
|
|
156
|
+
* @param {Boolean} colorTextureEnabled
|
|
157
|
+
*/
|
|
158
|
+
set colorTextureEnabled(colorTextureEnabled: boolean);
|
|
159
|
+
|
|
160
|
+
/**
|
|
161
|
+
* Gets whether basic color texture rendering is enabled.
|
|
162
|
+
*
|
|
163
|
+
* Default is ````true````.
|
|
164
|
+
*
|
|
165
|
+
* @returns {Boolean} True if basic color texture rendering is enabled.
|
|
166
|
+
*/
|
|
167
|
+
get colorTextureEnabled(): boolean;
|
|
168
|
+
|
|
123
169
|
/**
|
|
124
170
|
* set whether transparent of canvas background
|
|
125
171
|
* @param {boolean} trans
|
|
@@ -267,21 +313,6 @@ export declare class Scene extends Component {
|
|
|
267
313
|
*/
|
|
268
314
|
get logarithmicDepthBufferEnabled(): boolean;
|
|
269
315
|
|
|
270
|
-
/**
|
|
271
|
-
* Sets whether physically-based rendering is enabled.
|
|
272
|
-
*
|
|
273
|
-
*/
|
|
274
|
-
set pbrEnabled(value: boolean);
|
|
275
|
-
|
|
276
|
-
/**
|
|
277
|
-
* Gets whether quality rendering is enabled.
|
|
278
|
-
*
|
|
279
|
-
* Default is ````false````.
|
|
280
|
-
*
|
|
281
|
-
* @returns {Boolean} True if quality rendering is enabled.
|
|
282
|
-
*/
|
|
283
|
-
get pbrEnabled(): boolean;
|
|
284
|
-
|
|
285
316
|
/**
|
|
286
317
|
* Gets the IDs of the {@link Entity}s in {@link Scene.models}.
|
|
287
318
|
*
|