@pilotdev/pilot-web-3d 24.10.0 → 24.13.0

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 +1021 -971
  2. package/package.json +1 -1
package/index.d.ts CHANGED
@@ -114,7 +114,6 @@ export abstract class ViewObject extends THREE.Object3D {
114
114
  resetColor(): void;
115
115
  /**Gets original color for this object */
116
116
  getOriginalColor(): Color;
117
- getRelativePosition(absPosition: THREE.Vector3): THREE.Vector3;
118
117
  /**Dispose geometry */
119
118
  dispose(): void;
120
119
  /**User defined bounding box calculation for this object. Returns an empty THREE.Box3 by default.*/
@@ -141,6 +140,7 @@ export abstract class ViewObject extends THREE.Object3D {
141
140
  * @param object (optional) object to be reported about. This object by default.
142
141
  */
143
142
  protected riseOnUpdated(updateType?: UpdateType, object?: THREE.Object3D): void;
143
+ getRelativePosition(absPosition: THREE.Vector3): THREE.Vector3;
144
144
  }
145
145
  export class ModelElementIds {
146
146
 
@@ -220,6 +220,7 @@ export namespace Viewer3DIcons {
220
220
  const VIEWER_MEASUREMENT_PLANE_ICON: string;
221
221
  const VIEWER_MEASUREMENT_PERPENDICULAR_ICON: string;
222
222
  const VIEWER_MEASUREMENT_DIMENSION_ICON: string;
223
+ const VIEWER_ZOOM_TO_FIT_ICON: string;
223
224
  }
224
225
  export namespace ViewerGeneralIcons {
225
226
  const CLOSE: string;
@@ -649,14 +650,16 @@ export class ClickedEvent extends Event {
649
650
  modelId: string;
650
651
  modelElementId: string;
651
652
  ctrlKey: boolean;
653
+ intersection?: THREE.Intersection<THREE.Object3D>;
652
654
 
653
- constructor(type: string, modelId: string, modelElementId: string, ctrlKey: boolean);
655
+ constructor(type: string, modelId: string, modelElementId: string, ctrlKey: boolean, intersection?: THREE.Intersection<THREE.Object3D>);
654
656
  }
655
657
  export class HoverEvent extends Event {
656
658
  modelId: string;
657
659
  modelElementId: string;
660
+ intersection?: THREE.Intersection<THREE.Object3D>;
658
661
 
659
- constructor(type: string, modelId: string, modelElementId: string);
662
+ constructor(type: string, modelId: string, modelElementId: string, intersection?: THREE.Intersection<THREE.Object3D>);
660
663
  }
661
664
  export class GlobalEvents {
662
665
  static events: EventsDispatcherCore;
@@ -777,6 +780,7 @@ export class EventTypes extends CoreEventTypes {
777
780
  static MODEL_PART_UNLOADED: string;
778
781
  static VIRTUAL_ORIGIN_CHANGED: string;
779
782
  static SELECTION_CHANGED_EVENT: string;
783
+ static VISIBILITY_CHANGED_EVENT: string;
780
784
  static DELETE_OBJECTS_EVENT: string;
781
785
  static CAMERA_CHANGE_EVENT: string;
782
786
  static CAMERA_NAVIGATION_MODE_CHANGED_EVENT: string;
@@ -796,6 +800,10 @@ export class VirtualOriginEvent extends Event {
796
800
  virtualOrigin: Point3;
797
801
  delta: Point3;
798
802
  }
803
+ export class VisibilityChangedEvent extends Event {
804
+ elementIds: ModelElementIds[];
805
+ isVisible: boolean;
806
+ }
799
807
  export class DeleteEvent extends Event {
800
808
  deletedIds: ModelElementIds[];
801
809
  }
@@ -804,963 +812,65 @@ export enum SelectionMode {
804
812
  Append = 0,
805
813
  Replace = 1
806
814
  }
807
-
808
- export class SettingsNames {
809
- static TELEMETRY: string;
810
- static AXES: string;
811
- static CAMERA_ANIMATION: string;
812
- static HIDE_SMALL_ELEMENTS_WHEN_NAVIGATING: string;
813
- static GLOBAL_LIGHT: string;
814
- static LIGHT_SOURCE: string;
815
- static ANTI_ALIASING: string;
816
- static HIDE_SMALL_ELEMENTS_MOVING: string;
817
- static SMALL_ELEMENT_SIZE: string;
818
- static LABEL_LINE_LENGTH: string;
819
- static HIDE_EDGES_WHEN_NAVIGATING: string;
820
- static DISPLAY_MODE: string;
821
- static NAVIGATION_CUBE: string;
822
- static DESIRED_FRAMERATE: string;
823
- static MANAGE_TIME: string;
824
- static HOVER_MESHES: string;
825
- static HOVER_EDGES: string;
826
- static SELECT_MESHES: string;
827
- static SELECT_EDGES: string;
828
- }
829
- export enum ValueType {
830
- STRING = 0,
831
- NUMBER = 1,
832
- ENUM = 2,
833
- BOOL = 3
834
- }
835
- export class RenderViewSettings {
836
- telemetry?: boolean;
837
- hideEdgesWhenNavigation?: boolean;
838
- antiAliasing?: boolean;
839
- displayMode?: DisplayMode;
840
- /** Desired render framerate */
841
- desiredFramerate?: number;
842
- /** Allocated time for rendering operations, excluding scene rendering */
843
- manageTime?: number;
844
- /** Number of scene updates managed at once */
845
- chunkUpdateSize?: number;
846
- /** Draw hovered meshes on the `selectionScene` */
847
- hoverMeshes?: boolean;
848
- /** Draw hovered edges on the `selectionScene` */
849
- hoverEdges?: boolean;
850
- /** Draw selected meshes on the `selectionScene` */
851
- selectEdges?: boolean;
852
- /** Draw selected edges on the `selectionScene` */
853
- selectMeshes?: boolean;
854
- }
855
- export enum DisplayMode {
856
- FACES_AND_EDGES = 0,
857
- FACES = 1
858
- }
859
- export const defaultRenderViewSettings: RenderViewSettings;
860
- export class Viewer3DConfiguration extends ViewerConfiguration {
861
- render: ViewerSettings;
862
-
863
- constructor(appearance?: ViewerSettings, render?: ViewerSettings);
864
- }
865
- export const defaultViewer3DSettings: ViewerSettings;
866
- export interface SceneCheckOptions {
867
- /** specify whether intersections should be filtered by clippings */
868
- filterByClipping?: boolean;
869
- }
870
- export interface ModelCheckOptions extends SceneCheckOptions {
871
- /** Scene names to check intersections. */
872
- sceneNames?: string[];
815
+ export interface ModelElement {
816
+ get id(): string;
817
+ get modelPartId(): string;
818
+ get parent(): ModelElement | undefined;
819
+ get type(): string;
820
+ get name(): string;
821
+ get children(): ModelElement[];
822
+ get hasGeometry(): boolean;
823
+ get viewObject(): ViewObject | undefined;
873
824
  }
874
- export interface IIntersectionChecker<TOptions> {
875
- /**
876
- * Gets intersection point of the last casted ray
877
- */
878
- getIntersectionPoint(): THREE.Intersection<THREE.Object3D> | undefined;
825
+ export interface ModelElementTree {
879
826
  /**
880
- * Gets {@link THREE.Intersection<THREE.Object3D>} between a casted {@link ray} and model object.
881
- * @param ray
882
- * @param camera
883
- * @param options - (optional) intersection check options.
827
+ *
828
+ * @param {string|ModelElement} element - element id or element instance
829
+ * @param callback
830
+ * @param recursive
884
831
  */
885
- getIntersectionByRay(ray: THREE.Ray, camera: THREE.Camera, options?: TOptions): THREE.Intersection<THREE.Object3D> | undefined;
832
+ enumElementChildren(element: string | ModelElement, callback: (guid: string) => void, recursive?: boolean): void;
886
833
  /**
887
- * Gets ID of the model object intersected by {@link ray}
888
- * @param ray
889
- * @param camera
890
- * @param options - (optional) intersection check options.
834
+ * Gets the root element of the model part
835
+ * @returns {ModelElement} - model element instance
891
836
  */
892
- getIntersectionIDByRay(ray: THREE.Ray, camera: THREE.Camera, options?: TOptions): {
893
- modelId: string;
894
- guid: string;
895
- } | undefined;
837
+ getRootElement(): ModelElement | undefined;
896
838
  /**
897
- * Gets {@link THREE.Intersection} between a ray, casted from {@link camera} to {@link ndcPoint}, and model object.
898
- * @param ndcPoint
899
- * @param camera
900
- * @param options - (optional) intersection check options.
839
+ * Gets all elements of the model part
840
+ * @returns array of the model elements
901
841
  */
902
- getIntersectionByNdcPt(ndcPoint: THREE.Vector2, camera: THREE.Camera, options?: TOptions): THREE.Intersection<THREE.Object3D> | undefined;
842
+ getAllElements(): ModelElement[];
903
843
  /**
904
- * Gets ID of the model object intersected by ray, casted from {@link camera} to {@link ndcPoint}.
905
- * @param ndcPoint
906
- * @param camera
907
- * @param options - (optional) intersection check options.
844
+ * Gets model element by id
845
+ * @param { string } id - model element id
846
+ * @returns model element;
908
847
  */
909
- getIntersectionIDByNdcPt(ndcPoint: THREE.Vector2, camera: THREE.Camera, options?: TOptions): {
910
- modelId: string;
911
- guid: string;
912
- } | undefined;
848
+ getElement(id: string): ModelElement | undefined;
913
849
  /**
914
- * Gets IDs of the model objects intersected by frustum.
915
- * @param ndcFrustumBox - frustum in the NDC space.
916
- * @param unProjMatrix - NDC to World projection matrix.
917
- * @param isContainsOnly - if true, gets only fully contained objects in the frustum.
918
- * @param options - (optional) intersection check options.
850
+ * Checks given element is viewable
851
+ * @param {string|ModelElement} element - element id or element instance
852
+ * @returns {boolean}
919
853
  */
920
- getIntersectionIDByFrustumNdcPt(ndcFrustumBox: THREE.Box3, unProjMatrix: THREE.Matrix4, isContainsOnly: boolean, options?: TOptions): {
921
- modelId: string;
922
- guid: string;
923
- }[];
854
+ isViewableElement(element: string | ModelElement): boolean;
924
855
  /**
925
- * Gets all intersections between a ray, casted from {@link camera} to {@link ndcPoint} and model objects.
926
- * @param ray
927
- * @param camera
928
- * @param options - (optional) intersection check options.
856
+ * Checks given element is detached from the root element
857
+ * @param {string|ModelElement} element - element id or element instance
858
+ * @returns {boolean}
929
859
  */
930
- getAllIntersectionsByRay(ray: THREE.Ray, camera: THREE.Camera, options?: TOptions): THREE.Intersection<THREE.Object3D>[];
860
+ isDetachedElement(element: string | ModelElement): boolean;
931
861
  /**
932
- * Gets IDs of the model objects intersected by ray, casted from {@link camera} to {@link ndcPoint}.
933
- * @param ndcPos
934
- * @param camera
935
- * @param options - (optional) intersection check options.
862
+ * Gets the element level in the element tree
863
+ * @param {string|ModelElement} element - element id or element instance
864
+ * @returns {number} - level of the element
936
865
  */
937
- getAllIntersectionsByNdcPt(ndcPos: THREE.Vector2, camera: THREE.Camera, options?: TOptions): THREE.Intersection<THREE.Object3D>[];
938
- }
939
- export interface ISceneIntersectionChecker extends IIntersectionChecker<SceneCheckOptions> {
940
- /** Gets the bounding box of the scene*/
941
- get boundingBox(): THREE.Box3;
942
- }
943
- export interface IModelIntersectionChecker extends IIntersectionChecker<ModelCheckOptions> {
944
- /** Gets the bounding box of the model*/
945
- get boundingBox(): THREE.Box3;
946
- /** Gets the center of the model*/
947
- get modelCenter(): THREE.Vector3;
948
- }
949
- export class TPair<TKey, TValue> {
950
-
951
- constructor(key: TKey, value: TValue);
952
- get key(): TKey;
953
- get value(): TValue;
954
- }
955
- export interface IRenderOperationContext {
956
- /** If true, renderScenes operations will be forced*/
957
- isRedrawRequested: boolean;
958
- /** If true - operations will not be suspended by the scheduler*/
959
- isForcedExecution: boolean;
960
- /** Gets renderer*/
961
- get renderer(): I3DRenderer;
962
- /** Gets camera*/
963
- get camera(): THREE.Camera;
964
- /** Gets render settings*/
965
- get settings(): RenderViewSettings;
966
- /** Indicates whether the navigation is in progress */
967
- get isNavigation(): boolean;
968
- /** Indicates whether faces and edges should be drawn */
969
- get displayMode(): DisplayMode;
970
- /** Indicates whether the operation has been requested to be suspended by the scheduler*/
971
- get isSuspensionRequested(): boolean;
972
- /** Gets the remaining time for the render operations in current iteration*/
973
- get remainedTime(): DOMHighResTimeStamp;
974
- /** Gets the time elapsed on render operations in current iteration*/
975
- get elapsedTime(): DOMHighResTimeStamp;
976
- /** Gets the timestamp of the last rendered frame*/
977
- get lastFrameTimestamp(): DOMHighResTimeStamp;
978
- /** Gets the timestamp of the last finished render cycle*/
979
- get lastRenderCycleTimestamp(): DOMHighResTimeStamp;
980
- /** Indicates that the operation time has exceeded the alloted time */
981
- get isElapsed(): boolean;
982
- /**Data shared between operations in a one render cycle */
983
- get userData(): Map<string, object>;
984
- }
985
- export enum OperationStatus {
986
- /** Operation planned in the render cycle */
987
- Planned = 0,
988
- /** Operation suspended in the render cycle, will be resumed at the next iteration*/
989
- Suspended = 1,
990
- /** Operation finished in the render cycle */
991
- Finished = 2
992
- }
993
- export enum OperationMode {
994
- /** Perform an operation once*/
995
- OneTime = 0,
996
- /** Perform an operation once in a render cycle*/
997
- EveryCycle = 1,
998
- /** Perform an operation for each frame */
999
- EveryFrame = 2
1000
- }
1001
- export enum OperationPriority {
1002
- beforeAll = 0,
1003
- scanForChanges = 8,
1004
- applyChanges = 16,
1005
- manageScenes = 24,
1006
- renderScenes = 32,
1007
- renderViewcube = 40,
1008
- afterAll = 100
866
+ getChildLevelNumber(element: string | ModelElement): number;
1009
867
  }
1010
- export type RenderOperationDelegate = (context: IRenderOperationContext) => OperationStatus;
1011
- export enum SceneNames {
1012
- Main = "MainScene",
1013
- Overlay = "OverlayScene"
1014
- }
1015
- export interface IUserScene extends THREE.Scene {
1016
- /** Scene name */
1017
- readonly name: string;
1018
- /** Indicates whether the scene should to be updated (should to be managed)*/
1019
- get needsUpdate(): boolean;
1020
- /** Indicates whether the scene should be redrawn*/
1021
- get needsRedraw(): boolean;
1022
- /** Gets the scene intersection checker */
1023
- get intersectionChecker(): ISceneIntersectionChecker | null;
1024
- /** Sets clipping enable */
1025
- set clippingEnable(value: boolean);
1026
- /** Indicates whether the scene should be clipped */
1027
- get clippingEnable(): boolean;
1028
- /** Place objects on scene */
1029
- addRange(objects: THREE.Object3D[]): void;
1030
- /** Update objects on scene */
1031
- updateRange(objects: TPair<THREE.Object3D, UpdateType>[]): void;
1032
- /** Remove objects from scene */
1033
- removeRange(objects: THREE.Object3D[]): void;
1034
- /** Indicates if the object is placed on scene */
1035
- has(obj: THREE.Object3D): boolean;
1036
- /** Traverse scene */
1037
- traverse(callback: (object: THREE.Object3D) => void): void;
1038
- /** Set cliping for the scene */
1039
- setClipping(planes: THREE.Plane[]): void;
1040
- /** Manage scene, manage updates on scene */
1041
- manageScene(context?: IRenderOperationContext): boolean;
1042
- /** Render scene */
1043
- render(context?: IRenderOperationContext): void;
1044
- /** Dispose scene */
1045
- dispose(): void;
1046
- }
1047
- export interface I3DRenderer {
1048
- clippingPlanes: THREE.Plane[];
1049
- domElement: HTMLCanvasElement;
1050
- clear(color?: boolean, depth?: boolean, stencil?: boolean): void;
1051
- setClearColor(color: THREE.ColorRepresentation, alpha?: number): void;
1052
- clearDepth(): void;
1053
- render(scene: THREE.Object3D, camera: THREE.Camera): void;
1054
- getSize(target: THREE.Vector2): THREE.Vector2;
1055
- setSize(width: number, height: number, updateStyle?: boolean): void;
1056
- setPixelRatio(value: number): void;
1057
- setViewport(x: THREE.Vector4 | number, y?: number, width?: number, height?: number): void;
1058
- getViewport(target: THREE.Vector4): THREE.Vector4;
1059
- dispose(): void;
1060
- }
1061
- export interface IRenderViewer3D {
1062
- /** Gets model inetrsection checker. */
1063
- getIntersectionChecker(): IModelIntersectionChecker;
1064
- /** Request a full redraw of the canvas. */
1065
- updateCurrentCanvas(force?: boolean): Promise<void>;
1066
- /**
1067
- * Place object on the scene.\
1068
- * An object can only be placed on one scene.
1069
- * @param iObj - object to place.
1070
- * @param sceneID - (optional) scene name. `MainScene` by default.
1071
- * @param redraw - (optional) force a redraw of the scene after adding an object. False by default.
1072
- */
1073
- placeObjectOnScene(iObj: THREE.Object3D, sceneID?: string, redraw?: boolean): Promise<void>;
1074
- /**
1075
- * Remove object from scene.
1076
- * @param iObj - object to remove.
1077
- * @param redraw - (optional) force a redraw of the scene after removing an object. False by default.
1078
- */
1079
- removeObjectFromScene(iObj: THREE.Object3D, redraw?: boolean): Promise<void>;
1080
- /**
1081
- * Set clipping planes for rendering.
1082
- * @param planes - array of clipping planes.
1083
- */
1084
- setClipping(planes: THREE.Plane[]): void;
1085
- /**
1086
- * Set active clipping planes: planes with colored sections
1087
- * @param indices - active planes indices in the array of clipping planes
1088
- */
1089
- setActiveClipPlaneIndices(indices: number[]): void;
1090
- /**
1091
- * Gets all render scenes.
1092
- */
1093
- getScenes(): IUserScene[];
1094
- /**
1095
- *
1096
- * @param name
1097
- * @param isClippable
1098
- */
1099
- addScene(name: string, isClippable: boolean): IUserScene;
1100
- /**
1101
- *
1102
- * @param scene
1103
- */
1104
- removeScene(scene: IUserScene): void;
1105
- }
1106
- export abstract class CustomMaterial extends THREE.ShaderMaterial {
1107
-
1108
- constructor();
1109
- get hash(): number;
1110
- copy(source: CustomMaterial): this;
1111
- protected refreshUniforms(uniforms: {
1112
- [uniform: string]: THREE.IUniform;
1113
- }, material: CustomMaterial, renderer: THREE.WebGLRenderer): void;
1114
- protected onBeforeCompileCallback(shader: THREE.Shader): void;
1115
- protected refreshTransformUniform(map: THREE.Texture, uniform: THREE.IUniform): void;
1116
- protected onBeforeRender(renderer: THREE.WebGLRenderer, scene: THREE.Scene, camera: THREE.Camera, geometry: THREE.BufferGeometry, material: THREE.Material, group: THREE.Group): void;
1117
- }
1118
- export interface CustomMeshLambertMaterialParameters extends THREE.ShaderMaterialParameters {
1119
- instancing?: boolean | undefined;
1120
- instancingColor?: boolean | undefined;
1121
- color?: THREE.ColorRepresentation | undefined;
1122
- emissive?: THREE.ColorRepresentation | undefined;
1123
- emissiveIntensity?: number | undefined;
1124
- fog?: boolean | undefined;
1125
- }
1126
- export class CustomMeshLambertMaterial extends CustomMaterial {
1127
- type: string;
1128
-
1129
- constructor(parameters?: CustomMeshLambertMaterialParameters);
1130
- /**
1131
- * @default false
1132
- */
1133
- get instancing(): boolean;
1134
- set instancing(value: boolean);
1135
- /**
1136
- * @default false
1137
- */
1138
- get instancingColor(): boolean;
1139
- set instancingColor(value: boolean);
1140
- /**
1141
- * @default new THREE.Color( 0xffffff )
1142
- */
1143
- color: THREE.Color;
1144
- /**
1145
- * @default new THREE.Color( 0x000000 )
1146
- */
1147
- emissive: THREE.Color;
1148
- /**
1149
- * @default 1
1150
- */
1151
- emissiveIntensity: number;
1152
- /**
1153
- * Whether the material is affected by fog. Default is true.
1154
- * @default fog
1155
- */
1156
- fog: boolean;
1157
- protected refreshUniformsCommon(uniforms: {
1158
- [uniform: string]: THREE.IUniform;
1159
- }, material: CustomMeshLambertMaterial, renderer: THREE.WebGLRenderer): void;
1160
- protected refreshUniforms(uniforms: {
1161
- [uniform: string]: THREE.IUniform;
1162
- }, material: CustomMaterial, renderer: THREE.WebGLRenderer): void;
1163
- copy(source: CustomMeshLambertMaterial): this;
1164
- }
1165
- export interface CustomLineMaterialParameters extends THREE.ShaderMaterialParameters {
1166
- instancing?: boolean | undefined;
1167
- instancingColor?: boolean | undefined;
1168
- color?: THREE.ColorRepresentation | undefined;
1169
- }
1170
- export class CustomLineMaterial extends CustomMaterial {
1171
- type: string;
1172
-
1173
- constructor(parameters?: CustomLineMaterialParameters);
1174
- /**
1175
- * @default false
1176
- */
1177
- get instancing(): boolean;
1178
- set instancing(value: boolean);
1179
- /**
1180
- * @default false
1181
- */
1182
- get instancingColor(): boolean;
1183
- set instancingColor(value: boolean);
1184
- /**
1185
- * @default 0xffffff
1186
- */
1187
- color: THREE.Color;
1188
- copy(source: CustomLineMaterial): this;
1189
- protected refreshUniforms(uniforms: {
1190
- [uniform: string]: THREE.IUniform;
1191
- }, material: CustomLineMaterial, renderer: THREE.WebGLRenderer): void;
1192
- }
1193
- export interface MeshLineMaterialParameters extends THREE.ShaderMaterialParameters {
1194
- color?: THREE.ColorRepresentation | undefined;
1195
- dashed?: boolean | undefined;
1196
- dashScale?: number | undefined;
1197
- dashSize?: number | undefined;
1198
- dashOffset?: number | undefined;
1199
- gapSize?: number | undefined;
1200
- worldUnits?: boolean | undefined;
1201
- }
1202
- export class MeshLineMaterial extends CustomMaterial {
1203
- type: string;
1204
-
1205
- constructor(parameters: MeshLineMaterialParameters);
1206
- /**
1207
- * @default false
1208
- */
1209
- get worldUnits(): boolean;
1210
- set worldUnits(value: boolean);
1211
- /**
1212
- * @default false
1213
- */
1214
- get dashed(): boolean;
1215
- set dashed(value: boolean);
1216
- get resolution(): THREE.Vector2;
1217
- /**
1218
- * @default 0xffffff
1219
- */
1220
- color: THREE.Color;
1221
- /**
1222
- * @default 1
1223
- */
1224
- dashScale: number;
1225
- /**
1226
- * @default 1
1227
- */
1228
- dashSize: number;
1229
- /**
1230
- * @default 0
1231
- */
1232
- dashOffset: number;
1233
- /**
1234
- * @default 1
1235
- */
1236
- gapSize: number;
1237
- copy(source: MeshLineMaterial): this;
1238
- protected refreshUniforms(uniforms: {
1239
- [uniform: string]: THREE.IUniform;
1240
- }, material: CustomMaterial, renderer: THREE.WebGLRenderer): void;
1241
- }
1242
- export interface CustomPointMaterialParameters extends THREE.ShaderMaterialParameters, THREE.PointsMaterialParameters {
1243
- }
1244
- export class CustomPointMaterial extends CustomMaterial {
1245
- type: string;
1246
-
1247
- constructor(parameters?: CustomPointMaterialParameters);
1248
- /**
1249
- * @default new THREE.Color( 0xffffff )
1250
- */
1251
- color: THREE.Color;
1252
- /**
1253
- * @default null
1254
- */
1255
- map: THREE.Texture | null;
1256
- /**
1257
- * @default null
1258
- */
1259
- alphaMap: THREE.Texture | null;
1260
- /**
1261
- * @default 1
1262
- */
1263
- size: number;
1264
- /**
1265
- * @default true
1266
- */
1267
- sizeAttenuation: boolean;
1268
- copy(source: CustomPointMaterial): this;
1269
- protected refreshUniformsCommon(uniforms: {
1270
- [uniform: string]: THREE.IUniform;
1271
- }, material: CustomPointMaterial, renderer: THREE.WebGLRenderer): void;
1272
- protected refreshUniforms(uniforms: {
1273
- [uniform: string]: THREE.IUniform;
1274
- }, material: CustomMaterial, renderer: THREE.WebGLRenderer): void;
1275
- }
1276
- export enum NavigationHandlerPriority {
1277
- DefaultNavigation = 0,
1278
- GizmoHandlers = 20,
1279
- EmbeddedExtensions = 40,
1280
- CustomExtensions = 100
1281
- }
1282
- export class NavigationEventOptions implements EventListenerOptions {
1283
- /** If true, use event capturing instead of event bubbling*/
1284
- readonly capture: boolean;
1285
- /** Call priority of navigation event handlers, from highest to lowest*/
1286
- readonly priority: number | NavigationHandlerPriority;
1287
- /** Always handle, used if `NavigationEvent.isHandled` set to true*/
1288
- readonly alwaysHandle: boolean;
1289
- /** (optional) listener name*/
1290
- readonly navigationTargetName?: string;
1291
-
1292
- constructor(
1293
- /** If true, use event capturing instead of event bubbling*/
1294
- capture?: boolean,
1295
- /** Call priority of navigation event handlers, from highest to lowest*/
1296
- priority?: number | NavigationHandlerPriority,
1297
- /** Always handle, used if `NavigationEvent.isHandled` set to true*/
1298
- alwaysHandle?: boolean,
1299
- /** (optional) listener name*/
1300
- navigationTargetName?: string);
1301
- }
1302
- export type NavigationEvent = {
1303
- /**
1304
- * (optional) Value indicating whether the NavigationEvent event was handled.
1305
- */
1306
- isHandled?: boolean;
1307
- };
1308
- export interface ActiveEvent extends Event {
1309
- readonly isActive: boolean;
1310
- }
1311
- export interface NavigationEventSourceEventMap extends HTMLElementEventMap {
1312
- /**
1313
- * Occurs when the {@link INavigationEventSource.isActive} property changes.
1314
- */
1315
- "active": ActiveEvent;
1316
- }
1317
- export interface INavigationEventSource {
1318
- /**
1319
- * Activity of the event source
1320
- */
1321
- get isActive(): boolean;
1322
- set isActive(value: boolean);
1323
- addEventListener<T extends keyof NavigationEventSourceEventMap>(type: T, listener: (this: object, ev: NavigationEventSourceEventMap[T] & NavigationEvent) => void, options?: boolean | EventListenerOptions | NavigationEventOptions): void;
1324
- removeEventListener<T extends keyof NavigationEventSourceEventMap>(type: T, listener: (this: object, ev: NavigationEventSourceEventMap[T] & NavigationEvent) => void, options?: boolean | EventListenerOptions | NavigationEventOptions): void;
1325
- }
1326
- export interface INavigationAgent {
1327
- /**
1328
- * Canvas DOM-events source
1329
- */
1330
- readonly canvasNavigationSource: INavigationEventSource;
1331
- /**
1332
- * Keyboard DOM-events source
1333
- */
1334
- readonly keyboardNavigationSource: INavigationEventSource;
1335
- /**
1336
- * Activity of the navigation agent
1337
- */
1338
- get isActive(): boolean;
1339
- set isActive(value: boolean);
1340
- /**
1341
- * Gets rectangle of the navigation area
1342
- */
1343
- getNavigationArea(): DOMRect;
1344
- }
1345
- export interface INavigationTool {
1346
- /**
1347
- * Gets name of this navigation tool.
1348
- */
1349
- get name(): string;
1350
- /**
1351
- * Initialize navigation tool.
1352
- */
1353
- init(navAgent: INavigationAgent, cameraControl: ICameraControl, intersectionChecker: IModelIntersectionChecker): void;
1354
- /**
1355
- * Activates or deactivates this navigation tool.
1356
- */
1357
- setActive(isActive: boolean): void;
1358
- /**
1359
- * Gets the camera pivot point.
1360
- */
1361
- getPivotPoint(): THREE.Vector3;
1362
- /**
1363
- * Sets the camera pivot point.
1364
- */
1365
- setPivotPoint(pivotPoint: THREE.Vector3): void;
1366
- /**
1367
- * Sets the camera parameters.
1368
- * @param iParams
1369
- */
1370
- setCameraParameters(iParams: CameraParameters): void;
1371
- /**
1372
- * Gets the camera parameters.
1373
- */
1374
- getCameraParameters(): CameraParameters;
1375
- }
1376
- export class GizmoMaterials {
1377
- static gizmoMaterial: THREE.MeshBasicMaterial;
1378
- static matInvisible: THREE.MeshBasicMaterial;
1379
- static matRed: THREE.MeshBasicMaterial;
1380
- static matGreen: THREE.MeshBasicMaterial;
1381
- static matBlue: THREE.MeshBasicMaterial;
1382
- static matYellow: THREE.MeshBasicMaterial;
1383
- static matViolet: THREE.MeshBasicMaterial;
1384
- static matYellowTransparent: THREE.MeshBasicMaterial;
1385
- static init(): void;
1386
- }
1387
- export interface IGizmoObject extends THREE.Object3D {
1388
- getHovered(): boolean;
1389
- setHovered(value: boolean): void;
1390
- getActive(): boolean;
1391
- setActive(value: boolean): void;
1392
- dispose(): void;
1393
- }
1394
- export class GizmoObject extends THREE.Object3D implements IGizmoObject {
1395
- protected _meshes: THREE.Mesh[];
1396
- readonly baseMaterial: THREE.Material;
1397
- readonly hoverMaterial: THREE.Material;
1398
- readonly activeMaterial: THREE.Material;
1399
-
1400
- constructor(_meshes: THREE.Mesh[], baseMaterial?: THREE.Material, hoverMaterial?: THREE.Material, activeMaterial?: THREE.Material);
1401
- getHovered(): boolean;
1402
- setHovered(value: boolean): void;
1403
- getActive(): boolean;
1404
- setActive(value: boolean): void;
1405
- dispose(): void;
1406
- raycast(raycaster: THREE.Raycaster, intersects: THREE.Intersection<THREE.Object3D<THREE.Event>>[]): void;
1407
- }
1408
- export abstract class GizmoAxis extends THREE.Object3D implements IGizmoObject {
1409
- readonly handle: IGizmoObject;
1410
- readonly picker?: IGizmoObject;
1411
- readonly helper?: IGizmoObject;
1412
- protected _isHovered: boolean;
1413
- protected _isActive: boolean;
1414
- protected _plane: THREE.Plane;
1415
- protected _axisDir: THREE.Vector3;
1416
- protected _raycaster: THREE.Raycaster;
1417
- protected _worldPositionStart: THREE.Vector3;
1418
- protected _worldQuaternionStart: THREE.Quaternion;
1419
- protected _worldAxisDir: THREE.Vector3;
1420
- protected _startPoint: THREE.Vector3;
1421
- protected _endPoint: THREE.Vector3;
1422
- getActive(): boolean;
1423
- setActive(value: boolean): void;
1424
- getHovered(): boolean;
1425
- setHovered(value: boolean): void;
1426
- dispose(): void;
1427
- raycast(raycaster: THREE.Raycaster, intersects: THREE.Intersection<THREE.Object3D<THREE.Event>>[]): void;
1428
- abstract moveByNdcPt(ndcPos: THREE.Vector2, camera: THREE.Camera): THREE.Matrix4;
1429
- protected abstract updateGizmoPlane(camera: THREE.Camera): void;
1430
- protected setStartPt(ndcPos: THREE.Vector2, camera: THREE.Camera): void;
1431
- }
1432
- export class GizmoTranslationAxis extends GizmoAxis {
1433
- readonly handle: IGizmoObject;
1434
- readonly picker?: IGizmoObject;
1435
- readonly helper?: IGizmoObject;
1436
-
1437
- constructor(axisDir: THREE.Vector3, handle: IGizmoObject, picker?: IGizmoObject, helper?: IGizmoObject);
1438
- moveByNdcPt(ndcPos: THREE.Vector2, camera: THREE.Camera): THREE.Matrix4;
1439
- protected updateGizmoPlane(camera: THREE.Camera): void;
1440
- }
1441
- export class GizmoRotationAxis extends GizmoAxis {
1442
- readonly handle: IGizmoObject;
1443
- readonly picker?: IGizmoObject;
1444
- readonly helper?: IGizmoObject;
1445
- moveByNdcPt(ndcPos: THREE.Vector2, camera: THREE.Camera): THREE.Matrix4;
1446
- protected updateGizmoPlane(camera: THREE.Camera): void;
1447
- }
1448
- export class GizmoScaleAxis extends GizmoAxis {
1449
- readonly handle: IGizmoObject;
1450
- readonly picker?: IGizmoObject;
1451
- readonly helper?: IGizmoObject;
1452
- moveByNdcPt(ndcPos: THREE.Vector2, camera: THREE.Camera): THREE.Matrix4;
1453
- protected updateGizmoPlane(camera: THREE.Camera): void;
1454
- }
1455
- export class GizmoControl extends THREE.Object3D {
1456
-
1457
- constructor(camera: THREE.Camera, navAgent: INavigationAgent);
1458
- attachTo(object: THREE.Object3D, asChild?: boolean): void;
1459
- detach(): void;
1460
- addAxis(axis: GizmoAxis): void;
1461
- dispose(): void;
1462
- updateMatrixWorld(force?: boolean): void;
1463
- updateGizmoOffset(position?: THREE.Vector3, quaternion?: THREE.Quaternion): void;
1464
- }
1465
- export enum GizmoAxisDir {
1466
- NONE = 0,
1467
- X = 1,
1468
- Y = 2,
1469
- Z = 4,
1470
- XY = 3,
1471
- YZ = 6,
1472
- XZ = 5,
1473
- XYZ = 7
1474
- }
1475
- export class GizmoBuilder {
1476
- static build(camera: THREE.Camera, navAgent: INavigationAgent, translation?: GizmoAxisDir, rotation?: GizmoAxisDir, scale?: GizmoAxisDir): GizmoControl;
1477
- static buildTranslationAxis(axisDir: THREE.Vector3, handleBaseMatrial?: THREE.Material, handleHoveredMaterial?: THREE.Material, handleSelectedMaterial?: THREE.Material, pickerBaseMatrial?: THREE.Material, pickerHoveredMaterial?: THREE.Material, pickerSelectedMaterial?: THREE.Material): GizmoAxis;
1478
- static buildRotationAxis(axisDir: THREE.Vector3, handleBaseMatrial?: THREE.Material, handleHoveredMaterial?: THREE.Material, handleSelectedMaterial?: THREE.Material, pickerBaseMatrial?: THREE.Material, pickerHoveredMaterial?: THREE.Material, pickerSelectedMaterial?: THREE.Material): GizmoAxis;
1479
- static buildScaleAxis(axisDir: THREE.Vector3, handleBaseMatrial?: THREE.Material, handleHoveredMaterial?: THREE.Material, handleSelectedMaterial?: THREE.Material): GizmoAxis;
1480
- }
1481
- export interface CustomSpriteMaterialParameters extends THREE.ShaderMaterialParameters {
1482
- color?: THREE.ColorRepresentation | undefined;
1483
- map?: THREE.Texture | null | undefined;
1484
- alphaMap?: THREE.Texture | null | undefined;
1485
- rotation?: number | undefined;
1486
- sizeAttenuation?: boolean | undefined;
1487
- center?: THREE.Vector2 | undefined;
1488
- discreteClipping?: boolean | undefined;
1489
- offset?: THREE.Vector2 | undefined;
1490
- }
1491
- export class CustomSpriteMaterial extends CustomMaterial {
1492
- type: string;
1493
- readonly isSpriteMaterial: true;
1494
-
1495
- constructor(parameters?: CustomSpriteMaterialParameters);
1496
- /**
1497
- * @default true
1498
- */
1499
- get discreteClipping(): boolean;
1500
- set discreteClipping(value: boolean);
1501
- get resolution(): THREE.Vector2;
1502
- /**
1503
- * @default new THREE.Color( 0xffffff )
1504
- */
1505
- color: THREE.Color;
1506
- /**
1507
- * @default null
1508
- */
1509
- map: THREE.Texture | null;
1510
- /**
1511
- * @default null
1512
- */
1513
- alphaMap: THREE.Texture | null;
1514
- /**
1515
- * @default 0
1516
- */
1517
- rotation: number;
1518
- /**
1519
- * @default true
1520
- */
1521
- sizeAttenuation: boolean;
1522
- /**
1523
- * @default new THREE.Vector2(0.5, 0.5)
1524
- */
1525
- center: THREE.Vector2;
1526
- /**
1527
- * @default new THREE.Vector2(0.0, 0.0)
1528
- */
1529
- offset: THREE.Vector2;
1530
- copy(source: CustomSpriteMaterial): this;
1531
- protected refreshUniformsCommon(uniforms: {
1532
- [uniform: string]: THREE.IUniform;
1533
- }, material: CustomSpriteMaterial, renderer: THREE.WebGLRenderer): void;
1534
- protected refreshUniforms(uniforms: {
1535
- [uniform: string]: THREE.IUniform;
1536
- }, material: CustomMaterial, renderer: THREE.WebGLRenderer): void;
1537
- }
1538
- export class MeshLineGeometry extends THREE.InstancedBufferGeometry {
1539
- type: string;
1540
- instanceStart: THREE.BufferAttribute;
1541
- instanceEnd: THREE.BufferAttribute;
1542
- instanceColorStart: THREE.BufferAttribute;
1543
- instanceColorEnd: THREE.BufferAttribute;
1544
-
1545
- constructor();
1546
- applyMatrix4(matrix: THREE.Matrix4): this;
1547
- updatePoint(index: number, point: THREE.Vector3): void;
1548
- updateColor(index: number, color: Color): void;
1549
- setPoints(points: THREE.Vector3[]): this;
1550
- setPositions(array: ArrayLike<number>): this;
1551
- setColors(array: ArrayLike<number>): this;
1552
- computeLineDistances(): this;
1553
- toBufferGeometry(): THREE.BufferGeometry;
1554
- toWireframeGeometry(): THREE.BufferGeometry;
1555
- fromWireframeGeometry(geometry: THREE.WireframeGeometry): this;
1556
- fromEdgesGeometry(geometry: THREE.EdgesGeometry): this;
1557
- fromMesh(mesh: THREE.Mesh): this;
1558
- fromLineSegments(lineSegments: THREE.LineSegments): this;
1559
- computeBoundingBox(): void;
1560
- computeBoundingSphere(): void;
1561
- }
1562
- export class MeshLine extends THREE.Mesh {
1563
- type: string;
1564
- material: MeshLineMaterial;
1565
- geometry: MeshLineGeometry;
1566
-
1567
- constructor(geometry?: MeshLineGeometry, material?: MeshLineMaterial);
1568
- raycast(raycaster: THREE.Raycaster, intersects: THREE.Intersection[]): void;
1569
- }
1570
- export class CustomSprite extends THREE.Sprite {
1571
- material: CustomSpriteMaterial;
1572
-
1573
- constructor(material: CustomSpriteMaterial);
1574
- raycast(raycaster: THREE.Raycaster, intersects: THREE.Intersection<THREE.Object3D<THREE.Event>>[]): void;
1575
- dispose(): void;
1576
- }
1577
- export interface LabelSpriteParameters {
1578
- text?: string | undefined;
1579
- sizeAttenuation?: boolean | undefined;
1580
- fontFace?: string | FontFace | undefined;
1581
- fontSize?: number | undefined;
1582
- borderColor?: Color | undefined;
1583
- backgroundColor?: Color | undefined;
1584
- borderThickness?: number | undefined;
1585
- borderRadius?: number | undefined;
1586
- textColor?: Color | undefined;
1587
- textPadding?: THREE.Vector4Tuple | undefined;
1588
- }
1589
- export class LabelSprite extends CustomSprite {
1590
- readonly extraHeightFactor = 1.4;
1591
-
1592
- constructor(parameters: LabelSpriteParameters);
1593
- get sizeAttenuation(): boolean;
1594
- set sizeAttenuation(value: boolean);
1595
- /**
1596
- * @default ''
1597
- */
1598
- get text(): string;
1599
- set text(value: string);
1600
- /**
1601
- * @default 'Roboto, sans-serif'
1602
- */
1603
- get fontFace(): string | FontFace;
1604
- set fontFace(value: string | FontFace);
1605
- /**
1606
- * @default 12
1607
- */
1608
- get fontSize(): number;
1609
- set fontSize(value: number);
1610
- /**
1611
- * @default 2
1612
- */
1613
- get borderThickness(): number;
1614
- set borderThickness(value: number);
1615
- /**
1616
- * @default new Color(0, 0, 0, 1.0)
1617
- */
1618
- get borderColor(): Color;
1619
- set borderColor(value: Color);
1620
- /**
1621
- * @default 1
1622
- */
1623
- get borderRadius(): number;
1624
- set borderRadius(value: number);
1625
- /**
1626
- * @default new Color(1.0, 1.0, 1.0, 1.0)
1627
- */
1628
- get backgroundColor(): Color;
1629
- set backgroundColor(value: Color);
1630
- /**
1631
- * @default new Color(0, 0, 0, 1.0)
1632
- */
1633
- get textColor(): Color;
1634
- set textColor(value: Color);
1635
- /**
1636
- * Label text padding: left, top, right, bottom
1637
- * @default [0, 0, 0, 0]
1638
- */
1639
- get textPadding(): THREE.Vector4Tuple;
1640
- set textPadding(value: THREE.Vector4Tuple);
1641
- dispose(): void;
1642
- }
1643
- export interface MeshPointMaterialParameters extends THREE.ShaderMaterialParameters {
1644
- sizeAttenuation?: boolean | undefined;
1645
- discreteClipping?: boolean | undefined;
1646
- }
1647
- export class MeshPointMaterial extends CustomMaterial {
1648
-
1649
- constructor(parameters?: MeshPointMaterialParameters);
1650
- /**
1651
- * @default true
1652
- */
1653
- get discreteClipping(): boolean;
1654
- set discreteClipping(value: boolean);
1655
- get resolution(): THREE.Vector2;
1656
- /**
1657
- * @default true
1658
- */
1659
- sizeAttenuation: boolean;
1660
- copy(source: MeshPointMaterial): this;
1661
- protected refreshUniforms(uniforms: {
1662
- [uniform: string]: THREE.IUniform;
1663
- }, material: CustomMaterial, renderer: THREE.WebGLRenderer): void;
1664
- }
1665
- export interface MeshPointParamter {
1666
- point?: THREE.Vector3;
1667
- color?: Color;
1668
- size?: number;
1669
- }
1670
- export class MeshPoints extends THREE.Mesh {
1671
- geometry: THREE.InstancedBufferGeometry;
1672
- material: MeshPointMaterial;
1673
-
1674
- constructor();
1675
- /**
1676
- * @default new Color( 1,1,1,1 )
1677
- */
1678
- color: Color;
1679
- /**
1680
- * @default 1
1681
- */
1682
- pointSize: number;
1683
- /**
1684
- * @default new THREE.Vector3(0, 0, 0)
1685
- */
1686
- point: THREE.Vector3;
1687
- addPoint(pointParameter?: MeshPointParamter): number;
1688
- updatePoint(index: number, pointParameter: MeshPointParamter): void;
1689
- removePoint(index: number): this;
1690
- updateAttributes(): void;
1691
- dispose(): void;
1692
- raycast(raycaster: THREE.Raycaster, intersects: THREE.Intersection<THREE.Object3D<THREE.Event>>[]): void;
1693
- }
1694
- export interface ModelElement {
1695
- get id(): string;
1696
- get modelPartId(): string;
1697
- get parent(): ModelElement | undefined;
1698
- get type(): string;
1699
- get name(): string;
1700
- get children(): ModelElement[];
1701
- get hasGeometry(): boolean;
1702
- get viewObject(): ViewObject | undefined;
1703
- }
1704
- export interface ModelElementTree {
1705
- /**
1706
- *
1707
- * @param {string|ModelElement} element - element id or element instance
1708
- * @param callback
1709
- * @param recursive
1710
- */
1711
- enumElementChildren(element: string | ModelElement, callback: (guid: string) => void, recursive?: boolean): void;
1712
- /**
1713
- * Gets the root element of the model part
1714
- * @returns {ModelElement} - model element instance
1715
- */
1716
- getRootElement(): ModelElement | undefined;
1717
- /**
1718
- * Gets all elements of the model part
1719
- * @returns array of the model elements
1720
- */
1721
- getAllElements(): ModelElement[];
1722
- /**
1723
- * Gets model element by id
1724
- * @param { string } id - model element id
1725
- * @returns model element;
1726
- */
1727
- getElement(id: string): ModelElement | undefined;
1728
- /**
1729
- * Checks given element is viewable
1730
- * @param {string|ModelElement} element - element id or element instance
1731
- * @returns {boolean}
1732
- */
1733
- isViewableElement(element: string | ModelElement): boolean;
1734
- /**
1735
- * Checks given element is detached from the root element
1736
- * @param {string|ModelElement} element - element id or element instance
1737
- * @returns {boolean}
1738
- */
1739
- isDetachedElement(element: string | ModelElement): boolean;
1740
- /**
1741
- * Gets the element level in the element tree
1742
- * @param {string|ModelElement} element - element id or element instance
1743
- * @returns {number} - level of the element
1744
- */
1745
- getChildLevelNumber(element: string | ModelElement): number;
1746
- }
1747
- export interface ModelPart {
1748
- get id(): string;
1749
- get elementTree(): ModelElementTree;
1750
- dispose(): void;
1751
- }
1752
- export interface DeleteEventListener extends EventListener {
1753
- (evt: DeleteEvent): void;
1754
- }
1755
- export interface DeleteEventFilter {
1756
- (modelId: string, entityId: string): boolean;
1757
- }
1758
- export class DeletionManager {
1759
- readonly eventsDispatcher: IEventsDispatcher;
1760
- addDeletionFilter(filter: DeleteEventFilter): void;
1761
- removeDeletionFilter(filter: DeleteEventFilter): void;
1762
- delete(objectsToDelete: ModelElementIds[]): boolean;
1763
- isDeletionEnable(objectsToDelete: ModelElementIds[]): boolean;
868
+ export interface ModelPart {
869
+ get id(): string;
870
+ get elementTree(): ModelElementTree;
871
+ setModelPartPlacement(placement: THREE.Matrix4Tuple | number[]): void;
872
+ setModelPartScaling(scaling: number): void;
873
+ dispose(): void;
1764
874
  }
1765
875
  export enum IfcType {
1766
876
  IfcAbsorbedDoseMeasure = 0,
@@ -2968,27 +2078,954 @@ export enum IfcType {
2968
2078
  UNDEFINED = 1202,
2969
2079
  Other3DModel = 1203
2970
2080
  }
2971
- export class ModelElementPropertySet {
2972
- name: string;
2973
- properties: ModelElementProperty[];
2974
- type: IfcType;
2081
+ export class ModelElementPropertySet {
2082
+ name: string;
2083
+ properties: ModelElementProperty[];
2084
+ type: IfcType;
2085
+ }
2086
+ export class ModelElementProperty {
2087
+ name: string;
2088
+ unit: number;
2089
+ value: ModelElementPropertyValue;
2090
+ }
2091
+ export class ModelElementPropertyValue {
2092
+ str_value?: string;
2093
+ int_value?: number;
2094
+ double_value?: number;
2095
+ date_value?: bigint;
2096
+ array_value: Array<string>;
2097
+ decimal_value?: number;
2098
+ guid_value?: string;
2099
+ array_int_value: Array<number>;
2100
+ bool_value?: boolean;
2101
+ get value(): unknown;
2102
+ }
2103
+
2104
+ export class SettingsNames {
2105
+ static TELEMETRY: string;
2106
+ static AXES: string;
2107
+ static CAMERA_ANIMATION: string;
2108
+ static HIDE_SMALL_ELEMENTS_WHEN_NAVIGATING: string;
2109
+ static GLOBAL_LIGHT: string;
2110
+ static LIGHT_SOURCE: string;
2111
+ static ANTI_ALIASING: string;
2112
+ static HIDE_SMALL_ELEMENTS_MOVING: string;
2113
+ static SMALL_ELEMENT_SIZE: string;
2114
+ static LABEL_LINE_LENGTH: string;
2115
+ static HIDE_EDGES_WHEN_NAVIGATING: string;
2116
+ static DISPLAY_MODE: string;
2117
+ static NAVIGATION_CUBE: string;
2118
+ static DESIRED_FRAMERATE: string;
2119
+ static MANAGE_TIME: string;
2120
+ static HOVER_MESHES: string;
2121
+ static HOVER_EDGES: string;
2122
+ static SELECT_MESHES: string;
2123
+ static SELECT_EDGES: string;
2124
+ }
2125
+ export enum ValueType {
2126
+ STRING = 0,
2127
+ NUMBER = 1,
2128
+ ENUM = 2,
2129
+ BOOL = 3
2130
+ }
2131
+ export class RenderViewSettings {
2132
+ telemetry?: boolean;
2133
+ hideEdgesWhenNavigation?: boolean;
2134
+ antiAliasing?: boolean;
2135
+ displayMode?: DisplayMode;
2136
+ /** Desired render framerate */
2137
+ desiredFramerate?: number;
2138
+ /** Allocated time for rendering operations, excluding scene rendering */
2139
+ manageTime?: number;
2140
+ /** Number of scene updates managed at once */
2141
+ chunkUpdateSize?: number;
2142
+ /** Draw hovered meshes on the `selectionScene` */
2143
+ hoverMeshes?: boolean;
2144
+ /** Draw hovered edges on the `selectionScene` */
2145
+ hoverEdges?: boolean;
2146
+ /** Draw selected meshes on the `selectionScene` */
2147
+ selectEdges?: boolean;
2148
+ /** Draw selected edges on the `selectionScene` */
2149
+ selectMeshes?: boolean;
2150
+ }
2151
+ export enum DisplayMode {
2152
+ FACES_AND_EDGES = 0,
2153
+ FACES = 1
2154
+ }
2155
+ export const defaultRenderViewSettings: RenderViewSettings;
2156
+ export class Viewer3DConfiguration extends ViewerConfiguration {
2157
+ render: ViewerSettings;
2158
+
2159
+ constructor(appearance?: ViewerSettings, render?: ViewerSettings);
2160
+ }
2161
+ export const defaultViewer3DSettings: ViewerSettings;
2162
+ export interface SceneCheckOptions {
2163
+ /** specify whether intersections should be filtered by clippings */
2164
+ filterByClipping?: boolean;
2165
+ }
2166
+ export interface ModelCheckOptions extends SceneCheckOptions {
2167
+ /** Scene names to check intersections. */
2168
+ sceneNames?: string[];
2169
+ }
2170
+ export interface IIntersectionChecker<TOptions> {
2171
+ /**
2172
+ * Gets {@link THREE.Intersection<THREE.Object3D>} between a casted {@link ray} and model object.
2173
+ * @param ray
2174
+ * @param camera
2175
+ * @param options - (optional) intersection check options.
2176
+ */
2177
+ getIntersectionByRay(ray: THREE.Ray, camera: THREE.Camera, options?: TOptions): THREE.Intersection<THREE.Object3D> | undefined;
2178
+ /**
2179
+ * Gets ID of the model object intersected by {@link ray}
2180
+ * @param ray
2181
+ * @param camera
2182
+ * @param options - (optional) intersection check options.
2183
+ */
2184
+ getIntersectionIDByRay(ray: THREE.Ray, camera: THREE.Camera, options?: TOptions): {
2185
+ modelId: string;
2186
+ guid: string;
2187
+ } | undefined;
2188
+ /**
2189
+ * Gets {@link THREE.Intersection} between a ray, casted from {@link camera} to {@link ndcPoint}, and model object.
2190
+ * @param ndcPoint
2191
+ * @param camera
2192
+ * @param options - (optional) intersection check options.
2193
+ */
2194
+ getIntersectionByNdcPt(ndcPoint: THREE.Vector2, camera: THREE.Camera, options?: TOptions): THREE.Intersection<THREE.Object3D> | undefined;
2195
+ /**
2196
+ * Gets ID of the model object intersected by ray, casted from {@link camera} to {@link ndcPoint}.
2197
+ * @param ndcPoint
2198
+ * @param camera
2199
+ * @param options - (optional) intersection check options.
2200
+ */
2201
+ getIntersectionIDByNdcPt(ndcPoint: THREE.Vector2, camera: THREE.Camera, options?: TOptions): {
2202
+ modelId: string;
2203
+ guid: string;
2204
+ } | undefined;
2205
+ /**
2206
+ * Gets IDs of the model objects intersected by frustum.
2207
+ * @param ndcFrustumBox - frustum in the NDC space.
2208
+ * @param unProjMatrix - NDC to World projection matrix.
2209
+ * @param isContainsOnly - if true, gets only fully contained objects in the frustum.
2210
+ * @param options - (optional) intersection check options.
2211
+ */
2212
+ getIntersectionIDByFrustumNdcPt(ndcFrustumBox: THREE.Box3, unProjMatrix: THREE.Matrix4, isContainsOnly: boolean, options?: TOptions): {
2213
+ modelId: string;
2214
+ guid: string;
2215
+ }[];
2216
+ /**
2217
+ * Gets all intersections between a ray, casted from {@link camera} to {@link ndcPoint} and model objects.
2218
+ * @param ray
2219
+ * @param camera
2220
+ * @param options - (optional) intersection check options.
2221
+ */
2222
+ getAllIntersectionsByRay(ray: THREE.Ray, camera: THREE.Camera, options?: TOptions): THREE.Intersection<THREE.Object3D>[];
2223
+ /**
2224
+ * Gets IDs of the model objects intersected by ray, casted from {@link camera} to {@link ndcPoint}.
2225
+ * @param ndcPos
2226
+ * @param camera
2227
+ * @param options - (optional) intersection check options.
2228
+ */
2229
+ getAllIntersectionsByNdcPt(ndcPos: THREE.Vector2, camera: THREE.Camera, options?: TOptions): THREE.Intersection<THREE.Object3D>[];
2230
+ }
2231
+ export interface ISceneIntersectionChecker extends IIntersectionChecker<SceneCheckOptions> {
2232
+ /** Gets the bounding box of the scene*/
2233
+ get boundingBox(): THREE.Box3;
2234
+ }
2235
+ export interface IModelIntersectionChecker extends IIntersectionChecker<ModelCheckOptions> {
2236
+ /** Gets the bounding box of the model*/
2237
+ get boundingBox(): THREE.Box3;
2238
+ /** Gets the center of the model*/
2239
+ get modelCenter(): THREE.Vector3;
2240
+ }
2241
+ export class TPair<TKey, TValue> {
2242
+
2243
+ constructor(key: TKey, value: TValue);
2244
+ get key(): TKey;
2245
+ get value(): TValue;
2246
+ }
2247
+ export interface IRenderOperationContext {
2248
+ /** If true, renderScenes operations will be forced*/
2249
+ isRedrawRequested: boolean;
2250
+ /** If true - operations will not be suspended by the scheduler*/
2251
+ isForcedExecution: boolean;
2252
+ /** Gets renderer*/
2253
+ get renderer(): I3DRenderer;
2254
+ /** Gets camera*/
2255
+ get camera(): THREE.Camera;
2256
+ /** Gets render settings*/
2257
+ get settings(): RenderViewSettings;
2258
+ /** Indicates whether the navigation is in progress */
2259
+ get isNavigation(): boolean;
2260
+ /** Indicates whether faces and edges should be drawn */
2261
+ get displayMode(): DisplayMode;
2262
+ /** Indicates whether the operation has been requested to be suspended by the scheduler*/
2263
+ get isSuspensionRequested(): boolean;
2264
+ /** Gets the remaining time for the render operations in current iteration*/
2265
+ get remainedTime(): DOMHighResTimeStamp;
2266
+ /** Gets the time elapsed on render operations in current iteration*/
2267
+ get elapsedTime(): DOMHighResTimeStamp;
2268
+ /** Gets the timestamp of the last rendered frame*/
2269
+ get lastFrameTimestamp(): DOMHighResTimeStamp;
2270
+ /** Gets the timestamp of the last finished render cycle*/
2271
+ get lastRenderCycleTimestamp(): DOMHighResTimeStamp;
2272
+ /** Indicates that the operation time has exceeded the alloted time */
2273
+ get isElapsed(): boolean;
2274
+ /**Data shared between operations in a one render cycle */
2275
+ get userData(): Map<string, object>;
2276
+ }
2277
+ export enum OperationStatus {
2278
+ /** Operation planned in the render cycle */
2279
+ Planned = 0,
2280
+ /** Operation suspended in the render cycle, will be resumed at the next iteration*/
2281
+ Suspended = 1,
2282
+ /** Operation finished in the render cycle */
2283
+ Finished = 2
2284
+ }
2285
+ export enum OperationMode {
2286
+ /** Perform an operation once*/
2287
+ OneTime = 0,
2288
+ /** Perform an operation once in a render cycle*/
2289
+ EveryCycle = 1,
2290
+ /** Perform an operation for each frame */
2291
+ EveryFrame = 2
2292
+ }
2293
+ export enum OperationPriority {
2294
+ beforeAll = 0,
2295
+ scanForChanges = 8,
2296
+ applyChanges = 16,
2297
+ manageScenes = 24,
2298
+ renderScenes = 32,
2299
+ renderViewcube = 40,
2300
+ afterAll = 100
2301
+ }
2302
+ export type RenderOperationDelegate = (context: IRenderOperationContext) => OperationStatus;
2303
+ export enum SceneNames {
2304
+ Main = "MainScene",
2305
+ PointCloud = "PointCloud",
2306
+ Overlay = "OverlayScene"
2307
+ }
2308
+ export interface IUserScene extends THREE.Scene {
2309
+ /** Scene name */
2310
+ readonly name: string;
2311
+ /** Indicates whether the scene should to be updated (should to be managed)*/
2312
+ get needsUpdate(): boolean;
2313
+ /** Indicates whether the scene should be redrawn*/
2314
+ get needsRedraw(): boolean;
2315
+ /** Gets the scene intersection checker */
2316
+ get intersectionChecker(): ISceneIntersectionChecker | null;
2317
+ /** Sets clipping enable */
2318
+ set clippingEnable(value: boolean);
2319
+ /** Indicates whether the scene should be clipped */
2320
+ get clippingEnable(): boolean;
2321
+ /** Place objects on scene */
2322
+ addRange(objects: THREE.Object3D[]): void;
2323
+ /** Update objects on scene */
2324
+ updateRange(objects: TPair<THREE.Object3D, UpdateType>[]): void;
2325
+ /** Remove objects from scene */
2326
+ removeRange(objects: THREE.Object3D[]): void;
2327
+ /** Indicates if the object is placed on scene */
2328
+ has(obj: THREE.Object3D): boolean;
2329
+ /** Traverse scene */
2330
+ traverse(callback: (object: THREE.Object3D) => void): void;
2331
+ /** Set cliping for the scene */
2332
+ setClipping(planes: THREE.Plane[]): void;
2333
+ /** Manage scene, manage updates on scene */
2334
+ manageScene(context?: IRenderOperationContext): boolean;
2335
+ /** Render scene */
2336
+ render(context?: IRenderOperationContext): void;
2337
+ /** Dispose scene */
2338
+ dispose(): void;
2339
+ }
2340
+ export interface I3DRenderer {
2341
+ clippingPlanes: THREE.Plane[];
2342
+ domElement: HTMLCanvasElement;
2343
+ clear(color?: boolean, depth?: boolean, stencil?: boolean): void;
2344
+ getClearColor(target: THREE.Color): THREE.Color;
2345
+ setClearColor(color: THREE.ColorRepresentation, alpha?: number): void;
2346
+ clearDepth(): void;
2347
+ render(scene: THREE.Object3D, camera: THREE.Camera): void;
2348
+ getSize(target: THREE.Vector2): THREE.Vector2;
2349
+ setSize(width: number, height: number, updateStyle?: boolean): void;
2350
+ setPixelRatio(value: number): void;
2351
+ setViewport(x: THREE.Vector4 | number, y?: number, width?: number, height?: number): void;
2352
+ getViewport(target: THREE.Vector4): THREE.Vector4;
2353
+ dispose(): void;
2354
+ }
2355
+ export interface IRenderViewer3D {
2356
+ /** Gets model inetrsection checker. */
2357
+ getIntersectionChecker(): IModelIntersectionChecker;
2358
+ /** Request a full redraw of the canvas. */
2359
+ updateCurrentCanvas(force?: boolean): Promise<void>;
2360
+ /**
2361
+ * Place object on the scene.\
2362
+ * An object can only be placed on one scene.
2363
+ * @param iObj - object to place.
2364
+ * @param sceneID - (optional) scene name. `MainScene` by default.
2365
+ * @param redraw - (optional) force a redraw of the scene after adding an object. False by default.
2366
+ */
2367
+ placeObjectOnScene(iObj: THREE.Object3D, sceneID?: string, redraw?: boolean): Promise<void>;
2368
+ /**
2369
+ * Remove object from scene.
2370
+ * @param iObj - object to remove.
2371
+ * @param redraw - (optional) force a redraw of the scene after removing an object. False by default.
2372
+ */
2373
+ removeObjectFromScene(iObj: THREE.Object3D, redraw?: boolean): Promise<void>;
2374
+ /**
2375
+ * Set clipping planes for rendering.
2376
+ * @param planes - array of clipping planes.
2377
+ */
2378
+ setClipping(planes: THREE.Plane[]): void;
2379
+ /**
2380
+ * Set active clipping planes: planes with colored sections
2381
+ * @param indices - active planes indices in the array of clipping planes
2382
+ */
2383
+ setActiveClipPlaneIndices(indices: number[]): void;
2384
+ /**
2385
+ * Gets all render scenes.
2386
+ */
2387
+ getScenes(): IUserScene[];
2388
+ /**
2389
+ *
2390
+ * @param name
2391
+ * @param isClippable
2392
+ */
2393
+ addScene(name: string, isClippable: boolean): IUserScene;
2394
+ /**
2395
+ *
2396
+ * @param scene
2397
+ */
2398
+ removeScene(scene: IUserScene): void;
2399
+ }
2400
+ export abstract class CustomMaterial extends THREE.ShaderMaterial {
2401
+
2402
+ constructor();
2403
+ get hash(): number;
2404
+ copy(source: CustomMaterial): this;
2405
+ protected refreshUniforms(uniforms: {
2406
+ [uniform: string]: THREE.IUniform;
2407
+ }, material: CustomMaterial, renderer: THREE.WebGLRenderer): void;
2408
+ protected onBeforeCompileCallback(shader: THREE.Shader): void;
2409
+ protected refreshTransformUniform(map: THREE.Texture, uniform: THREE.IUniform): void;
2410
+ protected onBeforeRender(renderer: THREE.WebGLRenderer, scene: THREE.Scene, camera: THREE.Camera, geometry: THREE.BufferGeometry, material: THREE.Material, group: THREE.Group): void;
2411
+ }
2412
+ export interface CustomMeshLambertMaterialParameters extends THREE.ShaderMaterialParameters {
2413
+ instancing?: boolean | undefined;
2414
+ instancingColor?: boolean | undefined;
2415
+ color?: THREE.ColorRepresentation | undefined;
2416
+ emissive?: THREE.ColorRepresentation | undefined;
2417
+ emissiveIntensity?: number | undefined;
2418
+ fog?: boolean | undefined;
2419
+ }
2420
+ export class CustomMeshLambertMaterial extends CustomMaterial {
2421
+ type: string;
2422
+
2423
+ constructor(parameters?: CustomMeshLambertMaterialParameters);
2424
+ /**
2425
+ * @default false
2426
+ */
2427
+ get instancing(): boolean;
2428
+ set instancing(value: boolean);
2429
+ /**
2430
+ * @default false
2431
+ */
2432
+ get instancingColor(): boolean;
2433
+ set instancingColor(value: boolean);
2434
+ /**
2435
+ * @default new THREE.Color( 0xffffff )
2436
+ */
2437
+ color: THREE.Color;
2438
+ /**
2439
+ * @default new THREE.Color( 0x000000 )
2440
+ */
2441
+ emissive: THREE.Color;
2442
+ /**
2443
+ * @default 1
2444
+ */
2445
+ emissiveIntensity: number;
2446
+ /**
2447
+ * Whether the material is affected by fog. Default is true.
2448
+ * @default fog
2449
+ */
2450
+ fog: boolean;
2451
+ protected refreshUniformsCommon(uniforms: {
2452
+ [uniform: string]: THREE.IUniform;
2453
+ }, material: CustomMeshLambertMaterial, renderer: THREE.WebGLRenderer): void;
2454
+ protected refreshUniforms(uniforms: {
2455
+ [uniform: string]: THREE.IUniform;
2456
+ }, material: CustomMaterial, renderer: THREE.WebGLRenderer): void;
2457
+ copy(source: CustomMeshLambertMaterial): this;
2458
+ }
2459
+ export interface CustomLineMaterialParameters extends THREE.ShaderMaterialParameters {
2460
+ instancing?: boolean | undefined;
2461
+ instancingColor?: boolean | undefined;
2462
+ color?: THREE.ColorRepresentation | undefined;
2463
+ }
2464
+ export class CustomLineMaterial extends CustomMaterial {
2465
+ type: string;
2466
+
2467
+ constructor(parameters?: CustomLineMaterialParameters);
2468
+ /**
2469
+ * @default false
2470
+ */
2471
+ get instancing(): boolean;
2472
+ set instancing(value: boolean);
2473
+ /**
2474
+ * @default false
2475
+ */
2476
+ get instancingColor(): boolean;
2477
+ set instancingColor(value: boolean);
2478
+ /**
2479
+ * @default 0xffffff
2480
+ */
2481
+ color: THREE.Color;
2482
+ copy(source: CustomLineMaterial): this;
2483
+ protected refreshUniforms(uniforms: {
2484
+ [uniform: string]: THREE.IUniform;
2485
+ }, material: CustomLineMaterial, renderer: THREE.WebGLRenderer): void;
2486
+ }
2487
+ export interface MeshLineMaterialParameters extends THREE.ShaderMaterialParameters {
2488
+ color?: THREE.ColorRepresentation | undefined;
2489
+ dashed?: boolean | undefined;
2490
+ dashScale?: number | undefined;
2491
+ dashSize?: number | undefined;
2492
+ dashOffset?: number | undefined;
2493
+ gapSize?: number | undefined;
2494
+ worldUnits?: boolean | undefined;
2495
+ }
2496
+ export class MeshLineMaterial extends CustomMaterial {
2497
+ type: string;
2498
+
2499
+ constructor(parameters: MeshLineMaterialParameters);
2500
+ /**
2501
+ * @default false
2502
+ */
2503
+ get worldUnits(): boolean;
2504
+ set worldUnits(value: boolean);
2505
+ /**
2506
+ * @default false
2507
+ */
2508
+ get dashed(): boolean;
2509
+ set dashed(value: boolean);
2510
+ get resolution(): THREE.Vector2;
2511
+ /**
2512
+ * @default 0xffffff
2513
+ */
2514
+ color: THREE.Color;
2515
+ /**
2516
+ * @default 1
2517
+ */
2518
+ dashScale: number;
2519
+ /**
2520
+ * @default 1
2521
+ */
2522
+ dashSize: number;
2523
+ /**
2524
+ * @default 0
2525
+ */
2526
+ dashOffset: number;
2527
+ /**
2528
+ * @default 1
2529
+ */
2530
+ gapSize: number;
2531
+ copy(source: MeshLineMaterial): this;
2532
+ protected refreshUniforms(uniforms: {
2533
+ [uniform: string]: THREE.IUniform;
2534
+ }, material: CustomMaterial, renderer: THREE.WebGLRenderer): void;
2535
+ }
2536
+ export interface CustomPointMaterialParameters extends THREE.ShaderMaterialParameters, THREE.PointsMaterialParameters {
2537
+ }
2538
+ export class CustomPointMaterial extends CustomMaterial {
2539
+ type: string;
2540
+
2541
+ constructor(parameters?: CustomPointMaterialParameters);
2542
+ /**
2543
+ * @default new THREE.Color( 0xffffff )
2544
+ */
2545
+ color: THREE.Color;
2546
+ /**
2547
+ * @default null
2548
+ */
2549
+ map: THREE.Texture | null;
2550
+ /**
2551
+ * @default null
2552
+ */
2553
+ alphaMap: THREE.Texture | null;
2554
+ /**
2555
+ * @default 1
2556
+ */
2557
+ size: number;
2558
+ /**
2559
+ * @default true
2560
+ */
2561
+ sizeAttenuation: boolean;
2562
+ copy(source: CustomPointMaterial): this;
2563
+ protected refreshUniformsCommon(uniforms: {
2564
+ [uniform: string]: THREE.IUniform;
2565
+ }, material: CustomPointMaterial, renderer: THREE.WebGLRenderer): void;
2566
+ protected refreshUniforms(uniforms: {
2567
+ [uniform: string]: THREE.IUniform;
2568
+ }, material: CustomMaterial, renderer: THREE.WebGLRenderer): void;
2569
+ }
2570
+ export interface CloudPointMaterialParameters extends THREE.ShaderMaterialParameters, THREE.PointsMaterialParameters {
2571
+ color?: THREE.ColorRepresentation | undefined;
2572
+ size?: number | undefined;
2573
+ sizeAttenuation?: boolean | undefined;
2574
+ }
2575
+ export class CloudPointMaterial extends CustomMaterial {
2576
+ type: string;
2577
+
2578
+ constructor(parameters?: CloudPointMaterialParameters);
2579
+ /**
2580
+ * @default true
2581
+ */
2582
+ sizeAttenuation: boolean;
2583
+ /**
2584
+ * @default new THREE.Color( 0xffffff )
2585
+ */
2586
+ color: THREE.Color;
2587
+ /**
2588
+ * @default 1
2589
+ */
2590
+ size: number;
2591
+ copy(source: CloudPointMaterial): this;
2592
+ protected refreshUniformsCommon(uniforms: {
2593
+ [uniform: string]: THREE.IUniform;
2594
+ }, material: CloudPointMaterial, renderer: THREE.WebGLRenderer): void;
2595
+ protected refreshUniforms(uniforms: {
2596
+ [uniform: string]: THREE.IUniform;
2597
+ }, material: CustomMaterial, renderer: THREE.WebGLRenderer): void;
2598
+ }
2599
+ export enum NavigationHandlerPriority {
2600
+ DefaultNavigation = 0,
2601
+ GizmoHandlers = 20,
2602
+ EmbeddedExtensions = 40,
2603
+ CustomExtensions = 100
2604
+ }
2605
+ export class NavigationEventOptions implements EventListenerOptions {
2606
+ /** If true, use event capturing instead of event bubbling*/
2607
+ readonly capture: boolean;
2608
+ /** Call priority of navigation event handlers, from highest to lowest*/
2609
+ readonly priority: number | NavigationHandlerPriority;
2610
+ /** Always handle, used if `NavigationEvent.isHandled` set to true*/
2611
+ readonly alwaysHandle: boolean;
2612
+ /** (optional) listener name*/
2613
+ readonly navigationTargetName?: string;
2614
+
2615
+ constructor(
2616
+ /** If true, use event capturing instead of event bubbling*/
2617
+ capture?: boolean,
2618
+ /** Call priority of navigation event handlers, from highest to lowest*/
2619
+ priority?: number | NavigationHandlerPriority,
2620
+ /** Always handle, used if `NavigationEvent.isHandled` set to true*/
2621
+ alwaysHandle?: boolean,
2622
+ /** (optional) listener name*/
2623
+ navigationTargetName?: string);
2624
+ }
2625
+ export type NavigationEvent = {
2626
+ /**
2627
+ * (optional) Value indicating whether the NavigationEvent event was handled.
2628
+ */
2629
+ isHandled?: boolean;
2630
+ };
2631
+ export interface ActiveEvent extends Event {
2632
+ readonly isActive: boolean;
2633
+ }
2634
+ export interface NavigationEventSourceEventMap extends HTMLElementEventMap {
2635
+ /**
2636
+ * Occurs when the {@link INavigationEventSource.isActive} property changes.
2637
+ */
2638
+ "active": ActiveEvent;
2639
+ }
2640
+ export interface INavigationEventSource {
2641
+ /**
2642
+ * Activity of the event source
2643
+ */
2644
+ get isActive(): boolean;
2645
+ set isActive(value: boolean);
2646
+ addEventListener<T extends keyof NavigationEventSourceEventMap>(type: T, listener: (this: object, ev: NavigationEventSourceEventMap[T] & NavigationEvent) => void, options?: boolean | EventListenerOptions | NavigationEventOptions): void;
2647
+ removeEventListener<T extends keyof NavigationEventSourceEventMap>(type: T, listener: (this: object, ev: NavigationEventSourceEventMap[T] & NavigationEvent) => void, options?: boolean | EventListenerOptions | NavigationEventOptions): void;
2648
+ }
2649
+ export interface INavigationAgent {
2650
+ /**
2651
+ * Canvas DOM-events source
2652
+ */
2653
+ readonly canvasNavigationSource: INavigationEventSource;
2654
+ /**
2655
+ * Keyboard DOM-events source
2656
+ */
2657
+ readonly keyboardNavigationSource: INavigationEventSource;
2658
+ /**
2659
+ * Activity of the navigation agent
2660
+ */
2661
+ get isActive(): boolean;
2662
+ set isActive(value: boolean);
2663
+ /**
2664
+ * Gets rectangle of the navigation area
2665
+ */
2666
+ getNavigationArea(): DOMRect;
2667
+ }
2668
+ export interface INavigationTool {
2669
+ /**
2670
+ * Gets name of this navigation tool.
2671
+ */
2672
+ get name(): string;
2673
+ /**
2674
+ * Initialize navigation tool.
2675
+ */
2676
+ init(navAgent: INavigationAgent, cameraControl: ICameraControl, intersectionChecker: IModelIntersectionChecker): void;
2677
+ /**
2678
+ * Activates or deactivates this navigation tool.
2679
+ */
2680
+ setActive(isActive: boolean): void;
2681
+ /**
2682
+ * Gets the camera pivot point.
2683
+ */
2684
+ getPivotPoint(): THREE.Vector3;
2685
+ /**
2686
+ * Sets the camera pivot point.
2687
+ */
2688
+ setPivotPoint(pivotPoint: THREE.Vector3): void;
2689
+ /**
2690
+ * Sets the camera parameters.
2691
+ * @param iParams
2692
+ */
2693
+ setCameraParameters(iParams: CameraParameters): void;
2694
+ /**
2695
+ * Gets the camera parameters.
2696
+ */
2697
+ getCameraParameters(): CameraParameters;
2698
+ }
2699
+ export class GizmoMaterials {
2700
+ static gizmoMaterial: THREE.MeshBasicMaterial;
2701
+ static matInvisible: THREE.MeshBasicMaterial;
2702
+ static matRed: THREE.MeshBasicMaterial;
2703
+ static matGreen: THREE.MeshBasicMaterial;
2704
+ static matBlue: THREE.MeshBasicMaterial;
2705
+ static matYellow: THREE.MeshBasicMaterial;
2706
+ static matViolet: THREE.MeshBasicMaterial;
2707
+ static matYellowTransparent: THREE.MeshBasicMaterial;
2708
+ static init(): void;
2709
+ }
2710
+ export interface IGizmoObject extends THREE.Object3D {
2711
+ getHovered(): boolean;
2712
+ setHovered(value: boolean): void;
2713
+ getActive(): boolean;
2714
+ setActive(value: boolean): void;
2715
+ dispose(): void;
2716
+ }
2717
+ export class GizmoObject extends THREE.Object3D implements IGizmoObject {
2718
+ protected _meshes: THREE.Mesh[];
2719
+ readonly baseMaterial: THREE.Material;
2720
+ readonly hoverMaterial: THREE.Material;
2721
+ readonly activeMaterial: THREE.Material;
2722
+
2723
+ constructor(_meshes: THREE.Mesh[], baseMaterial?: THREE.Material, hoverMaterial?: THREE.Material, activeMaterial?: THREE.Material);
2724
+ getHovered(): boolean;
2725
+ setHovered(value: boolean): void;
2726
+ getActive(): boolean;
2727
+ setActive(value: boolean): void;
2728
+ dispose(): void;
2729
+ raycast(raycaster: THREE.Raycaster, intersects: THREE.Intersection<THREE.Object3D<THREE.Event>>[]): void;
2730
+ }
2731
+ export abstract class GizmoAxis extends THREE.Object3D implements IGizmoObject {
2732
+ readonly handle: IGizmoObject;
2733
+ readonly picker?: IGizmoObject;
2734
+ readonly helper?: IGizmoObject;
2735
+ protected _isHovered: boolean;
2736
+ protected _isActive: boolean;
2737
+ protected _plane: THREE.Plane;
2738
+ protected _axisDir: THREE.Vector3;
2739
+ protected _raycaster: THREE.Raycaster;
2740
+ protected _worldPositionStart: THREE.Vector3;
2741
+ protected _worldQuaternionStart: THREE.Quaternion;
2742
+ protected _worldAxisDir: THREE.Vector3;
2743
+ protected _startPoint: THREE.Vector3;
2744
+ protected _endPoint: THREE.Vector3;
2745
+ getActive(): boolean;
2746
+ setActive(value: boolean): void;
2747
+ getHovered(): boolean;
2748
+ setHovered(value: boolean): void;
2749
+ dispose(): void;
2750
+ raycast(raycaster: THREE.Raycaster, intersects: THREE.Intersection<THREE.Object3D<THREE.Event>>[]): void;
2751
+ abstract moveByNdcPt(ndcPos: THREE.Vector2, camera: THREE.Camera): THREE.Matrix4;
2752
+ protected abstract updateGizmoPlane(camera: THREE.Camera): void;
2753
+ protected setStartPt(ndcPos: THREE.Vector2, camera: THREE.Camera): void;
2754
+ }
2755
+ export class GizmoTranslationAxis extends GizmoAxis {
2756
+ readonly handle: IGizmoObject;
2757
+ readonly picker?: IGizmoObject;
2758
+ readonly helper?: IGizmoObject;
2759
+
2760
+ constructor(axisDir: THREE.Vector3, handle: IGizmoObject, picker?: IGizmoObject, helper?: IGizmoObject);
2761
+ moveByNdcPt(ndcPos: THREE.Vector2, camera: THREE.Camera): THREE.Matrix4;
2762
+ protected updateGizmoPlane(camera: THREE.Camera): void;
2763
+ }
2764
+ export class GizmoRotationAxis extends GizmoAxis {
2765
+ readonly handle: IGizmoObject;
2766
+ readonly picker?: IGizmoObject;
2767
+ readonly helper?: IGizmoObject;
2768
+ moveByNdcPt(ndcPos: THREE.Vector2, camera: THREE.Camera): THREE.Matrix4;
2769
+ protected updateGizmoPlane(camera: THREE.Camera): void;
2770
+ }
2771
+ export class GizmoScaleAxis extends GizmoAxis {
2772
+ readonly handle: IGizmoObject;
2773
+ readonly picker?: IGizmoObject;
2774
+ readonly helper?: IGizmoObject;
2775
+ moveByNdcPt(ndcPos: THREE.Vector2, camera: THREE.Camera): THREE.Matrix4;
2776
+ protected updateGizmoPlane(camera: THREE.Camera): void;
2777
+ }
2778
+ export class GizmoControl extends THREE.Object3D {
2779
+
2780
+ constructor(camera: THREE.Camera, navAgent: INavigationAgent);
2781
+ attachTo(object: THREE.Object3D, asChild?: boolean): void;
2782
+ detach(): void;
2783
+ addAxis(axis: GizmoAxis): void;
2784
+ dispose(): void;
2785
+ updateMatrixWorld(force?: boolean): void;
2786
+ updateGizmoOffset(position?: THREE.Vector3, quaternion?: THREE.Quaternion): void;
2787
+ }
2788
+ export enum GizmoAxisDir {
2789
+ NONE = 0,
2790
+ X = 1,
2791
+ Y = 2,
2792
+ Z = 4,
2793
+ XY = 3,
2794
+ YZ = 6,
2795
+ XZ = 5,
2796
+ XYZ = 7
2797
+ }
2798
+ export class GizmoBuilder {
2799
+ static build(camera: THREE.Camera, navAgent: INavigationAgent, translation?: GizmoAxisDir, rotation?: GizmoAxisDir, scale?: GizmoAxisDir): GizmoControl;
2800
+ static buildTranslationAxis(axisDir: THREE.Vector3, handleBaseMatrial?: THREE.Material, handleHoveredMaterial?: THREE.Material, handleSelectedMaterial?: THREE.Material, pickerBaseMatrial?: THREE.Material, pickerHoveredMaterial?: THREE.Material, pickerSelectedMaterial?: THREE.Material): GizmoAxis;
2801
+ static buildRotationAxis(axisDir: THREE.Vector3, handleBaseMatrial?: THREE.Material, handleHoveredMaterial?: THREE.Material, handleSelectedMaterial?: THREE.Material, pickerBaseMatrial?: THREE.Material, pickerHoveredMaterial?: THREE.Material, pickerSelectedMaterial?: THREE.Material): GizmoAxis;
2802
+ static buildScaleAxis(axisDir: THREE.Vector3, handleBaseMatrial?: THREE.Material, handleHoveredMaterial?: THREE.Material, handleSelectedMaterial?: THREE.Material): GizmoAxis;
2975
2803
  }
2976
- export class ModelElementProperty {
2977
- name: string;
2978
- unit: number;
2979
- value: ModelElementPropertyValue;
2804
+ export interface CustomSpriteMaterialParameters extends THREE.ShaderMaterialParameters {
2805
+ color?: THREE.ColorRepresentation | undefined;
2806
+ map?: THREE.Texture | null | undefined;
2807
+ alphaMap?: THREE.Texture | null | undefined;
2808
+ rotation?: number | undefined;
2809
+ sizeAttenuation?: boolean | undefined;
2810
+ center?: THREE.Vector2 | undefined;
2811
+ discreteClipping?: boolean | undefined;
2812
+ offset?: THREE.Vector2 | undefined;
2980
2813
  }
2981
- export class ModelElementPropertyValue {
2982
- str_value?: string;
2983
- int_value?: number;
2984
- double_value?: number;
2985
- date_value?: bigint;
2986
- array_value: Array<string>;
2987
- decimal_value?: number;
2988
- guid_value?: string;
2989
- array_int_value: Array<number>;
2990
- bool_value?: boolean;
2991
- get value(): unknown;
2814
+ export class CustomSpriteMaterial extends CustomMaterial {
2815
+ type: string;
2816
+ readonly isSpriteMaterial: true;
2817
+
2818
+ constructor(parameters?: CustomSpriteMaterialParameters);
2819
+ /**
2820
+ * @default true
2821
+ */
2822
+ get discreteClipping(): boolean;
2823
+ set discreteClipping(value: boolean);
2824
+ get resolution(): THREE.Vector2;
2825
+ /**
2826
+ * @default new THREE.Color( 0xffffff )
2827
+ */
2828
+ color: THREE.Color;
2829
+ /**
2830
+ * @default null
2831
+ */
2832
+ map: THREE.Texture | null;
2833
+ /**
2834
+ * @default null
2835
+ */
2836
+ alphaMap: THREE.Texture | null;
2837
+ /**
2838
+ * @default 0
2839
+ */
2840
+ rotation: number;
2841
+ /**
2842
+ * @default true
2843
+ */
2844
+ sizeAttenuation: boolean;
2845
+ /**
2846
+ * @default new THREE.Vector2(0.5, 0.5)
2847
+ */
2848
+ center: THREE.Vector2;
2849
+ /**
2850
+ * @default new THREE.Vector2(0.0, 0.0)
2851
+ */
2852
+ offset: THREE.Vector2;
2853
+ copy(source: CustomSpriteMaterial): this;
2854
+ protected refreshUniformsCommon(uniforms: {
2855
+ [uniform: string]: THREE.IUniform;
2856
+ }, material: CustomSpriteMaterial, renderer: THREE.WebGLRenderer): void;
2857
+ protected refreshUniforms(uniforms: {
2858
+ [uniform: string]: THREE.IUniform;
2859
+ }, material: CustomMaterial, renderer: THREE.WebGLRenderer): void;
2860
+ }
2861
+ export class MeshLineGeometry extends THREE.InstancedBufferGeometry {
2862
+ type: string;
2863
+ instanceStart: THREE.BufferAttribute;
2864
+ instanceEnd: THREE.BufferAttribute;
2865
+ instanceColorStart: THREE.BufferAttribute;
2866
+ instanceColorEnd: THREE.BufferAttribute;
2867
+
2868
+ constructor();
2869
+ applyMatrix4(matrix: THREE.Matrix4): this;
2870
+ updatePoint(index: number, point: THREE.Vector3): void;
2871
+ updateColor(index: number, color: Color): void;
2872
+ setPoints(points: THREE.Vector3[]): this;
2873
+ setPositions(array: ArrayLike<number>): this;
2874
+ setColors(array: ArrayLike<number>): this;
2875
+ computeLineDistances(): this;
2876
+ toBufferGeometry(): THREE.BufferGeometry;
2877
+ toWireframeGeometry(): THREE.WireframeGeometry;
2878
+ fromWireframeGeometry(geometry: THREE.WireframeGeometry): this;
2879
+ fromEdgesGeometry(geometry: THREE.EdgesGeometry): this;
2880
+ fromMesh(mesh: THREE.Mesh): this;
2881
+ fromLineSegments(lineSegments: THREE.LineSegments): this;
2882
+ computeBoundingBox(): void;
2883
+ computeBoundingSphere(): void;
2884
+ }
2885
+ export class MeshLine extends THREE.Mesh {
2886
+ type: string;
2887
+ material: MeshLineMaterial;
2888
+ geometry: MeshLineGeometry;
2889
+
2890
+ constructor(geometry?: MeshLineGeometry, material?: MeshLineMaterial);
2891
+ raycast(raycaster: THREE.Raycaster, intersects: THREE.Intersection[]): void;
2892
+ }
2893
+ export class CustomSprite extends THREE.Sprite {
2894
+ material: CustomSpriteMaterial;
2895
+
2896
+ constructor(material: CustomSpriteMaterial);
2897
+ raycast(raycaster: THREE.Raycaster, intersects: THREE.Intersection<THREE.Object3D<THREE.Event>>[]): void;
2898
+ dispose(): void;
2899
+ }
2900
+ export interface LabelSpriteParameters {
2901
+ text?: string | undefined;
2902
+ sizeAttenuation?: boolean | undefined;
2903
+ fontFace?: string | FontFace | undefined;
2904
+ fontSize?: number | undefined;
2905
+ borderColor?: Color | undefined;
2906
+ backgroundColor?: Color | undefined;
2907
+ borderThickness?: number | undefined;
2908
+ borderRadius?: number | undefined;
2909
+ textColor?: Color | undefined;
2910
+ textPadding?: THREE.Vector4Tuple | undefined;
2911
+ }
2912
+ export class LabelSprite extends CustomSprite {
2913
+ readonly extraHeightFactor = 1.4;
2914
+
2915
+ constructor(parameters: LabelSpriteParameters);
2916
+ get sizeAttenuation(): boolean;
2917
+ set sizeAttenuation(value: boolean);
2918
+ /**
2919
+ * @default ''
2920
+ */
2921
+ get text(): string;
2922
+ set text(value: string);
2923
+ /**
2924
+ * @default 'Roboto, sans-serif'
2925
+ */
2926
+ get fontFace(): string | FontFace;
2927
+ set fontFace(value: string | FontFace);
2928
+ /**
2929
+ * @default 12
2930
+ */
2931
+ get fontSize(): number;
2932
+ set fontSize(value: number);
2933
+ /**
2934
+ * @default 2
2935
+ */
2936
+ get borderThickness(): number;
2937
+ set borderThickness(value: number);
2938
+ /**
2939
+ * @default new Color(0, 0, 0, 1.0)
2940
+ */
2941
+ get borderColor(): Color;
2942
+ set borderColor(value: Color);
2943
+ /**
2944
+ * @default 1
2945
+ */
2946
+ get borderRadius(): number;
2947
+ set borderRadius(value: number);
2948
+ /**
2949
+ * @default new Color(1.0, 1.0, 1.0, 1.0)
2950
+ */
2951
+ get backgroundColor(): Color;
2952
+ set backgroundColor(value: Color);
2953
+ /**
2954
+ * @default new Color(0, 0, 0, 1.0)
2955
+ */
2956
+ get textColor(): Color;
2957
+ set textColor(value: Color);
2958
+ /**
2959
+ * Label text padding: left, top, right, bottom
2960
+ * @default [0, 0, 0, 0]
2961
+ */
2962
+ get textPadding(): THREE.Vector4Tuple;
2963
+ set textPadding(value: THREE.Vector4Tuple);
2964
+ dispose(): void;
2965
+ }
2966
+ export interface MeshPointMaterialParameters extends THREE.ShaderMaterialParameters {
2967
+ sizeAttenuation?: boolean | undefined;
2968
+ discreteClipping?: boolean | undefined;
2969
+ }
2970
+ export class MeshPointMaterial extends CustomMaterial {
2971
+
2972
+ constructor(parameters?: MeshPointMaterialParameters);
2973
+ /**
2974
+ * @default true
2975
+ */
2976
+ get discreteClipping(): boolean;
2977
+ set discreteClipping(value: boolean);
2978
+ get resolution(): THREE.Vector2;
2979
+ /**
2980
+ * @default true
2981
+ */
2982
+ sizeAttenuation: boolean;
2983
+ copy(source: MeshPointMaterial): this;
2984
+ protected refreshUniforms(uniforms: {
2985
+ [uniform: string]: THREE.IUniform;
2986
+ }, material: CustomMaterial, renderer: THREE.WebGLRenderer): void;
2987
+ }
2988
+ export interface MeshPointParamter {
2989
+ point?: THREE.Vector3;
2990
+ color?: Color;
2991
+ size?: number;
2992
+ }
2993
+ export class MeshPoints extends THREE.Mesh {
2994
+ geometry: THREE.InstancedBufferGeometry;
2995
+ material: MeshPointMaterial;
2996
+
2997
+ constructor();
2998
+ /**
2999
+ * @default new Color( 1,1,1,1 )
3000
+ */
3001
+ color: Color;
3002
+ /**
3003
+ * @default 1
3004
+ */
3005
+ pointSize: number;
3006
+ /**
3007
+ * @default new THREE.Vector3(0, 0, 0)
3008
+ */
3009
+ point: THREE.Vector3;
3010
+ addPoint(pointParameter?: MeshPointParamter): number;
3011
+ updatePoint(index: number, pointParameter: MeshPointParamter): void;
3012
+ removePoint(index: number): this;
3013
+ updateAttributes(): void;
3014
+ dispose(): void;
3015
+ raycast(raycaster: THREE.Raycaster, intersects: THREE.Intersection<THREE.Object3D<THREE.Event>>[]): void;
3016
+ }
3017
+ export interface DeleteEventListener extends EventListener {
3018
+ (evt: DeleteEvent): void;
3019
+ }
3020
+ export interface DeleteEventFilter {
3021
+ (modelId: string, entityId: string): boolean;
3022
+ }
3023
+ export class DeletionManager {
3024
+ readonly eventsDispatcher: IEventsDispatcher;
3025
+ addDeletionFilter(filter: DeleteEventFilter): void;
3026
+ removeDeletionFilter(filter: DeleteEventFilter): void;
3027
+ delete(objectsToDelete: ModelElementIds[]): boolean;
3028
+ isDeletionEnable(objectsToDelete: ModelElementIds[]): boolean;
2992
3029
  }
2993
3030
  /**
2994
3031
  * This class describes the coordination model. The coordination model contains parts of the model (aka ModelPart).
@@ -3216,6 +3253,8 @@ export interface INavigation {
3216
3253
  export class ModelLoadingOptions {
3217
3254
  guid: string;
3218
3255
  isConsolidatedModel?: boolean;
3256
+ placement?: THREE.Matrix4Tuple | number[];
3257
+ scaling?: number;
3219
3258
  }
3220
3259
  export let ViewerInstance: Viewer3D;
3221
3260
  export class Viewer3D extends ViewerBase {
@@ -3238,20 +3277,31 @@ export class Viewer3D extends ViewerBase {
3238
3277
  * Loads new model part to the viewer
3239
3278
  * @param buffer
3240
3279
  * @param options
3241
- * @param onSuccessCallback
3242
- * @param onErrorCallback
3280
+ * @param onSuccessCallback - Deprecated
3281
+ * @param onErrorCallback - Deprecated
3282
+ * @returns
3243
3283
  */
3244
- loadModelPart(data: ArrayBuffer | string, options: ModelLoadingOptions, onSuccessCallback: SuccessCallback, onErrorCallback: ErrorCallback): void;
3284
+ loadModelPart(data: ArrayBuffer | string, options: ModelLoadingOptions, onSuccessCallback?: SuccessCallback, onErrorCallback?: ErrorCallback): Promise<void>;
3245
3285
  /**
3246
3286
  * Updates the model part data file
3247
3287
  * @param data
3248
3288
  * @param options
3249
- * @param onSuccessCallback
3250
- * @param onErrorCallback
3289
+ * @param onSuccessCallback - Deprecated
3290
+ * @param onErrorCallback - Deprecated
3291
+ * @returns
3292
+ */
3293
+ updateModelPart(data: ArrayBuffer | string, options: ModelLoadingOptions, onSuccessCallback?: SuccessCallback, onErrorCallback?: ErrorCallback): Promise<void>;
3294
+ /**
3295
+ * Loads cloud points as new model part to the viewer
3296
+ * @param data
3297
+ * @param options
3298
+ * @param onSuccessCallback - Deprecated
3299
+ * @param onErrorCallback - Deprecated
3300
+ * @returns
3251
3301
  */
3252
- updateModelPart(data: ArrayBuffer | string, options: ModelLoadingOptions, onSuccessCallback: SuccessCallback, onErrorCallback: ErrorCallback): void;
3302
+ loadCloudPart(data: ArrayBuffer | string, options: ModelLoadingOptions, onSuccessCallback?: SuccessCallback, onErrorCallback?: ErrorCallback): Promise<void>;
3253
3303
  /**
3254
- * unloads model part from the viewer
3304
+ * Unloads model part from the viewer
3255
3305
  * @param modelPart - model part id or model part instance
3256
3306
  */
3257
3307
  unloadModelPart(modelPart?: string | ModelPart): void;
@@ -3275,7 +3325,7 @@ export class Viewer3D extends ViewerBase {
3275
3325
  setThemeFromSettings(): void;
3276
3326
  }
3277
3327
  export class GuiViewer3D extends Viewer3D {
3278
- loadModelPart(buffer: ArrayBuffer, options: ModelLoadingOptions, onSuccessCallback: SuccessCallback, onErrorCallback: ErrorCallback): void;
3328
+ loadModelPart(buffer: ArrayBuffer, options: ModelLoadingOptions, onSuccessCallback?: SuccessCallback, onErrorCallback?: ErrorCallback): Promise<void>;
3279
3329
  getToolbar(): ViewerToolbar;
3280
3330
  onPostExtensionLoad(extension: ExtensionBase): void;
3281
3331
  protected getToolbarHeight(): number;