@pilotdev/pilot-web-3d 23.0.6-alpha.2 → 23.0.6
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 +548 -397
- package/package.json +1 -1
package/index.d.ts
CHANGED
|
@@ -4,9 +4,20 @@ export class InitializerOptions {
|
|
|
4
4
|
libList?: string[];
|
|
5
5
|
language?: string;
|
|
6
6
|
}
|
|
7
|
+
class Global {
|
|
8
|
+
G: any;
|
|
9
|
+
RESOURCE_ROOT: string;
|
|
10
|
+
initializeResourceRoot(options: InitializerOptions): void;
|
|
11
|
+
getResourceUrl(resourceRelativePath: string): string;
|
|
12
|
+
}
|
|
13
|
+
export const global: Global;
|
|
14
|
+
export {};
|
|
15
|
+
export type StringMap = {
|
|
16
|
+
[key: string]: any;
|
|
17
|
+
};
|
|
7
18
|
export class Localization {
|
|
8
19
|
static initialize(options: any): Promise<void>;
|
|
9
|
-
static translate(stringToTrans: string):
|
|
20
|
+
static translate<T extends (string | StringMap) = string>(stringToTrans: string): T;
|
|
10
21
|
static setLanguage(language: string): Promise<void>;
|
|
11
22
|
static extendLocalization(locales: any): boolean;
|
|
12
23
|
}
|
|
@@ -24,6 +35,7 @@ export class ExtensionLoader {
|
|
|
24
35
|
loadExtension(extensionId: string): Promise<ExtensionBase>;
|
|
25
36
|
unloadExtension(extensionId: string): Promise<boolean>;
|
|
26
37
|
getExtensions(): string[];
|
|
38
|
+
getExtension(extensionId: string): ExtensionBase;
|
|
27
39
|
}
|
|
28
40
|
export interface ILayerManager {
|
|
29
41
|
createLayer(name: string): ILayer;
|
|
@@ -58,6 +70,7 @@ export class CoreEventTypes {
|
|
|
58
70
|
static VIEWER_MOUSE_LONG_TOUCH_EVENT: string;
|
|
59
71
|
static SETTING_CHANGED_EVENT: string;
|
|
60
72
|
static SETTING_RESET_EVENT: string;
|
|
73
|
+
static SETTING_LANGUAGE_CHANGED_EVENT: string;
|
|
61
74
|
}
|
|
62
75
|
export interface ISettingsStorage {
|
|
63
76
|
clear(): void;
|
|
@@ -87,11 +100,11 @@ export interface ISettings {
|
|
|
87
100
|
changeSetting<T>(name: string, value: T, notify?: boolean, providedData?: any): void;
|
|
88
101
|
getSettingValue<T>(name: string): T;
|
|
89
102
|
}
|
|
90
|
-
export
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
103
|
+
export enum BaseSettingsNames {
|
|
104
|
+
TOOLBAR = "toolbar",
|
|
105
|
+
TOOLBAR_DIRECTION = "toolbarDirection",
|
|
106
|
+
TOOLBAR_CONTENT = "toolbarContent",
|
|
107
|
+
THEME = "theme"
|
|
95
108
|
}
|
|
96
109
|
export class SettingChangedEvent extends Event {
|
|
97
110
|
name: string;
|
|
@@ -122,13 +135,9 @@ export enum ToolbarContent {
|
|
|
122
135
|
START = "ascn-toolbar-content-start",
|
|
123
136
|
END = "ascn-toolbar-content-end"
|
|
124
137
|
}
|
|
125
|
-
export interface ToolbarOptions {
|
|
126
|
-
height: number;
|
|
127
|
-
direction: ToolbarDirection;
|
|
128
|
-
}
|
|
129
138
|
export interface ToolbarStyle {
|
|
130
|
-
|
|
131
|
-
|
|
139
|
+
[BaseSettingsNames.TOOLBAR_DIRECTION]?: ToolbarDirection;
|
|
140
|
+
[BaseSettingsNames.TOOLBAR_CONTENT]?: ToolbarContent;
|
|
132
141
|
}
|
|
133
142
|
export const defaultToolbarAppearance: ToolbarStyle;
|
|
134
143
|
export type ViewerSettings = Record<string, any>;
|
|
@@ -136,6 +145,7 @@ export class ViewerConfiguration {
|
|
|
136
145
|
settingsPrefix: string;
|
|
137
146
|
appearance: ViewerSettings;
|
|
138
147
|
createConfiguration(configuration: ViewerSettings, origin: ViewerSettings): void;
|
|
148
|
+
mergeConfigurationAndSettings(configuration: ViewerSettings, settings: ISettings): void;
|
|
139
149
|
changeTheme(newTheme: string): void;
|
|
140
150
|
}
|
|
141
151
|
export type ErrorCallback = (message: string) => void;
|
|
@@ -183,7 +193,7 @@ export class Control {
|
|
|
183
193
|
export class Toolbar extends Control {
|
|
184
194
|
|
|
185
195
|
constructor(id: string, toolbarContainer: HTMLElement, options?: ToolbarStyle);
|
|
186
|
-
addControl(control: Control): void;
|
|
196
|
+
addControl(control: Control, index?: number): void;
|
|
187
197
|
removeControl(id: string): void;
|
|
188
198
|
changeToolbarPosition(direction: string): void;
|
|
189
199
|
changeToolbarContent(content: string): void;
|
|
@@ -258,12 +268,18 @@ export abstract class ViewObject extends THREE.Object3D {
|
|
|
258
268
|
protected _isVisible: boolean;
|
|
259
269
|
protected _isHidden: boolean;
|
|
260
270
|
protected _originalColor: Color;
|
|
261
|
-
/**
|
|
271
|
+
/**
|
|
272
|
+
* model element entity guid
|
|
273
|
+
* @default zeroGuid
|
|
274
|
+
*/
|
|
262
275
|
readonly entityGuid: string;
|
|
263
|
-
/**
|
|
276
|
+
/**
|
|
277
|
+
* model part guid
|
|
278
|
+
* @default zeroGuid
|
|
279
|
+
*/
|
|
264
280
|
readonly modelGuid: string;
|
|
265
281
|
|
|
266
|
-
constructor(entityGuid
|
|
282
|
+
constructor(entityGuid?: string, modelGuid?: string, color?: Color);
|
|
267
283
|
/**Mesh representation of the object */
|
|
268
284
|
abstract get mesh(): THREE.Mesh | null;
|
|
269
285
|
/**Edge representation of the object */
|
|
@@ -575,6 +591,34 @@ export class CustomPointMaterial extends CustomMaterial {
|
|
|
575
591
|
protected onBeforeRender(renderer: THREE.WebGLRenderer, scene: THREE.Scene, camera: THREE.Camera, geometry: THREE.BufferGeometry, material: THREE.Material, group: THREE.Group): void;
|
|
576
592
|
copy(source: CustomPointMaterial): this;
|
|
577
593
|
}
|
|
594
|
+
export namespace Viewer3DIcons {
|
|
595
|
+
const VIEWER_SETTINGS_ICON: string;
|
|
596
|
+
const VIEWER_MODEL_BROWSER_ICON: string;
|
|
597
|
+
const VIEWER_FULL_SCREEN_ICON: string;
|
|
598
|
+
const VIEWER_COLLAPSE_ICON: string;
|
|
599
|
+
const VIEWER_ELEMENT_PROPERTIES_ICON: string;
|
|
600
|
+
const VIEWER_ADD_CLIPPING_PLANE_ICON: string;
|
|
601
|
+
const VIEWER_CLIPPING_FLIP_ICON: string;
|
|
602
|
+
const VIEWER_DELETE_CLIPPING_PLANE_ICON: string;
|
|
603
|
+
const VIEWER_CLIPPING_CUBE_ICON: string;
|
|
604
|
+
const VIEWER_ADD_REMARK_ICON: string;
|
|
605
|
+
const VIEWER_MEASUREMENT_EDGE_ICON: string;
|
|
606
|
+
const VIEWER_MEASUREMENT_PLANE_ICON: string;
|
|
607
|
+
const VIEWER_MEASUREMENT_DIMENSION_ICON: string;
|
|
608
|
+
}
|
|
609
|
+
export namespace ViewerGeneralIcons {
|
|
610
|
+
const ZOOM_IN: string;
|
|
611
|
+
const ZOOM_OUT: string;
|
|
612
|
+
const CLOSE: string;
|
|
613
|
+
const STRETCH_WINDOW: string;
|
|
614
|
+
const EXPAND_TREE: string;
|
|
615
|
+
const COLLAPSE_TREE: string;
|
|
616
|
+
const ARROW_DROP_DOWN: string;
|
|
617
|
+
const ARROW_DROP_RIGHT: string;
|
|
618
|
+
const CIRCLE_ICON: string;
|
|
619
|
+
const SHOW: string;
|
|
620
|
+
const HIDE: string;
|
|
621
|
+
}
|
|
578
622
|
export class MeshLineGeometry extends THREE.InstancedBufferGeometry {
|
|
579
623
|
type: string;
|
|
580
624
|
instanceStart: THREE.BufferAttribute;
|
|
@@ -718,34 +762,53 @@ export interface IEventSigner<Data> {
|
|
|
718
762
|
allowMissing?: boolean;
|
|
719
763
|
}): boolean;
|
|
720
764
|
}
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
Append = 0,
|
|
724
|
-
Replace = 1
|
|
765
|
+
export interface IDisposable {
|
|
766
|
+
dispose(): void;
|
|
725
767
|
}
|
|
726
|
-
export class
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
displayMode?: DisplayMode;
|
|
731
|
-
/** Desired render framerate */
|
|
732
|
-
desiredFramerate?: number;
|
|
733
|
-
/** Allocated time for rendering operations, excluding scene rendering */
|
|
734
|
-
manageTime?: number;
|
|
735
|
-
/** Draw hovered meshes on the `selectionScene` */
|
|
736
|
-
hoverMeshes?: boolean;
|
|
737
|
-
/** Draw hovered edges on the `selectionScene` */
|
|
738
|
-
hoverEdges?: boolean;
|
|
739
|
-
/** Draw selected meshes on the `selectionScene` */
|
|
740
|
-
selectEdges?: boolean;
|
|
741
|
-
/** Draw selected edges on the `selectionScene` */
|
|
742
|
-
selectMeshes?: boolean;
|
|
768
|
+
export class DisposeBy implements IDisposable {
|
|
769
|
+
|
|
770
|
+
constructor(callback: () => void);
|
|
771
|
+
dispose(): void;
|
|
743
772
|
}
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
773
|
+
class RevertProperty<T, P extends keyof T> implements IDisposable {
|
|
774
|
+
dispose(): void;
|
|
775
|
+
}
|
|
776
|
+
export function changeProperty<T, P extends keyof T>(who: T, propName: P, newValue: T[P]): RevertProperty<T, P>;
|
|
777
|
+
export class MergeDisposables implements IDisposable {
|
|
778
|
+
|
|
779
|
+
constructor(handles: IDisposable[]);
|
|
780
|
+
push(...moreHandles: IDisposable[]): void;
|
|
781
|
+
dispose(): void;
|
|
782
|
+
}
|
|
783
|
+
class RemoveDomHandler implements IDisposable {
|
|
784
|
+
dispose(): void;
|
|
785
|
+
}
|
|
786
|
+
export function addDomListener<DomElement extends HTMLElement, Type extends keyof HTMLElementEventMap>(domElement: DomElement, type: Type, listener: (this: HTMLElement, ev: HTMLElementEventMap[Type]) => any): RemoveDomHandler;
|
|
787
|
+
export {};
|
|
788
|
+
export interface EventEmitter<Data> {
|
|
789
|
+
emit(data?: Data, options?: object): void;
|
|
790
|
+
}
|
|
791
|
+
export class RenderEventListener<Data> implements IEventListener<Data>, IDisposable {
|
|
792
|
+
|
|
793
|
+
constructor(event: IEventSigner<Data>, func: EventFunction<Data>, options: {
|
|
794
|
+
bind?: object;
|
|
795
|
+
});
|
|
796
|
+
dispose(): void;
|
|
797
|
+
}
|
|
798
|
+
export class EventDispatcher<Data> implements IEventSigner<Data>, EventEmitter<Data> {
|
|
799
|
+
listen(func: EventFunction<Data>, options?: {
|
|
800
|
+
bind?: object;
|
|
801
|
+
}): IEventListener<Data>;
|
|
802
|
+
unlisten(func: EventFunction<Data>, options?: {
|
|
803
|
+
bind?: object;
|
|
804
|
+
allowMissing?: boolean;
|
|
805
|
+
}): boolean;
|
|
806
|
+
emit(data?: Data): void;
|
|
807
|
+
emitR(data?: Data): any[];
|
|
808
|
+
asSigner(): IEventSigner<Data>;
|
|
809
|
+
asEmitter(): EventEmitter<Data>;
|
|
810
|
+
removeAllListeners(): void;
|
|
747
811
|
}
|
|
748
|
-
export const defaultRenderViewSettings: RenderViewSettings;
|
|
749
812
|
export interface IModelIntersectionChecker {
|
|
750
813
|
/** Gets the center of the model*/
|
|
751
814
|
get modelCenter(): THREE.Vector3;
|
|
@@ -797,60 +860,29 @@ export interface IModelIntersectionChecker {
|
|
|
797
860
|
guid: string;
|
|
798
861
|
}[];
|
|
799
862
|
}
|
|
800
|
-
export
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
863
|
+
export class RenderViewSettings {
|
|
864
|
+
telemetry?: boolean;
|
|
865
|
+
hideEdgesWhenNavigation?: boolean;
|
|
866
|
+
antiAliasing?: boolean;
|
|
867
|
+
displayMode?: DisplayMode;
|
|
868
|
+
/** Desired render framerate */
|
|
869
|
+
desiredFramerate?: number;
|
|
870
|
+
/** Allocated time for rendering operations, excluding scene rendering */
|
|
871
|
+
manageTime?: number;
|
|
872
|
+
/** Draw hovered meshes on the `selectionScene` */
|
|
873
|
+
hoverMeshes?: boolean;
|
|
874
|
+
/** Draw hovered edges on the `selectionScene` */
|
|
875
|
+
hoverEdges?: boolean;
|
|
876
|
+
/** Draw selected meshes on the `selectionScene` */
|
|
877
|
+
selectEdges?: boolean;
|
|
878
|
+
/** Draw selected edges on the `selectionScene` */
|
|
879
|
+
selectMeshes?: boolean;
|
|
810
880
|
}
|
|
811
|
-
export
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
/** Request a full redraw of the canvas. */
|
|
815
|
-
updateCurrentCanvas(): Promise<void>;
|
|
816
|
-
/**
|
|
817
|
-
* Place object on the scene.\
|
|
818
|
-
* An object can only be placed on one scene.
|
|
819
|
-
* @param iObj - object to place.
|
|
820
|
-
* @param sceneID - (optional) scene name. `MainScene` by default.
|
|
821
|
-
*/
|
|
822
|
-
placeObjectOnScene(iObj: THREE.Object3D, sceneID?: string): Promise<void>;
|
|
823
|
-
/**
|
|
824
|
-
* Remove object from scene.
|
|
825
|
-
* @param iObj
|
|
826
|
-
*/
|
|
827
|
-
removeObjectFromScene(iObj: THREE.Object3D): Promise<void>;
|
|
828
|
-
/**
|
|
829
|
-
* Set clipping planes for rendering.
|
|
830
|
-
* @param planes - array of clipping planes.
|
|
831
|
-
*/
|
|
832
|
-
setClipping(planes: THREE.Plane[]): void;
|
|
833
|
-
/**
|
|
834
|
-
* Set active clipping planes: planes with colored sections
|
|
835
|
-
* @param indices - active planes indices in the array of clipping planes
|
|
836
|
-
*/
|
|
837
|
-
setActiveClipPlaneIndices(indices: number[]): void;
|
|
838
|
-
/**
|
|
839
|
-
* Gets all render scenes.
|
|
840
|
-
*/
|
|
841
|
-
getScenes(): IUserScene[];
|
|
842
|
-
/**
|
|
843
|
-
*
|
|
844
|
-
* @param name
|
|
845
|
-
* @param isClippable
|
|
846
|
-
*/
|
|
847
|
-
addScene(name: string, isClippable: boolean): IUserScene;
|
|
848
|
-
/**
|
|
849
|
-
*
|
|
850
|
-
* @param scene
|
|
851
|
-
*/
|
|
852
|
-
removeScene(scene: IUserScene): void;
|
|
881
|
+
export enum DisplayMode {
|
|
882
|
+
FACES_AND_EDGES = 0,
|
|
883
|
+
FACES = 1
|
|
853
884
|
}
|
|
885
|
+
export const defaultRenderViewSettings: RenderViewSettings;
|
|
854
886
|
export interface IRenderOperationContext {
|
|
855
887
|
/** If true, renderScenes operations will be forced*/
|
|
856
888
|
isRedrawRequested: boolean;
|
|
@@ -905,7 +937,7 @@ export enum OperationPriority {
|
|
|
905
937
|
afterAll = 100
|
|
906
938
|
}
|
|
907
939
|
export type RenderOperationDelegate = (context: IRenderOperationContext) => OperationStatus;
|
|
908
|
-
export interface IUserScene {
|
|
940
|
+
export interface IUserScene extends THREE.Scene {
|
|
909
941
|
/** Scene name */
|
|
910
942
|
readonly name: string;
|
|
911
943
|
/** Indicates whether the scene should to be updated (should to be managed)*/
|
|
@@ -914,8 +946,6 @@ export interface IUserScene {
|
|
|
914
946
|
get needsRedraw(): boolean;
|
|
915
947
|
/** Gets the scene intersection checker */
|
|
916
948
|
get intersectionChecker(): IModelIntersectionChecker | null;
|
|
917
|
-
/** Gets the THREE.Object3D representation of the scene */
|
|
918
|
-
get threeObjectRepresentation(): THREE.Object3D | null;
|
|
919
949
|
/** Sets clipping enable */
|
|
920
950
|
set clippingEnable(value: boolean);
|
|
921
951
|
/** Indicates whether the scene should be clipped */
|
|
@@ -937,297 +967,69 @@ export interface IUserScene {
|
|
|
937
967
|
/** Render scene */
|
|
938
968
|
render(context: IRenderOperationContext): void;
|
|
939
969
|
/** Clear scene */
|
|
940
|
-
clear():
|
|
970
|
+
clear(): this;
|
|
941
971
|
/** Dispose scene */
|
|
942
972
|
dispose(): void;
|
|
943
973
|
}
|
|
944
|
-
export
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
readonly priority: number | NavigationHandlerPriority;
|
|
955
|
-
/** Always handle, used if `NavigationEvent.isHandled` set to true*/
|
|
956
|
-
readonly alwaysHandle: boolean;
|
|
957
|
-
/** (optional) listener name*/
|
|
958
|
-
readonly navigationTargetName?: string;
|
|
959
|
-
|
|
960
|
-
constructor(
|
|
961
|
-
/** If true, use event capturing instead of event bubbling*/
|
|
962
|
-
capture?: boolean,
|
|
963
|
-
/** Call priority of navigation event handlers, from highest to lowest*/
|
|
964
|
-
priority?: number | NavigationHandlerPriority,
|
|
965
|
-
/** Always handle, used if `NavigationEvent.isHandled` set to true*/
|
|
966
|
-
alwaysHandle?: boolean,
|
|
967
|
-
/** (optional) listener name*/
|
|
968
|
-
navigationTargetName?: string);
|
|
974
|
+
export interface I3DRenderer {
|
|
975
|
+
clear(color?: boolean, depth?: boolean, stencil?: boolean): void;
|
|
976
|
+
setClearColor(color: THREE.ColorRepresentation, alpha?: number): void;
|
|
977
|
+
clearDepth(): void;
|
|
978
|
+
render(scene: THREE.Object3D, camera: THREE.Camera): void;
|
|
979
|
+
getSize(target: THREE.Vector2): THREE.Vector2;
|
|
980
|
+
setSize(width: number, height: number, updateStyle?: boolean): void;
|
|
981
|
+
setViewport(x: THREE.Vector4 | number, y?: number, width?: number, height?: number): void;
|
|
982
|
+
clippingPlanes: THREE.Plane[];
|
|
983
|
+
domElement: HTMLCanvasElement;
|
|
969
984
|
}
|
|
970
|
-
export
|
|
985
|
+
export interface IRenderViewer3D {
|
|
986
|
+
/** Gets model inetrsection checker. */
|
|
987
|
+
getIntersectionChecker(): IModelIntersectionChecker;
|
|
988
|
+
/** Request a full redraw of the canvas. */
|
|
989
|
+
updateCurrentCanvas(): Promise<void>;
|
|
971
990
|
/**
|
|
972
|
-
*
|
|
991
|
+
* Place object on the scene.\
|
|
992
|
+
* An object can only be placed on one scene.
|
|
993
|
+
* @param iObj - object to place.
|
|
994
|
+
* @param sceneID - (optional) scene name. `MainScene` by default.
|
|
973
995
|
*/
|
|
974
|
-
|
|
975
|
-
};
|
|
976
|
-
export interface INavigationEventSource {
|
|
996
|
+
placeObjectOnScene(iObj: THREE.Object3D, sceneID?: string): Promise<void>;
|
|
977
997
|
/**
|
|
978
|
-
*
|
|
998
|
+
* Remove object from scene.
|
|
999
|
+
* @param iObj
|
|
979
1000
|
*/
|
|
980
|
-
|
|
1001
|
+
removeObjectFromScene(iObj: THREE.Object3D): Promise<void>;
|
|
981
1002
|
/**
|
|
982
|
-
*
|
|
983
|
-
* @param
|
|
1003
|
+
* Set clipping planes for rendering.
|
|
1004
|
+
* @param planes - array of clipping planes.
|
|
984
1005
|
*/
|
|
985
|
-
|
|
986
|
-
addEventListener<T extends keyof HTMLElementEventMap>(type: T, listener: (this: object, ev: HTMLElementEventMap[T] & NavigationEvent) => void, options?: boolean | EventListenerOptions | NavigationEventOptions): void;
|
|
987
|
-
removeEventListener<T extends keyof HTMLElementEventMap>(type: T, listener: (this: object, ev: HTMLElementEventMap[T] & NavigationEvent) => void, options?: boolean | EventListenerOptions | NavigationEventOptions): void;
|
|
988
|
-
}
|
|
989
|
-
export interface INavigationAgent {
|
|
1006
|
+
setClipping(planes: THREE.Plane[]): void;
|
|
990
1007
|
/**
|
|
991
|
-
*
|
|
1008
|
+
* Set active clipping planes: planes with colored sections
|
|
1009
|
+
* @param indices - active planes indices in the array of clipping planes
|
|
992
1010
|
*/
|
|
993
|
-
|
|
1011
|
+
setActiveClipPlaneIndices(indices: number[]): void;
|
|
994
1012
|
/**
|
|
995
|
-
*
|
|
1013
|
+
* Gets all render scenes.
|
|
996
1014
|
*/
|
|
997
|
-
|
|
1015
|
+
getScenes(): IUserScene[];
|
|
998
1016
|
/**
|
|
999
|
-
*
|
|
1017
|
+
*
|
|
1018
|
+
* @param name
|
|
1019
|
+
* @param isClippable
|
|
1000
1020
|
*/
|
|
1001
|
-
|
|
1021
|
+
addScene(name: string, isClippable: boolean): IUserScene;
|
|
1002
1022
|
/**
|
|
1003
|
-
*
|
|
1023
|
+
*
|
|
1024
|
+
* @param scene
|
|
1004
1025
|
*/
|
|
1005
|
-
|
|
1026
|
+
removeScene(scene: IUserScene): void;
|
|
1006
1027
|
}
|
|
1007
|
-
export
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
get
|
|
1012
|
-
/**
|
|
1013
|
-
* Initialize navigation tool.
|
|
1014
|
-
*/
|
|
1015
|
-
init(navAgent: INavigationAgent, cameraControl: ICameraControl, intersectionChecker: IModelIntersectionChecker): void;
|
|
1016
|
-
/**
|
|
1017
|
-
* Activates or deactivates this navigation tool.
|
|
1018
|
-
*/
|
|
1019
|
-
setActive(isActive: boolean): void;
|
|
1020
|
-
/**
|
|
1021
|
-
* Gets the camera pivot point.
|
|
1022
|
-
*/
|
|
1023
|
-
getPivotPoint(): THREE.Vector3;
|
|
1024
|
-
/**
|
|
1025
|
-
* Sets the camera pivot point.
|
|
1026
|
-
*/
|
|
1027
|
-
setPivotPoint(pivotPoint: THREE.Vector3): void;
|
|
1028
|
-
/**
|
|
1029
|
-
* Sets the camera parameters.
|
|
1030
|
-
* @param iParams
|
|
1031
|
-
*/
|
|
1032
|
-
setCameraParameters(iParams: CameraParameters): void;
|
|
1033
|
-
/**
|
|
1034
|
-
* Gets the camera parameters.
|
|
1035
|
-
*/
|
|
1036
|
-
getCameraParameters(): CameraParameters;
|
|
1037
|
-
}
|
|
1038
|
-
export class GizmoMaterials {
|
|
1039
|
-
static gizmoMaterial: THREE.MeshBasicMaterial;
|
|
1040
|
-
static matInvisible: THREE.MeshBasicMaterial;
|
|
1041
|
-
static matRed: THREE.MeshBasicMaterial;
|
|
1042
|
-
static matGreen: THREE.MeshBasicMaterial;
|
|
1043
|
-
static matBlue: THREE.MeshBasicMaterial;
|
|
1044
|
-
static matYellow: THREE.MeshBasicMaterial;
|
|
1045
|
-
static matViolet: THREE.MeshBasicMaterial;
|
|
1046
|
-
static matYellowTransparent: THREE.MeshBasicMaterial;
|
|
1047
|
-
static init(): void;
|
|
1048
|
-
}
|
|
1049
|
-
export interface IGizmoObject extends THREE.Object3D {
|
|
1050
|
-
getHovered(): boolean;
|
|
1051
|
-
setHovered(value: boolean): void;
|
|
1052
|
-
getActive(): boolean;
|
|
1053
|
-
setActive(value: boolean): void;
|
|
1054
|
-
dispose(): void;
|
|
1055
|
-
}
|
|
1056
|
-
export class GizmoObject extends THREE.Object3D implements IGizmoObject {
|
|
1057
|
-
protected _meshes: THREE.Mesh[];
|
|
1058
|
-
readonly baseMaterial: THREE.Material;
|
|
1059
|
-
readonly hoverMaterial: THREE.Material;
|
|
1060
|
-
readonly activeMaterial: THREE.Material;
|
|
1061
|
-
|
|
1062
|
-
constructor(_meshes: THREE.Mesh[], baseMaterial?: THREE.Material, hoverMaterial?: THREE.Material, activeMaterial?: THREE.Material);
|
|
1063
|
-
getHovered(): boolean;
|
|
1064
|
-
setHovered(value: boolean): void;
|
|
1065
|
-
getActive(): boolean;
|
|
1066
|
-
setActive(value: boolean): void;
|
|
1067
|
-
dispose(): void;
|
|
1068
|
-
raycast(raycaster: THREE.Raycaster, intersects: THREE.Intersection<THREE.Object3D<THREE.Event>>[]): void;
|
|
1069
|
-
}
|
|
1070
|
-
export abstract class GizmoAxis extends THREE.Object3D implements IGizmoObject {
|
|
1071
|
-
readonly handle: IGizmoObject;
|
|
1072
|
-
readonly picker?: IGizmoObject;
|
|
1073
|
-
readonly helper?: IGizmoObject;
|
|
1074
|
-
protected _isHovered: boolean;
|
|
1075
|
-
protected _isActive: boolean;
|
|
1076
|
-
protected _plane: THREE.Plane;
|
|
1077
|
-
protected _axisDir: THREE.Vector3;
|
|
1078
|
-
protected _raycaster: THREE.Raycaster;
|
|
1079
|
-
protected _worldPositionStart: THREE.Vector3;
|
|
1080
|
-
protected _worldQuaternionStart: THREE.Quaternion;
|
|
1081
|
-
protected _worldAxisDir: THREE.Vector3;
|
|
1082
|
-
protected _startPoint: THREE.Vector3;
|
|
1083
|
-
protected _endPoint: THREE.Vector3;
|
|
1084
|
-
getActive(): boolean;
|
|
1085
|
-
setActive(value: boolean): void;
|
|
1086
|
-
getHovered(): boolean;
|
|
1087
|
-
setHovered(value: boolean): void;
|
|
1088
|
-
dispose(): void;
|
|
1089
|
-
raycast(raycaster: THREE.Raycaster, intersects: THREE.Intersection<THREE.Object3D<THREE.Event>>[]): void;
|
|
1090
|
-
abstract moveByNdcPt(ndcPos: THREE.Vector2, camera: THREE.Camera): THREE.Matrix4;
|
|
1091
|
-
protected abstract updateGizmoPlane(camera: THREE.Camera): void;
|
|
1092
|
-
protected setStartPt(ndcPos: THREE.Vector2, camera: THREE.Camera): void;
|
|
1093
|
-
}
|
|
1094
|
-
export class GizmoTranslationAxis extends GizmoAxis {
|
|
1095
|
-
readonly handle: IGizmoObject;
|
|
1096
|
-
readonly picker?: IGizmoObject;
|
|
1097
|
-
readonly helper?: IGizmoObject;
|
|
1098
|
-
|
|
1099
|
-
constructor(axisDir: THREE.Vector3, handle: IGizmoObject, picker?: IGizmoObject, helper?: IGizmoObject);
|
|
1100
|
-
moveByNdcPt(ndcPos: THREE.Vector2, camera: THREE.Camera): THREE.Matrix4;
|
|
1101
|
-
protected updateGizmoPlane(camera: THREE.Camera): void;
|
|
1102
|
-
}
|
|
1103
|
-
export class GizmoRotationAxis extends GizmoAxis {
|
|
1104
|
-
readonly handle: IGizmoObject;
|
|
1105
|
-
readonly picker?: IGizmoObject;
|
|
1106
|
-
readonly helper?: IGizmoObject;
|
|
1107
|
-
moveByNdcPt(ndcPos: THREE.Vector2, camera: THREE.Camera): THREE.Matrix4;
|
|
1108
|
-
protected updateGizmoPlane(camera: THREE.Camera): void;
|
|
1109
|
-
}
|
|
1110
|
-
export class GizmoScaleAxis extends GizmoAxis {
|
|
1111
|
-
readonly handle: IGizmoObject;
|
|
1112
|
-
readonly picker?: IGizmoObject;
|
|
1113
|
-
readonly helper?: IGizmoObject;
|
|
1114
|
-
moveByNdcPt(ndcPos: THREE.Vector2, camera: THREE.Camera): THREE.Matrix4;
|
|
1115
|
-
protected updateGizmoPlane(camera: THREE.Camera): void;
|
|
1116
|
-
}
|
|
1117
|
-
export class GizmoControl extends THREE.Object3D {
|
|
1118
|
-
|
|
1119
|
-
constructor(camera: THREE.Camera, navAgent: INavigationAgent);
|
|
1120
|
-
attachTo(object: THREE.Object3D, asChild?: boolean): void;
|
|
1121
|
-
detach(): void;
|
|
1122
|
-
addAxis(axis: GizmoAxis): void;
|
|
1123
|
-
dispose(): void;
|
|
1124
|
-
updateMatrixWorld(force?: boolean): void;
|
|
1125
|
-
updateGizmoOffset(position?: THREE.Vector3, quaternion?: THREE.Quaternion): void;
|
|
1126
|
-
}
|
|
1127
|
-
export enum GizmoAxisDir {
|
|
1128
|
-
NONE = 0,
|
|
1129
|
-
X = 1,
|
|
1130
|
-
Y = 2,
|
|
1131
|
-
Z = 4,
|
|
1132
|
-
XY = 3,
|
|
1133
|
-
YZ = 6,
|
|
1134
|
-
XZ = 5,
|
|
1135
|
-
XYZ = 7
|
|
1136
|
-
}
|
|
1137
|
-
export class GizmoBuilder {
|
|
1138
|
-
static build(camera: THREE.Camera, navAgent: INavigationAgent, translation?: GizmoAxisDir, rotation?: GizmoAxisDir, scale?: GizmoAxisDir): GizmoControl;
|
|
1139
|
-
static buildTranslationAxis(axisDir: THREE.Vector3, handleBaseMatrial?: THREE.Material, handleHoveredMaterial?: THREE.Material, handleSelectedMaterial?: THREE.Material, pickerBaseMatrial?: THREE.Material, pickerHoveredMaterial?: THREE.Material, pickerSelectedMaterial?: THREE.Material): GizmoAxis;
|
|
1140
|
-
static buildRotationAxis(axisDir: THREE.Vector3, handleBaseMatrial?: THREE.Material, handleHoveredMaterial?: THREE.Material, handleSelectedMaterial?: THREE.Material, pickerBaseMatrial?: THREE.Material, pickerHoveredMaterial?: THREE.Material, pickerSelectedMaterial?: THREE.Material): GizmoAxis;
|
|
1141
|
-
static buildScaleAxis(axisDir: THREE.Vector3, handleBaseMatrial?: THREE.Material, handleHoveredMaterial?: THREE.Material, handleSelectedMaterial?: THREE.Material): GizmoAxis;
|
|
1142
|
-
}
|
|
1143
|
-
export interface LabelSpriteParameters {
|
|
1144
|
-
text?: string | undefined;
|
|
1145
|
-
sizeAttenuation?: boolean | undefined;
|
|
1146
|
-
fontFace?: string | FontFace | undefined;
|
|
1147
|
-
fontSize?: number | undefined;
|
|
1148
|
-
borderColor?: Color | undefined;
|
|
1149
|
-
backgroundColor?: Color | undefined;
|
|
1150
|
-
borderThickness?: number | undefined;
|
|
1151
|
-
borderRadius?: number | undefined;
|
|
1152
|
-
textColor?: Color | undefined;
|
|
1153
|
-
textPadding?: THREE.Vector4Tuple | undefined;
|
|
1154
|
-
}
|
|
1155
|
-
export class LabelSprite extends THREE.Sprite {
|
|
1156
|
-
readonly extraHeightFactor = 1.4;
|
|
1157
|
-
|
|
1158
|
-
constructor(parameters: LabelSpriteParameters);
|
|
1159
|
-
get sizeAttenuation(): boolean;
|
|
1160
|
-
set sizeAttenuation(value: boolean);
|
|
1161
|
-
/**
|
|
1162
|
-
* @default ''
|
|
1163
|
-
*/
|
|
1164
|
-
get text(): string;
|
|
1165
|
-
set text(value: string);
|
|
1166
|
-
/**
|
|
1167
|
-
* @default 'Roboto, sans-serif'
|
|
1168
|
-
*/
|
|
1169
|
-
get fontFace(): string | FontFace;
|
|
1170
|
-
set fontFace(value: string | FontFace);
|
|
1171
|
-
/**
|
|
1172
|
-
* @default 12
|
|
1173
|
-
*/
|
|
1174
|
-
get fontSize(): number;
|
|
1175
|
-
set fontSize(value: number);
|
|
1176
|
-
/**
|
|
1177
|
-
* @default 2
|
|
1178
|
-
*/
|
|
1179
|
-
get borderThickness(): number;
|
|
1180
|
-
set borderThickness(value: number);
|
|
1181
|
-
/**
|
|
1182
|
-
* @default new Color(0, 0, 0, 1.0)
|
|
1183
|
-
*/
|
|
1184
|
-
get borderColor(): Color;
|
|
1185
|
-
set borderColor(value: Color);
|
|
1186
|
-
/**
|
|
1187
|
-
* @default 1
|
|
1188
|
-
*/
|
|
1189
|
-
get borderRadius(): number;
|
|
1190
|
-
set borderRadius(value: number);
|
|
1191
|
-
/**
|
|
1192
|
-
* @default new Color(1.0, 1.0, 1.0, 1.0)
|
|
1193
|
-
*/
|
|
1194
|
-
get backgroundColor(): Color;
|
|
1195
|
-
set backgroundColor(value: Color);
|
|
1196
|
-
/**
|
|
1197
|
-
* @default new Color(0, 0, 0, 1.0)
|
|
1198
|
-
*/
|
|
1199
|
-
get textColor(): Color;
|
|
1200
|
-
set textColor(value: Color);
|
|
1201
|
-
/**
|
|
1202
|
-
* Label text padding: left, top, right, bottom
|
|
1203
|
-
* @default [0, 0, 0, 0]
|
|
1204
|
-
*/
|
|
1205
|
-
get textPadding(): THREE.Vector4Tuple;
|
|
1206
|
-
set textPadding(value: THREE.Vector4Tuple);
|
|
1207
|
-
dispose(): void;
|
|
1208
|
-
}
|
|
1209
|
-
export interface EventEmitter<Data> {
|
|
1210
|
-
emit(data?: Data, options?: object): void;
|
|
1211
|
-
}
|
|
1212
|
-
export class EventDispatcher<Data> implements IEventSigner<Data>, EventEmitter<Data> {
|
|
1213
|
-
listen(func: EventFunction<Data>, options?: {
|
|
1214
|
-
bind?: object;
|
|
1215
|
-
}): IEventListener<Data>;
|
|
1216
|
-
unlisten(func: EventFunction<Data>, options?: {
|
|
1217
|
-
bind?: object;
|
|
1218
|
-
allowMissing?: boolean;
|
|
1219
|
-
}): boolean;
|
|
1220
|
-
emit(data?: Data): void;
|
|
1221
|
-
emitR(data?: Data): any[];
|
|
1222
|
-
asSigner(): IEventSigner<Data>;
|
|
1223
|
-
asEmitter(): EventEmitter<Data>;
|
|
1224
|
-
removeAllListeners(): void;
|
|
1225
|
-
}
|
|
1226
|
-
export class ModelElement {
|
|
1227
|
-
get id(): string;
|
|
1228
|
-
get modelPartId(): string;
|
|
1229
|
-
get parent(): ModelElement | undefined;
|
|
1230
|
-
get type(): string;
|
|
1028
|
+
export class ModelElement {
|
|
1029
|
+
get id(): string;
|
|
1030
|
+
get modelPartId(): string;
|
|
1031
|
+
get parent(): ModelElement | undefined;
|
|
1032
|
+
get type(): string;
|
|
1231
1033
|
get name(): string;
|
|
1232
1034
|
get children(): ModelElement[];
|
|
1233
1035
|
get hasGeometry(): boolean;
|
|
@@ -2544,6 +2346,11 @@ export class ModelElementPropertyValue {
|
|
|
2544
2346
|
bool_value?: boolean;
|
|
2545
2347
|
get value(): unknown;
|
|
2546
2348
|
}
|
|
2349
|
+
|
|
2350
|
+
export enum SelectionMode {
|
|
2351
|
+
Append = 0,
|
|
2352
|
+
Replace = 1
|
|
2353
|
+
}
|
|
2547
2354
|
export class ModelElementIds {
|
|
2548
2355
|
modelPartId: string;
|
|
2549
2356
|
elementIds: string[];
|
|
@@ -2556,6 +2363,7 @@ export class EventTypes extends CoreEventTypes {
|
|
|
2556
2363
|
static CAMERA_NAVIGATION_MODE_CHANGED_EVENT: string;
|
|
2557
2364
|
static RENDER_CLICK_EVENT: string;
|
|
2558
2365
|
static RENDER_HOVER_EVENT: string;
|
|
2366
|
+
static RENDER_DOUBLE_CLICK_EVENT: string;
|
|
2559
2367
|
}
|
|
2560
2368
|
export class SelectionChangedEvent extends Event {
|
|
2561
2369
|
selectedIds: ModelElementIds[];
|
|
@@ -2574,13 +2382,107 @@ export class HoverEvent extends Event {
|
|
|
2574
2382
|
modelId: string;
|
|
2575
2383
|
modelElementId: string;
|
|
2576
2384
|
}
|
|
2577
|
-
export
|
|
2385
|
+
export enum NavigationHandlerPriority {
|
|
2386
|
+
DefaultNavigation = 0,
|
|
2387
|
+
GizmoHandlers = 20,
|
|
2388
|
+
EmbeddedExtensions = 40,
|
|
2389
|
+
CustomExtensions = 100
|
|
2390
|
+
}
|
|
2391
|
+
export class NavigationEventOptions implements EventListenerOptions {
|
|
2392
|
+
/** If true, use event capturing instead of event bubbling*/
|
|
2393
|
+
readonly capture: boolean;
|
|
2394
|
+
/** Call priority of navigation event handlers, from highest to lowest*/
|
|
2395
|
+
readonly priority: number | NavigationHandlerPriority;
|
|
2396
|
+
/** Always handle, used if `NavigationEvent.isHandled` set to true*/
|
|
2397
|
+
readonly alwaysHandle: boolean;
|
|
2398
|
+
/** (optional) listener name*/
|
|
2399
|
+
readonly navigationTargetName?: string;
|
|
2400
|
+
|
|
2401
|
+
constructor(
|
|
2402
|
+
/** If true, use event capturing instead of event bubbling*/
|
|
2403
|
+
capture?: boolean,
|
|
2404
|
+
/** Call priority of navigation event handlers, from highest to lowest*/
|
|
2405
|
+
priority?: number | NavigationHandlerPriority,
|
|
2406
|
+
/** Always handle, used if `NavigationEvent.isHandled` set to true*/
|
|
2407
|
+
alwaysHandle?: boolean,
|
|
2408
|
+
/** (optional) listener name*/
|
|
2409
|
+
navigationTargetName?: string);
|
|
2410
|
+
}
|
|
2411
|
+
export type NavigationEvent = {
|
|
2578
2412
|
/**
|
|
2579
|
-
*
|
|
2413
|
+
* (optional) Value indicating whether the NavigationEvent event was handled.
|
|
2580
2414
|
*/
|
|
2581
|
-
|
|
2582
|
-
|
|
2583
|
-
|
|
2415
|
+
isHandled?: boolean;
|
|
2416
|
+
};
|
|
2417
|
+
export interface INavigationEventSource {
|
|
2418
|
+
/**
|
|
2419
|
+
* Event fired on activity changed
|
|
2420
|
+
*/
|
|
2421
|
+
readonly eventSourceActivityChanged: IEventSigner<boolean>;
|
|
2422
|
+
/**
|
|
2423
|
+
* Activates or deactivate event source
|
|
2424
|
+
* @param value - activate if true
|
|
2425
|
+
*/
|
|
2426
|
+
setActive(value: boolean): void;
|
|
2427
|
+
addEventListener<T extends keyof HTMLElementEventMap>(type: T, listener: (this: object, ev: HTMLElementEventMap[T] & NavigationEvent) => void, options?: boolean | EventListenerOptions | NavigationEventOptions): void;
|
|
2428
|
+
removeEventListener<T extends keyof HTMLElementEventMap>(type: T, listener: (this: object, ev: HTMLElementEventMap[T] & NavigationEvent) => void, options?: boolean | EventListenerOptions | NavigationEventOptions): void;
|
|
2429
|
+
}
|
|
2430
|
+
export interface INavigationAgent {
|
|
2431
|
+
/**
|
|
2432
|
+
* Canvas DOM-events source
|
|
2433
|
+
*/
|
|
2434
|
+
readonly canvasNavigationSource: INavigationEventSource;
|
|
2435
|
+
/**
|
|
2436
|
+
* Keyboard DOM-events source
|
|
2437
|
+
*/
|
|
2438
|
+
readonly keyboardNavigationSource: INavigationEventSource;
|
|
2439
|
+
/**
|
|
2440
|
+
* Activates canvas and keyboard navigation event sources
|
|
2441
|
+
*/
|
|
2442
|
+
setActive(value: boolean): void;
|
|
2443
|
+
/**
|
|
2444
|
+
* Gets rectangle of the navigation area
|
|
2445
|
+
*/
|
|
2446
|
+
getNavigationArea(): DOMRect;
|
|
2447
|
+
}
|
|
2448
|
+
export interface INavigationTool {
|
|
2449
|
+
/**
|
|
2450
|
+
* Gets name of this navigation tool.
|
|
2451
|
+
*/
|
|
2452
|
+
get name(): string;
|
|
2453
|
+
/**
|
|
2454
|
+
* Initialize navigation tool.
|
|
2455
|
+
*/
|
|
2456
|
+
init(navAgent: INavigationAgent, cameraControl: ICameraControl, intersectionChecker: IModelIntersectionChecker): void;
|
|
2457
|
+
/**
|
|
2458
|
+
* Activates or deactivates this navigation tool.
|
|
2459
|
+
*/
|
|
2460
|
+
setActive(isActive: boolean): void;
|
|
2461
|
+
/**
|
|
2462
|
+
* Gets the camera pivot point.
|
|
2463
|
+
*/
|
|
2464
|
+
getPivotPoint(): THREE.Vector3;
|
|
2465
|
+
/**
|
|
2466
|
+
* Sets the camera pivot point.
|
|
2467
|
+
*/
|
|
2468
|
+
setPivotPoint(pivotPoint: THREE.Vector3): void;
|
|
2469
|
+
/**
|
|
2470
|
+
* Sets the camera parameters.
|
|
2471
|
+
* @param iParams
|
|
2472
|
+
*/
|
|
2473
|
+
setCameraParameters(iParams: CameraParameters): void;
|
|
2474
|
+
/**
|
|
2475
|
+
* Gets the camera parameters.
|
|
2476
|
+
*/
|
|
2477
|
+
getCameraParameters(): CameraParameters;
|
|
2478
|
+
}
|
|
2479
|
+
export interface INavigation {
|
|
2480
|
+
/**
|
|
2481
|
+
* Register navigation tool.
|
|
2482
|
+
*/
|
|
2483
|
+
registerNavigation(navigationTool: INavigationTool): void;
|
|
2484
|
+
/**
|
|
2485
|
+
* Unregister navigation tool.
|
|
2584
2486
|
*/
|
|
2585
2487
|
unregisterNavigation(navigationTool: INavigationTool): void;
|
|
2586
2488
|
/**
|
|
@@ -2637,6 +2539,61 @@ export interface INavigation {
|
|
|
2637
2539
|
*/
|
|
2638
2540
|
resetPivotPoint(): void;
|
|
2639
2541
|
}
|
|
2542
|
+
export interface CustomSpriteMaterialParameters extends THREE.ShaderMaterialParameters {
|
|
2543
|
+
color?: THREE.ColorRepresentation | undefined;
|
|
2544
|
+
map?: THREE.Texture | null | undefined;
|
|
2545
|
+
alphaMap?: THREE.Texture | null | undefined;
|
|
2546
|
+
rotation?: number | undefined;
|
|
2547
|
+
sizeAttenuation?: boolean | undefined;
|
|
2548
|
+
fog?: boolean | undefined;
|
|
2549
|
+
center?: THREE.Vector2 | undefined;
|
|
2550
|
+
}
|
|
2551
|
+
export class CustomSpriteMaterial extends CustomMaterial {
|
|
2552
|
+
type: string;
|
|
2553
|
+
readonly isSpriteMaterial: true;
|
|
2554
|
+
|
|
2555
|
+
constructor(parameters?: CustomSpriteMaterialParameters);
|
|
2556
|
+
/**
|
|
2557
|
+
* @default new THREE.Color( 0xffffff )
|
|
2558
|
+
*/
|
|
2559
|
+
color: THREE.Color;
|
|
2560
|
+
/**
|
|
2561
|
+
* @default null
|
|
2562
|
+
*/
|
|
2563
|
+
map: THREE.Texture | null;
|
|
2564
|
+
/**
|
|
2565
|
+
* @default null
|
|
2566
|
+
*/
|
|
2567
|
+
alphaMap: THREE.Texture | null;
|
|
2568
|
+
/**
|
|
2569
|
+
* @default 0
|
|
2570
|
+
*/
|
|
2571
|
+
rotation: number;
|
|
2572
|
+
/**
|
|
2573
|
+
* @default true
|
|
2574
|
+
*/
|
|
2575
|
+
sizeAttenuation: boolean;
|
|
2576
|
+
/**
|
|
2577
|
+
* @default true
|
|
2578
|
+
*/
|
|
2579
|
+
transparent: boolean;
|
|
2580
|
+
/**
|
|
2581
|
+
* Whether the material is affected by fog. Default is true.
|
|
2582
|
+
* @default fog
|
|
2583
|
+
*/
|
|
2584
|
+
fog: boolean;
|
|
2585
|
+
/**
|
|
2586
|
+
* @default new THREE.Vector2(0.5, 0.5)
|
|
2587
|
+
*/
|
|
2588
|
+
center: THREE.Vector2;
|
|
2589
|
+
get resolution(): THREE.Vector2;
|
|
2590
|
+
set resolution(value: THREE.Vector2);
|
|
2591
|
+
protected refreshUniformsCommon(uniforms: {
|
|
2592
|
+
[uniform: string]: THREE.IUniform;
|
|
2593
|
+
}, material: CustomSpriteMaterial, renderer: THREE.WebGLRenderer): void;
|
|
2594
|
+
protected onBeforeRender(renderer: THREE.WebGLRenderer, scene: THREE.Scene, camera: THREE.Camera, geometry: THREE.BufferGeometry, material: THREE.Material, group: THREE.Group): void;
|
|
2595
|
+
copy(source: CustomSpriteMaterial): this;
|
|
2596
|
+
}
|
|
2640
2597
|
export class ModelLoadingOptions {
|
|
2641
2598
|
guid: string;
|
|
2642
2599
|
isConsolidatedModel?: boolean;
|
|
@@ -2813,6 +2770,224 @@ export class Extension extends ExtensionBase {
|
|
|
2813
2770
|
|
|
2814
2771
|
constructor(viewer: Viewer3D, options?: object);
|
|
2815
2772
|
}
|
|
2773
|
+
export class GizmoMaterials {
|
|
2774
|
+
static gizmoMaterial: THREE.MeshBasicMaterial;
|
|
2775
|
+
static matInvisible: THREE.MeshBasicMaterial;
|
|
2776
|
+
static matRed: THREE.MeshBasicMaterial;
|
|
2777
|
+
static matGreen: THREE.MeshBasicMaterial;
|
|
2778
|
+
static matBlue: THREE.MeshBasicMaterial;
|
|
2779
|
+
static matYellow: THREE.MeshBasicMaterial;
|
|
2780
|
+
static matViolet: THREE.MeshBasicMaterial;
|
|
2781
|
+
static matYellowTransparent: THREE.MeshBasicMaterial;
|
|
2782
|
+
static init(): void;
|
|
2783
|
+
}
|
|
2784
|
+
export interface IGizmoObject extends THREE.Object3D {
|
|
2785
|
+
getHovered(): boolean;
|
|
2786
|
+
setHovered(value: boolean): void;
|
|
2787
|
+
getActive(): boolean;
|
|
2788
|
+
setActive(value: boolean): void;
|
|
2789
|
+
dispose(): void;
|
|
2790
|
+
}
|
|
2791
|
+
export class GizmoObject extends THREE.Object3D implements IGizmoObject {
|
|
2792
|
+
protected _meshes: THREE.Mesh[];
|
|
2793
|
+
readonly baseMaterial: THREE.Material;
|
|
2794
|
+
readonly hoverMaterial: THREE.Material;
|
|
2795
|
+
readonly activeMaterial: THREE.Material;
|
|
2796
|
+
|
|
2797
|
+
constructor(_meshes: THREE.Mesh[], baseMaterial?: THREE.Material, hoverMaterial?: THREE.Material, activeMaterial?: THREE.Material);
|
|
2798
|
+
getHovered(): boolean;
|
|
2799
|
+
setHovered(value: boolean): void;
|
|
2800
|
+
getActive(): boolean;
|
|
2801
|
+
setActive(value: boolean): void;
|
|
2802
|
+
dispose(): void;
|
|
2803
|
+
raycast(raycaster: THREE.Raycaster, intersects: THREE.Intersection<THREE.Object3D<THREE.Event>>[]): void;
|
|
2804
|
+
}
|
|
2805
|
+
export abstract class GizmoAxis extends THREE.Object3D implements IGizmoObject {
|
|
2806
|
+
readonly handle: IGizmoObject;
|
|
2807
|
+
readonly picker?: IGizmoObject;
|
|
2808
|
+
readonly helper?: IGizmoObject;
|
|
2809
|
+
protected _isHovered: boolean;
|
|
2810
|
+
protected _isActive: boolean;
|
|
2811
|
+
protected _plane: THREE.Plane;
|
|
2812
|
+
protected _axisDir: THREE.Vector3;
|
|
2813
|
+
protected _raycaster: THREE.Raycaster;
|
|
2814
|
+
protected _worldPositionStart: THREE.Vector3;
|
|
2815
|
+
protected _worldQuaternionStart: THREE.Quaternion;
|
|
2816
|
+
protected _worldAxisDir: THREE.Vector3;
|
|
2817
|
+
protected _startPoint: THREE.Vector3;
|
|
2818
|
+
protected _endPoint: THREE.Vector3;
|
|
2819
|
+
getActive(): boolean;
|
|
2820
|
+
setActive(value: boolean): void;
|
|
2821
|
+
getHovered(): boolean;
|
|
2822
|
+
setHovered(value: boolean): void;
|
|
2823
|
+
dispose(): void;
|
|
2824
|
+
raycast(raycaster: THREE.Raycaster, intersects: THREE.Intersection<THREE.Object3D<THREE.Event>>[]): void;
|
|
2825
|
+
abstract moveByNdcPt(ndcPos: THREE.Vector2, camera: THREE.Camera): THREE.Matrix4;
|
|
2826
|
+
protected abstract updateGizmoPlane(camera: THREE.Camera): void;
|
|
2827
|
+
protected setStartPt(ndcPos: THREE.Vector2, camera: THREE.Camera): void;
|
|
2828
|
+
}
|
|
2829
|
+
export class GizmoTranslationAxis extends GizmoAxis {
|
|
2830
|
+
readonly handle: IGizmoObject;
|
|
2831
|
+
readonly picker?: IGizmoObject;
|
|
2832
|
+
readonly helper?: IGizmoObject;
|
|
2833
|
+
|
|
2834
|
+
constructor(axisDir: THREE.Vector3, handle: IGizmoObject, picker?: IGizmoObject, helper?: IGizmoObject);
|
|
2835
|
+
moveByNdcPt(ndcPos: THREE.Vector2, camera: THREE.Camera): THREE.Matrix4;
|
|
2836
|
+
protected updateGizmoPlane(camera: THREE.Camera): void;
|
|
2837
|
+
}
|
|
2838
|
+
export class GizmoRotationAxis extends GizmoAxis {
|
|
2839
|
+
readonly handle: IGizmoObject;
|
|
2840
|
+
readonly picker?: IGizmoObject;
|
|
2841
|
+
readonly helper?: IGizmoObject;
|
|
2842
|
+
moveByNdcPt(ndcPos: THREE.Vector2, camera: THREE.Camera): THREE.Matrix4;
|
|
2843
|
+
protected updateGizmoPlane(camera: THREE.Camera): void;
|
|
2844
|
+
}
|
|
2845
|
+
export class GizmoScaleAxis extends GizmoAxis {
|
|
2846
|
+
readonly handle: IGizmoObject;
|
|
2847
|
+
readonly picker?: IGizmoObject;
|
|
2848
|
+
readonly helper?: IGizmoObject;
|
|
2849
|
+
moveByNdcPt(ndcPos: THREE.Vector2, camera: THREE.Camera): THREE.Matrix4;
|
|
2850
|
+
protected updateGizmoPlane(camera: THREE.Camera): void;
|
|
2851
|
+
}
|
|
2852
|
+
export class GizmoControl extends THREE.Object3D {
|
|
2853
|
+
|
|
2854
|
+
constructor(camera: THREE.Camera, navAgent: INavigationAgent);
|
|
2855
|
+
attachTo(object: THREE.Object3D, asChild?: boolean): void;
|
|
2856
|
+
detach(): void;
|
|
2857
|
+
addAxis(axis: GizmoAxis): void;
|
|
2858
|
+
dispose(): void;
|
|
2859
|
+
updateMatrixWorld(force?: boolean): void;
|
|
2860
|
+
updateGizmoOffset(position?: THREE.Vector3, quaternion?: THREE.Quaternion): void;
|
|
2861
|
+
}
|
|
2862
|
+
export enum GizmoAxisDir {
|
|
2863
|
+
NONE = 0,
|
|
2864
|
+
X = 1,
|
|
2865
|
+
Y = 2,
|
|
2866
|
+
Z = 4,
|
|
2867
|
+
XY = 3,
|
|
2868
|
+
YZ = 6,
|
|
2869
|
+
XZ = 5,
|
|
2870
|
+
XYZ = 7
|
|
2871
|
+
}
|
|
2872
|
+
export class GizmoBuilder {
|
|
2873
|
+
static build(camera: THREE.Camera, navAgent: INavigationAgent, translation?: GizmoAxisDir, rotation?: GizmoAxisDir, scale?: GizmoAxisDir): GizmoControl;
|
|
2874
|
+
static buildTranslationAxis(axisDir: THREE.Vector3, handleBaseMatrial?: THREE.Material, handleHoveredMaterial?: THREE.Material, handleSelectedMaterial?: THREE.Material, pickerBaseMatrial?: THREE.Material, pickerHoveredMaterial?: THREE.Material, pickerSelectedMaterial?: THREE.Material): GizmoAxis;
|
|
2875
|
+
static buildRotationAxis(axisDir: THREE.Vector3, handleBaseMatrial?: THREE.Material, handleHoveredMaterial?: THREE.Material, handleSelectedMaterial?: THREE.Material, pickerBaseMatrial?: THREE.Material, pickerHoveredMaterial?: THREE.Material, pickerSelectedMaterial?: THREE.Material): GizmoAxis;
|
|
2876
|
+
static buildScaleAxis(axisDir: THREE.Vector3, handleBaseMatrial?: THREE.Material, handleHoveredMaterial?: THREE.Material, handleSelectedMaterial?: THREE.Material): GizmoAxis;
|
|
2877
|
+
}
|
|
2878
|
+
export interface LabelSpriteParameters {
|
|
2879
|
+
text?: string | undefined;
|
|
2880
|
+
sizeAttenuation?: boolean | undefined;
|
|
2881
|
+
fontFace?: string | FontFace | undefined;
|
|
2882
|
+
fontSize?: number | undefined;
|
|
2883
|
+
borderColor?: Color | undefined;
|
|
2884
|
+
backgroundColor?: Color | undefined;
|
|
2885
|
+
borderThickness?: number | undefined;
|
|
2886
|
+
borderRadius?: number | undefined;
|
|
2887
|
+
textColor?: Color | undefined;
|
|
2888
|
+
textPadding?: THREE.Vector4Tuple | undefined;
|
|
2889
|
+
}
|
|
2890
|
+
export class LabelSprite extends THREE.Sprite {
|
|
2891
|
+
readonly extraHeightFactor = 1.4;
|
|
2892
|
+
|
|
2893
|
+
constructor(parameters: LabelSpriteParameters);
|
|
2894
|
+
get sizeAttenuation(): boolean;
|
|
2895
|
+
set sizeAttenuation(value: boolean);
|
|
2896
|
+
/**
|
|
2897
|
+
* @default ''
|
|
2898
|
+
*/
|
|
2899
|
+
get text(): string;
|
|
2900
|
+
set text(value: string);
|
|
2901
|
+
/**
|
|
2902
|
+
* @default 'Roboto, sans-serif'
|
|
2903
|
+
*/
|
|
2904
|
+
get fontFace(): string | FontFace;
|
|
2905
|
+
set fontFace(value: string | FontFace);
|
|
2906
|
+
/**
|
|
2907
|
+
* @default 12
|
|
2908
|
+
*/
|
|
2909
|
+
get fontSize(): number;
|
|
2910
|
+
set fontSize(value: number);
|
|
2911
|
+
/**
|
|
2912
|
+
* @default 2
|
|
2913
|
+
*/
|
|
2914
|
+
get borderThickness(): number;
|
|
2915
|
+
set borderThickness(value: number);
|
|
2916
|
+
/**
|
|
2917
|
+
* @default new Color(0, 0, 0, 1.0)
|
|
2918
|
+
*/
|
|
2919
|
+
get borderColor(): Color;
|
|
2920
|
+
set borderColor(value: Color);
|
|
2921
|
+
/**
|
|
2922
|
+
* @default 1
|
|
2923
|
+
*/
|
|
2924
|
+
get borderRadius(): number;
|
|
2925
|
+
set borderRadius(value: number);
|
|
2926
|
+
/**
|
|
2927
|
+
* @default new Color(1.0, 1.0, 1.0, 1.0)
|
|
2928
|
+
*/
|
|
2929
|
+
get backgroundColor(): Color;
|
|
2930
|
+
set backgroundColor(value: Color);
|
|
2931
|
+
/**
|
|
2932
|
+
* @default new Color(0, 0, 0, 1.0)
|
|
2933
|
+
*/
|
|
2934
|
+
get textColor(): Color;
|
|
2935
|
+
set textColor(value: Color);
|
|
2936
|
+
/**
|
|
2937
|
+
* Label text padding: left, top, right, bottom
|
|
2938
|
+
* @default [0, 0, 0, 0]
|
|
2939
|
+
*/
|
|
2940
|
+
get textPadding(): THREE.Vector4Tuple;
|
|
2941
|
+
set textPadding(value: THREE.Vector4Tuple);
|
|
2942
|
+
dispose(): void;
|
|
2943
|
+
}
|
|
2944
|
+
export interface MeshPointMaterialParameters extends THREE.ShaderMaterialParameters {
|
|
2945
|
+
sizeAttenuation?: boolean | undefined;
|
|
2946
|
+
}
|
|
2947
|
+
export class MeshPointMaterial extends CustomMaterial {
|
|
2948
|
+
|
|
2949
|
+
constructor(parameters?: MeshPointMaterialParameters);
|
|
2950
|
+
/**
|
|
2951
|
+
* @default true
|
|
2952
|
+
*/
|
|
2953
|
+
sizeAttenuation: boolean;
|
|
2954
|
+
get resolution(): THREE.Vector2;
|
|
2955
|
+
set resolution(value: THREE.Vector2);
|
|
2956
|
+
protected refreshUniformsCommon(uniforms: {
|
|
2957
|
+
[uniform: string]: THREE.IUniform;
|
|
2958
|
+
}, material: MeshPointMaterial, renderer: THREE.WebGLRenderer): void;
|
|
2959
|
+
protected onBeforeRender(renderer: THREE.WebGLRenderer, scene: THREE.Scene, camera: THREE.Camera, geometry: THREE.BufferGeometry, material: THREE.Material, group: THREE.Group): void;
|
|
2960
|
+
copy(source: MeshPointMaterial): this;
|
|
2961
|
+
}
|
|
2962
|
+
export interface MeshPointParamter {
|
|
2963
|
+
point?: THREE.Vector3;
|
|
2964
|
+
color?: Color;
|
|
2965
|
+
size?: number;
|
|
2966
|
+
}
|
|
2967
|
+
export class MeshPoints extends THREE.Mesh {
|
|
2968
|
+
geometry: THREE.InstancedBufferGeometry;
|
|
2969
|
+
material: MeshPointMaterial;
|
|
2970
|
+
|
|
2971
|
+
constructor();
|
|
2972
|
+
/**
|
|
2973
|
+
* @default new Color( 1,1,1,1 )
|
|
2974
|
+
*/
|
|
2975
|
+
color: Color;
|
|
2976
|
+
/**
|
|
2977
|
+
* @default 1
|
|
2978
|
+
*/
|
|
2979
|
+
pointSize: number;
|
|
2980
|
+
/**
|
|
2981
|
+
* @default new THREE.Vector3(0, 0, 0)
|
|
2982
|
+
*/
|
|
2983
|
+
point: THREE.Vector3;
|
|
2984
|
+
addPoint(pointParameter?: MeshPointParamter): number;
|
|
2985
|
+
updatePoint(index: number, pointParameter: MeshPointParamter): void;
|
|
2986
|
+
removePoint(index: number): this;
|
|
2987
|
+
updateAttributes(): void;
|
|
2988
|
+
dispose(): void;
|
|
2989
|
+
raycast(raycaster: THREE.Raycaster, intersects: THREE.Intersection<THREE.Object3D<THREE.Event>>[]): void;
|
|
2990
|
+
}
|
|
2816
2991
|
export interface IWindowStyle {
|
|
2817
2992
|
width: string;
|
|
2818
2993
|
height: string;
|
|
@@ -2840,30 +3015,6 @@ export class Dragger {
|
|
|
2840
3015
|
constructor(allowedDraggableElement: HTMLElement, draggableContainer: HTMLElement, containerToRestriction: HTMLElement, windowStater?: WindowStater);
|
|
2841
3016
|
get windowState(): IWindowStyle | null;
|
|
2842
3017
|
}
|
|
2843
|
-
export namespace Viewer3DIcons {
|
|
2844
|
-
const VIEWER_SETTINGS_ICON: string;
|
|
2845
|
-
const VIEWER_MODEL_BROWSER_ICON: string;
|
|
2846
|
-
const VIEWER_FULL_SCREEN_ICON: string;
|
|
2847
|
-
const VIEWER_COLLAPSE_ICON: string;
|
|
2848
|
-
const VIEWER_ELEMENT_PROPERTIES_ICON: string;
|
|
2849
|
-
const VIEWER_ADD_CLIPPING_PLANE_ICON: string;
|
|
2850
|
-
const VIEWER_CLIPPING_FLIP_ICON: string;
|
|
2851
|
-
const VIEWER_DELETE_CLIPPING_PLANE_ICON: string;
|
|
2852
|
-
const VIEWER_CLIPPING_CUBE_ICON: string;
|
|
2853
|
-
const VIEWER_DISABLED_DELETE_CLIPPING_PLANE_ICON: string;
|
|
2854
|
-
const VIEWER_DISABLED_CLIPPING_FLIP_ICON: string;
|
|
2855
|
-
const VIEWER_ADD_REMARK_ICON: string;
|
|
2856
|
-
}
|
|
2857
|
-
export namespace ViewerGeneralIcons {
|
|
2858
|
-
const ZOOM_IN: string;
|
|
2859
|
-
const ZOOM_OUT: string;
|
|
2860
|
-
const CLOSE: string;
|
|
2861
|
-
const STRETCH_WINDOW: string;
|
|
2862
|
-
const EXPAND_TREE: string;
|
|
2863
|
-
const COLLAPSE_TREE: string;
|
|
2864
|
-
const ARROW_DROP_DOWN: string;
|
|
2865
|
-
const ARROW_DROP_RIGHT: string;
|
|
2866
|
-
}
|
|
2867
3018
|
export class Button extends Control {
|
|
2868
3019
|
|
|
2869
3020
|
constructor(id: string);
|