bimatter-viewer-react 0.3.0 → 0.4.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/README.md +127 -0
- package/lib/Loaders/BmtConverter.d.ts +95 -0
- package/lib/Loaders/BmtLoader.d.ts +2 -0
- package/lib/Loaders/IFCLoader/IFCLoader.d.ts +4 -1
- package/lib/SelectableMesh.d.ts +2 -1
- package/lib/api/ViewerApi.d.ts +15 -0
- package/lib/api/loader.d.ts +7 -1
- package/lib/index.d.ts +5 -2
- package/lib/index.js +12720 -11728
- package/lib/utils/DimentionsUtils/DimentionLine.d.ts +59 -0
- package/lib/utils/DimentionsUtils/DimentionsUtils.d.ts +97 -0
- package/lib/utils/DimentionsUtils/index.d.ts +2 -0
- package/lib/utils/GeometryUtils/useGeometryIndex.d.ts +2 -0
- package/lib/utils/GeometryUtils/useGeometryUtils.d.ts +3 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -109,6 +109,16 @@ You can also load mixed model lists:
|
|
|
109
109
|
/>
|
|
110
110
|
```
|
|
111
111
|
|
|
112
|
+
IFC spaces are disabled by default. Enable them per load when room volumes should be loaded as an almost-transparent gray mesh:
|
|
113
|
+
|
|
114
|
+
```ts
|
|
115
|
+
import { loader } from "bimatter-viewer-react";
|
|
116
|
+
|
|
117
|
+
await loader.loadModel(["/models/architecture.ifc"], {
|
|
118
|
+
useIfcSpace: true,
|
|
119
|
+
});
|
|
120
|
+
```
|
|
121
|
+
|
|
112
122
|
## Loader API
|
|
113
123
|
|
|
114
124
|
You can load models yourself and pass parsed data to the viewer:
|
|
@@ -137,6 +147,7 @@ function App() {
|
|
|
137
147
|
```ts
|
|
138
148
|
await loader.loadModel(["/models/model.bmt"]);
|
|
139
149
|
await loader.loadModel(["/models/model.ifc"]);
|
|
150
|
+
await loader.loadModel(["/models/model.ifc"], { useIfcSpace: true });
|
|
140
151
|
await loader.loadModel(["/models/model.bmt", "/models/model.ifc"]);
|
|
141
152
|
await loader.loadModel(files);
|
|
142
153
|
```
|
|
@@ -199,6 +210,10 @@ function App() {
|
|
|
199
210
|
|
|
200
211
|
`P` - Create clipping plane by model intersection
|
|
201
212
|
|
|
213
|
+
### Dimensions
|
|
214
|
+
|
|
215
|
+
`M` - Toggle dimension drawing mode
|
|
216
|
+
|
|
202
217
|
## Viewer API
|
|
203
218
|
|
|
204
219
|
```ts
|
|
@@ -214,6 +229,9 @@ viewerRef.current?.geometryUtils.isolateByIds([1, 2, 3]);
|
|
|
214
229
|
viewerRef.current?.geometryUtils.isolateSelected();
|
|
215
230
|
viewerRef.current?.geometryUtils.resetIsolation();
|
|
216
231
|
viewerRef.current?.geometryUtils.getAllIds();
|
|
232
|
+
viewerRef.current?.geometryUtils.setIfcSpacesVisibility(false);
|
|
233
|
+
viewerRef.current?.geometryUtils.getIfcSpacesVisibility();
|
|
234
|
+
viewerRef.current?.geometryUtils.toggleIIfcSpacesVisibility();
|
|
217
235
|
|
|
218
236
|
viewerRef.current?.selector.setSelected(0, [10, 20], true);
|
|
219
237
|
viewerRef.current?.selector.addSelected(0, [30]);
|
|
@@ -230,6 +248,17 @@ viewerRef.current?.colors.clearColor(0, [10]);
|
|
|
230
248
|
viewerRef.current?.colors.clearModelColors(0);
|
|
231
249
|
viewerRef.current?.colors.clearAllColors();
|
|
232
250
|
|
|
251
|
+
viewerRef.current?.converter.convertToBmt({
|
|
252
|
+
activeView: true,
|
|
253
|
+
useMinVersion: true,
|
|
254
|
+
});
|
|
255
|
+
viewerRef.current?.converter.convertIfcFileToBmt(files, {
|
|
256
|
+
useIfcColors: true,
|
|
257
|
+
useIfcElementAssembly: true,
|
|
258
|
+
useIfcSpace: true,
|
|
259
|
+
useMinVersion: true,
|
|
260
|
+
});
|
|
261
|
+
|
|
233
262
|
viewerRef.current?.clipping.createPlane();
|
|
234
263
|
viewerRef.current?.clipping.createClippingRectangle();
|
|
235
264
|
viewerRef.current?.clipping.toggle();
|
|
@@ -238,6 +267,19 @@ viewerRef.current?.clipping.setEdgesActive(true);
|
|
|
238
267
|
viewerRef.current?.clipping.setHelpersActive(true);
|
|
239
268
|
viewerRef.current?.clipping.deleteAllPlanes();
|
|
240
269
|
|
|
270
|
+
viewerRef.current?.dimensions.setActive(true);
|
|
271
|
+
viewerRef.current?.dimensions.toggle();
|
|
272
|
+
viewerRef.current?.dimensions.cancelDrawing();
|
|
273
|
+
viewerRef.current?.dimensions.changeAxes();
|
|
274
|
+
viewerRef.current?.dimensions.delete();
|
|
275
|
+
viewerRef.current?.dimensions.deleteAll();
|
|
276
|
+
viewerRef.current?.dimensions.setUnit("mm");
|
|
277
|
+
viewerRef.current?.dimensions.setColor("#111827");
|
|
278
|
+
viewerRef.current?.dimensions.setWidth(1);
|
|
279
|
+
viewerRef.current?.dimensions.setSnapDistance(1);
|
|
280
|
+
viewerRef.current?.dimensions.setEndpointScaleFactor(0.015);
|
|
281
|
+
viewerRef.current?.dimensions.getDimensions();
|
|
282
|
+
|
|
241
283
|
viewerRef.current?.properties.getModelProps();
|
|
242
284
|
viewerRef.current?.properties.getModelStructure();
|
|
243
285
|
viewerRef.current?.utils.getUserDevice();
|
|
@@ -295,6 +337,8 @@ function App() {
|
|
|
295
337
|
}
|
|
296
338
|
```
|
|
297
339
|
|
|
340
|
+
IFC space visibility is a separate mesh-level layer. When spaces are disabled through `setIfcSpacesVisibility(false)`, `showAll()` does not show them again; use `setIfcSpacesVisibility(true)` or `toggleIIfcSpacesVisibility()` for that.
|
|
341
|
+
|
|
298
342
|
## Colorize Elements
|
|
299
343
|
|
|
300
344
|
Use `viewerRef.current.colors` to apply temporary color overrides to model elements. The color is applied by `modelID` and element ids:
|
|
@@ -343,6 +387,89 @@ function App() {
|
|
|
343
387
|
}
|
|
344
388
|
```
|
|
345
389
|
|
|
390
|
+
## Convert To BMT
|
|
391
|
+
|
|
392
|
+
Use `viewerRef.current.converter` to export loaded models to the BMT format. With `activeView: true`, the converter uses the current viewer state and exports only visible elements.
|
|
393
|
+
|
|
394
|
+
```tsx
|
|
395
|
+
import { useRef } from "react";
|
|
396
|
+
import { Viewer, type ViewerApi } from "bimatter-viewer-react";
|
|
397
|
+
|
|
398
|
+
function downloadFiles(files: { blob: Blob; name: string }[]) {
|
|
399
|
+
files.forEach((file) => {
|
|
400
|
+
const url = URL.createObjectURL(file.blob);
|
|
401
|
+
const link = document.createElement("a");
|
|
402
|
+
|
|
403
|
+
link.href = url;
|
|
404
|
+
link.download = file.name;
|
|
405
|
+
link.click();
|
|
406
|
+
URL.revokeObjectURL(url);
|
|
407
|
+
});
|
|
408
|
+
}
|
|
409
|
+
|
|
410
|
+
function App() {
|
|
411
|
+
const viewerRef = useRef<ViewerApi>(null);
|
|
412
|
+
|
|
413
|
+
function convertToBmt() {
|
|
414
|
+
const result = viewerRef.current?.converter.convertToBmt({
|
|
415
|
+
activeView: true,
|
|
416
|
+
fileName: "model",
|
|
417
|
+
useMinVersion: true,
|
|
418
|
+
});
|
|
419
|
+
|
|
420
|
+
if (result) {
|
|
421
|
+
downloadFiles(result.files);
|
|
422
|
+
}
|
|
423
|
+
}
|
|
424
|
+
|
|
425
|
+
return (
|
|
426
|
+
<>
|
|
427
|
+
<button onClick={convertToBmt}>Export BMT</button>
|
|
428
|
+
<Viewer ref={viewerRef} modelUrls={["/models/model.ifc"]} />
|
|
429
|
+
</>
|
|
430
|
+
);
|
|
431
|
+
}
|
|
432
|
+
```
|
|
433
|
+
|
|
434
|
+
Converter options:
|
|
435
|
+
|
|
436
|
+
```ts
|
|
437
|
+
viewerRef.current?.converter.convertToBmt({
|
|
438
|
+
activeView: true,
|
|
439
|
+
fileName: "model",
|
|
440
|
+
fileNames: {
|
|
441
|
+
0: "architecture",
|
|
442
|
+
1: "structure",
|
|
443
|
+
},
|
|
444
|
+
filterElement: ({ modelID, elementID }) => {
|
|
445
|
+
return modelID === 0 && elementID !== 10;
|
|
446
|
+
},
|
|
447
|
+
useMinVersion: true,
|
|
448
|
+
});
|
|
449
|
+
```
|
|
450
|
+
|
|
451
|
+
`activeView` exports only currently visible elements. This includes hide/isolate state because the viewer passes the current scene state to the converter.
|
|
452
|
+
|
|
453
|
+
`useMinVersion` exports `name.min.bmt` plus `name_props.json`. Without it, props and structure are written into one `.bmt` file.
|
|
454
|
+
|
|
455
|
+
`fileName` sets a base name for exported files. `fileNames` sets names per `modelID`.
|
|
456
|
+
|
|
457
|
+
`filterElement` is an optional custom element filter. Return `true` to keep an element in the exported BMT.
|
|
458
|
+
|
|
459
|
+
IFC file conversion is also available through the same API:
|
|
460
|
+
|
|
461
|
+
```ts
|
|
462
|
+
await viewerRef.current?.converter.convertIfcFileToBmt(files, {
|
|
463
|
+
fileName: "converted_ifc",
|
|
464
|
+
useIfcColors: true,
|
|
465
|
+
useIfcElementAssembly: true,
|
|
466
|
+
useIfcSpace: true,
|
|
467
|
+
useMinVersion: true,
|
|
468
|
+
});
|
|
469
|
+
```
|
|
470
|
+
|
|
471
|
+
`useIfcColors`, `useIfcElementAssembly`, and `useIfcSpace` are used when converting IFC files directly. They do not change already loaded model data in `convertToBmt`. `useIfcSpace` loads IFCSPACE geometry as a separate almost-transparent gray mesh when the IFC contains room geometry.
|
|
472
|
+
|
|
346
473
|
## Controlled Selection
|
|
347
474
|
|
|
348
475
|
Selection can be controlled by your app state, including Zustand, Redux, or local React state.
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import { type Object3D } from "three";
|
|
2
|
+
import type { BmtGeomData, BmtModelData } from "./BmtLoader";
|
|
3
|
+
import { type IfcCoordinationMatrixSource, type IfcModelSource } from "./IFCLoader/IFCLoader";
|
|
4
|
+
export type BmtConverterSource = IfcModelSource | IfcModelSource[];
|
|
5
|
+
export type BmtConvertibleModels = BmtModelData | BmtModelData[] | Record<number, BmtModelData>;
|
|
6
|
+
export type BmtVisibleIdsByModel = Record<string | number, Iterable<number>>;
|
|
7
|
+
export type BmtActiveViewFilterParams = {
|
|
8
|
+
elementID: number;
|
|
9
|
+
geometry: BmtGeomData;
|
|
10
|
+
geometryKey: number;
|
|
11
|
+
modelID: number;
|
|
12
|
+
};
|
|
13
|
+
export type BmtActiveViewFilter = (params: BmtActiveViewFilterParams) => boolean;
|
|
14
|
+
export type BmtConverterOptions = {
|
|
15
|
+
activeView?: boolean;
|
|
16
|
+
activeViewRoot?: Object3D | Object3D[] | null;
|
|
17
|
+
chunk?: number;
|
|
18
|
+
coordinationMatrix?: IfcCoordinationMatrixSource;
|
|
19
|
+
fileName?: string;
|
|
20
|
+
fileNames?: Record<string | number, string>;
|
|
21
|
+
filterElement?: BmtActiveViewFilter;
|
|
22
|
+
maxMeshBytes?: number;
|
|
23
|
+
useIfcColors?: boolean;
|
|
24
|
+
useIfcElementAssembly?: boolean;
|
|
25
|
+
useIfcSpace?: boolean;
|
|
26
|
+
useMinVersion?: boolean;
|
|
27
|
+
visibleIdsByModel?: BmtVisibleIdsByModel;
|
|
28
|
+
wasmPath?: string;
|
|
29
|
+
};
|
|
30
|
+
export type BmtConvertedFileType = "bmt" | "json";
|
|
31
|
+
export type BmtConvertedFile = {
|
|
32
|
+
blob: Blob;
|
|
33
|
+
bytes: Uint8Array;
|
|
34
|
+
name: string;
|
|
35
|
+
type: BmtConvertedFileType;
|
|
36
|
+
};
|
|
37
|
+
export type BmtConversionResult = {
|
|
38
|
+
files: BmtConvertedFile[];
|
|
39
|
+
models: Record<number, BmtModelData>;
|
|
40
|
+
};
|
|
41
|
+
export declare class BmtConverter {
|
|
42
|
+
private readonly textEncoder;
|
|
43
|
+
private readonly ifcLoader;
|
|
44
|
+
ConvertIfcFileToBmt(sources: BmtConverterSource, options?: BmtConverterOptions): Promise<BmtConversionResult>;
|
|
45
|
+
convertIfcFileToBmt(sources: BmtConverterSource, options?: BmtConverterOptions): Promise<BmtConversionResult>;
|
|
46
|
+
ConvertToBmt(models: BmtConvertibleModels, options?: BmtConverterOptions): BmtConversionResult;
|
|
47
|
+
convertToBmt(models: BmtConvertibleModels, options?: BmtConverterOptions): BmtConversionResult;
|
|
48
|
+
private configureIfcLoader;
|
|
49
|
+
private normalizeModels;
|
|
50
|
+
private isBmtModelData;
|
|
51
|
+
private getFileNamesFromSources;
|
|
52
|
+
private getModelFileBaseName;
|
|
53
|
+
private normalizeBaseName;
|
|
54
|
+
private createModelFiles;
|
|
55
|
+
private createBmtBytes;
|
|
56
|
+
private writeProps;
|
|
57
|
+
private writeMeshes;
|
|
58
|
+
private createMeshPayload;
|
|
59
|
+
private writeJsonChunk;
|
|
60
|
+
private writeTextChunk;
|
|
61
|
+
private writeChunk;
|
|
62
|
+
private createSerializableModel;
|
|
63
|
+
private markIfcSpaceGeometries;
|
|
64
|
+
private markIfcSpaceGeometry;
|
|
65
|
+
private geometryHasOnlyIds;
|
|
66
|
+
private getHiddenElementIds;
|
|
67
|
+
private addGeometryElementIds;
|
|
68
|
+
private getElementFilter;
|
|
69
|
+
private filterGeometry;
|
|
70
|
+
private isValidVertexIndex;
|
|
71
|
+
private createIndexArray;
|
|
72
|
+
private filterProps;
|
|
73
|
+
private filterStructure;
|
|
74
|
+
private filterStructureNode;
|
|
75
|
+
private getStructureNodeElementID;
|
|
76
|
+
private isStructureNode;
|
|
77
|
+
private getVisibleIdsByModel;
|
|
78
|
+
private getIfcSpaceIdsByModel;
|
|
79
|
+
private addVisibleIdsFromObject3D;
|
|
80
|
+
private isReadableAttribute;
|
|
81
|
+
private isObjectVisible;
|
|
82
|
+
private isIfcSpaceObject;
|
|
83
|
+
private getObjectModelID;
|
|
84
|
+
private hasMeshMatrices;
|
|
85
|
+
private getIndexType;
|
|
86
|
+
private colorToByte;
|
|
87
|
+
private deflateTypedArray;
|
|
88
|
+
private deflateBytes;
|
|
89
|
+
private encodeText;
|
|
90
|
+
private encodePrettyJson;
|
|
91
|
+
private isRecord;
|
|
92
|
+
}
|
|
93
|
+
export declare const bmtConverter: BmtConverter;
|
|
94
|
+
export declare function ConvertIfcFileToBmt(sources: BmtConverterSource, options?: BmtConverterOptions): Promise<BmtConversionResult>;
|
|
95
|
+
export declare function ConvertToBmt(models: BmtConvertibleModels, options?: BmtConverterOptions): BmtConversionResult;
|
|
@@ -12,6 +12,7 @@ export interface BmtGeomData {
|
|
|
12
12
|
pos: Float32Array;
|
|
13
13
|
norm?: Float32Array;
|
|
14
14
|
ind: BmtIndexArray;
|
|
15
|
+
isIfcSpace?: boolean;
|
|
15
16
|
ids: Uint32Array;
|
|
16
17
|
matrix?: string;
|
|
17
18
|
mat: BmtMaterialData;
|
|
@@ -85,6 +86,7 @@ export declare class BMTLoader {
|
|
|
85
86
|
STRUCTURE: number;
|
|
86
87
|
GRIDS: number;
|
|
87
88
|
MATRIX: number;
|
|
89
|
+
MESHSPACE: number;
|
|
88
90
|
};
|
|
89
91
|
parseMesh(data: Uint8Array): BmtMeshData;
|
|
90
92
|
private getExternalMetadataPath;
|
|
@@ -21,6 +21,7 @@ export type IfcCoordinationMatrixSource = Matrix4 | number[] | string | null | u
|
|
|
21
21
|
export declare class IFCLoader {
|
|
22
22
|
useIfcElemetAssembly: boolean;
|
|
23
23
|
useIfcColors: boolean;
|
|
24
|
+
useIfcSpace: boolean;
|
|
24
25
|
private coordinationMatrix;
|
|
25
26
|
private parser;
|
|
26
27
|
private propertySerializer;
|
|
@@ -58,9 +59,11 @@ export declare class IfcParser {
|
|
|
58
59
|
private readonly meshMatrix;
|
|
59
60
|
private readonly normalMatrix;
|
|
60
61
|
constructor(parser: IfcAPI, ifcModelID: number, options: IfcParserOptions);
|
|
61
|
-
parseData(allIds: Set<number>, elementsAssembly: IfcElementsAssembly | null): BmtModelData;
|
|
62
|
+
parseData(allIds: Set<number>, elementsAssembly: IfcElementsAssembly | null, includeSpaces?: boolean): BmtModelData;
|
|
63
|
+
private streamGeometryChunks;
|
|
62
64
|
private applyGeometryTransformation;
|
|
63
65
|
private planGeometryChunks;
|
|
66
|
+
private streamMeshes;
|
|
64
67
|
private getMaterialChunkPlan;
|
|
65
68
|
private deleteFlatMesh;
|
|
66
69
|
private canFitInChunk;
|
package/lib/SelectableMesh.d.ts
CHANGED
|
@@ -4,8 +4,9 @@ import type { BmtGeomData, BmtMaterialData } from "./Loaders/BmtLoader";
|
|
|
4
4
|
type SelectableMeshProps = {
|
|
5
5
|
colorPaletteTexture: DataTexture;
|
|
6
6
|
data: BmtGeomData;
|
|
7
|
+
isIfcSpace?: boolean;
|
|
7
8
|
material: BmtMaterialData;
|
|
8
9
|
meshMatrix: Matrix4;
|
|
9
10
|
};
|
|
10
|
-
export declare const SelectableMesh: React.MemoExoticComponent<({ colorPaletteTexture, material, data, meshMatrix, }: SelectableMeshProps) => import("react/jsx-runtime").JSX.Element>;
|
|
11
|
+
export declare const SelectableMesh: React.MemoExoticComponent<({ colorPaletteTexture, material, data, isIfcSpace, meshMatrix, }: SelectableMeshProps) => import("react/jsx-runtime").JSX.Element>;
|
|
11
12
|
export {};
|
package/lib/api/ViewerApi.d.ts
CHANGED
|
@@ -2,19 +2,25 @@ import type { ColorRepresentation } from "three";
|
|
|
2
2
|
import type { SelectedStore, UserDevice, ViewerGridAxesVisibility, ViewerGridAxisSide, ViewerStoreApi } from "../store/ViewerStore";
|
|
3
3
|
import { type ViewerPropertiesApi } from "./ViewerPropertiesApi";
|
|
4
4
|
import type { ViewerClippingApi } from "../utils/ClippingUtils";
|
|
5
|
+
import type { ViewerDimensionsApi } from "../utils/DimentionsUtils";
|
|
5
6
|
import type { ViewerCameraGetIntersection } from "../Camera/useCameraUtils";
|
|
7
|
+
import type { BmtConversionResult, BmtConverterOptions, BmtConverterSource } from "../Loaders/BmtConverter";
|
|
6
8
|
export type { ViewerClippingApi } from "../utils/ClippingUtils";
|
|
9
|
+
export type { ViewerDimensionsApi } from "../utils/DimentionsUtils";
|
|
7
10
|
export type { ViewerCameraGetIntersection } from "../Camera/useCameraUtils";
|
|
8
11
|
export type ViewerSelection = Record<number, number[]>;
|
|
9
12
|
export type ViewerGeometryUtilsApi = {
|
|
10
13
|
getAllIds: () => number[];
|
|
14
|
+
getIfcSpacesVisibility: () => boolean;
|
|
11
15
|
hideByIds: (ids: number[]) => void;
|
|
12
16
|
hideSelected: () => void;
|
|
13
17
|
isolateByIds: (ids: number[]) => void;
|
|
14
18
|
isolateSelected: () => void;
|
|
15
19
|
resetIsolation: () => void;
|
|
20
|
+
setIfcSpacesVisibility: (visible: boolean) => void;
|
|
16
21
|
showAll: () => void;
|
|
17
22
|
showByIds: (ids: number[]) => void;
|
|
23
|
+
toggleIIfcSpacesVisibility: () => void;
|
|
18
24
|
};
|
|
19
25
|
export type ViewerSelectorApi = {
|
|
20
26
|
addSelected: (modelID: number, ids: number[]) => void;
|
|
@@ -54,10 +60,17 @@ export type ViewerCameraApi = {
|
|
|
54
60
|
fitCamera: () => void;
|
|
55
61
|
getIntersection: ViewerCameraGetIntersection;
|
|
56
62
|
};
|
|
63
|
+
export type ViewerBmtConverterOptions = Pick<BmtConverterOptions, "activeView" | "fileName" | "fileNames" | "filterElement" | "useIfcColors" | "useIfcElementAssembly" | "useIfcSpace" | "useMinVersion">;
|
|
64
|
+
export type ViewerConverterApi = {
|
|
65
|
+
convertIfcFileToBmt: (sources: BmtConverterSource, options?: ViewerBmtConverterOptions) => Promise<BmtConversionResult>;
|
|
66
|
+
convertToBmt: (options?: ViewerBmtConverterOptions) => BmtConversionResult;
|
|
67
|
+
};
|
|
57
68
|
export type ViewerApi = {
|
|
58
69
|
camera: ViewerCameraApi;
|
|
59
70
|
clipping: ViewerClippingApi;
|
|
60
71
|
colors: ViewerColorsApi;
|
|
72
|
+
converter: ViewerConverterApi;
|
|
73
|
+
dimensions: ViewerDimensionsApi;
|
|
61
74
|
geometryUtils: ViewerGeometryUtilsApi;
|
|
62
75
|
properties: ViewerPropertiesApi;
|
|
63
76
|
selector: ViewerSelectorApi;
|
|
@@ -67,6 +80,8 @@ export type ViewerSceneApi = {
|
|
|
67
80
|
camera: ViewerCameraApi;
|
|
68
81
|
clipping: ViewerClippingApi;
|
|
69
82
|
colors: ViewerColorsApi;
|
|
83
|
+
converter: ViewerConverterApi;
|
|
84
|
+
dimensions: ViewerDimensionsApi;
|
|
70
85
|
geometryUtils: ViewerGeometryUtilsApi;
|
|
71
86
|
};
|
|
72
87
|
export declare function serializeSelected(selected: SelectedStore): ViewerSelection;
|
package/lib/api/loader.d.ts
CHANGED
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
import { type BmtModelData } from "../Loaders/BmtLoader";
|
|
2
2
|
export type ViewerModelSource = string | File;
|
|
3
3
|
export type ViewerLoadedModels = Record<number, BmtModelData>;
|
|
4
|
+
export type ViewerLoadModelOptions = {
|
|
5
|
+
useIfcSpace?: boolean;
|
|
6
|
+
};
|
|
4
7
|
declare class ViewerLoaderApi {
|
|
5
8
|
coordinationMatrix: string | undefined;
|
|
9
|
+
useIfcSpace: boolean;
|
|
6
10
|
private bmtLoader;
|
|
7
11
|
private ifcLoader;
|
|
8
12
|
private loadedModelCount;
|
|
@@ -10,10 +14,12 @@ declare class ViewerLoaderApi {
|
|
|
10
14
|
private initLoaders;
|
|
11
15
|
private getBmtLoader;
|
|
12
16
|
private getIfcLoader;
|
|
17
|
+
private getFileSourceMap;
|
|
18
|
+
private applyBmtMetadata;
|
|
13
19
|
private loadBmtModel;
|
|
14
20
|
private resetCoordinationMatrixState;
|
|
15
21
|
resetCoordinationMatrix(): void;
|
|
16
|
-
loadModel(sources: ViewerModelSource | ViewerModelSource[]): Promise<ViewerLoadedModels>;
|
|
22
|
+
loadModel(sources: ViewerModelSource | ViewerModelSource[], options?: ViewerLoadModelOptions): Promise<ViewerLoadedModels>;
|
|
17
23
|
}
|
|
18
24
|
export declare const loader: ViewerLoaderApi;
|
|
19
25
|
export {};
|
package/lib/index.d.ts
CHANGED
|
@@ -1,16 +1,19 @@
|
|
|
1
1
|
export { default as Viewer } from "./Viewer";
|
|
2
2
|
export type { ViewerModelsData, ViewerProps } from "./Viewer";
|
|
3
|
-
export type { ViewerApi, ViewerCameraApi, ViewerCameraGetIntersection, ViewerClippingApi, ViewerColorsApi, ViewerGeometryUtilsApi, ViewerSelection, ViewerSelectorApi, ViewerUtilsApi, } from "./api/ViewerApi";
|
|
3
|
+
export type { ViewerApi, ViewerCameraApi, ViewerCameraGetIntersection, ViewerClippingApi, ViewerColorsApi, ViewerBmtConverterOptions, ViewerConverterApi, ViewerDimensionsApi, ViewerGeometryUtilsApi, ViewerSelection, ViewerSelectorApi, ViewerUtilsApi, } from "./api/ViewerApi";
|
|
4
4
|
export type { ViewerPropertiesApi } from "./api/ViewerPropertiesApi";
|
|
5
5
|
export { BMTLoader } from "./Loaders/BmtLoader";
|
|
6
6
|
export type { BmtModelGeometryData, BmtGeomData, BmtIndexArray, BmtMaterialData, BmtElementProps, BmtModelData, BmtModelProps, BmtModelStructure, BmtModelStructureNode, BmtPropertyRecord, BmtPropertySet, BmtPropertyValue, } from "./Loaders/BmtLoader";
|
|
7
7
|
export { IFCLoader } from "./Loaders/IFCLoader/IFCLoader";
|
|
8
8
|
export type { IfcLoadedModels, IfcModelSource, } from "./Loaders/IFCLoader/IFCLoader";
|
|
9
|
+
export { BmtConverter, ConvertIfcFileToBmt, ConvertToBmt, bmtConverter, } from "./Loaders/BmtConverter";
|
|
10
|
+
export type { BmtActiveViewFilter, BmtActiveViewFilterParams, BmtConvertibleModels, BmtConversionResult, BmtConvertedFile, BmtConvertedFileType, BmtConverterOptions, BmtConverterSource, BmtVisibleIdsByModel, } from "./Loaders/BmtConverter";
|
|
9
11
|
export { ModelGrids } from "./utils/ModelGrids";
|
|
10
12
|
export type { ModelGridAxis, ModelGridData, ModelGridPoint, ModelGridsProps, ModelGridsData, } from "./utils/ModelGrids";
|
|
11
13
|
export { loader } from "./api/loader";
|
|
12
|
-
export type { ViewerLoadedModels, ViewerModelSource } from "./api/loader";
|
|
14
|
+
export type { ViewerLoadedModels, ViewerLoadModelOptions, ViewerModelSource, } from "./api/loader";
|
|
13
15
|
export { NavigationCube } from "./utils/NavigationCube";
|
|
16
|
+
export { DimensionLine, DimensionsUtils, useDimensionsUtils, type DimensionUnit, } from "./utils/DimentionsUtils";
|
|
14
17
|
export { createViewerStore } from "./store/ViewerStore";
|
|
15
18
|
export { ViewerStoreProvider } from "./store/ViewerStoreProvider";
|
|
16
19
|
export { useViewerStore, useViewerStoreApi } from "./store/useViewerStore";
|