@bimdata/viewer 1.9.0-rc.8 → 1.9.0-rc.80

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
@@ -1,3 +1,4 @@
1
+ /* eslint-disable*/
1
2
  declare module "@bimdata/viewer" {
2
3
  export default function makeBIMDataViewer(cfg: BDV.ViewerCfg): BDV.Viewer;
3
4
  }
@@ -9,11 +10,11 @@ declare namespace BDV {
9
10
  layout: Object
10
11
  ): Object;
11
12
  setLocale(lang: AvailableLangs): void;
12
- registerPlugin(plugin: Plugin, cfg: Object): void;
13
+ registerPlugin(plugin: PluginCfg, cfg?: Object): void;
13
14
  registerWindow(window: Object): void;
14
15
  unregisterWindow(windowName: string): void;
15
16
  setAccessToken(accessToken: string): void;
16
- loadIfcs(ifcIds: number[]): StateIfc[];
17
+ loadIfcs(ifcIds: number[]): StateModel[];
17
18
  }
18
19
 
19
20
  enum AvailableLangs {
@@ -25,10 +26,10 @@ declare namespace BDV {
25
26
  interface ViewerCfg {
26
27
  plugins: PluginsConfig;
27
28
  api: APIConfig;
28
- offlineOptions: OfflineData;
29
+ offlineOptions?: OfflineData;
29
30
  ui: UIConfig;
30
- logger: { level: LogLevel };
31
- locale: string;
31
+ logger?: { level: LogLevel };
32
+ locale?: string;
32
33
  }
33
34
 
34
35
  interface PluginsConfig {
@@ -99,7 +100,7 @@ declare namespace BDV {
99
100
  cloudId: number;
100
101
  projectId: number;
101
102
  accessToken: string;
102
- apiUrl: string;
103
+ apiUrl?: string;
103
104
  }
104
105
 
105
106
  interface UIConfig {
@@ -192,6 +193,10 @@ declare namespace BDV {
192
193
  }
193
194
 
194
195
  type ContextEvents = {
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 };
195
200
  "plugin-created": { pluginName: string; plugin: Plugin };
196
201
  "plugin-destroyed": { pluginName: string; plugin: Plugin };
197
202
  "plugin-menu-open": Plugin;
@@ -203,7 +208,7 @@ declare namespace BDV {
203
208
  "window-close": Window;
204
209
  };
205
210
 
206
- interface Context<T> {
211
+ interface Context<T extends Events> {
207
212
  loading: boolean;
208
213
  incrementSpinnerProcesses: Function;
209
214
  decrementSpinnerProcesses: Function;
@@ -232,9 +237,12 @@ declare namespace BDV {
232
237
  }
233
238
 
234
239
  type StateEvents = {
240
+ // models events
241
+ "models-loaded": { models: StateModel[] };
242
+ "models-unloaded": { models: StateModel[] };
235
243
  // ifcs events
236
- "ifcs-loaded": { ifcs: StateIfc[] };
237
- "ifcs-unloaded": { ifcs: StateIfc[] };
244
+ "ifcs-loaded": { ifcs: StateModel[] };
245
+ "ifcs-unloaded": { ifcs: StateModel[] };
238
246
  // objects events
239
247
  "objects-added": { objects: StateObject[] };
240
248
  "objects-removed": { objects: StateObject[] };
@@ -259,9 +267,11 @@ declare namespace BDV {
259
267
 
260
268
  /**** getters ****/
261
269
  getObjectsByUuids(uuids: string[]): StateObject[];
262
- getObject(id: string): StateObject;
263
- getIfc(id): StateIfc;
270
+ getObject(id: number): StateObject;
271
+ getModel(id: number): StateModel;
272
+ getIfc(id: number): StateModel;
264
273
  selectedObjects: StateObject[];
274
+ colorizedObjects: StateObject[];
265
275
  deselectedObjects: StateObject[];
266
276
  highlightedObjects: StateObject[];
267
277
  unhighlightedObjects: StateObject[];
@@ -270,16 +280,22 @@ declare namespace BDV {
270
280
  xrayedObjects: StateObject[];
271
281
  unxrayedObjects: StateObject[];
272
282
 
283
+ /**** models ****/
284
+ models: StateModel[];
285
+ modelsMap: Map<number, StateModel>;
286
+ loadModels(modelIds: string[]): Promise<StateModel[]>;
287
+ unloadModels(modelIds: string[]);
273
288
  /**** ifcs ****/
274
- ifcs: StateIfc[];
275
- ifcsMap: Map<number, StateIfc>;
276
- loadIfcs(ifcIds: string[]): Promise<StateIfc[]>;
289
+ ifcs: StateModel[];
290
+ ifcsMap: Map<number, StateModel>;
291
+ loadIfcs(ifcIds: string[]): Promise<StateModel[]>;
277
292
  unloadIfcs(ifcIds: string[]);
278
293
 
279
294
  /**** objects ****/
280
295
  objects: StateObject[];
281
296
  objectsMap: Map<number, StateObject>;
282
297
  selectObjects(ids: number[]): void;
298
+ colorizeObjects(ids: number[], color?: string): void;
283
299
  deselectObjects(ids: number[]): void;
284
300
  highlightObjects(ids: number[]): void;
285
301
  unhighlightObjects(ids: number[]): void;
@@ -287,11 +303,14 @@ declare namespace BDV {
287
303
  hideObjects(ids: number[]): void;
288
304
  xrayObjects(ids: number[]): void;
289
305
  unxrayObjects(ids: number[]): void;
306
+ isolateObjects(ids: number[]): void;
307
+ reintegrateObjects(): void;
290
308
  }
291
309
 
292
310
  interface APIObject {
293
311
  children: APIObject[];
294
- ifc: APIIfc;
312
+ model: StateModel;
313
+ ifc: StateModel;
295
314
  longname: string;
296
315
  name: string;
297
316
  object_type: string;
@@ -300,18 +319,39 @@ declare namespace BDV {
300
319
  uuid: string;
301
320
  }
302
321
 
303
- interface APIIfc {
322
+ interface StateModel {
304
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",
305
343
  }
306
344
 
307
345
  interface StateObject extends APIObject {
308
346
  id: number;
309
- ifc: StateIfc;
347
+ model: StateModel;
348
+ ifc: StateModel;
310
349
  visible: boolean;
311
350
  pickable: boolean;
312
351
  selected: boolean;
313
352
  highlighted: boolean;
314
353
  xrayed: boolean;
354
+ color: string;
315
355
  // advanced getters
316
356
  descendants;
317
357
  ancestors: StateObject[];
@@ -320,11 +360,7 @@ declare namespace BDV {
320
360
  space: StateObject;
321
361
  }
322
362
 
323
- interface StateIfc extends APIIfc {
324
- structure: Object;
325
- objects: StateObject[];
326
- uuids: Map<string, StateObject>;
327
- }
363
+ type ModelStatus = "C" | "E" | "P" | "I";
328
364
 
329
365
  interface VueInstance {
330
366
  $t(message: string): string;
@@ -352,13 +388,28 @@ declare namespace BDV {
352
388
  plugins: string[];
353
389
  }
354
390
 
355
- interface Plugin {
356
- $viewer: $viewer;
357
- methods: {
358
- $viewer: $viewer;
359
- };
360
- computed: {
361
- $viewer: $viewer;
362
- };
391
+ interface PluginCfg {
392
+ name: string;
393
+ component?: Object;
394
+ button?: Object;
395
+ addToWindows?: string[];
396
+ startupScript?: ($viewer: $viewer) => void;
363
397
  }
398
+
399
+ type Plugin<T> = VueComponent<{ $viewer: $viewer } | T>;
400
+
401
+ type VueComponent<T> =
402
+ | {
403
+ methods: T;
404
+ computed: T;
405
+ }
406
+ | T;
407
+
408
+ type Viewer3dPlugin = Plugin<{
409
+ fitViewObjects(uuids: string[]): void;
410
+ getCameraPosition(): Object;
411
+ getProjection(): string;
412
+ getViewpoint(snapshot?: boolean): Object;
413
+ setCameraPosition(cameraPosition?: Object): void;
414
+ }>;
364
415
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bimdata/viewer",
3
- "version": "1.9.0-rc.8",
3
+ "version": "1.9.0-rc.80",
4
4
  "description": "A customizable BIM viewer.",
5
5
  "keywords": [
6
6
  "bim",
@@ -25,10 +25,8 @@
25
25
  "scripts": {
26
26
  "test": "jest",
27
27
  "build": "rollup -c --environment BUILD:production",
28
- "build:dev": "rollup -c --environment BUILD:development",
29
28
  "prebuild": "rm -rf dist",
30
- "prebuild:dev": "rm -rf dist",
31
- "dev": "npm run build:dev -- --watch",
29
+ "dev": "vite",
32
30
  "prepublishOnly": "npm run build",
33
31
  "semantic-release": "semantic-release",
34
32
  "version": "echo $npm_package_version"
@@ -43,23 +41,30 @@
43
41
  ],
44
42
  "devDependencies": {
45
43
  "@babel/preset-env": "^7.15.6",
46
- "@bimdata/2d-engine": "1.6.0-beta.1",
47
- "@bimdata/areas": "0.4.11",
48
- "@bimdata/bimdata-api-client": "^6.17.3",
44
+ "@bimdata/2d-engine": "1.8.0",
45
+ "@bimdata/areas": "0.5.1",
46
+ "@bimdata/bimdata-api-client": "7.4.1",
49
47
  "@bimdata/color-picker": "0.0.3",
50
- "@bimdata/design-system": "1.0.1",
48
+ "@bimdata/design-system": "1.2.0-rc.40",
51
49
  "@johmun/vue-tags-input": "^2.1.0",
52
50
  "@rollup/plugin-alias": "3.1.5",
53
51
  "@rollup/plugin-babel": "^5.3.0",
52
+ "@rollup/plugin-commonjs": "^21.0.1",
54
53
  "@rollup/plugin-image": "^2.1.1",
54
+ "@rollup/plugin-json": "^4.1.0",
55
+ "@rollup/plugin-node-resolve": "^13.1.3",
56
+ "@rollup/plugin-replace": "^3.0.1",
55
57
  "@semantic-release/changelog": "^6.0.0",
56
58
  "@semantic-release/commit-analyzer": "^9.0.1",
57
59
  "@semantic-release/git": "^10.0.0",
58
60
  "@semantic-release/github": "^8.0.1",
59
61
  "@semantic-release/npm": "^8.0.0",
60
62
  "@semantic-release/release-notes-generator": "^10.0.2",
63
+ "@vue/composition-api": "^1.4.9",
61
64
  "@vue/test-utils": "1.2.2",
62
- "@xeokit/xeokit-sdk": "git+https://git@github.com/Amoki/xeokit-sdk.git#9a012280f6253a2a719f93dba6f90de53fee8413",
65
+ "@xeokit/xeokit-sdk": "git+https://git@github.com/Amoki/xeokit-sdk.git#b0e7759c68625da822ff81d8ca859f17998071b4",
66
+ "async": "^3.2.3",
67
+ "autoprefixer": "^10.4.2",
63
68
  "babel-core": "^7.0.0-bridge.0",
64
69
  "babel-jest": "^27.2.4",
65
70
  "conventional-changelog-eslint": "^3.0.9",
@@ -68,25 +73,25 @@
68
73
  "eslint-plugin-jest": "^24.5.0",
69
74
  "eslint-plugin-prettier": "^4.0.0",
70
75
  "eslint-plugin-vue": "^7.18.0",
76
+ "form-data": "^4.0.0",
71
77
  "html2canvas": "1.3.2",
72
78
  "jest": "^27.2.4",
73
79
  "jest-extended": "^0.11.5",
80
+ "lodash": "^4.17.21",
81
+ "node-fetch": "^2.6.6",
74
82
  "pdfjs-dist": "^2.9.359",
83
+ "postcss": "^8.4.5",
75
84
  "prettier": "^2.4.1",
76
85
  "querystring": "^0.2.0",
77
86
  "rollup": "2.57.0",
78
- "rollup-plugin-commonjs": "^10.0.1",
79
- "rollup-plugin-json": "^4.0.0",
80
- "rollup-plugin-livereload": "^2.0.5",
81
- "rollup-plugin-node-resolve": "^5.2.0",
87
+ "rollup-plugin-postcss": "^4.0.2",
82
88
  "rollup-plugin-replace": "^2.2.0",
83
- "rollup-plugin-serve": "^1.1.0",
84
- "rollup-plugin-svg": "^2.0.0",
85
89
  "rollup-plugin-terser": "7.0.2",
86
90
  "rollup-plugin-vue": "^5.0.1",
87
91
  "rollup-plugin-web-worker-loader": "^1.6.1",
88
92
  "semantic-release": "^18.0.0",
89
93
  "sinon": "^11.1.2",
94
+ "vite": "2.7.13",
90
95
  "vue": "^2.6.14",
91
96
  "vue-i18n": "^8.26.2",
92
97
  "vue-jest": "^3.0.7",