@pilotdev/pilot-web-3d 23.0.6-alpha.1 → 23.0.6-alpha.2

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 +360 -374
  2. package/package.json +1 -1
package/index.d.ts CHANGED
@@ -719,30 +719,33 @@ export interface IEventSigner<Data> {
719
719
  }): boolean;
720
720
  }
721
721
 
722
- export interface EventEmitter<Data> {
723
- emit(data?: Data, options?: object): void;
722
+ export enum SelectionMode {
723
+ Append = 0,
724
+ Replace = 1
724
725
  }
725
- export class EventListener<Data> implements IEventListener<Data>, Disposable {
726
-
727
- constructor(event: IEventSigner<Data>, func: EventFunction<Data>, options: {
728
- bind?: object;
729
- });
730
- dispose(): void;
726
+ export class RenderViewSettings {
727
+ telemetry?: boolean;
728
+ hideEdgesWhenNavigation?: boolean;
729
+ antiAliasing?: boolean;
730
+ displayMode?: DisplayMode;
731
+ /** Desired render framerate */
732
+ desiredFramerate?: number;
733
+ /** Allocated time for rendering operations, excluding scene rendering */
734
+ manageTime?: number;
735
+ /** Draw hovered meshes on the `selectionScene` */
736
+ hoverMeshes?: boolean;
737
+ /** Draw hovered edges on the `selectionScene` */
738
+ hoverEdges?: boolean;
739
+ /** Draw selected meshes on the `selectionScene` */
740
+ selectEdges?: boolean;
741
+ /** Draw selected edges on the `selectionScene` */
742
+ selectMeshes?: boolean;
731
743
  }
732
- export class EventDispatcher<Data> implements IEventSigner<Data>, EventEmitter<Data> {
733
- listen(func: EventFunction<Data>, options?: {
734
- bind?: object;
735
- }): EventListener<Data>;
736
- unlisten(func: EventFunction<Data>, options?: {
737
- bind?: object;
738
- allowMissing?: boolean;
739
- }): boolean;
740
- emit(data?: Data): void;
741
- emitR(data?: Data): any[];
742
- asSigner(): IEventSigner<Data>;
743
- asEmitter(): EventEmitter<Data>;
744
- removeAllListeners(): void;
744
+ export enum DisplayMode {
745
+ FACES_AND_EDGES = 0,
746
+ FACES = 1
745
747
  }
748
+ export const defaultRenderViewSettings: RenderViewSettings;
746
749
  export interface IModelIntersectionChecker {
747
750
  /** Gets the center of the model*/
748
751
  get modelCenter(): THREE.Vector3;
@@ -794,29 +797,60 @@ export interface IModelIntersectionChecker {
794
797
  guid: string;
795
798
  }[];
796
799
  }
797
- export class RenderViewSettings {
798
- telemetry?: boolean;
799
- hideEdgesWhenNavigation?: boolean;
800
- antiAliasing?: boolean;
801
- displayMode?: DisplayMode;
802
- /** Desired render framerate */
803
- desiredFramerate?: number;
804
- /** Allocated time for rendering operations, excluding scene rendering */
805
- manageTime?: number;
806
- /** Draw hovered meshes on the `selectionScene` */
807
- hoverMeshes?: boolean;
808
- /** Draw hovered edges on the `selectionScene` */
809
- hoverEdges?: boolean;
810
- /** Draw selected meshes on the `selectionScene` */
811
- selectEdges?: boolean;
812
- /** Draw selected edges on the `selectionScene` */
813
- selectMeshes?: boolean;
800
+ export interface I3DRenderer {
801
+ clear(color?: boolean, depth?: boolean, stencil?: boolean): void;
802
+ setClearColor(color: THREE.ColorRepresentation, alpha?: number): void;
803
+ clearDepth(): void;
804
+ render(scene: THREE.Object3D, camera: THREE.Camera): void;
805
+ getSize(target: THREE.Vector2): THREE.Vector2;
806
+ setSize(width: number, height: number, updateStyle?: boolean): void;
807
+ setViewport(x: THREE.Vector4 | number, y?: number, width?: number, height?: number): void;
808
+ clippingPlanes: THREE.Plane[];
809
+ domElement: HTMLCanvasElement;
814
810
  }
815
- export enum DisplayMode {
816
- FACES_AND_EDGES = 0,
817
- FACES = 1
811
+ export interface IRenderViewer3D {
812
+ /** Gets model inetrsection checker. */
813
+ getIntersectionChecker(): IModelIntersectionChecker;
814
+ /** Request a full redraw of the canvas. */
815
+ updateCurrentCanvas(): Promise<void>;
816
+ /**
817
+ * Place object on the scene.\
818
+ * An object can only be placed on one scene.
819
+ * @param iObj - object to place.
820
+ * @param sceneID - (optional) scene name. `MainScene` by default.
821
+ */
822
+ placeObjectOnScene(iObj: THREE.Object3D, sceneID?: string): Promise<void>;
823
+ /**
824
+ * Remove object from scene.
825
+ * @param iObj
826
+ */
827
+ removeObjectFromScene(iObj: THREE.Object3D): Promise<void>;
828
+ /**
829
+ * Set clipping planes for rendering.
830
+ * @param planes - array of clipping planes.
831
+ */
832
+ setClipping(planes: THREE.Plane[]): void;
833
+ /**
834
+ * Set active clipping planes: planes with colored sections
835
+ * @param indices - active planes indices in the array of clipping planes
836
+ */
837
+ setActiveClipPlaneIndices(indices: number[]): void;
838
+ /**
839
+ * Gets all render scenes.
840
+ */
841
+ getScenes(): IUserScene[];
842
+ /**
843
+ *
844
+ * @param name
845
+ * @param isClippable
846
+ */
847
+ addScene(name: string, isClippable: boolean): IUserScene;
848
+ /**
849
+ *
850
+ * @param scene
851
+ */
852
+ removeScene(scene: IUserScene): void;
818
853
  }
819
- export const defaultRenderViewSettings: RenderViewSettings;
820
854
  export interface IRenderOperationContext {
821
855
  /** If true, renderScenes operations will be forced*/
822
856
  isRedrawRequested: boolean;
@@ -907,59 +941,287 @@ export interface IUserScene {
907
941
  /** Dispose scene */
908
942
  dispose(): void;
909
943
  }
910
- export interface I3DRenderer {
911
- clear(color?: boolean, depth?: boolean, stencil?: boolean): void;
912
- setClearColor(color: ColorRepresentation, alpha?: number): void;
913
- clearDepth(): void;
914
- render(scene: THREE.Object3D, camera: THREE.Camera): void;
915
- getSize(target: THREE.Vector2): THREE.Vector2;
916
- setSize(width: number, height: number, updateStyle?: boolean): void;
917
- setViewport(x: THREE.Vector4 | number, y?: number, width?: number, height?: number): void;
918
- clippingPlanes: THREE.Plane[];
919
- domElement: HTMLCanvasElement;
944
+ export enum NavigationHandlerPriority {
945
+ DefaultNavigation = 0,
946
+ GizmoHandlers = 20,
947
+ EmbeddedExtensions = 40,
948
+ CustomExtensions = 100
920
949
  }
921
- export interface IRenderViewer3D {
922
- /** Gets model inetrsection checker. */
923
- getIntersectionChecker(): IModelIntersectionChecker;
924
- /** Request a full redraw of the canvas. */
925
- updateCurrentCanvas(): Promise<void>;
950
+ export class NavigationEventOptions implements EventListenerOptions {
951
+ /** If true, use event capturing instead of event bubbling*/
952
+ readonly capture: boolean;
953
+ /** Call priority of navigation event handlers, from highest to lowest*/
954
+ readonly priority: number | NavigationHandlerPriority;
955
+ /** Always handle, used if `NavigationEvent.isHandled` set to true*/
956
+ readonly alwaysHandle: boolean;
957
+ /** (optional) listener name*/
958
+ readonly navigationTargetName?: string;
959
+
960
+ constructor(
961
+ /** If true, use event capturing instead of event bubbling*/
962
+ capture?: boolean,
963
+ /** Call priority of navigation event handlers, from highest to lowest*/
964
+ priority?: number | NavigationHandlerPriority,
965
+ /** Always handle, used if `NavigationEvent.isHandled` set to true*/
966
+ alwaysHandle?: boolean,
967
+ /** (optional) listener name*/
968
+ navigationTargetName?: string);
969
+ }
970
+ export type NavigationEvent = {
926
971
  /**
927
- * Place object on the scene.\
928
- * An object can only be placed on one scene.
929
- * @param iObj - object to place.
930
- * @param sceneID - (optional) scene name. `MainScene` by default.
972
+ * (optional) Value indicating whether the NavigationEvent event was handled.
931
973
  */
932
- placeObjectOnScene(iObj: THREE.Object3D, sceneID?: string): Promise<void>;
974
+ isHandled?: boolean;
975
+ };
976
+ export interface INavigationEventSource {
933
977
  /**
934
- * Remove object from scene.
935
- * @param iObj
978
+ * Event fired on activity changed
936
979
  */
937
- removeObjectFromScene(iObj: THREE.Object3D): Promise<void>;
980
+ readonly eventSourceActivityChanged: IEventSigner<boolean>;
938
981
  /**
939
- * Set clipping planes for rendering.
940
- * @param planes - array of clipping planes.
982
+ * Activates or deactivate event source
983
+ * @param value - activate if true
941
984
  */
942
- setClipping(planes: THREE.Plane[]): void;
985
+ setActive(value: boolean): void;
986
+ addEventListener<T extends keyof HTMLElementEventMap>(type: T, listener: (this: object, ev: HTMLElementEventMap[T] & NavigationEvent) => void, options?: boolean | EventListenerOptions | NavigationEventOptions): void;
987
+ removeEventListener<T extends keyof HTMLElementEventMap>(type: T, listener: (this: object, ev: HTMLElementEventMap[T] & NavigationEvent) => void, options?: boolean | EventListenerOptions | NavigationEventOptions): void;
988
+ }
989
+ export interface INavigationAgent {
943
990
  /**
944
- * Set active clipping planes: planes with colored sections
945
- * @param indices - active planes indices in the array of clipping planes
991
+ * Canvas DOM-events source
946
992
  */
947
- setActiveClipPlaneIndices(indices: number[]): void;
993
+ readonly canvasNavigationSource: INavigationEventSource;
948
994
  /**
949
- * Gets all render scenes.
995
+ * Keyboard DOM-events source
950
996
  */
951
- getScenes(): IUserScene[];
997
+ readonly keyboardNavigationSource: INavigationEventSource;
952
998
  /**
953
- *
954
- * @param name
955
- * @param isClippable
999
+ * Activates canvas and keyboard navigation event sources
956
1000
  */
957
- addScene(name: string, isClippable: boolean): IUserScene;
1001
+ setActive(value: boolean): void;
958
1002
  /**
959
- *
960
- * @param scene
1003
+ * Gets rectangle of the navigation area
961
1004
  */
962
- removeScene(scene: IUserScene): void;
1005
+ getNavigationArea(): DOMRect;
1006
+ }
1007
+ export interface INavigationTool {
1008
+ /**
1009
+ * Gets name of this navigation tool.
1010
+ */
1011
+ get name(): string;
1012
+ /**
1013
+ * Initialize navigation tool.
1014
+ */
1015
+ init(navAgent: INavigationAgent, cameraControl: ICameraControl, intersectionChecker: IModelIntersectionChecker): void;
1016
+ /**
1017
+ * Activates or deactivates this navigation tool.
1018
+ */
1019
+ setActive(isActive: boolean): void;
1020
+ /**
1021
+ * Gets the camera pivot point.
1022
+ */
1023
+ getPivotPoint(): THREE.Vector3;
1024
+ /**
1025
+ * Sets the camera pivot point.
1026
+ */
1027
+ setPivotPoint(pivotPoint: THREE.Vector3): void;
1028
+ /**
1029
+ * Sets the camera parameters.
1030
+ * @param iParams
1031
+ */
1032
+ setCameraParameters(iParams: CameraParameters): void;
1033
+ /**
1034
+ * Gets the camera parameters.
1035
+ */
1036
+ getCameraParameters(): CameraParameters;
1037
+ }
1038
+ export class GizmoMaterials {
1039
+ static gizmoMaterial: THREE.MeshBasicMaterial;
1040
+ static matInvisible: THREE.MeshBasicMaterial;
1041
+ static matRed: THREE.MeshBasicMaterial;
1042
+ static matGreen: THREE.MeshBasicMaterial;
1043
+ static matBlue: THREE.MeshBasicMaterial;
1044
+ static matYellow: THREE.MeshBasicMaterial;
1045
+ static matViolet: THREE.MeshBasicMaterial;
1046
+ static matYellowTransparent: THREE.MeshBasicMaterial;
1047
+ static init(): void;
1048
+ }
1049
+ export interface IGizmoObject extends THREE.Object3D {
1050
+ getHovered(): boolean;
1051
+ setHovered(value: boolean): void;
1052
+ getActive(): boolean;
1053
+ setActive(value: boolean): void;
1054
+ dispose(): void;
1055
+ }
1056
+ export class GizmoObject extends THREE.Object3D implements IGizmoObject {
1057
+ protected _meshes: THREE.Mesh[];
1058
+ readonly baseMaterial: THREE.Material;
1059
+ readonly hoverMaterial: THREE.Material;
1060
+ readonly activeMaterial: THREE.Material;
1061
+
1062
+ constructor(_meshes: THREE.Mesh[], baseMaterial?: THREE.Material, hoverMaterial?: THREE.Material, activeMaterial?: THREE.Material);
1063
+ getHovered(): boolean;
1064
+ setHovered(value: boolean): void;
1065
+ getActive(): boolean;
1066
+ setActive(value: boolean): void;
1067
+ dispose(): void;
1068
+ raycast(raycaster: THREE.Raycaster, intersects: THREE.Intersection<THREE.Object3D<THREE.Event>>[]): void;
1069
+ }
1070
+ export abstract class GizmoAxis extends THREE.Object3D implements IGizmoObject {
1071
+ readonly handle: IGizmoObject;
1072
+ readonly picker?: IGizmoObject;
1073
+ readonly helper?: IGizmoObject;
1074
+ protected _isHovered: boolean;
1075
+ protected _isActive: boolean;
1076
+ protected _plane: THREE.Plane;
1077
+ protected _axisDir: THREE.Vector3;
1078
+ protected _raycaster: THREE.Raycaster;
1079
+ protected _worldPositionStart: THREE.Vector3;
1080
+ protected _worldQuaternionStart: THREE.Quaternion;
1081
+ protected _worldAxisDir: THREE.Vector3;
1082
+ protected _startPoint: THREE.Vector3;
1083
+ protected _endPoint: THREE.Vector3;
1084
+ getActive(): boolean;
1085
+ setActive(value: boolean): void;
1086
+ getHovered(): boolean;
1087
+ setHovered(value: boolean): void;
1088
+ dispose(): void;
1089
+ raycast(raycaster: THREE.Raycaster, intersects: THREE.Intersection<THREE.Object3D<THREE.Event>>[]): void;
1090
+ abstract moveByNdcPt(ndcPos: THREE.Vector2, camera: THREE.Camera): THREE.Matrix4;
1091
+ protected abstract updateGizmoPlane(camera: THREE.Camera): void;
1092
+ protected setStartPt(ndcPos: THREE.Vector2, camera: THREE.Camera): void;
1093
+ }
1094
+ export class GizmoTranslationAxis extends GizmoAxis {
1095
+ readonly handle: IGizmoObject;
1096
+ readonly picker?: IGizmoObject;
1097
+ readonly helper?: IGizmoObject;
1098
+
1099
+ constructor(axisDir: THREE.Vector3, handle: IGizmoObject, picker?: IGizmoObject, helper?: IGizmoObject);
1100
+ moveByNdcPt(ndcPos: THREE.Vector2, camera: THREE.Camera): THREE.Matrix4;
1101
+ protected updateGizmoPlane(camera: THREE.Camera): void;
1102
+ }
1103
+ export class GizmoRotationAxis extends GizmoAxis {
1104
+ readonly handle: IGizmoObject;
1105
+ readonly picker?: IGizmoObject;
1106
+ readonly helper?: IGizmoObject;
1107
+ moveByNdcPt(ndcPos: THREE.Vector2, camera: THREE.Camera): THREE.Matrix4;
1108
+ protected updateGizmoPlane(camera: THREE.Camera): void;
1109
+ }
1110
+ export class GizmoScaleAxis extends GizmoAxis {
1111
+ readonly handle: IGizmoObject;
1112
+ readonly picker?: IGizmoObject;
1113
+ readonly helper?: IGizmoObject;
1114
+ moveByNdcPt(ndcPos: THREE.Vector2, camera: THREE.Camera): THREE.Matrix4;
1115
+ protected updateGizmoPlane(camera: THREE.Camera): void;
1116
+ }
1117
+ export class GizmoControl extends THREE.Object3D {
1118
+
1119
+ constructor(camera: THREE.Camera, navAgent: INavigationAgent);
1120
+ attachTo(object: THREE.Object3D, asChild?: boolean): void;
1121
+ detach(): void;
1122
+ addAxis(axis: GizmoAxis): void;
1123
+ dispose(): void;
1124
+ updateMatrixWorld(force?: boolean): void;
1125
+ updateGizmoOffset(position?: THREE.Vector3, quaternion?: THREE.Quaternion): void;
1126
+ }
1127
+ export enum GizmoAxisDir {
1128
+ NONE = 0,
1129
+ X = 1,
1130
+ Y = 2,
1131
+ Z = 4,
1132
+ XY = 3,
1133
+ YZ = 6,
1134
+ XZ = 5,
1135
+ XYZ = 7
1136
+ }
1137
+ export class GizmoBuilder {
1138
+ static build(camera: THREE.Camera, navAgent: INavigationAgent, translation?: GizmoAxisDir, rotation?: GizmoAxisDir, scale?: GizmoAxisDir): GizmoControl;
1139
+ static buildTranslationAxis(axisDir: THREE.Vector3, handleBaseMatrial?: THREE.Material, handleHoveredMaterial?: THREE.Material, handleSelectedMaterial?: THREE.Material, pickerBaseMatrial?: THREE.Material, pickerHoveredMaterial?: THREE.Material, pickerSelectedMaterial?: THREE.Material): GizmoAxis;
1140
+ static buildRotationAxis(axisDir: THREE.Vector3, handleBaseMatrial?: THREE.Material, handleHoveredMaterial?: THREE.Material, handleSelectedMaterial?: THREE.Material, pickerBaseMatrial?: THREE.Material, pickerHoveredMaterial?: THREE.Material, pickerSelectedMaterial?: THREE.Material): GizmoAxis;
1141
+ static buildScaleAxis(axisDir: THREE.Vector3, handleBaseMatrial?: THREE.Material, handleHoveredMaterial?: THREE.Material, handleSelectedMaterial?: THREE.Material): GizmoAxis;
1142
+ }
1143
+ export interface LabelSpriteParameters {
1144
+ text?: string | undefined;
1145
+ sizeAttenuation?: boolean | undefined;
1146
+ fontFace?: string | FontFace | undefined;
1147
+ fontSize?: number | undefined;
1148
+ borderColor?: Color | undefined;
1149
+ backgroundColor?: Color | undefined;
1150
+ borderThickness?: number | undefined;
1151
+ borderRadius?: number | undefined;
1152
+ textColor?: Color | undefined;
1153
+ textPadding?: THREE.Vector4Tuple | undefined;
1154
+ }
1155
+ export class LabelSprite extends THREE.Sprite {
1156
+ readonly extraHeightFactor = 1.4;
1157
+
1158
+ constructor(parameters: LabelSpriteParameters);
1159
+ get sizeAttenuation(): boolean;
1160
+ set sizeAttenuation(value: boolean);
1161
+ /**
1162
+ * @default ''
1163
+ */
1164
+ get text(): string;
1165
+ set text(value: string);
1166
+ /**
1167
+ * @default 'Roboto, sans-serif'
1168
+ */
1169
+ get fontFace(): string | FontFace;
1170
+ set fontFace(value: string | FontFace);
1171
+ /**
1172
+ * @default 12
1173
+ */
1174
+ get fontSize(): number;
1175
+ set fontSize(value: number);
1176
+ /**
1177
+ * @default 2
1178
+ */
1179
+ get borderThickness(): number;
1180
+ set borderThickness(value: number);
1181
+ /**
1182
+ * @default new Color(0, 0, 0, 1.0)
1183
+ */
1184
+ get borderColor(): Color;
1185
+ set borderColor(value: Color);
1186
+ /**
1187
+ * @default 1
1188
+ */
1189
+ get borderRadius(): number;
1190
+ set borderRadius(value: number);
1191
+ /**
1192
+ * @default new Color(1.0, 1.0, 1.0, 1.0)
1193
+ */
1194
+ get backgroundColor(): Color;
1195
+ set backgroundColor(value: Color);
1196
+ /**
1197
+ * @default new Color(0, 0, 0, 1.0)
1198
+ */
1199
+ get textColor(): Color;
1200
+ set textColor(value: Color);
1201
+ /**
1202
+ * Label text padding: left, top, right, bottom
1203
+ * @default [0, 0, 0, 0]
1204
+ */
1205
+ get textPadding(): THREE.Vector4Tuple;
1206
+ set textPadding(value: THREE.Vector4Tuple);
1207
+ dispose(): void;
1208
+ }
1209
+ export interface EventEmitter<Data> {
1210
+ emit(data?: Data, options?: object): void;
1211
+ }
1212
+ export class EventDispatcher<Data> implements IEventSigner<Data>, EventEmitter<Data> {
1213
+ listen(func: EventFunction<Data>, options?: {
1214
+ bind?: object;
1215
+ }): IEventListener<Data>;
1216
+ unlisten(func: EventFunction<Data>, options?: {
1217
+ bind?: object;
1218
+ allowMissing?: boolean;
1219
+ }): boolean;
1220
+ emit(data?: Data): void;
1221
+ emitR(data?: Data): any[];
1222
+ asSigner(): IEventSigner<Data>;
1223
+ asEmitter(): EventEmitter<Data>;
1224
+ removeAllListeners(): void;
963
1225
  }
964
1226
  export class ModelElement {
965
1227
  get id(): string;
@@ -2282,11 +2544,6 @@ export class ModelElementPropertyValue {
2282
2544
  bool_value?: boolean;
2283
2545
  get value(): unknown;
2284
2546
  }
2285
-
2286
- export enum SelectionMode {
2287
- Append = 0,
2288
- Replace = 1
2289
- }
2290
2547
  export class ModelElementIds {
2291
2548
  modelPartId: string;
2292
2549
  elementIds: string[];
@@ -2295,121 +2552,27 @@ export class EventTypes extends CoreEventTypes {
2295
2552
  static SELECTION_CHANGED_EVENT: string;
2296
2553
  static MODEL_PART_LOADED: string;
2297
2554
  static MODEL_PART_UNLOADED: string;
2298
- static CAMERA_CHANGE_EVENT: string;
2299
- static CAMERA_NAVIGATION_MODE_CHANGED_EVENT: string;
2300
- static RENDER_CLICK_EVENT: string;
2301
- static RENDER_HOVER_EVENT: string;
2302
- }
2303
- export class SelectionChangedEvent extends Event {
2304
- selectedIds: ModelElementIds[];
2305
- }
2306
- export class ModelPartEvent extends Event {
2307
- modelPartId: string;
2308
- }
2309
- export class CameraEvent extends Event {
2310
- }
2311
- export class ClickedEvent extends Event {
2312
- modelId: string;
2313
- modelElementId: string;
2314
- ctrlKey: boolean;
2315
- }
2316
- export class HoverEvent extends Event {
2317
- modelId: string;
2318
- modelElementId: string;
2319
- }
2320
- export enum NavigationHandlerPriority {
2321
- DefaultNavigation = 0,
2322
- GizmoHandlers = 20,
2323
- EmbeddedExtensions = 40,
2324
- CustomExtensions = 100
2325
- }
2326
- export class NavigationEventOptions implements EventListenerOptions {
2327
- /** If true, use event capturing instead of event bubbling*/
2328
- readonly capture: boolean;
2329
- /** Call priority of navigation event handlers, from highest to lowest*/
2330
- readonly priority: number | NavigationHandlerPriority;
2331
- /** Always handle, used if `NavigationEvent.isHandled` set to true*/
2332
- readonly alwaysHandle: boolean;
2333
- /** (optional) listener name*/
2334
- readonly navigationTargetName?: string;
2335
-
2336
- constructor(
2337
- /** If true, use event capturing instead of event bubbling*/
2338
- capture?: boolean,
2339
- /** Call priority of navigation event handlers, from highest to lowest*/
2340
- priority?: number | NavigationHandlerPriority,
2341
- /** Always handle, used if `NavigationEvent.isHandled` set to true*/
2342
- alwaysHandle?: boolean,
2343
- /** (optional) listener name*/
2344
- navigationTargetName?: string);
2555
+ static CAMERA_CHANGE_EVENT: string;
2556
+ static CAMERA_NAVIGATION_MODE_CHANGED_EVENT: string;
2557
+ static RENDER_CLICK_EVENT: string;
2558
+ static RENDER_HOVER_EVENT: string;
2345
2559
  }
2346
- export type NavigationEvent = {
2347
- /**
2348
- * (optional) Value indicating whether the NavigationEvent event was handled.
2349
- */
2350
- isHandled?: boolean;
2351
- };
2352
- export interface INavigationEventSource {
2353
- /**
2354
- * Event fired on activity changed
2355
- */
2356
- readonly eventSourceActivityChanged: IEventSigner<boolean>;
2357
- /**
2358
- * Activates or deactivate event source
2359
- * @param value - activate if true
2360
- */
2361
- setActive(value: boolean): void;
2362
- addEventListener<T extends keyof HTMLElementEventMap>(type: T, listener: (this: object, ev: HTMLElementEventMap[T] & NavigationEvent) => void, options?: boolean | EventListenerOptions | NavigationEventOptions): void;
2363
- removeEventListener<T extends keyof HTMLElementEventMap>(type: T, listener: (this: object, ev: HTMLElementEventMap[T] & NavigationEvent) => void, options?: boolean | EventListenerOptions | NavigationEventOptions): void;
2560
+ export class SelectionChangedEvent extends Event {
2561
+ selectedIds: ModelElementIds[];
2364
2562
  }
2365
- export interface INavigationAgent {
2366
- /**
2367
- * Canvas DOM-events source
2368
- */
2369
- readonly canvasNavigationSource: INavigationEventSource;
2370
- /**
2371
- * Keyboard DOM-events source
2372
- */
2373
- readonly keyboardNavigationSource: INavigationEventSource;
2374
- /**
2375
- * Activates canvas and keyboard navigation event sources
2376
- */
2377
- setActive(value: boolean): void;
2378
- /**
2379
- * Gets rectangle of the navigation area
2380
- */
2381
- getNavigationArea(): DOMRect;
2563
+ export class ModelPartEvent extends Event {
2564
+ modelPartId: string;
2382
2565
  }
2383
- export interface INavigationTool {
2384
- /**
2385
- * Gets name of this navigation tool.
2386
- */
2387
- get name(): string;
2388
- /**
2389
- * Initialize navigation tool.
2390
- */
2391
- init(navAgent: INavigationAgent, cameraControl: ICameraControl, intersectionChecker: IModelIntersectionChecker): void;
2392
- /**
2393
- * Activates or deactivates this navigation tool.
2394
- */
2395
- setActive(isActive: boolean): void;
2396
- /**
2397
- * Gets the camera pivot point.
2398
- */
2399
- getPivotPoint(): THREE.Vector3;
2400
- /**
2401
- * Sets the camera pivot point.
2402
- */
2403
- setPivotPoint(pivotPoint: THREE.Vector3): void;
2404
- /**
2405
- * Sets the camera parameters.
2406
- * @param iParams
2407
- */
2408
- setCameraParameters(iParams: CameraParameters): void;
2409
- /**
2410
- * Gets the camera parameters.
2411
- */
2412
- getCameraParameters(): CameraParameters;
2566
+ export class CameraEvent extends Event {
2567
+ }
2568
+ export class ClickedEvent extends Event {
2569
+ modelId: string;
2570
+ modelElementId: string;
2571
+ ctrlKey: boolean;
2572
+ }
2573
+ export class HoverEvent extends Event {
2574
+ modelId: string;
2575
+ modelElementId: string;
2413
2576
  }
2414
2577
  export interface INavigation {
2415
2578
  /**
@@ -2478,12 +2641,6 @@ export class ModelLoadingOptions {
2478
2641
  guid: string;
2479
2642
  isConsolidatedModel?: boolean;
2480
2643
  }
2481
- export class EventsObserver {
2482
- protected eventsDispatcher: IEventsDispatcher;
2483
- protected _listeners: Map<string, EventListener>;
2484
- watch(): void;
2485
- dispose(): void;
2486
- }
2487
2644
  /**
2488
2645
  * This class describes the coordination model. The coordination model contains parts of the model (aka ModelPart).
2489
2646
  */
@@ -2656,177 +2813,6 @@ export class Extension extends ExtensionBase {
2656
2813
 
2657
2814
  constructor(viewer: Viewer3D, options?: object);
2658
2815
  }
2659
- export class GizmoMaterials {
2660
- static gizmoMaterial: THREE.MeshBasicMaterial;
2661
- static matInvisible: THREE.MeshBasicMaterial;
2662
- static matRed: THREE.MeshBasicMaterial;
2663
- static matGreen: THREE.MeshBasicMaterial;
2664
- static matBlue: THREE.MeshBasicMaterial;
2665
- static matYellow: THREE.MeshBasicMaterial;
2666
- static matViolet: THREE.MeshBasicMaterial;
2667
- static matYellowTransparent: THREE.MeshBasicMaterial;
2668
- static init(): void;
2669
- }
2670
- export interface IGizmoObject extends THREE.Object3D {
2671
- getHovered(): boolean;
2672
- setHovered(value: boolean): void;
2673
- getActive(): boolean;
2674
- setActive(value: boolean): void;
2675
- dispose(): void;
2676
- }
2677
- export class GizmoObject extends THREE.Object3D implements IGizmoObject {
2678
- protected _meshes: THREE.Mesh[];
2679
- readonly baseMaterial: THREE.Material;
2680
- readonly hoverMaterial: THREE.Material;
2681
- readonly activeMaterial: THREE.Material;
2682
-
2683
- constructor(_meshes: THREE.Mesh[], baseMaterial?: THREE.Material, hoverMaterial?: THREE.Material, activeMaterial?: THREE.Material);
2684
- getHovered(): boolean;
2685
- setHovered(value: boolean): void;
2686
- getActive(): boolean;
2687
- setActive(value: boolean): void;
2688
- dispose(): void;
2689
- raycast(raycaster: THREE.Raycaster, intersects: THREE.Intersection<THREE.Object3D<THREE.Event>>[]): void;
2690
- }
2691
- export abstract class GizmoAxis extends THREE.Object3D implements IGizmoObject {
2692
- readonly handle: IGizmoObject;
2693
- readonly picker?: IGizmoObject;
2694
- readonly helper?: IGizmoObject;
2695
- protected _isHovered: boolean;
2696
- protected _isActive: boolean;
2697
- protected _plane: THREE.Plane;
2698
- protected _axisDir: THREE.Vector3;
2699
- protected _raycaster: THREE.Raycaster;
2700
- protected _worldPositionStart: THREE.Vector3;
2701
- protected _worldQuaternionStart: THREE.Quaternion;
2702
- protected _worldAxisDir: THREE.Vector3;
2703
- protected _startPoint: THREE.Vector3;
2704
- protected _endPoint: THREE.Vector3;
2705
- getActive(): boolean;
2706
- setActive(value: boolean): void;
2707
- getHovered(): boolean;
2708
- setHovered(value: boolean): void;
2709
- dispose(): void;
2710
- raycast(raycaster: THREE.Raycaster, intersects: THREE.Intersection<THREE.Object3D<THREE.Event>>[]): void;
2711
- abstract moveByNdcPt(ndcPos: THREE.Vector2, camera: THREE.Camera): THREE.Matrix4;
2712
- protected abstract updateGizmoPlane(camera: THREE.Camera): void;
2713
- protected setStartPt(ndcPos: THREE.Vector2, camera: THREE.Camera): void;
2714
- }
2715
- export class GizmoTranslationAxis extends GizmoAxis {
2716
- readonly handle: IGizmoObject;
2717
- readonly picker?: IGizmoObject;
2718
- readonly helper?: IGizmoObject;
2719
-
2720
- constructor(axisDir: THREE.Vector3, handle: IGizmoObject, picker?: IGizmoObject, helper?: IGizmoObject);
2721
- moveByNdcPt(ndcPos: THREE.Vector2, camera: THREE.Camera): THREE.Matrix4;
2722
- protected updateGizmoPlane(camera: THREE.Camera): void;
2723
- }
2724
- export class GizmoRotationAxis extends GizmoAxis {
2725
- readonly handle: IGizmoObject;
2726
- readonly picker?: IGizmoObject;
2727
- readonly helper?: IGizmoObject;
2728
- moveByNdcPt(ndcPos: THREE.Vector2, camera: THREE.Camera): THREE.Matrix4;
2729
- protected updateGizmoPlane(camera: THREE.Camera): void;
2730
- }
2731
- export class GizmoScaleAxis extends GizmoAxis {
2732
- readonly handle: IGizmoObject;
2733
- readonly picker?: IGizmoObject;
2734
- readonly helper?: IGizmoObject;
2735
- moveByNdcPt(ndcPos: THREE.Vector2, camera: THREE.Camera): THREE.Matrix4;
2736
- protected updateGizmoPlane(camera: THREE.Camera): void;
2737
- }
2738
- export class GizmoControl extends THREE.Object3D {
2739
-
2740
- constructor(camera: THREE.Camera, navAgent: INavigationAgent);
2741
- attachTo(object: THREE.Object3D, asChild?: boolean): void;
2742
- detach(): void;
2743
- addAxis(axis: GizmoAxis): void;
2744
- dispose(): void;
2745
- updateMatrixWorld(force?: boolean): void;
2746
- updateGizmoOffset(position?: THREE.Vector3, quaternion?: THREE.Quaternion): void;
2747
- }
2748
- export enum GizmoAxisDir {
2749
- NONE = 0,
2750
- X = 1,
2751
- Y = 2,
2752
- Z = 4,
2753
- XY = 3,
2754
- YZ = 6,
2755
- XZ = 5,
2756
- XYZ = 7
2757
- }
2758
- export class GizmoBuilder {
2759
- static build(camera: THREE.Camera, navAgent: INavigationAgent, translation?: GizmoAxisDir, rotation?: GizmoAxisDir, scale?: GizmoAxisDir): GizmoControl;
2760
- static buildTranslationAxis(axisDir: THREE.Vector3, handleBaseMatrial?: THREE.Material, handleHoveredMaterial?: THREE.Material, handleSelectedMaterial?: THREE.Material, pickerBaseMatrial?: THREE.Material, pickerHoveredMaterial?: THREE.Material, pickerSelectedMaterial?: THREE.Material): GizmoAxis;
2761
- static buildRotationAxis(axisDir: THREE.Vector3, handleBaseMatrial?: THREE.Material, handleHoveredMaterial?: THREE.Material, handleSelectedMaterial?: THREE.Material, pickerBaseMatrial?: THREE.Material, pickerHoveredMaterial?: THREE.Material, pickerSelectedMaterial?: THREE.Material): GizmoAxis;
2762
- static buildScaleAxis(axisDir: THREE.Vector3, handleBaseMatrial?: THREE.Material, handleHoveredMaterial?: THREE.Material, handleSelectedMaterial?: THREE.Material): GizmoAxis;
2763
- }
2764
- export interface LabelSpriteParameters {
2765
- text?: string | undefined;
2766
- sizeAttenuation?: boolean | undefined;
2767
- fontFace?: string | FontFace | undefined;
2768
- fontSize?: number | undefined;
2769
- borderColor?: Color | undefined;
2770
- backgroundColor?: Color | undefined;
2771
- borderThickness?: number | undefined;
2772
- borderRadius?: number | undefined;
2773
- textColor?: Color | undefined;
2774
- textPadding?: THREE.Vector4Tuple | undefined;
2775
- }
2776
- export class LabelSprite extends THREE.Sprite {
2777
- readonly extraHeightFactor = 1.4;
2778
-
2779
- constructor(parameters: LabelSpriteParameters);
2780
- get sizeAttenuation(): boolean;
2781
- set sizeAttenuation(value: boolean);
2782
- /**
2783
- * @default ''
2784
- */
2785
- get text(): string;
2786
- set text(value: string);
2787
- /**
2788
- * @default 'Roboto, sans-serif'
2789
- */
2790
- get fontFace(): string | FontFace;
2791
- set fontFace(value: string | FontFace);
2792
- /**
2793
- * @default 12
2794
- */
2795
- get fontSize(): number;
2796
- set fontSize(value: number);
2797
- /**
2798
- * @default 2
2799
- */
2800
- get borderThickness(): number;
2801
- set borderThickness(value: number);
2802
- /**
2803
- * @default new Color(0, 0, 0, 1.0)
2804
- */
2805
- get borderColor(): Color;
2806
- set borderColor(value: Color);
2807
- /**
2808
- * @default 1
2809
- */
2810
- get borderRadius(): number;
2811
- set borderRadius(value: number);
2812
- /**
2813
- * @default new Color(1.0, 1.0, 1.0, 1.0)
2814
- */
2815
- get backgroundColor(): Color;
2816
- set backgroundColor(value: Color);
2817
- /**
2818
- * @default new Color(0, 0, 0, 1.0)
2819
- */
2820
- get textColor(): Color;
2821
- set textColor(value: Color);
2822
- /**
2823
- * Label text padding: left, top, right, bottom
2824
- * @default [0, 0, 0, 0]
2825
- */
2826
- get textPadding(): THREE.Vector4Tuple;
2827
- set textPadding(value: THREE.Vector4Tuple);
2828
- dispose(): void;
2829
- }
2830
2816
  export interface IWindowStyle {
2831
2817
  width: string;
2832
2818
  height: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pilotdev/pilot-web-3d",
3
- "version": "23.0.6-alpha.1",
3
+ "version": "23.0.6-alpha.2",
4
4
  "description": "TypeScript definitions for ASCON PilotWeb3D component",
5
5
  "main": "",
6
6
  "types": "index.d.ts",