@pilotdev/pilot-web-3d 1.0.2 → 1.0.3
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 +110 -96
- package/package.json +13 -13
package/index.d.ts
CHANGED
|
@@ -17,15 +17,97 @@
|
|
|
17
17
|
onPostExtensionLoad(extension: Extension): void;
|
|
18
18
|
}
|
|
19
19
|
|
|
20
|
+
export class Model {
|
|
21
|
+
/**
|
|
22
|
+
* Returns all model parts loaded in the viewer.
|
|
23
|
+
* @returns {ModelPart[]} - An array of visible and hidden model parts
|
|
24
|
+
*/
|
|
25
|
+
getAllModelParts(): ModelPart[];
|
|
26
|
+
/**
|
|
27
|
+
* Gets visible model parst
|
|
28
|
+
* @returns {ModelPart[]} - An array of visible model parts
|
|
29
|
+
*/
|
|
30
|
+
getVisibleModelParts(): ModelPart[];
|
|
31
|
+
/**
|
|
32
|
+
* Gets hidden model parts
|
|
33
|
+
* @returns {ModelPart[]} - An array of hidden model parts
|
|
34
|
+
*/
|
|
35
|
+
getHiddenModelParts(): ModelPart[];
|
|
36
|
+
/**
|
|
37
|
+
* Temporarily remove a model part from the Viewer, but keep loaders, materials, and geometry alive.
|
|
38
|
+
* @param {string | ModelPart} modelPart - model part id or model part instance
|
|
39
|
+
*/
|
|
40
|
+
hideModelPart(modelPart: string | ModelPart): void;
|
|
41
|
+
/**
|
|
42
|
+
* Shows hidden model part
|
|
43
|
+
* @param {string | ModelPart} modelPart - model part id or model part instance
|
|
44
|
+
*/
|
|
45
|
+
showModelPart(modelPart: string | ModelPart): void;
|
|
46
|
+
/**
|
|
47
|
+
* Hide model elements
|
|
48
|
+
* @param {string[]|string} elementIds - An array of model elements id or just a single model element id.
|
|
49
|
+
* @param {string | ModelPart} modelPart - id of the model part that contains the element ids. By default uses the initial model part loaded into the scene.
|
|
50
|
+
*/
|
|
51
|
+
hide(elementIds: string[] | string, modelPart?: string | ModelPart): void;
|
|
52
|
+
/**
|
|
53
|
+
* Hides all elements and model parts from the viewer
|
|
54
|
+
*/
|
|
55
|
+
hideAll(): void;
|
|
56
|
+
/**
|
|
57
|
+
* Ensures the passed in elements are shown.
|
|
58
|
+
*
|
|
59
|
+
* @param {string[] | string} elementIds - An array of model elements or just a single model element.
|
|
60
|
+
* @param {string | ModelPart} modelPart - id of the model part that contains the model element id. By default uses the initial model part loaded into the scene.
|
|
61
|
+
*
|
|
62
|
+
*/
|
|
63
|
+
show(elementIds: string[] | string, modelPart?: string | ModelPart): void;
|
|
64
|
+
/**
|
|
65
|
+
* Shows all elements and model parts
|
|
66
|
+
*/
|
|
67
|
+
showAll(): void;
|
|
68
|
+
/**
|
|
69
|
+
* Selects the array of model elements. You can also pass in a single model element id instead of an array.
|
|
70
|
+
*
|
|
71
|
+
* @param {string[] | string} elementIds - element or array of elements to select.
|
|
72
|
+
* @param {string | ModelPart} modelPart - model part id or the model part instance containing the elements.
|
|
73
|
+
*
|
|
74
|
+
*/
|
|
75
|
+
select(elementIds: string[] | string, modelPart?: string | ModelPart): void;
|
|
76
|
+
/**
|
|
77
|
+
* Unselect all model elements in all model parts
|
|
78
|
+
*/
|
|
79
|
+
clearSelection(): void;
|
|
80
|
+
/**
|
|
81
|
+
* Returns the current selection.
|
|
82
|
+
* @returns {ModelElementIds[]} Array of the currently selected model elements.
|
|
83
|
+
*/
|
|
84
|
+
getSelection(): ModelElementIds[];
|
|
85
|
+
/**
|
|
86
|
+
* Sets color to elements
|
|
87
|
+
* @param {string[] | string} elementIds - element or array of elements to change color.
|
|
88
|
+
* @param {number} r - red
|
|
89
|
+
* @param {number} g - green
|
|
90
|
+
* @param {number} b - blue
|
|
91
|
+
* @param {number} a - alpha
|
|
92
|
+
* @param {string | ModelPart} modelPart - id of the model part or model part instance containing the elements.
|
|
93
|
+
*/
|
|
94
|
+
setColor(elementIds: string[] | string, r: number, g: number, b: number, a: number, modelPart?: string | ModelPart): void;
|
|
95
|
+
/**
|
|
96
|
+
* Resets all changed colors for all elements in all model parts
|
|
97
|
+
* @param {string | ModelPart} model - id of the model part or model part instance.
|
|
98
|
+
*/
|
|
99
|
+
clearColors(model?: string | ModelPart): void;
|
|
100
|
+
}
|
|
101
|
+
|
|
20
102
|
export class ModelPart {
|
|
21
103
|
get id(): string;
|
|
22
104
|
get elementTree(): ModelElementTree;
|
|
23
105
|
dispose(): void;
|
|
24
106
|
}
|
|
25
107
|
|
|
26
|
-
export class
|
|
27
|
-
|
|
28
|
-
|
|
108
|
+
export class ModelElementIds {
|
|
109
|
+
modelPartId: string;
|
|
110
|
+
elementIds: string[];
|
|
29
111
|
}
|
|
30
112
|
|
|
31
113
|
export class ModelElementTree {
|
|
@@ -68,7 +150,7 @@
|
|
|
68
150
|
clearListeners(): void;
|
|
69
151
|
}
|
|
70
152
|
|
|
71
|
-
export type
|
|
153
|
+
export type CameraPosition = {
|
|
72
154
|
position: THREE.Vector3;
|
|
73
155
|
direction: THREE.Vector3;
|
|
74
156
|
};
|
|
@@ -76,102 +158,41 @@
|
|
|
76
158
|
export class Viewer3D extends ViewerBase {
|
|
77
159
|
start(): number;
|
|
78
160
|
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
161
|
/**
|
|
121
|
-
*
|
|
122
|
-
*
|
|
123
|
-
* @param
|
|
124
|
-
* @param
|
|
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
|
-
*
|
|
162
|
+
* Loads new model part to the viewer
|
|
163
|
+
* @param buffer
|
|
164
|
+
* @param options
|
|
165
|
+
* @param onSuccessCallback
|
|
166
|
+
* @param onErrorCallback
|
|
147
167
|
*/
|
|
148
|
-
|
|
168
|
+
loadModelPart(buffer: ArrayBuffer, options: {}, onSuccessCallback: SuccessCallback, onErrorCallback: ErrorCallback): void;
|
|
149
169
|
/**
|
|
150
|
-
*
|
|
170
|
+
* unloads model part from the viewer
|
|
171
|
+
* @param modelPart - model part id or model part instance
|
|
151
172
|
*/
|
|
152
|
-
|
|
173
|
+
unloadModelPart(modelPart: string | ModelPart): void;
|
|
153
174
|
/**
|
|
154
|
-
*
|
|
155
|
-
* @
|
|
156
|
-
* @param color -
|
|
157
|
-
* @param {string | ModelPart} model - id of the model or model instance containing the ids.
|
|
175
|
+
* Returns general model
|
|
176
|
+
* @returns { Model } - general model
|
|
158
177
|
*/
|
|
159
|
-
|
|
178
|
+
get model(): Model;
|
|
160
179
|
/**
|
|
161
|
-
*
|
|
162
|
-
* @param
|
|
180
|
+
* Sets the cameras point of view.
|
|
181
|
+
* @param cameraPosition camera position and direction.
|
|
163
182
|
*/
|
|
164
|
-
|
|
183
|
+
setCameraPosition(cameraPosition: CameraPosition): void;
|
|
165
184
|
/**
|
|
166
|
-
*
|
|
167
|
-
* @
|
|
185
|
+
* Gets the cameras point of view.
|
|
186
|
+
* @returns camera position and direction.
|
|
168
187
|
*/
|
|
169
|
-
|
|
188
|
+
getCameraPosition(): CameraPosition;
|
|
170
189
|
/**
|
|
171
|
-
*
|
|
172
|
-
* @
|
|
190
|
+
* Makes screenshot
|
|
191
|
+
* @param {string} [mimeType=image/png] Image MIME type.
|
|
192
|
+
* @param {number} [qualityArgument=1.0] Image quality to be used for image/jpeg or image/webp formats.
|
|
193
|
+
* @returns Blob object representing render image.
|
|
173
194
|
*/
|
|
174
|
-
|
|
195
|
+
makeScreenshot(mimeType?: string, quality?: number): Promise<Blob>;
|
|
175
196
|
}
|
|
176
197
|
|
|
177
198
|
export abstract class ViewerBase {
|
|
@@ -188,14 +209,7 @@
|
|
|
188
209
|
*
|
|
189
210
|
*/
|
|
190
211
|
finish(): void;
|
|
191
|
-
|
|
192
|
-
*
|
|
193
|
-
* @param buffer
|
|
194
|
-
* @param options
|
|
195
|
-
* @param onSuccessCallback
|
|
196
|
-
* @param onErrorCallback
|
|
197
|
-
*/
|
|
198
|
-
loadModel(buffer: ArrayBuffer, options: {}, onSuccessCallback: SuccessCallback, onErrorCallback: ErrorCallback): void;
|
|
212
|
+
|
|
199
213
|
onPostExtensionLoad(extension: Extension): void;
|
|
200
214
|
}
|
|
201
215
|
|
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@pilotdev/pilot-web-3d",
|
|
3
|
-
"version": "1.0.
|
|
4
|
-
"description": "TypeScript definitions for ASCON
|
|
5
|
-
"main": "",
|
|
6
|
-
"types": "index.d.ts",
|
|
7
|
-
"scripts": {},
|
|
8
|
-
"license": "MIT",
|
|
9
|
-
"typeScriptVersion": "4.4.3",
|
|
10
|
-
"
|
|
11
|
-
"@types/three": "0.135.0"
|
|
12
|
-
}
|
|
13
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@pilotdev/pilot-web-3d",
|
|
3
|
+
"version": "1.0.3",
|
|
4
|
+
"description": "TypeScript definitions for ASCON Pilot.Web.3D component",
|
|
5
|
+
"main": "",
|
|
6
|
+
"types": "index.d.ts",
|
|
7
|
+
"scripts": {},
|
|
8
|
+
"license": "MIT",
|
|
9
|
+
"typeScriptVersion": "4.4.3",
|
|
10
|
+
"dependencies": {
|
|
11
|
+
"@types/three": "0.135.0"
|
|
12
|
+
}
|
|
13
|
+
}
|