@pilotdev/pilot-web-3d 1.0.1 → 1.0.2
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 +106 -91
- package/package.json +1 -1
package/index.d.ts
CHANGED
|
@@ -68,98 +68,113 @@
|
|
|
68
68
|
clearListeners(): void;
|
|
69
69
|
}
|
|
70
70
|
|
|
71
|
+
export type ViewPointType = {
|
|
72
|
+
position: THREE.Vector3;
|
|
73
|
+
direction: THREE.Vector3;
|
|
74
|
+
};
|
|
75
|
+
export var ViewerInstance: Viewer3D;
|
|
71
76
|
export class Viewer3D extends ViewerBase {
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
77
|
+
start(): number;
|
|
78
|
+
finish(): void;
|
|
79
|
+
loadModel(buffer: ArrayBuffer, options: {}, onSuccessCallback: SuccessCallback, onErrorCallback: ErrorCallback): void;
|
|
80
|
+
unloadModel(model: string | ModelPart): void;
|
|
81
|
+
/**
|
|
82
|
+
* Returns all models loaded in the viewer.
|
|
83
|
+
* @returns {ModelPart[]} - An array of visible and hidden models
|
|
84
|
+
*/
|
|
85
|
+
getAllModels(): ModelPart[];
|
|
86
|
+
/**
|
|
87
|
+
* @returns {ModelPart[]} - An array of visible models
|
|
88
|
+
*/
|
|
89
|
+
getVisibleModels(): ModelPart[];
|
|
90
|
+
/**
|
|
91
|
+
* @returns {ModelPart[]} - An array of hidden models
|
|
92
|
+
*/
|
|
93
|
+
getHiddenModels(): ModelPart[];
|
|
94
|
+
/**
|
|
95
|
+
* Temporarily remove a model from the Viewer, but keep loaders, materials, and geometry alive.
|
|
96
|
+
* @param {string | ModelPart} model - model id or ModelPart object
|
|
97
|
+
* @returns {boolean} true indicates success, i.e., modelId referred to a visible model that is now hidden
|
|
98
|
+
*/
|
|
99
|
+
hideModel(model: string | ModelPart): void;
|
|
100
|
+
/**
|
|
101
|
+
*
|
|
102
|
+
* @param {string | ModelPart} model - model id or ModelPart object
|
|
103
|
+
*/
|
|
104
|
+
showModel(model: string | ModelPart): void;
|
|
105
|
+
/**
|
|
106
|
+
* Returns the current selection.
|
|
107
|
+
* @returns {Selection[]} Array of the currently selected nodes.
|
|
108
|
+
*/
|
|
109
|
+
getSelection(): Selection[];
|
|
110
|
+
/**
|
|
111
|
+
* Hide elements
|
|
112
|
+
* @param {string[]|string} elementIds - An array of elements (elementIds) or just a single element.
|
|
113
|
+
* @param {string | ModelPart} model - id of the model that contains the elementIds. By default uses the initial model loaded into the scene.
|
|
114
|
+
*/
|
|
115
|
+
hide(elementIds: string[] | string, model?: string | ModelPart): void;
|
|
116
|
+
/**
|
|
117
|
+
*
|
|
118
|
+
*/
|
|
119
|
+
hideAll(): void;
|
|
120
|
+
/**
|
|
121
|
+
* Ensures the passed in elements (elementIds) are shown.
|
|
122
|
+
*
|
|
123
|
+
* @param {string[] | string} elementIds - An array of elements (elementIds) or just a single node.
|
|
124
|
+
* @param {string | ModelPart} model - id of the model that contains the elementId. By default uses the initial model loaded into the scene.
|
|
125
|
+
*
|
|
126
|
+
*/
|
|
127
|
+
show(elementIds: string[] | string, model?: string | ModelPart): void;
|
|
128
|
+
/**
|
|
129
|
+
*
|
|
130
|
+
*/
|
|
131
|
+
showAll(): void;
|
|
132
|
+
/**
|
|
133
|
+
* Toggles the selection for a given elementIds.
|
|
134
|
+
* If it was unselected, it is selected.
|
|
135
|
+
* If it was selected, it is unselected.
|
|
136
|
+
*
|
|
137
|
+
* @param {string} elementIds
|
|
138
|
+
* @param {string | ModelPart} model - model that contains the elementIds. Uses the initial model loaded by default.
|
|
139
|
+
*/
|
|
140
|
+
toggleSelect(elementIds: string[] | string, model?: string | ModelPart): void;
|
|
141
|
+
/**
|
|
142
|
+
* Selects the array of ids. You can also pass in a single id instead of an array.
|
|
143
|
+
*
|
|
144
|
+
* @param {string[] | string} elementIds - element or array of elements to select.
|
|
145
|
+
* @param {string | ModelPart} model - model id or the model instance containing the ids.
|
|
146
|
+
*
|
|
147
|
+
*/
|
|
148
|
+
select(elementIds: string[] | string, model?: string | ModelPart): void;
|
|
149
|
+
/**
|
|
150
|
+
* Unselect all nodes in all models
|
|
151
|
+
*/
|
|
152
|
+
clearSelection(): void;
|
|
153
|
+
/**
|
|
154
|
+
*
|
|
155
|
+
* @param {string[] | string} elementIds - element or array of elements to change color.
|
|
156
|
+
* @param color -
|
|
157
|
+
* @param {string | ModelPart} model - id of the model or model instance containing the ids.
|
|
158
|
+
*/
|
|
159
|
+
setColor(elementIds: string[] | string, color: THREE.Color, model?: string | ModelPart): void;
|
|
160
|
+
/**
|
|
161
|
+
*
|
|
162
|
+
* @param {string | ModelPart} model - id of the model or model instance.
|
|
163
|
+
*/
|
|
164
|
+
clearColors(model?: string | ModelPart): void;
|
|
165
|
+
/**
|
|
166
|
+
* Sets the cameras point of view
|
|
167
|
+
* @param viewPoint camera position and direction
|
|
168
|
+
*/
|
|
169
|
+
setCameraViewPoint(viewPoint: ViewPointType): void;
|
|
170
|
+
/**
|
|
171
|
+
* Gets the cameras point of view
|
|
172
|
+
* @returns camera position and direction
|
|
173
|
+
*/
|
|
174
|
+
getCameraViewPoint(): ViewPointType;
|
|
160
175
|
}
|
|
161
|
-
|
|
162
|
-
export
|
|
176
|
+
|
|
177
|
+
export abstract class ViewerBase {
|
|
163
178
|
container: HTMLElement;
|
|
164
179
|
layerManagers: Map<number, ILayerManager>;
|
|
165
180
|
extensionsLoader: ExtensionLoader;
|
|
@@ -184,7 +199,7 @@
|
|
|
184
199
|
onPostExtensionLoad(extension: Extension): void;
|
|
185
200
|
}
|
|
186
201
|
|
|
187
|
-
export
|
|
202
|
+
export class ExtensionLoader {
|
|
188
203
|
loadExtension(extensionId: string): Promise<Extension>;
|
|
189
204
|
unloadExtension(extensionId: string): Promise<boolean>;
|
|
190
205
|
getExtensions(): Extension[];
|