@pilotdev/pilot-web-3d 23.0.6 → 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.
Files changed (2) hide show
  1. package/index.d.ts +908 -831
  2. package/package.json +1 -1
package/index.d.ts CHANGED
@@ -1,225 +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
- class Global {
8
- G: any;
9
- RESOURCE_ROOT: string;
10
- initializeResourceRoot(options: InitializerOptions): void;
11
- getResourceUrl(resourceRelativePath: string): string;
12
- }
13
- export const global: Global;
14
- export {};
15
- export type StringMap = {
16
- [key: string]: any;
17
- };
18
- export class Localization {
19
- static initialize(options: any): Promise<void>;
20
- static translate<T extends (string | StringMap) = string>(stringToTrans: string): T;
21
- static setLanguage(language: string): Promise<void>;
22
- static extendLocalization(locales: any): boolean;
23
- }
24
- export class LoadingSpinner {
25
- addToDOM(container: HTMLElement): void;
26
- removeFromDOM(container: HTMLElement): void;
27
- }
28
- export class ExtensionManager {
29
- registerExtensionType(extensionId: string, extension: typeof ExtensionBase): boolean;
30
- unregisterExtensionType(extensionId: string): boolean;
31
- getExtensionType(extensionId: string): typeof ExtensionBase;
32
- }
33
- export const theExtensionManager: ExtensionManager;
34
- export class ExtensionLoader {
35
- loadExtension(extensionId: string): Promise<ExtensionBase>;
36
- unloadExtension(extensionId: string): Promise<boolean>;
37
- getExtensions(): string[];
38
- getExtension(extensionId: string): ExtensionBase;
39
- }
40
- export interface ILayerManager {
41
- createLayer(name: string): ILayer;
42
- deleteLayer(name: string): boolean;
43
- getLayer(name: string): ILayer | null;
44
- hasLayer(name: string): boolean;
45
- }
46
- export interface ILayer {
47
- addOverlay(overlay: Overlay): boolean;
48
- removeOverlay(overlay: Overlay): boolean;
49
- getOverlays(): Overlay[];
50
- getContainer(): LayerContainer;
51
- getViewBox(): LayerViewBox;
52
- dispose(): void;
53
- }
54
- export type Overlay = HTMLElement | any;
55
- export type LayerContainer = HTMLElement | any;
56
- export type LayerViewBox = DOMRect | any;
57
- export interface IEventsDispatcher {
58
- addEventListener(event: string, listener: EventListener, options?: object): void;
59
- removeEventListener(event: string, listener: EventListener): void;
60
- hasEventListener(event: string, listener: EventListener): boolean;
61
- dispatchEvent(event: string | Event): void;
62
- dispatchEventAsync(event: string | Event): void;
63
- clearListeners(): void;
64
- }
65
- export class CoreEventTypes {
66
- static VIEWER_RESIZE_EVENT: string;
67
- static VIEWER_MOUSE_DOWN_EVENT: string;
68
- static VIEWER_MOUSE_MOVE_EVENT: string;
69
- static VIEWER_MOUSE_UP_EVENT: string;
70
- static VIEWER_MOUSE_LONG_TOUCH_EVENT: string;
71
- static SETTING_CHANGED_EVENT: string;
72
- static SETTING_RESET_EVENT: string;
73
- static SETTING_LANGUAGE_CHANGED_EVENT: string;
74
- }
75
- export interface ISettingsStorage {
76
- clear(): void;
77
- getItem<T>(key: string): T | null;
78
- removeItem(key: string): void;
79
- setItem<T>(key: string, value: T): void;
80
- getKeys(): string[];
81
- }
82
- export class SettingsStorageFactory {
83
- getSettingsStorage(): ISettingsStorage;
84
- }
85
- export class LocalSettingsStorage implements ISettingsStorage {
86
- clear(): void;
87
- getItem<T>(key: string): T | null;
88
- removeItem(key: string): void;
89
- setItem<T>(key: string, value: T): void;
90
- getKeys(): string[];
91
- }
92
- export class InMemorySettingsStorage implements ISettingsStorage {
93
- clear(): void;
94
- getItem<T>(key: string): T | null;
95
- removeItem(key: string): void;
96
- setItem<T>(key: string, value: T): void;
97
- getKeys(): string[];
98
- }
99
- export interface ISettings {
100
- changeSetting<T>(name: string, value: T, notify?: boolean, providedData?: any): void;
101
- getSettingValue<T>(name: string): T;
102
- }
103
- export enum BaseSettingsNames {
104
- TOOLBAR = "toolbar",
105
- TOOLBAR_DIRECTION = "toolbarDirection",
106
- TOOLBAR_CONTENT = "toolbarContent",
107
- THEME = "theme"
108
- }
109
- export class SettingChangedEvent extends Event {
110
- name: string;
111
- oldValue: any;
112
- newValue: any;
113
- providedData: any;
114
- }
115
- export abstract class SettingsBase implements ISettings {
116
- protected _eventDispatcher: IEventsDispatcher;
117
- protected _storage: ISettingsStorage;
118
- changeSetting<T>(name: string, value: T, notify?: boolean, providedData?: any): void;
119
- getSettingValue<T>(name: string): T;
120
- protected abstract getKeyWithPrefix(key: string): string;
121
- }
122
- export enum SettingsTheme {
123
- LIGHT_THEME = "ascn-light",
124
- DARK_THEME = "ascn-dark"
125
- }
126
- export const defaultThemeAppearance: string;
127
- export enum ToolbarDirection {
128
- TOP_FIXED = "ascn-toolbar-direction-fixed-top",
129
- TOP_FLUENT = "ascn-toolbar-direction-top",
130
- BOTTOM_FIXED = "ascn-toolbar-direction-fixed-bottom",
131
- BOTTOM_FLUENT = "ascn-toolbar-direction-bottom"
132
- }
133
- export enum ToolbarContent {
134
- CENTER = "ascn-toolbar-content-center",
135
- START = "ascn-toolbar-content-start",
136
- END = "ascn-toolbar-content-end"
137
- }
138
- export interface ToolbarStyle {
139
- [BaseSettingsNames.TOOLBAR_DIRECTION]?: ToolbarDirection;
140
- [BaseSettingsNames.TOOLBAR_CONTENT]?: ToolbarContent;
141
- }
142
- export const defaultToolbarAppearance: ToolbarStyle;
143
- export type ViewerSettings = Record<string, any>;
144
- export class ViewerConfiguration {
145
- settingsPrefix: string;
146
- appearance: ViewerSettings;
147
- createConfiguration(configuration: ViewerSettings, origin: ViewerSettings): void;
148
- mergeConfigurationAndSettings(configuration: ViewerSettings, settings: ISettings): void;
149
- changeTheme(newTheme: string): void;
150
- }
151
- export type ErrorCallback = (message: string) => void;
152
- export type SuccessCallback = (modelId: any) => void;
153
- export enum DocumentType {
154
- UNKNOWN = 0,
155
- DOCUMENT_2D = 1,
156
- DOCUMENT_3D = 2
157
- }
158
- export const defaultBaseSettings: ViewerConfiguration;
159
- export abstract class ViewerBase {
160
- protected _clientContainer: HTMLElement;
161
- protected _loadingSpinner: LoadingSpinner;
162
- protected _documentType: DocumentType;
163
- protected _configuration: ViewerConfiguration;
164
- readonly container: HTMLElement;
165
- readonly layerManagers: Map<number, ILayerManager>;
166
- readonly extensionsLoader: ExtensionLoader;
167
- abstract settings: ISettings;
168
- abstract events: IEventsDispatcher;
169
- get rootContainer(): HTMLElement;
170
- getConfiguration(): ViewerConfiguration;
171
- /**
172
- *
173
- * @returns
174
- */
175
- start(): Promise<number>;
176
- /**
177
- *
178
- */
179
- finish(): void;
180
- onPostExtensionLoad(extension: ExtensionBase): void;
181
- protected loadExtensions(): void;
182
- protected setThemeFromSettings(): void;
183
- }
184
- export class Control {
185
- container: HTMLElement;
186
-
187
- constructor(id: string);
188
- addClass(cssClass: string): void;
189
- removeClass(cssClass: string): void;
190
- getId(): string;
191
- setToolTip(tooltipText: string): void;
192
- }
193
- export class Toolbar extends Control {
194
-
195
- constructor(id: string, toolbarContainer: HTMLElement, options?: ToolbarStyle);
196
- addControl(control: Control, index?: number): void;
197
- removeControl(id: string): void;
198
- changeToolbarPosition(direction: string): void;
199
- changeToolbarContent(content: string): void;
200
- }
201
- export class ExtensionBase {
202
- protected _viewer: ViewerBase;
203
-
204
- constructor(viewer3D: ViewerBase, options?: any);
205
- load(): boolean | Promise<boolean>;
206
- unload(): boolean;
207
- activate(): boolean;
208
- deactivate(): boolean;
209
- /**
210
- * Gets the name of the extension.
211
- * @returns {string} Returns the name of the extension.
212
- */
213
- getName(): string;
214
- onMouseDown(event: MouseEvent): void;
215
- onMouseMove(event: MouseEvent): void;
216
- onMouseUp(event: MouseEvent): void;
217
- onMouseLongTouch(event: MouseEvent): void;
218
- onToolbarCreated(toolbar: Toolbar): void;
219
- protected bindDomEvents(): void;
220
- }
221
- export class ViewerToolbar extends Toolbar {
222
- }
223
3
  export enum UpdateType {
224
4
  /**No changes */
225
5
  None = 0,
@@ -335,6 +115,12 @@ export abstract class ViewObject extends THREE.Object3D {
335
115
  */
336
116
  protected riseOnUpdated(updateType?: UpdateType, object?: THREE.Object3D): void;
337
117
  }
118
+ export class ModelElementIds {
119
+
120
+ constructor(ids: string[], modelImplId: string);
121
+ modelPartId: string;
122
+ elementIds: string[];
123
+ }
338
124
  export abstract class CustomMaterial extends THREE.ShaderMaterial {
339
125
 
340
126
  constructor();
@@ -607,8 +393,6 @@ export namespace Viewer3DIcons {
607
393
  const VIEWER_MEASUREMENT_DIMENSION_ICON: string;
608
394
  }
609
395
  export namespace ViewerGeneralIcons {
610
- const ZOOM_IN: string;
611
- const ZOOM_OUT: string;
612
396
  const CLOSE: string;
613
397
  const STRETCH_WINDOW: string;
614
398
  const EXPAND_TREE: string;
@@ -618,6 +402,13 @@ export namespace ViewerGeneralIcons {
618
402
  const CIRCLE_ICON: string;
619
403
  const SHOW: string;
620
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;
621
412
  }
622
413
  export class MeshLineGeometry extends THREE.InstancedBufferGeometry {
623
414
  type: string;
@@ -629,7 +420,7 @@ export class MeshLineGeometry extends THREE.InstancedBufferGeometry {
629
420
  constructor();
630
421
  applyMatrix4(matrix: THREE.Matrix4): this;
631
422
  updatePoint(index: number, point: THREE.Vector3): void;
632
- updateColor(index: number, color: THREE.Color): void;
423
+ updateColor(index: number, color: Color): void;
633
424
  setPoints(points: THREE.Vector3[]): this;
634
425
  setPositions(array: ArrayLike<number>): this;
635
426
  setColors(array: ArrayLike<number>): this;
@@ -652,55 +443,150 @@ export class MeshLine extends THREE.Mesh {
652
443
  raycast(raycaster: THREE.Raycaster, intersects: THREE.Intersection[]): void;
653
444
  }
654
445
  export class TPair<TKey, TValue> {
446
+
447
+ constructor(key: TKey, value: TValue);
655
448
  get key(): TKey;
656
449
  get value(): TValue;
657
450
  }
658
- export type Point3 = {
659
- x: number;
660
- y: number;
661
- z: number;
662
- };
663
- export type CameraParameters = {
664
- /** Camera position */
665
- position: Point3;
666
- /** Camera view direction: vector pointing from camera to target */
667
- eyeDir: Point3;
668
- /** Field of view: angle in radians */
669
- angle: number;
670
- /** (optional) Vector pointing to the center of viewing area. Used only in the NavigationTool */
671
- viewCenter?: Point3;
672
- };
673
- export type CameraOrientation = {
674
- /** Camera view direction: vector pointing from camera to target */
675
- viewDir: THREE.Vector3;
676
- /** (optional) Camera up vector */
677
- upDir?: THREE.Vector3;
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;
678
472
  };
679
- export enum CameraNavigationMode {
680
- None = 0,
681
- Rotation = 1,
682
- Translation = 2,
683
- Spin = 4,
684
- Zoom = 8
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;
685
481
  }
686
- export interface ICameraControl {
687
- /**
688
- * Gets the Three.js camera.
689
- */
690
- getCamera(): THREE.Camera;
691
- /**
692
- * Gets the camera parameters.
693
- */
694
- getCameraParameters(): CameraParameters;
695
- /**
696
- * Sets the camera parameters.
697
- */
698
- setCameraParameters(iParams: CameraParameters): void;
699
- /**
700
- * Sets the aspect ratio.
701
- */
702
- setAspectRatio(width: number, heigth: number): boolean;
703
- /**
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.
587
+ */
588
+ setAspectRatio(width: number, heigth: number): boolean;
589
+ /**
704
590
  * Rotates camera around the rotationCenter
705
591
  * @param movement - offset in the screen space
706
592
  * @param rotationCenter - the center of rotation
@@ -718,12 +604,16 @@ export interface ICameraControl {
718
604
  * @param movement - offset in the screen space
719
605
  */
720
606
  spin(movement: THREE.Vector2): void;
607
+ /**
608
+ * Gets the camera orientation.
609
+ */
610
+ getCameraOrientation(): CameraOrientation;
721
611
  /**
722
612
  * Orient the camera
723
613
  * @param iOrientation
724
614
  * @param isAnimationEnabled
725
615
  */
726
- orientateCamera(iOrientation: CameraOrientation, isAnimationEnabled?: boolean): void;
616
+ setCameraOrientation(iOrientation: CameraOrientation, isAnimationEnabled?: boolean): void;
727
617
  /**
728
618
  * Zoom camera to the point
729
619
  * @param deltaSign - zoom distance
@@ -749,66 +639,6 @@ export interface ICameraControl {
749
639
  */
750
640
  setNavigationMode(mode: CameraNavigationMode, isEnable: boolean, duration?: number): void;
751
641
  }
752
- export type EventFunction<Data> = ((data: Data) => void) | (() => void);
753
- export interface IEventListener<Data> {
754
- dispose(): void;
755
- }
756
- export interface IEventSigner<Data> {
757
- listen(callback: EventFunction<Data>, options?: {
758
- bind?: object;
759
- }): IEventListener<Data>;
760
- unlisten(callback: EventFunction<Data>, options?: {
761
- bind?: object;
762
- allowMissing?: boolean;
763
- }): boolean;
764
- }
765
- export interface IDisposable {
766
- dispose(): void;
767
- }
768
- export class DisposeBy implements IDisposable {
769
-
770
- constructor(callback: () => void);
771
- dispose(): void;
772
- }
773
- class RevertProperty<T, P extends keyof T> implements IDisposable {
774
- dispose(): void;
775
- }
776
- export function changeProperty<T, P extends keyof T>(who: T, propName: P, newValue: T[P]): RevertProperty<T, P>;
777
- export class MergeDisposables implements IDisposable {
778
-
779
- constructor(handles: IDisposable[]);
780
- push(...moreHandles: IDisposable[]): void;
781
- dispose(): void;
782
- }
783
- class RemoveDomHandler implements IDisposable {
784
- dispose(): void;
785
- }
786
- export function addDomListener<DomElement extends HTMLElement, Type extends keyof HTMLElementEventMap>(domElement: DomElement, type: Type, listener: (this: HTMLElement, ev: HTMLElementEventMap[Type]) => any): RemoveDomHandler;
787
- export {};
788
- export interface EventEmitter<Data> {
789
- emit(data?: Data, options?: object): void;
790
- }
791
- export class RenderEventListener<Data> implements IEventListener<Data>, IDisposable {
792
-
793
- constructor(event: IEventSigner<Data>, func: EventFunction<Data>, options: {
794
- bind?: object;
795
- });
796
- dispose(): void;
797
- }
798
- export class EventDispatcher<Data> implements IEventSigner<Data>, EventEmitter<Data> {
799
- listen(func: EventFunction<Data>, options?: {
800
- bind?: object;
801
- }): IEventListener<Data>;
802
- unlisten(func: EventFunction<Data>, options?: {
803
- bind?: object;
804
- allowMissing?: boolean;
805
- }): boolean;
806
- emit(data?: Data): void;
807
- emitR(data?: Data): any[];
808
- asSigner(): IEventSigner<Data>;
809
- asEmitter(): EventEmitter<Data>;
810
- removeAllListeners(): void;
811
- }
812
642
  export interface IModelIntersectionChecker {
813
643
  /** Gets the center of the model*/
814
644
  get modelCenter(): THREE.Vector3;
@@ -860,6 +690,106 @@ export interface IModelIntersectionChecker {
860
690
  guid: string;
861
691
  }[];
862
692
  }
693
+ export enum NavigationHandlerPriority {
694
+ DefaultNavigation = 0,
695
+ GizmoHandlers = 20,
696
+ EmbeddedExtensions = 40,
697
+ CustomExtensions = 100
698
+ }
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 = {
720
+ /**
721
+ * (optional) Value indicating whether the NavigationEvent event was handled.
722
+ */
723
+ isHandled?: boolean;
724
+ };
725
+ export interface ActiveEvent extends Event {
726
+ readonly isActive: boolean;
727
+ }
728
+ export interface NavigationEventSourceEventMap extends HTMLElementEventMap {
729
+ /**
730
+ * Occurs when the {@link INavigationEventSource.isActive} property changes.
731
+ */
732
+ "active": ActiveEvent;
733
+ }
734
+ export interface INavigationEventSource {
735
+ /**
736
+ * Activity of the event source
737
+ */
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 {
744
+ /**
745
+ * Canvas DOM-events source
746
+ */
747
+ readonly canvasNavigationSource: INavigationEventSource;
748
+ /**
749
+ * Keyboard DOM-events source
750
+ */
751
+ readonly keyboardNavigationSource: INavigationEventSource;
752
+ /**
753
+ * Activity of the navigation agent
754
+ */
755
+ get isActive(): boolean;
756
+ set isActive(value: boolean);
757
+ /**
758
+ * Gets rectangle of the navigation area
759
+ */
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
+ }
863
793
  export class RenderViewSettings {
864
794
  telemetry?: boolean;
865
795
  hideEdgesWhenNavigation?: boolean;
@@ -966,8 +896,6 @@ export interface IUserScene extends THREE.Scene {
966
896
  manageScene(context?: IRenderOperationContext): boolean;
967
897
  /** Render scene */
968
898
  render(context: IRenderOperationContext): void;
969
- /** Clear scene */
970
- clear(): this;
971
899
  /** Dispose scene */
972
900
  dispose(): void;
973
901
  }
@@ -979,6 +907,7 @@ export interface I3DRenderer {
979
907
  getSize(target: THREE.Vector2): THREE.Vector2;
980
908
  setSize(width: number, height: number, updateStyle?: boolean): void;
981
909
  setViewport(x: THREE.Vector4 | number, y?: number, width?: number, height?: number): void;
910
+ getViewport(target: THREE.Vector4): THREE.Vector4;
982
911
  clippingPlanes: THREE.Plane[];
983
912
  domElement: HTMLCanvasElement;
984
913
  }
@@ -1025,6 +954,27 @@ export interface IRenderViewer3D {
1025
954
  */
1026
955
  removeScene(scene: IUserScene): void;
1027
956
  }
957
+ export class InitializerOptions {
958
+ libList?: string[];
959
+ language?: string;
960
+ }
961
+ class Global {
962
+ G: any;
963
+ RESOURCE_ROOT: string;
964
+ initializeResourceRoot(options: InitializerOptions): void;
965
+ getResourceUrl(resourceRelativePath: string): string;
966
+ }
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;
977
+ }
1028
978
  export class ModelElement {
1029
979
  get id(): string;
1030
980
  get modelPartId(): string;
@@ -1084,107 +1034,418 @@ export class ModelPart {
1084
1034
  get elementTree(): ModelElementTree;
1085
1035
  dispose(): void;
1086
1036
  }
1087
-
1088
- export class SettingsNames {
1089
- static TELEMETRY: string;
1090
- static AXES: string;
1091
- static CAMERA_ANIMATION: string;
1092
- static HIDE_SMALL_ELEMENTS_WHEN_NAVIGATING: string;
1093
- static GLOBAL_LIGHT: string;
1094
- static LIGHT_SOURCE: string;
1095
- static ANTI_ALIASING: string;
1096
- static HIDE_SMALL_ELEMENTS_MOVING: string;
1097
- static SMALL_ELEMENT_SIZE: string;
1098
- static LABEL_LINE_LENGTH: string;
1099
- static HIDE_EDGES_WHEN_NAVIGATING: string;
1100
- static DISPLAY_MODE: string;
1101
- static NAVIGATION_CUBE: string;
1102
- static DESIRED_FRAMERATE: string;
1103
- static MANAGE_TIME: string;
1104
- static HOVER_MESHES: string;
1105
- static HOVER_EDGES: string;
1106
- static SELECT_MESHES: string;
1107
- static SELECT_EDGES: string;
1108
- }
1109
- export enum ValueType {
1110
- STRING = 0,
1111
- NUMBER = 1,
1112
- ENUM = 2,
1113
- BOOL = 3
1114
- }
1115
- export class Viewer3DConfiguration extends ViewerConfiguration {
1116
- render: ViewerSettings;
1117
-
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
+ }
1166
+
1167
+ export class SettingsNames {
1168
+ static TELEMETRY: string;
1169
+ static AXES: string;
1170
+ static CAMERA_ANIMATION: string;
1171
+ static HIDE_SMALL_ELEMENTS_WHEN_NAVIGATING: string;
1172
+ static GLOBAL_LIGHT: string;
1173
+ static LIGHT_SOURCE: string;
1174
+ static ANTI_ALIASING: string;
1175
+ static HIDE_SMALL_ELEMENTS_MOVING: string;
1176
+ static SMALL_ELEMENT_SIZE: string;
1177
+ static LABEL_LINE_LENGTH: string;
1178
+ static HIDE_EDGES_WHEN_NAVIGATING: string;
1179
+ static DISPLAY_MODE: string;
1180
+ static NAVIGATION_CUBE: string;
1181
+ static DESIRED_FRAMERATE: string;
1182
+ static MANAGE_TIME: string;
1183
+ static HOVER_MESHES: string;
1184
+ static HOVER_EDGES: string;
1185
+ static SELECT_MESHES: string;
1186
+ static SELECT_EDGES: string;
1187
+ }
1188
+ export enum ValueType {
1189
+ STRING = 0,
1190
+ NUMBER = 1,
1191
+ ENUM = 2,
1192
+ BOOL = 3
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
+ }
1239
+ export class Viewer3DConfiguration extends ViewerConfiguration {
1240
+ render: ViewerSettings;
1241
+
1118
1242
  constructor(appearance?: ViewerSettings, render?: ViewerSettings);
1119
1243
  }
1120
1244
  export const defaultViewer3DSettings: ViewerSettings;
1121
- export enum IfcType {
1122
- IfcAbsorbedDoseMeasure = 0,
1123
- IfcAccelerationMeasure = 1,
1124
- IfcActionRequest = 2,
1125
- IfcActionRequestTypeEnum = 3,
1126
- IfcActionSourceTypeEnum = 4,
1127
- IfcActionTypeEnum = 5,
1128
- IfcActor = 6,
1129
- IfcActorRole = 7,
1130
- IfcActorSelect = 8,
1131
- IfcActuator = 9,
1132
- IfcActuatorType = 10,
1133
- IfcActuatorTypeEnum = 11,
1134
- IfcAddress = 12,
1135
- IfcAddressTypeEnum = 13,
1136
- IfcAdvancedBrep = 14,
1137
- IfcAdvancedBrepWithVoids = 15,
1138
- IfcAdvancedFace = 16,
1139
- IfcAirTerminal = 17,
1140
- IfcAirTerminalBox = 18,
1141
- IfcAirTerminalBoxType = 19,
1142
- IfcAirTerminalBoxTypeEnum = 20,
1143
- IfcAirTerminalType = 21,
1144
- IfcAirTerminalTypeEnum = 22,
1145
- IfcAirToAirHeatRecovery = 23,
1146
- IfcAirToAirHeatRecoveryType = 24,
1147
- IfcAirToAirHeatRecoveryTypeEnum = 25,
1148
- IfcAlarm = 26,
1149
- IfcAlarmType = 27,
1150
- IfcAlarmTypeEnum = 28,
1151
- IfcAlignment = 29,
1152
- IfcAlignment2DHorizontal = 30,
1153
- IfcAlignment2DHorizontalSegment = 31,
1154
- IfcAlignment2DSegment = 32,
1155
- IfcAlignment2DVerSegCircularArc = 33,
1156
- IfcAlignment2DVerSegLine = 34,
1157
- IfcAlignment2DVerSegParabolicArc = 35,
1158
- IfcAlignment2DVertical = 36,
1159
- IfcAlignment2DVerticalSegment = 37,
1160
- IfcAlignmentCurve = 38,
1161
- IfcAlignmentTypeEnum = 39,
1162
- IfcAmountOfSubstanceMeasure = 40,
1163
- IfcAnalysisModelTypeEnum = 41,
1164
- IfcAnalysisTheoryTypeEnum = 42,
1165
- IfcAngularVelocityMeasure = 43,
1166
- IfcAnnotation = 44,
1167
- IfcAnnotationFillArea = 45,
1168
- IfcApplication = 46,
1169
- IfcAppliedValue = 47,
1170
- IfcAppliedValueSelect = 48,
1171
- IfcApproval = 49,
1172
- IfcApprovalRelationship = 50,
1173
- IfcArbitraryClosedProfileDef = 51,
1174
- IfcArbitraryOpenProfileDef = 52,
1175
- IfcArbitraryProfileDefWithVoids = 53,
1176
- IfcArcIndex = 54,
1177
- IfcAreaDensityMeasure = 55,
1178
- IfcAreaMeasure = 56,
1179
- IfcArithmeticOperatorEnum = 57,
1180
- IfcAssemblyPlaceEnum = 58,
1181
- IfcAsset = 59,
1182
- IfcAsymmetricIShapeProfileDef = 60,
1183
- IfcAudioVisualAppliance = 61,
1184
- IfcAudioVisualApplianceType = 62,
1185
- IfcAudioVisualApplianceTypeEnum = 63,
1186
- IfcAxis1Placement = 64,
1187
- IfcAxis2Placement = 65,
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
+ }
1382
+ export enum IfcType {
1383
+ IfcAbsorbedDoseMeasure = 0,
1384
+ IfcAccelerationMeasure = 1,
1385
+ IfcActionRequest = 2,
1386
+ IfcActionRequestTypeEnum = 3,
1387
+ IfcActionSourceTypeEnum = 4,
1388
+ IfcActionTypeEnum = 5,
1389
+ IfcActor = 6,
1390
+ IfcActorRole = 7,
1391
+ IfcActorSelect = 8,
1392
+ IfcActuator = 9,
1393
+ IfcActuatorType = 10,
1394
+ IfcActuatorTypeEnum = 11,
1395
+ IfcAddress = 12,
1396
+ IfcAddressTypeEnum = 13,
1397
+ IfcAdvancedBrep = 14,
1398
+ IfcAdvancedBrepWithVoids = 15,
1399
+ IfcAdvancedFace = 16,
1400
+ IfcAirTerminal = 17,
1401
+ IfcAirTerminalBox = 18,
1402
+ IfcAirTerminalBoxType = 19,
1403
+ IfcAirTerminalBoxTypeEnum = 20,
1404
+ IfcAirTerminalType = 21,
1405
+ IfcAirTerminalTypeEnum = 22,
1406
+ IfcAirToAirHeatRecovery = 23,
1407
+ IfcAirToAirHeatRecoveryType = 24,
1408
+ IfcAirToAirHeatRecoveryTypeEnum = 25,
1409
+ IfcAlarm = 26,
1410
+ IfcAlarmType = 27,
1411
+ IfcAlarmTypeEnum = 28,
1412
+ IfcAlignment = 29,
1413
+ IfcAlignment2DHorizontal = 30,
1414
+ IfcAlignment2DHorizontalSegment = 31,
1415
+ IfcAlignment2DSegment = 32,
1416
+ IfcAlignment2DVerSegCircularArc = 33,
1417
+ IfcAlignment2DVerSegLine = 34,
1418
+ IfcAlignment2DVerSegParabolicArc = 35,
1419
+ IfcAlignment2DVertical = 36,
1420
+ IfcAlignment2DVerticalSegment = 37,
1421
+ IfcAlignmentCurve = 38,
1422
+ IfcAlignmentTypeEnum = 39,
1423
+ IfcAmountOfSubstanceMeasure = 40,
1424
+ IfcAnalysisModelTypeEnum = 41,
1425
+ IfcAnalysisTheoryTypeEnum = 42,
1426
+ IfcAngularVelocityMeasure = 43,
1427
+ IfcAnnotation = 44,
1428
+ IfcAnnotationFillArea = 45,
1429
+ IfcApplication = 46,
1430
+ IfcAppliedValue = 47,
1431
+ IfcAppliedValueSelect = 48,
1432
+ IfcApproval = 49,
1433
+ IfcApprovalRelationship = 50,
1434
+ IfcArbitraryClosedProfileDef = 51,
1435
+ IfcArbitraryOpenProfileDef = 52,
1436
+ IfcArbitraryProfileDefWithVoids = 53,
1437
+ IfcArcIndex = 54,
1438
+ IfcAreaDensityMeasure = 55,
1439
+ IfcAreaMeasure = 56,
1440
+ IfcArithmeticOperatorEnum = 57,
1441
+ IfcAssemblyPlaceEnum = 58,
1442
+ IfcAsset = 59,
1443
+ IfcAsymmetricIShapeProfileDef = 60,
1444
+ IfcAudioVisualAppliance = 61,
1445
+ IfcAudioVisualApplianceType = 62,
1446
+ IfcAudioVisualApplianceTypeEnum = 63,
1447
+ IfcAxis1Placement = 64,
1448
+ IfcAxis2Placement = 65,
1188
1449
  IfcAxis2Placement2D = 66,
1189
1450
  IfcAxis2Placement3D = 67,
1190
1451
  IfcBeam = 68,
@@ -2206,397 +2467,145 @@ export enum IfcType {
2206
2467
  IfcTextLiteral = 1084,
2207
2468
  IfcTextLiteralWithExtent = 1085,
2208
2469
  IfcTextPath = 1086,
2209
- IfcTextStyle = 1087,
2210
- IfcTextStyleFontModel = 1088,
2211
- IfcTextStyleForDefinedFont = 1089,
2212
- IfcTextStyleTextModel = 1090,
2213
- IfcTextTransformation = 1091,
2214
- IfcTextureCoordinate = 1092,
2215
- IfcTextureCoordinateGenerator = 1093,
2216
- IfcTextureMap = 1094,
2217
- IfcTextureVertex = 1095,
2218
- IfcTextureVertexList = 1096,
2219
- IfcThermalAdmittanceMeasure = 1097,
2220
- IfcThermalConductivityMeasure = 1098,
2221
- IfcThermalExpansionCoefficientMeasure = 1099,
2222
- IfcThermalResistanceMeasure = 1100,
2223
- IfcThermalTransmittanceMeasure = 1101,
2224
- IfcThermodynamicTemperatureMeasure = 1102,
2225
- IfcTime = 1103,
2226
- IfcTimeMeasure = 1104,
2227
- IfcTimeOrRatioSelect = 1105,
2228
- IfcTimePeriod = 1106,
2229
- IfcTimeSeries = 1107,
2230
- IfcTimeSeriesDataTypeEnum = 1108,
2231
- IfcTimeSeriesValue = 1109,
2232
- IfcTimeStamp = 1110,
2233
- IfcTopologicalRepresentationItem = 1111,
2234
- IfcTopologyRepresentation = 1112,
2235
- IfcToroidalSurface = 1113,
2236
- IfcTorqueMeasure = 1114,
2237
- IfcTransformer = 1115,
2238
- IfcTransformerType = 1116,
2239
- IfcTransformerTypeEnum = 1117,
2240
- IfcTransitionCode = 1118,
2241
- IfcTransitionCurveSegment2D = 1119,
2242
- IfcTransitionCurveType = 1120,
2243
- IfcTranslationalStiffnessSelect = 1121,
2244
- IfcTransportElement = 1122,
2245
- IfcTransportElementType = 1123,
2246
- IfcTransportElementTypeEnum = 1124,
2247
- IfcTrapeziumProfileDef = 1125,
2248
- IfcTriangulatedFaceSet = 1126,
2249
- IfcTriangulatedIrregularNetwork = 1127,
2250
- IfcTrimmedCurve = 1128,
2251
- IfcTrimmingPreference = 1129,
2252
- IfcTrimmingSelect = 1130,
2253
- IfcTShapeProfileDef = 1131,
2254
- IfcTubeBundle = 1132,
2255
- IfcTubeBundleType = 1133,
2256
- IfcTubeBundleTypeEnum = 1134,
2257
- IfcTypeObject = 1135,
2258
- IfcTypeProcess = 1136,
2259
- IfcTypeProduct = 1137,
2260
- IfcTypeResource = 1138,
2261
- IfcUnit = 1139,
2262
- IfcUnitaryControlElement = 1140,
2263
- IfcUnitaryControlElementType = 1141,
2264
- IfcUnitaryControlElementTypeEnum = 1142,
2265
- IfcUnitaryEquipment = 1143,
2266
- IfcUnitaryEquipmentType = 1144,
2267
- IfcUnitaryEquipmentTypeEnum = 1145,
2268
- IfcUnitAssignment = 1146,
2269
- IfcUnitEnum = 1147,
2270
- IfcURIReference = 1148,
2271
- IfcUShapeProfileDef = 1149,
2272
- IfcValue = 1150,
2273
- IfcValve = 1151,
2274
- IfcValveType = 1152,
2275
- IfcValveTypeEnum = 1153,
2276
- IfcVaporPermeabilityMeasure = 1154,
2277
- IfcVector = 1155,
2278
- IfcVectorOrDirection = 1156,
2279
- IfcVertex = 1157,
2280
- IfcVertexLoop = 1158,
2281
- IfcVertexPoint = 1159,
2282
- IfcVibrationIsolator = 1160,
2283
- IfcVibrationIsolatorType = 1161,
2284
- IfcVibrationIsolatorTypeEnum = 1162,
2285
- IfcVirtualElement = 1163,
2286
- IfcVirtualGridIntersection = 1164,
2287
- IfcVoidingFeature = 1165,
2288
- IfcVoidingFeatureTypeEnum = 1166,
2289
- IfcVolumeMeasure = 1167,
2290
- IfcVolumetricFlowRateMeasure = 1168,
2291
- IfcWall = 1169,
2292
- IfcWallElementedCase = 1170,
2293
- IfcWallStandardCase = 1171,
2294
- IfcWallType = 1172,
2295
- IfcWallTypeEnum = 1173,
2296
- IfcWarpingConstantMeasure = 1174,
2297
- IfcWarpingMomentMeasure = 1175,
2298
- IfcWarpingStiffnessSelect = 1176,
2299
- IfcWasteTerminal = 1177,
2300
- IfcWasteTerminalType = 1178,
2301
- IfcWasteTerminalTypeEnum = 1179,
2302
- IfcWindow = 1180,
2303
- IfcWindowLiningProperties = 1181,
2304
- IfcWindowPanelOperationEnum = 1182,
2305
- IfcWindowPanelPositionEnum = 1183,
2306
- IfcWindowPanelProperties = 1184,
2307
- IfcWindowStandardCase = 1185,
2308
- IfcWindowStyle = 1186,
2309
- IfcWindowStyleConstructionEnum = 1187,
2310
- IfcWindowStyleOperationEnum = 1188,
2311
- IfcWindowType = 1189,
2312
- IfcWindowTypeEnum = 1190,
2313
- IfcWindowTypePartitioningEnum = 1191,
2314
- IfcWorkCalendar = 1192,
2315
- IfcWorkCalendarTypeEnum = 1193,
2316
- IfcWorkControl = 1194,
2317
- IfcWorkPlan = 1195,
2318
- IfcWorkPlanTypeEnum = 1196,
2319
- IfcWorkSchedule = 1197,
2320
- IfcWorkScheduleTypeEnum = 1198,
2321
- IfcWorkTime = 1199,
2322
- IfcZone = 1200,
2323
- IfcZShapeProfileDef = 1201,
2324
- UNDEFINED = 1202,
2325
- Other3DModel = 1203
2326
- }
2327
- export class ModelElementPropertySet {
2328
- name: string;
2329
- properties: ModelElementProperty[];
2330
- type: IfcType;
2331
- }
2332
- export class ModelElementProperty {
2333
- name: string;
2334
- unit: number;
2335
- value: ModelElementPropertyValue;
2336
- }
2337
- export class ModelElementPropertyValue {
2338
- str_value?: string;
2339
- int_value?: number;
2340
- double_value?: number;
2341
- date_value?: bigint;
2342
- array_value: Array<string>;
2343
- decimal_value?: number;
2344
- guid_value?: string;
2345
- array_int_value: Array<number>;
2346
- bool_value?: boolean;
2347
- get value(): unknown;
2348
- }
2349
-
2350
- export enum SelectionMode {
2351
- Append = 0,
2352
- Replace = 1
2353
- }
2354
- export class ModelElementIds {
2355
- modelPartId: string;
2356
- elementIds: string[];
2357
- }
2358
- export class EventTypes extends CoreEventTypes {
2359
- static SELECTION_CHANGED_EVENT: string;
2360
- static MODEL_PART_LOADED: string;
2361
- static MODEL_PART_UNLOADED: string;
2362
- static CAMERA_CHANGE_EVENT: string;
2363
- static CAMERA_NAVIGATION_MODE_CHANGED_EVENT: string;
2364
- static RENDER_CLICK_EVENT: string;
2365
- static RENDER_HOVER_EVENT: string;
2366
- static RENDER_DOUBLE_CLICK_EVENT: string;
2367
- }
2368
- export class SelectionChangedEvent extends Event {
2369
- selectedIds: ModelElementIds[];
2370
- }
2371
- export class ModelPartEvent extends Event {
2372
- modelPartId: string;
2373
- }
2374
- export class CameraEvent extends Event {
2375
- }
2376
- export class ClickedEvent extends Event {
2377
- modelId: string;
2378
- modelElementId: string;
2379
- ctrlKey: boolean;
2380
- }
2381
- export class HoverEvent extends Event {
2382
- modelId: string;
2383
- modelElementId: string;
2384
- }
2385
- export enum NavigationHandlerPriority {
2386
- DefaultNavigation = 0,
2387
- GizmoHandlers = 20,
2388
- EmbeddedExtensions = 40,
2389
- CustomExtensions = 100
2390
- }
2391
- export class NavigationEventOptions implements EventListenerOptions {
2392
- /** If true, use event capturing instead of event bubbling*/
2393
- readonly capture: boolean;
2394
- /** Call priority of navigation event handlers, from highest to lowest*/
2395
- readonly priority: number | NavigationHandlerPriority;
2396
- /** Always handle, used if `NavigationEvent.isHandled` set to true*/
2397
- readonly alwaysHandle: boolean;
2398
- /** (optional) listener name*/
2399
- readonly navigationTargetName?: string;
2400
-
2401
- constructor(
2402
- /** If true, use event capturing instead of event bubbling*/
2403
- capture?: boolean,
2404
- /** Call priority of navigation event handlers, from highest to lowest*/
2405
- priority?: number | NavigationHandlerPriority,
2406
- /** Always handle, used if `NavigationEvent.isHandled` set to true*/
2407
- alwaysHandle?: boolean,
2408
- /** (optional) listener name*/
2409
- navigationTargetName?: string);
2410
- }
2411
- export type NavigationEvent = {
2412
- /**
2413
- * (optional) Value indicating whether the NavigationEvent event was handled.
2414
- */
2415
- isHandled?: boolean;
2416
- };
2417
- export interface INavigationEventSource {
2418
- /**
2419
- * Event fired on activity changed
2420
- */
2421
- readonly eventSourceActivityChanged: IEventSigner<boolean>;
2422
- /**
2423
- * Activates or deactivate event source
2424
- * @param value - activate if true
2425
- */
2426
- setActive(value: boolean): void;
2427
- addEventListener<T extends keyof HTMLElementEventMap>(type: T, listener: (this: object, ev: HTMLElementEventMap[T] & NavigationEvent) => void, options?: boolean | EventListenerOptions | NavigationEventOptions): void;
2428
- removeEventListener<T extends keyof HTMLElementEventMap>(type: T, listener: (this: object, ev: HTMLElementEventMap[T] & NavigationEvent) => void, options?: boolean | EventListenerOptions | NavigationEventOptions): void;
2429
- }
2430
- export interface INavigationAgent {
2431
- /**
2432
- * Canvas DOM-events source
2433
- */
2434
- readonly canvasNavigationSource: INavigationEventSource;
2435
- /**
2436
- * Keyboard DOM-events source
2437
- */
2438
- readonly keyboardNavigationSource: INavigationEventSource;
2439
- /**
2440
- * Activates canvas and keyboard navigation event sources
2441
- */
2442
- setActive(value: boolean): void;
2443
- /**
2444
- * Gets rectangle of the navigation area
2445
- */
2446
- getNavigationArea(): DOMRect;
2447
- }
2448
- export interface INavigationTool {
2449
- /**
2450
- * Gets name of this navigation tool.
2451
- */
2452
- get name(): string;
2453
- /**
2454
- * Initialize navigation tool.
2455
- */
2456
- init(navAgent: INavigationAgent, cameraControl: ICameraControl, intersectionChecker: IModelIntersectionChecker): void;
2457
- /**
2458
- * Activates or deactivates this navigation tool.
2459
- */
2460
- setActive(isActive: boolean): void;
2461
- /**
2462
- * Gets the camera pivot point.
2463
- */
2464
- getPivotPoint(): THREE.Vector3;
2465
- /**
2466
- * Sets the camera pivot point.
2467
- */
2468
- setPivotPoint(pivotPoint: THREE.Vector3): void;
2469
- /**
2470
- * Sets the camera parameters.
2471
- * @param iParams
2472
- */
2473
- setCameraParameters(iParams: CameraParameters): void;
2474
- /**
2475
- * Gets the camera parameters.
2476
- */
2477
- getCameraParameters(): CameraParameters;
2478
- }
2479
- export interface INavigation {
2480
- /**
2481
- * Register navigation tool.
2482
- */
2483
- registerNavigation(navigationTool: INavigationTool): void;
2484
- /**
2485
- * Unregister navigation tool.
2486
- */
2487
- unregisterNavigation(navigationTool: INavigationTool): void;
2488
- /**
2489
- * Activate or deactivate registered navigation tool.
2490
- * NB: There can be only one active navigation tool at time.
2491
- */
2492
- setActive(navigationToolName: string, isActive: boolean): void;
2493
- /**
2494
- * Get active navigation tool.
2495
- */
2496
- getActiveNavigation(): INavigationTool | null;
2497
- /**
2498
- * Get navigation agent.
2499
- */
2500
- getNavigationAgent(): INavigationAgent;
2501
- /**
2502
- * Gets navigation area rectangle
2503
- */
2504
- getNavigationArea(): DOMRect;
2505
- /**
2506
- * Sets the camera parameters.
2507
- */
2508
- setCameraParameters(params: CameraParameters): void;
2509
- /**
2510
- * Gets the camera parameters.
2511
- */
2512
- getCameraParameters(): CameraParameters;
2513
- /**
2514
- * Gets the camera control.
2515
- */
2516
- getCameraControl(): ICameraControl;
2517
- /**
2518
- * Gets the Three.js camera.
2519
- */
2520
- getCamera(): THREE.Camera;
2521
- /**
2522
- * Fits camera to objects by IDs.
2523
- * @param {string[] | string} elementIds - element or array of elements
2524
- * @param {string | ModelPart} modelPart - the model part id or the model part instance containing the elements.
2525
- * @param {boolean} immediate - true to avoid the default transition.
2526
- * @returns
2527
- */
2528
- fitToView(elementIds: string[] | string, modelPart: string | ModelPart, immediate?: boolean): void;
2529
- /**
2530
- * Sets the camera pivot point.
2531
- */
2532
- setPivotPoint(point: Point3): void;
2533
- /**
2534
- * Gets the camera pivot point.
2535
- */
2536
- getPivotPoint(): Point3;
2537
- /**
2538
- * Reset the camera pivot point.
2539
- */
2540
- resetPivotPoint(): void;
2470
+ IfcTextStyle = 1087,
2471
+ IfcTextStyleFontModel = 1088,
2472
+ IfcTextStyleForDefinedFont = 1089,
2473
+ IfcTextStyleTextModel = 1090,
2474
+ IfcTextTransformation = 1091,
2475
+ IfcTextureCoordinate = 1092,
2476
+ IfcTextureCoordinateGenerator = 1093,
2477
+ IfcTextureMap = 1094,
2478
+ IfcTextureVertex = 1095,
2479
+ IfcTextureVertexList = 1096,
2480
+ IfcThermalAdmittanceMeasure = 1097,
2481
+ IfcThermalConductivityMeasure = 1098,
2482
+ IfcThermalExpansionCoefficientMeasure = 1099,
2483
+ IfcThermalResistanceMeasure = 1100,
2484
+ IfcThermalTransmittanceMeasure = 1101,
2485
+ IfcThermodynamicTemperatureMeasure = 1102,
2486
+ IfcTime = 1103,
2487
+ IfcTimeMeasure = 1104,
2488
+ IfcTimeOrRatioSelect = 1105,
2489
+ IfcTimePeriod = 1106,
2490
+ IfcTimeSeries = 1107,
2491
+ IfcTimeSeriesDataTypeEnum = 1108,
2492
+ IfcTimeSeriesValue = 1109,
2493
+ IfcTimeStamp = 1110,
2494
+ IfcTopologicalRepresentationItem = 1111,
2495
+ IfcTopologyRepresentation = 1112,
2496
+ IfcToroidalSurface = 1113,
2497
+ IfcTorqueMeasure = 1114,
2498
+ IfcTransformer = 1115,
2499
+ IfcTransformerType = 1116,
2500
+ IfcTransformerTypeEnum = 1117,
2501
+ IfcTransitionCode = 1118,
2502
+ IfcTransitionCurveSegment2D = 1119,
2503
+ IfcTransitionCurveType = 1120,
2504
+ IfcTranslationalStiffnessSelect = 1121,
2505
+ IfcTransportElement = 1122,
2506
+ IfcTransportElementType = 1123,
2507
+ IfcTransportElementTypeEnum = 1124,
2508
+ IfcTrapeziumProfileDef = 1125,
2509
+ IfcTriangulatedFaceSet = 1126,
2510
+ IfcTriangulatedIrregularNetwork = 1127,
2511
+ IfcTrimmedCurve = 1128,
2512
+ IfcTrimmingPreference = 1129,
2513
+ IfcTrimmingSelect = 1130,
2514
+ IfcTShapeProfileDef = 1131,
2515
+ IfcTubeBundle = 1132,
2516
+ IfcTubeBundleType = 1133,
2517
+ IfcTubeBundleTypeEnum = 1134,
2518
+ IfcTypeObject = 1135,
2519
+ IfcTypeProcess = 1136,
2520
+ IfcTypeProduct = 1137,
2521
+ IfcTypeResource = 1138,
2522
+ IfcUnit = 1139,
2523
+ IfcUnitaryControlElement = 1140,
2524
+ IfcUnitaryControlElementType = 1141,
2525
+ IfcUnitaryControlElementTypeEnum = 1142,
2526
+ IfcUnitaryEquipment = 1143,
2527
+ IfcUnitaryEquipmentType = 1144,
2528
+ IfcUnitaryEquipmentTypeEnum = 1145,
2529
+ IfcUnitAssignment = 1146,
2530
+ IfcUnitEnum = 1147,
2531
+ IfcURIReference = 1148,
2532
+ IfcUShapeProfileDef = 1149,
2533
+ IfcValue = 1150,
2534
+ IfcValve = 1151,
2535
+ IfcValveType = 1152,
2536
+ IfcValveTypeEnum = 1153,
2537
+ IfcVaporPermeabilityMeasure = 1154,
2538
+ IfcVector = 1155,
2539
+ IfcVectorOrDirection = 1156,
2540
+ IfcVertex = 1157,
2541
+ IfcVertexLoop = 1158,
2542
+ IfcVertexPoint = 1159,
2543
+ IfcVibrationIsolator = 1160,
2544
+ IfcVibrationIsolatorType = 1161,
2545
+ IfcVibrationIsolatorTypeEnum = 1162,
2546
+ IfcVirtualElement = 1163,
2547
+ IfcVirtualGridIntersection = 1164,
2548
+ IfcVoidingFeature = 1165,
2549
+ IfcVoidingFeatureTypeEnum = 1166,
2550
+ IfcVolumeMeasure = 1167,
2551
+ IfcVolumetricFlowRateMeasure = 1168,
2552
+ IfcWall = 1169,
2553
+ IfcWallElementedCase = 1170,
2554
+ IfcWallStandardCase = 1171,
2555
+ IfcWallType = 1172,
2556
+ IfcWallTypeEnum = 1173,
2557
+ IfcWarpingConstantMeasure = 1174,
2558
+ IfcWarpingMomentMeasure = 1175,
2559
+ IfcWarpingStiffnessSelect = 1176,
2560
+ IfcWasteTerminal = 1177,
2561
+ IfcWasteTerminalType = 1178,
2562
+ IfcWasteTerminalTypeEnum = 1179,
2563
+ IfcWindow = 1180,
2564
+ IfcWindowLiningProperties = 1181,
2565
+ IfcWindowPanelOperationEnum = 1182,
2566
+ IfcWindowPanelPositionEnum = 1183,
2567
+ IfcWindowPanelProperties = 1184,
2568
+ IfcWindowStandardCase = 1185,
2569
+ IfcWindowStyle = 1186,
2570
+ IfcWindowStyleConstructionEnum = 1187,
2571
+ IfcWindowStyleOperationEnum = 1188,
2572
+ IfcWindowType = 1189,
2573
+ IfcWindowTypeEnum = 1190,
2574
+ IfcWindowTypePartitioningEnum = 1191,
2575
+ IfcWorkCalendar = 1192,
2576
+ IfcWorkCalendarTypeEnum = 1193,
2577
+ IfcWorkControl = 1194,
2578
+ IfcWorkPlan = 1195,
2579
+ IfcWorkPlanTypeEnum = 1196,
2580
+ IfcWorkSchedule = 1197,
2581
+ IfcWorkScheduleTypeEnum = 1198,
2582
+ IfcWorkTime = 1199,
2583
+ IfcZone = 1200,
2584
+ IfcZShapeProfileDef = 1201,
2585
+ UNDEFINED = 1202,
2586
+ Other3DModel = 1203
2541
2587
  }
2542
- export interface CustomSpriteMaterialParameters extends THREE.ShaderMaterialParameters {
2543
- color?: THREE.ColorRepresentation | undefined;
2544
- map?: THREE.Texture | null | undefined;
2545
- alphaMap?: THREE.Texture | null | undefined;
2546
- rotation?: number | undefined;
2547
- sizeAttenuation?: boolean | undefined;
2548
- fog?: boolean | undefined;
2549
- center?: THREE.Vector2 | undefined;
2588
+ export class ModelElementPropertySet {
2589
+ name: string;
2590
+ properties: ModelElementProperty[];
2591
+ type: IfcType;
2550
2592
  }
2551
- export class CustomSpriteMaterial extends CustomMaterial {
2552
- type: string;
2553
- readonly isSpriteMaterial: true;
2554
-
2555
- constructor(parameters?: CustomSpriteMaterialParameters);
2556
- /**
2557
- * @default new THREE.Color( 0xffffff )
2558
- */
2559
- color: THREE.Color;
2560
- /**
2561
- * @default null
2562
- */
2563
- map: THREE.Texture | null;
2564
- /**
2565
- * @default null
2566
- */
2567
- alphaMap: THREE.Texture | null;
2568
- /**
2569
- * @default 0
2570
- */
2571
- rotation: number;
2572
- /**
2573
- * @default true
2574
- */
2575
- sizeAttenuation: boolean;
2576
- /**
2577
- * @default true
2578
- */
2579
- transparent: boolean;
2580
- /**
2581
- * Whether the material is affected by fog. Default is true.
2582
- * @default fog
2583
- */
2584
- fog: boolean;
2585
- /**
2586
- * @default new THREE.Vector2(0.5, 0.5)
2587
- */
2588
- center: THREE.Vector2;
2589
- get resolution(): THREE.Vector2;
2590
- set resolution(value: THREE.Vector2);
2591
- protected refreshUniformsCommon(uniforms: {
2592
- [uniform: string]: THREE.IUniform;
2593
- }, material: CustomSpriteMaterial, renderer: THREE.WebGLRenderer): void;
2594
- protected onBeforeRender(renderer: THREE.WebGLRenderer, scene: THREE.Scene, camera: THREE.Camera, geometry: THREE.BufferGeometry, material: THREE.Material, group: THREE.Group): void;
2595
- copy(source: CustomSpriteMaterial): this;
2593
+ export class ModelElementProperty {
2594
+ name: string;
2595
+ unit: number;
2596
+ value: ModelElementPropertyValue;
2596
2597
  }
2597
- export class ModelLoadingOptions {
2598
- guid: string;
2599
- isConsolidatedModel?: boolean;
2598
+ export class ModelElementPropertyValue {
2599
+ str_value?: string;
2600
+ int_value?: number;
2601
+ double_value?: number;
2602
+ date_value?: bigint;
2603
+ array_value: Array<string>;
2604
+ decimal_value?: number;
2605
+ guid_value?: string;
2606
+ array_int_value: Array<number>;
2607
+ bool_value?: boolean;
2608
+ get value(): unknown;
2600
2609
  }
2601
2610
  /**
2602
2611
  * This class describes the coordination model. The coordination model contains parts of the model (aka ModelPart).
@@ -2711,12 +2720,41 @@ export class Model {
2711
2720
  */
2712
2721
  getElementProperties(elementId: string, modelPart?: string | ModelPart, version?: bigint): ModelElementPropertySet[];
2713
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
+ }
2714
2745
  export let ViewerInstance: Viewer3D;
2715
2746
  export class Viewer3D extends ViewerBase {
2716
2747
  protected _configuration: Viewer3DConfiguration;
2717
2748
  settings: Readonly<ISettings>;
2718
- get navigation(): INavigation;
2719
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;
2757
+ get navigation(): INavigation;
2720
2758
  getConfiguration(): Viewer3DConfiguration;
2721
2759
  start(): Promise<number>;
2722
2760
  finish(): void;
@@ -2733,13 +2771,8 @@ export class Viewer3D extends ViewerBase {
2733
2771
  * @param modelPart - model part id or model part instance
2734
2772
  */
2735
2773
  unloadModelPart(modelPart?: string | ModelPart): void;
2736
- /**
2737
- * Returns general model
2738
- * @returns { Model } - general model
2739
- */
2740
- get model(): Model;
2741
- get renderView(): IRenderViewer3D;
2742
- get canvas(): HTMLCanvasElement;
2774
+ setVirtualOrigin(point: Point3): void;
2775
+ getVirtualOrigin(): Point3;
2743
2776
  /**
2744
2777
  * Makes screenshot
2745
2778
  * @param {string} [mimeType=image/png] Image MIME type.
@@ -2749,16 +2782,26 @@ export class Viewer3D extends ViewerBase {
2749
2782
  makeScreenshot(mimeType?: string, quality?: number): Promise<Blob>;
2750
2783
  setThemeFromSettings(): void;
2751
2784
  }
2785
+ export class ViewerToolbar extends Toolbar {
2786
+ }
2752
2787
  export class GuiViewer3D extends Viewer3D {
2753
2788
  loadModelPart(buffer: ArrayBuffer, options: ModelLoadingOptions, onSuccessCallback: SuccessCallback, onErrorCallback: ErrorCallback): void;
2754
2789
  getToolbar(): ViewerToolbar;
2755
2790
  onPostExtensionLoad(extension: ExtensionBase): void;
2756
2791
  protected getToolbarHeight(): number;
2757
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
+ }
2758
2800
  export type InitializeSuccessCallback = () => void;
2759
2801
  export function coreInitializer(options: InitializerOptions, callback: InitializeSuccessCallback): void;
2760
2802
  export function coreShutdown(): void;
2761
2803
  export function CreateViewer(container: HTMLElement, configuration?: Viewer3DConfiguration): GuiViewer3D;
2804
+ export function CreateBasicViewer(container: HTMLElement, configuration?: Viewer3DConfiguration): Viewer3D;
2762
2805
  /**
2763
2806
  * @param options
2764
2807
  * @param callback
@@ -2943,6 +2986,7 @@ export class LabelSprite extends THREE.Sprite {
2943
2986
  }
2944
2987
  export interface MeshPointMaterialParameters extends THREE.ShaderMaterialParameters {
2945
2988
  sizeAttenuation?: boolean | undefined;
2989
+ discreteClipping?: boolean | undefined;
2946
2990
  }
2947
2991
  export class MeshPointMaterial extends CustomMaterial {
2948
2992
 
@@ -2951,6 +2995,11 @@ export class MeshPointMaterial extends CustomMaterial {
2951
2995
  * @default true
2952
2996
  */
2953
2997
  sizeAttenuation: boolean;
2998
+ /**
2999
+ * @default true
3000
+ */
3001
+ get discreteClipping(): boolean;
3002
+ set discreteClipping(value: boolean);
2954
3003
  get resolution(): THREE.Vector2;
2955
3004
  set resolution(value: THREE.Vector2);
2956
3005
  protected refreshUniformsCommon(uniforms: {
@@ -3015,12 +3064,20 @@ export class Dragger {
3015
3064
  constructor(allowedDraggableElement: HTMLElement, draggableContainer: HTMLElement, containerToRestriction: HTMLElement, windowStater?: WindowStater);
3016
3065
  get windowState(): IWindowStyle | null;
3017
3066
  }
3067
+ export namespace ControlState {
3068
+ enum State {
3069
+ ACTIVE = 0,
3070
+ INACTIVE = 1,
3071
+ DISABLED = 2
3072
+ }
3073
+ }
3018
3074
  export class Button extends Control {
3019
3075
 
3020
3076
  constructor(id: string);
3021
3077
  setIsChecked(value: boolean): void;
3022
- setState(state: Button.State): boolean;
3023
- getState(): Button.State;
3078
+ setState(state: ControlState.State): boolean;
3079
+ setText(text: string): void;
3080
+ getState(): ControlState.State;
3024
3081
  setIcon(iconClassName: string): void;
3025
3082
  setFromSvgTemlate(template: string): void;
3026
3083
  /**
@@ -3040,16 +3097,36 @@ export class Button extends Control {
3040
3097
  onMouseOut: (event: MouseEvent) => void;
3041
3098
  }
3042
3099
  export namespace Button {
3043
- enum State {
3044
- ACTIVE = 0,
3045
- INACTIVE = 1,
3046
- DISABLED = 2
3047
- }
3048
3100
  enum Event {
3049
3101
  STATE_CHANGED = "Button.StateChanged",
3050
3102
  CLICK = "click"
3051
3103
  }
3052
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
+ }
3053
3130
  interface ElementClass {
3054
3131
  panelClassName?: string;
3055
3132
  contentClassName?: string;