@pilotdev/pilot-web-3d 25.6.0 → 25.8.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 +196 -91
  2. package/package.json +1 -1
package/index.d.ts CHANGED
@@ -172,7 +172,7 @@ export type StringMap = {
172
172
  };
173
173
  export class Localization {
174
174
  static initialize(options: any): Promise<void>;
175
- static translate<T extends (string | StringMap) = string>(stringToTrans: string): T;
175
+ static translate<T extends (string | StringMap) = string>(stringToTrans: string, options?: {}): T;
176
176
  static setLanguage(language: string): Promise<void>;
177
177
  static extendLocalization(locales: any): boolean;
178
178
  static numberToStr(value: number, digitsAfterPoint?: number): string;
@@ -238,6 +238,7 @@ export namespace Viewer3DIcons {
238
238
  const VIEWER_MEASUREMENT_DIMENSION_ICON: string;
239
239
  const VIEWER_ZOOM_TO_FIT_ICON: string;
240
240
  const VIEWER_RENDER_OPTIONS_ICON: string;
241
+ const VIEWER_CONTEXT_MENU_COPY_PROPS: string;
241
242
  }
242
243
  export namespace ViewerGeneralIcons {
243
244
  const CLOSE: string;
@@ -276,6 +277,7 @@ export class SettingChangedEvent extends Event {
276
277
  providedData: any;
277
278
  }
278
279
  export class LoadingSpinner {
280
+ protected readonly _progress: ProgressBar;
279
281
  set loadingTextKey(value: string);
280
282
  get loadingTextKey(): string;
281
283
  addToDOM(container: HTMLElement): void;
@@ -386,6 +388,7 @@ export class ExtensionBase {
386
388
  onMouseUp(event: MouseEvent): void;
387
389
  onMouseLongTouch(event: MouseEvent): void;
388
390
  onToolbarCreated(toolbar: Toolbar): void;
391
+ onContextMenu(menu: IMenu): void;
389
392
  onTouchStart(event: TouchEvent): void;
390
393
  onTouchEnd(event: TouchEvent): void;
391
394
  }
@@ -498,6 +501,11 @@ export class EventsDispatcherCore implements IEventsDispatcher {
498
501
  removeEvent(type: string): void;
499
502
  clearListeners(): void;
500
503
  }
504
+ export interface IMenuBuilder {
505
+ build(): IControl[];
506
+ removeAllButtons(): IMenuBuilder;
507
+ withButton(controlId: string, icon: string, translationKey: string, command: () => void): IMenuBuilder;
508
+ }
501
509
  export class Button extends Control {
502
510
 
503
511
  constructor(id: string);
@@ -508,6 +516,7 @@ export class Button extends Control {
508
516
  getIsChecked(): boolean;
509
517
  setIcon(iconClassName: string): void;
510
518
  setFromSvgTemlate(template: string): void;
519
+ withoutIcon(): void;
511
520
  /**
512
521
  * Override this method to be notified when the user clicks on the button.
513
522
  * @param {MouseEvent} event
@@ -530,10 +539,15 @@ export namespace Button {
530
539
  CLICK = "click"
531
540
  }
532
541
  }
533
- export class SubMenu implements IMenu {
542
+ export class ContextMenu implements IMenu {
534
543
  readonly controls: IControl[];
535
544
  set selectedIndex(value: number | number[]);
536
545
  get selectedIndex(): number | number[];
546
+ set opened(value: boolean);
547
+ get opened(): boolean;
548
+ set textStubKey(value: string);
549
+ get textStubKey(): string;
550
+ get menuWrapper(): HTMLElement;
537
551
  setEnabled(index: number, value: boolean): void;
538
552
  addControl(control: IControl, index?: number): void;
539
553
  removeControl(index?: number): void;
@@ -544,7 +558,7 @@ export class SubMenu implements IMenu {
544
558
  export class ComboButton extends Control {
545
559
 
546
560
  constructor(id: string, selectedIndex?: number);
547
- get subMenu(): SubMenu;
561
+ get subMenu(): ContextMenu;
548
562
  /**
549
563
  * Override this method to be notified when the user clicks on the button.
550
564
  * @param {MouseEvent} event
@@ -612,6 +626,7 @@ export class Dialog extends Control implements ICloseable {
612
626
  setSvgIcon(template: string): Dialog;
613
627
  setFooter(value: HTMLElement): Dialog;
614
628
  setDialogElementClassNames(value: ElementClass): Dialog;
629
+ setSize(width: number, height: number): Dialog;
615
630
  setResizable(value: boolean): Dialog;
616
631
  setWindowOptions(value: IWindowStateOptions): Dialog;
617
632
  setDraggable(value: boolean): Dialog;
@@ -659,6 +674,9 @@ export function createSvgElement(svgString: string): HTMLElement;
659
674
  export function isString(element: any): boolean;
660
675
  export function isSvg(element: string): boolean;
661
676
  export function isSvgString(element: any): boolean;
677
+ export class GlobalEvents {
678
+ static events: EventsDispatcherCore;
679
+ }
662
680
  export const MouseButtons: {
663
681
  Left: number;
664
682
  Middle: number;
@@ -671,6 +689,17 @@ export class RenderEventTypes {
671
689
  static RENDER_HOVER_EVENT: string;
672
690
  static RENDER_DOUBLE_CLICK_EVENT: string;
673
691
  static RENDER_SELECTION_RESET_EVENT: string;
692
+ static RENDER_RIGHT_CLICK_WITHOUT_MOVEMENT: string;
693
+ static RENDER_UPDATE_CANVAS: string;
694
+ }
695
+ export class RightClickEvent extends Event {
696
+ modelId: string;
697
+ modelElementId: string;
698
+ ctrlKey: boolean;
699
+ intersection?: THREE.Intersection;
700
+ offsetX: number;
701
+ offsetY: number;
702
+ customTarget: HTMLElement;
674
703
  }
675
704
  export class SelectionChangedEvent extends Event {
676
705
  selectedIds: ModelElementIds[];
@@ -692,9 +721,6 @@ export class HoverEvent extends Event {
692
721
 
693
722
  constructor(type: string, modelId: string, modelElementId: string, intersection?: THREE.Intersection);
694
723
  }
695
- export class GlobalEvents {
696
- static events: EventsDispatcherCore;
697
- }
698
724
  export class RenderViewSettings {
699
725
  telemetry?: boolean;
700
726
  hideEdgesWhenNavigation?: boolean;
@@ -705,6 +731,7 @@ export class RenderViewSettings {
705
731
  hideSmallElements?: boolean;
706
732
  smallObjectSize?: number;
707
733
  frustumCulling?: boolean;
734
+ limitedMemory?: boolean;
708
735
  /** Desired render framerate */
709
736
  desiredFramerate?: number;
710
737
  /** Allocated time for rendering operations, excluding scene rendering */
@@ -873,6 +900,8 @@ export class EventTypes extends CoreEventTypes {
873
900
  static RENDER_CLICK_EVENT: string;
874
901
  static RENDER_HOVER_EVENT: string;
875
902
  static RENDER_DOUBLE_CLICK_EVENT: string;
903
+ static RENDER_RIGHT_CLICK_WITHOUT_MOVEMENT: string;
904
+ static RENDER_UPDATE_CANVAS: string;
876
905
  }
877
906
  export class ModelPartEvent extends Event {
878
907
  modelPartId: string;
@@ -900,16 +929,75 @@ export class VisibilityChangedEvent extends Event {
900
929
  export class DeleteEvent extends Event {
901
930
  deletedIds: ModelElementIds[];
902
931
  }
932
+ export class UpdateCanvasEvent extends Event {
933
+ }
903
934
 
904
935
  export enum SelectionMode {
905
936
  Append = 0,
906
937
  Replace = 1
907
938
  }
939
+ export class ElementNode {
940
+ Guid: string;
941
+ ObjectState: IfcNodeState;
942
+ Revision: bigint;
943
+ ParentGuid: string;
944
+ Name: string;
945
+ Type: string;
946
+ RepresentationType: string;
947
+ RepresentationTypeEnum: IfcType[];
948
+ RepresentationStatus: string;
949
+ RepresentationStatusFlag: IfcRepresentationStatus;
950
+ GridObject: GridObject;
951
+ MeshesProperties: Map<string, MeshProperty[]>;
952
+ }
953
+ export enum IfcNodeState {
954
+ Undefined = 0,
955
+ Added = 1,
956
+ Removed = 2,
957
+ AttributesModified = 3,
958
+ AttributesQuantitiesModified = 4,
959
+ PlacementModified = 8,
960
+ PlacementAndAttributesModified = 11,
961
+ PlacementAndAttributesQuantitiesModified = 12
962
+ }
963
+ export enum IfcRepresentationStatus {
964
+ SUCCESS = 0,
965
+ NO_REPRESENTATION = 1,
966
+ IGNORED_IFC_TYPE = 2,
967
+ IFC_PARSING_ERROR = 4,
968
+ SOLID_CREATION_ERROR = 8,
969
+ TESSELATING_ERROR = 16,
970
+ C3D_EXEPTION = 32,
971
+ UNCLOSED_SOLID = 64
972
+ }
973
+ export class MeshProperty {
974
+ meshColor: number;
975
+ meshPlacement: Float64Array;
976
+ }
977
+ export class GridObject {
978
+ gridPlacement: Float64Array;
979
+ gridAxes: GridAxis[];
980
+ }
981
+ export class GridAxis {
982
+ id: number;
983
+ type: AxisType;
984
+ label: string;
985
+ data: Float32Array;
986
+ }
987
+ export enum AxisType {
988
+ LINE = 0,
989
+ CIRCLE = 1,
990
+ ARC = 2
991
+ }
908
992
  export interface ModelElement {
909
993
  get id(): string;
910
994
  get modelPartId(): string;
911
995
  get parent(): ModelElement | undefined;
912
996
  get type(): string;
997
+ get representationType(): string | undefined;
998
+ get representationTypeEnum(): IfcType[] | undefined;
999
+ get representationStatus(): string | undefined;
1000
+ get representationStatusFlag(): IfcRepresentationStatus | undefined;
913
1001
  get name(): string;
914
1002
  get children(): ModelElement[];
915
1003
  get hasGeometry(): boolean;
@@ -936,7 +1024,7 @@ export interface ModelElementTree {
936
1024
  /**
937
1025
  * Gets model element by id
938
1026
  * @param { string } id - model element id
939
- * @returns model element;
1027
+ * @returns model element
940
1028
  */
941
1029
  getElement(id: string): ModelElement | undefined;
942
1030
  /**
@@ -945,6 +1033,11 @@ export interface ModelElementTree {
945
1033
  * @returns {boolean}
946
1034
  */
947
1035
  isViewableElement(element: string | ModelElement): boolean;
1036
+ /**
1037
+ * Gets detached elements of the model part
1038
+ * @returns array of the detached elements
1039
+ */
1040
+ getDetachedElements(): ModelElement[];
948
1041
  /**
949
1042
  * Checks given element is detached from the root element
950
1043
  * @param {string|ModelElement} element - element id or element instance
@@ -1228,6 +1321,89 @@ export type MemoryInfo = {
1228
1321
  bBoxes: number;
1229
1322
  memory: number;
1230
1323
  };
1324
+ export interface MeshPointMaterialParameters extends THREE.ShaderMaterialParameters {
1325
+ sizeAttenuation?: boolean | undefined;
1326
+ discreteClipping?: boolean | undefined;
1327
+ }
1328
+ export class MeshPointMaterial extends CustomMaterial {
1329
+
1330
+ constructor(parameters?: MeshPointMaterialParameters);
1331
+ /**
1332
+ * @default true
1333
+ */
1334
+ get discreteClipping(): boolean;
1335
+ set discreteClipping(value: boolean);
1336
+ get resolution(): THREE.Vector2;
1337
+ /**
1338
+ * @default true
1339
+ */
1340
+ sizeAttenuation: boolean;
1341
+ copy(source: MeshPointMaterial): this;
1342
+ protected refreshUniforms(uniforms: {
1343
+ [uniform: string]: THREE.IUniform;
1344
+ }, material: CustomMaterial, renderer: THREE.WebGLRenderer): void;
1345
+ }
1346
+ export interface MeshPointParamter {
1347
+ point?: THREE.Vector3;
1348
+ color?: Color;
1349
+ size?: number;
1350
+ }
1351
+ export class MeshPoints extends THREE.Mesh<THREE.InstancedBufferGeometry, MeshPointMaterial, ViewObjectEventMap> {
1352
+ geometry: THREE.InstancedBufferGeometry;
1353
+ material: MeshPointMaterial;
1354
+
1355
+ constructor();
1356
+ /**
1357
+ * @default new Color( 1,1,1,1 )
1358
+ */
1359
+ color: Color;
1360
+ /**
1361
+ * @default 1
1362
+ */
1363
+ pointSize: number;
1364
+ /**
1365
+ * @default new THREE.Vector3(0, 0, 0)
1366
+ */
1367
+ point: THREE.Vector3;
1368
+ addPoint(pointParameter?: MeshPointParamter): number;
1369
+ updatePoint(index: number, pointParameter: MeshPointParamter): void;
1370
+ removePoint(index: number): this;
1371
+ updateAttributes(): void;
1372
+ dispose(): void;
1373
+ raycast(raycaster: THREE.Raycaster, intersects: THREE.Intersection[]): void;
1374
+ }
1375
+ export class MeshLineGeometry extends THREE.InstancedBufferGeometry {
1376
+ type: string;
1377
+ instanceStart: THREE.BufferAttribute;
1378
+ instanceEnd: THREE.BufferAttribute;
1379
+ instanceColorStart: THREE.BufferAttribute;
1380
+ instanceColorEnd: THREE.BufferAttribute;
1381
+
1382
+ constructor();
1383
+ applyMatrix4(matrix: THREE.Matrix4): this;
1384
+ updatePoint(index: number, point: THREE.Vector3): void;
1385
+ updateColor(index: number, color: Color): void;
1386
+ setPoints(points: THREE.Vector3[]): this;
1387
+ setPositions(array: ArrayLike<number>): this;
1388
+ setColors(array: ArrayLike<number>): this;
1389
+ computeLineDistances(): this;
1390
+ toBufferGeometry(): THREE.BufferGeometry;
1391
+ toWireframeGeometry(): THREE.WireframeGeometry;
1392
+ fromWireframeGeometry(geometry: THREE.WireframeGeometry): this;
1393
+ fromEdgesGeometry(geometry: THREE.EdgesGeometry): this;
1394
+ fromMesh(mesh: THREE.Mesh): this;
1395
+ fromLineSegments(lineSegments: THREE.LineSegments): this;
1396
+ computeBoundingBox(): void;
1397
+ computeBoundingSphere(): void;
1398
+ }
1399
+ export class MeshLine extends THREE.Mesh<MeshLineGeometry, MeshLineMaterial, ViewObjectEventMap> {
1400
+ type: string;
1401
+ material: MeshLineMaterial;
1402
+ geometry: MeshLineGeometry;
1403
+
1404
+ constructor(geometry?: MeshLineGeometry, material?: MeshLineMaterial);
1405
+ raycast(raycaster: THREE.Raycaster, intersects: THREE.Intersection[]): void;
1406
+ }
1231
1407
  export interface SceneCheckOptions {
1232
1408
  /** specify whether intersections should be filtered by clippings */
1233
1409
  filterByClipping?: boolean;
@@ -1740,38 +1916,6 @@ export class CustomSpriteMaterial extends CustomMaterial {
1740
1916
  [uniform: string]: THREE.IUniform;
1741
1917
  }, material: CustomMaterial, renderer: THREE.WebGLRenderer): void;
1742
1918
  }
1743
- export class MeshLineGeometry extends THREE.InstancedBufferGeometry {
1744
- type: string;
1745
- instanceStart: THREE.BufferAttribute;
1746
- instanceEnd: THREE.BufferAttribute;
1747
- instanceColorStart: THREE.BufferAttribute;
1748
- instanceColorEnd: THREE.BufferAttribute;
1749
-
1750
- constructor();
1751
- applyMatrix4(matrix: THREE.Matrix4): this;
1752
- updatePoint(index: number, point: THREE.Vector3): void;
1753
- updateColor(index: number, color: Color): void;
1754
- setPoints(points: THREE.Vector3[]): this;
1755
- setPositions(array: ArrayLike<number>): this;
1756
- setColors(array: ArrayLike<number>): this;
1757
- computeLineDistances(): this;
1758
- toBufferGeometry(): THREE.BufferGeometry;
1759
- toWireframeGeometry(): THREE.WireframeGeometry;
1760
- fromWireframeGeometry(geometry: THREE.WireframeGeometry): this;
1761
- fromEdgesGeometry(geometry: THREE.EdgesGeometry): this;
1762
- fromMesh(mesh: THREE.Mesh): this;
1763
- fromLineSegments(lineSegments: THREE.LineSegments): this;
1764
- computeBoundingBox(): void;
1765
- computeBoundingSphere(): void;
1766
- }
1767
- export class MeshLine extends THREE.Mesh<MeshLineGeometry, MeshLineMaterial, ViewObjectEventMap> {
1768
- type: string;
1769
- material: MeshLineMaterial;
1770
- geometry: MeshLineGeometry;
1771
-
1772
- constructor(geometry?: MeshLineGeometry, material?: MeshLineMaterial);
1773
- raycast(raycaster: THREE.Raycaster, intersects: THREE.Intersection[]): void;
1774
- }
1775
1919
  export class CustomSprite extends THREE.Sprite {
1776
1920
  material: CustomSpriteMaterial;
1777
1921
 
@@ -1847,57 +1991,6 @@ export class LabelSprite extends CustomSprite {
1847
1991
  dispose(): void;
1848
1992
  rebuildSpriteMaterial(): void;
1849
1993
  }
1850
- export interface MeshPointMaterialParameters extends THREE.ShaderMaterialParameters {
1851
- sizeAttenuation?: boolean | undefined;
1852
- discreteClipping?: boolean | undefined;
1853
- }
1854
- export class MeshPointMaterial extends CustomMaterial {
1855
-
1856
- constructor(parameters?: MeshPointMaterialParameters);
1857
- /**
1858
- * @default true
1859
- */
1860
- get discreteClipping(): boolean;
1861
- set discreteClipping(value: boolean);
1862
- get resolution(): THREE.Vector2;
1863
- /**
1864
- * @default true
1865
- */
1866
- sizeAttenuation: boolean;
1867
- copy(source: MeshPointMaterial): this;
1868
- protected refreshUniforms(uniforms: {
1869
- [uniform: string]: THREE.IUniform;
1870
- }, material: CustomMaterial, renderer: THREE.WebGLRenderer): void;
1871
- }
1872
- export interface MeshPointParamter {
1873
- point?: THREE.Vector3;
1874
- color?: Color;
1875
- size?: number;
1876
- }
1877
- export class MeshPoints extends THREE.Mesh<THREE.InstancedBufferGeometry, MeshPointMaterial, ViewObjectEventMap> {
1878
- geometry: THREE.InstancedBufferGeometry;
1879
- material: MeshPointMaterial;
1880
-
1881
- constructor();
1882
- /**
1883
- * @default new Color( 1,1,1,1 )
1884
- */
1885
- color: Color;
1886
- /**
1887
- * @default 1
1888
- */
1889
- pointSize: number;
1890
- /**
1891
- * @default new THREE.Vector3(0, 0, 0)
1892
- */
1893
- point: THREE.Vector3;
1894
- addPoint(pointParameter?: MeshPointParamter): number;
1895
- updatePoint(index: number, pointParameter: MeshPointParamter): void;
1896
- removePoint(index: number): this;
1897
- updateAttributes(): void;
1898
- dispose(): void;
1899
- raycast(raycaster: THREE.Raycaster, intersects: THREE.Intersection[]): void;
1900
- }
1901
1994
  export interface ModelPart {
1902
1995
  get id(): string;
1903
1996
  get elementTree(): ModelElementTree;
@@ -3164,6 +3257,7 @@ export class SettingsNames {
3164
3257
  static HIDE_SMALL_ELEMENTS: string;
3165
3258
  static SMALL_ELEMENT_SIZE: string;
3166
3259
  static FRUSTUM_CULLING: string;
3260
+ static LIMITED_MEMORY: string;
3167
3261
  static LABEL_LINE_LENGTH: string;
3168
3262
  static HIDE_EDGES_WHEN_NAVIGATING: string;
3169
3263
  static DISPLAY_MODE: string;
@@ -3192,6 +3286,16 @@ export class Viewer3DConfiguration extends ViewerConfiguration {
3192
3286
  constructor(appearance?: ViewerSettings, render?: ViewerSettings);
3193
3287
  }
3194
3288
  export const defaultViewer3DSettings: ViewerSettings;
3289
+ export class BimProxyTypes {
3290
+ static BIM_OTHERS_NODE: string;
3291
+ static BIM_OTHER_3D_MODEL_TYPE: string;
3292
+ static BIM_IFC_COLLISION: string;
3293
+ static BIM_POINT_CLOUD: string;
3294
+ }
3295
+ export class BimOther3DModelNames {
3296
+ static getNameByExtension(extension: string): string | undefined;
3297
+ static typeNameExists(typeName: string): boolean;
3298
+ }
3195
3299
  export class ModelLoadingOptions {
3196
3300
  guid: string;
3197
3301
  isConsolidatedModel?: boolean;
@@ -3551,11 +3655,12 @@ export class Viewer3D extends ViewerBase {
3551
3655
  */
3552
3656
  makeScreenshot(mimeType?: string, quality?: number): Promise<Blob>;
3553
3657
  setThemeFromSettings(): void;
3658
+ protected createUI(): void;
3554
3659
  }
3555
3660
  export class GuiViewer3D extends Viewer3D {
3556
- loadModelPart(buffer: ArrayBuffer | string | Blob, options: ModelLoadingOptions, onSuccessCallback?: SuccessCallback, onErrorCallback?: ErrorCallback): Promise<void>;
3557
3661
  getToolbar(): ViewerToolbar;
3558
3662
  onPostExtensionLoad(extension: ExtensionBase): void;
3663
+ protected createUI(): void;
3559
3664
  protected getToolbarHeight(): number;
3560
3665
  }
3561
3666
  export function CreateViewer(container: HTMLElement, configuration?: Viewer3DConfiguration): GuiViewer3D;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pilotdev/pilot-web-3d",
3
- "version": "25.6.0",
3
+ "version": "25.8.0",
4
4
  "description": "TypeScript definitions for ASCON PilotWeb3D component",
5
5
  "main": "",
6
6
  "types": "index.d.ts",