@pilotdev/pilot-bim-dataprovider 23.0.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.
Files changed (38) hide show
  1. package/README.md +43 -0
  2. package/lib/index.d.ts +7 -0
  3. package/lib/index.js +7 -0
  4. package/lib/index.js.map +1 -0
  5. package/lib/src/model/BimDataElement.d.ts +15 -0
  6. package/lib/src/model/BimDataElement.js +15 -0
  7. package/lib/src/model/BimDataElement.js.map +1 -0
  8. package/lib/src/model/BimDataElementPropertySet.d.ts +23 -0
  9. package/lib/src/model/BimDataElementPropertySet.js +30 -0
  10. package/lib/src/model/BimDataElementPropertySet.js.map +1 -0
  11. package/lib/src/model/BimDataIfcType.d.ts +1206 -0
  12. package/lib/src/model/BimDataIfcType.js +1208 -0
  13. package/lib/src/model/BimDataIfcType.js.map +1 -0
  14. package/lib/src/model/BimDataModel.d.ts +16 -0
  15. package/lib/src/model/BimDataModel.js +55 -0
  16. package/lib/src/model/BimDataModel.js.map +1 -0
  17. package/lib/src/model/BimDataModelPart.d.ts +24 -0
  18. package/lib/src/model/BimDataModelPart.js +38 -0
  19. package/lib/src/model/BimDataModelPart.js.map +1 -0
  20. package/lib/src/model/BimDataTessellation.d.ts +6 -0
  21. package/lib/src/model/BimDataTessellation.js +9 -0
  22. package/lib/src/model/BimDataTessellation.js.map +1 -0
  23. package/lib/src/model/Consts.d.ts +2 -0
  24. package/lib/src/model/Consts.js +3 -0
  25. package/lib/src/model/Consts.js.map +1 -0
  26. package/lib/src/utils/ViewerTools.d.ts +13 -0
  27. package/lib/src/utils/ViewerTools.js +117 -0
  28. package/lib/src/utils/ViewerTools.js.map +1 -0
  29. package/lib/src/utils/WasmTools.d.ts +10 -0
  30. package/lib/src/utils/WasmTools.js +60 -0
  31. package/lib/src/utils/WasmTools.js.map +1 -0
  32. package/lib/src/wasm/index.d.ts +0 -0
  33. package/lib/src/wasm/index.js +3 -0
  34. package/lib/src/wasm/index.js.map +1 -0
  35. package/lib/src/wasm/pilot_bim_dataprovider.d.ts +128 -0
  36. package/lib/src/wasm/pilot_bim_dataprovider.js +16 -0
  37. package/lib/src/wasm/pilot_bim_dataprovider.wasm +0 -0
  38. package/package.json +31 -0
