bimatter-viewer-react 1.0.0 → 1.0.2
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/Model.d.ts +3 -2
- package/lib/SelectableMesh.d.ts +7 -2
- package/lib/ViewerComponents/ViewerScene.d.ts +5 -1
- package/lib/WebGpuSelectableMesh.d.ts +1 -1
- package/lib/api/ViewerApi.d.ts +8 -1
- package/lib/api/loader.d.ts +1 -0
- package/lib/index.d.ts +1 -0
- package/lib/index.js +3474 -2614
- package/lib/sharedMeshMaterials.d.ts +24 -0
- package/lib/utils/ClippingUtils/ClippingUtils.d.ts +6 -0
- package/lib/utils/DimentionsUtils/DimentionsUtils.d.ts +5 -0
- package/lib/utils/DimentionsUtils/index.d.ts +1 -1
- package/lib/utils/GeometryUtils/ElementCreationPreview.d.ts +23 -0
- package/lib/utils/GeometryUtils/createElements.d.ts +79 -0
- package/lib/workers/WorkerErrors.d.ts +6 -0
- package/package.json +1 -1
package/lib/Model.d.ts
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import type { BmtModelData } from "./Loaders/BmtLoader";
|
|
2
|
-
import { Matrix4, type DataTexture } from "three";
|
|
2
|
+
import { Matrix4, type DataTexture, type Plane } from "three";
|
|
3
3
|
import type { ViewerMaterialMode } from "./types";
|
|
4
4
|
type ModelProps = {
|
|
5
5
|
colorPaletteTexture: DataTexture;
|
|
6
6
|
coordinationMatrix?: Matrix4 | null;
|
|
7
7
|
modelID: number;
|
|
8
8
|
data: BmtModelData;
|
|
9
|
+
getClippingPlanes?: () => Plane[];
|
|
9
10
|
loadGeneration: number;
|
|
10
11
|
materialMode?: ViewerMaterialMode;
|
|
11
12
|
onUploadComplete?: (modelID: number, uploadedItemCount: number) => void;
|
|
@@ -16,6 +17,6 @@ type ModelProps = {
|
|
|
16
17
|
export declare function parseModelMatrix(matrix?: string): Matrix4 | null;
|
|
17
18
|
export declare function getModelCoordinationMatrix(data: BmtModelData): Matrix4 | null;
|
|
18
19
|
export declare function getModelCoordinationMatrixSource(data: BmtModelData): string | undefined;
|
|
19
|
-
declare function Model({ colorPaletteTexture, coordinationMatrix, modelID, data, loadGeneration, materialMode: materialModeOverride, onUploadComplete, onUploadProgress, trueNorthEnabled, useWebGPU, }: ModelProps): import("react/jsx-runtime").JSX.Element;
|
|
20
|
+
declare function Model({ colorPaletteTexture, coordinationMatrix, modelID, data, getClippingPlanes, loadGeneration, materialMode: materialModeOverride, onUploadComplete, onUploadProgress, trueNorthEnabled, useWebGPU, }: ModelProps): import("react/jsx-runtime").JSX.Element;
|
|
20
21
|
declare const _default: import("react").MemoExoticComponent<typeof Model>;
|
|
21
22
|
export default _default;
|
package/lib/SelectableMesh.d.ts
CHANGED
|
@@ -1,12 +1,17 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import { Matrix4, MeshBasicMaterial, MeshLambertMaterial, type ColorRepresentation, type DataTexture, type Material } from "three";
|
|
2
|
+
import { Matrix4, MeshBasicMaterial, MeshLambertMaterial, type ColorRepresentation, type DataTexture, type Material, type Plane } from "three";
|
|
3
3
|
import type { BmtGeomData, BmtMaterialData } from "./Loaders/BmtLoader";
|
|
4
4
|
import type { ViewerMaterialMode } from "./types";
|
|
5
|
+
import { type SharedMeshMaterials } from "./sharedMeshMaterials";
|
|
5
6
|
export type SelectableMeshProps = {
|
|
6
7
|
colorPaletteTexture: DataTexture;
|
|
7
8
|
data: BmtGeomData;
|
|
9
|
+
/** Current section planes, applied before the mesh is first rendered. */
|
|
10
|
+
getClippingPlanes?: () => Plane[];
|
|
8
11
|
isIfcSpace?: boolean;
|
|
9
12
|
material: BmtMaterialData;
|
|
13
|
+
/** Model-wide cache; without it the mesh owns its material. */
|
|
14
|
+
materialCache?: SharedMeshMaterials;
|
|
10
15
|
materialMode?: ViewerMaterialMode;
|
|
11
16
|
meshMatrix: Matrix4;
|
|
12
17
|
onReady?: (readyKey: string) => void;
|
|
@@ -18,4 +23,4 @@ export declare function createSelectableMaterial({ colorPaletteTexture, material
|
|
|
18
23
|
preselectionColor: ColorRepresentation;
|
|
19
24
|
}): MeshBasicMaterial | MeshLambertMaterial;
|
|
20
25
|
export declare function updateSelectableMaterialPreselectionColor(material: Material, preselectionColor: ColorRepresentation): void;
|
|
21
|
-
export declare const SelectableMesh: React.MemoExoticComponent<({ colorPaletteTexture, material, materialMode, data, isIfcSpace, meshMatrix, onReady, readyKey, useDoubleSideMaterial, }: SelectableMeshProps) => import("react/jsx-runtime").JSX.Element>;
|
|
26
|
+
export declare const SelectableMesh: React.MemoExoticComponent<({ colorPaletteTexture, material, materialCache, materialMode, data, getClippingPlanes, isIfcSpace, meshMatrix, onReady, readyKey, useDoubleSideMaterial, }: SelectableMeshProps) => import("react/jsx-runtime").JSX.Element>;
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import { Object3D, Plane } from "three";
|
|
2
2
|
import type { BmtModelData } from "../Loaders/BmtLoader";
|
|
3
3
|
import type { ViewerCameraRef, ViewerControlsRef, ViewerLightRef, ViewerMaterialMode, ViewerModelRef } from "../types";
|
|
4
|
+
import { type CreatedBmtElement } from "../utils/GeometryUtils/createElements";
|
|
4
5
|
import { type ViewerNotesApi } from "../utils/NotesUtils";
|
|
5
6
|
import { type ViewerApi, type ViewerSceneApi } from "../api/ViewerApi";
|
|
6
7
|
export type ModelsData = Record<number, BmtModelData>;
|
|
7
8
|
export type CameraDprMode = "wake" | "move" | "sleep";
|
|
8
|
-
|
|
9
|
+
type ElementCreatedHandler = (modelID: number, elementID: number, element: CreatedBmtElement) => void;
|
|
10
|
+
export declare const ViewerScene: import("react").MemoExoticComponent<({ autoFitCamera, cameraRef, controlRef, fitToView, loadGeneration, lightRef, materialMode, modelRef, modelsData, modelsLoading, initialPlanPlane, createPlanComment, createPlanMarkupCloud, deleteAllPlanNotes, onElementCreated, onReady, onModelsReady, onCameraDprModeChange, publicApi, invalidatePlanViews, setPlanPreselectionHandler, setPlanVisualObjectsGetter, setSceneApi, setPlanNotesModeActive, usePerformanceMoving, useWebGPU, }: {
|
|
9
11
|
autoFitCamera: boolean;
|
|
10
12
|
cameraRef: ViewerCameraRef;
|
|
11
13
|
controlRef: ViewerControlsRef;
|
|
@@ -18,6 +20,7 @@ export declare const ViewerScene: import("react").MemoExoticComponent<({ autoFit
|
|
|
18
20
|
modelsLoading: boolean;
|
|
19
21
|
initialPlanPlane?: Plane | null;
|
|
20
22
|
deleteAllPlanNotes: () => void;
|
|
23
|
+
onElementCreated: ElementCreatedHandler;
|
|
21
24
|
onReady?: (api: ViewerApi) => void;
|
|
22
25
|
onModelsReady: (loadGeneration: number) => void;
|
|
23
26
|
onCameraDprModeChange: (mode: CameraDprMode) => void;
|
|
@@ -35,3 +38,4 @@ export declare const ViewerScene: import("react").MemoExoticComponent<({ autoFit
|
|
|
35
38
|
usePerformanceMoving: boolean;
|
|
36
39
|
useWebGPU: boolean;
|
|
37
40
|
}) => import("react/jsx-runtime").JSX.Element>;
|
|
41
|
+
export {};
|
|
@@ -15,5 +15,5 @@ export declare function updateWebGpuSelectableMaterialColors(material: Material,
|
|
|
15
15
|
preselectionColor: ColorRepresentation;
|
|
16
16
|
selectionColor: ColorRepresentation;
|
|
17
17
|
}): void;
|
|
18
|
-
export declare const WebGpuSelectableMesh: React.MemoExoticComponent<({ colorPaletteTexture, material, materialMode, data, isIfcSpace, meshMatrix, onReady, readyKey, useDoubleSideMaterial, }: SelectableMeshProps) => import("react/jsx-runtime").JSX.Element>;
|
|
18
|
+
export declare const WebGpuSelectableMesh: React.MemoExoticComponent<({ colorPaletteTexture, material, materialCache, materialMode, data, getClippingPlanes, isIfcSpace, meshMatrix, onReady, readyKey, useDoubleSideMaterial, }: SelectableMeshProps) => import("react/jsx-runtime").JSX.Element>;
|
|
19
19
|
export {};
|
package/lib/api/ViewerApi.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ColorRepresentation, Group } from "three";
|
|
1
|
+
import type { BufferGeometry, ColorRepresentation, Group } from "three";
|
|
2
2
|
import type { SelectedStore, UserDevice, ViewerGridAxesVisibility, ViewerGridAxisSide, ViewerLightingSettings, ViewerLightingSettingsUpdate, ViewerPostproductionActivePassFilter, ViewerStoreApi } from "../store/ViewerStore";
|
|
3
3
|
import type { ViewerCameraProjection, ViewerFirstPersonControlSettings, ViewerPostproductionPassType } from "../types";
|
|
4
4
|
import { type ViewerPropertiesApi } from "./ViewerPropertiesApi";
|
|
@@ -11,6 +11,7 @@ import type { BmtConversionResult, BmtConverterOptions, BmtConverterSource } fro
|
|
|
11
11
|
import { FilteredElementsCollector } from "../Selector/FilteredElementsCollector";
|
|
12
12
|
import type { ViewerLoadedModels, ViewerLoadModelOptions, ViewerModelSource } from "./loader";
|
|
13
13
|
import type { GeometryIndex } from "../utils/GeometryUtils/useGeometryIndex";
|
|
14
|
+
import type { IfcElementType } from "../utils/GeometryUtils/createElements";
|
|
14
15
|
import type { WorkerProgressEvent } from "../workers";
|
|
15
16
|
import { type ViewerPlansApi, type ViewerPlansContainerFactory, type ViewerPlansSceneApi } from "./ViewerPlansApi";
|
|
16
17
|
export type { ViewerClippingApi, ViewerClippingVector3Input, } from "../utils/ClippingUtils";
|
|
@@ -23,6 +24,11 @@ export type { ViewerPlanHandle, ViewerPlansApi, ViewerPlanVector3Input, } from "
|
|
|
23
24
|
export type ViewerSelection = Record<number, number[]>;
|
|
24
25
|
export type ViewerGeometryUtilsApi = {
|
|
25
26
|
readonly indexesState: GeometryIndex | null;
|
|
27
|
+
cancelElementCreation: () => void;
|
|
28
|
+
createElement: (geometry: BufferGeometry, type: IfcElementType) => number;
|
|
29
|
+
createElementByGeometry: (geometry: BufferGeometry) => number;
|
|
30
|
+
createSlab: (thicknessMm?: number) => Promise<number>;
|
|
31
|
+
createWall: (heightMm?: number, widthMm?: number) => Promise<number>;
|
|
26
32
|
getAllIds: () => number[];
|
|
27
33
|
getIfcSpacesVisibility: () => boolean;
|
|
28
34
|
getModelGeometry: (modelID: number) => Group | null;
|
|
@@ -133,6 +139,7 @@ export type ViewerLoadModelsOptions = ViewerLoadModelOptions & {
|
|
|
133
139
|
onModelsDataChange?: (modelsData: ViewerLoadedModels | undefined) => void;
|
|
134
140
|
};
|
|
135
141
|
export type ViewerModelsApi = {
|
|
142
|
+
createEmptyModel: (name?: string) => number;
|
|
136
143
|
getData: () => ViewerLoadedModels | undefined;
|
|
137
144
|
getLoading: () => boolean;
|
|
138
145
|
getProgress: () => WorkerProgressEvent | null;
|
package/lib/api/loader.d.ts
CHANGED
|
@@ -41,6 +41,7 @@ declare class ViewerLoaderApi {
|
|
|
41
41
|
private resetCoordinationMatrixState;
|
|
42
42
|
private applyRenderSettings;
|
|
43
43
|
resetCoordinationMatrix(): void;
|
|
44
|
+
allocateModelID(usedModelIDs?: number[]): number;
|
|
44
45
|
loadModel(sources: ViewerModelSource | ViewerModelSource[], options?: ViewerLoadModelOptions): Promise<ViewerLoadedModels>;
|
|
45
46
|
}
|
|
46
47
|
export declare const loader: ViewerLoaderApi;
|
package/lib/index.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ export { default as Viewer } from "./Viewer";
|
|
|
2
2
|
export type { ViewerModelsData, ViewerProps } from "./Viewer";
|
|
3
3
|
export type { ViewerCameraProjection, ViewerMaterialMode, ViewerPostproductionPassType, ViewerUploadMode, } from "./types";
|
|
4
4
|
export type { ViewerApi, ViewerCameraApi, ViewerCameraGetIntersection, ViewerClippingApi, ViewerClippingVector3Input, ViewerColorsApi, ViewerBmtConverterOptions, ViewerConverterApi, ViewerDimensionsApi, ViewerGeometryUtilsApi, ViewerDetectedGpuInfo, ViewerGpuInfo, ViewerHardwareInfo, ViewerLoadModelsOptions, ViewerModelsApi, ViewerPlanHandle, ViewerPlansApi, ViewerPlanVector3Input, ViewerPostproductionApi, ViewerSelection, ViewerSelectorApi, ViewerUtilsApi, } from "./api/ViewerApi";
|
|
5
|
+
export type { BmtElementType, IfcElementType, } from "./utils/GeometryUtils/createElements";
|
|
5
6
|
export type { ViewerModelLevel, ViewerModelLevelsByModel, ViewerPropertiesApi, ViewerPropertiesExcelOptions, } from "./api/ViewerPropertiesApi";
|
|
6
7
|
export { BMTLoader } from "./Loaders/BmtLoader";
|
|
7
8
|
export type { BmtGeometryChunkData, BmtParseCallbacks, BmtParseProgressData, BmtModelGeometryData, BmtGeomData, BmtIndexArray, BmtMaterialData, BmtElementProps, BmtModelData, BmtModelProps, BmtModelStructure, BmtModelStructureNode, BmtPropertyRecord, BmtPropertySet, BmtPropertyValue, } from "./Loaders/BmtLoader";
|