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

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 (3) hide show
  1. package/index.d.ts +504 -88
  2. package/package.json +3 -3
  3. package/.script.py +0 -15
package/index.d.ts CHANGED
@@ -1,5 +1,15 @@
1
1
  /// <reference types="@types/three" />
2
2
  declare namespace PilotWeb3D {
3
+ export class InitializerOptions {
4
+ libList?: string[];
5
+ language?: string;
6
+ }
7
+ export class Localization {
8
+ static initialize(options: any): Promise<void>;
9
+ static translate(stringToTrans: string): string;
10
+ static setLanguage(language: string): Promise<void>;
11
+ static extendLocalization(locales: any): boolean;
12
+ }
3
13
  export class LoadingSpinner {
4
14
  addToDOM(container: HTMLElement): void;
5
15
  removeFromDOM(container: HTMLElement): void;
@@ -13,7 +23,7 @@ export const theExtensionManager: ExtensionManager;
13
23
  export class ExtensionLoader {
14
24
  loadExtension(extensionId: string): Promise<ExtensionBase>;
15
25
  unloadExtension(extensionId: string): Promise<boolean>;
16
- getExtensions(): ExtensionBase[];
26
+ getExtensions(): string[];
17
27
  }
18
28
  export interface ILayerManager {
19
29
  createLayer(name: string): ILayer;
@@ -74,44 +84,59 @@ export class InMemorySettingsStorage implements ISettingsStorage {
74
84
  getKeys(): string[];
75
85
  }
76
86
  export interface ISettings {
77
- changeSetting<T>(name: string, value: T, notify?: boolean): void;
87
+ changeSetting<T>(name: string, value: T, notify?: boolean, providedData?: any): void;
78
88
  getSettingValue<T>(name: string): T;
79
89
  }
80
-
81
90
  export class BaseSettingsNames {
82
91
  static TOOLBAR: string;
92
+ static TOOLBAR_DIRECTION: string;
93
+ static TOOLBAR_CONTENT: string;
94
+ static THEME: string;
83
95
  }
84
96
  export class SettingChangedEvent extends Event {
85
97
  name: string;
86
98
  oldValue: any;
87
99
  newValue: any;
100
+ providedData: any;
88
101
  }
89
102
  export abstract class SettingsBase implements ISettings {
90
103
  protected _eventDispatcher: IEventsDispatcher;
91
104
  protected _storage: ISettingsStorage;
92
- changeSetting<T>(name: string, value: T, notify?: boolean): void;
105
+ changeSetting<T>(name: string, value: T, notify?: boolean, providedData?: any): void;
93
106
  getSettingValue<T>(name: string): T;
94
107
  protected abstract getKeyWithPrefix(key: string): string;
95
108
  }
109
+ export enum SettingsTheme {
110
+ LIGHT_THEME = "ascn-light",
111
+ DARK_THEME = "ascn-dark"
112
+ }
113
+ export const defaultThemeAppearance: string;
96
114
  export enum ToolbarDirection {
97
- TOP_FIXED = "ascn-toolbar-fixed-top",
98
- TOP_FLUENT = "ascn-toolbar-top",
99
- BOTTOM_FIXED = "ascn-toolbar-fixed-bottom",
100
- BOTTOM_FLUENT = "ascn-toolbar-bottom"
115
+ TOP_FIXED = "ascn-toolbar-direction-fixed-top",
116
+ TOP_FLUENT = "ascn-toolbar-direction-top",
117
+ BOTTOM_FIXED = "ascn-toolbar-direction-fixed-bottom",
118
+ BOTTOM_FLUENT = "ascn-toolbar-direction-bottom"
101
119
  }
102
120
  export enum ToolbarContent {
103
121
  CENTER = "ascn-toolbar-content-center",
104
122
  START = "ascn-toolbar-content-start",
105
123
  END = "ascn-toolbar-content-end"
106
124
  }
125
+ export interface ToolbarOptions {
126
+ height: number;
127
+ direction: ToolbarDirection;
128
+ }
107
129
  export interface ToolbarStyle {
108
130
  direction?: ToolbarDirection;
109
131
  content?: ToolbarContent;
110
132
  }
133
+ export const defaultToolbarAppearance: ToolbarStyle;
111
134
  export type ViewerSettings = Record<string, any>;
112
135
  export class ViewerConfiguration {
136
+ settingsPrefix: string;
113
137
  appearance: ViewerSettings;
114
138
  createConfiguration(configuration: ViewerSettings, origin: ViewerSettings): void;
139
+ changeTheme(newTheme: string): void;
115
140
  }
116
141
  export type ErrorCallback = (message: string) => void;
117
142
  export type SuccessCallback = (modelId: any) => void;
@@ -126,11 +151,12 @@ export abstract class ViewerBase {
126
151
  protected _loadingSpinner: LoadingSpinner;
127
152
  protected _documentType: DocumentType;
128
153
  protected _configuration: ViewerConfiguration;
129
- container: HTMLElement;
130
- layerManagers: Map<number, ILayerManager>;
131
- extensionsLoader: ExtensionLoader;
154
+ readonly container: HTMLElement;
155
+ readonly layerManagers: Map<number, ILayerManager>;
156
+ readonly extensionsLoader: ExtensionLoader;
132
157
  abstract settings: ISettings;
133
158
  abstract events: IEventsDispatcher;
159
+ get rootContainer(): HTMLElement;
134
160
  getConfiguration(): ViewerConfiguration;
135
161
  /**
136
162
  *
@@ -143,6 +169,7 @@ export abstract class ViewerBase {
143
169
  finish(): void;
144
170
  onPostExtensionLoad(extension: ExtensionBase): void;
145
171
  protected loadExtensions(): void;
172
+ protected setThemeFromSettings(): void;
146
173
  }
147
174
  export class Control {
148
175
  container: HTMLElement;
@@ -158,6 +185,8 @@ export class Toolbar extends Control {
158
185
  constructor(id: string, toolbarContainer: HTMLElement, options?: ToolbarStyle);
159
186
  addControl(control: Control): void;
160
187
  removeControl(id: string): void;
188
+ changeToolbarPosition(direction: string): void;
189
+ changeToolbarContent(content: string): void;
161
190
  }
162
191
  export class ExtensionBase {
163
192
  protected _viewer: ViewerBase;
@@ -220,6 +249,7 @@ export class Color {
220
249
  alpha(): number;
221
250
  fromArray(array: ArrayLike<number>, offset?: number): Color;
222
251
  toArray(array: Array<number>, offset?: number): Array<number>;
252
+ clone(): Color;
223
253
  }
224
254
  export abstract class ViewObject extends THREE.Object3D {
225
255
  protected _isDisposed: boolean;
@@ -289,79 +319,297 @@ export abstract class ViewObject extends THREE.Object3D {
289
319
  */
290
320
  protected riseOnUpdated(updateType?: UpdateType, object?: THREE.Object3D): void;
291
321
  }
292
- export class MeshLine extends THREE.BufferGeometry {
293
- isMeshLine: boolean;
294
- widthCallback: (t: number) => number;
295
- positions: number[];
296
- previous: number[];
297
- next: number[];
298
- side: number[];
299
- width: number[];
300
- indices_array: number[];
301
- uvs: number[];
302
- counters: number[];
303
- _attributes: any;
304
- get geometry(): THREE.BufferGeometry;
305
- setPoints(points: THREE.Vector3[], widthCallback: (t: number) => number): void;
306
- setPointsArray(points: Float32Array, widthCallback: (t: number) => number): void;
307
- raycast(raycaster: THREE.Raycaster, intersects: THREE.Intersection[], lineWidth?: number, matrixWorld?: THREE.Matrix4): void;
308
- /**
309
- * Fast method to advance the line by one position. The oldest position is removed.
310
- * @param position
311
- */
312
- advance(position: THREE.Vector3): void;
313
- computeBoundingBox(): void;
314
- computeBoundingSphere(): void;
322
+ export abstract class CustomMaterial extends THREE.ShaderMaterial {
323
+
324
+ constructor();
325
+ copy(source: CustomMaterial): this;
326
+ protected customProgramCacheKeyCallback(): string;
327
+ protected onBeforeRender(renderer: THREE.WebGLRenderer, scene: THREE.Scene, camera: THREE.Camera, geometry: THREE.BufferGeometry, material: THREE.Material, group: THREE.Group): void;
328
+ protected onBeforeCompileCallback(shader: THREE.Shader): void;
329
+ protected refreshTransformUniform(map: THREE.Texture, uniform: THREE.IUniform): void;
330
+ }
331
+ export interface CustomMeshLambertMaterialParameters extends THREE.ShaderMaterialParameters, THREE.MeshLambertMaterialParameters {
332
+ instancing?: boolean | undefined;
333
+ }
334
+ export class CustomMeshLambertMaterial extends CustomMaterial {
335
+ type: string;
336
+
337
+ constructor(parameters?: CustomMeshLambertMaterialParameters);
338
+ /**
339
+ * @default false
340
+ */
341
+ get instancing(): boolean;
342
+ set instancing(value: boolean);
343
+ /**
344
+ * @default new THREE.Color( 0xffffff )
345
+ */
346
+ color: THREE.Color;
347
+ /**
348
+ * @default null
349
+ */
350
+ bumpMap: THREE.Texture | null;
351
+ /**
352
+ * @default 1
353
+ */
354
+ bumpScale: number;
355
+ /**
356
+ * @default null
357
+ */
358
+ displacementMap: THREE.Texture | null;
359
+ /**
360
+ * @default 1
361
+ */
362
+ displacementScale: number;
363
+ /**
364
+ * @default 0
365
+ */
366
+ displacementBias: number;
367
+ /**
368
+ * @default new THREE.Color( 0x000000 )
369
+ */
370
+ emissive: THREE.Color;
371
+ /**
372
+ * @default 1
373
+ */
374
+ emissiveIntensity: number;
375
+ /**
376
+ * @default null
377
+ */
378
+ emissiveMap: THREE.Texture | null;
379
+ /**
380
+ * @default false
381
+ */
382
+ flatShading: boolean;
383
+ /**
384
+ * @default null
385
+ */
386
+ map: THREE.Texture | null;
387
+ /**
388
+ * @default null
389
+ */
390
+ lightMap: THREE.Texture | null;
391
+ /**
392
+ * @default 1
393
+ */
394
+ lightMapIntensity: number;
395
+ /**
396
+ * @default null
397
+ */
398
+ normalMap: THREE.Texture | null;
399
+ normalMapType: THREE.NormalMapTypes;
400
+ /**
401
+ * @default new THREE.Vector2( 1, 1 )
402
+ */
403
+ normalScale: THREE.Vector2;
404
+ /**
405
+ * @default null
406
+ */
407
+ aoMap: THREE.Texture | null;
408
+ /**
409
+ * @default 1
410
+ */
411
+ aoMapIntensity: number;
412
+ /**
413
+ * @default null
414
+ */
415
+ specularMap: THREE.Texture | null;
416
+ /**
417
+ * @default null
418
+ */
419
+ alphaMap: THREE.Texture | null;
420
+ /**
421
+ * @default null
422
+ */
423
+ envMap: THREE.Texture | null;
424
+ /**
425
+ * @default THREE.MultiplyOperation
426
+ */
427
+ combine: THREE.Combine;
428
+ /**
429
+ * @default 1
430
+ */
431
+ reflectivity: number;
432
+ /**
433
+ * @default 0.98
434
+ */
435
+ refractionRatio: number;
436
+ /**
437
+ * @default false
438
+ */
439
+ wireframe: boolean;
440
+ /**
441
+ * @default 1
442
+ */
443
+ wireframeLinewidth: number;
444
+ /**
445
+ * @default 'round'
446
+ */
447
+ wireframeLinecap: string;
448
+ /**
449
+ * @default 'round'
450
+ */
451
+ wireframeLinejoin: string;
452
+ /**
453
+ * Whether the material is affected by fog. Default is true.
454
+ * @default fog
455
+ */
456
+ fog: boolean;
457
+ protected refreshUniformsCommon(uniforms: {
458
+ [uniform: string]: THREE.IUniform;
459
+ }, material: CustomMeshLambertMaterial, renderer: THREE.WebGLRenderer): void;
460
+ protected onBeforeRender(renderer: THREE.WebGLRenderer, scene: THREE.Scene, camera: THREE.Camera, geometry: THREE.BufferGeometry, material: THREE.Material, group: THREE.Group): void;
461
+ copy(source: CustomMeshLambertMaterial): this;
462
+ }
463
+ export interface CustomLineMaterialParameters extends THREE.ShaderMaterialParameters, THREE.LineBasicMaterialParameters {
464
+ instancing?: boolean | undefined;
465
+ }
466
+ export class CustomLineMaterial extends CustomMaterial {
467
+ type: string;
468
+
469
+ constructor(parameters?: CustomLineMaterialParameters);
470
+ /**
471
+ * @default false
472
+ */
473
+ get instancing(): boolean;
474
+ set instancing(value: boolean);
475
+ /**
476
+ * @default 0xffffff
477
+ */
478
+ color: THREE.Color;
479
+ /**
480
+ * Whether the material is affected by fog. Default is true.
481
+ * @default true
482
+ */
483
+ fog: boolean;
484
+ /**
485
+ * @default 1
486
+ */
487
+ linewidth: number;
488
+ /**
489
+ * @default 'round'
490
+ */
491
+ linecap: string;
492
+ /**
493
+ * @default 'round'
494
+ */
495
+ linejoin: string;
496
+ /**
497
+ * @default null
498
+ */
499
+ map: THREE.Texture | null;
500
+ protected refreshUniformsCommon(uniforms: {
501
+ [uniform: string]: THREE.IUniform;
502
+ }, material: CustomLineMaterial, renderer: THREE.WebGLRenderer): void;
503
+ protected onBeforeRender(renderer: THREE.WebGLRenderer, scene: THREE.Scene, camera: THREE.Camera, geometry: THREE.BufferGeometry, material: THREE.Material, group: THREE.Group): void;
504
+ copy(source: CustomLineMaterial): this;
315
505
  }
316
506
  export interface MeshLineMaterialParameters extends THREE.ShaderMaterialParameters {
317
- lineWidth?: number;
318
- map?: THREE.Texture;
319
- useMap?: boolean;
320
- alphaMap?: THREE.Texture;
321
- useAlphaMap?: number;
322
- color?: THREE.ColorRepresentation;
323
- resolution?: THREE.Vector2;
324
- sizeAttenuation?: boolean;
325
- dashArray?: number;
326
- dashOffset?: number;
327
- dashRatio?: number;
328
- useDash?: number;
329
- alphaTest?: number;
330
- repeat?: THREE.Vector2;
331
- }
332
- export class MeshLineMaterial extends THREE.ShaderMaterial {
333
- isMeshLineMaterial: boolean;
507
+ alphaToCoverage?: boolean | undefined;
508
+ color?: THREE.ColorRepresentation | undefined;
509
+ dashed?: boolean | undefined;
510
+ dashScale?: number | undefined;
511
+ dashSize?: number | undefined;
512
+ dashOffset?: number | undefined;
513
+ gapSize?: number | undefined;
514
+ linewidth?: number | undefined;
515
+ resolution?: THREE.Vector2 | undefined;
516
+ wireframe?: boolean | undefined;
517
+ worldUnits?: boolean | undefined;
518
+ }
519
+ export class MeshLineMaterial extends CustomMaterial {
520
+ type: string;
334
521
 
335
522
  constructor(parameters: MeshLineMaterialParameters);
336
- get lineWidth(): number;
337
- set lineWidth(value: number);
338
- get map(): THREE.Texture;
339
- set map(value: THREE.Texture);
340
- get useMap(): number;
341
- set useMap(value: number);
342
- get alphaMap(): THREE.Texture;
343
- set alphaMap(value: THREE.Texture);
344
- get useAlphaMap(): number;
345
- set useAlphaMap(value: number);
346
523
  get color(): THREE.Color;
347
- set color(value: THREE.Color);
348
- get resolution(): THREE.Vector2;
349
- set resolution(value: THREE.Vector2);
350
- get sizeAttenuation(): number;
351
- set sizeAttenuation(value: number);
352
- get dashArray(): number;
353
- set dashArray(value: number);
524
+ set color(value: THREE.ColorRepresentation);
525
+ get worldUnits(): boolean;
526
+ set worldUnits(value: boolean);
527
+ get dashed(): boolean;
528
+ set dashed(value: boolean);
529
+ get dashScale(): number;
530
+ set dashScale(value: number);
531
+ get dashSize(): number;
532
+ set dashSize(value: number);
354
533
  get dashOffset(): number;
355
534
  set dashOffset(value: number);
356
- get dashRatio(): number;
357
- set dashRatio(value: number);
358
- get useDash(): number;
359
- set useDash(value: number);
360
- get repeat(): THREE.Vector2;
361
- set repeat(value: THREE.Vector2);
362
- copy(source: MeshLineMaterial): this;
363
- clone(): this;
364
- dispose(): void;
535
+ get gapSize(): number;
536
+ set gapSize(value: number);
537
+ get resolution(): THREE.Vector2;
538
+ set resolution(value: THREE.Vector2);
539
+ onBeforeRender(renderer: THREE.WebGLRenderer, scene: THREE.Scene, camera: THREE.Camera, geometry: THREE.BufferGeometry, material: THREE.Material, group: THREE.Group): void;
540
+ }
541
+ export interface CustomPointMaterialParameters extends THREE.ShaderMaterialParameters, THREE.PointsMaterialParameters {
542
+ }
543
+ export class CustomPointMaterial extends CustomMaterial {
544
+ type: string;
545
+
546
+ constructor(parameters?: CustomPointMaterialParameters);
547
+ /**
548
+ * @default new THREE.Color( 0xffffff )
549
+ */
550
+ color: THREE.Color;
551
+ /**
552
+ * @default null
553
+ */
554
+ map: THREE.Texture | null;
555
+ /**
556
+ * @default null
557
+ */
558
+ alphaMap: THREE.Texture | null;
559
+ /**
560
+ * @default 1
561
+ */
562
+ size: number;
563
+ /**
564
+ * @default true
565
+ */
566
+ sizeAttenuation: boolean;
567
+ /**
568
+ * Whether the material is affected by fog. Default is true.
569
+ * @default fog
570
+ */
571
+ fog: boolean;
572
+ protected refreshUniformsCommon(uniforms: {
573
+ [uniform: string]: THREE.IUniform;
574
+ }, material: CustomPointMaterial, renderer: THREE.WebGLRenderer): void;
575
+ protected onBeforeRender(renderer: THREE.WebGLRenderer, scene: THREE.Scene, camera: THREE.Camera, geometry: THREE.BufferGeometry, material: THREE.Material, group: THREE.Group): void;
576
+ copy(source: CustomPointMaterial): this;
577
+ }
578
+ export class MeshLineGeometry extends THREE.InstancedBufferGeometry {
579
+ type: string;
580
+ instanceStart: THREE.BufferAttribute;
581
+ instanceEnd: THREE.BufferAttribute;
582
+ instanceColorStart: THREE.BufferAttribute;
583
+ instanceColorEnd: THREE.BufferAttribute;
584
+
585
+ constructor();
586
+ applyMatrix4(matrix: THREE.Matrix4): this;
587
+ updatePoint(index: number, point: THREE.Vector3): void;
588
+ updateColor(index: number, color: THREE.Color): void;
589
+ setPoints(points: THREE.Vector3[]): this;
590
+ setPositions(array: ArrayLike<number>): this;
591
+ setColors(array: ArrayLike<number>): this;
592
+ computeLineDistances(): this;
593
+ toBufferGeometry(): THREE.BufferGeometry;
594
+ toWireframeGeometry(): THREE.BufferGeometry;
595
+ fromWireframeGeometry(geometry: THREE.WireframeGeometry): this;
596
+ fromEdgesGeometry(geometry: THREE.EdgesGeometry): this;
597
+ fromMesh(mesh: THREE.Mesh): this;
598
+ fromLineSegments(lineSegments: THREE.LineSegments): this;
599
+ computeBoundingBox(): void;
600
+ computeBoundingSphere(): void;
601
+ }
602
+ export class MeshLine extends THREE.Mesh {
603
+ type: string;
604
+ material: MeshLineMaterial;
605
+ geometry: MeshLineGeometry;
606
+
607
+ constructor(geometry?: MeshLineGeometry, material?: MeshLineMaterial);
608
+ raycast(raycaster: THREE.Raycaster, intersects: THREE.Intersection[]): void;
609
+ }
610
+ export class TPair<TKey, TValue> {
611
+ get key(): TKey;
612
+ get value(): TValue;
365
613
  }
366
614
  export type Point3 = {
367
615
  x: number;
@@ -470,6 +718,31 @@ export interface IEventSigner<Data> {
470
718
  allowMissing?: boolean;
471
719
  }): boolean;
472
720
  }
721
+
722
+ export interface EventEmitter<Data> {
723
+ emit(data?: Data, options?: object): void;
724
+ }
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;
731
+ }
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;
745
+ }
473
746
  export interface IModelIntersectionChecker {
474
747
  /** Gets the center of the model*/
475
748
  get modelCenter(): THREE.Vector3;
@@ -482,13 +755,15 @@ export interface IModelIntersectionChecker {
482
755
  /**
483
756
  * Gets {@link THREE.Intersection} between a casted {@link ray} and model object.
484
757
  * @param ray
758
+ * @param camera
485
759
  */
486
- getIntersectionByRay(ray: THREE.Ray): THREE.Intersection<THREE.Object3D> | undefined;
760
+ getIntersectionByRay(ray: THREE.Ray, camera: THREE.Camera): THREE.Intersection<THREE.Object3D> | undefined;
487
761
  /**
488
762
  * Gets ID of the model object intersected by {@link ray}
489
763
  * @param ray
764
+ * @param camera
490
765
  */
491
- getIntersectionIDByRay(ray: THREE.Ray): {
766
+ getIntersectionIDByRay(ray: THREE.Ray, camera: THREE.Camera): {
492
767
  modelId: string;
493
768
  guid: string;
494
769
  } | undefined;
@@ -519,10 +794,6 @@ export interface IModelIntersectionChecker {
519
794
  guid: string;
520
795
  }[];
521
796
  }
522
- export class TPair<TKey, TValue> {
523
- get key(): TKey;
524
- get value(): TValue;
525
- }
526
797
  export class RenderViewSettings {
527
798
  telemetry?: boolean;
528
799
  hideEdgesWhenNavigation?: boolean;
@@ -611,6 +882,10 @@ export interface IUserScene {
611
882
  get intersectionChecker(): IModelIntersectionChecker | null;
612
883
  /** Gets the THREE.Object3D representation of the scene */
613
884
  get threeObjectRepresentation(): THREE.Object3D | null;
885
+ /** Sets clipping enable */
886
+ set clippingEnable(value: boolean);
887
+ /** Indicates whether the scene should be clipped */
888
+ get clippingEnable(): boolean;
614
889
  /** Place objects on scene */
615
890
  addRange(objects: THREE.Object3D[]): void;
616
891
  /** Update objects on scene */
@@ -634,6 +909,7 @@ export interface IUserScene {
634
909
  }
635
910
  export interface I3DRenderer {
636
911
  clear(color?: boolean, depth?: boolean, stencil?: boolean): void;
912
+ setClearColor(color: ColorRepresentation, alpha?: number): void;
637
913
  clearDepth(): void;
638
914
  render(scene: THREE.Object3D, camera: THREE.Camera): void;
639
915
  getSize(target: THREE.Vector2): THREE.Vector2;
@@ -673,6 +949,17 @@ export interface IRenderViewer3D {
673
949
  * Gets all render scenes.
674
950
  */
675
951
  getScenes(): IUserScene[];
952
+ /**
953
+ *
954
+ * @param name
955
+ * @param isClippable
956
+ */
957
+ addScene(name: string, isClippable: boolean): IUserScene;
958
+ /**
959
+ *
960
+ * @param scene
961
+ */
962
+ removeScene(scene: IUserScene): void;
676
963
  }
677
964
  export class ModelElement {
678
965
  get id(): string;
@@ -682,7 +969,8 @@ export class ModelElement {
682
969
  get name(): string;
683
970
  get children(): ModelElement[];
684
971
  get hasGeometry(): boolean;
685
- get boundingBoxCenter(): Point3;
972
+ get viewObject(): ViewObject | undefined;
973
+ get boundingBoxCenter(): Point3 | null;
686
974
  }
687
975
  export class ModelElementTree {
688
976
  /**
@@ -2315,7 +2603,7 @@ export class Viewer3D extends ViewerBase {
2315
2603
  settings: Readonly<ISettings>;
2316
2604
  get navigation(): INavigation;
2317
2605
  events: Readonly<IEventsDispatcher>;
2318
- baseConfiguration(): import("@core/index").ViewerConfiguration;
2606
+ getConfiguration(): Viewer3DConfiguration;
2319
2607
  start(): Promise<number>;
2320
2608
  finish(): void;
2321
2609
  /**
@@ -2345,6 +2633,7 @@ export class Viewer3D extends ViewerBase {
2345
2633
  * @returns Blob object representing render image.
2346
2634
  */
2347
2635
  makeScreenshot(mimeType?: string, quality?: number): Promise<Blob>;
2636
+ setThemeFromSettings(): void;
2348
2637
  }
2349
2638
  export class GuiViewer3D extends Viewer3D {
2350
2639
  loadModelPart(buffer: ArrayBuffer, options: ModelLoadingOptions, onSuccessCallback: SuccessCallback, onErrorCallback: ErrorCallback): void;
@@ -2472,6 +2761,123 @@ export class GizmoBuilder {
2472
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;
2473
2762
  static buildScaleAxis(axisDir: THREE.Vector3, handleBaseMatrial?: THREE.Material, handleHoveredMaterial?: THREE.Material, handleSelectedMaterial?: THREE.Material): GizmoAxis;
2474
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
+ export interface IWindowStyle {
2831
+ width: string;
2832
+ height: string;
2833
+ left: string;
2834
+ right: string;
2835
+ top: string;
2836
+ }
2837
+ export interface IWindowStateOptions {
2838
+ saveKey: string;
2839
+ restoreWindowSize: boolean;
2840
+ }
2841
+ export class WindowStater {
2842
+ get windowStylesState(): IWindowStyle;
2843
+ get windowOptionsState(): IWindowStateOptions;
2844
+ restore(): void;
2845
+ saveWindowState(): void;
2846
+ }
2847
+ export class Resizer {
2848
+
2849
+ constructor(resizableContainer: HTMLElement, containerToRestriction: HTMLElement, elementAnchor?: HTMLElement, windowStater?: WindowStater);
2850
+ get windowState(): IWindowStyle | null;
2851
+ }
2852
+ export class Dragger {
2853
+
2854
+ constructor(allowedDraggableElement: HTMLElement, draggableContainer: HTMLElement, containerToRestriction: HTMLElement, windowStater?: WindowStater);
2855
+ get windowState(): IWindowStyle | null;
2856
+ }
2857
+ export namespace Viewer3DIcons {
2858
+ const VIEWER_SETTINGS_ICON: string;
2859
+ const VIEWER_MODEL_BROWSER_ICON: string;
2860
+ const VIEWER_FULL_SCREEN_ICON: string;
2861
+ const VIEWER_COLLAPSE_ICON: string;
2862
+ const VIEWER_ELEMENT_PROPERTIES_ICON: string;
2863
+ const VIEWER_ADD_CLIPPING_PLANE_ICON: string;
2864
+ const VIEWER_CLIPPING_FLIP_ICON: string;
2865
+ const VIEWER_DELETE_CLIPPING_PLANE_ICON: string;
2866
+ const VIEWER_CLIPPING_CUBE_ICON: string;
2867
+ const VIEWER_DISABLED_DELETE_CLIPPING_PLANE_ICON: string;
2868
+ const VIEWER_DISABLED_CLIPPING_FLIP_ICON: string;
2869
+ const VIEWER_ADD_REMARK_ICON: string;
2870
+ }
2871
+ export namespace ViewerGeneralIcons {
2872
+ const ZOOM_IN: string;
2873
+ const ZOOM_OUT: string;
2874
+ const CLOSE: string;
2875
+ const STRETCH_WINDOW: string;
2876
+ const EXPAND_TREE: string;
2877
+ const COLLAPSE_TREE: string;
2878
+ const ARROW_DROP_DOWN: string;
2879
+ const ARROW_DROP_RIGHT: string;
2880
+ }
2475
2881
  export class Button extends Control {
2476
2882
 
2477
2883
  constructor(id: string);
@@ -2479,6 +2885,7 @@ export class Button extends Control {
2479
2885
  setState(state: Button.State): boolean;
2480
2886
  getState(): Button.State;
2481
2887
  setIcon(iconClassName: string): void;
2888
+ setFromSvgTemlate(template: string): void;
2482
2889
  /**
2483
2890
  * Override this method to be notified when the user clicks on the button.
2484
2891
  * @param {MouseEvent} event
@@ -2514,14 +2921,23 @@ interface ElementClass {
2514
2921
  export class Dialog extends Control {
2515
2922
  responseDialog: (state?: boolean) => void;
2516
2923
 
2517
- constructor(id: string, panelToAttach: HTMLElement, contentPassed?: HTMLElement, header?: HTMLElement, classNames?: ElementClass);
2924
+ constructor(id: string, panelToAttach: HTMLElement);
2518
2925
  get dialog(): HTMLElement;
2926
+ get dialogContent(): HTMLElement;
2927
+ get resizable(): boolean;
2928
+ setDialogContent(value: HTMLElement): Dialog;
2929
+ setHeader(value: HTMLElement): Dialog;
2930
+ setCaption(value: string): Dialog;
2931
+ setIcon(iconClassName: string): Dialog;
2932
+ setFooter(value: HTMLElement): Dialog;
2933
+ setDialogElementClassNames(value: ElementClass): Dialog;
2934
+ setResizable(value: boolean): Dialog;
2935
+ setWindowOptions(value: IWindowStateOptions): Dialog;
2936
+ setDraggable(value: boolean): Dialog;
2519
2937
  openDialog(): HTMLElement;
2520
2938
  destroyDialog(): void;
2521
2939
  isDialogShown(): boolean;
2522
2940
  subscribe(fn: (state: boolean) => void): void;
2523
- addCheckBox(value: boolean, caption: string, id: string, action: (isChecked: boolean) => void): void;
2524
- addComboBox(index: number, caption: string, id: string, values: string[], action: (selectedIndex: number) => void): void;
2525
2941
  }
2526
2942
  export {};
2527
2943
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pilotdev/pilot-web-3d",
3
- "version": "23.0.4",
3
+ "version": "23.0.6-alpha.1",
4
4
  "description": "TypeScript definitions for ASCON PilotWeb3D component",
5
5
  "main": "",
6
6
  "types": "index.d.ts",
@@ -8,8 +8,8 @@
8
8
  "author": "JSC Ascon",
9
9
  "license": "MIT",
10
10
  "typeScriptVersion": "4.9.4",
11
- "devDependencies": {
12
- "@types/three": "0.135.0"
11
+ "dependencies": {
12
+ "@types/three": "0.148.0"
13
13
  },
14
14
  "keywords": [
15
15
  "pilotdev",
package/.script.py DELETED
@@ -1,15 +0,0 @@
1
- text = '''
2
- ; good config
3
- ;@myorg:registry=https://somewhere-else.com/myorg
4
- ;@another:registry=https://somewhere-else.com/another
5
- //registry.npmjs.org/:_authToken=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
6
- ; would apply to both @myorg and @another
7
- ; //somewhere-else.com/:_authToken=MYTOKEN
8
- ; would apply only to @myorg
9
- ;//somewhere-else.com/myorg/:_authToken=MYTOKEN1
10
- ; would apply only to @another
11
- ;//somewhere-else.com/another/:_authToken=MYTOKEN2
12
- '''
13
- file = open("/home/teamcityagent/.BuildAgent/work/3abf6afd0f88818/3d_view/types/.npmrc","w")
14
- file.write(text)
15
- file.close()