package/README.md ADDED
@@ -0,0 +1,43 @@
1
+ ## Installation
2
+ > `npm istall @pilotdev/pilot-bim-dataprovider`
3
+
4
+ ## Summary
5
+
6
+ This package contains tools for reading and writing data from information model data container (**.bm** files).
7
+ This component is part of the **Pilot Cloud** service (https://pilotcloud.ascon.net/).
8
+
9
+ ## How to use
10
+
11
+ Initialize and read data from information model data container (**.bm** file).
12
+
13
+ ```js
14
+ import { BimDataBigIntMaxValue, BimDataModel } from "@pilotdev/pilot-bim-dataprovider";
15
+
16
+ // Create new instance of BimModel
17
+ const bimModel = new BimDataModel();
18
+
19
+ // Initialize model.
20
+ // Method returns Promise<void>
21
+ await bimModel.init();
22
+
23
+ // Read bm file and open it
24
+ // fileBuffer - Buffer of a .bm file
25
+ // uniqueId - must be unique identfier
26
+ const modelPart = bimModel.openModelPart("uniqueId", fileBuffer);
27
+
28
+ // Get all elements of the model-part
29
+ const elements = modelPart.getAllElements();
30
+
31
+ // Get latest version of properties of the element
32
+ const properties = modelPart.getElementProperties(elements[5].guid, BimDataBigIntMaxValue);
33
+
34
+ // Get all tessellations
35
+ const tesselations = modelPart.getTessellations();
36
+
37
+ // Close model part after end
38
+ modelPart.close();
39
+
40
+ // Dispose BimModel after all
41
+ bimModel.dispose();
42
+
43
+ ```
package/lib/index.d.ts ADDED
@@ -0,0 +1,7 @@
1
+ export { BimDataModel, IBimDataModel } from "./src/model/BimDataModel.js";
2
+ export { IBimDataModelPart } from "./src/model/BimDataModelPart.js";
3
+ export { BimDataBigIntMaxValue, BimDataBigIntMinValue } from "./src/model/Consts.js";
4
+ export { BimDataElement, BimDataMeshProperty } from "./src/model/BimDataElement.js";
5
+ export { BimDataIfcType } from "./src/model/BimDataIfcType.js";
6
+ export { BimDataElementPropertySet, BimDataElementProperty, BimDataElementPropertyValue } from "./src/model/BimDataElementPropertySet.js";
7
+ export { BimDataTessellation } from "./src/model/BimDataTessellation.js";
package/lib/index.js ADDED
@@ -0,0 +1,7 @@
1
+ export { BimDataModel } from "./src/model/BimDataModel.js";
2
+ export { BimDataBigIntMaxValue, BimDataBigIntMinValue } from "./src/model/Consts.js";
3
+ export { BimDataElement, BimDataMeshProperty } from "./src/model/BimDataElement.js";
4
+ export { BimDataIfcType } from "./src/model/BimDataIfcType.js";
5
+ export { BimDataElementPropertySet, BimDataElementProperty, BimDataElementPropertyValue } from "./src/model/BimDataElementPropertySet.js";
6
+ export { BimDataTessellation } from "./src/model/BimDataTessellation.js";
7
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAiB,MAAM,6BAA6B,CAAC;AAE1E,OAAO,EAAE,qBAAqB,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;AACrF,OAAO,EAAE,cAAc,EAAE,mBAAmB,EAAE,MAAM,+BAA+B,CAAC;AACpF,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAC/D,OAAO,EAAE,yBAAyB,EAAE,sBAAsB,EAAE,2BAA2B,EAAE,MAAM,0CAA0C,CAAC;AAC1I,OAAO,EAAE,mBAAmB,EAAE,MAAM,oCAAoC,CAAC"}
@@ -0,0 +1,15 @@
1
+ export declare class BimDataElement {
2
+ guid: string;
3
+ objectState: unknown;
4
+ revision: bigint;
5
+ parentGuid: string;
6
+ name: string;
7
+ type: string;
8
+ representationType: string;
9
+ representationStatus: string;
10
+ meshesProperties: Map<string, BimDataMeshProperty[]>;
11
+ }
12
+ export declare class BimDataMeshProperty {
13
+ meshColor: number;
14
+ meshPlacement: number[];
15
+ }
@@ -0,0 +1,15 @@
1
+ export class BimDataElement {
2
+ constructor() {
3
+ this.revision = BigInt(0);
4
+ //representationStatusFlag: any;
5
+ //gridObject: any;
6
+ this.meshesProperties = new Map();
7
+ }
8
+ }
9
+ export class BimDataMeshProperty {
10
+ constructor() {
11
+ this.meshColor = 0;
12
+ this.meshPlacement = new Array();
13
+ }
14
+ }
15
+ //# sourceMappingURL=BimDataElement.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BimDataElement.js","sourceRoot":"","sources":["../../../src/model/BimDataElement.ts"],"names":[],"mappings":"AAAA,MAAM,OAAO,cAAc;IAA3B;QAGE,aAAQ,GAAW,MAAM,CAAC,CAAC,CAAC,CAAC;QAM7B,gCAAgC;QAChC,kBAAkB;QAClB,qBAAgB,GAAuC,IAAI,GAAG,EAAE,CAAC;IACnE,CAAC;CAAA;AAED,MAAM,OAAO,mBAAmB;IAAhC;QACE,cAAS,GAAW,CAAC,CAAC;QACtB,kBAAa,GAAa,IAAI,KAAK,EAAE,CAAC;IACxC,CAAC;CAAA"}
@@ -0,0 +1,23 @@
1
+ import { BimDataIfcType } from "./BimDataIfcType";
2
+ export declare class BimDataElementPropertySet {
3
+ name: string;
4
+ properties: BimDataElementProperty[];
5
+ type: BimDataIfcType;
6
+ }
7
+ export declare class BimDataElementProperty {
8
+ name: string;
9
+ unit: number;
10
+ value: BimDataElementPropertyValue;
11
+ }
12
+ export declare class BimDataElementPropertyValue {
13
+ str_value?: string;
14
+ int_value?: number;
15
+ double_value?: number;
16
+ date_value?: bigint;
17
+ array_value: Array<string>;
18
+ decimal_value?: number;
19
+ guid_value?: string;
20
+ array_int_value: Array<number>;
21
+ bool_value?: boolean;
22
+ get value(): unknown;
23
+ }
@@ -0,0 +1,30 @@
1
+ export class BimDataElementPropertySet {
2
+ }
3
+ export class BimDataElementProperty {
4
+ constructor() {
5
+ this.unit = 0;
6
+ }
7
+ }
8
+ export class BimDataElementPropertyValue {
9
+ constructor() {
10
+ this.array_value = new Array();
11
+ this.array_int_value = new Array();
12
+ }
13
+ get value() {
14
+ if (this.str_value)
15
+ return this.str_value;
16
+ if (this.bool_value)
17
+ return this.bool_value;
18
+ if (this.date_value)
19
+ return this.date_value;
20
+ if (this.decimal_value)
21
+ return this.decimal_value;
22
+ if (this.guid_value)
23
+ return this.guid_value;
24
+ if (this.int_value)
25
+ return this.int_value;
26
+ if (this.double_value)
27
+ return this.double_value;
28
+ }
29
+ }
30
+ //# sourceMappingURL=BimDataElementPropertySet.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BimDataElementPropertySet.js","sourceRoot":"","sources":["../../../src/model/BimDataElementPropertySet.ts"],"names":[],"mappings":"AAEA,MAAM,OAAO,yBAAyB;CAIrC;AAED,MAAM,OAAO,sBAAsB;IAAnC;QAEE,SAAI,GAAW,CAAC,CAAC;IAEnB,CAAC;CAAA;AAED,MAAM,OAAO,2BAA2B;IAAxC;QAKE,gBAAW,GAAkB,IAAI,KAAK,EAAE,CAAC;QAGzC,oBAAe,GAAkB,IAAI,KAAK,EAAE,CAAC;IAmB/C,CAAC;IAhBC,IAAI,KAAK;QACP,IAAI,IAAI,CAAC,SAAS;YAChB,OAAO,IAAI,CAAC,SAAS,CAAC;QACxB,IAAI,IAAI,CAAC,UAAU;YACjB,OAAO,IAAI,CAAC,UAAU,CAAC;QACzB,IAAI,IAAI,CAAC,UAAU;YACjB,OAAO,IAAI,CAAC,UAAU,CAAC;QACzB,IAAI,IAAI,CAAC,aAAa;YACpB,OAAO,IAAI,CAAC,aAAa,CAAC;QAC5B,IAAI,IAAI,CAAC,UAAU;YACjB,OAAO,IAAI,CAAC,UAAU,CAAC;QACzB,IAAI,IAAI,CAAC,SAAS;YAChB,OAAO,IAAI,CAAC,SAAS,CAAC;QACxB,IAAI,IAAI,CAAC,YAAY;YACnB,OAAO,IAAI,CAAC,YAAY,CAAC;IAC7B,CAAC;CACF"}