@pilotdev/pilot-web-3d 24.0.1 → 24.2.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 +55 -5
  2. package/package.json +1 -1
package/index.d.ts CHANGED
@@ -355,6 +355,7 @@ export class ExtensionBase {
355
355
  * @returns {string} Returns the name of the extension.
356
356
  */
357
357
  getName(): string;
358
+ isActive(): boolean;
358
359
  addCursorPhantomFromSvg(template: string): void;
359
360
  removeCursorPhantom(): void;
360
361
  onMouseDown(event: MouseEvent): void;
@@ -538,13 +539,14 @@ export class Checkbox {
538
539
  onChange(value: boolean): void;
539
540
  createElement(): Element;
540
541
  }
541
- interface ISelectItem {
542
+ export interface ISelectItem {
542
543
  text: string;
543
544
  value: string;
544
545
  }
545
546
  export class Select {
546
547
 
547
548
  constructor(id: string, items: ISelectItem[], placeholder: string);
549
+ get items(): ISelectItem[];
548
550
  get select(): HTMLElement;
549
551
  get disabled(): boolean;
550
552
  set disabled(value: boolean);
@@ -552,15 +554,13 @@ export class Select {
552
554
  set selectedIndex(value: number);
553
555
  get placeholder(): string;
554
556
  set placeholder(value: string);
555
- get label(): HTMLElement;
556
- get previousSelectedIndex(): number;
557
+ get label(): HTMLLabelElement;
557
558
  onChange({ index, value }: {
558
559
  index: any;
559
560
  value: any;
560
561
  }): void;
561
562
  update(array: ISelectItem[], selectedIndex?: number): void;
562
563
  }
563
- export {};
564
564
  export class ViewerToolbar extends Toolbar {
565
565
  }
566
566
  interface ElementClass {
@@ -622,6 +622,10 @@ export abstract class SettingsBase implements ISettings {
622
622
  getSettingValue<T>(name: string): T;
623
623
  protected abstract getKeyWithPrefix(key: string): string;
624
624
  }
625
+ export function createSvgElement(svgString: string): HTMLElement;
626
+ export function isString(element: any): boolean;
627
+ export function isSvg(element: string): boolean;
628
+ export function isSvgString(element: any): boolean;
625
629
  export const MouseButtons: {
626
630
  Left: number;
627
631
  Middle: number;
@@ -872,7 +876,7 @@ export interface IIntersectionChecker<TOptions> {
872
876
  */
873
877
  getIntersectionPoint(): THREE.Intersection<THREE.Object3D> | undefined;
874
878
  /**
875
- * Gets {@link THREE.Intersection} between a casted {@link ray} and model object.
879
+ * Gets {@link THREE.Intersection<THREE.Object3D>} between a casted {@link ray} and model object.
876
880
  * @param ray
877
881
  * @param camera
878
882
  * @param options - (optional) intersection check options.
@@ -916,6 +920,20 @@ export interface IIntersectionChecker<TOptions> {
916
920
  modelId: string;
917
921
  guid: string;
918
922
  }[];
923
+ /**
924
+ * Gets all intersections between a ray, casted from {@link camera} to {@link ndcPoint} and model objects.
925
+ * @param ray
926
+ * @param camera
927
+ * @param options - (optional) intersection check options.
928
+ */
929
+ getAllIntersectionsByRay(ray: THREE.Ray, camera: THREE.Camera, options?: TOptions): THREE.Intersection<THREE.Object3D>[];
930
+ /**
931
+ * Gets IDs of the model objects intersected by ray, casted from {@link camera} to {@link ndcPoint}.
932
+ * @param ndcPos
933
+ * @param camera
934
+ * @param options - (optional) intersection check options.
935
+ */
936
+ getAllIntersectionsByNdcPt(ndcPos: THREE.Vector2, camera: THREE.Camera, options?: TOptions): THREE.Intersection<THREE.Object3D>[];
919
937
  }
920
938
  export interface ISceneIntersectionChecker extends IIntersectionChecker<SceneCheckOptions> {
921
939
  /** Gets the bounding box of the scene*/
@@ -2972,6 +2990,7 @@ export class DeletionManager {
2972
2990
  * This class describes the coordination model. The coordination model contains parts of the model (aka ModelPart).
2973
2991
  */
2974
2992
  export class Model {
2993
+ readonly eventDispatcher: IEventsDispatcher;
2975
2994
  /**
2976
2995
  * Returns all model parts loaded in the viewer.
2977
2996
  * @returns {ModelPart[]} - An array of visible and hidden model parts
@@ -3123,6 +3142,21 @@ export class Model {
3123
3142
  * @param filter - filter to remove.
3124
3143
  */
3125
3144
  removeDeletionFilter(filter: DeleteEventFilter): void;
3145
+ /**
3146
+ * Set model version.
3147
+ * @param value - specified version of the model.
3148
+ */
3149
+ setModelVersion(value: bigint): void;
3150
+ /**
3151
+ * Get current version of the model.
3152
+ * @returns current model version.
3153
+ */
3154
+ getModelVersion(): bigint;
3155
+ /**
3156
+ * Get list of all model versions.
3157
+ * @returns list of all model versions.
3158
+ */
3159
+ getAllModelVersions(): bigint[];
3126
3160
  }
3127
3161
  export interface INavigation {
3128
3162
  /**
@@ -3216,12 +3250,28 @@ export class Viewer3D extends ViewerBase {
3216
3250
  * @param onErrorCallback
3217
3251
  */
3218
3252
  loadModelPart(data: ArrayBuffer | string, options: ModelLoadingOptions, onSuccessCallback: SuccessCallback, onErrorCallback: ErrorCallback): void;
3253
+ /**
3254
+ * Updates the model part data file
3255
+ * @param data
3256
+ * @param options
3257
+ * @param onSuccessCallback
3258
+ * @param onErrorCallback
3259
+ */
3260
+ updateModelPart(data: ArrayBuffer | string, options: ModelLoadingOptions, onSuccessCallback: SuccessCallback, onErrorCallback: ErrorCallback): void;
3219
3261
  /**
3220
3262
  * unloads model part from the viewer
3221
3263
  * @param modelPart - model part id or model part instance
3222
3264
  */
3223
3265
  unloadModelPart(modelPart?: string | ModelPart): void;
3266
+ /**
3267
+ * Sets virtual origin of the model
3268
+ * @param point \{ x , y , z } coordinates of the virtual origin
3269
+ */
3224
3270
  setVirtualOrigin(point: Point3): Promise<void>;
3271
+ /**
3272
+ * Gets virtual origin of the model
3273
+ * @returns \{ x , y , z } coordinates of the virtual origin
3274
+ */
3225
3275
  getVirtualOrigin(): Point3;
3226
3276
  /**
3227
3277
  * 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.2.0",
4
4
  "description": "TypeScript definitions for ASCON PilotWeb3D component",
5
5
  "main": "",
6
6
  "types": "index.d.ts",