@inweb/viewer-core 25.8.20 → 25.8.21
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/lib/viewer/IViewpoint.d.ts +300 -31
- package/package.json +3 -3
- package/src/viewer/IViewpoint.ts +370 -36
|
@@ -1,181 +1,450 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
*/
|
|
4
|
-
export interface ILocation {
|
|
5
|
-
x: number;
|
|
6
|
-
y: number;
|
|
7
|
-
z: number;
|
|
8
|
-
}
|
|
9
|
-
/**
|
|
10
|
-
* BCF-style Direction of the Viewpoint
|
|
2
|
+
* Defines the 3D direction vector. Direction must not be a zero vector.
|
|
11
3
|
*/
|
|
12
4
|
export interface IDirection {
|
|
5
|
+
/**
|
|
6
|
+
* X direction.
|
|
7
|
+
*/
|
|
13
8
|
x: number;
|
|
9
|
+
/**
|
|
10
|
+
* Y direction.
|
|
11
|
+
*/
|
|
14
12
|
y: number;
|
|
13
|
+
/**
|
|
14
|
+
* Z direction.
|
|
15
|
+
*/
|
|
15
16
|
z: number;
|
|
16
17
|
}
|
|
17
18
|
/**
|
|
18
|
-
*
|
|
19
|
+
* Defines the 3D point.
|
|
19
20
|
*/
|
|
20
21
|
export interface IPoint {
|
|
22
|
+
/**
|
|
23
|
+
* X coordinate.
|
|
24
|
+
*/
|
|
21
25
|
x: number;
|
|
26
|
+
/**
|
|
27
|
+
* Y coordinate.
|
|
28
|
+
*/
|
|
22
29
|
y: number;
|
|
30
|
+
/**
|
|
31
|
+
* Z coordinate.
|
|
32
|
+
*/
|
|
23
33
|
z: number;
|
|
24
34
|
}
|
|
25
35
|
/**
|
|
26
|
-
*
|
|
36
|
+
* Defines the embedded picture in the viewpoint.
|
|
27
37
|
*/
|
|
28
38
|
export interface IBitmap {
|
|
39
|
+
/**
|
|
40
|
+
* GUID for identifying bitmap uniquely.
|
|
41
|
+
*/
|
|
29
42
|
guid: string;
|
|
30
|
-
|
|
43
|
+
/**
|
|
44
|
+
* Location of the center of the bitmap in world coordinates.
|
|
45
|
+
*/
|
|
46
|
+
location: IPoint;
|
|
47
|
+
/**
|
|
48
|
+
* Normal vector of the bitmap.
|
|
49
|
+
*/
|
|
31
50
|
normal: IDirection;
|
|
51
|
+
/**
|
|
52
|
+
* Up vector of the bitmap.
|
|
53
|
+
*/
|
|
32
54
|
up: IDirection;
|
|
55
|
+
/**
|
|
56
|
+
* Height of the bitmap in the model, in meters.
|
|
57
|
+
*/
|
|
33
58
|
height: number;
|
|
34
59
|
}
|
|
35
60
|
/**
|
|
36
|
-
*
|
|
61
|
+
* Describes a viewpoint using an orthogonal camera.
|
|
37
62
|
*/
|
|
38
63
|
export interface IOrthogonalCamera {
|
|
64
|
+
/**
|
|
65
|
+
* Camera location.
|
|
66
|
+
*/
|
|
39
67
|
view_point: IPoint;
|
|
68
|
+
/**
|
|
69
|
+
* Camera direction.
|
|
70
|
+
*/
|
|
40
71
|
direction: IDirection;
|
|
72
|
+
/**
|
|
73
|
+
* Camera up vector.
|
|
74
|
+
*/
|
|
41
75
|
up_vector: IDirection;
|
|
76
|
+
/**
|
|
77
|
+
* View field width to calculate aspect ratio.
|
|
78
|
+
*/
|
|
42
79
|
field_width: number;
|
|
80
|
+
/**
|
|
81
|
+
* View field height to calculate aspect ratio.
|
|
82
|
+
*/
|
|
43
83
|
field_height: number;
|
|
44
84
|
}
|
|
45
85
|
/**
|
|
46
|
-
*
|
|
86
|
+
* Defines the subsection of a model (clipping plane).
|
|
47
87
|
*/
|
|
48
88
|
export interface IClippingPlane {
|
|
49
|
-
|
|
89
|
+
/**
|
|
90
|
+
* Origin of the clipping plane.
|
|
91
|
+
*/
|
|
92
|
+
location: IPoint;
|
|
93
|
+
/**
|
|
94
|
+
* Direction of the clipping plane. The Direction vector points in the _invisible_ direction
|
|
95
|
+
* meaning the half-space that is clipped.
|
|
96
|
+
*/
|
|
50
97
|
direction: IDirection;
|
|
51
98
|
}
|
|
52
99
|
/**
|
|
53
|
-
*
|
|
100
|
+
* Describes a viewpoint using an perspective camera.
|
|
54
101
|
*/
|
|
55
102
|
export interface IPerspectiveCamera {
|
|
103
|
+
/**
|
|
104
|
+
* Camera location.
|
|
105
|
+
*/
|
|
56
106
|
view_point: IPoint;
|
|
107
|
+
/**
|
|
108
|
+
* Camera direction.
|
|
109
|
+
*/
|
|
57
110
|
direction: IDirection;
|
|
111
|
+
/**
|
|
112
|
+
* Camera up vector.
|
|
113
|
+
*/
|
|
58
114
|
up_vector: IDirection;
|
|
115
|
+
/**
|
|
116
|
+
* The entire vertical field of view angle of the camera, expressed in degrees. Valid range 0
|
|
117
|
+
* to 180 exclusive.
|
|
118
|
+
*/
|
|
59
119
|
field_of_view: number;
|
|
60
120
|
}
|
|
61
121
|
/**
|
|
62
|
-
*
|
|
122
|
+
* Defines the markup line object of the viewpoint.
|
|
63
123
|
*/
|
|
64
124
|
export interface ILine {
|
|
125
|
+
/**
|
|
126
|
+
* Array of line points.
|
|
127
|
+
*/
|
|
65
128
|
points: IPoint[];
|
|
129
|
+
/**
|
|
130
|
+
* Line type. Can be `solid`, `dot` or `dash`.
|
|
131
|
+
*
|
|
132
|
+
* @default "solid"
|
|
133
|
+
*/
|
|
66
134
|
type?: string;
|
|
135
|
+
/**
|
|
136
|
+
* Line width.
|
|
137
|
+
*/
|
|
67
138
|
width?: number;
|
|
139
|
+
/**
|
|
140
|
+
* Line color in hexadecimal color syntax `#RGB` using its primary color components (red,
|
|
141
|
+
* green, blue) written as hexadecimal numbers.
|
|
142
|
+
*/
|
|
68
143
|
color?: string;
|
|
144
|
+
/**
|
|
145
|
+
* Internal markup object identifier.
|
|
146
|
+
*/
|
|
69
147
|
id?: string;
|
|
70
148
|
}
|
|
71
149
|
/**
|
|
72
|
-
*
|
|
150
|
+
* Defines the markup text object of the viewpoint.
|
|
73
151
|
*/
|
|
74
152
|
export interface IText {
|
|
153
|
+
/**
|
|
154
|
+
* Coordinates of the top-left point (position) of the text.
|
|
155
|
+
*/
|
|
75
156
|
position: IPoint;
|
|
157
|
+
/**
|
|
158
|
+
* Text string.
|
|
159
|
+
*/
|
|
76
160
|
text: string;
|
|
161
|
+
/**
|
|
162
|
+
* Text rotation angle of the object, in degress.
|
|
163
|
+
*/
|
|
77
164
|
angle?: number;
|
|
165
|
+
/**
|
|
166
|
+
* Font size of the text.
|
|
167
|
+
*/
|
|
78
168
|
font_size?: number;
|
|
169
|
+
/**
|
|
170
|
+
* Deprecated. Use {@link font_size} instead.
|
|
171
|
+
*/
|
|
79
172
|
text_size?: number;
|
|
173
|
+
/**
|
|
174
|
+
* Text color in hexadecimal color syntax `#RGB` using its primary color components (red,
|
|
175
|
+
* green, blue) written as hexadecimal numbers.
|
|
176
|
+
*/
|
|
80
177
|
color?: string;
|
|
178
|
+
/**
|
|
179
|
+
* Internal markup object identifier.
|
|
180
|
+
*/
|
|
81
181
|
id?: string;
|
|
82
182
|
}
|
|
83
183
|
/**
|
|
84
|
-
*
|
|
184
|
+
* Defines the markup arrow object of the viewpoint.
|
|
85
185
|
*/
|
|
86
186
|
export interface IArrow {
|
|
187
|
+
/**
|
|
188
|
+
* Coordinales of the start point of arrow.
|
|
189
|
+
*/
|
|
87
190
|
start: IPoint;
|
|
191
|
+
/**
|
|
192
|
+
* Coordinales of the end point of arrow.
|
|
193
|
+
*/
|
|
88
194
|
end: IPoint;
|
|
195
|
+
/**
|
|
196
|
+
* Line color in hexadecimal color syntax `#RGB` using its primary color components (red,
|
|
197
|
+
* green, blue) written as hexadecimal numbers.
|
|
198
|
+
*/
|
|
89
199
|
color?: string;
|
|
200
|
+
/**
|
|
201
|
+
* Internal markup object identifier.
|
|
202
|
+
*/
|
|
90
203
|
id?: string;
|
|
91
204
|
}
|
|
92
205
|
/**
|
|
93
|
-
*
|
|
206
|
+
* Defines the markup cloud object of the viewpoint.
|
|
94
207
|
*/
|
|
95
208
|
export interface ICloud {
|
|
209
|
+
/**
|
|
210
|
+
* Coordinates of the top-left point (position) of the cloud.
|
|
211
|
+
*/
|
|
96
212
|
position: IPoint;
|
|
213
|
+
/**
|
|
214
|
+
* Width of the cloud.
|
|
215
|
+
*/
|
|
97
216
|
width?: number;
|
|
217
|
+
/**
|
|
218
|
+
* Height of the cloud.
|
|
219
|
+
*/
|
|
98
220
|
height?: number;
|
|
221
|
+
/**
|
|
222
|
+
* Line width of the cloud.
|
|
223
|
+
*/
|
|
99
224
|
line_width?: number;
|
|
225
|
+
/**
|
|
226
|
+
* Line color in hexadecimal color syntax `#RGB` using its primary color components (red,
|
|
227
|
+
* green, blue) written as hexadecimal numbers.
|
|
228
|
+
*/
|
|
100
229
|
color?: string;
|
|
230
|
+
/**
|
|
231
|
+
* Internal markup object identifier.
|
|
232
|
+
*/
|
|
101
233
|
id?: string;
|
|
102
234
|
}
|
|
103
235
|
/**
|
|
104
|
-
*
|
|
236
|
+
* Defines the markup ellipse object of the viewpoint.
|
|
105
237
|
*/
|
|
106
238
|
export interface IEllipse {
|
|
239
|
+
/**
|
|
240
|
+
* Coordinates of the center point (position) of the ellipse.
|
|
241
|
+
*/
|
|
107
242
|
position: IPoint;
|
|
243
|
+
/**
|
|
244
|
+
* Ellipse radius along the X and Y axes.
|
|
245
|
+
*/
|
|
108
246
|
radius: {
|
|
109
247
|
x: number;
|
|
110
248
|
y: number;
|
|
111
249
|
};
|
|
250
|
+
/**
|
|
251
|
+
* Line width of the ellipse.
|
|
252
|
+
*/
|
|
112
253
|
line_width?: number;
|
|
254
|
+
/**
|
|
255
|
+
* Line color in hexadecimal color syntax `#RGB` using its primary color components (red,
|
|
256
|
+
* green, blue) written as hexadecimal numbers.
|
|
257
|
+
*/
|
|
113
258
|
color?: string;
|
|
259
|
+
/**
|
|
260
|
+
* Internal markup object identifier.
|
|
261
|
+
*/
|
|
114
262
|
id?: string;
|
|
115
263
|
}
|
|
116
264
|
/**
|
|
117
|
-
*
|
|
265
|
+
* Defines the markup image object of the viewpoint.
|
|
118
266
|
*/
|
|
119
267
|
export interface IImage {
|
|
268
|
+
/**
|
|
269
|
+
* Coordinates of the top-left point (position) of the image.
|
|
270
|
+
*/
|
|
120
271
|
position: IPoint;
|
|
272
|
+
/**
|
|
273
|
+
* Image source as base64-encoded
|
|
274
|
+
* {@link https://developer.mozilla.org/docs/Web/HTTP/Basics_of_HTTP/Data_URIs | Data URL}.
|
|
275
|
+
*/
|
|
121
276
|
src: string;
|
|
122
|
-
|
|
123
|
-
|
|
277
|
+
/**
|
|
278
|
+
* Width of the image.
|
|
279
|
+
*/
|
|
280
|
+
width?: number;
|
|
281
|
+
/**
|
|
282
|
+
* Height of the image.
|
|
283
|
+
*/
|
|
284
|
+
height?: number;
|
|
285
|
+
/**
|
|
286
|
+
* Internal markup object identifier.
|
|
287
|
+
*/
|
|
124
288
|
id?: string;
|
|
125
289
|
}
|
|
126
290
|
/**
|
|
127
291
|
* Rectangle markup object of the Viewpoint
|
|
128
292
|
*/
|
|
129
293
|
export interface IRectangle {
|
|
294
|
+
/**
|
|
295
|
+
* Coordinates of the top-left point (position) of the rectangle.
|
|
296
|
+
*/
|
|
130
297
|
position: IPoint;
|
|
298
|
+
/**
|
|
299
|
+
* Width of the rectangle.
|
|
300
|
+
*/
|
|
131
301
|
width?: number;
|
|
302
|
+
/**
|
|
303
|
+
* Height of the rectangle.
|
|
304
|
+
*/
|
|
132
305
|
height?: number;
|
|
306
|
+
/**
|
|
307
|
+
* Line width of the rectangle.
|
|
308
|
+
*/
|
|
133
309
|
line_width?: number;
|
|
310
|
+
/**
|
|
311
|
+
* Line color in hexadecimal color syntax `#RGB` using its primary color components (red,
|
|
312
|
+
* green, blue) written as hexadecimal numbers.
|
|
313
|
+
*/
|
|
134
314
|
color?: string;
|
|
315
|
+
/**
|
|
316
|
+
* Internal markup object identifier.
|
|
317
|
+
*/
|
|
135
318
|
id?: string;
|
|
136
319
|
}
|
|
137
320
|
/**
|
|
138
|
-
*
|
|
321
|
+
* Defines the viewpoint colored components.
|
|
139
322
|
*/
|
|
140
323
|
export interface IColoring {
|
|
324
|
+
/**
|
|
325
|
+
* Component original handle in the model.
|
|
326
|
+
*/
|
|
141
327
|
handle: string;
|
|
328
|
+
/**
|
|
329
|
+
* Color in hexadecimal color syntax `#ARGB` using its primary color components (alpha, red,
|
|
330
|
+
* green, blue) written as hexadecimal numbers.
|
|
331
|
+
*/
|
|
142
332
|
color: string;
|
|
143
333
|
}
|
|
144
334
|
/**
|
|
145
|
-
*
|
|
335
|
+
* Defines the component in the model.
|
|
146
336
|
*/
|
|
147
|
-
export interface
|
|
337
|
+
export interface IComponent {
|
|
338
|
+
/**
|
|
339
|
+
* Component original handle in the model.
|
|
340
|
+
*/
|
|
148
341
|
handle: string;
|
|
149
342
|
}
|
|
150
343
|
/**
|
|
151
|
-
*
|
|
344
|
+
* Defines the viewpoint shapshot.
|
|
152
345
|
*/
|
|
153
346
|
export interface ISnapshot {
|
|
347
|
+
/**
|
|
348
|
+
* Snapshot image data as base64-encoded
|
|
349
|
+
* {@link https://developer.mozilla.org/docs/Web/HTTP/Basics_of_HTTP/Data_URIs | Data URL}.
|
|
350
|
+
*/
|
|
154
351
|
data: string;
|
|
155
352
|
}
|
|
156
353
|
/**
|
|
157
|
-
*
|
|
354
|
+
* Defines the model viewpoint with markup.
|
|
355
|
+
*
|
|
356
|
+
* This viewpoint is {@link https://github.com/buildingSMART/BCF-API | BCF-compatible}.
|
|
357
|
+
*
|
|
358
|
+
* Optional/mandatory fields clarification:
|
|
359
|
+
*
|
|
360
|
+
* - A viewpoint must contain a _camera definition_.
|
|
361
|
+
* - _Camera definition_ is exactly one of `perspective_camera` or `orthogonal_camera`.
|
|
158
362
|
*/
|
|
159
363
|
export interface IViewpoint {
|
|
364
|
+
/**
|
|
365
|
+
* Embedded pictures in the viewpoint. A list of bitmaps can be used to add more information,
|
|
366
|
+
* for example, text in the visualization.
|
|
367
|
+
*/
|
|
160
368
|
bitmaps?: IBitmap[];
|
|
369
|
+
/**
|
|
370
|
+
* GUID for identifying viewpoint uniquely.
|
|
371
|
+
*/
|
|
161
372
|
guid?: string;
|
|
373
|
+
/**
|
|
374
|
+
* Identifier of the file for which the viewpoint was created.
|
|
375
|
+
*/
|
|
162
376
|
file_id?: string;
|
|
377
|
+
/**
|
|
378
|
+
* Identifier of the assembly for which the viewpoint was created.
|
|
379
|
+
*/
|
|
163
380
|
assembly_id?: string;
|
|
381
|
+
/**
|
|
382
|
+
* Orthogonal camera view.
|
|
383
|
+
*/
|
|
164
384
|
orthogonal_camera?: IOrthogonalCamera;
|
|
385
|
+
/**
|
|
386
|
+
* Perspective view of the camera.
|
|
387
|
+
*/
|
|
165
388
|
perspective_camera?: IPerspectiveCamera;
|
|
389
|
+
/**
|
|
390
|
+
* Viewpoint description.
|
|
391
|
+
*/
|
|
166
392
|
description?: string;
|
|
393
|
+
/**
|
|
394
|
+
* Viewpoint index (sort order).
|
|
395
|
+
*/
|
|
167
396
|
index?: number;
|
|
397
|
+
/**
|
|
398
|
+
* List of markup Line objects.
|
|
399
|
+
*/
|
|
168
400
|
lines?: ILine[];
|
|
401
|
+
/**
|
|
402
|
+
* List of markup Texts objects.
|
|
403
|
+
*/
|
|
169
404
|
texts?: IText[];
|
|
405
|
+
/**
|
|
406
|
+
* Clipping planes for the model view.
|
|
407
|
+
*/
|
|
170
408
|
clipping_planes?: IClippingPlane[];
|
|
171
|
-
|
|
172
|
-
|
|
409
|
+
/**
|
|
410
|
+
* Selected components.
|
|
411
|
+
*/
|
|
412
|
+
selection?: IComponent[];
|
|
413
|
+
/**
|
|
414
|
+
* Visibility of components.
|
|
415
|
+
*/
|
|
416
|
+
visibility?: IComponent[];
|
|
417
|
+
/**
|
|
418
|
+
* Colored components.
|
|
419
|
+
*/
|
|
173
420
|
coloring?: IColoring[];
|
|
421
|
+
/**
|
|
422
|
+
* List of markup Arrow objects.
|
|
423
|
+
*/
|
|
174
424
|
arrows?: IArrow[];
|
|
425
|
+
/**
|
|
426
|
+
* List of markup Cloud objects.
|
|
427
|
+
*/
|
|
175
428
|
clouds?: ICloud[];
|
|
429
|
+
/**
|
|
430
|
+
* List of markup Ellipse objects.
|
|
431
|
+
*/
|
|
176
432
|
ellipses?: IEllipse[];
|
|
433
|
+
/**
|
|
434
|
+
* List of markup Image objects.
|
|
435
|
+
*/
|
|
177
436
|
images?: IImage[];
|
|
437
|
+
/**
|
|
438
|
+
* List of markup Rectangle objects.
|
|
439
|
+
*/
|
|
178
440
|
rectangles?: IRectangle[];
|
|
441
|
+
/**
|
|
442
|
+
* Viewpoint custom fields object, to store custom data.
|
|
443
|
+
*/
|
|
179
444
|
custom_fields?: any;
|
|
445
|
+
/**
|
|
446
|
+
* Snapshot image of the viewpoint. The longest dimension of should not exceed 1500 px,
|
|
447
|
+
* length or width.
|
|
448
|
+
*/
|
|
180
449
|
snapshot?: ISnapshot;
|
|
181
450
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@inweb/viewer-core",
|
|
3
|
-
"version": "25.8.
|
|
3
|
+
"version": "25.8.21",
|
|
4
4
|
"description": "3D CAD and BIM data Viewer core",
|
|
5
5
|
"homepage": "https://cloud.opendesign.com/docs/index.html",
|
|
6
6
|
"license": "SEE LICENSE IN LICENSE",
|
|
@@ -26,9 +26,9 @@
|
|
|
26
26
|
"test": "karma start karma.conf.js"
|
|
27
27
|
},
|
|
28
28
|
"devDependencies": {
|
|
29
|
-
"@inweb/eventemitter2": "~25.8.
|
|
29
|
+
"@inweb/eventemitter2": "~25.8.21"
|
|
30
30
|
},
|
|
31
31
|
"peerDependencies": {
|
|
32
|
-
"@inweb/eventemitter2": "~25.8.
|
|
32
|
+
"@inweb/eventemitter2": "~25.8.21"
|
|
33
33
|
}
|
|
34
34
|
}
|
package/src/viewer/IViewpoint.ts
CHANGED
|
@@ -22,140 +22,343 @@
|
|
|
22
22
|
///////////////////////////////////////////////////////////////////////////////
|
|
23
23
|
|
|
24
24
|
/**
|
|
25
|
-
*
|
|
26
|
-
*/
|
|
27
|
-
export interface ILocation {
|
|
28
|
-
x: number;
|
|
29
|
-
y: number;
|
|
30
|
-
z: number;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
/**
|
|
34
|
-
* BCF-style Direction of the Viewpoint
|
|
25
|
+
* Defines the 3D direction vector. Direction must not be a zero vector.
|
|
35
26
|
*/
|
|
36
27
|
export interface IDirection {
|
|
28
|
+
/**
|
|
29
|
+
* X direction.
|
|
30
|
+
*/
|
|
37
31
|
x: number;
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Y direction.
|
|
35
|
+
*/
|
|
38
36
|
y: number;
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Z direction.
|
|
40
|
+
*/
|
|
39
41
|
z: number;
|
|
40
42
|
}
|
|
41
43
|
|
|
42
44
|
/**
|
|
43
|
-
*
|
|
45
|
+
* Defines the 3D point.
|
|
44
46
|
*/
|
|
45
47
|
export interface IPoint {
|
|
48
|
+
/**
|
|
49
|
+
* X coordinate.
|
|
50
|
+
*/
|
|
46
51
|
x: number;
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* Y coordinate.
|
|
55
|
+
*/
|
|
47
56
|
y: number;
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* Z coordinate.
|
|
60
|
+
*/
|
|
48
61
|
z: number;
|
|
49
62
|
}
|
|
50
63
|
|
|
51
64
|
/**
|
|
52
|
-
*
|
|
65
|
+
* Defines the embedded picture in the viewpoint.
|
|
53
66
|
*/
|
|
54
67
|
export interface IBitmap {
|
|
68
|
+
/**
|
|
69
|
+
* GUID for identifying bitmap uniquely.
|
|
70
|
+
*/
|
|
55
71
|
guid: string;
|
|
56
|
-
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* Location of the center of the bitmap in world coordinates.
|
|
75
|
+
*/
|
|
76
|
+
location: IPoint;
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* Normal vector of the bitmap.
|
|
80
|
+
*/
|
|
57
81
|
normal: IDirection;
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* Up vector of the bitmap.
|
|
85
|
+
*/
|
|
58
86
|
up: IDirection;
|
|
87
|
+
|
|
88
|
+
/**
|
|
89
|
+
* Height of the bitmap in the model, in meters.
|
|
90
|
+
*/
|
|
59
91
|
height: number;
|
|
60
92
|
}
|
|
61
93
|
|
|
62
94
|
/**
|
|
63
|
-
*
|
|
95
|
+
* Describes a viewpoint using an orthogonal camera.
|
|
64
96
|
*/
|
|
65
97
|
export interface IOrthogonalCamera {
|
|
98
|
+
/**
|
|
99
|
+
* Camera location.
|
|
100
|
+
*/
|
|
66
101
|
view_point: IPoint;
|
|
102
|
+
|
|
103
|
+
/**
|
|
104
|
+
* Camera direction.
|
|
105
|
+
*/
|
|
67
106
|
direction: IDirection;
|
|
107
|
+
|
|
108
|
+
/**
|
|
109
|
+
* Camera up vector.
|
|
110
|
+
*/
|
|
68
111
|
up_vector: IDirection;
|
|
112
|
+
|
|
113
|
+
/**
|
|
114
|
+
* View field width to calculate aspect ratio.
|
|
115
|
+
*/
|
|
69
116
|
field_width: number;
|
|
117
|
+
|
|
118
|
+
/**
|
|
119
|
+
* View field height to calculate aspect ratio.
|
|
120
|
+
*/
|
|
70
121
|
field_height: number;
|
|
71
122
|
}
|
|
72
123
|
|
|
73
124
|
/**
|
|
74
|
-
*
|
|
125
|
+
* Defines the subsection of a model (clipping plane).
|
|
75
126
|
*/
|
|
76
127
|
export interface IClippingPlane {
|
|
77
|
-
|
|
128
|
+
/**
|
|
129
|
+
* Origin of the clipping plane.
|
|
130
|
+
*/
|
|
131
|
+
location: IPoint;
|
|
132
|
+
|
|
133
|
+
/**
|
|
134
|
+
* Direction of the clipping plane. The Direction vector points in the _invisible_ direction
|
|
135
|
+
* meaning the half-space that is clipped.
|
|
136
|
+
*/
|
|
78
137
|
direction: IDirection;
|
|
79
138
|
}
|
|
80
139
|
|
|
81
140
|
/**
|
|
82
|
-
*
|
|
141
|
+
* Describes a viewpoint using an perspective camera.
|
|
83
142
|
*/
|
|
84
143
|
export interface IPerspectiveCamera {
|
|
144
|
+
/**
|
|
145
|
+
* Camera location.
|
|
146
|
+
*/
|
|
85
147
|
view_point: IPoint;
|
|
148
|
+
|
|
149
|
+
/**
|
|
150
|
+
* Camera direction.
|
|
151
|
+
*/
|
|
86
152
|
direction: IDirection;
|
|
153
|
+
|
|
154
|
+
/**
|
|
155
|
+
* Camera up vector.
|
|
156
|
+
*/
|
|
87
157
|
up_vector: IDirection;
|
|
158
|
+
|
|
159
|
+
/**
|
|
160
|
+
* The entire vertical field of view angle of the camera, expressed in degrees. Valid range 0
|
|
161
|
+
* to 180 exclusive.
|
|
162
|
+
*/
|
|
88
163
|
field_of_view: number;
|
|
89
164
|
}
|
|
90
165
|
|
|
91
166
|
/**
|
|
92
|
-
*
|
|
167
|
+
* Defines the markup line object of the viewpoint.
|
|
93
168
|
*/
|
|
94
169
|
export interface ILine {
|
|
170
|
+
/**
|
|
171
|
+
* Array of line points.
|
|
172
|
+
*/
|
|
95
173
|
points: IPoint[];
|
|
174
|
+
|
|
175
|
+
/**
|
|
176
|
+
* Line type. Can be `solid`, `dot` or `dash`.
|
|
177
|
+
*
|
|
178
|
+
* @default "solid"
|
|
179
|
+
*/
|
|
96
180
|
type?: string;
|
|
181
|
+
|
|
182
|
+
/**
|
|
183
|
+
* Line width.
|
|
184
|
+
*/
|
|
97
185
|
width?: number;
|
|
186
|
+
|
|
187
|
+
/**
|
|
188
|
+
* Line color in hexadecimal color syntax `#RGB` using its primary color components (red,
|
|
189
|
+
* green, blue) written as hexadecimal numbers.
|
|
190
|
+
*/
|
|
98
191
|
color?: string;
|
|
192
|
+
|
|
193
|
+
/**
|
|
194
|
+
* Internal markup object identifier.
|
|
195
|
+
*/
|
|
99
196
|
id?: string;
|
|
100
197
|
}
|
|
101
198
|
|
|
102
199
|
/**
|
|
103
|
-
*
|
|
200
|
+
* Defines the markup text object of the viewpoint.
|
|
104
201
|
*/
|
|
105
202
|
export interface IText {
|
|
203
|
+
/**
|
|
204
|
+
* Coordinates of the top-left point (position) of the text.
|
|
205
|
+
*/
|
|
106
206
|
position: IPoint;
|
|
207
|
+
|
|
208
|
+
/**
|
|
209
|
+
* Text string.
|
|
210
|
+
*/
|
|
107
211
|
text: string;
|
|
212
|
+
|
|
213
|
+
/**
|
|
214
|
+
* Text rotation angle of the object, in degress.
|
|
215
|
+
*/
|
|
108
216
|
angle?: number;
|
|
217
|
+
|
|
218
|
+
/**
|
|
219
|
+
* Font size of the text.
|
|
220
|
+
*/
|
|
109
221
|
font_size?: number;
|
|
222
|
+
|
|
223
|
+
/**
|
|
224
|
+
* Deprecated. Use {@link font_size} instead.
|
|
225
|
+
*/
|
|
226
|
+
|
|
110
227
|
text_size?: number;
|
|
228
|
+
|
|
229
|
+
/**
|
|
230
|
+
* Text color in hexadecimal color syntax `#RGB` using its primary color components (red,
|
|
231
|
+
* green, blue) written as hexadecimal numbers.
|
|
232
|
+
*/
|
|
111
233
|
color?: string;
|
|
234
|
+
|
|
235
|
+
/**
|
|
236
|
+
* Internal markup object identifier.
|
|
237
|
+
*/
|
|
112
238
|
id?: string;
|
|
113
239
|
}
|
|
114
240
|
|
|
115
241
|
/**
|
|
116
|
-
*
|
|
242
|
+
* Defines the markup arrow object of the viewpoint.
|
|
117
243
|
*/
|
|
118
244
|
export interface IArrow {
|
|
245
|
+
/**
|
|
246
|
+
* Coordinales of the start point of arrow.
|
|
247
|
+
*/
|
|
119
248
|
start: IPoint;
|
|
249
|
+
|
|
250
|
+
/**
|
|
251
|
+
* Coordinales of the end point of arrow.
|
|
252
|
+
*/
|
|
120
253
|
end: IPoint;
|
|
254
|
+
|
|
255
|
+
/**
|
|
256
|
+
* Line color in hexadecimal color syntax `#RGB` using its primary color components (red,
|
|
257
|
+
* green, blue) written as hexadecimal numbers.
|
|
258
|
+
*/
|
|
121
259
|
color?: string;
|
|
260
|
+
|
|
261
|
+
/**
|
|
262
|
+
* Internal markup object identifier.
|
|
263
|
+
*/
|
|
122
264
|
id?: string;
|
|
123
265
|
}
|
|
124
266
|
|
|
125
267
|
/**
|
|
126
|
-
*
|
|
268
|
+
* Defines the markup cloud object of the viewpoint.
|
|
127
269
|
*/
|
|
128
270
|
export interface ICloud {
|
|
271
|
+
/**
|
|
272
|
+
* Coordinates of the top-left point (position) of the cloud.
|
|
273
|
+
*/
|
|
129
274
|
position: IPoint;
|
|
275
|
+
|
|
276
|
+
/**
|
|
277
|
+
* Width of the cloud.
|
|
278
|
+
*/
|
|
130
279
|
width?: number;
|
|
280
|
+
|
|
281
|
+
/**
|
|
282
|
+
* Height of the cloud.
|
|
283
|
+
*/
|
|
131
284
|
height?: number;
|
|
285
|
+
|
|
286
|
+
/**
|
|
287
|
+
* Line width of the cloud.
|
|
288
|
+
*/
|
|
132
289
|
line_width?: number;
|
|
290
|
+
|
|
291
|
+
/**
|
|
292
|
+
* Line color in hexadecimal color syntax `#RGB` using its primary color components (red,
|
|
293
|
+
* green, blue) written as hexadecimal numbers.
|
|
294
|
+
*/
|
|
133
295
|
color?: string;
|
|
296
|
+
|
|
297
|
+
/**
|
|
298
|
+
* Internal markup object identifier.
|
|
299
|
+
*/
|
|
134
300
|
id?: string;
|
|
135
301
|
}
|
|
136
302
|
|
|
137
303
|
/**
|
|
138
|
-
*
|
|
304
|
+
* Defines the markup ellipse object of the viewpoint.
|
|
139
305
|
*/
|
|
140
306
|
export interface IEllipse {
|
|
307
|
+
/**
|
|
308
|
+
* Coordinates of the center point (position) of the ellipse.
|
|
309
|
+
*/
|
|
141
310
|
position: IPoint;
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
311
|
+
|
|
312
|
+
/**
|
|
313
|
+
* Ellipse radius along the X and Y axes.
|
|
314
|
+
*/
|
|
315
|
+
radius: { x: number; y: number };
|
|
316
|
+
|
|
317
|
+
/**
|
|
318
|
+
* Line width of the ellipse.
|
|
319
|
+
*/
|
|
146
320
|
line_width?: number;
|
|
321
|
+
|
|
322
|
+
/**
|
|
323
|
+
* Line color in hexadecimal color syntax `#RGB` using its primary color components (red,
|
|
324
|
+
* green, blue) written as hexadecimal numbers.
|
|
325
|
+
*/
|
|
147
326
|
color?: string;
|
|
327
|
+
|
|
328
|
+
/**
|
|
329
|
+
* Internal markup object identifier.
|
|
330
|
+
*/
|
|
148
331
|
id?: string;
|
|
149
332
|
}
|
|
150
333
|
|
|
151
334
|
/**
|
|
152
|
-
*
|
|
335
|
+
* Defines the markup image object of the viewpoint.
|
|
153
336
|
*/
|
|
154
337
|
export interface IImage {
|
|
338
|
+
/**
|
|
339
|
+
* Coordinates of the top-left point (position) of the image.
|
|
340
|
+
*/
|
|
155
341
|
position: IPoint;
|
|
342
|
+
|
|
343
|
+
/**
|
|
344
|
+
* Image source as base64-encoded
|
|
345
|
+
* {@link https://developer.mozilla.org/docs/Web/HTTP/Basics_of_HTTP/Data_URIs | Data URL}.
|
|
346
|
+
*/
|
|
156
347
|
src: string;
|
|
157
|
-
|
|
158
|
-
|
|
348
|
+
|
|
349
|
+
/**
|
|
350
|
+
* Width of the image.
|
|
351
|
+
*/
|
|
352
|
+
width?: number;
|
|
353
|
+
|
|
354
|
+
/**
|
|
355
|
+
* Height of the image.
|
|
356
|
+
*/
|
|
357
|
+
height?: number;
|
|
358
|
+
|
|
359
|
+
/**
|
|
360
|
+
* Internal markup object identifier.
|
|
361
|
+
*/
|
|
159
362
|
id?: string;
|
|
160
363
|
}
|
|
161
364
|
|
|
@@ -163,59 +366,190 @@ export interface IImage {
|
|
|
163
366
|
* Rectangle markup object of the Viewpoint
|
|
164
367
|
*/
|
|
165
368
|
export interface IRectangle {
|
|
369
|
+
/**
|
|
370
|
+
* Coordinates of the top-left point (position) of the rectangle.
|
|
371
|
+
*/
|
|
166
372
|
position: IPoint;
|
|
373
|
+
|
|
374
|
+
/**
|
|
375
|
+
* Width of the rectangle.
|
|
376
|
+
*/
|
|
167
377
|
width?: number;
|
|
378
|
+
|
|
379
|
+
/**
|
|
380
|
+
* Height of the rectangle.
|
|
381
|
+
*/
|
|
168
382
|
height?: number;
|
|
383
|
+
|
|
384
|
+
/**
|
|
385
|
+
* Line width of the rectangle.
|
|
386
|
+
*/
|
|
169
387
|
line_width?: number;
|
|
388
|
+
|
|
389
|
+
/**
|
|
390
|
+
* Line color in hexadecimal color syntax `#RGB` using its primary color components (red,
|
|
391
|
+
* green, blue) written as hexadecimal numbers.
|
|
392
|
+
*/
|
|
170
393
|
color?: string;
|
|
394
|
+
|
|
395
|
+
/**
|
|
396
|
+
* Internal markup object identifier.
|
|
397
|
+
*/
|
|
171
398
|
id?: string;
|
|
172
399
|
}
|
|
173
400
|
|
|
174
401
|
/**
|
|
175
|
-
*
|
|
402
|
+
* Defines the viewpoint colored components.
|
|
176
403
|
*/
|
|
177
404
|
export interface IColoring {
|
|
405
|
+
/**
|
|
406
|
+
* Component original handle in the model.
|
|
407
|
+
*/
|
|
178
408
|
handle: string;
|
|
409
|
+
|
|
410
|
+
/**
|
|
411
|
+
* Color in hexadecimal color syntax `#ARGB` using its primary color components (alpha, red,
|
|
412
|
+
* green, blue) written as hexadecimal numbers.
|
|
413
|
+
*/
|
|
179
414
|
color: string;
|
|
180
415
|
}
|
|
181
416
|
|
|
182
417
|
/**
|
|
183
|
-
*
|
|
418
|
+
* Defines the component in the model.
|
|
184
419
|
*/
|
|
185
|
-
export interface
|
|
420
|
+
export interface IComponent {
|
|
421
|
+
/**
|
|
422
|
+
* Component original handle in the model.
|
|
423
|
+
*/
|
|
186
424
|
handle: string;
|
|
187
425
|
}
|
|
188
426
|
|
|
189
427
|
/**
|
|
190
|
-
*
|
|
428
|
+
* Defines the viewpoint shapshot.
|
|
191
429
|
*/
|
|
192
430
|
export interface ISnapshot {
|
|
431
|
+
/**
|
|
432
|
+
* Snapshot image data as base64-encoded
|
|
433
|
+
* {@link https://developer.mozilla.org/docs/Web/HTTP/Basics_of_HTTP/Data_URIs | Data URL}.
|
|
434
|
+
*/
|
|
193
435
|
data: string;
|
|
194
436
|
}
|
|
195
437
|
|
|
196
438
|
/**
|
|
197
|
-
*
|
|
439
|
+
* Defines the model viewpoint with markup.
|
|
440
|
+
*
|
|
441
|
+
* This viewpoint is {@link https://github.com/buildingSMART/BCF-API | BCF-compatible}.
|
|
442
|
+
*
|
|
443
|
+
* Optional/mandatory fields clarification:
|
|
444
|
+
*
|
|
445
|
+
* - A viewpoint must contain a _camera definition_.
|
|
446
|
+
* - _Camera definition_ is exactly one of `perspective_camera` or `orthogonal_camera`.
|
|
198
447
|
*/
|
|
199
448
|
export interface IViewpoint {
|
|
449
|
+
/**
|
|
450
|
+
* Embedded pictures in the viewpoint. A list of bitmaps can be used to add more information,
|
|
451
|
+
* for example, text in the visualization.
|
|
452
|
+
*/
|
|
200
453
|
bitmaps?: IBitmap[];
|
|
454
|
+
|
|
455
|
+
/**
|
|
456
|
+
* GUID for identifying viewpoint uniquely.
|
|
457
|
+
*/
|
|
201
458
|
guid?: string;
|
|
459
|
+
|
|
460
|
+
/**
|
|
461
|
+
* Identifier of the file for which the viewpoint was created.
|
|
462
|
+
*/
|
|
202
463
|
file_id?: string;
|
|
464
|
+
|
|
465
|
+
/**
|
|
466
|
+
* Identifier of the assembly for which the viewpoint was created.
|
|
467
|
+
*/
|
|
203
468
|
assembly_id?: string;
|
|
469
|
+
|
|
470
|
+
/**
|
|
471
|
+
* Orthogonal camera view.
|
|
472
|
+
*/
|
|
204
473
|
orthogonal_camera?: IOrthogonalCamera;
|
|
474
|
+
|
|
475
|
+
/**
|
|
476
|
+
* Perspective view of the camera.
|
|
477
|
+
*/
|
|
205
478
|
perspective_camera?: IPerspectiveCamera;
|
|
479
|
+
|
|
480
|
+
/**
|
|
481
|
+
* Viewpoint description.
|
|
482
|
+
*/
|
|
206
483
|
description?: string;
|
|
484
|
+
|
|
485
|
+
/**
|
|
486
|
+
* Viewpoint index (sort order).
|
|
487
|
+
*/
|
|
207
488
|
index?: number;
|
|
489
|
+
|
|
490
|
+
/**
|
|
491
|
+
* List of markup Line objects.
|
|
492
|
+
*/
|
|
208
493
|
lines?: ILine[];
|
|
494
|
+
|
|
495
|
+
/**
|
|
496
|
+
* List of markup Texts objects.
|
|
497
|
+
*/
|
|
209
498
|
texts?: IText[];
|
|
499
|
+
|
|
500
|
+
/**
|
|
501
|
+
* Clipping planes for the model view.
|
|
502
|
+
*/
|
|
210
503
|
clipping_planes?: IClippingPlane[];
|
|
211
|
-
|
|
212
|
-
|
|
504
|
+
|
|
505
|
+
/**
|
|
506
|
+
* Selected components.
|
|
507
|
+
*/
|
|
508
|
+
selection?: IComponent[];
|
|
509
|
+
|
|
510
|
+
/**
|
|
511
|
+
* Visibility of components.
|
|
512
|
+
*/
|
|
513
|
+
visibility?: IComponent[];
|
|
514
|
+
|
|
515
|
+
/**
|
|
516
|
+
* Colored components.
|
|
517
|
+
*/
|
|
213
518
|
coloring?: IColoring[];
|
|
519
|
+
|
|
520
|
+
/**
|
|
521
|
+
* List of markup Arrow objects.
|
|
522
|
+
*/
|
|
214
523
|
arrows?: IArrow[];
|
|
524
|
+
|
|
525
|
+
/**
|
|
526
|
+
* List of markup Cloud objects.
|
|
527
|
+
*/
|
|
215
528
|
clouds?: ICloud[];
|
|
529
|
+
|
|
530
|
+
/**
|
|
531
|
+
* List of markup Ellipse objects.
|
|
532
|
+
*/
|
|
216
533
|
ellipses?: IEllipse[];
|
|
534
|
+
|
|
535
|
+
/**
|
|
536
|
+
* List of markup Image objects.
|
|
537
|
+
*/
|
|
217
538
|
images?: IImage[];
|
|
539
|
+
|
|
540
|
+
/**
|
|
541
|
+
* List of markup Rectangle objects.
|
|
542
|
+
*/
|
|
218
543
|
rectangles?: IRectangle[];
|
|
544
|
+
|
|
545
|
+
/**
|
|
546
|
+
* Viewpoint custom fields object, to store custom data.
|
|
547
|
+
*/
|
|
219
548
|
custom_fields?: any;
|
|
549
|
+
|
|
550
|
+
/**
|
|
551
|
+
* Snapshot image of the viewpoint. The longest dimension of should not exceed 1500 px,
|
|
552
|
+
* length or width.
|
|
553
|
+
*/
|
|
220
554
|
snapshot?: ISnapshot;
|
|
221
555
|
}
|