@bimdata/viewer 1.9.0-rc.53 → 1.9.0-rc.56

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 CHANGED
@@ -14,7 +14,7 @@ declare namespace BDV {
14
14
  registerWindow(window: Object): void;
15
15
  unregisterWindow(windowName: string): void;
16
16
  setAccessToken(accessToken: string): void;
17
- loadIfcs(ifcIds: number[]): StateIfc[];
17
+ loadIfcs(ifcIds: number[]): StateModel[];
18
18
  }
19
19
 
20
20
  enum AvailableLangs {
@@ -193,10 +193,10 @@ declare namespace BDV {
193
193
  }
194
194
 
195
195
  type ContextEvents = {
196
- "3d-model-loaded": { ifc: StateIfc; model: Object; plugin: Object };
197
- "3d-model-unloaded": { ifc: StateIfc; plugin: Object };
198
- "2d-model-loaded": { ifc: StateIfc; plugin: Object };
199
- "2d-model-unloaded": { ifc: StateIfc; plugin: Object };
196
+ "3d-model-loaded": { ifc: StateModel; model: Object; plugin: Object };
197
+ "3d-model-unloaded": { ifc: StateModel; plugin: Object };
198
+ "2d-model-loaded": { ifc: StateModel; plugin: Object };
199
+ "2d-model-unloaded": { ifc: StateModel; plugin: Object };
200
200
  "plugin-created": { pluginName: string; plugin: Plugin };
201
201
  "plugin-destroyed": { pluginName: string; plugin: Plugin };
202
202
  "plugin-menu-open": Plugin;
@@ -237,9 +237,12 @@ declare namespace BDV {
237
237
  }
238
238
 
239
239
  type StateEvents = {
240
+ // models events
241
+ "models-loaded": { models: StateModel[] };
242
+ "models-unloaded": { models: StateModel[] };
240
243
  // ifcs events
241
- "ifcs-loaded": { ifcs: StateIfc[] };
242
- "ifcs-unloaded": { ifcs: StateIfc[] };
244
+ "ifcs-loaded": { ifcs: StateModel[] };
245
+ "ifcs-unloaded": { ifcs: StateModel[] };
243
246
  // objects events
244
247
  "objects-added": { objects: StateObject[] };
245
248
  "objects-removed": { objects: StateObject[] };
@@ -264,8 +267,9 @@ declare namespace BDV {
264
267
 
265
268
  /**** getters ****/
266
269
  getObjectsByUuids(uuids: string[]): StateObject[];
267
- getObject(id: string): StateObject;
268
- getIfc(id): StateIfc;
270
+ getObject(id: number): StateObject;
271
+ getModel(id: number): StateModel;
272
+ getIfc(id: number): StateModel;
269
273
  selectedObjects: StateObject[];
270
274
  colorizedObjects: StateObject[];
271
275
  deselectedObjects: StateObject[];
@@ -276,10 +280,15 @@ declare namespace BDV {
276
280
  xrayedObjects: StateObject[];
277
281
  unxrayedObjects: StateObject[];
278
282
 
283
+ /**** models ****/
284
+ models: StateModel[];
285
+ modelsMap: Map<number, StateModel>;
286
+ loadModels(modelIds: string[]): Promise<StateModel[]>;
287
+ unloadModels(modelIds: string[]);
279
288
  /**** ifcs ****/
280
- ifcs: StateIfc[];
281
- ifcsMap: Map<number, StateIfc>;
282
- loadIfcs(ifcIds: string[]): Promise<StateIfc[]>;
289
+ ifcs: StateModel[];
290
+ ifcsMap: Map<number, StateModel>;
291
+ loadIfcs(ifcIds: string[]): Promise<StateModel[]>;
283
292
  unloadIfcs(ifcIds: string[]);
284
293
 
285
294
  /**** objects ****/
@@ -300,7 +309,8 @@ declare namespace BDV {
300
309
 
301
310
  interface APIObject {
302
311
  children: APIObject[];
303
- ifc: APIIfc;
312
+ model: StateModel;
313
+ ifc: StateModel;
304
314
  longname: string;
305
315
  name: string;
306
316
  object_type: string;
@@ -309,13 +319,32 @@ declare namespace BDV {
309
319
  uuid: string;
310
320
  }
311
321
 
312
- interface APIIfc {
322
+ interface StateModel {
313
323
  id: number;
324
+ type: ModelType;
325
+ structure: Object;
326
+ objects: StateObject[];
327
+ uuids: Map<string, StateObject>;
328
+ }
329
+
330
+ enum ModelType {
331
+ IFC = "IFC",
332
+ DWG = "DWG",
333
+ DXF = "DXF",
334
+ GLTF = "GLTF",
335
+ PDF = "PDF",
336
+ JPEG = "JPEG",
337
+ PNG = "PNG",
338
+ OBJ = "OBJ",
339
+ DAE = "DAE",
340
+ BFX = "BFX",
341
+ METABUILDING = "METABUILDING",
314
342
  }
315
343
 
316
344
  interface StateObject extends APIObject {
317
345
  id: number;
318
- ifc: StateIfc;
346
+ model: StateModel;
347
+ ifc: StateModel;
319
348
  visible: boolean;
320
349
  pickable: boolean;
321
350
  selected: boolean;
@@ -330,12 +359,6 @@ declare namespace BDV {
330
359
  space: StateObject;
331
360
  }
332
361
 
333
- interface StateIfc extends APIIfc {
334
- structure: Object;
335
- objects: StateObject[];
336
- uuids: Map<string, StateObject>;
337
- }
338
-
339
362
  interface ProjectModel {
340
363
  id: number;
341
364
  name: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bimdata/viewer",
3
- "version": "1.9.0-rc.53",
3
+ "version": "1.9.0-rc.56",
4
4
  "description": "A customizable BIM viewer.",
5
5
  "keywords": [
6
6
  "bim",
@@ -43,7 +43,7 @@
43
43
  "@babel/preset-env": "^7.15.6",
44
44
  "@bimdata/2d-engine": "1.7.0",
45
45
  "@bimdata/areas": "0.5.0",
46
- "@bimdata/bimdata-api-client": "7.1.0",
46
+ "@bimdata/bimdata-api-client": "7.4.1",
47
47
  "@bimdata/color-picker": "0.0.3",
48
48
  "@bimdata/design-system": "1.2.0-rc.30",
49
49
  "@johmun/vue-tags-input": "^2.1.0",