@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.
Files changed (2) hide show
  1. package/index.d.ts +106 -91
  2. 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
- start(): number;
73
- finish(): void;
74
- loadModel(buffer: ArrayBuffer, options: {}, onSuccessCallback: SuccessCallback, onErrorCallback: ErrorCallback): void;
75
- unloadModel(model: string | ModelPart): void;
76
- /**
77
- * Returns all models loaded in the viewer.
78
- * @returns {ModelPart[]} - An array of visible and hidden models
79
- */
80
- getAllModels(): ModelPart[];
81
- /**
82
- * @returns {ModelPart[]} - An array of visible models
83
- */
84
- getVisibleModels(): ModelPart[];
85
- /**
86
- * @returns {ModelPart[]} - An array of hidden models
87
- */
88
- getHiddenModels(): ModelPart[];
89
- /**
90
- * Temporarily remove a model from the Viewer, but keep loaders, materials, and geometry alive.
91
- * @param {string | ModelPart} model - model id or ModelPart object
92
- * @returns {boolean} true indicates success, i.e., modelId referred to a visible model that is now hidden
93
- */
94
- hideModel(model: string | ModelPart): void;
95
- /**
96
- *
97
- * @param {string | ModelPart} model - model id or ModelPart object
98
- */
99
- showModel(model: string | ModelPart): void;
100
- /**
101
- * Returns the current selection.
102
- * @returns {Selection[]} Array of the currently selected nodes.
103
- */
104
- getSelection(): Selection[];
105
- /**
106
- * Hide elements
107
- * @param {string[]|string} elementIds - An array of elements (elementIds) or just a single element.
108
- * @param {string | ModelPart} model - id of the model that contains the elementIds. By default uses the initial model loaded into the scene.
109
- */
110
- hide(elementIds: string[] | string, model?: string | ModelPart): void;
111
- /**
112
- *
113
- */
114
- hideAll(): void;
115
- /**
116
- * Ensures the passed in elements (elementIds) are shown.
117
- *
118
- * @param {string[] | string} elementIds - An array of elements (elementIds) or just a single node.
119
- * @param {string | ModelPart} model - id of the model that contains the elementId. By default uses the initial model loaded into the scene.
120
- *
121
- */
122
- show(elementIds: string[] | string, model?: string | ModelPart): void;
123
- /**
124
- *
125
- */
126
- showAll(): void;
127
- /**
128
- * Toggles the selection for a given elementIds.
129
- * If it was unselected, it is selected.
130
- * If it was selected, it is unselected.
131
- *
132
- * @param {string} elementIds
133
- * @param {string | ModelPart} model - model that contains the elementIds. Uses the initial model loaded by default.
134
- */
135
- toggleSelect(elementIds: string[] | string, model?: string | ModelPart): void;
136
- /**
137
- * Selects the array of ids. You can also pass in a single id instead of an array.
138
- *
139
- * @param {string[] | string} elementIds - element or array of elements to select.
140
- * @param {string | ModelPart} model - model id or the model instance containing the ids.
141
- *
142
- */
143
- select(elementIds: string[] | string, model?: string | ModelPart): void;
144
- /**
145
- * Unselect all nodes in all models
146
- */
147
- clearSelection(): void;
148
- /**
149
- *
150
- * @param {string[] | string} elementIds - element or array of elements to change color.
151
- * @param color -
152
- * @param {string | ModelPart} model - id of the model or model instance containing the ids.
153
- */
154
- setColor(elementIds: string[] | string, color: THREE.Color, model?: string | ModelPart): void;
155
- /**
156
- *
157
- * @param {string | ModelPart} model - id of the model or model instance.
158
- */
159
- clearColors(model?: string | ModelPart): void;
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 abstract class ViewerBase {
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 class ExtensionLoader {
202
+ export class ExtensionLoader {
188
203
  loadExtension(extensionId: string): Promise<Extension>;
189
204
  unloadExtension(extensionId: string): Promise<boolean>;
190
205
  getExtensions(): Extension[];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pilotdev/pilot-web-3d",
3
- "version": "1.0.1",
3
+ "version": "1.0.2",
4
4
  "description": "TypeScript definitions for ASCON pilotweb3d.js library",
5
5
  "main": "",
6
6
  "types": "index.d.ts",