@pilotdev/pilot-web-3d 23.0.5 → 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.
- package/index.d.ts +86 -4
- package/package.json +2 -2
package/index.d.ts
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
/// <reference types="@types/three" />
|
|
2
2
|
declare namespace PilotWeb3D {
|
|
3
|
+
export class InitializerOptions {
|
|
4
|
+
libList?: string[];
|
|
5
|
+
language?: string;
|
|
6
|
+
}
|
|
3
7
|
export class Localization {
|
|
4
8
|
static initialize(options: any): Promise<void>;
|
|
5
9
|
static translate(stringToTrans: string): string;
|
|
@@ -83,11 +87,11 @@ export interface ISettings {
|
|
|
83
87
|
changeSetting<T>(name: string, value: T, notify?: boolean, providedData?: any): void;
|
|
84
88
|
getSettingValue<T>(name: string): T;
|
|
85
89
|
}
|
|
86
|
-
|
|
87
90
|
export class BaseSettingsNames {
|
|
88
91
|
static TOOLBAR: string;
|
|
89
92
|
static TOOLBAR_DIRECTION: string;
|
|
90
93
|
static TOOLBAR_CONTENT: string;
|
|
94
|
+
static THEME: string;
|
|
91
95
|
}
|
|
92
96
|
export class SettingChangedEvent extends Event {
|
|
93
97
|
name: string;
|
|
@@ -102,6 +106,11 @@ export abstract class SettingsBase implements ISettings {
|
|
|
102
106
|
getSettingValue<T>(name: string): T;
|
|
103
107
|
protected abstract getKeyWithPrefix(key: string): string;
|
|
104
108
|
}
|
|
109
|
+
export enum SettingsTheme {
|
|
110
|
+
LIGHT_THEME = "ascn-light",
|
|
111
|
+
DARK_THEME = "ascn-dark"
|
|
112
|
+
}
|
|
113
|
+
export const defaultThemeAppearance: string;
|
|
105
114
|
export enum ToolbarDirection {
|
|
106
115
|
TOP_FIXED = "ascn-toolbar-direction-fixed-top",
|
|
107
116
|
TOP_FLUENT = "ascn-toolbar-direction-top",
|
|
@@ -127,6 +136,7 @@ export class ViewerConfiguration {
|
|
|
127
136
|
settingsPrefix: string;
|
|
128
137
|
appearance: ViewerSettings;
|
|
129
138
|
createConfiguration(configuration: ViewerSettings, origin: ViewerSettings): void;
|
|
139
|
+
changeTheme(newTheme: string): void;
|
|
130
140
|
}
|
|
131
141
|
export type ErrorCallback = (message: string) => void;
|
|
132
142
|
export type SuccessCallback = (modelId: any) => void;
|
|
@@ -159,6 +169,7 @@ export abstract class ViewerBase {
|
|
|
159
169
|
finish(): void;
|
|
160
170
|
onPostExtensionLoad(extension: ExtensionBase): void;
|
|
161
171
|
protected loadExtensions(): void;
|
|
172
|
+
protected setThemeFromSettings(): void;
|
|
162
173
|
}
|
|
163
174
|
export class Control {
|
|
164
175
|
container: HTMLElement;
|
|
@@ -238,6 +249,7 @@ export class Color {
|
|
|
238
249
|
alpha(): number;
|
|
239
250
|
fromArray(array: ArrayLike<number>, offset?: number): Color;
|
|
240
251
|
toArray(array: Array<number>, offset?: number): Array<number>;
|
|
252
|
+
clone(): Color;
|
|
241
253
|
}
|
|
242
254
|
export abstract class ViewObject extends THREE.Object3D {
|
|
243
255
|
protected _isDisposed: boolean;
|
|
@@ -706,6 +718,31 @@ export interface IEventSigner<Data> {
|
|
|
706
718
|
allowMissing?: boolean;
|
|
707
719
|
}): boolean;
|
|
708
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
|
+
}
|
|
709
746
|
export interface IModelIntersectionChecker {
|
|
710
747
|
/** Gets the center of the model*/
|
|
711
748
|
get modelCenter(): THREE.Vector3;
|
|
@@ -718,13 +755,15 @@ export interface IModelIntersectionChecker {
|
|
|
718
755
|
/**
|
|
719
756
|
* Gets {@link THREE.Intersection} between a casted {@link ray} and model object.
|
|
720
757
|
* @param ray
|
|
758
|
+
* @param camera
|
|
721
759
|
*/
|
|
722
|
-
getIntersectionByRay(ray: THREE.Ray): THREE.Intersection<THREE.Object3D> | undefined;
|
|
760
|
+
getIntersectionByRay(ray: THREE.Ray, camera: THREE.Camera): THREE.Intersection<THREE.Object3D> | undefined;
|
|
723
761
|
/**
|
|
724
762
|
* Gets ID of the model object intersected by {@link ray}
|
|
725
763
|
* @param ray
|
|
764
|
+
* @param camera
|
|
726
765
|
*/
|
|
727
|
-
getIntersectionIDByRay(ray: THREE.Ray): {
|
|
766
|
+
getIntersectionIDByRay(ray: THREE.Ray, camera: THREE.Camera): {
|
|
728
767
|
modelId: string;
|
|
729
768
|
guid: string;
|
|
730
769
|
} | undefined;
|
|
@@ -843,6 +882,10 @@ export interface IUserScene {
|
|
|
843
882
|
get intersectionChecker(): IModelIntersectionChecker | null;
|
|
844
883
|
/** Gets the THREE.Object3D representation of the scene */
|
|
845
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;
|
|
846
889
|
/** Place objects on scene */
|
|
847
890
|
addRange(objects: THREE.Object3D[]): void;
|
|
848
891
|
/** Update objects on scene */
|
|
@@ -866,6 +909,7 @@ export interface IUserScene {
|
|
|
866
909
|
}
|
|
867
910
|
export interface I3DRenderer {
|
|
868
911
|
clear(color?: boolean, depth?: boolean, stencil?: boolean): void;
|
|
912
|
+
setClearColor(color: ColorRepresentation, alpha?: number): void;
|
|
869
913
|
clearDepth(): void;
|
|
870
914
|
render(scene: THREE.Object3D, camera: THREE.Camera): void;
|
|
871
915
|
getSize(target: THREE.Vector2): THREE.Vector2;
|
|
@@ -905,6 +949,17 @@ export interface IRenderViewer3D {
|
|
|
905
949
|
* Gets all render scenes.
|
|
906
950
|
*/
|
|
907
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;
|
|
908
963
|
}
|
|
909
964
|
export class ModelElement {
|
|
910
965
|
get id(): string;
|
|
@@ -914,7 +969,8 @@ export class ModelElement {
|
|
|
914
969
|
get name(): string;
|
|
915
970
|
get children(): ModelElement[];
|
|
916
971
|
get hasGeometry(): boolean;
|
|
917
|
-
get
|
|
972
|
+
get viewObject(): ViewObject | undefined;
|
|
973
|
+
get boundingBoxCenter(): Point3 | null;
|
|
918
974
|
}
|
|
919
975
|
export class ModelElementTree {
|
|
920
976
|
/**
|
|
@@ -2577,6 +2633,7 @@ export class Viewer3D extends ViewerBase {
|
|
|
2577
2633
|
* @returns Blob object representing render image.
|
|
2578
2634
|
*/
|
|
2579
2635
|
makeScreenshot(mimeType?: string, quality?: number): Promise<Blob>;
|
|
2636
|
+
setThemeFromSettings(): void;
|
|
2580
2637
|
}
|
|
2581
2638
|
export class GuiViewer3D extends Viewer3D {
|
|
2582
2639
|
loadModelPart(buffer: ArrayBuffer, options: ModelLoadingOptions, onSuccessCallback: SuccessCallback, onErrorCallback: ErrorCallback): void;
|
|
@@ -2797,6 +2854,30 @@ export class Dragger {
|
|
|
2797
2854
|
constructor(allowedDraggableElement: HTMLElement, draggableContainer: HTMLElement, containerToRestriction: HTMLElement, windowStater?: WindowStater);
|
|
2798
2855
|
get windowState(): IWindowStyle | null;
|
|
2799
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
|
+
}
|
|
2800
2881
|
export class Button extends Control {
|
|
2801
2882
|
|
|
2802
2883
|
constructor(id: string);
|
|
@@ -2804,6 +2885,7 @@ export class Button extends Control {
|
|
|
2804
2885
|
setState(state: Button.State): boolean;
|
|
2805
2886
|
getState(): Button.State;
|
|
2806
2887
|
setIcon(iconClassName: string): void;
|
|
2888
|
+
setFromSvgTemlate(template: string): void;
|
|
2807
2889
|
/**
|
|
2808
2890
|
* Override this method to be notified when the user clicks on the button.
|
|
2809
2891
|
* @param {MouseEvent} event
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pilotdev/pilot-web-3d",
|
|
3
|
-
"version": "23.0.
|
|
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,7 +8,7 @@
|
|
|
8
8
|
"author": "JSC Ascon",
|
|
9
9
|
"license": "MIT",
|
|
10
10
|
"typeScriptVersion": "4.9.4",
|
|
11
|
-
"
|
|
11
|
+
"dependencies": {
|
|
12
12
|
"@types/three": "0.148.0"
|
|
13
13
|
},
|
|
14
14
|
"keywords": [
|