@xeokit/xeokit-sdk 2.4.0-alpha-85 → 2.4.0-alpha-86

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": "@xeokit/xeokit-sdk",
3
- "version": "2.4.0-alpha-85",
3
+ "version": "2.4.0-alpha-86",
4
4
  "description": "Web Programming Toolkit for 3D/2D BIM and AEC Graphics",
5
5
  "module": "./dist/xeokit-sdk.es.js",
6
6
  "main": "./dist/xeokit-sdk.cjs.js",
@@ -0,0 +1,255 @@
1
+ import {Component} from '../Component.js';
2
+
3
+
4
+ export declare class Bitmap extends Component {
5
+
6
+ /**
7
+ * Creates a new Bitmap.
8
+ *
9
+ * Registers the Bitmap in {@link Scene#bitmaps}; causes Scene to fire a "bitmapCreated" event.
10
+ *
11
+ * @constructor
12
+ * @param {Component} [owner] Owner component. When destroyed, the owner will destroy this ````Bitmap```` as well.
13
+ * @param {*} [cfg] ````Bitmap```` configuration
14
+ * @param {string} [cfg.id] Optional ID, unique among all components in the parent {@link Scene}, generated automatically when omitted.
15
+ * @param {Boolean} [cfg.visible=true] Indicates whether or not this ````Bitmap```` is visible.
16
+ * @param {number[]} [cfg.pos=[0,0,0]] World-space position of the ````Bitmap````.
17
+ * @param {number[]} [cfg.normal=[0,0,1]] Normal vector indicating the direction the ````Bitmap```` faces.
18
+ * @param {number[]} [cfg.up=[0,1,0]] Direction of "up" for the ````Bitmap````.
19
+ * @param {number[]} [cfg.height=1] World-space height of the ````Bitmap````.
20
+ * @param {number[]} [cfg.matrix=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]] Modelling transform matrix for the ````Bitmap````. Overrides the ````position````, ````height```, ````rotation```` and ````normal```` parameters.
21
+ * @param {Boolean} [cfg.collidable=true] Indicates if the ````Bitmap```` is initially included in boundary calculations.
22
+ * @param {Boolean} [cfg.clippable=true] Indicates if the ````Bitmap```` is initially clippable.
23
+ * @param {Boolean} [cfg.pickable=true] Indicates if the ````Bitmap```` is initially pickable.
24
+ * @param {number} [cfg.opacity=1.0] ````Bitmap````'s initial opacity factor, multiplies by the rendered fragment alpha.
25
+ * @param {string} [cfg.src] URL of image. Accepted file types are PNG and JPEG.
26
+ * @param {HTMLImageElement} [cfg.image] An ````HTMLImageElement```` to source the image from. Overrides ````src````.
27
+ * @param {string} [cfg.imageData] Image data as a base64 encoded string.
28
+ * @param {string} [cfg.type="jpg"] Image MIME type. Accepted values are "jpg" and "png". Default is "jpg". Normally only needed with ````image```` or ````imageData````. Automatically inferred from file extension of ````src````, if the file has a recognized extension.
29
+ */
30
+ constructor(owner: Component, cfg?: any);
31
+
32
+ /**
33
+ * Sets if this ````Bitmap```` is visible or not.
34
+ *
35
+ * Default value is ````true````.
36
+ *
37
+ * @param {Boolean} visible Set ````true```` to make this ````Bitmap```` visible.
38
+ */
39
+ set visible(visible: boolean) ;
40
+
41
+ /**
42
+ * Gets if this ````Bitmap```` is visible or not.
43
+ *
44
+ * Default value is ````true````.
45
+ *
46
+ * @returns {Boolean} Returns ````true```` if visible.
47
+ */
48
+ get visible(): boolean;
49
+
50
+ /**
51
+ * Sets an ````HTMLImageElement```` to source the image from.
52
+ *
53
+ * Sets {@link Texture#src} null.
54
+ *
55
+ * You may also need to set {@link Bitmap#type}, if you want to read the image data with {@link Bitmap#imageData}.
56
+ *
57
+ * @type {HTMLImageElement}
58
+ */
59
+ set image(image: HTMLImageElement);
60
+
61
+ /**
62
+ * Gets the ````HTMLImageElement```` the ````Bitmap````'s image is sourced from, if set.
63
+ *
64
+ * Returns null if not set.
65
+ *
66
+ * @type {HTMLImageElement}
67
+ */
68
+ get image(): HTMLImageElement;
69
+
70
+ /**
71
+ * Sets an image file path that the ````Bitmap````'s image is sourced from.
72
+ *
73
+ * If the file extension is a recognized MIME type, also sets {@link Bitmap#type} to that MIME type.
74
+ *
75
+ * Accepted file types are PNG and JPEG.
76
+ *
77
+ * @type {string}
78
+ */
79
+ set src(src: string);
80
+
81
+ /**
82
+ * Gets the image file path that the ````Bitmap````'s image is sourced from, if set.
83
+ *
84
+ * Returns null if not set.
85
+ *
86
+ * @type {string}
87
+ */
88
+ get src(): string;
89
+
90
+ /**
91
+ * Sets an image file path that the ````Bitmap````'s image is sourced from.
92
+ *
93
+ * Accepted file types are PNG and JPEG.
94
+ *
95
+ * Sets {@link Texture#image} null.
96
+ *
97
+ * You may also need to set {@link Bitmap#type}, if you want to read the image data with {@link Bitmap#imageData}.
98
+ *
99
+ * @type {string}
100
+ */
101
+ set imageData(imageData: string);
102
+
103
+ /**
104
+ * Gets the image file path that the ````Bitmap````'s image is sourced from, if set.
105
+ *
106
+ * Returns null if not set.
107
+ *
108
+ * @type {string}
109
+ */
110
+ get imageData(): string;
111
+
112
+ /**
113
+ * Sets the MIME type of this Bitmap.
114
+ *
115
+ * This is used by ````Bitmap```` when getting image data with {@link Bitmap#imageData}.
116
+ *
117
+ * Supported values are "jpg" and "png",
118
+ *
119
+ * Default is "jpg".
120
+ *
121
+ * @type {string}
122
+ */
123
+ set type(type: string);
124
+
125
+ /**
126
+ * Gets the MIME type of this Bitmap.
127
+ *
128
+ * @type {string}
129
+ */
130
+ get type(): string;
131
+
132
+ /**
133
+ * Gets the World-space position of this ````Bitmap````.
134
+ *
135
+ * Default value is ````[0, 0, 0]````.
136
+ *
137
+ * @returns {number[]} Current position.
138
+ */
139
+ get pos(): number[];
140
+
141
+ /**
142
+ * Gets the direction of the normal vector that is perpendicular to this ````Bitmap````.
143
+ *
144
+ * @returns {number[]} value Current normal direction.
145
+ */
146
+ get normal(): number[];
147
+
148
+ /**
149
+ * Gets the "up" direction of this ````Bitmap````.
150
+ *
151
+ * @returns {number[]} value Current "up" direction.
152
+ */
153
+ get up(): number[];
154
+
155
+ /**
156
+ * Sets the World-space height of the ````Bitmap````.
157
+ *
158
+ * Default value is ````1.0````.
159
+ *
160
+ * @param {number} height New World-space height of the ````Bitmap````.
161
+ */
162
+ set height(height: number);
163
+
164
+ /**
165
+ * Gets the World-space height of the ````Bitmap````.
166
+ *
167
+ * Returns {number} World-space height of the ````Bitmap````.
168
+ */
169
+ get height(): number;
170
+
171
+ /**
172
+ * Sets if this ````Bitmap```` is included in boundary calculations.
173
+ *
174
+ * Default is ````true````.
175
+ *
176
+ * @type {Boolean}
177
+ */
178
+ set collidable(value: boolean) ;
179
+
180
+ /**
181
+ * Gets if this ````Bitmap```` is included in boundary calculations.
182
+ *
183
+ * Default is ````true````.
184
+ *
185
+ * @type {Boolean}
186
+ */
187
+ get collidable(): boolean;
188
+
189
+ /**
190
+ * Sets if this ````Bitmap```` is clippable.
191
+ *
192
+ * Clipping is done by the {@link SectionPlane}s in {@link Scene#sectionPlanes}.
193
+ *
194
+ * Default is ````true````.
195
+ *
196
+ * @type {Boolean}
197
+ */
198
+ set clippable(value: boolean);
199
+
200
+ /**
201
+ * Gets if this ````Bitmap```` is clippable.
202
+ *
203
+ * Clipping is done by the {@link SectionPlane}s in {@link Scene#sectionPlanes}.
204
+ *
205
+ * Default is ````true````.
206
+ *
207
+ * @type {Boolean}
208
+ */
209
+ get clippable(): boolean;
210
+
211
+ /**
212
+ * Sets if this ````Bitmap```` is pickable.
213
+ *
214
+ * Default is ````true````.
215
+ *
216
+ * @type {Boolean}
217
+ */
218
+ set pickable(value: boolean);
219
+
220
+ /**
221
+ * Gets if this ````Bitmap```` is pickable.
222
+ *
223
+ * Default is ````true````.
224
+ *
225
+ * @type {Boolean}
226
+ */
227
+ get pickable(): boolean;
228
+
229
+ /**
230
+ * Sets the opacity factor for this ````Bitmap````.
231
+ *
232
+ * This is a factor in range ````[0..1]```` which multiplies by the rendered fragment alphas.
233
+ *
234
+ * @type {number}
235
+ */
236
+ set opacity(opacity: boolean);
237
+
238
+ /**
239
+ * Gets this ````Bitmap````'s opacity factor.
240
+ *
241
+ * This is a factor in range ````[0..1]```` which multiplies by the rendered fragment alphas.
242
+ *
243
+ * @type {number}
244
+ */
245
+ get opacity(): boolean;
246
+
247
+ /**
248
+ * Destroys this ````Bitmap````.
249
+ *
250
+ * Removes the ```Bitmap```` from {@link Scene#bitmaps}; causes Scene to fire a "bitmapDestroyed" event.
251
+ */
252
+ destroy(): void;
253
+
254
+ }
255
+
@@ -0,0 +1 @@
1
+ export * from "./Bitmap";
@@ -0,0 +1,114 @@
1
+ import {Component} from '../Component';
2
+
3
+
4
+ /**
5
+ * A set of 3D line segments.
6
+ *
7
+ * * Creates a set of 3D line segments.
8
+ * * Registered by {@link LineSet#id} in {@link Scene#lineSets}.
9
+ * * Configure color using the {@link LinesMaterial} located at {@link Scene#linesMaterial}.
10
+ * * {@link BCFViewpointsPlugin} will save and load Linesets in BCF viewpoints.
11
+ *
12
+ * ## Usage
13
+ *
14
+ * In the example below, we'll load the Schependomlaan model, then use
15
+ * a ````LineSet```` to show a grid underneath the model.
16
+ *
17
+ * [<img src="http://xeokit.github.io/xeokit-sdk/assets/images/LineSet_grid.png">](/examples/#LineSet_grid)
18
+ *
19
+ * [[Run this example](/examples/#LineSet_grid)]
20
+ *
21
+ * ````javascript
22
+ * import {Viewer, XKTLoaderPlugin, LineSet, buildGridGeometry} from "https://cdn.jsdelivr.net/npm/@xeokit/xeokit-sdk/dist/xeokit-sdk.es.min.js";
23
+ *
24
+ * const viewer = new Viewer({
25
+ * canvasId: "myCanvas",
26
+ * transparent: true
27
+ * });
28
+ *
29
+ * const camera = viewer.camera;
30
+ *
31
+ * viewer.camera.eye = [-2.56, 8.38, 8.27];
32
+ * viewer.camera.look = [13.44, 3.31, -14.83];
33
+ * viewer.camera.up = [0.10, 0.98, -0.14];
34
+ *
35
+ * const xktLoader = new XKTLoaderPlugin(viewer);
36
+ *
37
+ * const model = xktLoader.load({
38
+ * id: "myModel",
39
+ * src: "../assets/models/xkt/v8/ifc/Schependomlaan.ifc.xkt",
40
+ * position: [0,1,0],
41
+ * edges: true,
42
+ * saoEnabled: true
43
+ * });
44
+ *
45
+ * const geometryArrays = buildGridGeometry({
46
+ * size: 100,
47
+ * divisions: 30
48
+ * });
49
+ *
50
+ * new LineSet(viewer.scene, {
51
+ * positions: geometryArrays.positions,
52
+ * indices: geometryArrays.indices
53
+ * });
54
+ * ````
55
+ */
56
+ export declare class LineSet extends Component {
57
+
58
+ /**
59
+ * Creates a new LineSet.
60
+ *
61
+ * Registers the LineSet in {@link Scene#lineSets}; causes Scene to fire a "lineSetCreated" event.
62
+ *
63
+ * @constructor
64
+ * @param {Component} [owner] Owner component. When destroyed, the owner will destroy this ````LineSet```` as well.
65
+ * @param {*} [cfg] ````LineSet```` configuration
66
+ * @param {string} [cfg.id] Optional ID, unique among all components in the parent {@link Scene}, generated automatically when omitted.
67
+ * @param {number[]} cfg.positions World-space 3D vertex positions.
68
+ * @param {number[]} [cfg.indices] Indices to connect ````positions```` into line segments. Note that these are separate line segments, not a polyline.
69
+ * @param {number[]} [cfg.color=[0,0,0]] The color of this ````LineSet````. This is both emissive and diffuse.
70
+ * @param {boolean} [cfg.visible=true] Indicates whether or not this ````LineSet```` is visible.
71
+ * @param {number} [cfg.opacity=1.0] ````LineSet````'s initial opacity factor.
72
+ */
73
+ constructor(owner: Component, cfg?: any);
74
+
75
+ /**
76
+ * Sets if this ````LineSet```` is visible.
77
+ *
78
+ * Default value is ````true````.
79
+ *
80
+ * @param {boolean} visible Set ````true```` to make this ````LineSet```` visible.
81
+ */
82
+ set visible(visible: boolean);
83
+
84
+ /**
85
+ * Gets if this ````LineSet```` is visible.
86
+ *
87
+ * Default value is ````true````.
88
+ *
89
+ * @returns {boolean} Returns ````true```` if visible.
90
+ */
91
+ get visible(): boolean;
92
+
93
+ /**
94
+ * Gets the 3D World-space vertex positions of the lines in this ````LineSet````.
95
+ *
96
+ * @returns {number[]}
97
+ */
98
+ get positions(): number[];
99
+
100
+ /**
101
+ * Gets the vertex indices of the lines in this ````LineSet````.
102
+ *
103
+ * @returns {number[]}
104
+ */
105
+ get indices(): number[];
106
+
107
+ /**
108
+ * Destroys this ````LineSet````.
109
+ *
110
+ * Removes the ```LineSet```` from {@link Scene#lineSets}; causes Scene to fire a "lineSetDestroyed" event.
111
+ */
112
+ destroy(): void;
113
+ }
114
+
@@ -0,0 +1 @@
1
+ export * from "./LineSet";
@@ -1,6 +1,7 @@
1
1
  export * from "./Component";
2
2
  export * from "./Entity";
3
-
3
+ export * from "./LineSet";
4
+ export * from "./Bitmap";
4
5
  export * from "./camera";
5
6
  export * from "./CameraControl/CameraControl";
6
7
  export * from "./geometry";