dxfview 0.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/README.md +1 -0
- package/dist/dxfview.esm.min.js +7 -0
- package/dist/types/components/dxf-layout-bar/DxfLayoutBar.d.ts +26 -0
- package/dist/types/components/dxf-layout-bar/index.d.ts +1 -0
- package/dist/types/components/pop-panel/PopPanel.d.ts +14 -0
- package/dist/types/components/pop-panel/index.d.ts +1 -0
- package/dist/types/components/progress-bar/ProgressBar.d.ts +34 -0
- package/dist/types/components/progress-bar/index.d.ts +1 -0
- package/dist/types/components/settings/ProjectSettingsDef.d.ts +44 -0
- package/dist/types/components/settings/index.d.ts +1 -0
- package/dist/types/components/tool-tip/Tooltip.d.ts +20 -0
- package/dist/types/components/tool-tip/index.d.ts +1 -0
- package/dist/types/core/Configs.d.ts +238 -0
- package/dist/types/core/Constants.d.ts +164 -0
- package/dist/types/core/Units.d.ts +16 -0
- package/dist/types/core/VersionManager.d.ts +3 -0
- package/dist/types/core/camera-controls/CameraControls.d.ts +773 -0
- package/dist/types/core/camera-controls/Constants.d.ts +2 -0
- package/dist/types/core/camera-controls/EventDispatcher.d.ts +41 -0
- package/dist/types/core/camera-controls/index.d.ts +2 -0
- package/dist/types/core/camera-controls/types.d.ts +112 -0
- package/dist/types/core/camera-controls/utils/extractClientCoordFromEvent.d.ts +3 -0
- package/dist/types/core/camera-controls/utils/math-utils.d.ts +11 -0
- package/dist/types/core/camera-controls/utils/notSupportedInOrthographicCamera.d.ts +2 -0
- package/dist/types/core/canvas/CanvasRender.d.ts +52 -0
- package/dist/types/core/canvas/Constants.d.ts +28 -0
- package/dist/types/core/canvas/Drawable.d.ts +87 -0
- package/dist/types/core/canvas/DrawableList.d.ts +29 -0
- package/dist/types/core/canvas/index.d.ts +4 -0
- package/dist/types/core/compare/BaseDxfCompareHelper.d.ts +104 -0
- package/dist/types/core/compare/CompareDrawable.d.ts +17 -0
- package/dist/types/core/compare/DxfCompareHelper.d.ts +69 -0
- package/dist/types/core/compare/DxfCompareMarkupManager.d.ts +11 -0
- package/dist/types/core/compare/index.d.ts +4 -0
- package/dist/types/core/controls/CameraControlsEx.d.ts +34 -0
- package/dist/types/core/controls/index.d.ts +1 -0
- package/dist/types/core/dxf/DxfCompare.d.ts +151 -0
- package/dist/types/core/dxf/DxfConstants.d.ts +15 -0
- package/dist/types/core/dxf/DxfLoader.d.ts +526 -0
- package/dist/types/core/dxf/DxfObject.d.ts +32 -0
- package/dist/types/core/dxf/DxfUtils.d.ts +79 -0
- package/dist/types/core/dxf/HatchPatternShaders.d.ts +12 -0
- package/dist/types/core/dxf/LinePatternShaders.d.ts +12 -0
- package/dist/types/core/dxf/bspline.d.ts +8 -0
- package/dist/types/core/dxf/dxfom-mtext.d.ts +46 -0
- package/dist/types/core/dxf/dxfom-text.d.ts +16 -0
- package/dist/types/core/dxf/index.d.ts +10 -0
- package/dist/types/core/dxf/round10.d.ts +2 -0
- package/dist/types/core/dxf-parser/AutoCadColorIndex.d.ts +8 -0
- package/dist/types/core/dxf-parser/DxfBaseReader.d.ts +12 -0
- package/dist/types/core/dxf-parser/DxfBinaryReader.d.ts +14 -0
- package/dist/types/core/dxf-parser/DxfParser.d.ts +327 -0
- package/dist/types/core/dxf-parser/DxfTextReader.d.ts +31 -0
- package/dist/types/core/dxf-parser/ParseHelpers.d.ts +36 -0
- package/dist/types/core/dxf-parser/entities/3dface.d.ts +11 -0
- package/dist/types/core/dxf-parser/entities/arc.d.ts +16 -0
- package/dist/types/core/dxf-parser/entities/attdef.d.ts +31 -0
- package/dist/types/core/dxf-parser/entities/attrib.d.ts +31 -0
- package/dist/types/core/dxf-parser/entities/circle.d.ts +13 -0
- package/dist/types/core/dxf-parser/entities/dimension.d.ts +22 -0
- package/dist/types/core/dxf-parser/entities/ellipse.d.ts +15 -0
- package/dist/types/core/dxf-parser/entities/geomtry.d.ts +40 -0
- package/dist/types/core/dxf-parser/entities/hatch.d.ts +108 -0
- package/dist/types/core/dxf-parser/entities/image.d.ts +37 -0
- package/dist/types/core/dxf-parser/entities/insert.d.ts +20 -0
- package/dist/types/core/dxf-parser/entities/leader.d.ts +23 -0
- package/dist/types/core/dxf-parser/entities/line.d.ts +10 -0
- package/dist/types/core/dxf-parser/entities/lwpolyline.d.ts +21 -0
- package/dist/types/core/dxf-parser/entities/mleader.d.ts +101 -0
- package/dist/types/core/dxf-parser/entities/mtext.d.ts +18 -0
- package/dist/types/core/dxf-parser/entities/ole2frame.d.ts +20 -0
- package/dist/types/core/dxf-parser/entities/point.d.ts +11 -0
- package/dist/types/core/dxf-parser/entities/polyline.d.ts +20 -0
- package/dist/types/core/dxf-parser/entities/ray.d.ts +10 -0
- package/dist/types/core/dxf-parser/entities/region.d.ts +10 -0
- package/dist/types/core/dxf-parser/entities/seqend.d.ts +8 -0
- package/dist/types/core/dxf-parser/entities/solid.d.ts +10 -0
- package/dist/types/core/dxf-parser/entities/spline.d.ts +23 -0
- package/dist/types/core/dxf-parser/entities/table.d.ts +42 -0
- package/dist/types/core/dxf-parser/entities/text.d.ts +18 -0
- package/dist/types/core/dxf-parser/entities/vertex.d.ts +20 -0
- package/dist/types/core/dxf-parser/entities/viewport.d.ts +46 -0
- package/dist/types/core/dxf-parser/entities/xline.d.ts +10 -0
- package/dist/types/core/dxf-parser/index.d.ts +27 -0
- package/dist/types/core/dxf-parser/objects/common.d.ts +15 -0
- package/dist/types/core/dxf-parser/objects/dictionary.d.ts +19 -0
- package/dist/types/core/dxf-parser/objects/imagedef.d.ts +24 -0
- package/dist/types/core/dxf-parser/objects/layout.d.ts +29 -0
- package/dist/types/core/dxf-parser/objects/sortentstable.d.ts +12 -0
- package/dist/types/core/dxf-parser/objects/spatialfilter.d.ts +22 -0
- package/dist/types/core/dxf-parser/objects/xrecord.d.ts +11 -0
- package/dist/types/core/font/BaseFont.d.ts +88 -0
- package/dist/types/core/font/FontManager.d.ts +107 -0
- package/dist/types/core/font/MeshFont.d.ts +44 -0
- package/dist/types/core/font/ShxFont.d.ts +108 -0
- package/dist/types/core/font/index.d.ts +1 -0
- package/dist/types/core/font/shx/ExtraLettersTemplate.d.ts +1 -0
- package/dist/types/core/font/shx/Shx.constants.d.ts +11 -0
- package/dist/types/core/font/shx/ShxParser.d.ts +18 -0
- package/dist/types/core/font/shx/TextShape.d.ts +24 -0
- package/dist/types/core/font/shx/gbk/index.d.ts +4 -0
- package/dist/types/core/font/shx/index.d.ts +1 -0
- package/dist/types/core/font/shx/util/BitConverter.d.ts +18 -0
- package/dist/types/core/geometry-offset/Edge.d.ts +27 -0
- package/dist/types/core/geometry-offset/Offset.d.ts +46 -0
- package/dist/types/core/geometry-offset/index.d.ts +1 -0
- package/dist/types/core/helpers/BinaryReader.d.ts +24 -0
- package/dist/types/core/helpers/BoxSelectHelper.d.ts +44 -0
- package/dist/types/core/helpers/LoadingHelper.d.ts +46 -0
- package/dist/types/core/helpers/MobileTouchHelperDrawable.d.ts +26 -0
- package/dist/types/core/helpers/OSnapHelper.d.ts +167 -0
- package/dist/types/core/helpers/ObjectPixelSizeHelper.d.ts +13 -0
- package/dist/types/core/helpers/PickMarkupHelper.d.ts +29 -0
- package/dist/types/core/helpers/RafHelper.d.ts +18 -0
- package/dist/types/core/helpers/ZoomToRectHelper.d.ts +17 -0
- package/dist/types/core/helpers/index.d.ts +9 -0
- package/dist/types/core/index.d.ts +18 -0
- package/dist/types/core/indexeddb/AnnotationTable.d.ts +14 -0
- package/dist/types/core/indexeddb/BaseTable.d.ts +36 -0
- package/dist/types/core/indexeddb/DxfDataTable.d.ts +22 -0
- package/dist/types/core/indexeddb/FontDataTable.d.ts +32 -0
- package/dist/types/core/indexeddb/IndexedDbManager.d.ts +29 -0
- package/dist/types/core/indexeddb/ViewpointTable.d.ts +14 -0
- package/dist/types/core/indexeddb/index.d.ts +6 -0
- package/dist/types/core/input/InputManager.d.ts +161 -0
- package/dist/types/core/input/index.d.ts +1 -0
- package/dist/types/core/license/AutoConfig.d.ts +17 -0
- package/dist/types/core/license/LicenseManager.d.ts +107 -0
- package/dist/types/core/license/PublicKey.d.ts +1 -0
- package/dist/types/core/license/index.d.ts +1 -0
- package/dist/types/core/markup/ArrowMarkup.d.ts +14 -0
- package/dist/types/core/markup/BaseMarkup.d.ts +28 -0
- package/dist/types/core/markup/CircleMarkup.d.ts +12 -0
- package/dist/types/core/markup/CloudLineMarkup.d.ts +10 -0
- package/dist/types/core/markup/CloudRectMarkup.d.ts +11 -0
- package/dist/types/core/markup/CloudRectWithTextMarkup.d.ts +43 -0
- package/dist/types/core/markup/Constants.d.ts +17 -0
- package/dist/types/core/markup/DotMarkup.d.ts +9 -0
- package/dist/types/core/markup/EllipseMarkup.d.ts +12 -0
- package/dist/types/core/markup/LeaderLineMarkup.d.ts +25 -0
- package/dist/types/core/markup/MarkupManager.d.ts +91 -0
- package/dist/types/core/markup/PolylineMarkup.d.ts +11 -0
- package/dist/types/core/markup/RectMarkup.d.ts +10 -0
- package/dist/types/core/markup/TextMarkup.d.ts +40 -0
- package/dist/types/core/markup/XMarkup.d.ts +10 -0
- package/dist/types/core/markup/index.d.ts +13 -0
- package/dist/types/core/model/Constants.d.ts +51 -0
- package/dist/types/core/model/Model.d.ts +18 -0
- package/dist/types/core/model/Model2d.d.ts +115 -0
- package/dist/types/core/model/index.d.ts +3 -0
- package/dist/types/core/patches/Constants.d.ts +4 -0
- package/dist/types/core/patches/Line.d.ts +2 -0
- package/dist/types/core/patches/Mesh.d.ts +2 -0
- package/dist/types/core/patches/Points.d.ts +2 -0
- package/dist/types/core/patches/index.d.ts +4 -0
- package/dist/types/core/undo-redo/AddAnnotationCommand.d.ts +11 -0
- package/dist/types/core/undo-redo/AddMarkupCommand.d.ts +10 -0
- package/dist/types/core/undo-redo/AddMeasurementCommand.d.ts +9 -0
- package/dist/types/core/undo-redo/Command.d.ts +6 -0
- package/dist/types/core/undo-redo/RemoveAnnotationCommand.d.ts +11 -0
- package/dist/types/core/undo-redo/RemoveMarkupCommand.d.ts +10 -0
- package/dist/types/core/undo-redo/RemoveMeasurementCommand.d.ts +9 -0
- package/dist/types/core/undo-redo/UndoRedoManager.d.ts +21 -0
- package/dist/types/core/undo-redo/UpdateMarkupCommand.d.ts +11 -0
- package/dist/types/core/undo-redo/index.d.ts +9 -0
- package/dist/types/core/utils/CSS2DObjectUtils.d.ts +14 -0
- package/dist/types/core/utils/ColorUtils.d.ts +21 -0
- package/dist/types/core/utils/CommonUtils.d.ts +125 -0
- package/dist/types/core/utils/CoordinateUtils.d.ts +81 -0
- package/dist/types/core/utils/DecimalPrecisionUtils.d.ts +4 -0
- package/dist/types/core/utils/DeviceUtils.d.ts +15 -0
- package/dist/types/core/utils/EdgeUtils.d.ts +14 -0
- package/dist/types/core/utils/Event.d.ts +33 -0
- package/dist/types/core/utils/FpsUtils.d.ts +13 -0
- package/dist/types/core/utils/GeometryUtils.d.ts +111 -0
- package/dist/types/core/utils/Locale.d.ts +190 -0
- package/dist/types/core/utils/LogUtils.d.ts +7 -0
- package/dist/types/core/utils/MaterialUtils.d.ts +40 -0
- package/dist/types/core/utils/MathUtils.d.ts +59 -0
- package/dist/types/core/utils/MergeUtils.d.ts +638 -0
- package/dist/types/core/utils/ObjectUtils.d.ts +87 -0
- package/dist/types/core/utils/PolygonUtils.d.ts +8 -0
- package/dist/types/core/utils/SVGObjectUtils.d.ts +16 -0
- package/dist/types/core/utils/SceneUtils.d.ts +26 -0
- package/dist/types/core/utils/SectionUtils.d.ts +11 -0
- package/dist/types/core/utils/UnitConversionUtils.d.ts +31 -0
- package/dist/types/core/utils/index.d.ts +21 -0
- package/dist/types/core/viewers/BaseViewer.d.ts +265 -0
- package/dist/types/core/viewers/DxfViewer.d.ts +1372 -0
- package/dist/types/core/viewers/Plugin.d.ts +29 -0
- package/dist/types/core/viewers/ViewerEvent.d.ts +178 -0
- package/dist/types/core/viewers/index.d.ts +4 -0
- package/dist/types/export.doc.d.ts +10 -0
- package/dist/types/fetch-polyfill.d.ts +2 -0
- package/dist/types/index.d.ts +8 -0
- package/dist/types/plugins/annotation/AnnotationPlugin.d.ts +139 -0
- package/dist/types/plugins/annotation/AutoDrawAnnotation.d.ts +63 -0
- package/dist/types/plugins/annotation/BaseAnnotation.d.ts +113 -0
- package/dist/types/plugins/annotation/BaseAnnotationDrawable.d.ts +139 -0
- package/dist/types/plugins/annotation/CopyAnnotation.d.ts +36 -0
- package/dist/types/plugins/annotation/CopyDrawable.d.ts +26 -0
- package/dist/types/plugins/annotation/FreeDrawAnnotation.d.ts +59 -0
- package/dist/types/plugins/annotation/RectAnnotation.d.ts +53 -0
- package/dist/types/plugins/annotation/RectDrawable.d.ts +42 -0
- package/dist/types/plugins/annotation/ShapeFinder.d.ts +51 -0
- package/dist/types/plugins/annotation/freeDrawDrawable.d.ts +21 -0
- package/dist/types/plugins/annotation/index.d.ts +8 -0
- package/dist/types/plugins/annotation/type.d.ts +182 -0
- package/dist/types/plugins/axis-gizmo/AxisGizmoPlugin.d.ts +49 -0
- package/dist/types/plugins/axis-gizmo/CoordinateAxes.d.ts +12 -0
- package/dist/types/plugins/axis-gizmo/index.d.ts +1 -0
- package/dist/types/plugins/bottom-bar/BottomBarPlugin.d.ts +44 -0
- package/dist/types/plugins/bottom-bar/index.d.ts +1 -0
- package/dist/types/plugins/divide/CoverLayerManager.d.ts +44 -0
- package/dist/types/plugins/divide/DivGeometryUtils.d.ts +66 -0
- package/dist/types/plugins/divide/DividePlugin.d.ts +181 -0
- package/dist/types/plugins/divide/FrameAnnotation.d.ts +142 -0
- package/dist/types/plugins/divide/FrameDrawable.d.ts +75 -0
- package/dist/types/plugins/divide/index.d.ts +6 -0
- package/dist/types/plugins/divide/types.d.ts +38 -0
- package/dist/types/plugins/hotpoint/HotpointPlugin.d.ts +93 -0
- package/dist/types/plugins/hotpoint/index.d.ts +1 -0
- package/dist/types/plugins/index.d.ts +12 -0
- package/dist/types/plugins/layer-manager/LayerManagerPlugin.d.ts +59 -0
- package/dist/types/plugins/layer-manager/index.d.ts +1 -0
- package/dist/types/plugins/local-model-uploader/IUploader.d.ts +10 -0
- package/dist/types/plugins/local-model-uploader/LocalDxfUploader.d.ts +19 -0
- package/dist/types/plugins/local-model-uploader/index.d.ts +1 -0
- package/dist/types/plugins/measure/AngleMeasureDrawable.d.ts +12 -0
- package/dist/types/plugins/measure/AngleMeasurement.d.ts +16 -0
- package/dist/types/plugins/measure/AreaMeasureDrawable.d.ts +14 -0
- package/dist/types/plugins/measure/AreaMeasurement.d.ts +31 -0
- package/dist/types/plugins/measure/BaseMeasureDrawable.d.ts +35 -0
- package/dist/types/plugins/measure/BaseMeasurement.d.ts +127 -0
- package/dist/types/plugins/measure/CoordinateMeasureDrawable.d.ts +10 -0
- package/dist/types/plugins/measure/CoordinateMeasurement.d.ts +15 -0
- package/dist/types/plugins/measure/DistanceMeasureDrawable.d.ts +15 -0
- package/dist/types/plugins/measure/DistanceMeasurement.d.ts +28 -0
- package/dist/types/plugins/measure/MeasurementPlugin.d.ts +131 -0
- package/dist/types/plugins/measure/index.d.ts +3 -0
- package/dist/types/plugins/overview-map/ImageDrawable.d.ts +41 -0
- package/dist/types/plugins/overview-map/LineDrawable.d.ts +20 -0
- package/dist/types/plugins/overview-map/OverviewMapDrawable.d.ts +24 -0
- package/dist/types/plugins/overview-map/OverviewMapPlugin.d.ts +156 -0
- package/dist/types/plugins/overview-map/TextDrawable.d.ts +50 -0
- package/dist/types/plugins/overview-map/index.d.ts +5 -0
- package/dist/types/plugins/screenshot/ScreenshotPlugin.d.ts +88 -0
- package/dist/types/plugins/screenshot/index.d.ts +1 -0
- package/dist/types/plugins/stats/StatsPlugin.d.ts +20 -0
- package/dist/types/plugins/stats/index.d.ts +1 -0
- package/dist/types/plugins/toolbars/DxfViewerToolbarPlugin.d.ts +67 -0
- package/dist/types/plugins/toolbars/MarkupToolbar.d.ts +33 -0
- package/dist/types/plugins/toolbars/Toolbar.config.d.ts +5 -0
- package/dist/types/plugins/toolbars/Toolbar.constants.d.ts +96 -0
- package/dist/types/plugins/toolbars/Toolbar.d.ts +102 -0
- package/dist/types/plugins/toolbars/index.d.ts +5 -0
- package/dist/types/version.d.ts +2 -0
- package/package.json +90 -0
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import * as THREE from "three";
|
|
2
|
+
import { DxfObject } from "../dxf/DxfObject";
|
|
3
|
+
/**
|
|
4
|
+
* @internal
|
|
5
|
+
*/
|
|
6
|
+
export interface MaterialInfo {
|
|
7
|
+
id: number;
|
|
8
|
+
material?: THREE.Material;
|
|
9
|
+
clonedMaterial?: THREE.Material;
|
|
10
|
+
opacity: number;
|
|
11
|
+
transparent: boolean;
|
|
12
|
+
side: THREE.Side;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Util class for Threejs Object
|
|
16
|
+
* @internal
|
|
17
|
+
*/
|
|
18
|
+
export declare class ObjectUtils {
|
|
19
|
+
/**
|
|
20
|
+
* Outline default material
|
|
21
|
+
*/
|
|
22
|
+
private static OUTLINE_MATERIAL;
|
|
23
|
+
/**
|
|
24
|
+
* Creates outlines for given object and children
|
|
25
|
+
*/
|
|
26
|
+
static createOutlines(object: THREE.Object3D, options?: {
|
|
27
|
+
onlyVisible: boolean;
|
|
28
|
+
meshOnly: boolean;
|
|
29
|
+
}, onProgress?: (event: ProgressEvent) => void): Promise<THREE.LineSegments[]>;
|
|
30
|
+
/**
|
|
31
|
+
* Recursively removes outlines for given object and children
|
|
32
|
+
*/
|
|
33
|
+
static removeOutlines(object: THREE.Object3D): void;
|
|
34
|
+
/**
|
|
35
|
+
* Checks if an object has outline already
|
|
36
|
+
* @param checkChildren If it checks children recursively.
|
|
37
|
+
*/
|
|
38
|
+
static hasOutline(object: THREE.Object3D, checkChildren?: boolean): boolean;
|
|
39
|
+
/**
|
|
40
|
+
* Sets outline visiblility for given object and children
|
|
41
|
+
*/
|
|
42
|
+
static setOutlinesVisibility(object: THREE.Object3D, visible: boolean): void;
|
|
43
|
+
/**
|
|
44
|
+
* Creates outline for given geometry
|
|
45
|
+
*/
|
|
46
|
+
static createOutline(geometry: THREE.BufferGeometry, material?: THREE.LineBasicMaterial, matrix?: THREE.Matrix4): THREE.LineSegments;
|
|
47
|
+
/**
|
|
48
|
+
* Clones object
|
|
49
|
+
* @param object target object to be cloned
|
|
50
|
+
* @param cloneMaterial if it needs to clone material or not
|
|
51
|
+
* @returns cloned object
|
|
52
|
+
*/
|
|
53
|
+
static cloneObject(object: THREE.Object3D, cloneMaterial?: boolean): THREE.Object3D;
|
|
54
|
+
private static BOX_FACE_MATERIAL;
|
|
55
|
+
/**
|
|
56
|
+
* Creates box mesh
|
|
57
|
+
*/
|
|
58
|
+
static createBox(sizeX: number, sizeY: number, sizeZ: number, faceMaterial?: THREE.Material, withBottom?: boolean): THREE.Mesh<THREE.BufferGeometry<THREE.NormalBufferAttributes>, THREE.Material>;
|
|
59
|
+
/**
|
|
60
|
+
* TODO: Relative to center
|
|
61
|
+
*/
|
|
62
|
+
static rebaseObjectOnRTC(object: THREE.Object3D): THREE.Object3D;
|
|
63
|
+
static isEmptyObject(object: THREE.Object3D | DxfObject): boolean;
|
|
64
|
+
static removeEmptyObjects(object: THREE.Object3D | DxfObject): boolean;
|
|
65
|
+
/**
|
|
66
|
+
* From bottom to top, removes child objects first,
|
|
67
|
+
* and then removes empty parent objects
|
|
68
|
+
*/
|
|
69
|
+
static removeEmptyObjectsFromRemovingObjects(removingObjects: THREE.Object3D[], levelObject: THREE.Object3D): void;
|
|
70
|
+
/**
|
|
71
|
+
* To save memory, object3d shares some variables
|
|
72
|
+
*/
|
|
73
|
+
static setSharedVariablesOfObject(object: THREE.Object3D): void;
|
|
74
|
+
/**
|
|
75
|
+
* Checks if an object is a drawable leaf object
|
|
76
|
+
*/
|
|
77
|
+
static isLeafObject(obj: THREE.Object3D): boolean;
|
|
78
|
+
/**
|
|
79
|
+
* object layers related setting functions
|
|
80
|
+
*/
|
|
81
|
+
static enableLayerChannels(obj: THREE.Object3D, channels: number[], recursive?: boolean): void;
|
|
82
|
+
static disableLayerChannels(obj: THREE.Object3D, channels: number[], recursive?: boolean): void;
|
|
83
|
+
static setLayerChannels(obj: THREE.Object3D, channels: number[], recursive?: boolean): void;
|
|
84
|
+
static isObjectHittable(obj: THREE.Object3D): boolean;
|
|
85
|
+
static isObjectSnapable(obj: THREE.Object3D): boolean;
|
|
86
|
+
static isObjectSelectable(obj: THREE.Object3D): boolean;
|
|
87
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { SVGObject } from "three/examples/jsm/renderers/SVGRenderer.js";
|
|
2
|
+
export declare const SNAP_ICON_SIZE = 10;
|
|
3
|
+
export declare enum OSnapMarkerType {
|
|
4
|
+
TripleCross = "TripleCross",
|
|
5
|
+
Square = "Square",
|
|
6
|
+
Triangle = "Triangle",
|
|
7
|
+
CircleWithCross = "CircleWithCross",
|
|
8
|
+
Cross = "Cross",
|
|
9
|
+
Perpendicular = "Perpendicular"
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* @internal
|
|
13
|
+
*/
|
|
14
|
+
export declare class SVGObjectUtils {
|
|
15
|
+
static createSVGObject(node: SVGPathElement | SVGTextElement | SVGLineElement): SVGObject;
|
|
16
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import * as THREE from "three";
|
|
2
|
+
/**
|
|
3
|
+
* Util methods about Scene
|
|
4
|
+
* @internal
|
|
5
|
+
*/
|
|
6
|
+
export declare class SceneUtils {
|
|
7
|
+
/**
|
|
8
|
+
* Get all visible objects' bounding box in a scene.
|
|
9
|
+
* @param scene
|
|
10
|
+
*/
|
|
11
|
+
static getVisibleObjectBoundingBox(scene: THREE.Scene): THREE.Box3;
|
|
12
|
+
static getObjectsBoundingBox(scene: THREE.Scene, objectIds: number[], sampling?: boolean): THREE.Box3;
|
|
13
|
+
/**
|
|
14
|
+
* Box3.expandByObject() doesn't work well in some case.
|
|
15
|
+
* E.g. when object's position is far away from object's center?
|
|
16
|
+
* When objects are instanced?
|
|
17
|
+
* That's why we need a method to find bounding box by object's children!
|
|
18
|
+
* And, better to do sampling in case there are too many children.
|
|
19
|
+
*/
|
|
20
|
+
static getBoundingBox(object: THREE.Object3D, sampling?: boolean): THREE.Box3;
|
|
21
|
+
/**
|
|
22
|
+
* InstancedMesh is different, we need to get its child meshes in order to get the bounding box
|
|
23
|
+
*/
|
|
24
|
+
static getInstancedMeshBoundingBox(mesh: THREE.InstancedMesh): THREE.Box3;
|
|
25
|
+
static getObjectCenter(object: THREE.Object3D, center: THREE.Vector3): void;
|
|
26
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import * as THREE from "three";
|
|
2
|
+
/**
|
|
3
|
+
* @internal
|
|
4
|
+
*/
|
|
5
|
+
export declare class SectionUtils {
|
|
6
|
+
static setMaterialSection(mat: THREE.Material, planes: THREE.Plane[], bAppend?: boolean, bClipIntersection?: boolean): void;
|
|
7
|
+
static removeSection(object: THREE.Object3D): void;
|
|
8
|
+
static addSection(object: THREE.Object3D, planes: THREE.Plane[], bAppend?: boolean, bClipIntersection?: boolean): void;
|
|
9
|
+
static generateSectionPlanesByBox(sectionBox: THREE.Box2): THREE.Plane[];
|
|
10
|
+
static generateSectionPlanesByPoints(points: THREE.Vector2[], bLeftSideOfForwadDirection?: boolean): THREE.Plane[] | undefined;
|
|
11
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @internal
|
|
3
|
+
*/
|
|
4
|
+
export declare const unitConversionByMeter: {
|
|
5
|
+
[key: string]: number;
|
|
6
|
+
};
|
|
7
|
+
/**
|
|
8
|
+
* @internal
|
|
9
|
+
*/
|
|
10
|
+
export declare const unitLabel: {
|
|
11
|
+
[key: string]: string;
|
|
12
|
+
};
|
|
13
|
+
/**
|
|
14
|
+
* @internal
|
|
15
|
+
*/
|
|
16
|
+
export declare const getUnitStr: (unit: string, power?: number) => string;
|
|
17
|
+
/**
|
|
18
|
+
* Gets unit
|
|
19
|
+
* value
|
|
20
|
+
* sourceUnit
|
|
21
|
+
* targetUnit
|
|
22
|
+
* @internal
|
|
23
|
+
*/
|
|
24
|
+
export interface valueWithUnit {
|
|
25
|
+
value: number;
|
|
26
|
+
unit: string;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* @internal
|
|
30
|
+
*/
|
|
31
|
+
export declare const getLengthValueByUnit: (value: number, sourceUnit: string, targetUnit: string, power?: number) => valueWithUnit;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export * from "./CommonUtils";
|
|
2
|
+
export * from "./ColorUtils";
|
|
3
|
+
export * from "./CoordinateUtils";
|
|
4
|
+
export * from "./CSS2DObjectUtils";
|
|
5
|
+
export * from "./DecimalPrecisionUtils";
|
|
6
|
+
export * from "./DeviceUtils";
|
|
7
|
+
export * from "./EdgeUtils";
|
|
8
|
+
export * from "./Event";
|
|
9
|
+
export * from "./FpsUtils";
|
|
10
|
+
export * from "./GeometryUtils";
|
|
11
|
+
export * from "./Locale";
|
|
12
|
+
export * from "./LogUtils";
|
|
13
|
+
export * from "./MaterialUtils";
|
|
14
|
+
export * from "./MathUtils";
|
|
15
|
+
export * from "./MergeUtils";
|
|
16
|
+
export * from "./ObjectUtils";
|
|
17
|
+
export * from "./PolygonUtils";
|
|
18
|
+
export * from "./SceneUtils";
|
|
19
|
+
export * from "./SectionUtils";
|
|
20
|
+
export * from "./SVGObjectUtils";
|
|
21
|
+
export * from "./UnitConversionUtils";
|
|
@@ -0,0 +1,265 @@
|
|
|
1
|
+
import type { TFunction } from "i18next";
|
|
2
|
+
import * as THREE from "three";
|
|
3
|
+
import { Box2 } from "../Constants";
|
|
4
|
+
import { ViewerEvent } from "./ViewerEvent";
|
|
5
|
+
import type { BaseViewerConfig, CameraConfig } from "../../core/Configs";
|
|
6
|
+
import type { CanvasRender } from "../../core/canvas";
|
|
7
|
+
import type { CameraControlsEx } from "../../core/controls";
|
|
8
|
+
import { EventInfo, InputManager } from "../../core/input/InputManager";
|
|
9
|
+
import type { MarkupManager } from "../../core/markup";
|
|
10
|
+
import { UndoRedoManager } from "../../core/undo-redo/UndoRedoManager";
|
|
11
|
+
import { Event } from "../../core/utils";
|
|
12
|
+
import { Plugin } from "../../core/viewers/Plugin";
|
|
13
|
+
import type { MeasurementPlugin } from "../../plugins";
|
|
14
|
+
/**
|
|
15
|
+
* 截图结果,包含结果图像和,
|
|
16
|
+
* 对于 DxfViewer,还包含截图时的视图范围,
|
|
17
|
+
* 对于 BimViewer,包含相机的位置和目标。
|
|
18
|
+
*/
|
|
19
|
+
export interface ScreenshotResult {
|
|
20
|
+
/**
|
|
21
|
+
* 截图时的视图范围。
|
|
22
|
+
* 注意,这不是图像的范围。
|
|
23
|
+
* 这仅适用于 DxfViewer。
|
|
24
|
+
*/
|
|
25
|
+
viewExtent?: Box2;
|
|
26
|
+
/**
|
|
27
|
+
* 用于 BimViewer
|
|
28
|
+
* @internal
|
|
29
|
+
*/
|
|
30
|
+
/**
|
|
31
|
+
* 用于 BimViewer
|
|
32
|
+
* @internal
|
|
33
|
+
*/
|
|
34
|
+
/**
|
|
35
|
+
* 图像类型,默认为 "image/png"
|
|
36
|
+
* @internal
|
|
37
|
+
*/
|
|
38
|
+
imageType: string;
|
|
39
|
+
/**
|
|
40
|
+
* 图像,base64 格式。
|
|
41
|
+
*/
|
|
42
|
+
base64Image: string;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* @internal
|
|
46
|
+
*/
|
|
47
|
+
export declare enum ViewerName {
|
|
48
|
+
BaseViewer = "BaseViewer",
|
|
49
|
+
BimViewer = "BimViewer",
|
|
50
|
+
DxfViewer = "DxfViewer",
|
|
51
|
+
VRViewer = "VRViewer"
|
|
52
|
+
}
|
|
53
|
+
declare type ViewerEvents = {
|
|
54
|
+
[K in ViewerEvent]: any;
|
|
55
|
+
};
|
|
56
|
+
/**
|
|
57
|
+
* DxfViewer、BimViewer 等的抽象基类。
|
|
58
|
+
*/
|
|
59
|
+
export declare abstract class BaseViewer extends Event<ViewerEvents> {
|
|
60
|
+
/**
|
|
61
|
+
* @internal
|
|
62
|
+
*/
|
|
63
|
+
name: ViewerName;
|
|
64
|
+
/**
|
|
65
|
+
* @internal
|
|
66
|
+
*/
|
|
67
|
+
translate: TFunction;
|
|
68
|
+
/**
|
|
69
|
+
* @internal
|
|
70
|
+
*/
|
|
71
|
+
parentContainer?: HTMLElement;
|
|
72
|
+
/**
|
|
73
|
+
* @internal
|
|
74
|
+
*/
|
|
75
|
+
viewerContainer?: HTMLElement;
|
|
76
|
+
container?: HTMLElement;
|
|
77
|
+
protected inputManager?: InputManager;
|
|
78
|
+
/**
|
|
79
|
+
* @internal
|
|
80
|
+
*/
|
|
81
|
+
scene?: THREE.Scene;
|
|
82
|
+
/**
|
|
83
|
+
* @internal
|
|
84
|
+
*/
|
|
85
|
+
renderer?: THREE.WebGLRenderer;
|
|
86
|
+
/**
|
|
87
|
+
* @internal
|
|
88
|
+
*/
|
|
89
|
+
camera?: THREE.PerspectiveCamera | THREE.OrthographicCamera;
|
|
90
|
+
/**
|
|
91
|
+
* @internal
|
|
92
|
+
*/
|
|
93
|
+
controls?: CameraControlsEx;
|
|
94
|
+
protected height: number;
|
|
95
|
+
protected width: number;
|
|
96
|
+
/**
|
|
97
|
+
* @internal
|
|
98
|
+
*/
|
|
99
|
+
widgetContainer?: HTMLElement;
|
|
100
|
+
private spinner?;
|
|
101
|
+
protected jobCount: number;
|
|
102
|
+
protected viewerCfg: BaseViewerConfig;
|
|
103
|
+
/**
|
|
104
|
+
* @internal
|
|
105
|
+
*/
|
|
106
|
+
cameraCfg?: CameraConfig;
|
|
107
|
+
/**
|
|
108
|
+
* @internal
|
|
109
|
+
*/
|
|
110
|
+
groundPlane?: THREE.Mesh;
|
|
111
|
+
/**
|
|
112
|
+
* @describe overlay canvas
|
|
113
|
+
* @internal
|
|
114
|
+
*/
|
|
115
|
+
overlayRender?: CanvasRender;
|
|
116
|
+
/**
|
|
117
|
+
* @internal
|
|
118
|
+
*/
|
|
119
|
+
loadedModels?: any;
|
|
120
|
+
/**
|
|
121
|
+
* @internal
|
|
122
|
+
*/
|
|
123
|
+
undoRedoManager?: UndoRedoManager;
|
|
124
|
+
protected enableOverlayRenderer: boolean;
|
|
125
|
+
/**
|
|
126
|
+
* @internal
|
|
127
|
+
*/
|
|
128
|
+
protected requestAnimationFrameHandle?: number;
|
|
129
|
+
/**
|
|
130
|
+
* @internal
|
|
131
|
+
*/
|
|
132
|
+
protected frustumSize: number;
|
|
133
|
+
/**
|
|
134
|
+
* @internal
|
|
135
|
+
*/
|
|
136
|
+
protected loadingProgressBar?: any;
|
|
137
|
+
protected lastFrameExecuteTime: number;
|
|
138
|
+
protected minFrameInterval: number;
|
|
139
|
+
protected plugins: Plugin[];
|
|
140
|
+
constructor(viewerCfg: BaseViewerConfig);
|
|
141
|
+
private initLogLevel;
|
|
142
|
+
private initLocalization;
|
|
143
|
+
private initContainer;
|
|
144
|
+
/**
|
|
145
|
+
* 在用户传入的容器下创建一个 viewerContainer。
|
|
146
|
+
* 创建一个新的有一些好处。例如,它的样式不会影响
|
|
147
|
+
* 用户传入的容器 div。
|
|
148
|
+
*/
|
|
149
|
+
private initViewerContainer;
|
|
150
|
+
/**
|
|
151
|
+
*
|
|
152
|
+
* @description 为ui组件创建一个div,如果组件需要位置,只需相对容器,可能会在后面移除。
|
|
153
|
+
*/
|
|
154
|
+
private initWidgetContainer;
|
|
155
|
+
protected initSpinner(): void;
|
|
156
|
+
/**
|
|
157
|
+
* 设置加载动画的可见性
|
|
158
|
+
*/
|
|
159
|
+
protected setSpinnerVisibility(visible: boolean): void;
|
|
160
|
+
/**
|
|
161
|
+
* 增加作业数量,并相应地显示加载动画
|
|
162
|
+
*/
|
|
163
|
+
protected increaseJobCount(): void;
|
|
164
|
+
/**
|
|
165
|
+
* 减少作业数量,并相应地隐藏加载动画
|
|
166
|
+
*/
|
|
167
|
+
protected decreaseJobCount(): void;
|
|
168
|
+
protected resize(width: number, height: number): void;
|
|
169
|
+
destroy(): void;
|
|
170
|
+
/**
|
|
171
|
+
* @internal
|
|
172
|
+
* @description 全局事件输入管理器。例如:mousedown、mouseup、keydown。
|
|
173
|
+
*/
|
|
174
|
+
getInputManager(): InputManager | undefined;
|
|
175
|
+
/**
|
|
176
|
+
* @internal
|
|
177
|
+
*/
|
|
178
|
+
getViewConfig(): BaseViewerConfig;
|
|
179
|
+
/**
|
|
180
|
+
* @internal
|
|
181
|
+
*/
|
|
182
|
+
enableRender(): void;
|
|
183
|
+
/**
|
|
184
|
+
* @internal
|
|
185
|
+
*/
|
|
186
|
+
getRaycaster(): THREE.Raycaster | undefined;
|
|
187
|
+
/**
|
|
188
|
+
* @internal
|
|
189
|
+
*/
|
|
190
|
+
getRaycastableObjectsByMouse(event?: EventInfo): THREE.Object3D[];
|
|
191
|
+
/**
|
|
192
|
+
* 带事件级缓存的射线相交辅助函数。默认:无缓存。
|
|
193
|
+
* 派生视图类可通过 `event.raycastCache` 重写此方法提供缓存功能。
|
|
194
|
+
* @internal
|
|
195
|
+
*/
|
|
196
|
+
intersectObjectsCached(event: EventInfo, objects: THREE.Object3D[], recursive: boolean, cacheKey: string): THREE.Intersection[];
|
|
197
|
+
/**
|
|
198
|
+
* 获取视图中所有对象的包围盒。
|
|
199
|
+
* @internal
|
|
200
|
+
*/
|
|
201
|
+
getBBox(): THREE.Box3 | undefined;
|
|
202
|
+
flyTo(position: THREE.Vector3, lookAt: THREE.Vector3): void;
|
|
203
|
+
/**
|
|
204
|
+
* 是否为3d视图器。
|
|
205
|
+
* DxfViewer 是2d的,因此返回 false。
|
|
206
|
+
* @default true
|
|
207
|
+
* @internal
|
|
208
|
+
*/
|
|
209
|
+
is3d(): boolean;
|
|
210
|
+
/**
|
|
211
|
+
* @description 兼容旧版本,请使用 MeasurePlugin 代替
|
|
212
|
+
* @internal
|
|
213
|
+
*/
|
|
214
|
+
get measurePlugin(): MeasurementPlugin | undefined;
|
|
215
|
+
/**
|
|
216
|
+
* @internal
|
|
217
|
+
*/
|
|
218
|
+
getMarkupManager(): MarkupManager | undefined;
|
|
219
|
+
/**
|
|
220
|
+
* @deprecated
|
|
221
|
+
*/
|
|
222
|
+
deactivateMeasurement(): void;
|
|
223
|
+
/**
|
|
224
|
+
* @deprecated
|
|
225
|
+
*/
|
|
226
|
+
deactivateAnnotation(): void;
|
|
227
|
+
/**
|
|
228
|
+
* @deprecated
|
|
229
|
+
*/
|
|
230
|
+
setMeasurementVisibility(id: string, visible: boolean): boolean;
|
|
231
|
+
/**
|
|
232
|
+
* @internal
|
|
233
|
+
*/
|
|
234
|
+
screenshot(config: any): Promise<undefined | string>;
|
|
235
|
+
/**
|
|
236
|
+
* 获取一个像素在世界坐标中代表的长度。
|
|
237
|
+
* 这对正交相机有效。
|
|
238
|
+
* 对于透视相机,一个像素在不同位置代表不同的大小,
|
|
239
|
+
* 取决于相机的距离和其视野等。我们简单地以相机目标作为位置来计算。
|
|
240
|
+
* @internal
|
|
241
|
+
*/
|
|
242
|
+
getPixelSizeInWorldCoord(): number;
|
|
243
|
+
/**
|
|
244
|
+
* 在预期的id重复的情况下获取一个唯一的modelId。
|
|
245
|
+
*/
|
|
246
|
+
protected getUniqueModelId(expectedModelId: string): string;
|
|
247
|
+
/**
|
|
248
|
+
* 安装一个插件。
|
|
249
|
+
*/
|
|
250
|
+
addPlugin(plugin: Plugin): void;
|
|
251
|
+
/**
|
|
252
|
+
* 卸载一个插件,首先清除其内容。
|
|
253
|
+
*/
|
|
254
|
+
removePlugin(plugin: Plugin): void;
|
|
255
|
+
/**
|
|
256
|
+
* 清除所有插件。
|
|
257
|
+
* 插件不是由视图器创建的,因此不会被视图器销毁。
|
|
258
|
+
*/
|
|
259
|
+
clearPlugins(): void;
|
|
260
|
+
/**
|
|
261
|
+
* 查找一个插件。
|
|
262
|
+
*/
|
|
263
|
+
findPlugin(id: string): Plugin | undefined;
|
|
264
|
+
}
|
|
265
|
+
export {};
|