@xtctwins/tctwins-core 1.0.6 → 1.0.7

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.7",
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
  /**
@@ -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.