@pilotdev/pilot-web-3d 24.0.1 → 24.4.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 +67 -25
  2. package/package.json +1 -1
package/index.d.ts CHANGED
@@ -218,6 +218,7 @@ export namespace Viewer3DIcons {
218
218
  const VIEWER_ADD_REMARK_ICON: string;
219
219
  const VIEWER_MEASUREMENT_EDGE_ICON: string;
220
220
  const VIEWER_MEASUREMENT_PLANE_ICON: string;
221
+ const VIEWER_MEASUREMENT_PERPENDICULAR_ICON: string;
221
222
  const VIEWER_MEASUREMENT_DIMENSION_ICON: string;
222
223
  }
223
224
  export namespace ViewerGeneralIcons {
@@ -355,6 +356,7 @@ export class ExtensionBase {
355
356
  * @returns {string} Returns the name of the extension.
356
357
  */
357
358
  getName(): string;
359
+ isActive(): boolean;
358
360
  addCursorPhantomFromSvg(template: string): void;
359
361
  removeCursorPhantom(): void;
360
362
  onMouseDown(event: MouseEvent): void;
@@ -454,7 +456,7 @@ export abstract class ViewerBase {
454
456
  /**
455
457
  *
456
458
  */
457
- finish(): void;
459
+ finish(): Promise<void>;
458
460
  onPostExtensionLoad(extension: ExtensionBase): void;
459
461
  onExtensionUnloading(extension: ExtensionBase): void;
460
462
  onPostExtensionUnload(extension: ExtensionBase): void;
@@ -538,13 +540,14 @@ export class Checkbox {
538
540
  onChange(value: boolean): void;
539
541
  createElement(): Element;
540
542
  }
541
- interface ISelectItem {
543
+ export interface ISelectItem {
542
544
  text: string;
543
545
  value: string;
544
546
  }
545
547
  export class Select {
546
548
 
547
549
  constructor(id: string, items: ISelectItem[], placeholder: string);
550
+ get items(): ISelectItem[];
548
551
  get select(): HTMLElement;
549
552
  get disabled(): boolean;
550
553
  set disabled(value: boolean);
@@ -552,15 +555,13 @@ export class Select {
552
555
  set selectedIndex(value: number);
553
556
  get placeholder(): string;
554
557
  set placeholder(value: string);
555
- get label(): HTMLElement;
556
- get previousSelectedIndex(): number;
558
+ get label(): HTMLLabelElement;
557
559
  onChange({ index, value }: {
558
560
  index: any;
559
561
  value: any;
560
562
  }): void;
561
563
  update(array: ISelectItem[], selectedIndex?: number): void;
562
564
  }
563
- export {};
564
565
  export class ViewerToolbar extends Toolbar {
565
566
  }
566
567
  interface ElementClass {
@@ -622,6 +623,10 @@ export abstract class SettingsBase implements ISettings {
622
623
  getSettingValue<T>(name: string): T;
623
624
  protected abstract getKeyWithPrefix(key: string): string;
624
625
  }
626
+ export function createSvgElement(svgString: string): HTMLElement;
627
+ export function isString(element: any): boolean;
628
+ export function isSvg(element: string): boolean;
629
+ export function isSvgString(element: any): boolean;
625
630
  export const MouseButtons: {
626
631
  Left: number;
627
632
  Middle: number;
@@ -753,7 +758,7 @@ export interface ICameraControl {
753
758
  * @param iOrientation - camera orientation after zooming (optional)
754
759
  * @param isAnimationEnabled - is animated zoom enabled
755
760
  */
756
- zoomToFit(bb: THREE.Box3, iOrientation?: CameraOrientation, iAnimationEnabled?: boolean): void;
761
+ zoomToFit(boundingBox: THREE.Box3, iOrientation?: CameraOrientation, iAnimationEnabled?: boolean): void;
757
762
  /**
758
763
  * Gets the navigation mode.
759
764
  */
@@ -872,7 +877,7 @@ export interface IIntersectionChecker<TOptions> {
872
877
  */
873
878
  getIntersectionPoint(): THREE.Intersection<THREE.Object3D> | undefined;
874
879
  /**
875
- * Gets {@link THREE.Intersection} between a casted {@link ray} and model object.
880
+ * Gets {@link THREE.Intersection<THREE.Object3D>} between a casted {@link ray} and model object.
876
881
  * @param ray
877
882
  * @param camera
878
883
  * @param options - (optional) intersection check options.
@@ -916,6 +921,20 @@ export interface IIntersectionChecker<TOptions> {
916
921
  modelId: string;
917
922
  guid: string;
918
923
  }[];
924
+ /**
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.
929
+ */
930
+ getAllIntersectionsByRay(ray: THREE.Ray, camera: THREE.Camera, options?: TOptions): THREE.Intersection<THREE.Object3D>[];
931
+ /**
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.
936
+ */
937
+ getAllIntersectionsByNdcPt(ndcPos: THREE.Vector2, camera: THREE.Camera, options?: TOptions): THREE.Intersection<THREE.Object3D>[];
919
938
  }
920
939
  export interface ISceneIntersectionChecker extends IIntersectionChecker<SceneCheckOptions> {
921
940
  /** Gets the bounding box of the scene*/
@@ -1034,6 +1053,7 @@ export interface I3DRenderer {
1034
1053
  render(scene: THREE.Object3D, camera: THREE.Camera): void;
1035
1054
  getSize(target: THREE.Vector2): THREE.Vector2;
1036
1055
  setSize(width: number, height: number, updateStyle?: boolean): void;
1056
+ setPixelRatio(value: number): void;
1037
1057
  setViewport(x: THREE.Vector4 | number, y?: number, width?: number, height?: number): void;
1038
1058
  getViewport(target: THREE.Vector4): THREE.Vector4;
1039
1059
  dispose(): void;
@@ -1048,13 +1068,15 @@ export interface IRenderViewer3D {
1048
1068
  * An object can only be placed on one scene.
1049
1069
  * @param iObj - object to place.
1050
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.
1051
1072
  */
1052
- placeObjectOnScene(iObj: THREE.Object3D, sceneID?: string): Promise<void>;
1073
+ placeObjectOnScene(iObj: THREE.Object3D, sceneID?: string, redraw?: boolean): Promise<void>;
1053
1074
  /**
1054
1075
  * Remove object from scene.
1055
- * @param iObj
1076
+ * @param iObj - object to remove.
1077
+ * @param redraw - (optional) force a redraw of the scene after removing an object. False by default.
1056
1078
  */
1057
- removeObjectFromScene(iObj: THREE.Object3D): Promise<void>;
1079
+ removeObjectFromScene(iObj: THREE.Object3D, redraw?: boolean): Promise<void>;
1058
1080
  /**
1059
1081
  * Set clipping planes for rendering.
1060
1082
  * @param planes - array of clipping planes.
@@ -2972,6 +2994,7 @@ export class DeletionManager {
2972
2994
  * This class describes the coordination model. The coordination model contains parts of the model (aka ModelPart).
2973
2995
  */
2974
2996
  export class Model {
2997
+ readonly eventDispatcher: IEventsDispatcher;
2975
2998
  /**
2976
2999
  * Returns all model parts loaded in the viewer.
2977
3000
  * @returns {ModelPart[]} - An array of visible and hidden model parts
@@ -3123,6 +3146,21 @@ export class Model {
3123
3146
  * @param filter - filter to remove.
3124
3147
  */
3125
3148
  removeDeletionFilter(filter: DeleteEventFilter): void;
3149
+ /**
3150
+ * Set model version.
3151
+ * @param value - specified version of the model.
3152
+ */
3153
+ setModelVersion(value: bigint): void;
3154
+ /**
3155
+ * Get current version of the model.
3156
+ * @returns current model version.
3157
+ */
3158
+ getModelVersion(): bigint;
3159
+ /**
3160
+ * Get list of all model versions.
3161
+ * @returns list of all model versions.
3162
+ */
3163
+ getAllModelVersions(): bigint[];
3126
3164
  }
3127
3165
  export interface INavigation {
3128
3166
  /**
@@ -3150,30 +3188,18 @@ export interface INavigation {
3150
3188
  * Gets navigation area rectangle
3151
3189
  */
3152
3190
  getNavigationArea(): DOMRect;
3153
- /**
3154
- * Sets the camera parameters.
3155
- */
3156
- setCameraParameters(params: CameraParameters): void;
3157
- /**
3158
- * Gets the camera parameters.
3159
- */
3160
- getCameraParameters(): CameraParameters;
3161
3191
  /**
3162
3192
  * Gets the camera control.
3163
3193
  */
3164
3194
  getCameraControl(): ICameraControl;
3165
3195
  /**
3166
- * Gets the Three.js camera.
3167
- */
3168
- getCamera(): THREE.Camera;
3169
- /**
3170
- * Fits camera to objects by IDs.
3196
+ * Fits camera to objects by IDs. It fits the entire model if no ID is provided.
3171
3197
  * @param {string[] | string} elementIds - element or array of elements
3172
3198
  * @param {string | ModelPart} modelPart - the model part id or the model part instance containing the elements.
3173
3199
  * @param {boolean} immediate - true to avoid the default transition.
3174
3200
  * @returns
3175
3201
  */
3176
- fitToView(elementIds: string[] | string, modelPart: string | ModelPart, immediate?: boolean): void;
3202
+ fitToView(elementIds?: string[] | string, modelPart?: string | ModelPart, immediate?: boolean): void;
3177
3203
  /**
3178
3204
  * Sets the camera pivot point.
3179
3205
  */
@@ -3207,7 +3233,7 @@ export class Viewer3D extends ViewerBase {
3207
3233
  get navigation(): INavigation;
3208
3234
  getConfiguration(): Viewer3DConfiguration;
3209
3235
  start(): Promise<number>;
3210
- finish(): void;
3236
+ finish(): Promise<void>;
3211
3237
  /**
3212
3238
  * Loads new model part to the viewer
3213
3239
  * @param buffer
@@ -3216,12 +3242,28 @@ export class Viewer3D extends ViewerBase {
3216
3242
  * @param onErrorCallback
3217
3243
  */
3218
3244
  loadModelPart(data: ArrayBuffer | string, options: ModelLoadingOptions, onSuccessCallback: SuccessCallback, onErrorCallback: ErrorCallback): void;
3245
+ /**
3246
+ * Updates the model part data file
3247
+ * @param data
3248
+ * @param options
3249
+ * @param onSuccessCallback
3250
+ * @param onErrorCallback
3251
+ */
3252
+ updateModelPart(data: ArrayBuffer | string, options: ModelLoadingOptions, onSuccessCallback: SuccessCallback, onErrorCallback: ErrorCallback): void;
3219
3253
  /**
3220
3254
  * unloads model part from the viewer
3221
3255
  * @param modelPart - model part id or model part instance
3222
3256
  */
3223
3257
  unloadModelPart(modelPart?: string | ModelPart): void;
3258
+ /**
3259
+ * Sets virtual origin of the model
3260
+ * @param point \{ x , y , z } coordinates of the virtual origin
3261
+ */
3224
3262
  setVirtualOrigin(point: Point3): Promise<void>;
3263
+ /**
3264
+ * Gets virtual origin of the model
3265
+ * @returns \{ x , y , z } coordinates of the virtual origin
3266
+ */
3225
3267
  getVirtualOrigin(): Point3;
3226
3268
  /**
3227
3269
  * Makes screenshot
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pilotdev/pilot-web-3d",
3
- "version": "24.0.1",
3
+ "version": "24.4.0",
4
4
  "description": "TypeScript definitions for ASCON PilotWeb3D component",
5
5
  "main": "",
6
6
  "types": "index.d.ts",