@xtctwins/tctwins-core 1.0.6 → 1.0.8

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,6 +1,6 @@
1
1
  {
2
2
  "name": "@xtctwins/tctwins-core",
3
- "version": "1.0.6",
3
+ "version": "1.0.8",
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,6 +7,8 @@ export declare type ContextMenuConfiguration = {
7
7
  enabled?: boolean;
8
8
  /** Whether this ````ContextMenu```` automatically hides whenever we mouse-down or tap anywhere in the page. */
9
9
  hideOnMouseDown?: boolean;
10
+ /** Whether this ````ContextMenu```` automatically hides after we select a menu item. Se false if we want the menu to remain shown and show any updates to its item titles, after we've selected an item. */
11
+ hideOnAction?: boolean;
10
12
  };
11
13
 
12
14
  /**
@@ -11,7 +11,7 @@ export declare class AngleMeasurement extends Component {
11
11
  * @type {AngleMeasurementsPlugin}
12
12
  */
13
13
  plugin: AngleMeasurementsPlugin;
14
-
14
+
15
15
  /**
16
16
  * Sets whether this AngleMeasurement indicates that its measurement is approximate.
17
17
  *
@@ -28,6 +28,7 @@ export declare class AngleMeasurement extends Component {
28
28
  * @type {Boolean}
29
29
  */
30
30
  get approximate(): boolean;
31
+
31
32
  /**
32
33
  * Sets whether this AngleMeasurement is visible or not.
33
34
  *
@@ -112,7 +113,41 @@ export declare class AngleMeasurement extends Component {
112
113
  * @type {Boolean}
113
114
  */
114
115
  get angleVisible(): boolean;
115
-
116
+
117
+ /**
118
+ * Sets if the labels are visible.
119
+ *
120
+ * @type {Boolean}
121
+ */
122
+ set labelsVisible(value: Boolean);
123
+
124
+ /**
125
+ * Gets if the labels are visible.
126
+ *
127
+ * @type {Boolean}
128
+ */
129
+ get labelsVisible();
130
+
131
+ /**
132
+ * Sets if this DistanceMeasurement appears highlighted.
133
+ * @param highlighted
134
+ */
135
+ setHighlighted(highlighted: Boolean): any;
136
+
137
+ /**
138
+ * Sets if the wires, dots ad labels will fire "mouseOver" "mouseLeave" and "contextMenu" events.
139
+ *
140
+ * @type {Boolean}
141
+ */
142
+ set clickable(value: Boolean);
143
+
144
+ /**
145
+ * Gets if the wires, dots ad labels will fire "mouseOver" "mouseLeave" and "contextMenu" events.
146
+ *
147
+ * @type {Boolean}
148
+ */
149
+ get clickable();
150
+
116
151
  /**
117
152
  * Gets the origin {@link Marker}.
118
153
  *
@@ -141,4 +176,21 @@ export declare class AngleMeasurement extends Component {
141
176
  * @type {Number}
142
177
  */
143
178
  get angle(): number;
144
- }
179
+
180
+ /**
181
+ * Gets the color of the angle measurement.
182
+ *
183
+ * The color is an HTML string representation, eg. "#00BBFF" and "blue".
184
+ *
185
+ * @type {String}
186
+ */
187
+ get color(): string;
188
+
189
+ /** Sets the color of the angle measurement.
190
+ *
191
+ * The color is given as an HTML string representation, eg. "#00BBFF" and "blue".
192
+ *
193
+ * @type {String}
194
+ */
195
+ set color(value);
196
+ }
@@ -72,6 +72,23 @@ export declare class DistanceMeasurement extends Component {
72
72
  */
73
73
  get targetVisible(): boolean;
74
74
 
75
+ /**
76
+ * Sets if the axis-aligned wires between {@link DistanceMeasurement#origin} and {@link DistanceMeasurement#target} are enabled.
77
+ *
78
+ * Wires are only shown if enabled and visible.
79
+ *
80
+ * @type {Boolean}
81
+ */
82
+ set axisEnabled(value: boolean);
83
+
84
+ /**
85
+ * Gets if the axis-aligned wires between {@link DistanceMeasurement#origin} and {@link DistanceMeasurement#target} are enabled.
86
+ *
87
+ * Wires are only shown if enabled and visible.
88
+ *
89
+ * @type {Boolean}
90
+ */
91
+ get axisEnabled();
75
92
  /**
76
93
  * Sets if the direct point-to-point wire between {@link DistanceMeasurement.origin} and {@link DistanceMeasurement.target} is visible.
77
94
  *
@@ -100,20 +117,108 @@ export declare class DistanceMeasurement extends Component {
100
117
  */
101
118
  get axisVisible(): boolean;
102
119
 
120
+ /**
121
+ * Sets if the X-axis-aligned wire between {@link DistanceMeasurement#origin} and {@link DistanceMeasurement#target} is visible.
122
+ *
123
+ * Wires are only shown if enabled and visible.
124
+ *
125
+ * @type {Boolean}
126
+ */
127
+ set xAxisVisible(value: boolean);
128
+
129
+ /**
130
+ * Gets if the X-axis-aligned wires between {@link DistanceMeasurement#origin} and {@link DistanceMeasurement#target} are visible.
131
+ *
132
+ * Wires are only shown if enabled and visible.
133
+ *
134
+ * @type {Boolean}
135
+ */
136
+ get xAxisVisible();
137
+
138
+ /**
139
+ * Sets if the Y-axis-aligned wire between {@link DistanceMeasurement#origin} and {@link DistanceMeasurement#target} is visible.
140
+ *
141
+ * Wires are only shown if enabled and visible.
142
+ *
143
+ * @type {Boolean}
144
+ */
145
+ set yAxisVisible(value: boolean);
146
+
147
+ /**
148
+ * Gets if the Y-axis-aligned wires between {@link DistanceMeasurement#origin} and {@link DistanceMeasurement#target} are visible.
149
+ *
150
+ * Wires are only shown if enabled and visible.
151
+ *
152
+ * @type {Boolean}
153
+ */
154
+ get yAxisVisible();
155
+
156
+ /**
157
+ * Sets if the Z-axis-aligned wire between {@link DistanceMeasurement#origin} and {@link DistanceMeasurement#target} is visible.
158
+ *
159
+ * Wires are only shown if enabled and visible.
160
+ *
161
+ * @type {Boolean}
162
+ */
163
+ set zAxisVisible(value: boolean);
164
+
165
+ /**
166
+ * Gets if the Z-axis-aligned wires between {@link DistanceMeasurement#origin} and {@link DistanceMeasurement#target} are visible.
167
+ *
168
+ * Wires are only shown if enabled and visible.
169
+ *
170
+ * @type {Boolean}
171
+ */
172
+ get zAxisVisible();
173
+
174
+ /**
175
+ * Sets if the labels are visible.
176
+ *
177
+ * @type {Boolean}
178
+ */
179
+ set labelsVisible(value: boolean);
180
+
181
+ /**
182
+ * Gets if the labels are visible.
183
+ *
184
+ * @type {Boolean}
185
+ */
186
+ get labelsVisible();
187
+
188
+ /**
189
+ * Sets if this DistanceMeasurement appears highlighted.
190
+ * @param highlighted
191
+ */
192
+ setHighlighted(highlighted: boolean): any;
193
+
194
+ /**
195
+ * Sets if the wires, dots ad labels will fire "mouseOver" "mouseLeave" and "contextMenu" events, or ignore mouse events altogether.
196
+ *
197
+ * @type {Boolean}
198
+ */
199
+ set clickable(value: boolean);
200
+
201
+ /**
202
+ * Gets if the wires, dots ad labels will fire "mouseOver" "mouseLeave" and "contextMenu" events.
203
+ *
204
+ * @type {Boolean}
205
+ */
206
+ get clickable();
207
+
103
208
  /**
104
209
  * Gets the origin {@link Marker}.
105
210
  *
106
211
  * @type {Marker}
107
212
  */
108
213
  get origin(): Marker;
109
-
214
+
110
215
  /**
111
216
  * Gets the target {@link Marker}.
112
217
  *
113
218
  * @type {Marker}
114
219
  */
115
220
  get target(): Marker;
116
-
221
+
117
222
  /**
118
223
  * Gets the World-space direct point-to-point distance between {@link DistanceMeasurement.origin} and {@link DistanceMeasurement.target}.
119
224
  *
@@ -4,6 +4,8 @@ import { Viewer } from "../../viewer/Viewer";
4
4
  export declare type FastNavPluginConfiguration = {
5
5
  /** Optional ID for this plugin, so that we can find it within {@link Viewer.plugins}. */
6
6
  id?: string;
7
+ /** Whether to temporarily hide color textures whenever we interact with the Viewer. */
8
+ hideColorTexture?: boolean;
7
9
  /** Whether to temporarily hide physically-based rendering (PBR) whenever we interact with the Viewer. */
8
10
  hidePBR?: boolean;
9
11
  /** Whether to temporarily hide scalable ambient occlusion (SAO) whenever we interact with the Viewer. */
@@ -35,6 +37,24 @@ export declare class FastNavPlugin extends Plugin {
35
37
  */
36
38
  constructor(viewer: Viewer, cfg?: FastNavPluginConfiguration);
37
39
 
40
+ /**
41
+ * Gets whether to temporarily hide color textures whenever we interact with the Viewer.
42
+ *
43
+ * Default is ````true````.
44
+ *
45
+ * @return {Boolean} ````true```` if hiding color textures.
46
+ */
47
+ get hideColorTexture(): boolean;
48
+
49
+ /**
50
+ * Sets whether to temporarily hide color textures whenever we interact with the Viewer.
51
+ *
52
+ * Default is ````true````.
53
+ *
54
+ * @param {Boolean} hideColorTexture ````true```` to hide color textures.
55
+ */
56
+ set hideColorTexture(hideColorTexture: boolean);
57
+
38
58
  /**
39
59
  * Sets whether to temporarily hide physically-based rendering (PBR) whenever we interact with the Viewer.
40
60
  *
@@ -3,9 +3,19 @@ import { Plugin, Viewer } from "../../viewer";
3
3
  import { Storey } from "./Storey";
4
4
  import { StoreyMap } from "./StoreyMap";
5
5
 
6
+ export declare type IFCStoreyPlanObjectStates = {
7
+ [key: string] : {
8
+ visible: boolean;
9
+ edges?: boolean;
10
+ colorize?: number[]
11
+ }
12
+ };
13
+
6
14
  export declare type StoreyViewsPluginConfiguration = {
7
15
  /** Optional ID for this plugin, so that we can find it within {@link Viewer.plugins}. */
8
16
  id?: string;
17
+ /** Map of visual states for the {@link Entity}s as rendered within each {@link Storey}. Default value is {@link IFCStoreyPlanObjectStates}. */
18
+ objectStates?: IFCStoreyPlanObjectStates;
9
19
  };
10
20
 
11
21
  /**
@@ -40,6 +50,24 @@ export declare class StoreyViewsPlugin extends Plugin {
40
50
  */
41
51
  modelStoreys: {[key: string]: { [key: string]: Storey} };
42
52
 
53
+ /**
54
+ * Sets map of visual states for the {@link Entity}s as rendered within each {@link Storey}.
55
+ *
56
+ * Default value is {@link IFCStoreyPlanObjectStates}.
57
+ *
58
+ * @type {IFCStoreyPlanObjectStates}
59
+ */
60
+ set objectStates(arg: IFCStoreyPlanObjectStates);
61
+
62
+ /**
63
+ * Gets map of visual states for the {@link Entity}s as rendered within each {@link Storey}.
64
+ *
65
+ * Default value is {@link IFCStoreyPlanObjectStates}.
66
+ *
67
+ * @type {IFCStoreyPlanObjectStates}
68
+ */
69
+ get objectStates(): IFCStoreyPlanObjectStates;
70
+
43
71
  /**
44
72
  * Arranges the {@link Camera} for a 3D orthographic view of the {@link Entity}s within the given storey.
45
73
  *
@@ -60,14 +88,20 @@ export declare class StoreyViewsPlugin extends Plugin {
60
88
  *
61
89
  * Optionally hides all other Entitys.
62
90
  *
91
+ * Optionally sets the visual appearance of each of the Entitys according to its IFC type. The appearance of
92
+ * IFC types in plan views is configured by {@link StoreyViewsPlugin.objectStates}.
93
+ *
63
94
  * See also: {@link ObjectsMemento}, which saves and restores a memento of the visual state
64
95
  * of the {@link Entity}'s that represent objects within a {@link Scene}.
65
96
  *
66
97
  * @param {String} storeyId ID of the ````IfcBuildingStorey```` object.
67
98
  * @param {*} [options] Options for showing the Entitys within the storey.
99
+ * @param {Boolean} [options.hideOthers=false] When ````true````, hide all other {@link Entity}s.
100
+ * @param {Boolean} [options.useObjectStates=false] When ````true````, apply the custom visibilities and appearances configured for IFC types in {@link StoreyViewsPlugin.objectStates}.
68
101
  */
69
102
  showStoreyObjects(storeyId: string, options?: {
70
103
  hideOthers?: boolean;
104
+ useObjectStates?: boolean
71
105
  }): void;
72
106
 
73
107
  /**
@@ -49,6 +49,15 @@ export declare class TreeViewPlugin extends Plugin {
49
49
  */
50
50
  get hierarchy(): "containment" | "storeys" | "types";
51
51
 
52
+ /**
53
+ * Returns the map of {@link ModelTreeView}s.
54
+ *
55
+ * Each ModelTreeView is mapped to the ID of its model.
56
+ *
57
+ * @return {*|{}}
58
+ */
59
+ get modelTreeViews(): any;
60
+
52
61
  /**
53
62
  * Adds a model to this tree view.
54
63
  *
@@ -131,5 +131,5 @@ export declare class MetaScene {
131
131
  * @param {String} id ID of root {@link MetaObject}.
132
132
  * @param {Function} callback Callback fired at each {@link MetaObject}.
133
133
  */
134
- withMetaObjectsInSubtree(id: string, callback: ()=> void): void;
134
+ withMetaObjectsInSubtree(id: string, callback: (...args: any[])=> void): void;
135
135
  }
