bimatter-viewer-react 0.6.7 → 0.6.9
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/lib/Viewer.d.ts
CHANGED
|
@@ -4,6 +4,7 @@ import { Canvas } from "@react-three/fiber";
|
|
|
4
4
|
import type { ViewerMaterialMode } from "./types";
|
|
5
5
|
import { type ViewerApi, type ViewerSelection } from "./api/ViewerApi";
|
|
6
6
|
import { type ViewerModelSource } from "./api/loader";
|
|
7
|
+
import type { WorkerProgressEvent } from "./workers";
|
|
7
8
|
type ModelsData = Record<number, BmtModelData>;
|
|
8
9
|
export type ViewerModelsData = ModelsData;
|
|
9
10
|
export type ViewerProps = {
|
|
@@ -11,10 +12,15 @@ export type ViewerProps = {
|
|
|
11
12
|
camera?: ComponentProps<typeof Canvas>["camera"];
|
|
12
13
|
dpr?: ComponentProps<typeof Canvas>["dpr"];
|
|
13
14
|
defaultSelected?: ViewerSelection;
|
|
15
|
+
fitToView?: boolean;
|
|
14
16
|
materialMode?: ViewerMaterialMode;
|
|
17
|
+
modelsLoading?: boolean;
|
|
15
18
|
modelUrls?: string[];
|
|
16
19
|
modelSources?: ViewerModelSource[];
|
|
17
20
|
modelsData?: ModelsData;
|
|
21
|
+
onModelsDataChange?: (modelsData: ModelsData | undefined) => void;
|
|
22
|
+
onModelLoadingChange?: (loading: boolean) => void;
|
|
23
|
+
onModelProgress?: (progress: WorkerProgressEvent | null) => void;
|
|
18
24
|
onReady?: (api: ViewerApi) => void;
|
|
19
25
|
onSelectedChange?: (selected: ViewerSelection) => void;
|
|
20
26
|
performanceMode?: boolean;
|
|
@@ -60,7 +60,9 @@ var b = l.memo(function({ colorPaletteTexture: e, material: t, materialMode: n =
|
|
|
60
60
|
v
|
|
61
61
|
]), u(() => {
|
|
62
62
|
if (!s.current) return;
|
|
63
|
-
let e = s.current.geometry
|
|
63
|
+
let e = s.current.geometry;
|
|
64
|
+
n !== "performance" && !e.attributes.normal && e.computeVertexNormals();
|
|
65
|
+
let t = new h(e, { indirect: !0 });
|
|
64
66
|
return Object.assign(e, { boundsTree: t }), () => {
|
|
65
67
|
S.dispose(), Object.assign(e, { boundsTree: null });
|
|
66
68
|
};
|
package/lib/api/ViewerApi.d.ts
CHANGED
|
@@ -7,6 +7,8 @@ import type { ViewerDimensionsApi } from "../utils/DimentionsUtils";
|
|
|
7
7
|
import type { ViewerCameraGetIntersection } from "../Camera/useCameraUtils";
|
|
8
8
|
import type { BmtConversionResult, BmtConverterOptions, BmtConverterSource } from "../Loaders/BmtConverter";
|
|
9
9
|
import { FilteredElementsCollector } from "../Selector/FilteredElementsCollector";
|
|
10
|
+
import type { ViewerLoadedModels, ViewerLoadModelOptions, ViewerModelSource } from "./loader";
|
|
11
|
+
import type { WorkerProgressEvent } from "../workers";
|
|
10
12
|
export type { ViewerClippingApi } from "../utils/ClippingUtils";
|
|
11
13
|
export type { ViewerColorConfigByModel, ViewerModelColorConfig, } from "../utils/ColorsUtils/useElementColors";
|
|
12
14
|
export type { ViewerDimensionsApi } from "../utils/DimentionsUtils";
|
|
@@ -76,6 +78,17 @@ export type ViewerConverterApi = {
|
|
|
76
78
|
convertIfcFileToBmt: (sources: BmtConverterSource, options?: ViewerBmtConverterOptions) => Promise<BmtConversionResult>;
|
|
77
79
|
convertToBmt: (options?: ViewerBmtConverterOptions) => BmtConversionResult;
|
|
78
80
|
};
|
|
81
|
+
export type ViewerLoadModelsOptions = ViewerLoadModelOptions & {
|
|
82
|
+
clearViewer?: boolean;
|
|
83
|
+
fitToView?: boolean;
|
|
84
|
+
};
|
|
85
|
+
export type ViewerModelsApi = {
|
|
86
|
+
getData: () => ViewerLoadedModels | undefined;
|
|
87
|
+
getLoading: () => boolean;
|
|
88
|
+
getProgress: () => WorkerProgressEvent | null;
|
|
89
|
+
loadModels: (sources: ViewerModelSource[], options?: ViewerLoadModelsOptions) => Promise<ViewerLoadedModels>;
|
|
90
|
+
reset: () => void;
|
|
91
|
+
};
|
|
79
92
|
export type ViewerApi = {
|
|
80
93
|
camera: ViewerCameraApi;
|
|
81
94
|
clipping: ViewerClippingApi;
|
|
@@ -83,6 +96,7 @@ export type ViewerApi = {
|
|
|
83
96
|
converter: ViewerConverterApi;
|
|
84
97
|
dimensions: ViewerDimensionsApi;
|
|
85
98
|
geometryUtils: ViewerGeometryUtilsApi;
|
|
99
|
+
models: ViewerModelsApi;
|
|
86
100
|
properties: ViewerPropertiesApi;
|
|
87
101
|
selector: ViewerSelectorApi;
|
|
88
102
|
utils: ViewerUtilsApi;
|
|
@@ -98,4 +112,4 @@ export type ViewerSceneApi = {
|
|
|
98
112
|
};
|
|
99
113
|
export declare function serializeSelected(selected: SelectedStore): ViewerSelection;
|
|
100
114
|
export declare function createSelectedStore(selection: ViewerSelection): SelectedStore;
|
|
101
|
-
export declare function createPublicViewerApi(viewerStore: ViewerStoreApi, getSceneApi: () => ViewerSceneApi | null): ViewerApi;
|
|
115
|
+
export declare function createPublicViewerApi(viewerStore: ViewerStoreApi, getSceneApi: () => ViewerSceneApi | null, getModelsApi: () => ViewerModelsApi | null): ViewerApi;
|
package/lib/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export { default as Viewer } from "./Viewer";
|
|
2
2
|
export type { ViewerModelsData, ViewerProps } from "./Viewer";
|
|
3
3
|
export type { ViewerMaterialMode } from "./types";
|
|
4
|
-
export type { ViewerApi, ViewerCameraApi, ViewerCameraGetIntersection, ViewerClippingApi, ViewerColorsApi, ViewerBmtConverterOptions, ViewerConverterApi, ViewerDimensionsApi, ViewerGeometryUtilsApi, ViewerSelection, ViewerSelectorApi, ViewerUtilsApi, } from "./api/ViewerApi";
|
|
4
|
+
export type { ViewerApi, ViewerCameraApi, ViewerCameraGetIntersection, ViewerClippingApi, ViewerColorsApi, ViewerBmtConverterOptions, ViewerConverterApi, ViewerDimensionsApi, ViewerGeometryUtilsApi, ViewerLoadModelsOptions, ViewerModelsApi, ViewerSelection, ViewerSelectorApi, ViewerUtilsApi, } from "./api/ViewerApi";
|
|
5
5
|
export type { ViewerModelLevel, ViewerModelLevelsByModel, ViewerPropertiesApi, ViewerPropertiesExcelOptions, } from "./api/ViewerPropertiesApi";
|
|
6
6
|
export { BMTLoader } from "./Loaders/BmtLoader";
|
|
7
7
|
export type { BmtGeometryChunkData, BmtParseCallbacks, BmtParseProgressData, BmtModelGeometryData, BmtGeomData, BmtIndexArray, BmtMaterialData, BmtElementProps, BmtModelData, BmtModelProps, BmtModelStructure, BmtModelStructureNode, BmtPropertyRecord, BmtPropertySet, BmtPropertyValue, } from "./Loaders/BmtLoader";
|