@pilotdev/pilot-bim-dataprovider 23.0.2 → 23.0.4
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/README.md +42 -42
- package/lib/index.d.ts +7 -7
- package/lib/index.js +6 -6
- package/lib/index.js.map +1 -1
- package/lib/src/model/BimDataElement.d.ts +26 -15
- package/lib/src/model/BimDataElement.js +23 -14
- package/lib/src/model/BimDataElement.js.map +1 -1
- package/lib/src/model/BimDataElementPropertySet.d.ts +23 -23
- package/lib/src/model/BimDataElementPropertySet.js +29 -29
- package/lib/src/model/BimDataIfcType.d.ts +1206 -1206
- package/lib/src/model/BimDataIfcType.js +1207 -1207
- package/lib/src/model/BimDataModel.d.ts +16 -16
- package/lib/src/model/BimDataModel.js +54 -54
- package/lib/src/model/BimDataModelPart.d.ts +24 -24
- package/lib/src/model/BimDataModelPart.js +37 -37
- package/lib/src/model/BimDataTessellation.d.ts +6 -6
- package/lib/src/model/BimDataTessellation.js +8 -8
- package/lib/src/model/Consts.d.ts +2 -2
- package/lib/src/model/Consts.js +2 -2
- package/lib/src/utils/ViewerTools.d.ts +13 -13
- package/lib/src/utils/ViewerTools.js +137 -116
- package/lib/src/utils/ViewerTools.js.map +1 -1
- package/lib/src/utils/WasmTools.d.ts +10 -10
- package/lib/src/utils/WasmTools.js +59 -59
- package/lib/src/wasm/index.js +2 -2
- package/lib/src/wasm/pilot_bim_dataprovider.d.ts +137 -127
- package/lib/src/wasm/pilot_bim_dataprovider.js +15 -15
- package/lib/src/wasm/pilot_bim_dataprovider.wasm +0 -0
- package/package.json +34 -31
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { IDisposable, IWasmBimModule, VectorOf } from "../wasm/pilot_bim_dataprovider.js";
|
|
2
|
-
export declare class WasmTools {
|
|
3
|
-
static vectorToArray<T>(vector: VectorOf<unknown>, dispose?: boolean): T[];
|
|
4
|
-
static vectorToUint32Array(vector: VectorOf<number>, dispose: boolean): Uint32Array;
|
|
5
|
-
static vectorToUint8Array(vector: VectorOf<number>, dispose: boolean): Uint8Array;
|
|
6
|
-
static vectorToNumberArray(vector: VectorOf<number>, dispose: boolean): number[];
|
|
7
|
-
static isDisposable(o: any): o is IDisposable;
|
|
8
|
-
static isVectorOf(a: any): a is VectorOf<any>;
|
|
9
|
-
static isFileExists(path: string, module: IWasmBimModule): boolean;
|
|
10
|
-
}
|
|
1
|
+
import { IDisposable, IWasmBimModule, VectorOf } from "../wasm/pilot_bim_dataprovider.js";
|
|
2
|
+
export declare class WasmTools {
|
|
3
|
+
static vectorToArray<T>(vector: VectorOf<unknown>, dispose?: boolean): T[];
|
|
4
|
+
static vectorToUint32Array(vector: VectorOf<number>, dispose: boolean): Uint32Array;
|
|
5
|
+
static vectorToUint8Array(vector: VectorOf<number>, dispose: boolean): Uint8Array;
|
|
6
|
+
static vectorToNumberArray(vector: VectorOf<number>, dispose: boolean): number[];
|
|
7
|
+
static isDisposable(o: any): o is IDisposable;
|
|
8
|
+
static isVectorOf(a: any): a is VectorOf<any>;
|
|
9
|
+
static isFileExists(path: string, module: IWasmBimModule): boolean;
|
|
10
|
+
}
|
|
@@ -1,60 +1,60 @@
|
|
|
1
|
-
export class WasmTools {
|
|
2
|
-
static vectorToArray(vector, dispose = true) {
|
|
3
|
-
const result = Array();
|
|
4
|
-
for (let index = 0; index < vector.size(); index++) {
|
|
5
|
-
const element = vector.get(index);
|
|
6
|
-
if (dispose && this.isDisposable(element))
|
|
7
|
-
element.delete();
|
|
8
|
-
result.push(element);
|
|
9
|
-
}
|
|
10
|
-
if (dispose)
|
|
11
|
-
vector.delete();
|
|
12
|
-
return result;
|
|
13
|
-
}
|
|
14
|
-
static vectorToUint32Array(vector, dispose) {
|
|
15
|
-
const result = new Uint32Array(vector.size());
|
|
16
|
-
for (let index = 0; index < vector.size(); index++) {
|
|
17
|
-
const element = vector.get(index);
|
|
18
|
-
result[index] = element;
|
|
19
|
-
}
|
|
20
|
-
if (dispose)
|
|
21
|
-
vector.delete();
|
|
22
|
-
return result;
|
|
23
|
-
}
|
|
24
|
-
static vectorToUint8Array(vector, dispose) {
|
|
25
|
-
const result = new Uint8Array(vector.size());
|
|
26
|
-
for (let index = 0; index < vector.size(); index++) {
|
|
27
|
-
const element = vector.get(index);
|
|
28
|
-
result[index] = element;
|
|
29
|
-
}
|
|
30
|
-
if (dispose)
|
|
31
|
-
vector.delete();
|
|
32
|
-
return result;
|
|
33
|
-
}
|
|
34
|
-
static vectorToNumberArray(vector, dispose) {
|
|
35
|
-
const result = new Array(vector.size());
|
|
36
|
-
for (let index = 0; index < vector.size(); index++) {
|
|
37
|
-
const element = vector.get(index);
|
|
38
|
-
result[index] = element;
|
|
39
|
-
}
|
|
40
|
-
if (dispose)
|
|
41
|
-
vector.delete();
|
|
42
|
-
return result;
|
|
43
|
-
}
|
|
44
|
-
static isDisposable(o) {
|
|
45
|
-
return typeof o.delete === "function";
|
|
46
|
-
}
|
|
47
|
-
static isVectorOf(a) {
|
|
48
|
-
return typeof a.size === "function" && typeof a.get === "function";
|
|
49
|
-
}
|
|
50
|
-
static isFileExists(path, module) {
|
|
51
|
-
try {
|
|
52
|
-
module.FS.lookupPath(path, {});
|
|
53
|
-
return true;
|
|
54
|
-
}
|
|
55
|
-
catch (error) {
|
|
56
|
-
return false;
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
}
|
|
1
|
+
export class WasmTools {
|
|
2
|
+
static vectorToArray(vector, dispose = true) {
|
|
3
|
+
const result = Array();
|
|
4
|
+
for (let index = 0; index < vector.size(); index++) {
|
|
5
|
+
const element = vector.get(index);
|
|
6
|
+
if (dispose && this.isDisposable(element))
|
|
7
|
+
element.delete();
|
|
8
|
+
result.push(element);
|
|
9
|
+
}
|
|
10
|
+
if (dispose)
|
|
11
|
+
vector.delete();
|
|
12
|
+
return result;
|
|
13
|
+
}
|
|
14
|
+
static vectorToUint32Array(vector, dispose) {
|
|
15
|
+
const result = new Uint32Array(vector.size());
|
|
16
|
+
for (let index = 0; index < vector.size(); index++) {
|
|
17
|
+
const element = vector.get(index);
|
|
18
|
+
result[index] = element;
|
|
19
|
+
}
|
|
20
|
+
if (dispose)
|
|
21
|
+
vector.delete();
|
|
22
|
+
return result;
|
|
23
|
+
}
|
|
24
|
+
static vectorToUint8Array(vector, dispose) {
|
|
25
|
+
const result = new Uint8Array(vector.size());
|
|
26
|
+
for (let index = 0; index < vector.size(); index++) {
|
|
27
|
+
const element = vector.get(index);
|
|
28
|
+
result[index] = element;
|
|
29
|
+
}
|
|
30
|
+
if (dispose)
|
|
31
|
+
vector.delete();
|
|
32
|
+
return result;
|
|
33
|
+
}
|
|
34
|
+
static vectorToNumberArray(vector, dispose) {
|
|
35
|
+
const result = new Array(vector.size());
|
|
36
|
+
for (let index = 0; index < vector.size(); index++) {
|
|
37
|
+
const element = vector.get(index);
|
|
38
|
+
result[index] = element;
|
|
39
|
+
}
|
|
40
|
+
if (dispose)
|
|
41
|
+
vector.delete();
|
|
42
|
+
return result;
|
|
43
|
+
}
|
|
44
|
+
static isDisposable(o) {
|
|
45
|
+
return typeof o.delete === "function";
|
|
46
|
+
}
|
|
47
|
+
static isVectorOf(a) {
|
|
48
|
+
return typeof a.size === "function" && typeof a.get === "function";
|
|
49
|
+
}
|
|
50
|
+
static isFileExists(path, module) {
|
|
51
|
+
try {
|
|
52
|
+
module.FS.lookupPath(path, {});
|
|
53
|
+
return true;
|
|
54
|
+
}
|
|
55
|
+
catch (error) {
|
|
56
|
+
return false;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
60
|
//# sourceMappingURL=WasmTools.js.map
|
package/lib/src/wasm/index.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
// do not delete this file
|
|
1
|
+
"use strict";
|
|
2
|
+
// do not delete this file
|
|
3
3
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,128 +1,138 @@
|
|
|
1
|
-
/// <reference types="emscripten" />
|
|
2
|
-
export interface IWasmBimModule extends EmscriptenModule {
|
|
3
|
-
get FS(): typeof FS;
|
|
4
|
-
getTessellations(filename: string): VectorOf<WasmTessellation>;
|
|
5
|
-
getAllNodes(filename: string): VectorOf<WasmIfcNode>;
|
|
6
|
-
getProperties(filename: string, elementId:string, version: bigint): VectorOf<WasmElementPropertySet>;
|
|
7
|
-
doLeakCheck(): void;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
export interface VectorOf<T> extends IDisposable {
|
|
11
|
-
get(index: number): T;
|
|
12
|
-
size(): number;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
export interface WasmModelMesh extends IDisposable {
|
|
16
|
-
vertices: VectorOf<number>;
|
|
17
|
-
normals: VectorOf<number>;
|
|
18
|
-
indices: VectorOf<number>;
|
|
19
|
-
edge_indices: VectorOf<number>;
|
|
20
|
-
color: number;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
export interface WasmTessellation extends IDisposable {
|
|
24
|
-
id: string;
|
|
25
|
-
node_id: string;
|
|
26
|
-
revision: number;
|
|
27
|
-
model_mesh: WasmModelMesh;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
export interface WasmIfcNode extends IDisposable{
|
|
31
|
-
id: string;
|
|
32
|
-
object_state: object;
|
|
33
|
-
revision: bigint;
|
|
34
|
-
parent_guid: string;
|
|
35
|
-
name: string;
|
|
36
|
-
type: string;
|
|
37
|
-
representation_type: string;
|
|
38
|
-
representation_status: string;
|
|
39
|
-
representation_status_flag: WasmIfcRepresentationStatus;
|
|
40
|
-
grid_object: WasmGridObject;
|
|
41
|
-
mesh_properties: VectorOf<WasmMeshPropertyPair>;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
export interface WasmGridObject extends IDisposable {
|
|
45
|
-
grid_axes: VectorOf<WasmGridAxis>;
|
|
46
|
-
placement: VectorOf<number>;
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
export interface WasmGridAxis extends IDisposable {
|
|
50
|
-
id: number;
|
|
51
|
-
type:
|
|
52
|
-
data: VectorOf<number>;
|
|
53
|
-
label: string;
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
export interface
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
export
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
export
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
1
|
+
/// <reference types="emscripten" />
|
|
2
|
+
export interface IWasmBimModule extends EmscriptenModule {
|
|
3
|
+
get FS(): typeof FS;
|
|
4
|
+
getTessellations(filename: string): VectorOf<WasmTessellation>;
|
|
5
|
+
getAllNodes(filename: string): VectorOf<WasmIfcNode>;
|
|
6
|
+
getProperties(filename: string, elementId:string, version: bigint): VectorOf<WasmElementPropertySet>;
|
|
7
|
+
doLeakCheck(): void;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export interface VectorOf<T> extends IDisposable {
|
|
11
|
+
get(index: number): T;
|
|
12
|
+
size(): number;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export interface WasmModelMesh extends IDisposable {
|
|
16
|
+
vertices: VectorOf<number>;
|
|
17
|
+
normals: VectorOf<number>;
|
|
18
|
+
indices: VectorOf<number>;
|
|
19
|
+
edge_indices: VectorOf<number>;
|
|
20
|
+
color: number;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export interface WasmTessellation extends IDisposable {
|
|
24
|
+
id: string;
|
|
25
|
+
node_id: string;
|
|
26
|
+
revision: number;
|
|
27
|
+
model_mesh: WasmModelMesh;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export interface WasmIfcNode extends IDisposable{
|
|
31
|
+
id: string;
|
|
32
|
+
object_state: object;
|
|
33
|
+
revision: bigint;
|
|
34
|
+
parent_guid: string;
|
|
35
|
+
name: string;
|
|
36
|
+
type: string;
|
|
37
|
+
representation_type: string;
|
|
38
|
+
representation_status: string;
|
|
39
|
+
representation_status_flag: WasmIfcRepresentationStatus;
|
|
40
|
+
grid_object: WasmGridObject;
|
|
41
|
+
mesh_properties: VectorOf<WasmMeshPropertyPair>;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export interface WasmGridObject extends IDisposable {
|
|
45
|
+
grid_axes: VectorOf<WasmGridAxis>;
|
|
46
|
+
placement: VectorOf<number>;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export interface WasmGridAxis extends IDisposable {
|
|
50
|
+
id: number;
|
|
51
|
+
type: WasmGridAxisType;
|
|
52
|
+
data: VectorOf<number>;
|
|
53
|
+
label: string;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
export interface WasmGridAxisType {
|
|
57
|
+
value: number;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
export enum WasmGridAxisTypeEnum {
|
|
61
|
+
LINE,
|
|
62
|
+
CIRCLE,
|
|
63
|
+
ARC
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
export interface WasmMeshPropertyPair extends IDisposable {
|
|
67
|
+
key: string;
|
|
68
|
+
value: VectorOf<WasmMeshProperties>;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
export interface WasmMeshProperties extends IDisposable{
|
|
72
|
+
mesh_color: number;
|
|
73
|
+
mesh_placement: VectorOf<number>;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
export class IDisposable {
|
|
77
|
+
delete(): void;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
export interface WasmIfcRepresentationStatus {
|
|
81
|
+
value: number;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
export enum WasmIfcRepresentationStatusEnum {
|
|
85
|
+
SUCCESS = 0,
|
|
86
|
+
NO_REPRESENTATION = 1,
|
|
87
|
+
IGNORED_IFC_TYPE = 2,
|
|
88
|
+
IFC_PARSING_ERROR = 4,
|
|
89
|
+
SOLID_CREATION_ERROR = 8,
|
|
90
|
+
TESSELATING_ERROR = 16,
|
|
91
|
+
C3D_EXEPTION = 32,
|
|
92
|
+
UNCLOSED_SOLID = 64
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
export interface WasmDValue extends IDisposable {
|
|
96
|
+
str_value?: OptionalString;
|
|
97
|
+
int_value?: OptionalLong;
|
|
98
|
+
double_value?: OptionalDouble;
|
|
99
|
+
date_value?: OptionalDate;
|
|
100
|
+
array_value: VectorOf<string>;
|
|
101
|
+
decimal_value?: OptionalDouble;
|
|
102
|
+
guid_value?: OptionalGuid;
|
|
103
|
+
array_int_value: VectorOf<number>;
|
|
104
|
+
bool_value?: OptionalBool;
|
|
105
|
+
//value: any;
|
|
106
|
+
}
|
|
107
|
+
export interface WasmElementProperty extends IDisposable {
|
|
108
|
+
name: string;
|
|
109
|
+
unit: number;
|
|
110
|
+
value: WasmDValue;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
export interface WasmElementPropertySet extends IDisposable {
|
|
114
|
+
name: string;
|
|
115
|
+
properties: VectorOf<WasmElementProperty>;
|
|
116
|
+
type: number;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
export interface WasmGuid {
|
|
120
|
+
hi(): bigint;
|
|
121
|
+
lo(): bigint;
|
|
122
|
+
toString(): string;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
export abstract class Optional<T> {
|
|
126
|
+
has_value(): boolean;
|
|
127
|
+
value(): T;
|
|
128
|
+
}
|
|
129
|
+
export class OptionalString extends Optional<string> {}
|
|
130
|
+
export class OptionalBool extends Optional<boolean> {}
|
|
131
|
+
export class OptionalLong extends Optional<number> {}
|
|
132
|
+
export class OptionalDouble extends Optional<number> {}
|
|
133
|
+
export class OptionalDate extends Optional<bigint> {}
|
|
134
|
+
export class OptionalGuid extends Optional<WasmGuid> {}
|
|
135
|
+
|
|
136
|
+
|
|
137
|
+
declare const BimDataProviderModule: EmscriptenModuleFactory<IWasmBimModule>;
|
|
128
138
|
export default BimDataProviderModule;
|