@@ -2,13 +2,15 @@ export * from "./Component";
2
2
  export * from "./Entity";
3
3
  export * from "./LineSet";
4
4
  export * from "./Bitmap";
5
+ export * from "./LineSet";
6
+ export * from "./Bitmap";
5
7
  export * from "./camera";
6
8
  export * from "./CameraControl/CameraControl";
7
9
  export * from "./geometry";
8
10
  export * from "./lights";
9
11
  export * from "./marker";
10
12
  export * from "./materials";
11
- export * from "./math/math";
13
+ export * from "./math";
12
14
  export * from "./mementos";
13
15
  export * from "./mesh";
14
16
  export * from "./nodes";
@@ -18,3 +20,4 @@ export * from "./sectionPlane";
18
20
  export * from "./stats";
19
21
  export * from "./viewport";
20
22
  export * from "./webgl";
23
+ export * from "./utils";
@@ -9,6 +9,11 @@ import { Component } from "../Component";
9
9
  * * Located at {@link Scene#input}
10
10
  */
11
11
  export declare class Input extends Component {
12
+ readonly KEY_CTRL: number;
13
+
14
+ keyDown: boolean[];
15
+
16
+ keyboardEnabled: boolean;
12
17
 
13
18
  /**
14
19
  * Sets whether input handlers are enabled.
@@ -30,17 +30,23 @@ declare const math: {
30
30
  */
31
31
  vec4: (values?: number[]) => number[];
32
32
 
33
+ /**
34
+ * Returns a new, uninitialized 2D axis-aligned bounding box.
35
+ *
36
+ */
37
+ AABB2: (values?: any) => any;
38
+
33
39
  /**
34
40
  * Gets the center of a 2D AABB.
35
41
  * @returns {Number[]}
36
42
  */
37
- getAABB2Center(aabb: number[], dest?: (values?: number[]) => number[]): number[];
43
+ getAABB2Center(aabb: number[], dest?: any): number[];
38
44
 
39
45
  /**
40
46
  * Gets the center of an AABB.
41
47
  * @returns {Number[]}
42
48
  */
43
- getAABB3Center(aabb: number[], dest?: (values?: number[]) => number[]): number[];
49
+ getAABB3Center(aabb: number[], dest?: any): number[];
44
50
 
45
51
  /**
46
52
  * Gets the diagonal size of an AABB3 given as minima and maxima.
@@ -53,9 +59,46 @@ declare const math: {
53
59
  normalizeVec3: (v: number[], dest?: any) => number[];
54
60
 
55
61
  /**
56
- * Multiplies each element of a three-element vector by a scalar.
57
- */
62
+ * Multiplies each element of a three-element vector by a scalar.
63
+ */
58
64
  mulVec3Scalar: (v: number[], scalar: number, dest?: number[]) => number[];
65
+
66
+ /**
67
+ * Returns true if the first AABB contains the second AABB.
68
+ */
69
+ containsAABB3: (aabb1: number[], aabb2: number[]) => boolean;
70
+
71
+ /**
72
+ * Returns a new, uninitialized 3D axis-aligned bounding box.
73
+ */
74
+ AABB3: (values?: any) => any;
75
+
76
+ /**
77
+ * Collapses a 3D axis-aligned boundary, ready to expand to fit 3D points.
78
+ * Creates new AABB if none supplied.
79
+ */
80
+ collapseAABB3: (aabb: number[]) => number[];
81
+
82
+ /**
83
+ * Expands the first axis-aligned 3D boundary to enclose the second, if required.
84
+ */
85
+ expandAABB3: (aabb1: number[], aabb2: number[]) => number[];
86
+
87
+ /**
88
+ * Returns a new, uninitialized 4x4 matrix.
89
+ * @method mat4
90
+ * @param [values] Initial values.
91
+ * @static
92
+ * @returns {Number[]}
93
+ */
94
+ mat4(values?: any): number[];
95
+
96
+ /**
97
+ * Returns a 4x4 perspective projection matrix.
98
+ * @method frustumMat4v
99
+ * @static
100
+ */
101
+ frustumMat4: (left: number, right: number, bottom: number, top: number, near: number, far: number, dest: number[] | null) => number[];
59
102
  };
60
103
 
61
104
  export {math};
@@ -79,6 +79,33 @@ export declare class Scene extends Component {
79
79
  */
80
80
  get startTime(): Date;
81
81
 
82
+ /**
83
+ * canvas
84
+ */
85
+ get canvas(): any;
86
+
87
+ /**
88
+ * Sets whether data texture scene representation (DTX) is enabled for the {@link Scene}.
89
+ *
90
+ * Even when enabled, DTX will only work if supported.
91
+ *
92
+ * Default value is ````false````.
93
+ *
94
+ * @type {Boolean}
95
+ */
96
+ set dtxEnabled(value: boolean);
97
+
98
+ /**
99
+ * Gets whether data texture-based scene representation (DTX) is enabled for the {@link Scene}.
100
+ *
101
+ * Even when enabled, DTX will only apply if supported.
102
+ *
103
+ * Default value is ````false````.
104
+ *
105
+ * @type {Boolean}
106
+ */
107
+ get dtxEnabled(): boolean;
108
+
82
109
  /**
83
110
  * Map of {@link Entity}s that represent models.
84
111
  *
@@ -646,7 +673,7 @@ export declare class Scene extends Component {
646
673
  * @param {String[]} ids Array of {@link Entity.id} values.
647
674
  * @returns {[Number, Number, Number, Number, Number, Number]} An axis-aligned World-space bounding box, given as elements ````[xmin, ymin, zmin, xmax, ymax, zmax]````.
648
675
  */
649
- getAABB(ids: string[]): number[];
676
+ getAABB(ids?: string[] | null): number[];
650
677
 
651
678
  /**
652
679
  * Batch-updates {@link Entity.visible} on {@link Entity}s that represent objects.