@bimdata/viewer 1.9.0-alpha.buildingmaker → 1.9.0-alpha.synchroplan.0

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,33 @@ 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
+ status: ModelStatus;
326
+ structure: Object;
327
+ objects: StateObject[];
328
+ uuids: Map<string, StateObject>;
329
+ }
330
+
331
+ enum ModelType {
332
+ IFC = "IFC",
333
+ DWG = "DWG",
334
+ DXF = "DXF",
335
+ GLTF = "GLTF",
336
+ PDF = "PDF",
337
+ JPEG = "JPEG",
338
+ PNG = "PNG",
339
+ OBJ = "OBJ",
340
+ DAE = "DAE",
341
+ BFX = "BFX",
342
+ METABUILDING = "METABUILDING",
314
343
  }
315
344
 
316
345
  interface StateObject extends APIObject {
317
346
  id: number;
318
- ifc: StateIfc;
347
+ model: StateModel;
348
+ ifc: StateModel;
319
349
  visible: boolean;
320
350
  pickable: boolean;
321
351
  selected: boolean;
@@ -330,22 +360,7 @@ declare namespace BDV {
330
360
  space: StateObject;
331
361
  }
332
362
 
333
- interface StateIfc extends APIIfc {
334
- structure: Object;
335
- objects: StateObject[];
336
- uuids: Map<string, StateObject>;
337
- }
338
-
339
- interface ProjectModel {
340
- id: number;
341
- name: string;
342
- status: ProjectModelStatus;
343
- preview: string;
344
- loading: boolean;
345
- loaded: boolean;
346
- }
347
-
348
- type ProjectModelStatus = "C" | "E" | "P" | "I";
363
+ type ModelStatus = "C" | "E" | "P" | "I";
349
364
 
350
365
  interface VueInstance {
351
366
  $t(message: string): string;
@@ -381,21 +396,20 @@ declare namespace BDV {
381
396
  startupScript?: ($viewer: $viewer) => void;
382
397
  }
383
398
 
384
- interface Plugin {
385
- $viewer?: $viewer;
386
- methods?: {
387
- $viewer: $viewer;
388
- };
389
- computed?: {
390
- $viewer: $viewer;
391
- };
392
- }
399
+ type Plugin<T> = VueComponent<{ $viewer: $viewer } | T>;
393
400
 
394
- interface Viewer3dPlugin extends Plugin {
401
+ type VueComponent<T> =
402
+ | {
403
+ methods: T;
404
+ computed: T;
405
+ }
406
+ | T;
407
+
408
+ type Viewer3dPlugin = Plugin<{
395
409
  fitViewObjects(uuids: string[]): void;
396
410
  getCameraPosition(): Object;
397
411
  getProjection(): string;
398
412
  getViewpoint(snapshot?: boolean): Object;
399
413
  setCameraPosition(cameraPosition?: Object): void;
400
- }
414
+ }>;
401
415
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bimdata/viewer",
3
- "version": "1.9.0-alpha.buildingmaker",
3
+ "version": "1.9.0-alpha.synchroplan.0",
4
4
  "description": "A customizable BIM viewer.",
5
5
  "keywords": [
6
6
  "bim",
@@ -24,7 +24,7 @@
24
24
  "unpkg": "dist/bimdata-viewer.min.js",
25
25
  "scripts": {
26
26
  "test": "jest",
27
- "build": "rollup -c",
27
+ "build": "rollup -c --environment BUILD:production",
28
28
  "prebuild": "rm -rf dist",
29
29
  "dev": "vite",
30
30
  "prepublishOnly": "npm run build",
@@ -41,11 +41,11 @@
41
41
  ],
42
42
  "devDependencies": {
43
43
  "@babel/preset-env": "^7.15.6",
44
- "@bimdata/2d-engine": "1.7.0",
45
- "@bimdata/areas": "0.5.0",
46
- "@bimdata/bimdata-api-client": "7.0.0",
44
+ "@bimdata/2d-engine": "1.8.0",
45
+ "@bimdata/areas": "0.5.1",
46
+ "@bimdata/bimdata-api-client": "7.4.1",
47
47
  "@bimdata/color-picker": "0.0.3",
48
- "@bimdata/design-system": "1.2.0-rc.22",
48
+ "@bimdata/design-system": "1.2.0-rc.42",
49
49
  "@johmun/vue-tags-input": "^2.1.0",
50
50
  "@rollup/plugin-alias": "3.1.5",
51
51
  "@rollup/plugin-babel": "^5.3.0",
@@ -60,8 +60,10 @@
60
60
  "@semantic-release/github": "^8.0.1",
61
61
  "@semantic-release/npm": "^8.0.0",
62
62
  "@semantic-release/release-notes-generator": "^10.0.2",
63
+ "@vue/composition-api": "^1.4.9",
63
64
  "@vue/test-utils": "1.2.2",
64
65
  "@xeokit/xeokit-sdk": "git+https://git@github.com/Amoki/xeokit-sdk.git#b0e7759c68625da822ff81d8ca859f17998071b4",
66
+ "async": "^3.2.3",
65
67
  "autoprefixer": "^10.4.2",
66
68
  "babel-core": "^7.0.0-bridge.0",
67
69
  "babel-jest": "^27.2.4",
@@ -75,6 +77,7 @@
75
77
  "html2canvas": "1.3.2",
76
78
  "jest": "^27.2.4",
77
79
  "jest-extended": "^0.11.5",
80
+ "lodash": "^4.17.21",
78
81
  "node-fetch": "^2.6.6",
79
82
  "pdfjs-dist": "^2.9.359",
80
83
  "postcss": "^8.4.5",