@maqiuyao/dxf-viewer 0.1.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 +79 -0
- package/dist/assets/vite-project.css +1 -0
- package/dist/dxf-viewer.cjs +1533 -0
- package/dist/dxf-viewer.js +33490 -0
- package/dist/src/dxfViewer/core/Configs.d.ts +250 -0
- package/dist/src/dxfViewer/core/Constants.d.ts +76 -0
- package/dist/src/dxfViewer/core/Units.d.ts +16 -0
- package/dist/src/dxfViewer/core/VersionManager.d.ts +14 -0
- package/dist/src/dxfViewer/core/camera/CameraManager.d.ts +81 -0
- package/dist/src/dxfViewer/core/camera/index.d.ts +1 -0
- package/dist/src/dxfViewer/core/camera-controls/CameraControls.d.ts +744 -0
- package/dist/src/dxfViewer/core/camera-controls/Constants.d.ts +2 -0
- package/dist/src/dxfViewer/core/camera-controls/EventDispatcher.d.ts +42 -0
- package/dist/src/dxfViewer/core/camera-controls/index.d.ts +2 -0
- package/dist/src/dxfViewer/core/camera-controls/types.d.ts +112 -0
- package/dist/src/dxfViewer/core/camera-controls/utils/extractClientCoordFromEvent.d.ts +7 -0
- package/dist/src/dxfViewer/core/camera-controls/utils/math-utils.d.ts +14 -0
- package/dist/src/dxfViewer/core/camera-controls/utils/notSupportedInOrthographicCamera.d.ts +2 -0
- package/dist/src/dxfViewer/core/canvas/CanvasRender.d.ts +49 -0
- package/dist/src/dxfViewer/core/canvas/Constants.d.ts +28 -0
- package/dist/src/dxfViewer/core/canvas/Drawable.d.ts +87 -0
- package/dist/src/dxfViewer/core/canvas/DrawableList.d.ts +40 -0
- package/dist/src/dxfViewer/core/canvas/index.d.ts +4 -0
- package/dist/src/dxfViewer/core/compare/BaseDxfCompareHelper.d.ts +104 -0
- package/dist/src/dxfViewer/core/compare/CompareDrawable.d.ts +30 -0
- package/dist/src/dxfViewer/core/compare/DxfCompareHelper.d.ts +76 -0
- package/dist/src/dxfViewer/core/compare/DxfCompareMarkupManager.d.ts +11 -0
- package/dist/src/dxfViewer/core/compare/index.d.ts +4 -0
- package/dist/src/dxfViewer/core/components/Container.d.ts +38 -0
- package/dist/src/dxfViewer/core/components/ProgressBar.d.ts +31 -0
- package/dist/src/dxfViewer/core/components/Spinner.d.ts +13 -0
- package/dist/src/dxfViewer/core/components/index.d.ts +3 -0
- package/dist/src/dxfViewer/core/controls/CameraControlsEx.d.ts +33 -0
- package/dist/src/dxfViewer/core/controls/Control.d.ts +17 -0
- package/dist/src/dxfViewer/core/controls/OrbitControls.d.ts +13 -0
- package/dist/src/dxfViewer/core/controls/PlanControls.d.ts +13 -0
- package/dist/src/dxfViewer/core/controls/index.d.ts +3 -0
- package/dist/src/dxfViewer/core/dxf/DxfCompare.d.ts +170 -0
- package/dist/src/dxfViewer/core/dxf/DxfConstants.d.ts +24 -0
- package/dist/src/dxfViewer/core/dxf/DxfLoader.d.ts +569 -0
- package/dist/src/dxfViewer/core/dxf/DxfObject.d.ts +44 -0
- package/dist/src/dxfViewer/core/dxf/DxfUtils.d.ts +79 -0
- package/dist/src/dxfViewer/core/dxf/HatchPatternShaders.d.ts +12 -0
- package/dist/src/dxfViewer/core/dxf/LinePatternShaders.d.ts +12 -0
- package/dist/src/dxfViewer/core/dxf/bspline.d.ts +7 -0
- package/dist/src/dxfViewer/core/dxf/dxfom-mtext.d.ts +46 -0
- package/dist/src/dxfViewer/core/dxf/dxfom-text.d.ts +16 -0
- package/dist/src/dxfViewer/core/dxf/index.d.ts +10 -0
- package/dist/src/dxfViewer/core/dxf/round10.d.ts +1 -0
- package/dist/src/dxfViewer/core/dxf-parser/AutoCadColorIndex.d.ts +8 -0
- package/dist/src/dxfViewer/core/dxf-parser/DxfBaseReader.d.ts +13 -0
- package/dist/src/dxfViewer/core/dxf-parser/DxfBinaryReader.d.ts +14 -0
- package/dist/src/dxfViewer/core/dxf-parser/DxfParser.d.ts +321 -0
- package/dist/src/dxfViewer/core/dxf-parser/DxfTextReader.d.ts +30 -0
- package/dist/src/dxfViewer/core/dxf-parser/ParseHelpers.d.ts +18 -0
- package/dist/src/dxfViewer/core/dxf-parser/entities/3dface.d.ts +11 -0
- package/dist/src/dxfViewer/core/dxf-parser/entities/arc.d.ts +16 -0
- package/dist/src/dxfViewer/core/dxf-parser/entities/attdef.d.ts +31 -0
- package/dist/src/dxfViewer/core/dxf-parser/entities/attrib.d.ts +31 -0
- package/dist/src/dxfViewer/core/dxf-parser/entities/circle.d.ts +13 -0
- package/dist/src/dxfViewer/core/dxf-parser/entities/dimension.d.ts +22 -0
- package/dist/src/dxfViewer/core/dxf-parser/entities/ellipse.d.ts +15 -0
- package/dist/src/dxfViewer/core/dxf-parser/entities/geomtry.d.ts +40 -0
- package/dist/src/dxfViewer/core/dxf-parser/entities/hatch.d.ts +104 -0
- package/dist/src/dxfViewer/core/dxf-parser/entities/image.d.ts +37 -0
- package/dist/src/dxfViewer/core/dxf-parser/entities/insert.d.ts +21 -0
- package/dist/src/dxfViewer/core/dxf-parser/entities/leader.d.ts +20 -0
- package/dist/src/dxfViewer/core/dxf-parser/entities/line.d.ts +10 -0
- package/dist/src/dxfViewer/core/dxf-parser/entities/lwpolyline.d.ts +17 -0
- package/dist/src/dxfViewer/core/dxf-parser/entities/mleader.d.ts +97 -0
- package/dist/src/dxfViewer/core/dxf-parser/entities/mtext.d.ts +18 -0
- package/dist/src/dxfViewer/core/dxf-parser/entities/ole2frame.d.ts +18 -0
- package/dist/src/dxfViewer/core/dxf-parser/entities/point.d.ts +11 -0
- package/dist/src/dxfViewer/core/dxf-parser/entities/polyline.d.ts +19 -0
- package/dist/src/dxfViewer/core/dxf-parser/entities/ray.d.ts +10 -0
- package/dist/src/dxfViewer/core/dxf-parser/entities/region.d.ts +10 -0
- package/dist/src/dxfViewer/core/dxf-parser/entities/seqend.d.ts +8 -0
- package/dist/src/dxfViewer/core/dxf-parser/entities/solid.d.ts +10 -0
- package/dist/src/dxfViewer/core/dxf-parser/entities/spline.d.ts +23 -0
- package/dist/src/dxfViewer/core/dxf-parser/entities/table.d.ts +44 -0
- package/dist/src/dxfViewer/core/dxf-parser/entities/text.d.ts +18 -0
- package/dist/src/dxfViewer/core/dxf-parser/entities/vertex.d.ts +23 -0
- package/dist/src/dxfViewer/core/dxf-parser/entities/viewport.d.ts +46 -0
- package/dist/src/dxfViewer/core/dxf-parser/entities/xline.d.ts +10 -0
- package/dist/src/dxfViewer/core/dxf-parser/index.d.ts +27 -0
- package/dist/src/dxfViewer/core/dxf-parser/objects/common.d.ts +15 -0
- package/dist/src/dxfViewer/core/dxf-parser/objects/dictionary.d.ts +19 -0
- package/dist/src/dxfViewer/core/dxf-parser/objects/imagedef.d.ts +24 -0
- package/dist/src/dxfViewer/core/dxf-parser/objects/layout.d.ts +26 -0
- package/dist/src/dxfViewer/core/dxf-parser/objects/sortentstable.d.ts +12 -0
- package/dist/src/dxfViewer/core/dxf-parser/objects/spatialfilter.d.ts +22 -0
- package/dist/src/dxfViewer/core/dxf-parser/objects/xrecord.d.ts +11 -0
- package/dist/src/dxfViewer/core/effect/EffectManager.d.ts +43 -0
- package/dist/src/dxfViewer/core/effect/index.d.ts +1 -0
- package/dist/src/dxfViewer/core/font/BaseFont.d.ts +41 -0
- package/dist/src/dxfViewer/core/font/FontManager.d.ts +52 -0
- package/dist/src/dxfViewer/core/font/MeshFont.d.ts +14 -0
- package/dist/src/dxfViewer/core/font/ShxFont.d.ts +49 -0
- package/dist/src/dxfViewer/core/font/index.d.ts +1 -0
- package/dist/src/dxfViewer/core/font/shx/ExtraLettersTemplate.d.ts +4 -0
- package/dist/src/dxfViewer/core/font/shx/Shx.constants.d.ts +20 -0
- package/dist/src/dxfViewer/core/font/shx/ShxParser.d.ts +18 -0
- package/dist/src/dxfViewer/core/font/shx/TextShape.d.ts +24 -0
- package/dist/src/dxfViewer/core/font/shx/gbk/index.d.ts +3 -0
- package/dist/src/dxfViewer/core/font/shx/index.d.ts +1 -0
- package/dist/src/dxfViewer/core/font/shx/util/BitConverter.d.ts +21 -0
- package/dist/src/dxfViewer/core/geometry-offset/Edge.d.ts +27 -0
- package/dist/src/dxfViewer/core/geometry-offset/Offset.d.ts +46 -0
- package/dist/src/dxfViewer/core/geometry-offset/index.d.ts +1 -0
- package/dist/src/dxfViewer/core/helpers/BinaryReader.d.ts +23 -0
- package/dist/src/dxfViewer/core/helpers/BoxSelectHelper.d.ts +44 -0
- package/dist/src/dxfViewer/core/helpers/InstantiateHelper.d.ts +26 -0
- package/dist/src/dxfViewer/core/helpers/LoadingHelper.d.ts +59 -0
- package/dist/src/dxfViewer/core/helpers/MeshBvhHelper.d.ts +15 -0
- package/dist/src/dxfViewer/core/helpers/MobileTouchHelperDrawable.d.ts +26 -0
- package/dist/src/dxfViewer/core/helpers/OSnapHelper.d.ts +158 -0
- package/dist/src/dxfViewer/core/helpers/ObjectPixelSizeHelper.d.ts +13 -0
- package/dist/src/dxfViewer/core/helpers/PickMarkupHelper.d.ts +29 -0
- package/dist/src/dxfViewer/core/helpers/RafHelper.d.ts +18 -0
- package/dist/src/dxfViewer/core/helpers/ZoomToRectHelper.d.ts +24 -0
- package/dist/src/dxfViewer/core/helpers/index.d.ts +11 -0
- package/dist/src/dxfViewer/core/index.d.ts +19 -0
- package/dist/src/dxfViewer/core/indexeddb/BaseTable.d.ts +36 -0
- package/dist/src/dxfViewer/core/indexeddb/DxfDataTable.d.ts +22 -0
- package/dist/src/dxfViewer/core/indexeddb/FontDataTable.d.ts +32 -0
- package/dist/src/dxfViewer/core/indexeddb/IndexedDbManager.d.ts +50 -0
- package/dist/src/dxfViewer/core/indexeddb/index.d.ts +4 -0
- package/dist/src/dxfViewer/core/input-manager/InputManager.d.ts +146 -0
- package/dist/src/dxfViewer/core/input-manager/index.d.ts +2 -0
- package/dist/src/dxfViewer/core/materials/BimTilesHighlightMaterial.d.ts +21 -0
- package/dist/src/dxfViewer/core/materials/BimTilesMaterial.d.ts +32 -0
- package/dist/src/dxfViewer/core/materials/BimTilesPickMaterial.d.ts +14 -0
- package/dist/src/dxfViewer/core/materials/BimTilesTransparentMaterial.d.ts +20 -0
- package/dist/src/dxfViewer/core/materials/StandardMaterialEx.d.ts +29 -0
- package/dist/src/dxfViewer/core/materials/constants.d.ts +4 -0
- package/dist/src/dxfViewer/core/materials/index.d.ts +5 -0
- package/dist/src/dxfViewer/core/model/Constants.d.ts +58 -0
- package/dist/src/dxfViewer/core/model/Model.d.ts +18 -0
- package/dist/src/dxfViewer/core/model/Model2d.d.ts +144 -0
- package/dist/src/dxfViewer/core/model/Model3d.d.ts +111 -0
- package/dist/src/dxfViewer/core/model/bimtiles/BatchedMeshesParser.d.ts +26 -0
- package/dist/src/dxfViewer/core/model/bimtiles/BimTilesConfigParser.d.ts +43 -0
- package/dist/src/dxfViewer/core/model/bimtiles/BimTilesData.d.ts +280 -0
- package/dist/src/dxfViewer/core/model/bimtiles/BimTilesMaterialManager.d.ts +139 -0
- package/dist/src/dxfViewer/core/model/bimtiles/BimTilesModel.d.ts +70 -0
- package/dist/src/dxfViewer/core/model/bimtiles/BimTilesPropertyParser.d.ts +45 -0
- package/dist/src/dxfViewer/core/model/bimtiles/BimTilesRenderer.d.ts +59 -0
- package/dist/src/dxfViewer/core/model/bimtiles/InstancedMeshesParser.d.ts +41 -0
- package/dist/src/dxfViewer/core/model/bimtiles/TileParser.d.ts +14 -0
- package/dist/src/dxfViewer/core/model/bimtiles/Utils.d.ts +29 -0
- package/dist/src/dxfViewer/core/model/index.d.ts +6 -0
- package/dist/src/dxfViewer/core/patches/Constants.d.ts +6 -0
- package/dist/src/dxfViewer/core/patches/Line.d.ts +3 -0
- package/dist/src/dxfViewer/core/patches/Mesh.d.ts +2 -0
- package/dist/src/dxfViewer/core/patches/Points.d.ts +3 -0
- package/dist/src/dxfViewer/core/patches/index.d.ts +4 -0
- package/dist/src/dxfViewer/core/patches/shaders/ShaderChunk.d.ts +143 -0
- package/dist/src/dxfViewer/core/patches/shaders/shaderChunk/common_ex.glsl.d.ts +2 -0
- package/dist/src/dxfViewer/core/patches/shaders/shaderChunk/id_pars_vertex.glsl.d.ts +2 -0
- package/dist/src/dxfViewer/core/patches/shaders/shaderChunk/id_vertex.glsl.d.ts +2 -0
- package/dist/src/dxfViewer/core/patches/shaders/shaderChunk/outine_bc_vertex.glsl.d.ts +2 -0
- package/dist/src/dxfViewer/core/patches/shaders/shaderChunk/outline_bc_fragment.glsl.d.ts +2 -0
- package/dist/src/dxfViewer/core/patches/shaders/shaderChunk/outline_bc_pars_fragment.glsl.d.ts +2 -0
- package/dist/src/dxfViewer/core/patches/shaders/shaderChunk/outline_bc_pars_vertex.glsl.d.ts +2 -0
- package/dist/src/dxfViewer/core/patches/shaders/shaderChunk/state_fragment.glsl.d.ts +2 -0
- package/dist/src/dxfViewer/core/patches/shaders/shaderChunk/state_highlight_fragment.glsl.d.ts +2 -0
- package/dist/src/dxfViewer/core/patches/shaders/shaderChunk/state_pars_fragment.glsl.d.ts +2 -0
- package/dist/src/dxfViewer/core/patches/shaders/shaderChunk/state_transparent_fragment.glsl.d.ts +2 -0
- package/dist/src/dxfViewer/core/patches/shaders/shaderLib/pick_ex.glsl.d.ts +2 -0
- package/dist/src/dxfViewer/core/patches/shaders/shaderLib/standard_ex.glsl.d.ts +2 -0
- package/dist/src/dxfViewer/core/pick/PickManager.d.ts +54 -0
- package/dist/src/dxfViewer/core/pick/index.d.ts +1 -0
- package/dist/src/dxfViewer/core/scene/SceneManager.d.ts +43 -0
- package/dist/src/dxfViewer/core/scene/index.d.ts +1 -0
- package/dist/src/dxfViewer/core/shp-js/BitView.d.ts +12 -0
- package/dist/src/dxfViewer/core/shp-js/SHPLoader.d.ts +12 -0
- package/dist/src/dxfViewer/core/shp-js/Shp.d.ts +10 -0
- package/dist/src/dxfViewer/core/shp-js/ShpThree.d.ts +24 -0
- package/dist/src/dxfViewer/core/shp-js/index.d.ts +4 -0
- package/dist/src/dxfViewer/core/text-texture/TextTexture.d.ts +45 -0
- package/dist/src/dxfViewer/core/undo/Command.d.ts +6 -0
- package/dist/src/dxfViewer/core/undo/UndoManager.d.ts +24 -0
- package/dist/src/dxfViewer/core/undo/index.d.ts +2 -0
- package/dist/src/dxfViewer/core/utils/CSS2DObjectUtils.d.ts +14 -0
- package/dist/src/dxfViewer/core/utils/CancelablePromise.d.ts +6 -0
- package/dist/src/dxfViewer/core/utils/ColorUtils.d.ts +21 -0
- package/dist/src/dxfViewer/core/utils/CommonUtils.d.ts +129 -0
- package/dist/src/dxfViewer/core/utils/CoordinateUtils.d.ts +81 -0
- package/dist/src/dxfViewer/core/utils/DecimalPrecisionUtils.d.ts +10 -0
- package/dist/src/dxfViewer/core/utils/DeviceUtils.d.ts +15 -0
- package/dist/src/dxfViewer/core/utils/EdgeUtils.d.ts +14 -0
- package/dist/src/dxfViewer/core/utils/Event.d.ts +34 -0
- package/dist/src/dxfViewer/core/utils/ExportUtils.d.ts +61 -0
- package/dist/src/dxfViewer/core/utils/FpsUtils.d.ts +13 -0
- package/dist/src/dxfViewer/core/utils/GeometryUtils.d.ts +78 -0
- package/dist/src/dxfViewer/core/utils/Locale.d.ts +22 -0
- package/dist/src/dxfViewer/core/utils/LogUtils.d.ts +7 -0
- package/dist/src/dxfViewer/core/utils/MaterialUtils.d.ts +40 -0
- package/dist/src/dxfViewer/core/utils/MathUtils.d.ts +41 -0
- package/dist/src/dxfViewer/core/utils/MergeUtils.d.ts +120 -0
- package/dist/src/dxfViewer/core/utils/ObjectUtils.d.ts +215 -0
- package/dist/src/dxfViewer/core/utils/PolygonUtils.d.ts +9 -0
- package/dist/src/dxfViewer/core/utils/SVGObjectUtils.d.ts +22 -0
- package/dist/src/dxfViewer/core/utils/SceneUtils.d.ts +26 -0
- package/dist/src/dxfViewer/core/utils/SectionUtils.d.ts +11 -0
- package/dist/src/dxfViewer/core/utils/SimplifyUtils.d.ts +15 -0
- package/dist/src/dxfViewer/core/utils/TextUtils.d.ts +37 -0
- package/dist/src/dxfViewer/core/utils/TextureUtils.d.ts +16 -0
- package/dist/src/dxfViewer/core/utils/UnitConversionUtils.d.ts +31 -0
- package/dist/src/dxfViewer/core/utils/Viewer3dUtils.d.ts +25 -0
- package/dist/src/dxfViewer/core/utils/index.d.ts +26 -0
- package/dist/src/dxfViewer/core/viewers/BaseViewer.d.ts +248 -0
- package/dist/src/dxfViewer/core/viewers/BimTilesViewer.d.ts +126 -0
- package/dist/src/dxfViewer/core/viewers/Constants.d.ts +9 -0
- package/dist/src/dxfViewer/core/viewers/Plugin.d.ts +29 -0
- package/dist/src/dxfViewer/core/viewers/Viewer2d.d.ts +405 -0
- package/dist/src/dxfViewer/core/viewers/Viewer3d.d.ts +130 -0
- package/dist/src/dxfViewer/core/viewers/Viewer3dLite.d.ts +143 -0
- package/dist/src/dxfViewer/core/viewers/ViewerEvent.d.ts +96 -0
- package/dist/src/dxfViewer/core/viewers/index.d.ts +8 -0
- package/dist/src/dxfViewer/core/webcam/WebCam.d.ts +27 -0
- package/dist/src/dxfViewer/core/webcam/index.d.ts +1 -0
- package/dist/src/dxfViewer/core/workers/CreateMeshBvh.worker.d.ts +1 -0
- package/dist/src/dxfViewer/core/workers/GenerateMeshBvhWorker.d.ts +17 -0
- package/dist/src/dxfViewer/core/workers/index.d.ts +1 -0
- package/dist/src/dxfViewer/lib.d.ts +1 -0
- package/package.json +62 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { BimTilesMaterialParameters } from './BimTilesMaterial';
|
|
2
|
+
import * as THREE from "three";
|
|
3
|
+
/**
|
|
4
|
+
* Material used for highlighting objects.
|
|
5
|
+
*/
|
|
6
|
+
export declare class BimTilesHighlightMaterial extends THREE.MeshStandardMaterial {
|
|
7
|
+
isBimTilesHighlightMaterial: boolean;
|
|
8
|
+
type: string;
|
|
9
|
+
transparent: boolean;
|
|
10
|
+
opacity: number;
|
|
11
|
+
depthTest: boolean;
|
|
12
|
+
side: 2;
|
|
13
|
+
uniforms: {
|
|
14
|
+
[uniform: string]: THREE.IUniform<any>;
|
|
15
|
+
};
|
|
16
|
+
vertexShader: string;
|
|
17
|
+
fragmentShader: string;
|
|
18
|
+
stateTexture: THREE.DataTexture;
|
|
19
|
+
constructor(params: BimTilesMaterialParameters);
|
|
20
|
+
setValues(params: BimTilesMaterialParameters): void;
|
|
21
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import * as THREE from "three";
|
|
2
|
+
/**
|
|
3
|
+
* Parameters to create a {@link BimTilesMaterial}.
|
|
4
|
+
*/
|
|
5
|
+
export interface BimTilesMaterialParameters extends THREE.MeshStandardMaterialParameters {
|
|
6
|
+
stateTexture: THREE.DataTexture;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Base material for BimTiles objects.
|
|
10
|
+
*
|
|
11
|
+
* Beside the standard PBR shading, it supports object states (hidden/transparent/
|
|
12
|
+
* highlighted/hovered) which are read from the shared state texture, and a
|
|
13
|
+
* barycentric based outline.
|
|
14
|
+
*/
|
|
15
|
+
export declare class BimTilesMaterial extends THREE.MeshStandardMaterial {
|
|
16
|
+
isBimTilesMaterial: boolean;
|
|
17
|
+
type: string;
|
|
18
|
+
uniforms: {
|
|
19
|
+
[uniform: string]: THREE.IUniform<any>;
|
|
20
|
+
};
|
|
21
|
+
vertexShader: string;
|
|
22
|
+
fragmentShader: string;
|
|
23
|
+
stateTexture: THREE.DataTexture;
|
|
24
|
+
readonly defaultOutlineColor: THREE.Color;
|
|
25
|
+
protected useBCOutline: boolean;
|
|
26
|
+
protected outlineVisible: boolean;
|
|
27
|
+
constructor(params: BimTilesMaterialParameters);
|
|
28
|
+
setOutlineVisible(visible: boolean): void;
|
|
29
|
+
enableOutline(enable: boolean): void;
|
|
30
|
+
setOutLineColor(color?: THREE.Color): void;
|
|
31
|
+
setValues(params: BimTilesMaterialParameters): void;
|
|
32
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { BimTilesMaterialParameters } from './BimTilesMaterial';
|
|
2
|
+
import * as THREE from "three";
|
|
3
|
+
/**
|
|
4
|
+
* Material used to render BimTiles objects into the picking render target.
|
|
5
|
+
*
|
|
6
|
+
* Each fragment outputs the color which encodes the tile object id of the drawn object.
|
|
7
|
+
*/
|
|
8
|
+
export declare class BimTilesPickMaterial extends THREE.ShaderMaterial {
|
|
9
|
+
isBimTilesPickMaterial: boolean;
|
|
10
|
+
type: string;
|
|
11
|
+
stateTexture: THREE.DataTexture;
|
|
12
|
+
constructor(params: BimTilesMaterialParameters);
|
|
13
|
+
setValues(params: BimTilesMaterialParameters): void;
|
|
14
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { BimTilesMaterialParameters } from './BimTilesMaterial';
|
|
2
|
+
import * as THREE from "three";
|
|
3
|
+
/**
|
|
4
|
+
* Material used for transparent objects.
|
|
5
|
+
*/
|
|
6
|
+
export declare class BimTilesTransparentMaterial extends THREE.MeshStandardMaterial {
|
|
7
|
+
isBimTilesTransparentMaterial: boolean;
|
|
8
|
+
type: string;
|
|
9
|
+
transparent: boolean;
|
|
10
|
+
opacity: number;
|
|
11
|
+
side: 0;
|
|
12
|
+
uniforms: {
|
|
13
|
+
[uniform: string]: THREE.IUniform<any>;
|
|
14
|
+
};
|
|
15
|
+
vertexShader: string;
|
|
16
|
+
fragmentShader: string;
|
|
17
|
+
stateTexture: THREE.DataTexture;
|
|
18
|
+
constructor(params: BimTilesMaterialParameters);
|
|
19
|
+
setValues(params: BimTilesMaterialParameters): void;
|
|
20
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import * as THREE from "three";
|
|
2
|
+
/**
|
|
3
|
+
* MeshStandardMaterial with barycentric outline support.
|
|
4
|
+
*
|
|
5
|
+
* @note This class is tree-shaken out of dist/index.esm.dev.js, so its implementation
|
|
6
|
+
* cannot be recovered from the bundle. Only the contract below (members and signatures,
|
|
7
|
+
* taken from dist/types/core/materials/StandardMaterialEx.d.ts) is authoritative; the
|
|
8
|
+
* method bodies are inferred from the retained ShaderChunk["standard_ex_vertex"] /
|
|
9
|
+
* ShaderChunk["standard_ex_fragment"] shaders (which include the <outline_bc_*> chunks)
|
|
10
|
+
* and from the isomorphic {@link BimTilesMaterial} implementation.
|
|
11
|
+
*/
|
|
12
|
+
export declare class StandardMaterialEx extends THREE.MeshStandardMaterial {
|
|
13
|
+
isStandardMaterialEx: boolean;
|
|
14
|
+
useBCOutline: boolean;
|
|
15
|
+
outlineVisible: boolean;
|
|
16
|
+
outlineColor: THREE.Color;
|
|
17
|
+
uniforms: Record<string, any>;
|
|
18
|
+
vertexShader: string;
|
|
19
|
+
fragmentShader: string;
|
|
20
|
+
useForCap: boolean;
|
|
21
|
+
constructor(params?: any);
|
|
22
|
+
/**
|
|
23
|
+
* Syncs the uniforms with this material's properties.
|
|
24
|
+
*/
|
|
25
|
+
refreshUniforms(): void;
|
|
26
|
+
setOutlineVisible(visible: boolean): void;
|
|
27
|
+
setOutLineColor(color?: THREE.Color): void;
|
|
28
|
+
copy(source: any): this;
|
|
29
|
+
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export declare const pickExVertex = "\n #include <clipping_planes_pars_vertex>\n\n attribute int tileObjectId;\n flat varying int vTileObjectId;\n #include <common_ex>\n void main() {\n\n vec4 mvPosition = vec4(position, 1.0);\n #include <clipping_planes_vertex>\n vTileObjectId = tileObjectId;\n\n #ifdef USE_INSTANCING\n mvPosition = instanceMatrix * mvPosition;\n #endif\n gl_Position = projectionMatrix * modelViewMatrix * mvPosition;\n }\n";
|
|
2
|
+
export declare const pickExFragment = "\n #include <clipping_planes_pars_fragment>\n\n flat varying int vTileObjectId;\n uniform sampler2D uStateTexture;\n uniform float uTextureWidth;\n uniform float uTextureHeight;\n // uniform bool uIsIsolating;\n #include <common_ex>\n void main() {\n #include <clipping_planes_fragment>\n vec4 textureColor = getTextureColorByTileObjectId(uStateTexture, uTextureWidth, uTextureHeight, vTileObjectId);\n // If is isolating, other objects(which is hidden or transparent) are not pickable.\n // if (uIsIsolating && !isIsolated(textureColor)) {\n // discard;\n // }\n // if an object is hidden, it is not pickable\n if (isHidden(textureColor)) {\n discard;\n }\n // if an object is transparent, it is not pickable\n if (isTransparent(textureColor)) {\n discard;\n }\n\n gl_FragColor = tileObjectId2Color(vTileObjectId);\n }\n";
|
|
3
|
+
export declare const standardExVertex = "\n#define STANDARD\n\nvarying vec3 vViewPosition;\n\n#ifdef USE_TRANSMISSION\n\n\tvarying vec3 vWorldPosition;\n\n#endif\n\n#include <common>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\n\n#include <outline_bc_pars_vertex>\n\nvoid main() {\n\n\t#include <uv_vertex>\n\t#include <color_vertex>\n\t#include <morphcolor_vertex>\n\n #include <outline_bc_vertex>\n\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <normal_vertex>\n\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\n\tvViewPosition = - mvPosition.xyz;\n\n\t#include <worldpos_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n\n#ifdef USE_TRANSMISSION\n\n\tvWorldPosition = worldPosition.xyz;\n\n#endif\n}\n";
|
|
4
|
+
export declare const standardExFragment = "\n#define STANDARD\n\n#ifdef PHYSICAL\n\t#define IOR\n\t#define USE_SPECULAR\n#endif\n\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float roughness;\nuniform float metalness;\nuniform float opacity;\n\n#ifdef IOR\n\tuniform float ior;\n#endif\n\n#ifdef USE_SPECULAR\n\tuniform float specularIntensity;\n\tuniform vec3 specularColor;\n\n\t#ifdef USE_SPECULAR_COLORMAP\n\t\tuniform sampler2D specularColorMap;\n\t#endif\n\n\t#ifdef USE_SPECULAR_INTENSITYMAP\n\t\tuniform sampler2D specularIntensityMap;\n\t#endif\n#endif\n\n#ifdef USE_CLEARCOAT\n\tuniform float clearcoat;\n\tuniform float clearcoatRoughness;\n#endif\n\n#ifdef USE_IRIDESCENCE\n\tuniform float iridescence;\n\tuniform float iridescenceIOR;\n\tuniform float iridescenceThicknessMinimum;\n\tuniform float iridescenceThicknessMaximum;\n#endif\n\n#ifdef USE_SHEEN\n\tuniform vec3 sheenColor;\n\tuniform float sheenRoughness;\n\n\t#ifdef USE_SHEEN_COLORMAP\n\t\tuniform sampler2D sheenColorMap;\n\t#endif\n\n\t#ifdef USE_SHEEN_ROUGHNESSMAP\n\t\tuniform sampler2D sheenRoughnessMap;\n\t#endif\n#endif\n\n#ifdef USE_ANISOTROPY\n\tuniform vec2 anisotropyVector;\n\n\t#ifdef USE_ANISOTROPYMAP\n\t\tuniform sampler2D anisotropyMap;\n\t#endif\n#endif\n\nvarying vec3 vViewPosition;\n\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <iridescence_fragment>\n#include <cube_uv_reflection_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_physical_pars_fragment>\n#include <fog_pars_fragment>\n#include <lights_pars_begin>\n#include <normal_pars_fragment>\n#include <lights_physical_pars_fragment>\n#include <transmission_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <clearcoat_pars_fragment>\n#include <iridescence_pars_fragment>\n#include <roughnessmap_pars_fragment>\n#include <metalnessmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\n\n#include <outline_bc_pars_fragment>\n\nvoid main() {\n\n\t#include <clipping_planes_fragment>\n\n\tvec4 diffuseColor = vec4(diffuse, opacity);\n\tReflectedLight reflectedLight = ReflectedLight(vec3(0.0), vec3(0.0), vec3(0.0), vec3(0.0));\n\tvec3 totalEmissiveRadiance = emissive;\n\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <alphahash_fragment>\n\t#include <roughnessmap_fragment>\n\t#include <metalnessmap_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\t#include <clearcoat_normal_fragment_begin>\n\t#include <clearcoat_normal_fragment_maps>\n\t#include <emissivemap_fragment>\n\n\t// accumulation\n\t#include <lights_physical_fragment>\n\t#include <lights_fragment_begin>\n\t#include <lights_fragment_maps>\n\t#include <lights_fragment_end>\n\n\t// modulation\n\t#include <aomap_fragment>\n\n\tvec3 totalDiffuse = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse;\n\tvec3 totalSpecular = reflectedLight.directSpecular + reflectedLight.indirectSpecular;\n\n\t#include <transmission_fragment>\n\n\tvec3 outgoingLight = totalDiffuse + totalSpecular + totalEmissiveRadiance;\n\n\t#ifdef USE_SHEEN\n\n\t\t// Sheen energy compensation approximation calculation can be found at the end of\n\t\t// https://drive.google.com/file/d/1T0D1VSyR4AllqIJTQAraEIzjlb5h4FKH/view?usp=sharing\n\t\tfloat sheenEnergyComp = 1.0 - 0.157 * max3(material.sheenColor);\n\n\t\toutgoingLight = outgoingLight * sheenEnergyComp + sheenSpecular;\n\n\t#endif\n\n\t#ifdef USE_CLEARCOAT\n\n\t\tfloat dotNVcc = saturate(dot(geometry.clearcoatNormal, geometry.viewDir));\n\n\t\tvec3 Fcc = F_Schlick(material.clearcoatF0, material.clearcoatF90, dotNVcc);\n\n\t\toutgoingLight = outgoingLight * (1.0 - material.clearcoat * Fcc) + clearcoatSpecular * material.clearcoat;\n\n\t#endif\n\n\t#include <opaque_fragment>\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n\n #include <outline_bc_fragment>\n}\n";
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { DxfData } from '../dxf';
|
|
2
|
+
import { PdfData } from '../viewers';
|
|
3
|
+
import * as THREE from "three";
|
|
4
|
+
/**
|
|
5
|
+
* Loaded 3d model info for Viewer3d.
|
|
6
|
+
*/
|
|
7
|
+
export interface ModelData3d {
|
|
8
|
+
/**
|
|
9
|
+
* modelId that is unique for loaded models
|
|
10
|
+
*/
|
|
11
|
+
modelId: string;
|
|
12
|
+
/**
|
|
13
|
+
* Three.js object.
|
|
14
|
+
*/
|
|
15
|
+
object?: THREE.Object3D;
|
|
16
|
+
/**
|
|
17
|
+
* Bounding box of the model.
|
|
18
|
+
*/
|
|
19
|
+
bbox?: THREE.Box3;
|
|
20
|
+
/**
|
|
21
|
+
* Edge objects of the model.
|
|
22
|
+
*/
|
|
23
|
+
edges?: THREE.LineSegments[];
|
|
24
|
+
/**
|
|
25
|
+
* TilesRenderer for BimTiles
|
|
26
|
+
* @internal
|
|
27
|
+
*/
|
|
28
|
+
tilesRenderer?: any;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Loaded 2d model info for Viewer2d.
|
|
32
|
+
*/
|
|
33
|
+
export interface ModelData2d {
|
|
34
|
+
/**
|
|
35
|
+
* modelId that is unique for loaded models
|
|
36
|
+
*/
|
|
37
|
+
modelId: string;
|
|
38
|
+
/**
|
|
39
|
+
* Used for dxf data.
|
|
40
|
+
*/
|
|
41
|
+
dxfData?: DxfData;
|
|
42
|
+
/**
|
|
43
|
+
* Used for pdf data.
|
|
44
|
+
*/
|
|
45
|
+
pdfData?: PdfData;
|
|
46
|
+
/**
|
|
47
|
+
* Model space transform matrix.
|
|
48
|
+
* @internal
|
|
49
|
+
*/
|
|
50
|
+
msTransformMatrix?: THREE.Matrix4;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* BimTile object.
|
|
54
|
+
*/
|
|
55
|
+
export interface TileObject {
|
|
56
|
+
tilesetId: number;
|
|
57
|
+
userId: number;
|
|
58
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import * as THREE from "three";
|
|
2
|
+
/**
|
|
3
|
+
* Base model class.
|
|
4
|
+
*/
|
|
5
|
+
export declare abstract class Model {
|
|
6
|
+
/**
|
|
7
|
+
* The model id, it should be unique in the lifecycle of a viewer.
|
|
8
|
+
*/
|
|
9
|
+
abstract modelId: string;
|
|
10
|
+
/**
|
|
11
|
+
* Gets the THREE.Object3D of this model.
|
|
12
|
+
*/
|
|
13
|
+
abstract getModelObject(): THREE.Object3D;
|
|
14
|
+
/**
|
|
15
|
+
* Gets the bounding box of this model.
|
|
16
|
+
*/
|
|
17
|
+
abstract getBBox(): THREE.Box3;
|
|
18
|
+
}
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
import { ModelData2d } from './Constants';
|
|
2
|
+
import { Units } from '../Units';
|
|
3
|
+
import { DxfData } from '../dxf';
|
|
4
|
+
import { ILayer, ILayoutObject, IPoint, IViewport, IViewportEntity } from '../dxf-parser';
|
|
5
|
+
import { Model } from './Model';
|
|
6
|
+
import { PdfData, PdfLayer } from '../viewers/Viewer2d';
|
|
7
|
+
import * as THREE from "three";
|
|
8
|
+
/**
|
|
9
|
+
* Loaded 2d model info for Viewer2d.
|
|
10
|
+
*/
|
|
11
|
+
export declare class Model2d extends Model {
|
|
12
|
+
modelId: string;
|
|
13
|
+
private modelData;
|
|
14
|
+
modelObject: THREE.Object3D;
|
|
15
|
+
private bbox?;
|
|
16
|
+
constructor(modelData: ModelData2d);
|
|
17
|
+
get pdfData(): PdfData | undefined;
|
|
18
|
+
get dxfData(): DxfData | undefined;
|
|
19
|
+
/**
|
|
20
|
+
* @internal
|
|
21
|
+
*/
|
|
22
|
+
get msTransformMatrix(): THREE.Matrix4 | undefined;
|
|
23
|
+
/**
|
|
24
|
+
* @internal
|
|
25
|
+
*/
|
|
26
|
+
set msTransformMatrix(matrix: THREE.Matrix4 | undefined);
|
|
27
|
+
/**
|
|
28
|
+
* @internal
|
|
29
|
+
*/
|
|
30
|
+
get loadedEntityCount(): number;
|
|
31
|
+
/**
|
|
32
|
+
* Gets dxf data header.
|
|
33
|
+
*/
|
|
34
|
+
get header(): Record<string, number | IPoint> | undefined;
|
|
35
|
+
/**
|
|
36
|
+
* Gets dxf data viewports.
|
|
37
|
+
*/
|
|
38
|
+
get viewports(): IViewport[] | undefined;
|
|
39
|
+
/**
|
|
40
|
+
* Gets layers.
|
|
41
|
+
*/
|
|
42
|
+
get layers(): Record<string, ILayer | PdfLayer> | undefined;
|
|
43
|
+
/**
|
|
44
|
+
* Gets dxf data layoutViewportsMap.
|
|
45
|
+
* @internal
|
|
46
|
+
*/
|
|
47
|
+
get layoutViewportsMap(): Record<string, IViewportEntity[]> | undefined;
|
|
48
|
+
/**
|
|
49
|
+
* Gets three.js object of the model.
|
|
50
|
+
*/
|
|
51
|
+
getModelObject(): THREE.Object3D;
|
|
52
|
+
/**
|
|
53
|
+
* Gets model bounding box.
|
|
54
|
+
*/
|
|
55
|
+
getBBox(): THREE.Box3;
|
|
56
|
+
/**
|
|
57
|
+
* Gets dxf units.
|
|
58
|
+
* @internal
|
|
59
|
+
*/
|
|
60
|
+
getUnits(): Units;
|
|
61
|
+
/**
|
|
62
|
+
* Gets dxf model space extent.
|
|
63
|
+
* @internal
|
|
64
|
+
*/
|
|
65
|
+
getModelSpaceExtent(): THREE.Box3 | undefined;
|
|
66
|
+
/**
|
|
67
|
+
* Gets layer by layer name.
|
|
68
|
+
*/
|
|
69
|
+
getLayer(layerName: string): ILayer | PdfLayer | undefined;
|
|
70
|
+
/**
|
|
71
|
+
* Gets layer object and three.js object by layer name.
|
|
72
|
+
*/
|
|
73
|
+
getObjectsByLayer(layerName: string): THREE.Object3D[] | undefined;
|
|
74
|
+
/**
|
|
75
|
+
* Gets layout of dxf data.
|
|
76
|
+
*/
|
|
77
|
+
getLayouts(): ILayoutObject[];
|
|
78
|
+
getLayoutByName(layoutName: string): ILayoutObject | undefined;
|
|
79
|
+
/**
|
|
80
|
+
* Gets layout extent of dxf data.
|
|
81
|
+
* @internal
|
|
82
|
+
*/
|
|
83
|
+
getLayoutExtent(layout: ILayoutObject): THREE.Box3;
|
|
84
|
+
/**
|
|
85
|
+
* Gets layout viewports.
|
|
86
|
+
* @internal
|
|
87
|
+
*/
|
|
88
|
+
getLayoutViewports(layout: ILayoutObject): IViewportEntity[];
|
|
89
|
+
/**
|
|
90
|
+
* Gets the layout level three.js object.
|
|
91
|
+
*/
|
|
92
|
+
getLayoutLevelObject(layoutName: string): THREE.Object3D | undefined;
|
|
93
|
+
/**
|
|
94
|
+
* Sets model visibility.
|
|
95
|
+
*/
|
|
96
|
+
setVisible(visible: boolean): void;
|
|
97
|
+
/**
|
|
98
|
+
* Sets layer visibility.
|
|
99
|
+
*/
|
|
100
|
+
setLayerVisible(layerName: string, visible: boolean, enableHideVisuallySmallObjects?: boolean, cameraZoom?: number): void;
|
|
101
|
+
/**
|
|
102
|
+
* Sets layer opacity.
|
|
103
|
+
*/
|
|
104
|
+
setLayerOpacity(layerName: string, opacity: number): void;
|
|
105
|
+
/**
|
|
106
|
+
* Sets layer color.
|
|
107
|
+
*/
|
|
108
|
+
setLayerColor(layerName: string, color: number): void;
|
|
109
|
+
/**
|
|
110
|
+
* Resets layer color.
|
|
111
|
+
*/
|
|
112
|
+
resetLayerColor(layerName: string): void;
|
|
113
|
+
/**
|
|
114
|
+
* @internal
|
|
115
|
+
*/
|
|
116
|
+
switchTransformMs(layoutName: string): void;
|
|
117
|
+
activateLayout(layoutName: string | undefined, isLayoutInitialized: boolean): void;
|
|
118
|
+
getFilteredViewports(layout: ILayoutObject): IViewportEntity[];
|
|
119
|
+
private generateObjectsByViewport;
|
|
120
|
+
private setMaterialUniforms;
|
|
121
|
+
private getObjectsByBoundingBox;
|
|
122
|
+
/**
|
|
123
|
+
* Shows objects for given layout, and hide any other layouts.
|
|
124
|
+
*/
|
|
125
|
+
showLayoutObjects(layoutName: string): void;
|
|
126
|
+
/**
|
|
127
|
+
* Checks if a layer is frozen for viewport (VP Freeze)
|
|
128
|
+
*/
|
|
129
|
+
private isLayerFrozenForViewport;
|
|
130
|
+
addSpatialFilterSection(object: THREE.Object3D, dxfData: DxfData, bFromViewport?: boolean): void;
|
|
131
|
+
private findSpatialFilter;
|
|
132
|
+
private getAnyMaterial;
|
|
133
|
+
private generateSectionsBySpatialFilter;
|
|
134
|
+
private hasObject;
|
|
135
|
+
private hasObjectWithId;
|
|
136
|
+
/**
|
|
137
|
+
* 高亮指定的 3D 对象
|
|
138
|
+
* 通过替换材质为高亮材质实现视觉高亮效果
|
|
139
|
+
* @param {THREE.Object3D} object - 要高亮的 3D 对象
|
|
140
|
+
*/
|
|
141
|
+
highlightObject(object: THREE.Object3D): void;
|
|
142
|
+
unHighlightObject(object: THREE.Object3D): void;
|
|
143
|
+
clearHighlight(): void;
|
|
144
|
+
}
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
import { ModelData3d } from './Constants';
|
|
2
|
+
import { Model } from './Model';
|
|
3
|
+
import * as THREE from "three";
|
|
4
|
+
/**
|
|
5
|
+
* Loaded 3d model info for Viewer3d.
|
|
6
|
+
*/
|
|
7
|
+
export declare class Model3d extends Model {
|
|
8
|
+
modelId: string;
|
|
9
|
+
bbox?: THREE.Box3;
|
|
10
|
+
/**
|
|
11
|
+
* Root object that contains normal object, object for highlight, object for transparent, etc.
|
|
12
|
+
*/
|
|
13
|
+
rootObject: THREE.Group;
|
|
14
|
+
/**
|
|
15
|
+
* Normal model object.
|
|
16
|
+
*/
|
|
17
|
+
modelObject: THREE.Object3D;
|
|
18
|
+
/**
|
|
19
|
+
* Object for highlight usage.
|
|
20
|
+
*/
|
|
21
|
+
highlighUsage: THREE.Group;
|
|
22
|
+
/**
|
|
23
|
+
* Object for transparent usage.
|
|
24
|
+
*/
|
|
25
|
+
transparentUsage: THREE.Group;
|
|
26
|
+
/**
|
|
27
|
+
* Each edge object is created under its Mesh object.
|
|
28
|
+
* These are references of edge objects.
|
|
29
|
+
*/
|
|
30
|
+
edges?: THREE.Object3D[];
|
|
31
|
+
/**
|
|
32
|
+
* Object that is being highlighted.
|
|
33
|
+
*/
|
|
34
|
+
highlighedObject?: THREE.Object3D;
|
|
35
|
+
constructor(modelData: ModelData3d);
|
|
36
|
+
/**
|
|
37
|
+
* Gets the THREE.Object3D of this model.
|
|
38
|
+
*/
|
|
39
|
+
setDoubleSidedMaterials(): void;
|
|
40
|
+
revertDoubleSidedMaterials(): void;
|
|
41
|
+
getModelObject(): THREE.Object3D;
|
|
42
|
+
/**
|
|
43
|
+
* Gets the bounding box of this model.
|
|
44
|
+
*/
|
|
45
|
+
getBBox(): THREE.Box3;
|
|
46
|
+
/**
|
|
47
|
+
* Enables/disables edges.
|
|
48
|
+
*/
|
|
49
|
+
enableOutline(enable: boolean, onProgress?: (event: ProgressEvent) => void): Promise<void>;
|
|
50
|
+
/**
|
|
51
|
+
* Sets object's color.
|
|
52
|
+
*/
|
|
53
|
+
setObjectColor(object: THREE.Object3D, color: number): void;
|
|
54
|
+
/**
|
|
55
|
+
* Sets object's opacity.
|
|
56
|
+
*/
|
|
57
|
+
setObjectOpacity(object: THREE.Object3D, opacity?: number, batchId?: number, instanceId?: number): void;
|
|
58
|
+
/**
|
|
59
|
+
* Clears object's opacity.
|
|
60
|
+
*/
|
|
61
|
+
clearObjectOpacity(object: THREE.Object3D, batchId?: number, instanceId?: number): void;
|
|
62
|
+
/**
|
|
63
|
+
* Is object transparent.
|
|
64
|
+
*/
|
|
65
|
+
isObjectTransparent(object: THREE.Object3D): boolean;
|
|
66
|
+
/**
|
|
67
|
+
* Sets model's opacity.
|
|
68
|
+
*/
|
|
69
|
+
setOpacity(opacity?: number): void;
|
|
70
|
+
/**
|
|
71
|
+
* Clears model's opacity.
|
|
72
|
+
*/
|
|
73
|
+
clearOpacity(): void;
|
|
74
|
+
/**
|
|
75
|
+
* Highlights an object.
|
|
76
|
+
*/
|
|
77
|
+
highlightObjectById(objectId: number, batchId?: number, instanceId?: number): void;
|
|
78
|
+
/**
|
|
79
|
+
* Highlights an object.
|
|
80
|
+
*/
|
|
81
|
+
highlightObject(object: THREE.Object3D, batchId?: number, instanceId?: number): void;
|
|
82
|
+
/**
|
|
83
|
+
* Clears highlight for object(s) if any.
|
|
84
|
+
*/
|
|
85
|
+
clearHighlight(): void;
|
|
86
|
+
/**
|
|
87
|
+
* Sets an object's visibility.
|
|
88
|
+
*/
|
|
89
|
+
setObjectVisible(object: THREE.Object3D, visible: boolean): void;
|
|
90
|
+
/**
|
|
91
|
+
* Sets model's visibility.
|
|
92
|
+
*/
|
|
93
|
+
setVisible(visible: boolean): void;
|
|
94
|
+
/**
|
|
95
|
+
* Checks if there is any visible object.
|
|
96
|
+
*/
|
|
97
|
+
hasVisibleObject(): boolean;
|
|
98
|
+
/**
|
|
99
|
+
* Checks if there is any invisible object.
|
|
100
|
+
*/
|
|
101
|
+
hasInvisibleObject(): boolean;
|
|
102
|
+
private createBatchMeshById;
|
|
103
|
+
private createInstanceMeshById;
|
|
104
|
+
setClipPlanes(clippingPlanes: THREE.Plane[]): void;
|
|
105
|
+
/**
|
|
106
|
+
* @internal
|
|
107
|
+
*/
|
|
108
|
+
getObjectTree(): void;
|
|
109
|
+
private hasObject;
|
|
110
|
+
private hasObjectWithId;
|
|
111
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { BatchData, MeshJsonData } from './BimTilesData';
|
|
2
|
+
import * as THREE from "three";
|
|
3
|
+
/**
|
|
4
|
+
* Batched mesh.
|
|
5
|
+
*/
|
|
6
|
+
export interface BatchedMesh {
|
|
7
|
+
type: number;
|
|
8
|
+
position: THREE.TypedArray;
|
|
9
|
+
color: THREE.TypedArray;
|
|
10
|
+
normal: THREE.TypedArray;
|
|
11
|
+
indice: THREE.TypedArray;
|
|
12
|
+
uv: THREE.TypedArray;
|
|
13
|
+
tangent: THREE.TypedArray;
|
|
14
|
+
barycentric: THREE.TypedArray;
|
|
15
|
+
materialId: string;
|
|
16
|
+
userIds: number[];
|
|
17
|
+
batchTable: BatchData[];
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Parses batched meshes of a tile.
|
|
21
|
+
*/
|
|
22
|
+
export declare class BatchedMeshesParser {
|
|
23
|
+
parse(buffer: ArrayBuffer, meshes: MeshJsonData[]): BatchedMesh[];
|
|
24
|
+
private parseMesh;
|
|
25
|
+
private parseTypedArray;
|
|
26
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import * as THREE from "three";
|
|
2
|
+
export interface BimTilesConfigMetadata {
|
|
3
|
+
asset: string;
|
|
4
|
+
version: string;
|
|
5
|
+
generateTool?: string;
|
|
6
|
+
datetime: string;
|
|
7
|
+
root: string;
|
|
8
|
+
modelSize: number;
|
|
9
|
+
}
|
|
10
|
+
export interface BimTilesConfigStatistics {
|
|
11
|
+
elementCount: number;
|
|
12
|
+
batchElementCount: number;
|
|
13
|
+
instanceElementCount: number;
|
|
14
|
+
batchCount: number;
|
|
15
|
+
instanceCount: number;
|
|
16
|
+
tileCount: number;
|
|
17
|
+
userDataCount: number;
|
|
18
|
+
materialCount: number;
|
|
19
|
+
meshVertexCount: number;
|
|
20
|
+
meshFaceCount: number;
|
|
21
|
+
textureCount: number;
|
|
22
|
+
texturePixels: number;
|
|
23
|
+
}
|
|
24
|
+
interface BimTilesConfigView {
|
|
25
|
+
transform: THREE.Matrix4;
|
|
26
|
+
boundingVolume: THREE.Box3;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* BimTiles config definition.
|
|
30
|
+
* A bimtiles has one config file.
|
|
31
|
+
*/
|
|
32
|
+
export declare class BimTilesConfigParser {
|
|
33
|
+
private url;
|
|
34
|
+
private metadata;
|
|
35
|
+
private statistics;
|
|
36
|
+
private view;
|
|
37
|
+
constructor(url: string);
|
|
38
|
+
parse(): Promise<boolean>;
|
|
39
|
+
getMetadata(): BimTilesConfigMetadata;
|
|
40
|
+
getStatistics(): BimTilesConfigStatistics;
|
|
41
|
+
getView(): BimTilesConfigView;
|
|
42
|
+
}
|
|
43
|
+
export {};
|