@pilotdev/pilot-web-3d 23.0.1-1 → 23.0.3-1

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 +150 -1220
  2. package/package.json +11 -3
package/index.d.ts CHANGED
@@ -1,19 +1,16 @@
1
1
  /// <reference types="@types/three" />
2
2
  declare namespace PilotWeb3D {
3
3
  export class LoadingSpinner {
4
- constructor();
5
4
  addToDOM(container: HTMLElement): void;
6
5
  removeFromDOM(container: HTMLElement): void;
7
6
  }
8
7
  export class ExtensionManager {
9
- constructor();
10
8
  registerExtensionType(extensionId: string, extension: typeof ExtensionBase): boolean;
11
9
  unregisterExtensionType(extensionId: string): boolean;
12
10
  getExtensionType(extensionId: string): typeof ExtensionBase;
13
11
  }
14
12
  export const theExtensionManager: ExtensionManager;
15
13
  export class ExtensionLoader {
16
- constructor(viewer: ViewerBase, extensionManager: ExtensionManager);
17
14
  loadExtension(extensionId: string): Promise<ExtensionBase>;
18
15
  unloadExtension(extensionId: string): Promise<boolean>;
19
16
  getExtensions(): ExtensionBase[];
@@ -43,15 +40,6 @@ export interface IEventsDispatcher {
43
40
  dispatchEventAsync(event: string | Event): void;
44
41
  clearListeners(): void;
45
42
  }
46
- export class EventsDispatcherCore implements IEventsDispatcher {
47
- dispatchEventAsync(event: string | Event): void;
48
- hasEventListener(type: string, listener: EventListener): boolean;
49
- dispatchEvent(event: string | Event): void;
50
- addEventListener(type: string, listener: EventListener, options?: object): void;
51
- removeEventListener(type: string, listener: EventListener): void;
52
- removeEvent(type: string): void;
53
- clearListeners(): void;
54
- }
55
43
  export type ViewerSettings = Record<string, any>;
56
44
  export class ViewerConfiguration {
57
45
  [key: string]: any;
@@ -76,7 +64,6 @@ export class SettingsStorageFactory {
76
64
  getSettingsStorage(): ISettingsStorage;
77
65
  }
78
66
  export class LocalSettingsStorage implements ISettingsStorage {
79
- constructor();
80
67
  clear(): void;
81
68
  getItem<T>(key: string): T | null;
82
69
  removeItem(key: string): void;
@@ -84,7 +71,6 @@ export class LocalSettingsStorage implements ISettingsStorage {
84
71
  getKeys(): string[];
85
72
  }
86
73
  export class InMemorySettingsStorage implements ISettingsStorage {
87
- constructor();
88
74
  clear(): void;
89
75
  getItem<T>(key: string): T | null;
90
76
  removeItem(key: string): void;
@@ -103,7 +89,6 @@ export class SettingChangedEvent extends Event {
103
89
  export abstract class SettingsBase implements ISettings {
104
90
  protected _eventDispatcher: IEventsDispatcher;
105
91
  protected _storage: ISettingsStorage;
106
- constructor(storage: ISettingsStorage, eventDispatcher: IEventsDispatcher);
107
92
  changeSetting<T>(name: string, value: T, notify?: boolean): void;
108
93
  getSettingValue<T>(name: string): T;
109
94
  protected abstract getKeyWithPrefix(key: string): string;
@@ -125,7 +110,6 @@ export abstract class ViewerBase {
125
110
  extensionsLoader: ExtensionLoader;
126
111
  abstract settings: ISettings;
127
112
  abstract events: IEventsDispatcher;
128
- constructor(container: HTMLElement, configuration?: ViewerConfiguration);
129
113
  /**
130
114
  *
131
115
  * @returns
@@ -140,6 +124,7 @@ export abstract class ViewerBase {
140
124
  }
141
125
  export class Control {
142
126
  container: HTMLElement;
127
+
143
128
  constructor(id: string);
144
129
  addClass(cssClass: string): void;
145
130
  removeClass(cssClass: string): void;
@@ -147,12 +132,14 @@ export class Control {
147
132
  setToolTip(tooltipText: string): void;
148
133
  }
149
134
  export class Toolbar extends Control {
135
+
150
136
  constructor(id: string);
151
137
  addControl(control: Control): void;
152
138
  removeControl(id: string): void;
153
139
  }
154
140
  export class ExtensionBase {
155
141
  protected _viewer: ViewerBase;
142
+
156
143
  constructor(viewer3D: ViewerBase, options?: any);
157
144
  load(): boolean | Promise<boolean>;
158
145
  unload(): boolean;
@@ -172,55 +159,15 @@ export class ExtensionBase {
172
159
  }
173
160
  export class ViewerToolbar extends Toolbar {
174
161
  }
175
- export const PredefinedColors: {
176
- DEFAULT: string;
177
- DIFF: string;
178
- IFC_WINDOW: string;
179
- IFC_DOOR: string;
180
- DEFAULT_FACE: string;
181
- HIGHLIGHTED_FACE: string;
182
- SELECTED_FACE: string;
183
- DEFAULT_EDGE: string;
184
- HIGHLIGHTED_EDGE: string;
185
- SELECTED_EDGE: string;
186
- };
187
- export interface MeshLineMaterialParameters extends THREE.ShaderMaterialParameters {
188
- color?: string;
189
- }
190
- export class MeshLineMaterial extends THREE.RawShaderMaterial {
191
- constructor(iParameters?: MeshLineMaterialParameters);
192
- getColor(): any;
193
- setColor(iColor: THREE.Color): void;
194
- getLineWidth(): any;
195
- setLineWidth(iVal: number): number;
196
- }
197
- export class GlobalMaterials {
198
- static diffElement: THREE.MeshLambertMaterial;
199
- static diffAdditionalElement: THREE.MeshLambertMaterial;
200
- static basicTransparent: THREE.MeshLambertMaterial;
201
- static init(): void;
202
- static basicMaterial: THREE.MeshLambertMaterial;
203
- static basicInstancedMaterial: THREE.MeshLambertMaterial;
204
- static transparentInstancedMaterial: THREE.MeshLambertMaterial;
205
- static highlightedMeshMaterial: THREE.MeshLambertMaterial;
206
- static selectedTransparentMeshMaterial: THREE.MeshLambertMaterial;
207
- static selectedMeshMaterial: THREE.MeshLambertMaterial;
208
- static threeLine: THREE.LineBasicMaterial;
209
- static basicLineMaterial: THREE.LineBasicMaterial;
210
- static basicInstancedLineMaterial: THREE.LineBasicMaterial;
211
- static highlightedLineMaterial: THREE.LineBasicMaterial;
212
- static selectedLineMaterial: THREE.LineBasicMaterial;
213
- static pointsMaterial: THREE.PointsMaterial;
214
- }
215
162
  export enum UpdateType {
216
163
  /**No changes */
217
- NONE = 0,
164
+ None = 0,
218
165
  /**Object has been removed from the scene */
219
- REMOVE = 1,
166
+ Remove = 1,
220
167
  /**Object has been added to the scene */
221
- ADD = 2,
168
+ Add = 2,
222
169
  /**Оbject has been significantly changed. Re-insert required */
223
- HARD = 4,
170
+ Hard = 4,
224
171
  /**Child objects has been changed*/
225
172
  Children = 8,
226
173
  /**Object geometry has been changed */
@@ -242,6 +189,7 @@ export class Color {
242
189
  g: number;
243
190
  b: number;
244
191
  a: number;
192
+
245
193
  constructor(r: number, g: number, b: number, a: number);
246
194
  static fromThreeColor(color: THREE.Color, alpha?: number): Color;
247
195
  static fromColorRepresentation(representation: THREE.ColorRepresentation): Color;
@@ -261,6 +209,7 @@ export abstract class ViewObject extends THREE.Object3D {
261
209
  readonly entityGuid: string;
262
210
  /**model part guid */
263
211
  readonly modelGuid: string;
212
+
264
213
  constructor(entityGuid: string, modelGuid: string, color: Color);
265
214
  /**Mesh representation of the object */
266
215
  abstract get mesh(): THREE.Mesh | null;
@@ -317,197 +266,18 @@ export abstract class ViewObject extends THREE.Object3D {
317
266
  */
318
267
  protected riseOnUpdated(updateType?: UpdateType, object?: THREE.Object3D): void;
319
268
  }
320
- export class Tessellation {
321
- vertices: number[];
322
- normals: number[];
323
- indices: number[];
324
- edgeIndices: number[];
325
- toBufferGeometry(): THREE.BufferGeometry;
326
- getWireframe(bufferGeometry?: THREE.BufferGeometry): THREE.WireframeGeometry;
327
- }
328
- export function isBinaryMeshTessellation(iData: Tessellation): boolean;
329
- export function isBinaryWireframeTessellation(iData: Tessellation): boolean;
330
- export function isBinaryPoints(iData: Tessellation): boolean;
331
- export function isTessellation(iData: Tessellation): boolean;
332
- export class ElementNode {
333
- Guid: string;
334
- ObjectState: unknown;
335
- Revision: bigint;
336
- ParentGuid: string;
337
- Name: string;
338
- Type: string;
339
- RepresentationType: string;
340
- RepresentationStatus: string;
341
- MeshesProperties: Map<string, MeshProperty[]>;
342
- }
343
- export class MeshProperty {
344
- meshColor: number;
345
- meshPlacement: number[];
346
- }
347
- export class MergeableViewObject extends ViewObject {
348
- protected _mesh?: THREE.Mesh;
349
- protected _wireframeMesh?: THREE.LineSegments;
350
- protected _meshMaterial?: THREE.Material;
351
- protected _wireframeMaterial?: THREE.LineBasicMaterial;
352
- constructor(entityGuid: string, modelGuid: string, transformation: THREE.Matrix4, color: Color, faceGeometry: THREE.BufferGeometry, edgeGeometry: THREE.WireframeGeometry);
353
- get mesh(): THREE.Mesh;
354
- get edges(): THREE.LineSegments;
355
- getBoundingBox(): THREE.Box3;
356
- raycast(iRaycaster: THREE.Raycaster, oIntersects: THREE.Intersection[]): void;
357
- dispose(): void;
358
- protected setHiddenForObject(iVal: boolean): void;
359
- protected setVisibleForObject(iVal: boolean): void;
360
- protected setColorForObject(iColor: Color): void;
361
- }
362
- type UpdateRange = {
363
- offset: number;
364
- count: number;
365
- };
366
- export class InstancedGeometry extends THREE.Object3D {
367
- readonly faceGeometry: THREE.BufferGeometry;
368
- readonly edgeGeometry: THREE.WireframeGeometry;
369
- readonly isInstanced: boolean;
370
- visibilityAutoUpdate: boolean;
371
- constructor(faceGeometry: THREE.BufferGeometry, edgeGeometry: THREE.WireframeGeometry, count: number);
372
- get geometry(): THREE.BufferGeometry;
373
- get wires(): THREE.BufferGeometry;
374
- updateVisibility(): void;
375
- getColorAt(index: number): Color;
376
- getMatrixAt(index: number): THREE.Matrix4;
377
- setColorAt(index: number, color: Color): void;
378
- setMatrixAt(index: number, matrix: THREE.Matrix4): void;
379
- setVisibileAt(index: number, visible: boolean): void;
380
- getVisibleAt(index: number): boolean;
381
- getBoundingBoxAt(index: number): THREE.Box3;
382
- disposeAt(index: number): void;
383
- dispose(): void;
384
- }
385
- export function calculateUpdateRange(changedElements: number[], itemSize: number, prev?: UpdateRange): UpdateRange;
386
- export {};
387
- export class InstancedViewObject extends ViewObject {
388
- readonly isInstanced: boolean;
389
- protected _instancedChildren: THREE.Object3D[];
390
- constructor(instancedGeometry: InstancedGeometry, entityGuid: string, modelGuid: string, _index: number, position: THREE.Matrix4, color: Color);
391
- get mesh(): THREE.Mesh;
392
- get edges(): THREE.LineSegments;
393
- raycast(iRaycaster: THREE.Raycaster, oIntersects: THREE.Intersection[]): void;
394
- getBoundingBox(): THREE.Box3;
395
- dispose(): void;
396
- getInstancedChlidren(): THREE.Object3D[];
397
- protected setHiddenForObject(iVal: boolean): void;
398
- protected setVisibleForObject(iVal: boolean): void;
399
- protected setColorForObject(color: Color): void;
400
- }
401
- export class InstancedMeshViewObject extends ViewObject {
402
- readonly instancedMesh: THREE.InstancedMesh;
403
- readonly isInstanced: boolean;
404
- protected _instancedChildren: THREE.Object3D[];
405
- constructor(instancedMesh: THREE.InstancedMesh, edgeGeometry: THREE.WireframeGeometry, entityGuid: string, modelGuid: string, _index: number, _transformation: THREE.Matrix4, color: Color);
406
- get mesh(): THREE.Mesh;
407
- get edges(): THREE.LineSegments;
408
- raycast(iRaycaster: THREE.Raycaster, oIntersects: THREE.Intersection[]): void;
409
- getBoundingBox(): THREE.Box3;
410
- dispose(): void;
411
- getInstancedChlidren(): THREE.Object3D[];
412
- protected setColorForObject(color: Color): void;
413
- protected setHoveredForObject(iVal: boolean): void;
414
- protected setSelectedForObject(iVal: boolean): void;
415
- protected setHiddenForObject(iVal: boolean): void;
416
- protected setVisibleForObject(iVal: boolean): void;
417
- protected _wireframeMesh: THREE.LineSegments;
418
- protected _wireframeMaterial: THREE.LineBasicMaterial;
419
- }
420
- export class RenderEngineSettings {
421
- static MaxVerticesInBlock: number;
422
- static MaxIndicesInBlock: number;
423
- static isInstancingEnabled: boolean;
424
- static MinInstanceCount: number;
425
- static useCustomShaders: boolean;
426
- static handleSelectionOnMainScene: boolean;
427
- static hoverMeshes: boolean;
428
- static hoverEdges: boolean;
429
- static selectEdges: boolean;
430
- static selectMeshes: boolean;
431
- }
432
- export class BatchViewObject extends ViewObject {
433
- constructor(entityGuid: string, modelGuid: string, _viewObjects: ViewObject[]);
434
- get mesh(): THREE.Mesh<THREE.BufferGeometry, THREE.Material | THREE.Material[]>;
435
- get edges(): THREE.LineSegments<THREE.BufferGeometry, THREE.Material | THREE.Material[]>;
436
- getBoundingBox(): THREE.Box3;
437
- protected setHoveredForObject(iVal: boolean): void;
438
- protected setSelectedForObject(iVal: boolean): void;
439
- protected setHiddenForObject(iVal: boolean): void;
440
- protected setVisibleForObject(iVal: boolean): void;
441
- protected setColorForObject(color: Color): void;
442
- protected resetColorForObject(): void;
269
+ export type EventFunction<Data> = ((data: Data) => void) | (() => void);
270
+ export interface IEventListener<Data> {
443
271
  dispose(): void;
444
272
  }
445
- export type ViewObjectParameters = {
446
- tessellationKey: string;
447
- element: ModelEntity;
448
- placement: THREE.Matrix4;
449
- color: Color;
450
- };
451
- type BuildObject3DFunction = () => ViewObject;
452
- export class ViewObjectBuilder {
453
- constructor(fabric: ViewObjectFabric);
454
- addParameter(parameter: ViewObjectParameters): void;
455
- builderMethod(elem: ModelEntity): BuildObject3DFunction;
456
- build(elem: ModelEntity): ViewObject;
457
- }
458
- export class ViewObjectFabric {
459
- addToBuild(parameter: ViewObjectParameters): number;
460
- getViewObjectById(id: number): ViewObject;
461
- createBuilder(): ViewObjectBuilder;
462
- buildAll(tessellations: Map<string, Tessellation>): void;
463
- clear(): void;
464
- }
465
- export {};
466
- export class ElementEntitySet {
467
- constructor(ids: string[], modelImplId: string);
468
- modelImplId: string;
469
- ids: string[];
470
- }
471
- export const MouseButtons: {
472
- Left: number;
473
- Middle: number;
474
- Right: number;
475
- };
476
- export class EventArgs {
477
- }
478
- export class ClickedEventArgs extends EventArgs {
479
- modelId: string;
480
- modelElementId: string;
481
- ctrlKey: boolean;
482
- constructor(modelId: string, modelElementId: string, ctrlKey: boolean);
483
- }
484
- export class SelectionChangedEventArgs extends EventArgs {
485
- selectedIds: ElementEntitySet[];
486
- constructor();
487
- }
488
- export class HoverEventArgs extends EventArgs {
489
- modelId: string;
490
- modelElementId: string;
491
- constructor(modelId: string, modelElementId: string);
492
- }
493
- export class GlobalEvents {
494
- static clicked: EventDispatcher<ClickedEventArgs>;
495
- static selectionChanged: EventDispatcher<SelectionChangedEventArgs>;
496
- static selectionReset: EventDispatcher<void>;
497
- static hovered: EventDispatcher<HoverEventArgs>;
498
- static canvasesResized: EventDispatcher<DOMRect>;
499
- static renderRequiredEverywhere: EventDispatcher<void>;
500
- static modelLoaded: EventDispatcher<ModelImpl>;
501
- static modelUpdated: EventDispatcher<{
502
- viewNumber?: number;
503
- }>;
504
- static tessellationLoaded: EventDispatcher<void>;
505
- static preciseModelSet: EventDispatcher<boolean>;
506
- static projectLoaded: EventDispatcher<void>;
507
- static amountOfTessellationsToLoad: EventDispatcher<number>;
508
- static dblClick: EventDispatcher<ClickedEventArgs>;
509
- static cameraParametersChanged: EventDispatcher<void>;
510
- static cameraNavigationModeChanged: EventDispatcher<void>;
273
+ export interface IEventSigner<Data> {
274
+ listen(callback: EventFunction<Data>, options?: {
275
+ bind?: object;
276
+ }): IEventListener<Data>;
277
+ unlisten(callback: EventFunction<Data>, options?: {
278
+ bind?: object;
279
+ allowMissing?: boolean;
280
+ }): boolean;
511
281
  }
512
282
  export type Point3 = {
513
283
  x: number;
@@ -603,183 +373,6 @@ export interface ICameraControl {
603
373
  */
604
374
  setNavigationMode(mode: CameraNavigationMode, isEnable: boolean, duration?: number): void;
605
375
  }
606
- export class CameraPlacement {
607
- constructor(cameraPos: THREE.Vector3, viewDir: THREE.Vector3, upDir?: THREE.Vector3);
608
- static fromPointView(cameraPosition: THREE.Vector3, eyeDirection: THREE.Vector3): CameraPlacement;
609
- clone(): CameraPlacement;
610
- getCameraPos(): THREE.Vector3;
611
- getViewDir(): THREE.Vector3;
612
- getUpDir(): THREE.Vector3;
613
- getOrientation(): CameraOrientation;
614
- setOrientation(iOrientation: CameraOrientation): void;
615
- getRightDir(): THREE.Vector3;
616
- getViewTarget(): THREE.Vector3;
617
- getRotationMatrix(): THREE.Matrix4;
618
- getRotationQuaternion(): THREE.Quaternion;
619
- }
620
- export class CameraInternalParams {
621
- mode: "perspective" | "ortho";
622
- near: number;
623
- far: number;
624
- fov: number;
625
- /**
626
- * @param {number} fov vertical, in radians
627
- */
628
- constructor(mode: "perspective" | "ortho", near: number, far: number, fov: number);
629
- clone(): CameraInternalParams;
630
- }
631
- export const maxFar = 10000000;
632
- export const minNear: number;
633
- export class LCPCamera {
634
- constructor(external?: CameraPlacement, internal?: CameraInternalParams);
635
- setOrientation(iOrientation: CameraOrientation): void;
636
- setAspectRatio(aspect: number): boolean;
637
- getPlacement(): CameraPlacement;
638
- getInternalParams(): CameraInternalParams;
639
- setPlacement(iParams: CameraPlacement): void;
640
- setInternalParams(iParams: CameraInternalParams): void;
641
- getThreeCamera(): THREE.Camera;
642
- checkValid(): void;
643
- getFov(): number;
644
- }
645
- export class CameraInterpolation {
646
- constructor(_startPlacement: CameraPlacement, _endPlacement: CameraPlacement);
647
- apply(iCamera: LCPCamera, iOrientationObserver?: EventEmitter<CameraOrientation>): void;
648
- stop(): void;
649
- }
650
- export class BrowserInfo {
651
- constructor();
652
- isMobileBrowser(): boolean;
653
- isIE11(): boolean;
654
- }
655
- export class globals {
656
- static browserInfo: BrowserInfo;
657
- }
658
- export class CameraControl implements ICameraControl {
659
- protected _camera: LCPCamera;
660
- protected _modelOrientationObserver: EventEmitter<CameraOrientation>;
661
- constructor(modelOrientationObserver?: EventEmitter<CameraOrientation>);
662
- getCamera(): THREE.Camera;
663
- setCameraParameters(iParams: CameraParameters): void;
664
- getCameraParameters(): CameraParameters;
665
- setAspectRatio(width: number, heigth: number): boolean;
666
- rotate(movement: THREE.Vector2, rotationCenter: THREE.Vector3): void;
667
- translate(prevPosNdc: THREE.Vector2, currPosNdc: THREE.Vector2, viewCenter: THREE.Vector3): void;
668
- spin(movement: THREE.Vector2): void;
669
- orientateCamera(iOrientation: CameraOrientation, isAnimationEnabled?: boolean): void;
670
- zoomToPoint(deltaSign: number, point: THREE.Vector3): void;
671
- zoomToFit(bb: THREE.Box3, iOrientation?: CameraOrientation, isAnimationEnabled?: boolean): void;
672
- setNavigationMode(mode: CameraNavigationMode, isEnable: boolean, duration?: number): void;
673
- getNavigationMode(): CameraNavigationMode;
674
- protected calcCameraRotation(rotationDelta: THREE.Vector2): THREE.Quaternion;
675
- protected abortAnimation(): void;
676
- protected getPlacement(): CameraPlacement;
677
- protected updatePlacement(iParams: CameraPlacement): void;
678
- protected calcZoomToFitPosition(bb: THREE.Box3, iOrientation: CameraOrientation): THREE.Vector3;
679
- protected moveToPosition(newParams: CameraPlacement, isAnimationEnabled?: boolean): void;
680
- }
681
- export enum IntersectionType {
682
- Outside = 0,
683
- Contains = 1,
684
- Intersects = 2
685
- }
686
- export class IntersectionItem {
687
- minParam: number;
688
- maxParam: number;
689
- node: BvhNode;
690
- intersectionType: IntersectionType;
691
- constructor(minParam: number, maxParam: number, node: BvhNode, intersectionType?: IntersectionType);
692
- }
693
- export class BvhNode {
694
- box: THREE.Box3;
695
- sphere: THREE.Sphere;
696
- object: THREE.Object3D;
697
- guid: string;
698
- constructor(iBox?: THREE.Box3, object?: THREE.Object3D, guid?: string);
699
- }
700
- export interface IBvh {
701
- get needsUpdate(): boolean;
702
- getRootBox(): THREE.Box3;
703
- add(nodes: BvhNode[] | BvhNode): void;
704
- update(nodes: BvhNode[] | BvhNode): void;
705
- remove(nodes: string[] | string): void;
706
- manage(): void;
707
- intersectRay(iRay: THREE.Ray, iTol: number): IntersectionItem[];
708
- intersectFrustum(frustum: THREE.Frustum): IntersectionItem[];
709
- clear(): void;
710
- }
711
- export class ExtRay extends THREE.Ray {
712
- inverseDirection: THREE.Vector3;
713
- constructor(iRay: THREE.Ray);
714
- }
715
- export function intersectRayBox(iRay: ExtRay, iBox: THREE.Box3, iTol: number, oParams: {
716
- min: number;
717
- max: number;
718
- }): boolean;
719
- export function intersectFrustumBox(frustum: THREE.Frustum, box: THREE.Box3, oParams: {
720
- min: number;
721
- max: number;
722
- }): IntersectionType;
723
- export class BvhStack implements IBvh {
724
- get needsUpdate(): boolean;
725
- manage(): void;
726
- add(nodes: BvhNode[] | BvhNode): void;
727
- update(nodes: BvhNode[] | BvhNode): void;
728
- remove(nodes: string[] | string): void;
729
- intersectRay(iRay: THREE.Ray, iTol: number): IntersectionItem[];
730
- intersectFrustum(frustum: THREE.Frustum): IntersectionItem[];
731
- getRootBox(): THREE.Box3;
732
- clear(): void;
733
- }
734
- export class BvhRaycaster<T extends THREE.Object3D> extends THREE.Raycaster {
735
- constructor();
736
- intersectObjectsBvh(iTree: IBvh[], iFirstOnly?: boolean): THREE.Intersection<T>[];
737
- }
738
- export class BvhFrustumIntersector<T extends THREE.Object3D> {
739
- intersectObjectsBvh(BVHs: IBvh[], ndcFrustumBox: THREE.Box3, unProjMatrix: THREE.Matrix4, isContainsOnly: boolean, getObjectGeometry?: (object: T) => THREE.Mesh | THREE.LineSegments): T[];
740
- checkMeshIntersection(obj: THREE.Mesh, ndcFrustumBox: THREE.Box3, projMatrix: THREE.Matrix4, isContainsOnly: boolean): IntersectionType;
741
- /**
742
- * Calc intersection by SAT method
743
- * * IntersectionType.Outside - no intersection
744
- * * IntersectionType.Contains - a-polygon contains in b-polygon
745
- * * IntersectionType.Intersects - a-polygon contains or intersects b-polygon
746
- * @param {THREE.Vector2[]} a points
747
- * @param {THREE.Vector2[]} b points
748
- * @returns IntersectionType
749
- */
750
- calcSatIntersection(a: THREE.Vector2[], b: THREE.Vector2[]): IntersectionType;
751
- }
752
- export abstract class IntersectionChecker<T extends THREE.Object3D> {
753
- protected _raycaster: BvhRaycaster<T>;
754
- protected _ndcRaycaster: THREE.Raycaster;
755
- protected _frustumIntersector: BvhFrustumIntersector<T>;
756
- protected _prevRay?: THREE.Ray;
757
- protected _currentIntersection?: THREE.Intersection<T>;
758
- get modelCenter(): THREE.Vector3;
759
- getIntersectionPoint(): THREE.Intersection<T> | undefined;
760
- getIntersectionByRay(ray: THREE.Ray): THREE.Intersection<T> | undefined;
761
- getIntersectionByNdcPt(ndcPos: THREE.Vector2, camera: THREE.Camera): THREE.Intersection<T> | undefined;
762
- clear(): void;
763
- dispose(): void;
764
- abstract add(iObjects: T | T[]): void;
765
- protected abstract getBvh(): IBvh[];
766
- protected filterIntersections(intersections: THREE.Intersection<T>[]): THREE.Intersection<T>;
767
- }
768
- export class ViewcubeIntersectionChecker extends IntersectionChecker<ViewcubeElement> {
769
- protected _hovered?: ViewcubeElement;
770
- tryToHoverByRay(ray: THREE.Ray): void;
771
- tryToHoverByNdcPt(ndcPos: THREE.Vector2, camera: THREE.Camera): void;
772
- resetHover(): void;
773
- add(iObjects: ViewcubeElement[]): void;
774
- click(ndcPos: THREE.Vector2, camera: THREE.Camera): void;
775
- dblClick(ndcPos: THREE.Vector2, camera: THREE.Camera): void;
776
- clear(): void;
777
- protected getBvh(): IBvh[];
778
- }
779
- export class GlobalTextures {
780
- static getTexture(iName: string): Promise<THREE.Texture>;
781
- static getTextureWithUrl(iName: string, url: string): Promise<THREE.Texture>;
782
- }
783
376
  export interface IModelIntersectionChecker {
784
377
  /** Gets the center of the model*/
785
378
  get modelCenter(): THREE.Vector3;
@@ -822,12 +415,17 @@ export interface IModelIntersectionChecker {
822
415
  * @param ndcFrustumBox - frustum in the NDC space
823
416
  * @param unProjMatrix - NDC to World projection matrix
824
417
  * @param isContainsOnly - if true, gets only fully contained objects in the frustum
418
+ * @param isClippingEnable - if true, intersect objects only in the clipping space
825
419
  */
826
- getIntersectionIDByFrustumNdcPt(ndcFrustumBox: THREE.Box3, unProjMatrix: THREE.Matrix4, isContainsOnly: boolean): {
420
+ getIntersectionIDByFrustumNdcPt(ndcFrustumBox: THREE.Box3, unProjMatrix: THREE.Matrix4, isContainsOnly: boolean, isClippingEnable?: boolean): {
827
421
  modelId: string;
828
422
  guid: string;
829
423
  }[];
830
424
  }
425
+ export class TPair<TKey, TValue> {
426
+ get key(): TKey;
427
+ get value(): TValue;
428
+ }
831
429
  export class RenderViewSettings {
832
430
  telemetry?: boolean;
833
431
  hideEdgesWhenNavigation?: boolean;
@@ -934,8 +532,6 @@ export interface IUserScene {
934
532
  render(context: IRenderOperationContext): void;
935
533
  /** Clear scene */
936
534
  clear(): void;
937
- /** Dispose scene */
938
- dispose(): void;
939
535
  }
940
536
  export interface I3DRenderer {
941
537
  clear(color?: boolean, depth?: boolean, stencil?: boolean): void;
@@ -944,467 +540,131 @@ export interface I3DRenderer {
944
540
  getSize(target: THREE.Vector2): THREE.Vector2;
945
541
  setSize(width: number, height: number, updateStyle?: boolean): void;
946
542
  setViewport(x: THREE.Vector4 | number, y?: number, width?: number, height?: number): void;
947
- dispose(): void;
948
543
  clippingPlanes: THREE.Plane[];
949
544
  domElement: HTMLCanvasElement;
950
545
  }
951
546
  export interface IRenderViewer3D {
952
547
  /** Gets model inetrsection checker. */
953
548
  getIntersectionChecker(): IModelIntersectionChecker;
954
- /** Request a full redraw of the canvas */
549
+ /** Request a full redraw of the canvas. */
955
550
  updateCurrentCanvas(): Promise<void>;
956
551
  /**
957
552
  * Place object on the scene.\
958
553
  * An object can only be placed on one scene.
959
- * @param iObj - object to place
554
+ * @param iObj - object to place.
960
555
  * @param sceneID - (optional) scene name. `MainScene` by default.
961
556
  */
962
557
  placeObjectOnScene(iObj: THREE.Object3D, sceneID?: string): Promise<void>;
963
558
  /**
964
- * Removae object from scene.
559
+ * Remove object from scene.
965
560
  * @param iObj
966
561
  */
967
562
  removeObjectFromScene(iObj: THREE.Object3D): Promise<void>;
968
563
  /**
969
- * Set clipping for the scene.
970
- * @param planes - clipping planes
971
- * @param sceneID - (optional) scene name. `MainScene` by default.
564
+ * Set clipping planes for rendering.
565
+ * @param planes - array of clipping planes.
566
+ */
567
+ setClipping(planes: THREE.Plane[]): void;
568
+ /**
569
+ * Set active clipping planes: planes with colored sections
570
+ * @param indices - active planes indices in the array of clipping planes
972
571
  */
973
- setClipping(planes: THREE.Plane[], sceneID?: string): void;
572
+ setActiveClipPlaneIndices(indices: number[]): void;
974
573
  /**
975
574
  * Gets all render scenes.
976
575
  */
977
576
  getScenes(): IUserScene[];
978
577
  }
979
- export enum ViewcubeAxis {
980
- X = 0,
981
- Y = 1,
982
- Z = 2
983
- }
984
- export class ViewcubeElement extends THREE.Mesh {
985
- constructor(geometry: THREE.BufferGeometry, defaultFaceMaterial: THREE.MeshLambertMaterial, outline: THREE.LineSegments, outlineDefaultVisibility: boolean, outlineDefaultMaterial: THREE.LineBasicMaterial, _defaultOrientation: CameraOrientation, _viewcubeOrientationObserver: EventEmitter<CameraOrientation>);
986
- getOutline(): THREE.LineSegments<THREE.BufferGeometry, THREE.Material | THREE.Material[]>;
987
- createMaterials(): void;
988
- setUpVector(up: THREE.Vector3): void;
989
- getBoundingBox(): THREE.Box3;
990
- setHovered(iVal: boolean): void;
991
- handleClick(): void;
992
- handleDblClick(): void;
993
- getDefaultOrientation(): CameraOrientation;
994
- setSelected(isSelected: boolean): void;
995
- }
996
- export class Viewcube {
997
- constructor(_resizableCanvasHolder: HTMLDivElement, _viewcubeHolder: HTMLDivElement, _viewcubeOrientationObserver: EventDispatcher<CameraOrientation>, _updateCanvas: () => void, _sideBase64Images: TMap<string, string>);
998
- click(ndcPos: THREE.Vector2): void;
999
- dblClick(ndcPos: THREE.Vector2): void;
1000
- tryToHover(ndcPos: THREE.Vector2): void;
1001
- render(renderer: I3DRenderer): void;
1002
- dispose(): void;
1003
- getScene(): THREE.Scene;
1004
- getCamera(): LCPCamera;
1005
- setOrientation(iOrientation: CameraOrientation): void;
1006
- updateSelectedElement(iOrientation: CameraOrientation): void;
1007
- addArrows(): void;
1008
- addBoxWireFrame(): void;
1009
- }
1010
- export class ImagesHolder {
1011
- container: HTMLDivElement;
1012
- sideBase64Images: TMap<string, string>;
1013
- constructor(container: HTMLDivElement);
1014
- addImage(name: string, svg: string): ImagesHolder;
1015
- }
1016
- export function warn(m: string, ...p: unknown[]): void;
1017
- export function assert(cond: boolean, message?: string, ...p: unknown[]): void;
1018
- export function check(cond: () => boolean, message?: string, ...p: unknown[]): void;
1019
- export function log(level: number, message: string, ...p: unknown[]): void;
1020
- export abstract class ScenePart extends THREE.Scene implements IUserScene {
1021
- protected _needsRedraw: boolean;
1022
- protected _allObjects: Map<string, THREE.Object3D<THREE.Event>>;
1023
- protected _directionalLight: THREE.PointLight;
1024
- protected _ambientLight: THREE.AmbientLight;
1025
- constructor(name?: string);
1026
- get avgRenderTime(): DOMHighResTimeStamp;
1027
- abstract get needsUpdate(): boolean;
1028
- get needsRedraw(): boolean;
1029
- abstract get intersectionChecker(): IModelIntersectionChecker | null;
1030
- get threeObjectRepresentation(): THREE.Object3D | null;
1031
- update(...objects: TPair<THREE.Object3D, UpdateType>[]): this;
1032
- has(obj: THREE.Object3D): boolean;
1033
- render(context: IRenderOperationContext): void;
1034
- clear(): this;
1035
- dispose(): void;
1036
- setClipping(planes: THREE.Plane[]): void;
1037
- abstract updateRange(objects: TPair<THREE.Object3D, UpdateType>[]): void;
1038
- abstract addRange(objects: THREE.Object3D[]): void;
1039
- abstract removeRange(objects: THREE.Object3D[]): void;
1040
- abstract manageScene(context?: IRenderOperationContext): boolean;
1041
- protected onBeforeRenderCallback(renderer: THREE.WebGLRenderer, scene: THREE.Scene, camera: THREE.Camera, renderTarget: object): void;
1042
- protected onAfterRenderCallback(renderer: THREE.WebGLRenderer, scene: THREE.Scene, camera: THREE.Camera): void;
1043
- }
1044
- export enum ObjectType {
1045
- INSTANCED = "Instanced",
1046
- MERGEABLE = "Mergeable",
1047
- UNMERGEABLE = "Unmergeable",
1048
- UNSUPPORTED = "Unsupported"
1049
- }
1050
- export class MeshType {
1051
- static geometryType: string;
1052
- static create(geom?: THREE.BufferGeometry): THREE.Mesh<THREE.BufferGeometry, THREE.Material | THREE.Material[]>;
1053
- static isType(obj: THREE.Object3D): obj is THREE.Mesh;
1054
- }
1055
- export class LineSegmentsType {
1056
- static geometryType: string;
1057
- static create(geom?: THREE.BufferGeometry): THREE.LineSegments<THREE.BufferGeometry, THREE.Material | THREE.Material[]>;
1058
- static isType(obj: THREE.Object3D): obj is THREE.LineSegments;
1059
- }
1060
- const SupportableTypes: (typeof MeshType | typeof LineSegmentsType)[];
1061
- type MergeableTypeConstructor = (typeof SupportableTypes)[0];
1062
- const dummyEls: (THREE.LineSegments<THREE.BufferGeometry, THREE.Material | THREE.Material[]> | THREE.Mesh<THREE.BufferGeometry, THREE.Material | THREE.Material[]>)[];
1063
- export type MergeableType = (typeof dummyEls)[0];
1064
- export type MergeableObjectInfo = {
1065
- type: MergeableTypeConstructor;
1066
- material: THREE.Material;
1067
- castShadow: boolean;
1068
- receiveShadow: boolean;
1069
- };
1070
- export type ObjectTag = {
1071
- obj: THREE.Object3D;
1072
- objectType: ObjectType;
1073
- tag: string;
1074
- info?: any;
1075
- };
1076
- export function getTag(obj: THREE.Object3D): ObjectTag;
1077
- export function hash(material: THREE.Material): number;
1078
- export function isMergeable(obj: THREE.Object3D): obj is MergeableType;
1079
- export function isInstancedThreeObject(obj: THREE.Object3D): boolean;
1080
- export function isInstancedViewObject(obj: THREE.Object3D): obj is InstancedViewObject | InstancedMeshViewObject;
1081
- export {};
1082
- const gTypedArrays: (Int8ArrayConstructor | Uint8ArrayConstructor | Uint8ClampedArrayConstructor | Int16ArrayConstructor | Uint16ArrayConstructor | Int32ArrayConstructor | Uint32ArrayConstructor | Float32ArrayConstructor | Float64ArrayConstructor)[];
1083
- type AttrTypedArrayCtor = (typeof gTypedArrays)[0];
1084
- type AttributeInfo = {
1085
- type: AttrTypedArrayCtor;
1086
- name: string;
1087
- itemSize: number;
1088
- normalized: boolean;
1089
- };
1090
- type GeometryInfo = {
1091
- attr: AttributeInfo[];
1092
- vertexCount: number;
1093
- indexCount: number;
1094
- };
1095
- function getGeometryInfo(geom: THREE.BufferGeometry): GeometryInfo | undefined;
1096
- function allocateMerged(geoms: GeometryInfo[]): THREE.BufferGeometry;
1097
- type Position = {
1098
- vertex: number;
1099
- index: number;
1100
- };
1101
- function copyBufferGeometry(mergedGeometry: THREE.BufferGeometry, starts: Position, geometry: THREE.BufferGeometry, transform: THREE.Matrix4): Position;
1102
- function copyIndexes(target: THREE.BufferAttribute, targetStart: number, source: THREE.BufferAttribute, indexOffset: number): number;
1103
- function copyVertices(target: THREE.BufferGeometry, targetStart: number, source: THREE.BufferGeometry, transform: THREE.Matrix4): number;
1104
- export { GeometryInfo, getGeometryInfo, allocateMerged, copyBufferGeometry, copyIndexes, copyVertices };
1105
- export class ObjectData {
1106
- readonly threeObj: THREE.Object3D;
1107
- constructor(threeObj: THREE.Object3D);
1108
- }
1109
- export abstract class StorageBase implements IStorage {
1110
- readonly storageTag: string;
1111
- protected _isEdgeVisible: boolean;
1112
- protected readonly _threeObj: THREE.Object3D<THREE.Event>;
1113
- protected _allObjects: Map<string, ObjectData>;
1114
- protected _updateQueue: Map<ObjectData, UpdateType>;
1115
- constructor(tag: string);
1116
- get needsUpdate(): boolean;
1117
- get edgeVisible(): boolean;
1118
- set edgeVisible(value: boolean);
1119
- count(): number;
1120
- getThreeObject(): THREE.Object3D;
1121
- isEmpty(): boolean;
1122
- has(obj: THREE.Object3D): boolean;
1123
- update(obj: THREE.Object3D<THREE.Event>, updateType: UpdateType): void;
1124
- manageStorage(allottedTime: DOMHighResTimeStamp): number;
1125
- dispose(): void;
1126
- abstract add(obj: THREE.Object3D): boolean;
1127
- abstract remove(obj: THREE.Object3D): boolean;
1128
- protected abstract updateObject(objData: ObjectData, updateType: UpdateType): void;
1129
- protected addDrawnObject(objData: ObjectData): void;
1130
- protected removeDrawnObject(objData: ObjectData): void;
1131
- protected updateDrawnObject(objData: ObjectData): void;
1132
- protected arrayRemove<Type>(array: Type[], elem: Type): void;
1133
- }
1134
- export function isVisible(objData: ObjectData): boolean;
1135
- export class Block {
1136
- readonly threeObj: MergeableType;
1137
- readonly objects: BlockObjectData[];
1138
- private constructor();
1139
- static create(objects: BlockObjectData[], info: MergeableObjectInfo): Block;
1140
- isNeedVisibilityUpdate(): boolean;
1141
- updateVisibilityInBlock(): void;
1142
- isVisible(): boolean;
1143
- isVisibleInBlock(objData: BlockObjectData): boolean;
1144
- dispose(): void;
1145
- }
1146
- type BlockPos = {
1147
- vertex: number;
1148
- index: number;
1149
- };
1150
- export class BlockObjectData extends ObjectData {
1151
- readonly threeObj: MergeableType;
1152
- constructor(threeObj: MergeableType);
1153
- static create(iThreeObj: THREE.Object3D): BlockObjectData | undefined;
1154
- readonly geom: Geom.GeometryInfo;
1155
- block: Block;
1156
- blockPos: BlockPos;
1157
- }
1158
- export class BlockStorage extends StorageBase {
1159
- readonly info: MergeableObjectInfo;
1160
- constructor(tag: string, info: MergeableObjectInfo);
1161
- set edgeVisible(value: boolean);
1162
- get needsUpdate(): boolean;
1163
- add(obj: THREE.Object3D): boolean;
1164
- remove(obj: THREE.Object3D): boolean;
1165
- tryToMergeOneBlock(makeIncomplete?: boolean): boolean;
1166
- manageStorage(allottedTime: DOMHighResTimeStamp): number;
1167
- dispose(): void;
1168
- protected updateObject(objData: ObjectData, updateType: UpdateType): void;
1169
- }
1170
- export {};
1171
- export class UnmergeableStorage extends StorageBase {
1172
- constructor(tag: string);
1173
- add(obj: THREE.Object3D): boolean;
1174
- remove(obj: THREE.Object3D): boolean;
1175
- protected updateObject(objData: ObjectData, updateType: UpdateType): void;
1176
- }
1177
- export class InstancedObjectsStorage extends StorageBase {
1178
- constructor(tag: string);
1179
- set edgeVisible(value: boolean);
1180
- add(obj: THREE.Object3D): boolean;
1181
- remove(obj: THREE.Object3D): boolean;
1182
- protected updateObject(objData: ObjectData, updateType: UpdateType): void;
1183
- protected addDrawnObject(objData: ObjectData): void;
1184
- }
1185
- export interface IStorage {
1186
- readonly storageTag: string;
1187
- edgeVisible: boolean;
1188
- get needsUpdate(): boolean;
1189
- getThreeObject(): THREE.Object3D;
1190
- isEmpty(): boolean;
1191
- add(obj: THREE.Object3D): boolean;
1192
- remove(obj: THREE.Object3D): boolean;
1193
- has(obj: THREE.Object3D): boolean;
1194
- update(obj: THREE.Object3D, updateType: UpdateType): void;
1195
- manageStorage(allottedTime: DOMHighResTimeStamp): number;
1196
- dispose(): void;
1197
- }
1198
- export function createStorage(objectTag: ObjectTag): IStorage;
1199
- export class SelectedObjectsStorage extends StorageBase {
1200
- constructor(tag: string);
1201
- get needsUpdate(): boolean;
1202
- set edgeVisible(value: boolean);
1203
- add(obj: THREE.Object3D): boolean;
1204
- remove(obj: THREE.Object3D): boolean;
1205
- manageStorage(allottedTime: DOMHighResTimeStamp): number;
1206
- dispose(): void;
1207
- protected updateObject(objData: ObjectData, updateType: UpdateType): void;
1208
- }
1209
- export class BvhTree implements IBvh {
1210
- constructor();
1211
- get needsUpdate(): boolean;
1212
- manage(): void;
1213
- add(nodes: BvhNode[] | BvhNode): void;
1214
- update(nodes: BvhNode[] | BvhNode): void;
1215
- remove(nodes: string[] | string): void;
1216
- intersectRay(iRay: THREE.Ray, iTol: number): IntersectionItem[];
1217
- intersectFrustum(frustum: THREE.Frustum): IntersectionItem[];
1218
- getRootBox(): THREE.Box3;
1219
- clear(): void;
1220
- }
1221
- export class BlockScene extends ScenePart {
1222
- get needsUpdate(): boolean;
1223
- get intersectionChecker(): IModelIntersectionChecker;
1224
- add(...objects: THREE.Object3D<THREE.Event>[]): this;
1225
- remove(...objects: THREE.Object3D<THREE.Event>[]): this;
1226
- addRange(objects: THREE.Object3D<THREE.Event>[]): void;
1227
- removeRange(objects: THREE.Object3D<THREE.Event>[]): void;
1228
- updateRange(objects: TPair<THREE.Object3D<THREE.Event>, UpdateType>[]): void;
1229
- clear(): this;
1230
- dispose(): void;
1231
- setClipping(planes: THREE.Plane[]): void;
1232
- manageScene(context?: IRenderOperationContext): boolean;
1233
- render(context: IRenderOperationContext): void;
1234
- traverse(callback: (object: THREE.Object3D<THREE.Event>) => void): void;
1235
- traverseVisible(callback: (object: THREE.Object3D<THREE.Event>) => void): void;
1236
- }
1237
- export class SelectionScene extends ScenePart {
1238
- constructor(name?: string);
1239
- get needsUpdate(): boolean;
1240
- get intersectionChecker(): null;
1241
- add(...objects: THREE.Object3D<THREE.Event>[]): this;
1242
- remove(...objects: THREE.Object3D<THREE.Event>[]): this;
1243
- addRange(objects: THREE.Object3D<THREE.Event>[]): void;
1244
- removeRange(objects: THREE.Object3D<THREE.Event>[]): void;
1245
- updateRange(objects: TPair<THREE.Object3D<THREE.Event>, UpdateType>[]): void;
1246
- clear(): this;
1247
- dispose(): void;
1248
- manageScene(context?: IRenderOperationContext): boolean;
578
+ export class ModelElement {
579
+ get id(): string;
580
+ get modelPartId(): string;
581
+ get parent(): ModelElement | undefined;
582
+ get type(): string;
583
+ get name(): string;
584
+ get children(): ModelElement[];
585
+ get hasGeometry(): boolean;
586
+ get boundingBoxCenter(): Point3;
1249
587
  }
1250
- export class MainScene extends ScenePart {
1251
- constructor(name?: string);
1252
- get needsUpdate(): boolean;
1253
- get needsRedraw(): boolean;
1254
- get intersectionChecker(): IModelIntersectionChecker;
1255
- updateRange(objects: TPair<THREE.Object3D<THREE.Event>, UpdateType>[]): void;
1256
- addRange(objects: THREE.Object3D<THREE.Event>[]): void;
1257
- removeRange(objects: THREE.Object3D<THREE.Event>[]): void;
1258
- manageScene(context?: IRenderOperationContext): boolean;
1259
- setClipping(planes: THREE.Plane[]): void;
1260
- clear(): this;
1261
- render(context: IRenderOperationContext): void;
1262
- dispose(): void;
588
+ export class ModelElementTree {
589
+ /**
590
+ *
591
+ * @param {string|ModelElement} element - element id or element instance
592
+ * @param callback
593
+ * @param recursive
594
+ */
595
+ enumElementChildren(element: string | ModelElement, callback: (guid: string) => void, recursive?: boolean): void;
596
+ /**
597
+ * Gets the root element of the model part
598
+ * @returns {ModelElement} - model element instance
599
+ */
600
+ getRootElement(): ModelElement;
601
+ /**
602
+ * Gets all elements of the model part
603
+ * @returns array of the model elements
604
+ */
605
+ getAllElements(): ModelElement[];
606
+ /**
607
+ * Gets model element by id
608
+ * @param { string } id - model element id
609
+ * @returns model element;
610
+ */
611
+ getElement(id: string): ModelElement;
612
+ /**
613
+ * Checks given element is viewable
614
+ * @param {string|ModelElement} element - element id or element instance
615
+ * @returns {boolean}
616
+ */
617
+ isViewableElement(element: string | ModelElement): boolean;
618
+ /**
619
+ * Checks given element is detached from the root element
620
+ * @param {string|ModelElement} element - element id or element instance
621
+ * @returns {boolean}
622
+ */
623
+ isDetachedElement(element: string | ModelElement): boolean;
624
+ /**
625
+ * Gets the element level in the element tree
626
+ * @param {string|ModelElement} element - element id or element instance
627
+ * @returns {number} - level of the element
628
+ */
629
+ getChildLevelNumber(element: string | ModelElement): number;
1263
630
  }
1264
- export class OverlayScene extends ScenePart {
1265
- get needsUpdate(): boolean;
1266
- get intersectionChecker(): IModelIntersectionChecker;
1267
- clear(): this;
631
+ export class ModelPart {
632
+ get id(): string;
633
+ get elementTree(): ModelElementTree;
1268
634
  dispose(): void;
1269
- add(...objects: THREE.Object3D<THREE.Event>[]): this;
1270
- remove(...objects: THREE.Object3D<THREE.Event>[]): this;
1271
- updateRange(objects: TPair<THREE.Object3D, UpdateType>[]): void;
1272
- addRange(objects: THREE.Object3D<THREE.Event>[]): void;
1273
- removeRange(objects: THREE.Object3D<THREE.Event>[]): void;
1274
- manageScene(context?: IRenderOperationContext): boolean;
1275
- setClipping(planes: THREE.Plane[]): void;
1276
- }
1277
- export class RenderOperation {
1278
- constructor(id: string, mode: OperationMode, priority: number | OperationPriority, opDelegate: RenderOperationDelegate, opCallback?: (status: OperationStatus) => void, affectsOnTotalManageTime?: boolean);
1279
- status: OperationStatus;
1280
- readonly isAffectsOnTotalManageTime: boolean;
1281
- readonly operationID: string;
1282
- readonly mode: OperationMode;
1283
- readonly priority: number;
1284
- readonly opDelegate: RenderOperationDelegate;
1285
- readonly opCallback: (status: OperationStatus) => void;
1286
- execute(context: IRenderOperationContext): void;
1287
- }
1288
- export class RenderOperationContext implements IRenderOperationContext {
1289
- constructor(schedulerContext: RenderLoopContext);
1290
- get isSuspensionRequested(): boolean;
1291
- isRedrawRequested: boolean;
1292
- isForcedExecution: boolean;
1293
- get renderer(): I3DRenderer;
1294
- get camera(): THREE.Camera;
1295
- get settings(): RenderViewSettings;
1296
- get isNavigation(): boolean;
1297
- get currentTime(): DOMHighResTimeStamp;
1298
- get elapsedTime(): DOMHighResTimeStamp;
1299
- get remainedTime(): DOMHighResTimeStamp;
1300
- get isElapsed(): boolean;
1301
- get lastFrameTimestamp(): DOMHighResTimeStamp;
1302
- get lastRenderCycleTimestamp(): DOMHighResTimeStamp;
1303
- get userData(): Map<string, object>;
1304
- start(allottedTime: DOMHighResTimeStamp): void;
1305
- pauseTimer(): void;
1306
- resumeTimer(): void;
1307
635
  }
1308
- class RenderLoopContext {
1309
- constructor(renderer: I3DRenderer, cameraControl: ICameraControl, settings: RenderViewSettings);
1310
- isRedrawRequested: boolean;
1311
- isForcedExecution: boolean;
1312
- lastFrameTimestamp: DOMHighResTimeStamp;
1313
- lastRenderCycleTimestamp: DOMHighResTimeStamp;
1314
- readonly userData: Map<string, object>;
1315
- readonly renderer: I3DRenderer;
1316
- readonly cameraControl: ICameraControl;
1317
- readonly settings: RenderViewSettings;
1318
- createOperationContext(): RenderOperationContext;
1319
- reset(operations: RenderOperation[]): void;
1320
- isDone(): boolean;
1321
- execute(): void;
1322
- }
1323
- export class RenderScheduler {
1324
- renderer: I3DRenderer;
1325
- cameraControl: ICameraControl;
1326
- constructor(renderer: I3DRenderer, cameraControl: ICameraControl, settings: RenderViewSettings);
1327
- isRedrawRequested: boolean;
1328
- get renderLoopContext(): RenderLoopContext;
1329
- addOperation(operation: RenderOperation): boolean;
1330
- removeOperation(operation: RenderOperation): boolean;
1331
- render(force?: boolean): Promise<void>;
1332
- run(): void;
1333
- stop(): void;
1334
- reset(): void;
1335
- clear(): void;
1336
- updateSettings(settings: RenderViewSettings): void;
1337
- }
1338
- export {};
1339
- export class RenderIntersectionChecker implements IModelIntersectionChecker {
1340
- get modelCenter(): THREE.Vector3;
1341
- get needsUpdate(): boolean;
1342
- get boundingBox(): THREE.Box3;
1343
- add(iScenes: IUserScene | IUserScene[]): void;
1344
- remove(iScenes: IUserScene | IUserScene[]): void;
1345
- update(): void;
1346
- manage(): boolean;
1347
- getIntersectionPoint(): THREE.Intersection<THREE.Object3D<THREE.Event>>;
1348
- getIntersectionByRay(ray: THREE.Ray): THREE.Intersection<THREE.Object3D<THREE.Event>>;
1349
- getIntersectionIDByRay(ray: THREE.Ray): {
1350
- modelId: string;
1351
- guid: string;
1352
- };
1353
- getIntersectionByNdcPt(ndcPos: THREE.Vector2, camera: THREE.Camera): THREE.Intersection<THREE.Object3D<THREE.Event>>;
1354
- getIntersectionIDByNdcPt(ndcPos: THREE.Vector2, camera: THREE.Camera): {
1355
- modelId: string;
1356
- guid: string;
1357
- };
1358
- getIntersectionIDByFrustumNdcPt(ndcFrustumBox: THREE.Box3, unProjMatrix: THREE.Matrix4, isContainsOnly: boolean): {
1359
- modelId: string;
1360
- guid: string;
1361
- }[];
1362
- clear(): void;
1363
- dispose(): void;
636
+
637
+ export class SettingsNames {
638
+ static TELEMETRY: string;
639
+ static AXES: string;
640
+ static CAMERA_ANIMATION: string;
641
+ static HIDE_SMALL_ELEMENTS_WHEN_NAVIGATING: string;
642
+ static GLOBAL_LIGHT: string;
643
+ static LIGHT_SOURCE: string;
644
+ static ANTI_ALIASING: string;
645
+ static HIDE_SMALL_ELEMENTS_MOVING: string;
646
+ static SMALL_ELEMENT_SIZE: string;
647
+ static LABEL_LINE_LENGTH: string;
648
+ static HIDE_EDGES_WHEN_NAVIGATING: string;
649
+ static DISPLAY_MODE: string;
650
+ static NAVIGATION_CUBE: string;
651
+ static DESIRED_FRAMERATE: string;
652
+ static MANAGE_TIME: string;
653
+ static HOVER_MESHES: string;
654
+ static HOVER_EDGES: string;
655
+ static SELECT_MESHES: string;
656
+ static SELECT_EDGES: string;
1364
657
  }
1365
- export enum SceneType {
1366
- Main = "MainScene",
1367
- Overlay = "OverlayScene"
658
+ export enum ValueType {
659
+ STRING = 0,
660
+ NUMBER = 1,
661
+ ENUM = 2,
662
+ BOOL = 3
1368
663
  }
1369
- export class RenderEngine {
1370
- constructor(settings: RenderViewSettings, renderer: I3DRenderer, cameraControl: ICameraControl);
1371
- placeObjectOnScene(obj: THREE.Object3D, forceUpdate?: boolean, sceneID?: string): Promise<void>;
1372
- removeObjectFromScene(obj: THREE.Object3D, forceUpdate?: boolean): Promise<void>;
1373
- addScene(scene: IUserScene): void;
1374
- removeScene(scene: IUserScene): void;
1375
- getScenes(): IUserScene[];
1376
- getIntersectionChecker(): IModelIntersectionChecker;
1377
- addOperation(operation: RenderOperation): boolean;
1378
- removeOperation(operation: RenderOperation): boolean;
1379
- render(): Promise<void>;
1380
- traverse(callback: (object: THREE.Object3D<THREE.Event>) => void): void;
1381
- clear(): void;
1382
- dispose(): void;
1383
- manageUpdates(): boolean;
1384
- manageScenes(): void;
1385
- updateSettings(settings: RenderViewSettings): void;
1386
- }
1387
- export class RenderView implements IRenderViewer3D {
1388
- constructor(resizableCanvasContainer: HTMLDivElement, viewcubeHolder: ImagesHolder, renderer: I3DRenderer, settings?: RenderViewSettings);
1389
- zoomToFit(): void;
1390
- getObjectsBBox(selectedOnly: boolean): THREE.Box3;
1391
- getObjectsBBox(viewObjects: ViewObject[]): THREE.Box3;
1392
- placeObjectOnScene(iObj: THREE.Object3D, sceneID?: string): Promise<void>;
1393
- removeObjectFromScene(iObj: THREE.Object3D): Promise<void>;
1394
- setClipping(planes: THREE.Plane[], sceneID?: string): void;
1395
- getScenes(): IUserScene[];
1396
- getViewCube(): Viewcube;
1397
- getRenderer(): I3DRenderer;
1398
- getCameraControl(): ICameraControl;
1399
- getIntersectionChecker(): IModelIntersectionChecker;
1400
- getRenderImage(type?: string, quality?: number): Promise<Blob>;
1401
- getRenderSettings(): RenderViewSettings;
1402
- updateRenderSettings(): void;
1403
- clear(): void;
1404
- dispose(): void;
1405
- updateCurrentCanvas(): Promise<void>;
1406
- showStats(show: boolean): void;
664
+ export class Viewer3DConfiguration extends ViewerConfiguration {
665
+ settings?: ViewerSettings;
1407
666
  }
667
+ export const defaultViewer3DSettings: ViewerSettings;
1408
668
  export enum IfcType {
1409
669
  IfcAbsorbedDoseMeasure = 0,
1410
670
  IfcAccelerationMeasure = 1,
@@ -2633,163 +1893,12 @@ export class ModelElementPropertyValue {
2633
1893
  bool_value?: boolean;
2634
1894
  get value(): unknown;
2635
1895
  }
2636
- export const svgBack: string;
2637
- export const svgBottom: string;
2638
- export const svgFront: string;
2639
- export const svgLeft: string;
2640
- export const svgRight: string;
2641
- export const svgTop: string;
2642
- export class ModelElement {
2643
- constructor(entity: ModelEntity);
2644
- get id(): string;
2645
- get modelPartId(): string;
2646
- get parent(): ModelElement | undefined;
2647
- get type(): string;
2648
- get name(): string;
2649
- get children(): ModelElement[];
2650
- get hasGeometry(): boolean;
2651
- get boundingBoxCenter(): Point3;
2652
- }
2653
- export class ModelElementTree {
2654
- constructor(_treeAccess: ModelEntityTreeAccess);
2655
- /**
2656
- *
2657
- * @param {string|ModelElement} element - element id or element instance
2658
- * @param callback
2659
- * @param recursive
2660
- */
2661
- enumElementChildren(element: string | ModelElement, callback: (guid: string) => void, recursive?: boolean): void;
2662
- /**
2663
- * Gets the root element of the model part
2664
- * @returns {ModelElement} - model element instance
2665
- */
2666
- getRootElement(): ModelElement;
2667
- /**
2668
- * Gets all elements of the model part
2669
- * @returns array of the model elements
2670
- */
2671
- getAllElements(): ModelElement[];
2672
- /**
2673
- * Gets model element by id
2674
- * @param { string } id - model element id
2675
- * @returns model element;
2676
- */
2677
- getElement(id: string): ModelElement;
2678
- /**
2679
- * Checks given element is viewable
2680
- * @param {string|ModelElement} element - element id or element instance
2681
- * @returns {boolean}
2682
- */
2683
- isViewableElement(element: string | ModelElement): boolean;
2684
- /**
2685
- * Checks given element is detached from the root element
2686
- * @param {string|ModelElement} element - element id or element instance
2687
- * @returns {boolean}
2688
- */
2689
- isDetachedElement(element: string | ModelElement): boolean;
2690
- /**
2691
- * Gets the element level in the element tree
2692
- * @param {string|ModelElement} element - element id or element instance
2693
- * @returns {number} - level of the element
2694
- */
2695
- getChildLevelNumber(element: string | ModelElement): number;
2696
- }
2697
- export class ModelPart {
2698
- constructor(model: ModelImpl);
2699
- get id(): string;
2700
- get elementTree(): ModelElementTree;
2701
- dispose(): void;
2702
- }
2703
- export class SettingsNames {
2704
- static TELEMETRY: string;
2705
- static AXES: string;
2706
- static CAMERA_ANIMATION: string;
2707
- static HIDE_SMALL_ELEMENTS_WHEN_NAVIGATING: string;
2708
- static GLOBAL_LIGHT: string;
2709
- static LIGHT_SOURCE: string;
2710
- static ANTI_ALIASING: string;
2711
- static HIDE_SMALL_ELEMENTS_MOVING: string;
2712
- static SMALL_ELEMENT_SIZE: string;
2713
- static LABEL_LINE_LENGTH: string;
2714
- static HIDE_EDGES_WHEN_NAVIGATING: string;
2715
- static DISPLAY_MODE: string;
2716
- static NAVIGATION_CUBE: string;
2717
- static DESIRED_FRAMERATE: string;
2718
- static MANAGE_TIME: string;
2719
- static HOVER_MESHES: string;
2720
- static HOVER_EDGES: string;
2721
- static SELECT_MESHES: string;
2722
- static SELECT_EDGES: string;
2723
- }
2724
- export enum ValueType {
2725
- STRING = 0,
2726
- NUMBER = 1,
2727
- ENUM = 2,
2728
- BOOL = 3
2729
- }
2730
- export class Viewer3DConfiguration extends ViewerConfiguration {
2731
- settings?: ViewerSettings;
2732
- }
2733
- export const defaultViewer3DSettings: ViewerSettings;
2734
- export class SettingsActualizer {
2735
- constructor(settingsStorage: ISettings);
2736
- actualize(settings?: ViewerSettings): ViewerSettings;
2737
- actualizeRenderSettings(settings?: ViewerSettings): RenderViewSettings;
2738
- }
2739
- export interface IElementEntityProvider {
2740
- getElementEntity(id: string, modelId: string): ModelEntity;
2741
- getElementEntities(modelId: string): ModelEntity[];
2742
- }
2743
- export class ColorManager {
2744
- constructor(elementEntityProvider: IElementEntityProvider);
2745
- getColoredNodes(): ElementEntitySet[];
2746
- setColor(entityIds: string[], color: Color, modelId: string): void;
2747
- reset(entityIds: string[], modelId: string): void;
2748
- resetAll(modelId?: string): void;
2749
- }
1896
+
2750
1897
  export enum SelectionMode {
2751
1898
  Append = 0,
2752
1899
  Replace = 1
2753
1900
  }
2754
- export class SelectionManager {
2755
- constructor(elementEntityProvider: IElementEntityProvider);
2756
- select(entityIds: string[], modelId: string, selectionMode: SelectionMode): void;
2757
- deselect(entityIds: string[], modelId: string): void;
2758
- clearSelection(): void;
2759
- unselectModelPart(modelId: string): void;
2760
- getSelection(): ElementEntitySet[];
2761
- hover(entityIds: string[], modelId: string): void;
2762
- unhover(entityIds: string[], modelId: string): void;
2763
- clearHovered(modelId?: string): void;
2764
- }
2765
- export class VisibilityManager {
2766
- constructor(elementEntityProvider: IElementEntityProvider);
2767
- getHiddenElementEntities(): ElementEntitySet[];
2768
- hide(entityIds: string[], modelId: string): void;
2769
- show(entityIds: string[], modelId: string): void;
2770
- showAll(): void;
2771
- hideModel(modelId: string): void;
2772
- showModel(modelId: string): void;
2773
- getHiddenModelIds(): string[];
2774
- }
2775
- export class ModelPartContainer {
2776
- modelPartImpl: ModelImpl;
2777
- modelWasm: IWasmModelPart;
2778
- constructor(impl: ModelImpl, wasm: IWasmModelPart);
2779
- dispose(): void;
2780
- }
2781
- export class ModelPartsHolder implements IElementEntityProvider {
2782
- getElementEntity(id: string, modelPartId: string): ModelEntity | undefined;
2783
- getElementEntities(modelPartId: string): ModelEntity[];
2784
- addModelPart(modelPart: ModelImpl, wasmPart: IWasmModelPart): boolean;
2785
- removeModelPart(modelPartId: string): boolean;
2786
- clear(): void;
2787
- getModelParts(): ModelPartContainer[];
2788
- getModelPart(modelPartId?: string): ModelPartContainer | undefined;
2789
- hasModelPart(modelPartId: string): boolean;
2790
- }
2791
1901
  export class ModelElementIds {
2792
- constructor(set: ElementEntitySet);
2793
1902
  modelPartId: string;
2794
1903
  elementIds: string[];
2795
1904
  }
@@ -2804,34 +1913,20 @@ export class EventTypes extends CoreEventTypes {
2804
1913
  }
2805
1914
  export class SelectionChangedEvent extends Event {
2806
1915
  selectedIds: ModelElementIds[];
2807
- constructor(type: string, selectedIds: ModelElementIds[]);
2808
1916
  }
2809
1917
  export class ModelPartEvent extends Event {
2810
1918
  modelPartId: string;
2811
- constructor(type: string, modelPartId: string);
2812
1919
  }
2813
1920
  export class CameraEvent extends Event {
2814
- constructor(type: string);
2815
1921
  }
2816
1922
  export class ClickedEvent extends Event {
2817
1923
  modelId: string;
2818
1924
  modelElementId: string;
2819
1925
  ctrlKey: boolean;
2820
- constructor(type: string, modelId: string, modelElementId: string, ctrlKey: boolean);
2821
1926
  }
2822
1927
  export class HoverEvent extends Event {
2823
1928
  modelId: string;
2824
1929
  modelElementId: string;
2825
- constructor(type: string, modelId: string, modelElementId: string);
2826
- }
2827
- export class RenderViewHolder {
2828
- renderView: RenderView;
2829
- clear(): void;
2830
- }
2831
- export class Settings extends SettingsBase {
2832
- constructor(renderViewHandler: RenderViewHolder, storage: ISettingsStorage, eventDispatcher: IEventsDispatcher);
2833
- getSettingValue<T>(name: string): T;
2834
- protected getKeyWithPrefix(key: string): string;
2835
1930
  }
2836
1931
  export enum NavigationHandlerPriority {
2837
1932
  DefaultNavigation = 0,
@@ -2848,6 +1943,7 @@ export class NavigationEventOptions implements EventListenerOptions {
2848
1943
  readonly alwaysHandle: boolean;
2849
1944
  /** (optional) listener name*/
2850
1945
  readonly navigationTargetName?: string;
1946
+
2851
1947
  constructor(
2852
1948
  /** If true, use event capturing instead of event bubbling*/
2853
1949
  capture?: boolean,
@@ -2865,6 +1961,15 @@ export type NavigationEvent = {
2865
1961
  isHandled?: boolean;
2866
1962
  };
2867
1963
  export interface INavigationEventSource {
1964
+ /**
1965
+ * Event fired on activity changed
1966
+ */
1967
+ readonly eventSourceActivityChanged: IEventSigner<boolean>;
1968
+ /**
1969
+ * Activates or deactivate event source
1970
+ * @param value - activate if true
1971
+ */
1972
+ setActive(value: boolean): void;
2868
1973
  addEventListener<T extends keyof HTMLElementEventMap>(type: T, listener: (this: object, ev: HTMLElementEventMap[T] & NavigationEvent) => void, options?: boolean | EventListenerOptions | NavigationEventOptions): void;
2869
1974
  removeEventListener<T extends keyof HTMLElementEventMap>(type: T, listener: (this: object, ev: HTMLElementEventMap[T] & NavigationEvent) => void, options?: boolean | EventListenerOptions | NavigationEventOptions): void;
2870
1975
  }
@@ -2877,6 +1982,10 @@ export interface INavigationAgent {
2877
1982
  * Keyboard DOM-events source
2878
1983
  */
2879
1984
  readonly keyboardNavigationSource: INavigationEventSource;
1985
+ /**
1986
+ * Activates canvas and keyboard navigation event sources
1987
+ */
1988
+ setActive(value: boolean): void;
2880
1989
  /**
2881
1990
  * Gets rectangle of the navigation area
2882
1991
  */
@@ -2913,102 +2022,6 @@ export interface INavigationTool {
2913
2022
  */
2914
2023
  getCameraParameters(): CameraParameters;
2915
2024
  }
2916
- export abstract class NavigationTool implements INavigationTool {
2917
- protected _isActive: boolean;
2918
- protected _cameraControl: ICameraControl;
2919
- protected _intersectionChecker: IModelIntersectionChecker;
2920
- protected _viewCenter: THREE.Vector3;
2921
- protected _pivotPoint: THREE.Vector3;
2922
- protected _navAgent: INavigationAgent;
2923
- abstract get name(): string;
2924
- init(navAgent: INavigationAgent, cameraControl: ICameraControl, intersectionChecker: IModelIntersectionChecker): void;
2925
- setActive(isActive: boolean): void;
2926
- getPivotPoint(): THREE.Vector3;
2927
- setPivotPoint(pivotPoint: THREE.Vector3): void;
2928
- setCameraParameters(iParams: CameraParameters): void;
2929
- getCameraParameters(): CameraParameters;
2930
- protected abstract addEvents(): void;
2931
- protected abstract removeEvents(): void;
2932
- protected handleHovered(object: THREE.Object3D): void;
2933
- protected handleClick(object: THREE.Object3D, ctrlKey: boolean): void;
2934
- protected handleDblClick(object: THREE.Object3D): void;
2935
- protected getViewCenter(): THREE.Vector3;
2936
- protected setViewCenter(viewCenter: THREE.Vector3): void;
2937
- protected rotate(movement: THREE.Vector2): void;
2938
- protected translate(prevPos: THREE.Vector2, currPos: THREE.Vector2): void;
2939
- protected spin(movement: THREE.Vector2): void;
2940
- protected zoom(deltaSign: number): void;
2941
- protected resetSelection(): void;
2942
- protected onEventHandled(event: Event & NavigationEvent): void;
2943
- }
2944
- export class DesktopNavigation extends NavigationTool {
2945
- protected _prevMousePos?: THREE.Vector2;
2946
- protected _mouseLftIsDown: boolean;
2947
- protected _mouseLftIsDownPos?: THREE.Vector2;
2948
- protected _mouseRhtIsDown: boolean;
2949
- protected _mouseMidIsDown: boolean;
2950
- protected _boundOnMouseEnter: any;
2951
- protected _boundOnMouseLeave: any;
2952
- protected _boundOnMouseMove: any;
2953
- protected _boundOnMouseClick: any;
2954
- protected _boundOnMouseDoubleClick: any;
2955
- protected _boundOnMouseScroll: any;
2956
- protected _boundOnMouseDown: any;
2957
- protected _boundOnMouseUp: any;
2958
- protected _boundOnKeyDown: any;
2959
- protected _boundOnKeyUp: any;
2960
- get name(): string;
2961
- protected addEvents(): void;
2962
- protected removeEvents(): void;
2963
- protected onMouseEnter(ev: MouseEvent & NavigationEvent): void;
2964
- protected onMouseLeave(ev: MouseEvent & NavigationEvent): void;
2965
- protected onMouseMove(ev: MouseEvent & NavigationEvent): void;
2966
- protected onMouseClick(ev: MouseEvent & NavigationEvent): void;
2967
- protected onMouseDoubleClick(ev: MouseEvent & NavigationEvent): void;
2968
- protected onMouseScroll(ev: WheelEvent & NavigationEvent): void;
2969
- protected onMouseDown(ev: MouseEvent & NavigationEvent): void;
2970
- protected onMouseUp(ev: MouseEvent & NavigationEvent): void;
2971
- protected onKeyDown(ev: KeyboardEvent & NavigationEvent): void;
2972
- protected onKeyUp(ev: KeyboardEvent & NavigationEvent): void;
2973
- protected isAllMouseButtonsUp(): boolean;
2974
- }
2975
- export class MobileNavigation extends NavigationTool {
2976
- protected _initialTap?: THREE.Vector2;
2977
- protected _prevTap?: THREE.Vector2;
2978
- protected _prevPinch?: [THREE.Vector2, THREE.Vector2];
2979
- protected _boundOnTouchStart: any;
2980
- protected _boundOnTouchEnd: any;
2981
- protected _boundOnTouchMove: any;
2982
- get name(): string;
2983
- protected addEvents(): void;
2984
- protected removeEvents(): void;
2985
- protected onTouchStart(evt: TouchEvent & NavigationEvent): void;
2986
- protected onTouchEnd(evt: TouchEvent & NavigationEvent): void;
2987
- protected onTouchMove(evt: TouchEvent & NavigationEvent): void;
2988
- protected onSwipe(currentPos: THREE.Vector2): void;
2989
- protected onPinch(iTouchPair: [THREE.Vector2, THREE.Vector2]): void;
2990
- protected getPinchCenter(iTouchPair: [THREE.Vector2, THREE.Vector2]): THREE.Vector2;
2991
- protected getTouchPoint(touch: Touch): THREE.Vector2;
2992
- protected getTouchPair(curTouches: TouchList): [THREE.Vector2, THREE.Vector2];
2993
- }
2994
- export function normalizeModelPartId(modelPartsHolder: ModelPartsHolder, model?: string | ModelPart): string | undefined;
2995
- export function normalizeIds(nodeIds: string | string[]): string[];
2996
- export const BigIntMaxValue: bigint;
2997
- export const BigIntMinValue: bigint;
2998
- export class NavigationAgent implements INavigationAgent {
2999
- readonly canvasNavigationSource: INavigationEventSource;
3000
- readonly keyboardNavigationSource: INavigationEventSource;
3001
- constructor(canvas: HTMLCanvasElement, document: Document);
3002
- getNavigationArea(): DOMRect;
3003
- clear(): void;
3004
- }
3005
- export class NavigationMarkDrawer {
3006
- constructor(navigation: INavigation, renderViewHolder: RenderViewHolder);
3007
- init(): void;
3008
- onCameraParametersChanged(): void;
3009
- onCameraNavigationModeChanged(): void;
3010
- dispose(): void;
3011
- }
3012
2025
  export interface INavigation {
3013
2026
  /**
3014
2027
  * Register navigation tool.
@@ -3072,69 +2085,13 @@ export interface INavigation {
3072
2085
  */
3073
2086
  resetPivotPoint(): void;
3074
2087
  }
3075
- export class Navigation implements INavigation {
3076
- constructor(_renderViewHolder: RenderViewHolder, _modelPartsHolder: ModelPartsHolder);
3077
- init(canvas: HTMLCanvasElement, document: Document): void;
3078
- dispose(): void;
3079
- registerNavigation(navigation: INavigationTool): void;
3080
- unregisterNavigation(navigation: INavigationTool): void;
3081
- setActive(navigationName: string, isActive: boolean): void;
3082
- getActiveNavigation(): INavigationTool | null;
3083
- getNavigationAgent(): NavigationAgent;
3084
- getNavigationArea(): DOMRect;
3085
- /**
3086
- * Sets the camera parameters.
3087
- */
3088
- setCameraParameters(params: CameraParameters): void;
3089
- /**
3090
- * Gets the camera parameters.
3091
- */
3092
- getCameraParameters(): CameraParameters;
3093
- getCameraControl(): ICameraControl;
3094
- getCamera(): THREE.Camera;
3095
- /**
3096
- *
3097
- * @param {string[] | string} elementIds - element or array of elements
3098
- * @param {string | ModelPart} modelPart - the model part id or the model part instance containing the elements.
3099
- * @param {boolean} immediate - true to avoid the default transition.
3100
- * @returns
3101
- */
3102
- fitToView(elementIds: string[] | string, modelPart?: string | ModelPart, immediate?: boolean): void;
3103
- setPivotPoint(point: Point3): void;
3104
- getPivotPoint(): Point3;
3105
- resetPivotPoint(): void;
3106
- }
3107
- export interface IManagersProvider {
3108
- getSelectionManger(modelsHolder: ModelPartsHolder): SelectionManager;
3109
- getVisibilityManager(modelsHolder: ModelPartsHolder): VisibilityManager;
3110
- getColorManager(modelsHolder: ModelPartsHolder): ColorManager;
3111
- getSettingsManager(renderViewHolder: RenderViewHolder, eventsDispatcher: IEventsDispatcher): Settings;
3112
- getNavigationManager(renderViewHolder: RenderViewHolder, modelPartsHolder: ModelPartsHolder): Navigation;
3113
- }
3114
- export class ManagerProvider implements IManagersProvider {
3115
- getSelectionManger(modelsHolder: ModelPartsHolder): SelectionManager;
3116
- getVisibilityManager(modelsHolder: ModelPartsHolder): VisibilityManager;
3117
- getColorManager(modelsHolder: ModelPartsHolder): ColorManager;
3118
- getSettingsManager(renderViewHolder: RenderViewHolder, eventsDispatcher: IEventsDispatcher): Settings;
3119
- getNavigationManager(renderViewHolder: RenderViewHolder, modelPartsHolder: ModelPartsHolder): Navigation;
3120
- }
3121
2088
  export class ModelLoadingOptions {
3122
2089
  guid: string;
3123
2090
  isConsolidatedModel?: boolean;
3124
2091
  }
3125
- export class Tools {
3126
- static is3dDocument(buffer: ArrayBuffer): boolean;
3127
- static is2dDocument(buffer: ArrayBuffer): boolean;
3128
- }
3129
- export const version = "1.0.0";
3130
- export class RenderEventsDispatcher extends EventsDispatcherCore {
3131
- constructor();
3132
- addEventListener(event: string, listener: EventListener, options?: object): void;
3133
- }
3134
2092
  export class EventsObserver {
3135
2093
  protected eventsDispatcher: IEventsDispatcher;
3136
2094
  protected _listeners: Map<string, EventListener>;
3137
- constructor(eventsDispatcher: IEventsDispatcher);
3138
2095
  watch(): void;
3139
2096
  dispose(): void;
3140
2097
  }
@@ -3142,7 +2099,6 @@ export class EventsObserver {
3142
2099
  * This class describes the coordination model. The coordination model contains parts of the model (aka ModelPart).
3143
2100
  */
3144
2101
  export class Model {
3145
- constructor(modelPartsHolder: ModelPartsHolder, renderMaker: IRenderMaker, managerProvider: IManagersProvider, updateViewerFunc: () => void);
3146
2102
  /**
3147
2103
  * Returns all model parts loaded in the viewer.
3148
2104
  * @returns {ModelPart[]} - An array of visible and hidden model parts
@@ -3258,7 +2214,6 @@ export class Viewer3D extends ViewerBase {
3258
2214
  settings: Readonly<ISettings>;
3259
2215
  get navigation(): INavigation;
3260
2216
  events: Readonly<IEventsDispatcher>;
3261
- constructor(container: HTMLElement, wasmModel: IWasmModel, renderModelMaker: IRenderMaker, managers: IManagersProvider, configuration?: Viewer3DConfiguration);
3262
2217
  start(): Promise<number>;
3263
2218
  finish(): void;
3264
2219
  /**
@@ -3290,7 +2245,6 @@ export class Viewer3D extends ViewerBase {
3290
2245
  makeScreenshot(mimeType?: string, quality?: number): Promise<Blob>;
3291
2246
  }
3292
2247
  export class GuiViewer3D extends Viewer3D {
3293
- constructor(container: HTMLElement, wasmModel: IWasmModel, renderModelMaker: IRenderMaker, managers: IManagersProvider, configuration?: Viewer3DConfiguration);
3294
2248
  loadModelPart(buffer: ArrayBuffer, options: ModelLoadingOptions, onSuccessCallback: SuccessCallback, onErrorCallback: ErrorCallback): void;
3295
2249
  getToolbar(): ViewerToolbar;
3296
2250
  onPostExtensionLoad(extension: ExtensionBase): void;
@@ -3299,28 +2253,24 @@ export class GuiViewer3D extends Viewer3D {
3299
2253
  export function CreateViewer(container: HTMLElement, configuration?: Viewer3DConfiguration): GuiViewer3D;
3300
2254
  export class Extension extends ExtensionBase {
3301
2255
  protected _viewer: Viewer3D;
2256
+
3302
2257
  constructor(viewer: Viewer3D, options?: object);
3303
2258
  }
3304
2259
  export class GizmoMaterials {
3305
2260
  static gizmoMaterial: THREE.MeshBasicMaterial;
3306
- static gizmoLineMaterial: THREE.LineBasicMaterial;
3307
- static matHelper: THREE.LineBasicMaterial;
3308
2261
  static matInvisible: THREE.MeshBasicMaterial;
3309
2262
  static matRed: THREE.MeshBasicMaterial;
3310
2263
  static matGreen: THREE.MeshBasicMaterial;
3311
2264
  static matBlue: THREE.MeshBasicMaterial;
3312
2265
  static matYellow: THREE.MeshBasicMaterial;
3313
- static matGray: THREE.MeshBasicMaterial;
3314
2266
  static matViolet: THREE.MeshBasicMaterial;
3315
- static matRedTransparent: THREE.MeshBasicMaterial;
3316
- static matGreenTransparent: THREE.MeshBasicMaterial;
3317
- static matBlueTransparent: THREE.MeshBasicMaterial;
3318
- static matWhiteTransparent: THREE.MeshBasicMaterial;
3319
2267
  static matYellowTransparent: THREE.MeshBasicMaterial;
3320
2268
  static init(): void;
3321
2269
  }
3322
2270
  export interface IGizmoObject extends THREE.Object3D {
2271
+ getHovered(): boolean;
3323
2272
  setHovered(value: boolean): void;
2273
+ getActive(): boolean;
3324
2274
  setActive(value: boolean): void;
3325
2275
  dispose(): void;
3326
2276
  }
@@ -3329,8 +2279,11 @@ export class GizmoObject extends THREE.Object3D implements IGizmoObject {
3329
2279
  readonly baseMaterial: THREE.Material;
3330
2280
  readonly hoverMaterial: THREE.Material;
3331
2281
  readonly activeMaterial: THREE.Material;
2282
+
3332
2283
  constructor(_meshes: THREE.Mesh[], baseMaterial?: THREE.Material, hoverMaterial?: THREE.Material, activeMaterial?: THREE.Material);
2284
+ getHovered(): boolean;
3333
2285
  setHovered(value: boolean): void;
2286
+ getActive(): boolean;
3334
2287
  setActive(value: boolean): void;
3335
2288
  dispose(): void;
3336
2289
  raycast(raycaster: THREE.Raycaster, intersects: THREE.Intersection<THREE.Object3D<THREE.Event>>[]): void;
@@ -3339,6 +2292,8 @@ export abstract class GizmoAxis extends THREE.Object3D implements IGizmoObject {
3339
2292
  readonly handle: IGizmoObject;
3340
2293
  readonly picker?: IGizmoObject;
3341
2294
  readonly helper?: IGizmoObject;
2295
+ protected _isHovered: boolean;
2296
+ protected _isActive: boolean;
3342
2297
  protected _plane: THREE.Plane;
3343
2298
  protected _axisDir: THREE.Vector3;
3344
2299
  protected _raycaster: THREE.Raycaster;
@@ -3347,8 +2302,9 @@ export abstract class GizmoAxis extends THREE.Object3D implements IGizmoObject {
3347
2302
  protected _worldAxisDir: THREE.Vector3;
3348
2303
  protected _startPoint: THREE.Vector3;
3349
2304
  protected _endPoint: THREE.Vector3;
3350
- constructor(axisDir: THREE.Vector3, handle: IGizmoObject, picker?: IGizmoObject, helper?: IGizmoObject);
2305
+ getActive(): boolean;
3351
2306
  setActive(value: boolean): void;
2307
+ getHovered(): boolean;
3352
2308
  setHovered(value: boolean): void;
3353
2309
  dispose(): void;
3354
2310
  raycast(raycaster: THREE.Raycaster, intersects: THREE.Intersection<THREE.Object3D<THREE.Event>>[]): void;
@@ -3360,6 +2316,7 @@ export class GizmoTranslationAxis extends GizmoAxis {
3360
2316
  readonly handle: IGizmoObject;
3361
2317
  readonly picker?: IGizmoObject;
3362
2318
  readonly helper?: IGizmoObject;
2319
+
3363
2320
  constructor(axisDir: THREE.Vector3, handle: IGizmoObject, picker?: IGizmoObject, helper?: IGizmoObject);
3364
2321
  moveByNdcPt(ndcPos: THREE.Vector2, camera: THREE.Camera): THREE.Matrix4;
3365
2322
  protected updateGizmoPlane(camera: THREE.Camera): void;
@@ -3368,7 +2325,6 @@ export class GizmoRotationAxis extends GizmoAxis {
3368
2325
  readonly handle: IGizmoObject;
3369
2326
  readonly picker?: IGizmoObject;
3370
2327
  readonly helper?: IGizmoObject;
3371
- constructor(axisDir: THREE.Vector3, handle: IGizmoObject, picker?: IGizmoObject, helper?: IGizmoObject);
3372
2328
  moveByNdcPt(ndcPos: THREE.Vector2, camera: THREE.Camera): THREE.Matrix4;
3373
2329
  protected updateGizmoPlane(camera: THREE.Camera): void;
3374
2330
  }
@@ -3376,17 +2332,18 @@ export class GizmoScaleAxis extends GizmoAxis {
3376
2332
  readonly handle: IGizmoObject;
3377
2333
  readonly picker?: IGizmoObject;
3378
2334
  readonly helper?: IGizmoObject;
3379
- constructor(axisDir: THREE.Vector3, handle: IGizmoObject, picker?: IGizmoObject, helper?: IGizmoObject);
3380
2335
  moveByNdcPt(ndcPos: THREE.Vector2, camera: THREE.Camera): THREE.Matrix4;
3381
2336
  protected updateGizmoPlane(camera: THREE.Camera): void;
3382
2337
  }
3383
2338
  export class GizmoControl extends THREE.Object3D {
2339
+
3384
2340
  constructor(camera: THREE.Camera, navAgent: INavigationAgent);
3385
- attachTo(object: ViewObject, asChild?: boolean): void;
2341
+ attachTo(object: THREE.Object3D, asChild?: boolean): void;
3386
2342
  detach(): void;
3387
2343
  addAxis(axis: GizmoAxis): void;
3388
2344
  dispose(): void;
3389
2345
  updateMatrixWorld(force?: boolean): void;
2346
+ updateGizmoOffset(position?: THREE.Vector3, quaternion?: THREE.Quaternion): void;
3390
2347
  }
3391
2348
  export enum GizmoAxisDir {
3392
2349
  NONE = 0,
@@ -3403,43 +2360,16 @@ export class GizmoBuilder {
3403
2360
  static buildTranslationAxis(axisDir: THREE.Vector3, handleBaseMatrial?: THREE.Material, handleHoveredMaterial?: THREE.Material, handleSelectedMaterial?: THREE.Material, pickerBaseMatrial?: THREE.Material, pickerHoveredMaterial?: THREE.Material, pickerSelectedMaterial?: THREE.Material): GizmoAxis;
3404
2361
  static buildRotationAxis(axisDir: THREE.Vector3, handleBaseMatrial?: THREE.Material, handleHoveredMaterial?: THREE.Material, handleSelectedMaterial?: THREE.Material, pickerBaseMatrial?: THREE.Material, pickerHoveredMaterial?: THREE.Material, pickerSelectedMaterial?: THREE.Material): GizmoAxis;
3405
2362
  static buildScaleAxis(axisDir: THREE.Vector3, handleBaseMatrial?: THREE.Material, handleHoveredMaterial?: THREE.Material, handleSelectedMaterial?: THREE.Material): GizmoAxis;
3406
- static buildXAxis(): GizmoAxis;
3407
- static buildYAxis(): GizmoAxis;
3408
- static buildZAxis(): GizmoAxis;
3409
- static buildXRotAxis(): GizmoAxis;
3410
- static buildYRotAxis(): GizmoAxis;
3411
- static buildZRotAxis(): GizmoAxis;
3412
- static buildXScaleAxis(): GizmoAxis;
3413
- static buildYScaleAxis(): GizmoAxis;
3414
- static buildZScaleAxis(): GizmoAxis;
3415
- }
3416
- export class Global {
3417
- G: any;
3418
- RESOURCE_ROOT: string;
3419
- constructor();
3420
- /**
3421
- * @param {object} options - Initialization options
3422
- * @private
3423
- */
3424
- initializeResourceRoot(options: any): void;
3425
- getResourceUrl(resourceRelativePath: string): string;
3426
- }
3427
- export const global: Global;
3428
- export class Localization {
3429
- static initialize(options: any): Promise<void>;
3430
- static translate(stringToTrans: string): string;
3431
- static setLanguage(language: string): Promise<TFunction>;
3432
2363
  }
3433
- type InitializeSuccessCallback = () => void;
2364
+ export type InitializeSuccessCallback = () => void;
3434
2365
  /**
3435
- *
3436
2366
  * @param options
3437
2367
  * @param callback
3438
2368
  */
3439
2369
  export function Initializer(options: any, callback: InitializeSuccessCallback): void;
3440
2370
  export function shutdown(): void;
3441
- export {};
3442
2371
  export class Button extends Control {
2372
+
3443
2373
  constructor(id: string);
3444
2374
  setIsChecked(value: boolean): void;
3445
2375
  setState(state: Button.State): boolean;