@pilotdev/pilot-web-3d 23.0.6-alpha.2 → 23.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/index.d.ts +966 -738
- package/package.json +1 -1
package/index.d.ts
CHANGED
|
@@ -1,215 +1,5 @@
|
|
|
1
1
|
/// <reference types="@types/three" />
|
|
2
2
|
declare namespace PilotWeb3D {
|
|
3
|
-
export class InitializerOptions {
|
|
4
|
-
libList?: string[];
|
|
5
|
-
language?: string;
|
|
6
|
-
}
|
|
7
|
-
export class Localization {
|
|
8
|
-
static initialize(options: any): Promise<void>;
|
|
9
|
-
static translate(stringToTrans: string): string;
|
|
10
|
-
static setLanguage(language: string): Promise<void>;
|
|
11
|
-
static extendLocalization(locales: any): boolean;
|
|
12
|
-
}
|
|
13
|
-
export class LoadingSpinner {
|
|
14
|
-
addToDOM(container: HTMLElement): void;
|
|
15
|
-
removeFromDOM(container: HTMLElement): void;
|
|
16
|
-
}
|
|
17
|
-
export class ExtensionManager {
|
|
18
|
-
registerExtensionType(extensionId: string, extension: typeof ExtensionBase): boolean;
|
|
19
|
-
unregisterExtensionType(extensionId: string): boolean;
|
|
20
|
-
getExtensionType(extensionId: string): typeof ExtensionBase;
|
|
21
|
-
}
|
|
22
|
-
export const theExtensionManager: ExtensionManager;
|
|
23
|
-
export class ExtensionLoader {
|
|
24
|
-
loadExtension(extensionId: string): Promise<ExtensionBase>;
|
|
25
|
-
unloadExtension(extensionId: string): Promise<boolean>;
|
|
26
|
-
getExtensions(): string[];
|
|
27
|
-
}
|
|
28
|
-
export interface ILayerManager {
|
|
29
|
-
createLayer(name: string): ILayer;
|
|
30
|
-
deleteLayer(name: string): boolean;
|
|
31
|
-
getLayer(name: string): ILayer | null;
|
|
32
|
-
hasLayer(name: string): boolean;
|
|
33
|
-
}
|
|
34
|
-
export interface ILayer {
|
|
35
|
-
addOverlay(overlay: Overlay): boolean;
|
|
36
|
-
removeOverlay(overlay: Overlay): boolean;
|
|
37
|
-
getOverlays(): Overlay[];
|
|
38
|
-
getContainer(): LayerContainer;
|
|
39
|
-
getViewBox(): LayerViewBox;
|
|
40
|
-
dispose(): void;
|
|
41
|
-
}
|
|
42
|
-
export type Overlay = HTMLElement | any;
|
|
43
|
-
export type LayerContainer = HTMLElement | any;
|
|
44
|
-
export type LayerViewBox = DOMRect | any;
|
|
45
|
-
export interface IEventsDispatcher {
|
|
46
|
-
addEventListener(event: string, listener: EventListener, options?: object): void;
|
|
47
|
-
removeEventListener(event: string, listener: EventListener): void;
|
|
48
|
-
hasEventListener(event: string, listener: EventListener): boolean;
|
|
49
|
-
dispatchEvent(event: string | Event): void;
|
|
50
|
-
dispatchEventAsync(event: string | Event): void;
|
|
51
|
-
clearListeners(): void;
|
|
52
|
-
}
|
|
53
|
-
export class CoreEventTypes {
|
|
54
|
-
static VIEWER_RESIZE_EVENT: string;
|
|
55
|
-
static VIEWER_MOUSE_DOWN_EVENT: string;
|
|
56
|
-
static VIEWER_MOUSE_MOVE_EVENT: string;
|
|
57
|
-
static VIEWER_MOUSE_UP_EVENT: string;
|
|
58
|
-
static VIEWER_MOUSE_LONG_TOUCH_EVENT: string;
|
|
59
|
-
static SETTING_CHANGED_EVENT: string;
|
|
60
|
-
static SETTING_RESET_EVENT: string;
|
|
61
|
-
}
|
|
62
|
-
export interface ISettingsStorage {
|
|
63
|
-
clear(): void;
|
|
64
|
-
getItem<T>(key: string): T | null;
|
|
65
|
-
removeItem(key: string): void;
|
|
66
|
-
setItem<T>(key: string, value: T): void;
|
|
67
|
-
getKeys(): string[];
|
|
68
|
-
}
|
|
69
|
-
export class SettingsStorageFactory {
|
|
70
|
-
getSettingsStorage(): ISettingsStorage;
|
|
71
|
-
}
|
|
72
|
-
export class LocalSettingsStorage implements ISettingsStorage {
|
|
73
|
-
clear(): void;
|
|
74
|
-
getItem<T>(key: string): T | null;
|
|
75
|
-
removeItem(key: string): void;
|
|
76
|
-
setItem<T>(key: string, value: T): void;
|
|
77
|
-
getKeys(): string[];
|
|
78
|
-
}
|
|
79
|
-
export class InMemorySettingsStorage implements ISettingsStorage {
|
|
80
|
-
clear(): void;
|
|
81
|
-
getItem<T>(key: string): T | null;
|
|
82
|
-
removeItem(key: string): void;
|
|
83
|
-
setItem<T>(key: string, value: T): void;
|
|
84
|
-
getKeys(): string[];
|
|
85
|
-
}
|
|
86
|
-
export interface ISettings {
|
|
87
|
-
changeSetting<T>(name: string, value: T, notify?: boolean, providedData?: any): void;
|
|
88
|
-
getSettingValue<T>(name: string): T;
|
|
89
|
-
}
|
|
90
|
-
export class BaseSettingsNames {
|
|
91
|
-
static TOOLBAR: string;
|
|
92
|
-
static TOOLBAR_DIRECTION: string;
|
|
93
|
-
static TOOLBAR_CONTENT: string;
|
|
94
|
-
static THEME: string;
|
|
95
|
-
}
|
|
96
|
-
export class SettingChangedEvent extends Event {
|
|
97
|
-
name: string;
|
|
98
|
-
oldValue: any;
|
|
99
|
-
newValue: any;
|
|
100
|
-
providedData: any;
|
|
101
|
-
}
|
|
102
|
-
export abstract class SettingsBase implements ISettings {
|
|
103
|
-
protected _eventDispatcher: IEventsDispatcher;
|
|
104
|
-
protected _storage: ISettingsStorage;
|
|
105
|
-
changeSetting<T>(name: string, value: T, notify?: boolean, providedData?: any): void;
|
|
106
|
-
getSettingValue<T>(name: string): T;
|
|
107
|
-
protected abstract getKeyWithPrefix(key: string): string;
|
|
108
|
-
}
|
|
109
|
-
export enum SettingsTheme {
|
|
110
|
-
LIGHT_THEME = "ascn-light",
|
|
111
|
-
DARK_THEME = "ascn-dark"
|
|
112
|
-
}
|
|
113
|
-
export const defaultThemeAppearance: string;
|
|
114
|
-
export enum ToolbarDirection {
|
|
115
|
-
TOP_FIXED = "ascn-toolbar-direction-fixed-top",
|
|
116
|
-
TOP_FLUENT = "ascn-toolbar-direction-top",
|
|
117
|
-
BOTTOM_FIXED = "ascn-toolbar-direction-fixed-bottom",
|
|
118
|
-
BOTTOM_FLUENT = "ascn-toolbar-direction-bottom"
|
|
119
|
-
}
|
|
120
|
-
export enum ToolbarContent {
|
|
121
|
-
CENTER = "ascn-toolbar-content-center",
|
|
122
|
-
START = "ascn-toolbar-content-start",
|
|
123
|
-
END = "ascn-toolbar-content-end"
|
|
124
|
-
}
|
|
125
|
-
export interface ToolbarOptions {
|
|
126
|
-
height: number;
|
|
127
|
-
direction: ToolbarDirection;
|
|
128
|
-
}
|
|
129
|
-
export interface ToolbarStyle {
|
|
130
|
-
direction?: ToolbarDirection;
|
|
131
|
-
content?: ToolbarContent;
|
|
132
|
-
}
|
|
133
|
-
export const defaultToolbarAppearance: ToolbarStyle;
|
|
134
|
-
export type ViewerSettings = Record<string, any>;
|
|
135
|
-
export class ViewerConfiguration {
|
|
136
|
-
settingsPrefix: string;
|
|
137
|
-
appearance: ViewerSettings;
|
|
138
|
-
createConfiguration(configuration: ViewerSettings, origin: ViewerSettings): void;
|
|
139
|
-
changeTheme(newTheme: string): void;
|
|
140
|
-
}
|
|
141
|
-
export type ErrorCallback = (message: string) => void;
|
|
142
|
-
export type SuccessCallback = (modelId: any) => void;
|
|
143
|
-
export enum DocumentType {
|
|
144
|
-
UNKNOWN = 0,
|
|
145
|
-
DOCUMENT_2D = 1,
|
|
146
|
-
DOCUMENT_3D = 2
|
|
147
|
-
}
|
|
148
|
-
export const defaultBaseSettings: ViewerConfiguration;
|
|
149
|
-
export abstract class ViewerBase {
|
|
150
|
-
protected _clientContainer: HTMLElement;
|
|
151
|
-
protected _loadingSpinner: LoadingSpinner;
|
|
152
|
-
protected _documentType: DocumentType;
|
|
153
|
-
protected _configuration: ViewerConfiguration;
|
|
154
|
-
readonly container: HTMLElement;
|
|
155
|
-
readonly layerManagers: Map<number, ILayerManager>;
|
|
156
|
-
readonly extensionsLoader: ExtensionLoader;
|
|
157
|
-
abstract settings: ISettings;
|
|
158
|
-
abstract events: IEventsDispatcher;
|
|
159
|
-
get rootContainer(): HTMLElement;
|
|
160
|
-
getConfiguration(): ViewerConfiguration;
|
|
161
|
-
/**
|
|
162
|
-
*
|
|
163
|
-
* @returns
|
|
164
|
-
*/
|
|
165
|
-
start(): Promise<number>;
|
|
166
|
-
/**
|
|
167
|
-
*
|
|
168
|
-
*/
|
|
169
|
-
finish(): void;
|
|
170
|
-
onPostExtensionLoad(extension: ExtensionBase): void;
|
|
171
|
-
protected loadExtensions(): void;
|
|
172
|
-
protected setThemeFromSettings(): void;
|
|
173
|
-
}
|
|
174
|
-
export class Control {
|
|
175
|
-
container: HTMLElement;
|
|
176
|
-
|
|
177
|
-
constructor(id: string);
|
|
178
|
-
addClass(cssClass: string): void;
|
|
179
|
-
removeClass(cssClass: string): void;
|
|
180
|
-
getId(): string;
|
|
181
|
-
setToolTip(tooltipText: string): void;
|
|
182
|
-
}
|
|
183
|
-
export class Toolbar extends Control {
|
|
184
|
-
|
|
185
|
-
constructor(id: string, toolbarContainer: HTMLElement, options?: ToolbarStyle);
|
|
186
|
-
addControl(control: Control): void;
|
|
187
|
-
removeControl(id: string): void;
|
|
188
|
-
changeToolbarPosition(direction: string): void;
|
|
189
|
-
changeToolbarContent(content: string): void;
|
|
190
|
-
}
|
|
191
|
-
export class ExtensionBase {
|
|
192
|
-
protected _viewer: ViewerBase;
|
|
193
|
-
|
|
194
|
-
constructor(viewer3D: ViewerBase, options?: any);
|
|
195
|
-
load(): boolean | Promise<boolean>;
|
|
196
|
-
unload(): boolean;
|
|
197
|
-
activate(): boolean;
|
|
198
|
-
deactivate(): boolean;
|
|
199
|
-
/**
|
|
200
|
-
* Gets the name of the extension.
|
|
201
|
-
* @returns {string} Returns the name of the extension.
|
|
202
|
-
*/
|
|
203
|
-
getName(): string;
|
|
204
|
-
onMouseDown(event: MouseEvent): void;
|
|
205
|
-
onMouseMove(event: MouseEvent): void;
|
|
206
|
-
onMouseUp(event: MouseEvent): void;
|
|
207
|
-
onMouseLongTouch(event: MouseEvent): void;
|
|
208
|
-
onToolbarCreated(toolbar: Toolbar): void;
|
|
209
|
-
protected bindDomEvents(): void;
|
|
210
|
-
}
|
|
211
|
-
export class ViewerToolbar extends Toolbar {
|
|
212
|
-
}
|
|
213
3
|
export enum UpdateType {
|
|
214
4
|
/**No changes */
|
|
215
5
|
None = 0,
|
|
@@ -258,12 +48,18 @@ export abstract class ViewObject extends THREE.Object3D {
|
|
|
258
48
|
protected _isVisible: boolean;
|
|
259
49
|
protected _isHidden: boolean;
|
|
260
50
|
protected _originalColor: Color;
|
|
261
|
-
/**
|
|
51
|
+
/**
|
|
52
|
+
* model element entity guid
|
|
53
|
+
* @default zeroGuid
|
|
54
|
+
*/
|
|
262
55
|
readonly entityGuid: string;
|
|
263
|
-
/**
|
|
56
|
+
/**
|
|
57
|
+
* model part guid
|
|
58
|
+
* @default zeroGuid
|
|
59
|
+
*/
|
|
264
60
|
readonly modelGuid: string;
|
|
265
61
|
|
|
266
|
-
constructor(entityGuid
|
|
62
|
+
constructor(entityGuid?: string, modelGuid?: string, color?: Color);
|
|
267
63
|
/**Mesh representation of the object */
|
|
268
64
|
abstract get mesh(): THREE.Mesh | null;
|
|
269
65
|
/**Edge representation of the object */
|
|
@@ -319,6 +115,12 @@ export abstract class ViewObject extends THREE.Object3D {
|
|
|
319
115
|
*/
|
|
320
116
|
protected riseOnUpdated(updateType?: UpdateType, object?: THREE.Object3D): void;
|
|
321
117
|
}
|
|
118
|
+
export class ModelElementIds {
|
|
119
|
+
|
|
120
|
+
constructor(ids: string[], modelImplId: string);
|
|
121
|
+
modelPartId: string;
|
|
122
|
+
elementIds: string[];
|
|
123
|
+
}
|
|
322
124
|
export abstract class CustomMaterial extends THREE.ShaderMaterial {
|
|
323
125
|
|
|
324
126
|
constructor();
|
|
@@ -575,6 +377,39 @@ export class CustomPointMaterial extends CustomMaterial {
|
|
|
575
377
|
protected onBeforeRender(renderer: THREE.WebGLRenderer, scene: THREE.Scene, camera: THREE.Camera, geometry: THREE.BufferGeometry, material: THREE.Material, group: THREE.Group): void;
|
|
576
378
|
copy(source: CustomPointMaterial): this;
|
|
577
379
|
}
|
|
380
|
+
export namespace Viewer3DIcons {
|
|
381
|
+
const VIEWER_SETTINGS_ICON: string;
|
|
382
|
+
const VIEWER_MODEL_BROWSER_ICON: string;
|
|
383
|
+
const VIEWER_FULL_SCREEN_ICON: string;
|
|
384
|
+
const VIEWER_COLLAPSE_ICON: string;
|
|
385
|
+
const VIEWER_ELEMENT_PROPERTIES_ICON: string;
|
|
386
|
+
const VIEWER_ADD_CLIPPING_PLANE_ICON: string;
|
|
387
|
+
const VIEWER_CLIPPING_FLIP_ICON: string;
|
|
388
|
+
const VIEWER_DELETE_CLIPPING_PLANE_ICON: string;
|
|
389
|
+
const VIEWER_CLIPPING_CUBE_ICON: string;
|
|
390
|
+
const VIEWER_ADD_REMARK_ICON: string;
|
|
391
|
+
const VIEWER_MEASUREMENT_EDGE_ICON: string;
|
|
392
|
+
const VIEWER_MEASUREMENT_PLANE_ICON: string;
|
|
393
|
+
const VIEWER_MEASUREMENT_DIMENSION_ICON: string;
|
|
394
|
+
}
|
|
395
|
+
export namespace ViewerGeneralIcons {
|
|
396
|
+
const CLOSE: string;
|
|
397
|
+
const STRETCH_WINDOW: string;
|
|
398
|
+
const EXPAND_TREE: string;
|
|
399
|
+
const COLLAPSE_TREE: string;
|
|
400
|
+
const ARROW_DROP_DOWN: string;
|
|
401
|
+
const ARROW_DROP_RIGHT: string;
|
|
402
|
+
const CIRCLE_ICON: string;
|
|
403
|
+
const SHOW: string;
|
|
404
|
+
const HIDE: string;
|
|
405
|
+
const TRASH: string;
|
|
406
|
+
const ARROW_DR: string;
|
|
407
|
+
}
|
|
408
|
+
export namespace Viewer2DIcons {
|
|
409
|
+
const REMARK_CIRCLE_ICON: string;
|
|
410
|
+
const ZOOM_IN: string;
|
|
411
|
+
const ZOOM_OUT: string;
|
|
412
|
+
}
|
|
578
413
|
export class MeshLineGeometry extends THREE.InstancedBufferGeometry {
|
|
579
414
|
type: string;
|
|
580
415
|
instanceStart: THREE.BufferAttribute;
|
|
@@ -585,7 +420,7 @@ export class MeshLineGeometry extends THREE.InstancedBufferGeometry {
|
|
|
585
420
|
constructor();
|
|
586
421
|
applyMatrix4(matrix: THREE.Matrix4): this;
|
|
587
422
|
updatePoint(index: number, point: THREE.Vector3): void;
|
|
588
|
-
updateColor(index: number, color:
|
|
423
|
+
updateColor(index: number, color: Color): void;
|
|
589
424
|
setPoints(points: THREE.Vector3[]): this;
|
|
590
425
|
setPositions(array: ArrayLike<number>): this;
|
|
591
426
|
setColors(array: ArrayLike<number>): this;
|
|
@@ -608,52 +443,147 @@ export class MeshLine extends THREE.Mesh {
|
|
|
608
443
|
raycast(raycaster: THREE.Raycaster, intersects: THREE.Intersection[]): void;
|
|
609
444
|
}
|
|
610
445
|
export class TPair<TKey, TValue> {
|
|
446
|
+
|
|
447
|
+
constructor(key: TKey, value: TValue);
|
|
611
448
|
get key(): TKey;
|
|
612
449
|
get value(): TValue;
|
|
613
450
|
}
|
|
614
|
-
export
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
451
|
+
export interface IEventsDispatcher {
|
|
452
|
+
addEventListener(event: string, listener: EventListener, options?: object): void;
|
|
453
|
+
removeEventListener(event: string, listener: EventListener): void;
|
|
454
|
+
hasEventListener(event: string, listener: EventListener): boolean;
|
|
455
|
+
dispatchEvent(event: string | Event): void;
|
|
456
|
+
dispatchEventAsync(event: string | Event): void;
|
|
457
|
+
clearListeners(): void;
|
|
458
|
+
}
|
|
459
|
+
export class EventsDispatcherCore implements IEventsDispatcher {
|
|
460
|
+
dispatchEventAsync(event: string | Event): void;
|
|
461
|
+
hasEventListener(type: string, listener: EventListener): boolean;
|
|
462
|
+
dispatchEvent(event: string | Event): void;
|
|
463
|
+
addEventListener(type: string, listener: EventListener, options?: object): void;
|
|
464
|
+
removeEventListener(type: string, listener: EventListener): void;
|
|
465
|
+
removeEvent(type: string): void;
|
|
466
|
+
clearListeners(): void;
|
|
467
|
+
}
|
|
468
|
+
export const MouseButtons: {
|
|
469
|
+
Left: number;
|
|
470
|
+
Middle: number;
|
|
471
|
+
Right: number;
|
|
634
472
|
};
|
|
635
|
-
export
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
473
|
+
export class RenderEventTypes {
|
|
474
|
+
static SELECTION_CHANGED_EVENT: string;
|
|
475
|
+
static SELECTION_RESET_EVENT: string;
|
|
476
|
+
static CAMERA_CHANGED_EVENT: string;
|
|
477
|
+
static CAMERA_NAVIGATION_MODE_CHANGED_EVENT: string;
|
|
478
|
+
static RENDER_CLICK_EVENT: string;
|
|
479
|
+
static RENDER_HOVER_EVENT: string;
|
|
480
|
+
static RENDER_DOUBLE_CLICK_EVENT: string;
|
|
641
481
|
}
|
|
642
|
-
export
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
482
|
+
export class SelectionChangedEvent extends Event {
|
|
483
|
+
selectedIds: ModelElementIds[];
|
|
484
|
+
|
|
485
|
+
constructor(type: string, selectedIds?: ModelElementIds[]);
|
|
486
|
+
}
|
|
487
|
+
export class ClickedEvent extends Event {
|
|
488
|
+
modelId: string;
|
|
489
|
+
modelElementId: string;
|
|
490
|
+
ctrlKey: boolean;
|
|
491
|
+
|
|
492
|
+
constructor(type: string, modelId: string, modelElementId: string, ctrlKey: boolean);
|
|
493
|
+
}
|
|
494
|
+
export class HoverEvent extends Event {
|
|
495
|
+
modelId: string;
|
|
496
|
+
modelElementId: string;
|
|
497
|
+
|
|
498
|
+
constructor(type: string, modelId: string, modelElementId: string);
|
|
499
|
+
}
|
|
500
|
+
export class GlobalEvents {
|
|
501
|
+
static events: EventsDispatcherCore;
|
|
502
|
+
}
|
|
503
|
+
|
|
504
|
+
export enum SelectionMode {
|
|
505
|
+
Append = 0,
|
|
506
|
+
Replace = 1
|
|
507
|
+
}
|
|
508
|
+
export interface ISettingsStorage {
|
|
509
|
+
clear(): void;
|
|
510
|
+
getItem<T>(key: string): T | null;
|
|
511
|
+
removeItem(key: string): void;
|
|
512
|
+
setItem<T>(key: string, value: T): void;
|
|
513
|
+
getKeys(): string[];
|
|
514
|
+
}
|
|
515
|
+
export class SettingsStorageFactory {
|
|
516
|
+
getSettingsStorage(): ISettingsStorage;
|
|
517
|
+
}
|
|
518
|
+
export class LocalSettingsStorage implements ISettingsStorage {
|
|
519
|
+
clear(): void;
|
|
520
|
+
getItem<T>(key: string): T | null;
|
|
521
|
+
removeItem(key: string): void;
|
|
522
|
+
setItem<T>(key: string, value: T): void;
|
|
523
|
+
getKeys(): string[];
|
|
524
|
+
}
|
|
525
|
+
export class InMemorySettingsStorage implements ISettingsStorage {
|
|
526
|
+
clear(): void;
|
|
527
|
+
getItem<T>(key: string): T | null;
|
|
528
|
+
removeItem(key: string): void;
|
|
529
|
+
setItem<T>(key: string, value: T): void;
|
|
530
|
+
getKeys(): string[];
|
|
531
|
+
}
|
|
532
|
+
export type Point3 = {
|
|
533
|
+
x: number;
|
|
534
|
+
y: number;
|
|
535
|
+
z: number;
|
|
536
|
+
};
|
|
537
|
+
export function pointToVector3(point: Point3): THREE.Vector3;
|
|
538
|
+
export type CameraParameters = {
|
|
539
|
+
/** Camera position */
|
|
540
|
+
position: Point3;
|
|
541
|
+
/** Camera view direction: vector pointing from camera to target */
|
|
542
|
+
eyeDir: Point3;
|
|
543
|
+
/** Field of view: angle in radians */
|
|
544
|
+
angle: number;
|
|
545
|
+
/** (optional) Camera up vector*/
|
|
546
|
+
upDir?: Point3;
|
|
547
|
+
/** (optional) Vector pointing to the center of viewing area.*/
|
|
548
|
+
viewCenter?: Point3;
|
|
549
|
+
};
|
|
550
|
+
export type CameraOrientation = {
|
|
551
|
+
/** Camera view direction: vector pointing from camera to target */
|
|
552
|
+
viewDir: THREE.Vector3;
|
|
553
|
+
/** (optional) Camera up vector */
|
|
554
|
+
upDir?: THREE.Vector3;
|
|
555
|
+
};
|
|
556
|
+
export enum CameraNavigationMode {
|
|
557
|
+
None = 0,
|
|
558
|
+
Rotation = 1,
|
|
559
|
+
Translation = 2,
|
|
560
|
+
Spin = 4,
|
|
561
|
+
Zoom = 8
|
|
562
|
+
}
|
|
563
|
+
export interface ICameraControl {
|
|
564
|
+
/**
|
|
565
|
+
* Gets the Three.js camera.
|
|
566
|
+
*/
|
|
567
|
+
getCamera(): THREE.Camera;
|
|
568
|
+
/**
|
|
569
|
+
* Gets the camera parameters.
|
|
570
|
+
*/
|
|
571
|
+
getCameraParameters(): CameraParameters;
|
|
572
|
+
/**
|
|
573
|
+
* Sets the camera parameters.
|
|
574
|
+
*/
|
|
575
|
+
setCameraParameters(iParams: CameraParameters): void;
|
|
576
|
+
/**
|
|
577
|
+
* Sets the camera view point.
|
|
578
|
+
* @param viewCenter - view point
|
|
579
|
+
*/
|
|
580
|
+
setViewCenter(viewCenter: THREE.Vector3): void;
|
|
581
|
+
/**
|
|
582
|
+
* Gets the camera view point.
|
|
583
|
+
*/
|
|
584
|
+
getViewCenter(): THREE.Vector3;
|
|
585
|
+
/**
|
|
586
|
+
* Sets the aspect ratio.
|
|
657
587
|
*/
|
|
658
588
|
setAspectRatio(width: number, heigth: number): boolean;
|
|
659
589
|
/**
|
|
@@ -674,12 +604,16 @@ export interface ICameraControl {
|
|
|
674
604
|
* @param movement - offset in the screen space
|
|
675
605
|
*/
|
|
676
606
|
spin(movement: THREE.Vector2): void;
|
|
607
|
+
/**
|
|
608
|
+
* Gets the camera orientation.
|
|
609
|
+
*/
|
|
610
|
+
getCameraOrientation(): CameraOrientation;
|
|
677
611
|
/**
|
|
678
612
|
* Orient the camera
|
|
679
613
|
* @param iOrientation
|
|
680
614
|
* @param isAnimationEnabled
|
|
681
615
|
*/
|
|
682
|
-
|
|
616
|
+
setCameraOrientation(iOrientation: CameraOrientation, isAnimationEnabled?: boolean): void;
|
|
683
617
|
/**
|
|
684
618
|
* Zoom camera to the point
|
|
685
619
|
* @param deltaSign - zoom distance
|
|
@@ -705,47 +639,6 @@ export interface ICameraControl {
|
|
|
705
639
|
*/
|
|
706
640
|
setNavigationMode(mode: CameraNavigationMode, isEnable: boolean, duration?: number): void;
|
|
707
641
|
}
|
|
708
|
-
export type EventFunction<Data> = ((data: Data) => void) | (() => void);
|
|
709
|
-
export interface IEventListener<Data> {
|
|
710
|
-
dispose(): void;
|
|
711
|
-
}
|
|
712
|
-
export interface IEventSigner<Data> {
|
|
713
|
-
listen(callback: EventFunction<Data>, options?: {
|
|
714
|
-
bind?: object;
|
|
715
|
-
}): IEventListener<Data>;
|
|
716
|
-
unlisten(callback: EventFunction<Data>, options?: {
|
|
717
|
-
bind?: object;
|
|
718
|
-
allowMissing?: boolean;
|
|
719
|
-
}): boolean;
|
|
720
|
-
}
|
|
721
|
-
|
|
722
|
-
export enum SelectionMode {
|
|
723
|
-
Append = 0,
|
|
724
|
-
Replace = 1
|
|
725
|
-
}
|
|
726
|
-
export class RenderViewSettings {
|
|
727
|
-
telemetry?: boolean;
|
|
728
|
-
hideEdgesWhenNavigation?: boolean;
|
|
729
|
-
antiAliasing?: boolean;
|
|
730
|
-
displayMode?: DisplayMode;
|
|
731
|
-
/** Desired render framerate */
|
|
732
|
-
desiredFramerate?: number;
|
|
733
|
-
/** Allocated time for rendering operations, excluding scene rendering */
|
|
734
|
-
manageTime?: number;
|
|
735
|
-
/** Draw hovered meshes on the `selectionScene` */
|
|
736
|
-
hoverMeshes?: boolean;
|
|
737
|
-
/** Draw hovered edges on the `selectionScene` */
|
|
738
|
-
hoverEdges?: boolean;
|
|
739
|
-
/** Draw selected meshes on the `selectionScene` */
|
|
740
|
-
selectEdges?: boolean;
|
|
741
|
-
/** Draw selected edges on the `selectionScene` */
|
|
742
|
-
selectMeshes?: boolean;
|
|
743
|
-
}
|
|
744
|
-
export enum DisplayMode {
|
|
745
|
-
FACES_AND_EDGES = 0,
|
|
746
|
-
FACES = 1
|
|
747
|
-
}
|
|
748
|
-
export const defaultRenderViewSettings: RenderViewSettings;
|
|
749
642
|
export interface IModelIntersectionChecker {
|
|
750
643
|
/** Gets the center of the model*/
|
|
751
644
|
get modelCenter(): THREE.Vector3;
|
|
@@ -797,60 +690,129 @@ export interface IModelIntersectionChecker {
|
|
|
797
690
|
guid: string;
|
|
798
691
|
}[];
|
|
799
692
|
}
|
|
800
|
-
export
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
getSize(target: THREE.Vector2): THREE.Vector2;
|
|
806
|
-
setSize(width: number, height: number, updateStyle?: boolean): void;
|
|
807
|
-
setViewport(x: THREE.Vector4 | number, y?: number, width?: number, height?: number): void;
|
|
808
|
-
clippingPlanes: THREE.Plane[];
|
|
809
|
-
domElement: HTMLCanvasElement;
|
|
693
|
+
export enum NavigationHandlerPriority {
|
|
694
|
+
DefaultNavigation = 0,
|
|
695
|
+
GizmoHandlers = 20,
|
|
696
|
+
EmbeddedExtensions = 40,
|
|
697
|
+
CustomExtensions = 100
|
|
810
698
|
}
|
|
811
|
-
export
|
|
812
|
-
/**
|
|
813
|
-
|
|
814
|
-
/**
|
|
815
|
-
|
|
699
|
+
export class NavigationEventOptions implements EventListenerOptions {
|
|
700
|
+
/** If true, use event capturing instead of event bubbling*/
|
|
701
|
+
readonly capture: boolean;
|
|
702
|
+
/** Call priority of navigation event handlers, from highest to lowest*/
|
|
703
|
+
readonly priority: number | NavigationHandlerPriority;
|
|
704
|
+
/** Always handle, used if `NavigationEvent.isHandled` set to true*/
|
|
705
|
+
readonly alwaysHandle: boolean;
|
|
706
|
+
/** (optional) listener name*/
|
|
707
|
+
readonly navigationTargetName?: string;
|
|
708
|
+
|
|
709
|
+
constructor(
|
|
710
|
+
/** If true, use event capturing instead of event bubbling*/
|
|
711
|
+
capture?: boolean,
|
|
712
|
+
/** Call priority of navigation event handlers, from highest to lowest*/
|
|
713
|
+
priority?: number | NavigationHandlerPriority,
|
|
714
|
+
/** Always handle, used if `NavigationEvent.isHandled` set to true*/
|
|
715
|
+
alwaysHandle?: boolean,
|
|
716
|
+
/** (optional) listener name*/
|
|
717
|
+
navigationTargetName?: string);
|
|
718
|
+
}
|
|
719
|
+
export type NavigationEvent = {
|
|
816
720
|
/**
|
|
817
|
-
*
|
|
818
|
-
* An object can only be placed on one scene.
|
|
819
|
-
* @param iObj - object to place.
|
|
820
|
-
* @param sceneID - (optional) scene name. `MainScene` by default.
|
|
721
|
+
* (optional) Value indicating whether the NavigationEvent event was handled.
|
|
821
722
|
*/
|
|
822
|
-
|
|
723
|
+
isHandled?: boolean;
|
|
724
|
+
};
|
|
725
|
+
export interface ActiveEvent extends Event {
|
|
726
|
+
readonly isActive: boolean;
|
|
727
|
+
}
|
|
728
|
+
export interface NavigationEventSourceEventMap extends HTMLElementEventMap {
|
|
823
729
|
/**
|
|
824
|
-
*
|
|
825
|
-
* @param iObj
|
|
730
|
+
* Occurs when the {@link INavigationEventSource.isActive} property changes.
|
|
826
731
|
*/
|
|
827
|
-
|
|
732
|
+
"active": ActiveEvent;
|
|
733
|
+
}
|
|
734
|
+
export interface INavigationEventSource {
|
|
828
735
|
/**
|
|
829
|
-
*
|
|
830
|
-
* @param planes - array of clipping planes.
|
|
736
|
+
* Activity of the event source
|
|
831
737
|
*/
|
|
832
|
-
|
|
738
|
+
get isActive(): boolean;
|
|
739
|
+
set isActive(value: boolean);
|
|
740
|
+
addEventListener<T extends keyof NavigationEventSourceEventMap>(type: T, listener: (this: object, ev: NavigationEventSourceEventMap[T] & NavigationEvent) => void, options?: boolean | EventListenerOptions | NavigationEventOptions): void;
|
|
741
|
+
removeEventListener<T extends keyof NavigationEventSourceEventMap>(type: T, listener: (this: object, ev: NavigationEventSourceEventMap[T] & NavigationEvent) => void, options?: boolean | EventListenerOptions | NavigationEventOptions): void;
|
|
742
|
+
}
|
|
743
|
+
export interface INavigationAgent {
|
|
833
744
|
/**
|
|
834
|
-
*
|
|
835
|
-
* @param indices - active planes indices in the array of clipping planes
|
|
745
|
+
* Canvas DOM-events source
|
|
836
746
|
*/
|
|
837
|
-
|
|
747
|
+
readonly canvasNavigationSource: INavigationEventSource;
|
|
838
748
|
/**
|
|
839
|
-
*
|
|
749
|
+
* Keyboard DOM-events source
|
|
840
750
|
*/
|
|
841
|
-
|
|
751
|
+
readonly keyboardNavigationSource: INavigationEventSource;
|
|
842
752
|
/**
|
|
843
|
-
*
|
|
844
|
-
* @param name
|
|
845
|
-
* @param isClippable
|
|
753
|
+
* Activity of the navigation agent
|
|
846
754
|
*/
|
|
847
|
-
|
|
755
|
+
get isActive(): boolean;
|
|
756
|
+
set isActive(value: boolean);
|
|
848
757
|
/**
|
|
849
|
-
*
|
|
850
|
-
* @param scene
|
|
758
|
+
* Gets rectangle of the navigation area
|
|
851
759
|
*/
|
|
852
|
-
|
|
760
|
+
getNavigationArea(): DOMRect;
|
|
761
|
+
}
|
|
762
|
+
export interface INavigationTool {
|
|
763
|
+
/**
|
|
764
|
+
* Gets name of this navigation tool.
|
|
765
|
+
*/
|
|
766
|
+
get name(): string;
|
|
767
|
+
/**
|
|
768
|
+
* Initialize navigation tool.
|
|
769
|
+
*/
|
|
770
|
+
init(navAgent: INavigationAgent, cameraControl: ICameraControl, intersectionChecker: IModelIntersectionChecker): void;
|
|
771
|
+
/**
|
|
772
|
+
* Activates or deactivates this navigation tool.
|
|
773
|
+
*/
|
|
774
|
+
setActive(isActive: boolean): void;
|
|
775
|
+
/**
|
|
776
|
+
* Gets the camera pivot point.
|
|
777
|
+
*/
|
|
778
|
+
getPivotPoint(): THREE.Vector3;
|
|
779
|
+
/**
|
|
780
|
+
* Sets the camera pivot point.
|
|
781
|
+
*/
|
|
782
|
+
setPivotPoint(pivotPoint: THREE.Vector3): void;
|
|
783
|
+
/**
|
|
784
|
+
* Sets the camera parameters.
|
|
785
|
+
* @param iParams
|
|
786
|
+
*/
|
|
787
|
+
setCameraParameters(iParams: CameraParameters): void;
|
|
788
|
+
/**
|
|
789
|
+
* Gets the camera parameters.
|
|
790
|
+
*/
|
|
791
|
+
getCameraParameters(): CameraParameters;
|
|
792
|
+
}
|
|
793
|
+
export class RenderViewSettings {
|
|
794
|
+
telemetry?: boolean;
|
|
795
|
+
hideEdgesWhenNavigation?: boolean;
|
|
796
|
+
antiAliasing?: boolean;
|
|
797
|
+
displayMode?: DisplayMode;
|
|
798
|
+
/** Desired render framerate */
|
|
799
|
+
desiredFramerate?: number;
|
|
800
|
+
/** Allocated time for rendering operations, excluding scene rendering */
|
|
801
|
+
manageTime?: number;
|
|
802
|
+
/** Draw hovered meshes on the `selectionScene` */
|
|
803
|
+
hoverMeshes?: boolean;
|
|
804
|
+
/** Draw hovered edges on the `selectionScene` */
|
|
805
|
+
hoverEdges?: boolean;
|
|
806
|
+
/** Draw selected meshes on the `selectionScene` */
|
|
807
|
+
selectEdges?: boolean;
|
|
808
|
+
/** Draw selected edges on the `selectionScene` */
|
|
809
|
+
selectMeshes?: boolean;
|
|
810
|
+
}
|
|
811
|
+
export enum DisplayMode {
|
|
812
|
+
FACES_AND_EDGES = 0,
|
|
813
|
+
FACES = 1
|
|
853
814
|
}
|
|
815
|
+
export const defaultRenderViewSettings: RenderViewSettings;
|
|
854
816
|
export interface IRenderOperationContext {
|
|
855
817
|
/** If true, renderScenes operations will be forced*/
|
|
856
818
|
isRedrawRequested: boolean;
|
|
@@ -905,7 +867,7 @@ export enum OperationPriority {
|
|
|
905
867
|
afterAll = 100
|
|
906
868
|
}
|
|
907
869
|
export type RenderOperationDelegate = (context: IRenderOperationContext) => OperationStatus;
|
|
908
|
-
export interface IUserScene {
|
|
870
|
+
export interface IUserScene extends THREE.Scene {
|
|
909
871
|
/** Scene name */
|
|
910
872
|
readonly name: string;
|
|
911
873
|
/** Indicates whether the scene should to be updated (should to be managed)*/
|
|
@@ -914,8 +876,6 @@ export interface IUserScene {
|
|
|
914
876
|
get needsRedraw(): boolean;
|
|
915
877
|
/** Gets the scene intersection checker */
|
|
916
878
|
get intersectionChecker(): IModelIntersectionChecker | null;
|
|
917
|
-
/** Gets the THREE.Object3D representation of the scene */
|
|
918
|
-
get threeObjectRepresentation(): THREE.Object3D | null;
|
|
919
879
|
/** Sets clipping enable */
|
|
920
880
|
set clippingEnable(value: boolean);
|
|
921
881
|
/** Indicates whether the scene should be clipped */
|
|
@@ -936,292 +896,84 @@ export interface IUserScene {
|
|
|
936
896
|
manageScene(context?: IRenderOperationContext): boolean;
|
|
937
897
|
/** Render scene */
|
|
938
898
|
render(context: IRenderOperationContext): void;
|
|
939
|
-
/** Clear scene */
|
|
940
|
-
clear(): void;
|
|
941
899
|
/** Dispose scene */
|
|
942
900
|
dispose(): void;
|
|
943
901
|
}
|
|
944
|
-
export
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
/** Always handle, used if `NavigationEvent.isHandled` set to true*/
|
|
956
|
-
readonly alwaysHandle: boolean;
|
|
957
|
-
/** (optional) listener name*/
|
|
958
|
-
readonly navigationTargetName?: string;
|
|
959
|
-
|
|
960
|
-
constructor(
|
|
961
|
-
/** If true, use event capturing instead of event bubbling*/
|
|
962
|
-
capture?: boolean,
|
|
963
|
-
/** Call priority of navigation event handlers, from highest to lowest*/
|
|
964
|
-
priority?: number | NavigationHandlerPriority,
|
|
965
|
-
/** Always handle, used if `NavigationEvent.isHandled` set to true*/
|
|
966
|
-
alwaysHandle?: boolean,
|
|
967
|
-
/** (optional) listener name*/
|
|
968
|
-
navigationTargetName?: string);
|
|
969
|
-
}
|
|
970
|
-
export type NavigationEvent = {
|
|
971
|
-
/**
|
|
972
|
-
* (optional) Value indicating whether the NavigationEvent event was handled.
|
|
973
|
-
*/
|
|
974
|
-
isHandled?: boolean;
|
|
975
|
-
};
|
|
976
|
-
export interface INavigationEventSource {
|
|
977
|
-
/**
|
|
978
|
-
* Event fired on activity changed
|
|
979
|
-
*/
|
|
980
|
-
readonly eventSourceActivityChanged: IEventSigner<boolean>;
|
|
981
|
-
/**
|
|
982
|
-
* Activates or deactivate event source
|
|
983
|
-
* @param value - activate if true
|
|
984
|
-
*/
|
|
985
|
-
setActive(value: boolean): void;
|
|
986
|
-
addEventListener<T extends keyof HTMLElementEventMap>(type: T, listener: (this: object, ev: HTMLElementEventMap[T] & NavigationEvent) => void, options?: boolean | EventListenerOptions | NavigationEventOptions): void;
|
|
987
|
-
removeEventListener<T extends keyof HTMLElementEventMap>(type: T, listener: (this: object, ev: HTMLElementEventMap[T] & NavigationEvent) => void, options?: boolean | EventListenerOptions | NavigationEventOptions): void;
|
|
988
|
-
}
|
|
989
|
-
export interface INavigationAgent {
|
|
990
|
-
/**
|
|
991
|
-
* Canvas DOM-events source
|
|
992
|
-
*/
|
|
993
|
-
readonly canvasNavigationSource: INavigationEventSource;
|
|
994
|
-
/**
|
|
995
|
-
* Keyboard DOM-events source
|
|
996
|
-
*/
|
|
997
|
-
readonly keyboardNavigationSource: INavigationEventSource;
|
|
998
|
-
/**
|
|
999
|
-
* Activates canvas and keyboard navigation event sources
|
|
1000
|
-
*/
|
|
1001
|
-
setActive(value: boolean): void;
|
|
1002
|
-
/**
|
|
1003
|
-
* Gets rectangle of the navigation area
|
|
1004
|
-
*/
|
|
1005
|
-
getNavigationArea(): DOMRect;
|
|
902
|
+
export interface I3DRenderer {
|
|
903
|
+
clear(color?: boolean, depth?: boolean, stencil?: boolean): void;
|
|
904
|
+
setClearColor(color: THREE.ColorRepresentation, alpha?: number): void;
|
|
905
|
+
clearDepth(): void;
|
|
906
|
+
render(scene: THREE.Object3D, camera: THREE.Camera): void;
|
|
907
|
+
getSize(target: THREE.Vector2): THREE.Vector2;
|
|
908
|
+
setSize(width: number, height: number, updateStyle?: boolean): void;
|
|
909
|
+
setViewport(x: THREE.Vector4 | number, y?: number, width?: number, height?: number): void;
|
|
910
|
+
getViewport(target: THREE.Vector4): THREE.Vector4;
|
|
911
|
+
clippingPlanes: THREE.Plane[];
|
|
912
|
+
domElement: HTMLCanvasElement;
|
|
1006
913
|
}
|
|
1007
|
-
export interface
|
|
914
|
+
export interface IRenderViewer3D {
|
|
915
|
+
/** Gets model inetrsection checker. */
|
|
916
|
+
getIntersectionChecker(): IModelIntersectionChecker;
|
|
917
|
+
/** Request a full redraw of the canvas. */
|
|
918
|
+
updateCurrentCanvas(): Promise<void>;
|
|
1008
919
|
/**
|
|
1009
|
-
*
|
|
920
|
+
* Place object on the scene.\
|
|
921
|
+
* An object can only be placed on one scene.
|
|
922
|
+
* @param iObj - object to place.
|
|
923
|
+
* @param sceneID - (optional) scene name. `MainScene` by default.
|
|
1010
924
|
*/
|
|
1011
|
-
|
|
925
|
+
placeObjectOnScene(iObj: THREE.Object3D, sceneID?: string): Promise<void>;
|
|
1012
926
|
/**
|
|
1013
|
-
*
|
|
927
|
+
* Remove object from scene.
|
|
928
|
+
* @param iObj
|
|
1014
929
|
*/
|
|
1015
|
-
|
|
930
|
+
removeObjectFromScene(iObj: THREE.Object3D): Promise<void>;
|
|
1016
931
|
/**
|
|
1017
|
-
*
|
|
932
|
+
* Set clipping planes for rendering.
|
|
933
|
+
* @param planes - array of clipping planes.
|
|
1018
934
|
*/
|
|
1019
|
-
|
|
935
|
+
setClipping(planes: THREE.Plane[]): void;
|
|
1020
936
|
/**
|
|
1021
|
-
*
|
|
937
|
+
* Set active clipping planes: planes with colored sections
|
|
938
|
+
* @param indices - active planes indices in the array of clipping planes
|
|
1022
939
|
*/
|
|
1023
|
-
|
|
940
|
+
setActiveClipPlaneIndices(indices: number[]): void;
|
|
1024
941
|
/**
|
|
1025
|
-
*
|
|
942
|
+
* Gets all render scenes.
|
|
1026
943
|
*/
|
|
1027
|
-
|
|
944
|
+
getScenes(): IUserScene[];
|
|
1028
945
|
/**
|
|
1029
|
-
*
|
|
1030
|
-
* @param
|
|
946
|
+
*
|
|
947
|
+
* @param name
|
|
948
|
+
* @param isClippable
|
|
1031
949
|
*/
|
|
1032
|
-
|
|
950
|
+
addScene(name: string, isClippable: boolean): IUserScene;
|
|
1033
951
|
/**
|
|
1034
|
-
*
|
|
952
|
+
*
|
|
953
|
+
* @param scene
|
|
1035
954
|
*/
|
|
1036
|
-
|
|
1037
|
-
}
|
|
1038
|
-
export class GizmoMaterials {
|
|
1039
|
-
static gizmoMaterial: THREE.MeshBasicMaterial;
|
|
1040
|
-
static matInvisible: THREE.MeshBasicMaterial;
|
|
1041
|
-
static matRed: THREE.MeshBasicMaterial;
|
|
1042
|
-
static matGreen: THREE.MeshBasicMaterial;
|
|
1043
|
-
static matBlue: THREE.MeshBasicMaterial;
|
|
1044
|
-
static matYellow: THREE.MeshBasicMaterial;
|
|
1045
|
-
static matViolet: THREE.MeshBasicMaterial;
|
|
1046
|
-
static matYellowTransparent: THREE.MeshBasicMaterial;
|
|
1047
|
-
static init(): void;
|
|
1048
|
-
}
|
|
1049
|
-
export interface IGizmoObject extends THREE.Object3D {
|
|
1050
|
-
getHovered(): boolean;
|
|
1051
|
-
setHovered(value: boolean): void;
|
|
1052
|
-
getActive(): boolean;
|
|
1053
|
-
setActive(value: boolean): void;
|
|
1054
|
-
dispose(): void;
|
|
1055
|
-
}
|
|
1056
|
-
export class GizmoObject extends THREE.Object3D implements IGizmoObject {
|
|
1057
|
-
protected _meshes: THREE.Mesh[];
|
|
1058
|
-
readonly baseMaterial: THREE.Material;
|
|
1059
|
-
readonly hoverMaterial: THREE.Material;
|
|
1060
|
-
readonly activeMaterial: THREE.Material;
|
|
1061
|
-
|
|
1062
|
-
constructor(_meshes: THREE.Mesh[], baseMaterial?: THREE.Material, hoverMaterial?: THREE.Material, activeMaterial?: THREE.Material);
|
|
1063
|
-
getHovered(): boolean;
|
|
1064
|
-
setHovered(value: boolean): void;
|
|
1065
|
-
getActive(): boolean;
|
|
1066
|
-
setActive(value: boolean): void;
|
|
1067
|
-
dispose(): void;
|
|
1068
|
-
raycast(raycaster: THREE.Raycaster, intersects: THREE.Intersection<THREE.Object3D<THREE.Event>>[]): void;
|
|
1069
|
-
}
|
|
1070
|
-
export abstract class GizmoAxis extends THREE.Object3D implements IGizmoObject {
|
|
1071
|
-
readonly handle: IGizmoObject;
|
|
1072
|
-
readonly picker?: IGizmoObject;
|
|
1073
|
-
readonly helper?: IGizmoObject;
|
|
1074
|
-
protected _isHovered: boolean;
|
|
1075
|
-
protected _isActive: boolean;
|
|
1076
|
-
protected _plane: THREE.Plane;
|
|
1077
|
-
protected _axisDir: THREE.Vector3;
|
|
1078
|
-
protected _raycaster: THREE.Raycaster;
|
|
1079
|
-
protected _worldPositionStart: THREE.Vector3;
|
|
1080
|
-
protected _worldQuaternionStart: THREE.Quaternion;
|
|
1081
|
-
protected _worldAxisDir: THREE.Vector3;
|
|
1082
|
-
protected _startPoint: THREE.Vector3;
|
|
1083
|
-
protected _endPoint: THREE.Vector3;
|
|
1084
|
-
getActive(): boolean;
|
|
1085
|
-
setActive(value: boolean): void;
|
|
1086
|
-
getHovered(): boolean;
|
|
1087
|
-
setHovered(value: boolean): void;
|
|
1088
|
-
dispose(): void;
|
|
1089
|
-
raycast(raycaster: THREE.Raycaster, intersects: THREE.Intersection<THREE.Object3D<THREE.Event>>[]): void;
|
|
1090
|
-
abstract moveByNdcPt(ndcPos: THREE.Vector2, camera: THREE.Camera): THREE.Matrix4;
|
|
1091
|
-
protected abstract updateGizmoPlane(camera: THREE.Camera): void;
|
|
1092
|
-
protected setStartPt(ndcPos: THREE.Vector2, camera: THREE.Camera): void;
|
|
1093
|
-
}
|
|
1094
|
-
export class GizmoTranslationAxis extends GizmoAxis {
|
|
1095
|
-
readonly handle: IGizmoObject;
|
|
1096
|
-
readonly picker?: IGizmoObject;
|
|
1097
|
-
readonly helper?: IGizmoObject;
|
|
1098
|
-
|
|
1099
|
-
constructor(axisDir: THREE.Vector3, handle: IGizmoObject, picker?: IGizmoObject, helper?: IGizmoObject);
|
|
1100
|
-
moveByNdcPt(ndcPos: THREE.Vector2, camera: THREE.Camera): THREE.Matrix4;
|
|
1101
|
-
protected updateGizmoPlane(camera: THREE.Camera): void;
|
|
1102
|
-
}
|
|
1103
|
-
export class GizmoRotationAxis extends GizmoAxis {
|
|
1104
|
-
readonly handle: IGizmoObject;
|
|
1105
|
-
readonly picker?: IGizmoObject;
|
|
1106
|
-
readonly helper?: IGizmoObject;
|
|
1107
|
-
moveByNdcPt(ndcPos: THREE.Vector2, camera: THREE.Camera): THREE.Matrix4;
|
|
1108
|
-
protected updateGizmoPlane(camera: THREE.Camera): void;
|
|
1109
|
-
}
|
|
1110
|
-
export class GizmoScaleAxis extends GizmoAxis {
|
|
1111
|
-
readonly handle: IGizmoObject;
|
|
1112
|
-
readonly picker?: IGizmoObject;
|
|
1113
|
-
readonly helper?: IGizmoObject;
|
|
1114
|
-
moveByNdcPt(ndcPos: THREE.Vector2, camera: THREE.Camera): THREE.Matrix4;
|
|
1115
|
-
protected updateGizmoPlane(camera: THREE.Camera): void;
|
|
1116
|
-
}
|
|
1117
|
-
export class GizmoControl extends THREE.Object3D {
|
|
1118
|
-
|
|
1119
|
-
constructor(camera: THREE.Camera, navAgent: INavigationAgent);
|
|
1120
|
-
attachTo(object: THREE.Object3D, asChild?: boolean): void;
|
|
1121
|
-
detach(): void;
|
|
1122
|
-
addAxis(axis: GizmoAxis): void;
|
|
1123
|
-
dispose(): void;
|
|
1124
|
-
updateMatrixWorld(force?: boolean): void;
|
|
1125
|
-
updateGizmoOffset(position?: THREE.Vector3, quaternion?: THREE.Quaternion): void;
|
|
955
|
+
removeScene(scene: IUserScene): void;
|
|
1126
956
|
}
|
|
1127
|
-
export
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
Y = 2,
|
|
1131
|
-
Z = 4,
|
|
1132
|
-
XY = 3,
|
|
1133
|
-
YZ = 6,
|
|
1134
|
-
XZ = 5,
|
|
1135
|
-
XYZ = 7
|
|
957
|
+
export class InitializerOptions {
|
|
958
|
+
libList?: string[];
|
|
959
|
+
language?: string;
|
|
1136
960
|
}
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
961
|
+
class Global {
|
|
962
|
+
G: any;
|
|
963
|
+
RESOURCE_ROOT: string;
|
|
964
|
+
initializeResourceRoot(options: InitializerOptions): void;
|
|
965
|
+
getResourceUrl(resourceRelativePath: string): string;
|
|
1142
966
|
}
|
|
1143
|
-
export
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
textPadding?: THREE.Vector4Tuple | undefined;
|
|
1154
|
-
}
|
|
1155
|
-
export class LabelSprite extends THREE.Sprite {
|
|
1156
|
-
readonly extraHeightFactor = 1.4;
|
|
1157
|
-
|
|
1158
|
-
constructor(parameters: LabelSpriteParameters);
|
|
1159
|
-
get sizeAttenuation(): boolean;
|
|
1160
|
-
set sizeAttenuation(value: boolean);
|
|
1161
|
-
/**
|
|
1162
|
-
* @default ''
|
|
1163
|
-
*/
|
|
1164
|
-
get text(): string;
|
|
1165
|
-
set text(value: string);
|
|
1166
|
-
/**
|
|
1167
|
-
* @default 'Roboto, sans-serif'
|
|
1168
|
-
*/
|
|
1169
|
-
get fontFace(): string | FontFace;
|
|
1170
|
-
set fontFace(value: string | FontFace);
|
|
1171
|
-
/**
|
|
1172
|
-
* @default 12
|
|
1173
|
-
*/
|
|
1174
|
-
get fontSize(): number;
|
|
1175
|
-
set fontSize(value: number);
|
|
1176
|
-
/**
|
|
1177
|
-
* @default 2
|
|
1178
|
-
*/
|
|
1179
|
-
get borderThickness(): number;
|
|
1180
|
-
set borderThickness(value: number);
|
|
1181
|
-
/**
|
|
1182
|
-
* @default new Color(0, 0, 0, 1.0)
|
|
1183
|
-
*/
|
|
1184
|
-
get borderColor(): Color;
|
|
1185
|
-
set borderColor(value: Color);
|
|
1186
|
-
/**
|
|
1187
|
-
* @default 1
|
|
1188
|
-
*/
|
|
1189
|
-
get borderRadius(): number;
|
|
1190
|
-
set borderRadius(value: number);
|
|
1191
|
-
/**
|
|
1192
|
-
* @default new Color(1.0, 1.0, 1.0, 1.0)
|
|
1193
|
-
*/
|
|
1194
|
-
get backgroundColor(): Color;
|
|
1195
|
-
set backgroundColor(value: Color);
|
|
1196
|
-
/**
|
|
1197
|
-
* @default new Color(0, 0, 0, 1.0)
|
|
1198
|
-
*/
|
|
1199
|
-
get textColor(): Color;
|
|
1200
|
-
set textColor(value: Color);
|
|
1201
|
-
/**
|
|
1202
|
-
* Label text padding: left, top, right, bottom
|
|
1203
|
-
* @default [0, 0, 0, 0]
|
|
1204
|
-
*/
|
|
1205
|
-
get textPadding(): THREE.Vector4Tuple;
|
|
1206
|
-
set textPadding(value: THREE.Vector4Tuple);
|
|
1207
|
-
dispose(): void;
|
|
1208
|
-
}
|
|
1209
|
-
export interface EventEmitter<Data> {
|
|
1210
|
-
emit(data?: Data, options?: object): void;
|
|
1211
|
-
}
|
|
1212
|
-
export class EventDispatcher<Data> implements IEventSigner<Data>, EventEmitter<Data> {
|
|
1213
|
-
listen(func: EventFunction<Data>, options?: {
|
|
1214
|
-
bind?: object;
|
|
1215
|
-
}): IEventListener<Data>;
|
|
1216
|
-
unlisten(func: EventFunction<Data>, options?: {
|
|
1217
|
-
bind?: object;
|
|
1218
|
-
allowMissing?: boolean;
|
|
1219
|
-
}): boolean;
|
|
1220
|
-
emit(data?: Data): void;
|
|
1221
|
-
emitR(data?: Data): any[];
|
|
1222
|
-
asSigner(): IEventSigner<Data>;
|
|
1223
|
-
asEmitter(): EventEmitter<Data>;
|
|
1224
|
-
removeAllListeners(): void;
|
|
967
|
+
export const global: Global;
|
|
968
|
+
export {};
|
|
969
|
+
export type StringMap = {
|
|
970
|
+
[key: string]: any;
|
|
971
|
+
};
|
|
972
|
+
export class Localization {
|
|
973
|
+
static initialize(options: any): Promise<void>;
|
|
974
|
+
static translate<T extends (string | StringMap) = string>(stringToTrans: string): T;
|
|
975
|
+
static setLanguage(language: string): Promise<void>;
|
|
976
|
+
static extendLocalization(locales: any): boolean;
|
|
1225
977
|
}
|
|
1226
978
|
export class ModelElement {
|
|
1227
979
|
get id(): string;
|
|
@@ -1282,6 +1034,135 @@ export class ModelPart {
|
|
|
1282
1034
|
get elementTree(): ModelElementTree;
|
|
1283
1035
|
dispose(): void;
|
|
1284
1036
|
}
|
|
1037
|
+
export interface INavigation {
|
|
1038
|
+
/**
|
|
1039
|
+
* Register navigation tool.
|
|
1040
|
+
*/
|
|
1041
|
+
registerNavigation(navigationTool: INavigationTool): void;
|
|
1042
|
+
/**
|
|
1043
|
+
* Unregister navigation tool.
|
|
1044
|
+
*/
|
|
1045
|
+
unregisterNavigation(navigationTool: INavigationTool): void;
|
|
1046
|
+
/**
|
|
1047
|
+
* Activate or deactivate registered navigation tool.
|
|
1048
|
+
* NB: There can be only one active navigation tool at time.
|
|
1049
|
+
*/
|
|
1050
|
+
setActive(navigationToolName: string, isActive: boolean): void;
|
|
1051
|
+
/**
|
|
1052
|
+
* Get active navigation tool.
|
|
1053
|
+
*/
|
|
1054
|
+
getActiveNavigation(): INavigationTool | null;
|
|
1055
|
+
/**
|
|
1056
|
+
* Get navigation agent.
|
|
1057
|
+
*/
|
|
1058
|
+
getNavigationAgent(): INavigationAgent;
|
|
1059
|
+
/**
|
|
1060
|
+
* Gets navigation area rectangle
|
|
1061
|
+
*/
|
|
1062
|
+
getNavigationArea(): DOMRect;
|
|
1063
|
+
/**
|
|
1064
|
+
* Sets the camera parameters.
|
|
1065
|
+
*/
|
|
1066
|
+
setCameraParameters(params: CameraParameters): void;
|
|
1067
|
+
/**
|
|
1068
|
+
* Gets the camera parameters.
|
|
1069
|
+
*/
|
|
1070
|
+
getCameraParameters(): CameraParameters;
|
|
1071
|
+
/**
|
|
1072
|
+
* Gets the camera control.
|
|
1073
|
+
*/
|
|
1074
|
+
getCameraControl(): ICameraControl;
|
|
1075
|
+
/**
|
|
1076
|
+
* Gets the Three.js camera.
|
|
1077
|
+
*/
|
|
1078
|
+
getCamera(): THREE.Camera;
|
|
1079
|
+
/**
|
|
1080
|
+
* Fits camera to objects by IDs.
|
|
1081
|
+
* @param {string[] | string} elementIds - element or array of elements
|
|
1082
|
+
* @param {string | ModelPart} modelPart - the model part id or the model part instance containing the elements.
|
|
1083
|
+
* @param {boolean} immediate - true to avoid the default transition.
|
|
1084
|
+
* @returns
|
|
1085
|
+
*/
|
|
1086
|
+
fitToView(elementIds: string[] | string, modelPart: string | ModelPart, immediate?: boolean): void;
|
|
1087
|
+
/**
|
|
1088
|
+
* Sets the camera pivot point.
|
|
1089
|
+
*/
|
|
1090
|
+
setPivotPoint(point: Point3): void;
|
|
1091
|
+
/**
|
|
1092
|
+
* Gets the camera pivot point.
|
|
1093
|
+
*/
|
|
1094
|
+
getPivotPoint(): Point3;
|
|
1095
|
+
/**
|
|
1096
|
+
* Reset the camera pivot point.
|
|
1097
|
+
*/
|
|
1098
|
+
resetPivotPoint(): void;
|
|
1099
|
+
}
|
|
1100
|
+
export interface CustomSpriteMaterialParameters extends THREE.ShaderMaterialParameters {
|
|
1101
|
+
color?: THREE.ColorRepresentation | undefined;
|
|
1102
|
+
map?: THREE.Texture | null | undefined;
|
|
1103
|
+
alphaMap?: THREE.Texture | null | undefined;
|
|
1104
|
+
rotation?: number | undefined;
|
|
1105
|
+
sizeAttenuation?: boolean | undefined;
|
|
1106
|
+
fog?: boolean | undefined;
|
|
1107
|
+
center?: THREE.Vector2 | undefined;
|
|
1108
|
+
discreteClipping?: boolean | undefined;
|
|
1109
|
+
offset?: THREE.Vector2 | undefined;
|
|
1110
|
+
}
|
|
1111
|
+
export class CustomSpriteMaterial extends CustomMaterial {
|
|
1112
|
+
type: string;
|
|
1113
|
+
readonly isSpriteMaterial: true;
|
|
1114
|
+
|
|
1115
|
+
constructor(parameters?: CustomSpriteMaterialParameters);
|
|
1116
|
+
/**
|
|
1117
|
+
* @default new THREE.Color( 0xffffff )
|
|
1118
|
+
*/
|
|
1119
|
+
color: THREE.Color;
|
|
1120
|
+
/**
|
|
1121
|
+
* @default null
|
|
1122
|
+
*/
|
|
1123
|
+
map: THREE.Texture | null;
|
|
1124
|
+
/**
|
|
1125
|
+
* @default null
|
|
1126
|
+
*/
|
|
1127
|
+
alphaMap: THREE.Texture | null;
|
|
1128
|
+
/**
|
|
1129
|
+
* @default 0
|
|
1130
|
+
*/
|
|
1131
|
+
rotation: number;
|
|
1132
|
+
/**
|
|
1133
|
+
* @default true
|
|
1134
|
+
*/
|
|
1135
|
+
sizeAttenuation: boolean;
|
|
1136
|
+
/**
|
|
1137
|
+
* @default true
|
|
1138
|
+
*/
|
|
1139
|
+
transparent: boolean;
|
|
1140
|
+
/**
|
|
1141
|
+
* Whether the material is affected by fog. Default is true.
|
|
1142
|
+
* @default fog
|
|
1143
|
+
*/
|
|
1144
|
+
fog: boolean;
|
|
1145
|
+
/**
|
|
1146
|
+
* @default new THREE.Vector2(0.5, 0.5)
|
|
1147
|
+
*/
|
|
1148
|
+
center: THREE.Vector2;
|
|
1149
|
+
/**
|
|
1150
|
+
* @default new THREE.Vector2(0.0, 0.0)
|
|
1151
|
+
*/
|
|
1152
|
+
offset: THREE.Vector2;
|
|
1153
|
+
/**
|
|
1154
|
+
* @default true
|
|
1155
|
+
*/
|
|
1156
|
+
get discreteClipping(): boolean;
|
|
1157
|
+
set discreteClipping(value: boolean);
|
|
1158
|
+
get resolution(): THREE.Vector2;
|
|
1159
|
+
set resolution(value: THREE.Vector2);
|
|
1160
|
+
protected refreshUniformsCommon(uniforms: {
|
|
1161
|
+
[uniform: string]: THREE.IUniform;
|
|
1162
|
+
}, material: CustomSpriteMaterial, renderer: THREE.WebGLRenderer): void;
|
|
1163
|
+
protected onBeforeRender(renderer: THREE.WebGLRenderer, scene: THREE.Scene, camera: THREE.Camera, geometry: THREE.BufferGeometry, material: THREE.Material, group: THREE.Group): void;
|
|
1164
|
+
copy(source: CustomSpriteMaterial): this;
|
|
1165
|
+
}
|
|
1285
1166
|
|
|
1286
1167
|
export class SettingsNames {
|
|
1287
1168
|
static TELEMETRY: string;
|
|
@@ -1310,12 +1191,194 @@ export enum ValueType {
|
|
|
1310
1191
|
ENUM = 2,
|
|
1311
1192
|
BOOL = 3
|
|
1312
1193
|
}
|
|
1194
|
+
export interface ISettings {
|
|
1195
|
+
changeSetting<T>(name: string, value: T, notify?: boolean, providedData?: any): void;
|
|
1196
|
+
getSettingValue<T>(name: string): T;
|
|
1197
|
+
}
|
|
1198
|
+
export enum BaseSettingsNames {
|
|
1199
|
+
TOOLBAR = "toolbar",
|
|
1200
|
+
TOOLBAR_POSITION = "toolbarPosition",
|
|
1201
|
+
TOOLBAR_CONTENT_ALIGNMENT = "toolbarContent",
|
|
1202
|
+
THEME = "theme"
|
|
1203
|
+
}
|
|
1204
|
+
export class SettingChangedEvent extends Event {
|
|
1205
|
+
name: string;
|
|
1206
|
+
oldValue: any;
|
|
1207
|
+
newValue: any;
|
|
1208
|
+
providedData: any;
|
|
1209
|
+
}
|
|
1210
|
+
export enum SettingsTheme {
|
|
1211
|
+
LIGHT_THEME = "ascn-light",
|
|
1212
|
+
DARK_THEME = "ascn-dark"
|
|
1213
|
+
}
|
|
1214
|
+
export const defaultThemeAppearance: string;
|
|
1215
|
+
export enum ToolbarPosition {
|
|
1216
|
+
TOP_FIXED = "ascn-toolbar-position-fixed-top",
|
|
1217
|
+
TOP_FLUENT = "ascn-toolbar-position-top",
|
|
1218
|
+
BOTTOM_FIXED = "ascn-toolbar-position-fixed-bottom",
|
|
1219
|
+
BOTTOM_FLUENT = "ascn-toolbar-position-bottom"
|
|
1220
|
+
}
|
|
1221
|
+
export enum ToolbarContentAlignment {
|
|
1222
|
+
CENTER = "ascn-toolbar-content-center",
|
|
1223
|
+
START = "ascn-toolbar-content-start",
|
|
1224
|
+
END = "ascn-toolbar-content-end"
|
|
1225
|
+
}
|
|
1226
|
+
export interface ToolbarStyle {
|
|
1227
|
+
[BaseSettingsNames.TOOLBAR_POSITION]?: ToolbarPosition;
|
|
1228
|
+
[BaseSettingsNames.TOOLBAR_CONTENT_ALIGNMENT]?: ToolbarContentAlignment;
|
|
1229
|
+
}
|
|
1230
|
+
export const defaultToolbarAppearance: ToolbarStyle;
|
|
1231
|
+
export type ViewerSettings = Record<string, any>;
|
|
1232
|
+
export class ViewerConfiguration {
|
|
1233
|
+
settingsPrefix: string;
|
|
1234
|
+
appearance: ViewerSettings;
|
|
1235
|
+
createConfiguration(configuration: ViewerSettings, origin: ViewerSettings): void;
|
|
1236
|
+
mergeConfigurationAndSettings(configuration: ViewerSettings, settings: ISettings): void;
|
|
1237
|
+
changeTheme(newTheme: string): void;
|
|
1238
|
+
}
|
|
1313
1239
|
export class Viewer3DConfiguration extends ViewerConfiguration {
|
|
1314
1240
|
render: ViewerSettings;
|
|
1315
1241
|
|
|
1316
1242
|
constructor(appearance?: ViewerSettings, render?: ViewerSettings);
|
|
1317
1243
|
}
|
|
1318
1244
|
export const defaultViewer3DSettings: ViewerSettings;
|
|
1245
|
+
export class LoadingSpinner {
|
|
1246
|
+
addToDOM(container: HTMLElement): void;
|
|
1247
|
+
removeFromDOM(container: HTMLElement): void;
|
|
1248
|
+
}
|
|
1249
|
+
export class CoreEventTypes {
|
|
1250
|
+
static VIEWER_RESIZE_EVENT: string;
|
|
1251
|
+
static VIEWER_MOUSE_DOWN_EVENT: string;
|
|
1252
|
+
static VIEWER_MOUSE_MOVE_EVENT: string;
|
|
1253
|
+
static VIEWER_MOUSE_UP_EVENT: string;
|
|
1254
|
+
static VIEWER_MOUSE_LONG_TOUCH_EVENT: string;
|
|
1255
|
+
static SETTING_CHANGED_EVENT: string;
|
|
1256
|
+
static SETTING_RESET_EVENT: string;
|
|
1257
|
+
static SETTING_LANGUAGE_CHANGED_EVENT: string;
|
|
1258
|
+
static SETTING_THEME_CHANGED_EVENT: string;
|
|
1259
|
+
}
|
|
1260
|
+
export interface IControl {
|
|
1261
|
+
container: HTMLElement;
|
|
1262
|
+
getId(): string;
|
|
1263
|
+
setToolTip(tooltipText: string): void;
|
|
1264
|
+
setText(text: string): void;
|
|
1265
|
+
}
|
|
1266
|
+
export class Control implements IControl {
|
|
1267
|
+
container: HTMLElement;
|
|
1268
|
+
|
|
1269
|
+
constructor(id: string);
|
|
1270
|
+
addClass(cssClass: string): void;
|
|
1271
|
+
removeClass(cssClass: string): void;
|
|
1272
|
+
getId(): string;
|
|
1273
|
+
setToolTip(tooltipText: string): void;
|
|
1274
|
+
setText(text: string): void;
|
|
1275
|
+
}
|
|
1276
|
+
export interface IMenu {
|
|
1277
|
+
controls: IControl[];
|
|
1278
|
+
addControl(control: IControl, index?: number): void;
|
|
1279
|
+
removeControl(index: number): void;
|
|
1280
|
+
}
|
|
1281
|
+
interface IToolbarButton {
|
|
1282
|
+
button: IControl;
|
|
1283
|
+
index: number;
|
|
1284
|
+
}
|
|
1285
|
+
export class Toolbar extends Control implements IMenu {
|
|
1286
|
+
readonly controls: IControl[];
|
|
1287
|
+
addControl(control: IControl, index?: number): void;
|
|
1288
|
+
removeControl(index: number): void;
|
|
1289
|
+
getControls(): IToolbarButton[];
|
|
1290
|
+
changeToolbarPosition(direction: ToolbarPosition): void;
|
|
1291
|
+
changeToolbarContentAlignment(content: ToolbarContentAlignment): void;
|
|
1292
|
+
}
|
|
1293
|
+
export {};
|
|
1294
|
+
export class ExtensionBase {
|
|
1295
|
+
protected _viewer: ViewerBase;
|
|
1296
|
+
protected _options: object;
|
|
1297
|
+
|
|
1298
|
+
constructor(viewer3D: ViewerBase, options?: object);
|
|
1299
|
+
load(): boolean | Promise<boolean>;
|
|
1300
|
+
unload(): boolean;
|
|
1301
|
+
activate(): boolean;
|
|
1302
|
+
deactivate(): boolean;
|
|
1303
|
+
/**
|
|
1304
|
+
* Gets the name of the extension.
|
|
1305
|
+
* @returns {string} Returns the name of the extension.
|
|
1306
|
+
*/
|
|
1307
|
+
getName(): string;
|
|
1308
|
+
onMouseDown(event: MouseEvent): void;
|
|
1309
|
+
onMouseMove(event: MouseEvent): void;
|
|
1310
|
+
onMouseUp(event: MouseEvent): void;
|
|
1311
|
+
onMouseLongTouch(event: MouseEvent): void;
|
|
1312
|
+
onToolbarCreated(toolbar: Toolbar): void;
|
|
1313
|
+
protected bindDomEvents(): void;
|
|
1314
|
+
}
|
|
1315
|
+
export class ExtensionManager {
|
|
1316
|
+
registerExtensionType(extensionId: string, extension: typeof ExtensionBase): boolean;
|
|
1317
|
+
unregisterExtensionType(extensionId: string): boolean;
|
|
1318
|
+
getExtensionType(extensionId: string): typeof ExtensionBase;
|
|
1319
|
+
}
|
|
1320
|
+
export const theExtensionManager: ExtensionManager;
|
|
1321
|
+
export class ExtensionLoader {
|
|
1322
|
+
/**
|
|
1323
|
+
* Loads the extension with the given id and options.
|
|
1324
|
+
*
|
|
1325
|
+
* @param {string} extensionId - The string id of the extension.
|
|
1326
|
+
* @param {object} options - An optional dictionary of options.
|
|
1327
|
+
*
|
|
1328
|
+
* @returns {Promise<ExtensionBase>} - Resolves with the extension requested.
|
|
1329
|
+
*/
|
|
1330
|
+
loadExtension(extensionId: string, options?: object): Promise<ExtensionBase>;
|
|
1331
|
+
/**
|
|
1332
|
+
* Unloads the extension with the given id.
|
|
1333
|
+
*
|
|
1334
|
+
* @param {string} extensionId - The string id of the extension.
|
|
1335
|
+
* @returns {Promise<boolean>} - True if the extension was successfully unloaded.
|
|
1336
|
+
*/
|
|
1337
|
+
unloadExtension(extensionId: string): Promise<boolean>;
|
|
1338
|
+
/**
|
|
1339
|
+
* Returns all loaded extensions.
|
|
1340
|
+
* @returns {?string[]} - Ids of loaded extensions.
|
|
1341
|
+
*/
|
|
1342
|
+
getExtensions(): string[];
|
|
1343
|
+
/**
|
|
1344
|
+
* Returns the loaded extension.
|
|
1345
|
+
* @param {string} extensionId - The string id of the extension.
|
|
1346
|
+
* @returns {?ExtensionBase} - Extension.
|
|
1347
|
+
*/
|
|
1348
|
+
getExtension(extensionId: string): ExtensionBase;
|
|
1349
|
+
}
|
|
1350
|
+
export type ErrorCallback = (message: string) => void;
|
|
1351
|
+
export type SuccessCallback = (modelId: any) => void;
|
|
1352
|
+
export enum DocumentType {
|
|
1353
|
+
UNKNOWN = 0,
|
|
1354
|
+
DOCUMENT_2D = 1,
|
|
1355
|
+
DOCUMENT_3D = 2
|
|
1356
|
+
}
|
|
1357
|
+
export const defaultBaseSettings: ViewerConfiguration;
|
|
1358
|
+
export abstract class ViewerBase {
|
|
1359
|
+
protected _clientContainer: HTMLElement;
|
|
1360
|
+
protected _loadingSpinner: LoadingSpinner;
|
|
1361
|
+
protected _documentType: DocumentType;
|
|
1362
|
+
protected _configuration: ViewerConfiguration;
|
|
1363
|
+
readonly container: HTMLElement;
|
|
1364
|
+
readonly extensionsLoader: ExtensionLoader;
|
|
1365
|
+
abstract settings: ISettings;
|
|
1366
|
+
abstract events: IEventsDispatcher;
|
|
1367
|
+
get rootContainer(): HTMLElement;
|
|
1368
|
+
getConfiguration(): ViewerConfiguration;
|
|
1369
|
+
/**
|
|
1370
|
+
*
|
|
1371
|
+
* @returns
|
|
1372
|
+
*/
|
|
1373
|
+
start(): Promise<number>;
|
|
1374
|
+
/**
|
|
1375
|
+
*
|
|
1376
|
+
*/
|
|
1377
|
+
finish(): void;
|
|
1378
|
+
onPostExtensionLoad(extension: ExtensionBase): void;
|
|
1379
|
+
protected loadExtensions(): void;
|
|
1380
|
+
protected setThemeFromSettings(): void;
|
|
1381
|
+
}
|
|
1319
1382
|
export enum IfcType {
|
|
1320
1383
|
IfcAbsorbedDoseMeasure = 0,
|
|
1321
1384
|
IfcAccelerationMeasure = 1,
|
|
@@ -2544,103 +2607,6 @@ export class ModelElementPropertyValue {
|
|
|
2544
2607
|
bool_value?: boolean;
|
|
2545
2608
|
get value(): unknown;
|
|
2546
2609
|
}
|
|
2547
|
-
export class ModelElementIds {
|
|
2548
|
-
modelPartId: string;
|
|
2549
|
-
elementIds: string[];
|
|
2550
|
-
}
|
|
2551
|
-
export class EventTypes extends CoreEventTypes {
|
|
2552
|
-
static SELECTION_CHANGED_EVENT: string;
|
|
2553
|
-
static MODEL_PART_LOADED: string;
|
|
2554
|
-
static MODEL_PART_UNLOADED: string;
|
|
2555
|
-
static CAMERA_CHANGE_EVENT: string;
|
|
2556
|
-
static CAMERA_NAVIGATION_MODE_CHANGED_EVENT: string;
|
|
2557
|
-
static RENDER_CLICK_EVENT: string;
|
|
2558
|
-
static RENDER_HOVER_EVENT: string;
|
|
2559
|
-
}
|
|
2560
|
-
export class SelectionChangedEvent extends Event {
|
|
2561
|
-
selectedIds: ModelElementIds[];
|
|
2562
|
-
}
|
|
2563
|
-
export class ModelPartEvent extends Event {
|
|
2564
|
-
modelPartId: string;
|
|
2565
|
-
}
|
|
2566
|
-
export class CameraEvent extends Event {
|
|
2567
|
-
}
|
|
2568
|
-
export class ClickedEvent extends Event {
|
|
2569
|
-
modelId: string;
|
|
2570
|
-
modelElementId: string;
|
|
2571
|
-
ctrlKey: boolean;
|
|
2572
|
-
}
|
|
2573
|
-
export class HoverEvent extends Event {
|
|
2574
|
-
modelId: string;
|
|
2575
|
-
modelElementId: string;
|
|
2576
|
-
}
|
|
2577
|
-
export interface INavigation {
|
|
2578
|
-
/**
|
|
2579
|
-
* Register navigation tool.
|
|
2580
|
-
*/
|
|
2581
|
-
registerNavigation(navigationTool: INavigationTool): void;
|
|
2582
|
-
/**
|
|
2583
|
-
* Unregister navigation tool.
|
|
2584
|
-
*/
|
|
2585
|
-
unregisterNavigation(navigationTool: INavigationTool): void;
|
|
2586
|
-
/**
|
|
2587
|
-
* Activate or deactivate registered navigation tool.
|
|
2588
|
-
* NB: There can be only one active navigation tool at time.
|
|
2589
|
-
*/
|
|
2590
|
-
setActive(navigationToolName: string, isActive: boolean): void;
|
|
2591
|
-
/**
|
|
2592
|
-
* Get active navigation tool.
|
|
2593
|
-
*/
|
|
2594
|
-
getActiveNavigation(): INavigationTool | null;
|
|
2595
|
-
/**
|
|
2596
|
-
* Get navigation agent.
|
|
2597
|
-
*/
|
|
2598
|
-
getNavigationAgent(): INavigationAgent;
|
|
2599
|
-
/**
|
|
2600
|
-
* Gets navigation area rectangle
|
|
2601
|
-
*/
|
|
2602
|
-
getNavigationArea(): DOMRect;
|
|
2603
|
-
/**
|
|
2604
|
-
* Sets the camera parameters.
|
|
2605
|
-
*/
|
|
2606
|
-
setCameraParameters(params: CameraParameters): void;
|
|
2607
|
-
/**
|
|
2608
|
-
* Gets the camera parameters.
|
|
2609
|
-
*/
|
|
2610
|
-
getCameraParameters(): CameraParameters;
|
|
2611
|
-
/**
|
|
2612
|
-
* Gets the camera control.
|
|
2613
|
-
*/
|
|
2614
|
-
getCameraControl(): ICameraControl;
|
|
2615
|
-
/**
|
|
2616
|
-
* Gets the Three.js camera.
|
|
2617
|
-
*/
|
|
2618
|
-
getCamera(): THREE.Camera;
|
|
2619
|
-
/**
|
|
2620
|
-
* Fits camera to objects by IDs.
|
|
2621
|
-
* @param {string[] | string} elementIds - element or array of elements
|
|
2622
|
-
* @param {string | ModelPart} modelPart - the model part id or the model part instance containing the elements.
|
|
2623
|
-
* @param {boolean} immediate - true to avoid the default transition.
|
|
2624
|
-
* @returns
|
|
2625
|
-
*/
|
|
2626
|
-
fitToView(elementIds: string[] | string, modelPart: string | ModelPart, immediate?: boolean): void;
|
|
2627
|
-
/**
|
|
2628
|
-
* Sets the camera pivot point.
|
|
2629
|
-
*/
|
|
2630
|
-
setPivotPoint(point: Point3): void;
|
|
2631
|
-
/**
|
|
2632
|
-
* Gets the camera pivot point.
|
|
2633
|
-
*/
|
|
2634
|
-
getPivotPoint(): Point3;
|
|
2635
|
-
/**
|
|
2636
|
-
* Reset the camera pivot point.
|
|
2637
|
-
*/
|
|
2638
|
-
resetPivotPoint(): void;
|
|
2639
|
-
}
|
|
2640
|
-
export class ModelLoadingOptions {
|
|
2641
|
-
guid: string;
|
|
2642
|
-
isConsolidatedModel?: boolean;
|
|
2643
|
-
}
|
|
2644
2610
|
/**
|
|
2645
2611
|
* This class describes the coordination model. The coordination model contains parts of the model (aka ModelPart).
|
|
2646
2612
|
*/
|
|
@@ -2754,12 +2720,41 @@ export class Model {
|
|
|
2754
2720
|
*/
|
|
2755
2721
|
getElementProperties(elementId: string, modelPart?: string | ModelPart, version?: bigint): ModelElementPropertySet[];
|
|
2756
2722
|
}
|
|
2723
|
+
export class EventTypes extends CoreEventTypes {
|
|
2724
|
+
static MODEL_PART_LOADED: string;
|
|
2725
|
+
static MODEL_PART_UNLOADED: string;
|
|
2726
|
+
static VIRTUAL_ORIGIN_CHANGED: string;
|
|
2727
|
+
static SELECTION_CHANGED_EVENT: string;
|
|
2728
|
+
static CAMERA_CHANGE_EVENT: string;
|
|
2729
|
+
static CAMERA_NAVIGATION_MODE_CHANGED_EVENT: string;
|
|
2730
|
+
static RENDER_CLICK_EVENT: string;
|
|
2731
|
+
static RENDER_HOVER_EVENT: string;
|
|
2732
|
+
static RENDER_DOUBLE_CLICK_EVENT: string;
|
|
2733
|
+
}
|
|
2734
|
+
export class ModelPartEvent extends Event {
|
|
2735
|
+
modelPartId: string;
|
|
2736
|
+
}
|
|
2737
|
+
export class VirtualOriginEvent extends Event {
|
|
2738
|
+
virtualOrigin: Point3;
|
|
2739
|
+
delta: Point3;
|
|
2740
|
+
}
|
|
2741
|
+
export class ModelLoadingOptions {
|
|
2742
|
+
guid: string;
|
|
2743
|
+
isConsolidatedModel?: boolean;
|
|
2744
|
+
}
|
|
2757
2745
|
export let ViewerInstance: Viewer3D;
|
|
2758
2746
|
export class Viewer3D extends ViewerBase {
|
|
2759
2747
|
protected _configuration: Viewer3DConfiguration;
|
|
2760
2748
|
settings: Readonly<ISettings>;
|
|
2749
|
+
events: Readonly<IEventsDispatcher>;
|
|
2750
|
+
/**
|
|
2751
|
+
* Returns general model
|
|
2752
|
+
* @returns { Model } - general model
|
|
2753
|
+
*/
|
|
2754
|
+
get model(): Model;
|
|
2755
|
+
get renderView(): IRenderViewer3D;
|
|
2756
|
+
get canvas(): HTMLCanvasElement;
|
|
2761
2757
|
get navigation(): INavigation;
|
|
2762
|
-
events: Readonly<IEventsDispatcher>;
|
|
2763
2758
|
getConfiguration(): Viewer3DConfiguration;
|
|
2764
2759
|
start(): Promise<number>;
|
|
2765
2760
|
finish(): void;
|
|
@@ -2776,13 +2771,8 @@ export class Viewer3D extends ViewerBase {
|
|
|
2776
2771
|
* @param modelPart - model part id or model part instance
|
|
2777
2772
|
*/
|
|
2778
2773
|
unloadModelPart(modelPart?: string | ModelPart): void;
|
|
2779
|
-
|
|
2780
|
-
|
|
2781
|
-
* @returns { Model } - general model
|
|
2782
|
-
*/
|
|
2783
|
-
get model(): Model;
|
|
2784
|
-
get renderView(): IRenderViewer3D;
|
|
2785
|
-
get canvas(): HTMLCanvasElement;
|
|
2774
|
+
setVirtualOrigin(point: Point3): void;
|
|
2775
|
+
getVirtualOrigin(): Point3;
|
|
2786
2776
|
/**
|
|
2787
2777
|
* Makes screenshot
|
|
2788
2778
|
* @param {string} [mimeType=image/png] Image MIME type.
|
|
@@ -2792,16 +2782,26 @@ export class Viewer3D extends ViewerBase {
|
|
|
2792
2782
|
makeScreenshot(mimeType?: string, quality?: number): Promise<Blob>;
|
|
2793
2783
|
setThemeFromSettings(): void;
|
|
2794
2784
|
}
|
|
2785
|
+
export class ViewerToolbar extends Toolbar {
|
|
2786
|
+
}
|
|
2795
2787
|
export class GuiViewer3D extends Viewer3D {
|
|
2796
2788
|
loadModelPart(buffer: ArrayBuffer, options: ModelLoadingOptions, onSuccessCallback: SuccessCallback, onErrorCallback: ErrorCallback): void;
|
|
2797
2789
|
getToolbar(): ViewerToolbar;
|
|
2798
2790
|
onPostExtensionLoad(extension: ExtensionBase): void;
|
|
2799
2791
|
protected getToolbarHeight(): number;
|
|
2800
2792
|
}
|
|
2793
|
+
export abstract class SettingsBase implements ISettings {
|
|
2794
|
+
protected _eventDispatcher: IEventsDispatcher;
|
|
2795
|
+
protected _storage: ISettingsStorage;
|
|
2796
|
+
changeSetting<T>(name: string, value: T, notify?: boolean, providedData?: any): void;
|
|
2797
|
+
getSettingValue<T>(name: string): T;
|
|
2798
|
+
protected abstract getKeyWithPrefix(key: string): string;
|
|
2799
|
+
}
|
|
2801
2800
|
export type InitializeSuccessCallback = () => void;
|
|
2802
2801
|
export function coreInitializer(options: InitializerOptions, callback: InitializeSuccessCallback): void;
|
|
2803
2802
|
export function coreShutdown(): void;
|
|
2804
2803
|
export function CreateViewer(container: HTMLElement, configuration?: Viewer3DConfiguration): GuiViewer3D;
|
|
2804
|
+
export function CreateBasicViewer(container: HTMLElement, configuration?: Viewer3DConfiguration): Viewer3D;
|
|
2805
2805
|
/**
|
|
2806
2806
|
* @param options
|
|
2807
2807
|
* @param callback
|
|
@@ -2813,6 +2813,230 @@ export class Extension extends ExtensionBase {
|
|
|
2813
2813
|
|
|
2814
2814
|
constructor(viewer: Viewer3D, options?: object);
|
|
2815
2815
|
}
|
|
2816
|
+
export class GizmoMaterials {
|
|
2817
|
+
static gizmoMaterial: THREE.MeshBasicMaterial;
|
|
2818
|
+
static matInvisible: THREE.MeshBasicMaterial;
|
|
2819
|
+
static matRed: THREE.MeshBasicMaterial;
|
|
2820
|
+
static matGreen: THREE.MeshBasicMaterial;
|
|
2821
|
+
static matBlue: THREE.MeshBasicMaterial;
|
|
2822
|
+
static matYellow: THREE.MeshBasicMaterial;
|
|
2823
|
+
static matViolet: THREE.MeshBasicMaterial;
|
|
2824
|
+
static matYellowTransparent: THREE.MeshBasicMaterial;
|
|
2825
|
+
static init(): void;
|
|
2826
|
+
}
|
|
2827
|
+
export interface IGizmoObject extends THREE.Object3D {
|
|
2828
|
+
getHovered(): boolean;
|
|
2829
|
+
setHovered(value: boolean): void;
|
|
2830
|
+
getActive(): boolean;
|
|
2831
|
+
setActive(value: boolean): void;
|
|
2832
|
+
dispose(): void;
|
|
2833
|
+
}
|
|
2834
|
+
export class GizmoObject extends THREE.Object3D implements IGizmoObject {
|
|
2835
|
+
protected _meshes: THREE.Mesh[];
|
|
2836
|
+
readonly baseMaterial: THREE.Material;
|
|
2837
|
+
readonly hoverMaterial: THREE.Material;
|
|
2838
|
+
readonly activeMaterial: THREE.Material;
|
|
2839
|
+
|
|
2840
|
+
constructor(_meshes: THREE.Mesh[], baseMaterial?: THREE.Material, hoverMaterial?: THREE.Material, activeMaterial?: THREE.Material);
|
|
2841
|
+
getHovered(): boolean;
|
|
2842
|
+
setHovered(value: boolean): void;
|
|
2843
|
+
getActive(): boolean;
|
|
2844
|
+
setActive(value: boolean): void;
|
|
2845
|
+
dispose(): void;
|
|
2846
|
+
raycast(raycaster: THREE.Raycaster, intersects: THREE.Intersection<THREE.Object3D<THREE.Event>>[]): void;
|
|
2847
|
+
}
|
|
2848
|
+
export abstract class GizmoAxis extends THREE.Object3D implements IGizmoObject {
|
|
2849
|
+
readonly handle: IGizmoObject;
|
|
2850
|
+
readonly picker?: IGizmoObject;
|
|
2851
|
+
readonly helper?: IGizmoObject;
|
|
2852
|
+
protected _isHovered: boolean;
|
|
2853
|
+
protected _isActive: boolean;
|
|
2854
|
+
protected _plane: THREE.Plane;
|
|
2855
|
+
protected _axisDir: THREE.Vector3;
|
|
2856
|
+
protected _raycaster: THREE.Raycaster;
|
|
2857
|
+
protected _worldPositionStart: THREE.Vector3;
|
|
2858
|
+
protected _worldQuaternionStart: THREE.Quaternion;
|
|
2859
|
+
protected _worldAxisDir: THREE.Vector3;
|
|
2860
|
+
protected _startPoint: THREE.Vector3;
|
|
2861
|
+
protected _endPoint: THREE.Vector3;
|
|
2862
|
+
getActive(): boolean;
|
|
2863
|
+
setActive(value: boolean): void;
|
|
2864
|
+
getHovered(): boolean;
|
|
2865
|
+
setHovered(value: boolean): void;
|
|
2866
|
+
dispose(): void;
|
|
2867
|
+
raycast(raycaster: THREE.Raycaster, intersects: THREE.Intersection<THREE.Object3D<THREE.Event>>[]): void;
|
|
2868
|
+
abstract moveByNdcPt(ndcPos: THREE.Vector2, camera: THREE.Camera): THREE.Matrix4;
|
|
2869
|
+
protected abstract updateGizmoPlane(camera: THREE.Camera): void;
|
|
2870
|
+
protected setStartPt(ndcPos: THREE.Vector2, camera: THREE.Camera): void;
|
|
2871
|
+
}
|
|
2872
|
+
export class GizmoTranslationAxis extends GizmoAxis {
|
|
2873
|
+
readonly handle: IGizmoObject;
|
|
2874
|
+
readonly picker?: IGizmoObject;
|
|
2875
|
+
readonly helper?: IGizmoObject;
|
|
2876
|
+
|
|
2877
|
+
constructor(axisDir: THREE.Vector3, handle: IGizmoObject, picker?: IGizmoObject, helper?: IGizmoObject);
|
|
2878
|
+
moveByNdcPt(ndcPos: THREE.Vector2, camera: THREE.Camera): THREE.Matrix4;
|
|
2879
|
+
protected updateGizmoPlane(camera: THREE.Camera): void;
|
|
2880
|
+
}
|
|
2881
|
+
export class GizmoRotationAxis extends GizmoAxis {
|
|
2882
|
+
readonly handle: IGizmoObject;
|
|
2883
|
+
readonly picker?: IGizmoObject;
|
|
2884
|
+
readonly helper?: IGizmoObject;
|
|
2885
|
+
moveByNdcPt(ndcPos: THREE.Vector2, camera: THREE.Camera): THREE.Matrix4;
|
|
2886
|
+
protected updateGizmoPlane(camera: THREE.Camera): void;
|
|
2887
|
+
}
|
|
2888
|
+
export class GizmoScaleAxis extends GizmoAxis {
|
|
2889
|
+
readonly handle: IGizmoObject;
|
|
2890
|
+
readonly picker?: IGizmoObject;
|
|
2891
|
+
readonly helper?: IGizmoObject;
|
|
2892
|
+
moveByNdcPt(ndcPos: THREE.Vector2, camera: THREE.Camera): THREE.Matrix4;
|
|
2893
|
+
protected updateGizmoPlane(camera: THREE.Camera): void;
|
|
2894
|
+
}
|
|
2895
|
+
export class GizmoControl extends THREE.Object3D {
|
|
2896
|
+
|
|
2897
|
+
constructor(camera: THREE.Camera, navAgent: INavigationAgent);
|
|
2898
|
+
attachTo(object: THREE.Object3D, asChild?: boolean): void;
|
|
2899
|
+
detach(): void;
|
|
2900
|
+
addAxis(axis: GizmoAxis): void;
|
|
2901
|
+
dispose(): void;
|
|
2902
|
+
updateMatrixWorld(force?: boolean): void;
|
|
2903
|
+
updateGizmoOffset(position?: THREE.Vector3, quaternion?: THREE.Quaternion): void;
|
|
2904
|
+
}
|
|
2905
|
+
export enum GizmoAxisDir {
|
|
2906
|
+
NONE = 0,
|
|
2907
|
+
X = 1,
|
|
2908
|
+
Y = 2,
|
|
2909
|
+
Z = 4,
|
|
2910
|
+
XY = 3,
|
|
2911
|
+
YZ = 6,
|
|
2912
|
+
XZ = 5,
|
|
2913
|
+
XYZ = 7
|
|
2914
|
+
}
|
|
2915
|
+
export class GizmoBuilder {
|
|
2916
|
+
static build(camera: THREE.Camera, navAgent: INavigationAgent, translation?: GizmoAxisDir, rotation?: GizmoAxisDir, scale?: GizmoAxisDir): GizmoControl;
|
|
2917
|
+
static buildTranslationAxis(axisDir: THREE.Vector3, handleBaseMatrial?: THREE.Material, handleHoveredMaterial?: THREE.Material, handleSelectedMaterial?: THREE.Material, pickerBaseMatrial?: THREE.Material, pickerHoveredMaterial?: THREE.Material, pickerSelectedMaterial?: THREE.Material): GizmoAxis;
|
|
2918
|
+
static buildRotationAxis(axisDir: THREE.Vector3, handleBaseMatrial?: THREE.Material, handleHoveredMaterial?: THREE.Material, handleSelectedMaterial?: THREE.Material, pickerBaseMatrial?: THREE.Material, pickerHoveredMaterial?: THREE.Material, pickerSelectedMaterial?: THREE.Material): GizmoAxis;
|
|
2919
|
+
static buildScaleAxis(axisDir: THREE.Vector3, handleBaseMatrial?: THREE.Material, handleHoveredMaterial?: THREE.Material, handleSelectedMaterial?: THREE.Material): GizmoAxis;
|
|
2920
|
+
}
|
|
2921
|
+
export interface LabelSpriteParameters {
|
|
2922
|
+
text?: string | undefined;
|
|
2923
|
+
sizeAttenuation?: boolean | undefined;
|
|
2924
|
+
fontFace?: string | FontFace | undefined;
|
|
2925
|
+
fontSize?: number | undefined;
|
|
2926
|
+
borderColor?: Color | undefined;
|
|
2927
|
+
backgroundColor?: Color | undefined;
|
|
2928
|
+
borderThickness?: number | undefined;
|
|
2929
|
+
borderRadius?: number | undefined;
|
|
2930
|
+
textColor?: Color | undefined;
|
|
2931
|
+
textPadding?: THREE.Vector4Tuple | undefined;
|
|
2932
|
+
}
|
|
2933
|
+
export class LabelSprite extends THREE.Sprite {
|
|
2934
|
+
readonly extraHeightFactor = 1.4;
|
|
2935
|
+
|
|
2936
|
+
constructor(parameters: LabelSpriteParameters);
|
|
2937
|
+
get sizeAttenuation(): boolean;
|
|
2938
|
+
set sizeAttenuation(value: boolean);
|
|
2939
|
+
/**
|
|
2940
|
+
* @default ''
|
|
2941
|
+
*/
|
|
2942
|
+
get text(): string;
|
|
2943
|
+
set text(value: string);
|
|
2944
|
+
/**
|
|
2945
|
+
* @default 'Roboto, sans-serif'
|
|
2946
|
+
*/
|
|
2947
|
+
get fontFace(): string | FontFace;
|
|
2948
|
+
set fontFace(value: string | FontFace);
|
|
2949
|
+
/**
|
|
2950
|
+
* @default 12
|
|
2951
|
+
*/
|
|
2952
|
+
get fontSize(): number;
|
|
2953
|
+
set fontSize(value: number);
|
|
2954
|
+
/**
|
|
2955
|
+
* @default 2
|
|
2956
|
+
*/
|
|
2957
|
+
get borderThickness(): number;
|
|
2958
|
+
set borderThickness(value: number);
|
|
2959
|
+
/**
|
|
2960
|
+
* @default new Color(0, 0, 0, 1.0)
|
|
2961
|
+
*/
|
|
2962
|
+
get borderColor(): Color;
|
|
2963
|
+
set borderColor(value: Color);
|
|
2964
|
+
/**
|
|
2965
|
+
* @default 1
|
|
2966
|
+
*/
|
|
2967
|
+
get borderRadius(): number;
|
|
2968
|
+
set borderRadius(value: number);
|
|
2969
|
+
/**
|
|
2970
|
+
* @default new Color(1.0, 1.0, 1.0, 1.0)
|
|
2971
|
+
*/
|
|
2972
|
+
get backgroundColor(): Color;
|
|
2973
|
+
set backgroundColor(value: Color);
|
|
2974
|
+
/**
|
|
2975
|
+
* @default new Color(0, 0, 0, 1.0)
|
|
2976
|
+
*/
|
|
2977
|
+
get textColor(): Color;
|
|
2978
|
+
set textColor(value: Color);
|
|
2979
|
+
/**
|
|
2980
|
+
* Label text padding: left, top, right, bottom
|
|
2981
|
+
* @default [0, 0, 0, 0]
|
|
2982
|
+
*/
|
|
2983
|
+
get textPadding(): THREE.Vector4Tuple;
|
|
2984
|
+
set textPadding(value: THREE.Vector4Tuple);
|
|
2985
|
+
dispose(): void;
|
|
2986
|
+
}
|
|
2987
|
+
export interface MeshPointMaterialParameters extends THREE.ShaderMaterialParameters {
|
|
2988
|
+
sizeAttenuation?: boolean | undefined;
|
|
2989
|
+
discreteClipping?: boolean | undefined;
|
|
2990
|
+
}
|
|
2991
|
+
export class MeshPointMaterial extends CustomMaterial {
|
|
2992
|
+
|
|
2993
|
+
constructor(parameters?: MeshPointMaterialParameters);
|
|
2994
|
+
/**
|
|
2995
|
+
* @default true
|
|
2996
|
+
*/
|
|
2997
|
+
sizeAttenuation: boolean;
|
|
2998
|
+
/**
|
|
2999
|
+
* @default true
|
|
3000
|
+
*/
|
|
3001
|
+
get discreteClipping(): boolean;
|
|
3002
|
+
set discreteClipping(value: boolean);
|
|
3003
|
+
get resolution(): THREE.Vector2;
|
|
3004
|
+
set resolution(value: THREE.Vector2);
|
|
3005
|
+
protected refreshUniformsCommon(uniforms: {
|
|
3006
|
+
[uniform: string]: THREE.IUniform;
|
|
3007
|
+
}, material: MeshPointMaterial, renderer: THREE.WebGLRenderer): void;
|
|
3008
|
+
protected onBeforeRender(renderer: THREE.WebGLRenderer, scene: THREE.Scene, camera: THREE.Camera, geometry: THREE.BufferGeometry, material: THREE.Material, group: THREE.Group): void;
|
|
3009
|
+
copy(source: MeshPointMaterial): this;
|
|
3010
|
+
}
|
|
3011
|
+
export interface MeshPointParamter {
|
|
3012
|
+
point?: THREE.Vector3;
|
|
3013
|
+
color?: Color;
|
|
3014
|
+
size?: number;
|
|
3015
|
+
}
|
|
3016
|
+
export class MeshPoints extends THREE.Mesh {
|
|
3017
|
+
geometry: THREE.InstancedBufferGeometry;
|
|
3018
|
+
material: MeshPointMaterial;
|
|
3019
|
+
|
|
3020
|
+
constructor();
|
|
3021
|
+
/**
|
|
3022
|
+
* @default new Color( 1,1,1,1 )
|
|
3023
|
+
*/
|
|
3024
|
+
color: Color;
|
|
3025
|
+
/**
|
|
3026
|
+
* @default 1
|
|
3027
|
+
*/
|
|
3028
|
+
pointSize: number;
|
|
3029
|
+
/**
|
|
3030
|
+
* @default new THREE.Vector3(0, 0, 0)
|
|
3031
|
+
*/
|
|
3032
|
+
point: THREE.Vector3;
|
|
3033
|
+
addPoint(pointParameter?: MeshPointParamter): number;
|
|
3034
|
+
updatePoint(index: number, pointParameter: MeshPointParamter): void;
|
|
3035
|
+
removePoint(index: number): this;
|
|
3036
|
+
updateAttributes(): void;
|
|
3037
|
+
dispose(): void;
|
|
3038
|
+
raycast(raycaster: THREE.Raycaster, intersects: THREE.Intersection<THREE.Object3D<THREE.Event>>[]): void;
|
|
3039
|
+
}
|
|
2816
3040
|
export interface IWindowStyle {
|
|
2817
3041
|
width: string;
|
|
2818
3042
|
height: string;
|
|
@@ -2840,36 +3064,20 @@ export class Dragger {
|
|
|
2840
3064
|
constructor(allowedDraggableElement: HTMLElement, draggableContainer: HTMLElement, containerToRestriction: HTMLElement, windowStater?: WindowStater);
|
|
2841
3065
|
get windowState(): IWindowStyle | null;
|
|
2842
3066
|
}
|
|
2843
|
-
export namespace
|
|
2844
|
-
|
|
2845
|
-
|
|
2846
|
-
|
|
2847
|
-
|
|
2848
|
-
|
|
2849
|
-
const VIEWER_ADD_CLIPPING_PLANE_ICON: string;
|
|
2850
|
-
const VIEWER_CLIPPING_FLIP_ICON: string;
|
|
2851
|
-
const VIEWER_DELETE_CLIPPING_PLANE_ICON: string;
|
|
2852
|
-
const VIEWER_CLIPPING_CUBE_ICON: string;
|
|
2853
|
-
const VIEWER_DISABLED_DELETE_CLIPPING_PLANE_ICON: string;
|
|
2854
|
-
const VIEWER_DISABLED_CLIPPING_FLIP_ICON: string;
|
|
2855
|
-
const VIEWER_ADD_REMARK_ICON: string;
|
|
2856
|
-
}
|
|
2857
|
-
export namespace ViewerGeneralIcons {
|
|
2858
|
-
const ZOOM_IN: string;
|
|
2859
|
-
const ZOOM_OUT: string;
|
|
2860
|
-
const CLOSE: string;
|
|
2861
|
-
const STRETCH_WINDOW: string;
|
|
2862
|
-
const EXPAND_TREE: string;
|
|
2863
|
-
const COLLAPSE_TREE: string;
|
|
2864
|
-
const ARROW_DROP_DOWN: string;
|
|
2865
|
-
const ARROW_DROP_RIGHT: string;
|
|
3067
|
+
export namespace ControlState {
|
|
3068
|
+
enum State {
|
|
3069
|
+
ACTIVE = 0,
|
|
3070
|
+
INACTIVE = 1,
|
|
3071
|
+
DISABLED = 2
|
|
3072
|
+
}
|
|
2866
3073
|
}
|
|
2867
3074
|
export class Button extends Control {
|
|
2868
3075
|
|
|
2869
3076
|
constructor(id: string);
|
|
2870
3077
|
setIsChecked(value: boolean): void;
|
|
2871
|
-
setState(state:
|
|
2872
|
-
|
|
3078
|
+
setState(state: ControlState.State): boolean;
|
|
3079
|
+
setText(text: string): void;
|
|
3080
|
+
getState(): ControlState.State;
|
|
2873
3081
|
setIcon(iconClassName: string): void;
|
|
2874
3082
|
setFromSvgTemlate(template: string): void;
|
|
2875
3083
|
/**
|
|
@@ -2889,16 +3097,36 @@ export class Button extends Control {
|
|
|
2889
3097
|
onMouseOut: (event: MouseEvent) => void;
|
|
2890
3098
|
}
|
|
2891
3099
|
export namespace Button {
|
|
2892
|
-
enum State {
|
|
2893
|
-
ACTIVE = 0,
|
|
2894
|
-
INACTIVE = 1,
|
|
2895
|
-
DISABLED = 2
|
|
2896
|
-
}
|
|
2897
3100
|
enum Event {
|
|
2898
3101
|
STATE_CHANGED = "Button.StateChanged",
|
|
2899
3102
|
CLICK = "click"
|
|
2900
3103
|
}
|
|
2901
3104
|
}
|
|
3105
|
+
export class SubMenu implements IMenu {
|
|
3106
|
+
readonly controls: IControl[];
|
|
3107
|
+
set selectedIndex(value: number);
|
|
3108
|
+
get selectedIndex(): number;
|
|
3109
|
+
addControl(control: IControl, index?: number): void;
|
|
3110
|
+
removeControl(index?: number): void;
|
|
3111
|
+
clearList(): void;
|
|
3112
|
+
changeControl(item: IControl, index: number): void;
|
|
3113
|
+
getControlsCount(): number;
|
|
3114
|
+
}
|
|
3115
|
+
export class ComboButton extends Control {
|
|
3116
|
+
|
|
3117
|
+
constructor(id: string, selectedIndex?: number);
|
|
3118
|
+
get subMenu(): SubMenu;
|
|
3119
|
+
/**
|
|
3120
|
+
* Override this method to be notified when the user clicks on the button.
|
|
3121
|
+
* @param {MouseEvent} event
|
|
3122
|
+
*/
|
|
3123
|
+
onClick: (event: PointerEvent) => void;
|
|
3124
|
+
onOpen: () => void;
|
|
3125
|
+
onClose: () => void;
|
|
3126
|
+
setState(state: ControlState.State): boolean;
|
|
3127
|
+
setText(text: string): void;
|
|
3128
|
+
setFromSvgTemlate(template: string): void;
|
|
3129
|
+
}
|
|
2902
3130
|
interface ElementClass {
|
|
2903
3131
|
panelClassName?: string;
|
|
2904
3132
|
contentClassName?: string;
|