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,36 @@
|
|
|
1
|
+
import * as THREE from "three";
|
|
2
|
+
import { BaseAnnotation } from "./BaseAnnotation";
|
|
3
|
+
import type { BaseAnnotationDrawable } from "./BaseAnnotationDrawable";
|
|
4
|
+
import { DrawableList } from "../../core/canvas";
|
|
5
|
+
import type { OSnapHelper } from "../../core/helpers";
|
|
6
|
+
import { EventInfo, InputManager } from "../../core/input/InputManager";
|
|
7
|
+
import type { BaseViewer } from "../../core/viewers";
|
|
8
|
+
/**
|
|
9
|
+
* CopyAnnotation: 复制绘制模式
|
|
10
|
+
* - 当选择到一个封闭图形后,按下 Ctrl+C 进入复制模式,生成一个 CopyDrawable 预览
|
|
11
|
+
* - 鼠标移动时,CopyDrawable 左上角跟随吸附位置移动
|
|
12
|
+
* - 左键点击落下并完成复制(复制原图形的 title/annotationType/property)
|
|
13
|
+
*/
|
|
14
|
+
export declare class CopyAnnotation extends BaseAnnotation {
|
|
15
|
+
private sourceDrawable?;
|
|
16
|
+
private copyDrawable?;
|
|
17
|
+
constructor(viewer: BaseViewer, input: InputManager, drawList: DrawableList, osnapHelper: OSnapHelper);
|
|
18
|
+
exitDrawing(): void;
|
|
19
|
+
cancel(): void;
|
|
20
|
+
protected complete(): void;
|
|
21
|
+
protected setTooltipContent(): void;
|
|
22
|
+
protected createAnnotationDrawable(): BaseAnnotationDrawable | undefined;
|
|
23
|
+
activate(): void;
|
|
24
|
+
deactivate(): void;
|
|
25
|
+
private onKeyDownForCopy;
|
|
26
|
+
/**
|
|
27
|
+
* 从当前 drawList 选择开始复制(用于 Ctrl+C 或调用方触发)
|
|
28
|
+
*/
|
|
29
|
+
beginWithSelection(): void;
|
|
30
|
+
/**
|
|
31
|
+
* 外部可传入指定源图形直接开始复制预览
|
|
32
|
+
*/
|
|
33
|
+
beginWithSource(src: BaseAnnotationDrawable): void;
|
|
34
|
+
protected onMouseMove(position: THREE.Vector3): void;
|
|
35
|
+
protected onMouseClick(e: EventInfo): void;
|
|
36
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import * as THREE from "three";
|
|
2
|
+
import { BaseAnnotationDrawable } from "./BaseAnnotationDrawable";
|
|
3
|
+
import { AnnotationProperty, AnnotationType } from "./type";
|
|
4
|
+
import { OSnapHelper } from "../../core/helpers";
|
|
5
|
+
import type { BaseViewer } from "../../core/viewers";
|
|
6
|
+
/**
|
|
7
|
+
* CopyDrawable: 复制出的封闭图形,在鼠标移动时跟随光标(带吸附),点击落下
|
|
8
|
+
*/
|
|
9
|
+
export declare class CopyDrawable extends BaseAnnotationDrawable {
|
|
10
|
+
private clonedFromPoints;
|
|
11
|
+
constructor(id: string, osnapHelper: OSnapHelper, viewer?: BaseViewer);
|
|
12
|
+
/**
|
|
13
|
+
* 设定被复制的原始点集与元数据
|
|
14
|
+
*/
|
|
15
|
+
setSource(points: THREE.Vector3[], meta?: {
|
|
16
|
+
title?: string;
|
|
17
|
+
annotationType?: AnnotationType;
|
|
18
|
+
property?: Partial<AnnotationProperty>;
|
|
19
|
+
}): this;
|
|
20
|
+
/**
|
|
21
|
+
* 根据给定的左上角目标位置,平移当前图形到该位置
|
|
22
|
+
*/
|
|
23
|
+
moveToTopLeft(targetTopLeft: THREE.Vector3): this;
|
|
24
|
+
draw(ctx: CanvasRenderingContext2D, camera: THREE.Camera): void;
|
|
25
|
+
getClassType(): string;
|
|
26
|
+
}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import * as THREE from "three";
|
|
2
|
+
import { BaseAnnotation } from "./BaseAnnotation";
|
|
3
|
+
import { BaseAnnotationDrawable } from "./BaseAnnotationDrawable";
|
|
4
|
+
import { DrawableList } from "../../core/canvas/DrawableList";
|
|
5
|
+
import type { OSnapHelper } from "../../core/helpers";
|
|
6
|
+
import { EventInfo, InputManager } from "../../core/input/InputManager";
|
|
7
|
+
import type { BaseViewer } from "../../core/viewers";
|
|
8
|
+
/**
|
|
9
|
+
* 自由绘制标注类
|
|
10
|
+
* 用于处理自由绘制的标注功能
|
|
11
|
+
*/
|
|
12
|
+
export declare class FreeDrawAnnotation extends BaseAnnotation {
|
|
13
|
+
private minPointDistance;
|
|
14
|
+
constructor(viewer: BaseViewer, input: InputManager, drawList: DrawableList, osnapHelper: OSnapHelper);
|
|
15
|
+
/**
|
|
16
|
+
* 退出绘制
|
|
17
|
+
*/
|
|
18
|
+
exitDrawing(): void;
|
|
19
|
+
/**
|
|
20
|
+
* 取消当前绘制
|
|
21
|
+
*/
|
|
22
|
+
cancel(): void;
|
|
23
|
+
/**
|
|
24
|
+
* 完成当前绘制
|
|
25
|
+
*/
|
|
26
|
+
protected complete(): void;
|
|
27
|
+
/**
|
|
28
|
+
* 设置提示内容
|
|
29
|
+
*/
|
|
30
|
+
protected setTooltipContent(): void;
|
|
31
|
+
/**
|
|
32
|
+
* 创建标注drawable
|
|
33
|
+
*/
|
|
34
|
+
protected createAnnotationDrawable(): BaseAnnotationDrawable | undefined;
|
|
35
|
+
/**
|
|
36
|
+
* 重写鼠标点击处理,用于开始绘制
|
|
37
|
+
*/
|
|
38
|
+
protected onMouseClick(e: EventInfo): void;
|
|
39
|
+
/**
|
|
40
|
+
* 开始绘制
|
|
41
|
+
*/
|
|
42
|
+
private startDrawing;
|
|
43
|
+
/**
|
|
44
|
+
* 继续绘制(添加点)
|
|
45
|
+
*/
|
|
46
|
+
private continueDrawing;
|
|
47
|
+
/**
|
|
48
|
+
* 重写鼠标移动处理,用于连续绘制
|
|
49
|
+
*/
|
|
50
|
+
protected onMouseMove(position: THREE.Vector3): void;
|
|
51
|
+
/**
|
|
52
|
+
* 重写双击处理,用于快速结束绘制
|
|
53
|
+
*/
|
|
54
|
+
dblclick: () => void;
|
|
55
|
+
/**
|
|
56
|
+
* 将世界坐标转换为屏幕坐标
|
|
57
|
+
*/
|
|
58
|
+
private worldToScreen;
|
|
59
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import * as THREE from "three";
|
|
2
|
+
import { BaseAnnotation } from "./BaseAnnotation";
|
|
3
|
+
import { AnnotationModeType, BaseAnnotationDrawable } from "./BaseAnnotationDrawable";
|
|
4
|
+
import type { DrawableList } from "../../core/canvas/DrawableList";
|
|
5
|
+
import type { OSnapHelper } from "../../core/helpers";
|
|
6
|
+
import type { EventInfo, InputManager } from "../../core/input/InputManager";
|
|
7
|
+
import type { BaseViewer } from "../../core/viewers";
|
|
8
|
+
/**
|
|
9
|
+
* 矩形标注工具
|
|
10
|
+
* 支持通过两次点击绘制矩形:第一次点击确定起始点,第二次点击确定结束点
|
|
11
|
+
* 在绘制过程中提供实时预览
|
|
12
|
+
*/
|
|
13
|
+
export declare class RectAnnotation extends BaseAnnotation {
|
|
14
|
+
type: AnnotationModeType;
|
|
15
|
+
private startPoint?;
|
|
16
|
+
constructor(viewer: BaseViewer, inputManager: InputManager, drawList: DrawableList, osnapHelper: OSnapHelper);
|
|
17
|
+
/**
|
|
18
|
+
* 重写鼠标点击处理,用于矩形绘制
|
|
19
|
+
*/
|
|
20
|
+
protected onMouseClick(e: EventInfo): void;
|
|
21
|
+
/**
|
|
22
|
+
* 开始绘制矩形
|
|
23
|
+
*/
|
|
24
|
+
private startDrawing;
|
|
25
|
+
/**
|
|
26
|
+
* 完成绘制矩形
|
|
27
|
+
*/
|
|
28
|
+
private finishDrawing;
|
|
29
|
+
/**
|
|
30
|
+
* 退出绘制
|
|
31
|
+
*/
|
|
32
|
+
exitDrawing(): void;
|
|
33
|
+
/**
|
|
34
|
+
* 取消当前绘制
|
|
35
|
+
*/
|
|
36
|
+
cancel(): void;
|
|
37
|
+
/**
|
|
38
|
+
* 完成当前绘制
|
|
39
|
+
*/
|
|
40
|
+
protected complete(): void;
|
|
41
|
+
/**
|
|
42
|
+
* 设置提示内容
|
|
43
|
+
*/
|
|
44
|
+
protected setTooltipContent(): void;
|
|
45
|
+
/**
|
|
46
|
+
* 创建标注drawable
|
|
47
|
+
*/
|
|
48
|
+
protected createAnnotationDrawable(): BaseAnnotationDrawable | undefined;
|
|
49
|
+
/**
|
|
50
|
+
* 重写鼠标移动处理,用于实时预览
|
|
51
|
+
*/
|
|
52
|
+
protected onMouseMove(position: THREE.Vector3): void;
|
|
53
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import * as THREE from "three";
|
|
2
|
+
import { AnnotationModeType, BaseAnnotationDrawable } from "./BaseAnnotationDrawable";
|
|
3
|
+
import { OSnapHelper } from "../../core/helpers";
|
|
4
|
+
import { EventInfo } from "../../core/input/InputManager";
|
|
5
|
+
import type { BaseViewer } from "../../core/viewers";
|
|
6
|
+
/**
|
|
7
|
+
* 矩形标注 Drawable
|
|
8
|
+
* 支持通过两个对角点绘制矩形,具有填充和边框
|
|
9
|
+
*/
|
|
10
|
+
export declare class RectDrawable extends BaseAnnotationDrawable {
|
|
11
|
+
type: AnnotationModeType;
|
|
12
|
+
private dragFixedPoint?;
|
|
13
|
+
constructor(id: string, osnapHelper: OSnapHelper, points: THREE.Vector3[], viewer?: BaseViewer);
|
|
14
|
+
draw(ctx: CanvasRenderingContext2D, camera: THREE.Camera): void;
|
|
15
|
+
/**
|
|
16
|
+
* 根据两个对角点计算矩形的四个顶点
|
|
17
|
+
*/
|
|
18
|
+
private getRectPoints;
|
|
19
|
+
isPointInPath(p: THREE.Vector3): boolean;
|
|
20
|
+
getVertexes(): THREE.Vector3[];
|
|
21
|
+
getClassType(): string;
|
|
22
|
+
/**
|
|
23
|
+
* 重写更新方法,确保矩形只需要两个点
|
|
24
|
+
*/
|
|
25
|
+
update(points: THREE.Vector3[]): this;
|
|
26
|
+
/**
|
|
27
|
+
* 重写拖拽开始方法,处理4个顶点的拖拽
|
|
28
|
+
*/
|
|
29
|
+
beginDragVertex(index: number): void;
|
|
30
|
+
/**
|
|
31
|
+
* 重写拖拽预览更新方法,处理4个顶点的拖拽
|
|
32
|
+
*/
|
|
33
|
+
updateDragPreview(position: THREE.Vector3, eventInfo?: EventInfo): void;
|
|
34
|
+
/**
|
|
35
|
+
* 重写拖拽结束方法,处理4个顶点的拖拽
|
|
36
|
+
*/
|
|
37
|
+
endDragVertex(): void;
|
|
38
|
+
/**
|
|
39
|
+
* 根据拖拽的顶点更新矩形的两个对角点
|
|
40
|
+
*/
|
|
41
|
+
private updateRectFromVertexDrag;
|
|
42
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import * as THREE from "three";
|
|
2
|
+
import { EventInfo } from "../../core/input/InputManager";
|
|
3
|
+
import type { BaseViewer } from "../../core/viewers";
|
|
4
|
+
export interface ShapeCandidate {
|
|
5
|
+
kind: "rect" | "polygon";
|
|
6
|
+
area: number;
|
|
7
|
+
nestingLevel: number;
|
|
8
|
+
data: {
|
|
9
|
+
kind: "rect";
|
|
10
|
+
rect: {
|
|
11
|
+
min: THREE.Vector3;
|
|
12
|
+
max: THREE.Vector3;
|
|
13
|
+
};
|
|
14
|
+
} | {
|
|
15
|
+
kind: "polygon";
|
|
16
|
+
points: THREE.Vector3[];
|
|
17
|
+
};
|
|
18
|
+
source: string;
|
|
19
|
+
}
|
|
20
|
+
export declare class ShapeFinder {
|
|
21
|
+
private viewer;
|
|
22
|
+
private debugEnabled;
|
|
23
|
+
private closedPolysCache;
|
|
24
|
+
constructor(viewer: BaseViewer, debug?: boolean);
|
|
25
|
+
private d;
|
|
26
|
+
pickSmallestClosedShapeContainingPoint(e: EventInfo, p: THREE.Vector3): {
|
|
27
|
+
kind: "rect";
|
|
28
|
+
rect: {
|
|
29
|
+
min: THREE.Vector3;
|
|
30
|
+
max: THREE.Vector3;
|
|
31
|
+
};
|
|
32
|
+
} | {
|
|
33
|
+
kind: "polygon";
|
|
34
|
+
points: THREE.Vector3[];
|
|
35
|
+
} | undefined;
|
|
36
|
+
private collectCandidatesFromIntersections;
|
|
37
|
+
private collectCandidatesFromObjects;
|
|
38
|
+
private extractCandidatesFromObject;
|
|
39
|
+
private extractClosedPolygonsFromLineObject;
|
|
40
|
+
private makeRectKey;
|
|
41
|
+
private makePolyKey;
|
|
42
|
+
private shouldConsiderObjectNearPoint;
|
|
43
|
+
private extractClosedPolygonsFromLineObjectUsingBatches;
|
|
44
|
+
private buildSegmentsForBatch;
|
|
45
|
+
private calculateNestingLevels;
|
|
46
|
+
private isShapeCompletelyInside;
|
|
47
|
+
private getAxisAlignedBoundingRect;
|
|
48
|
+
private filterCandidatesByDistance;
|
|
49
|
+
private getDistanceToClickPoint;
|
|
50
|
+
private sortCandidates;
|
|
51
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import * as THREE from "three";
|
|
2
|
+
import { AnnotationModeType, BaseAnnotationDrawable } from "./BaseAnnotationDrawable";
|
|
3
|
+
import { OSnapHelper } from "../../core/helpers";
|
|
4
|
+
import type { BaseViewer } from "../../core/viewers";
|
|
5
|
+
export declare class FreeDrawDrawable extends BaseAnnotationDrawable {
|
|
6
|
+
type: AnnotationModeType;
|
|
7
|
+
constructor(id: string, osnapHelper: OSnapHelper, points: THREE.Vector3[], viewer?: BaseViewer);
|
|
8
|
+
draw(ctx: CanvasRenderingContext2D, camera: THREE.Camera): void;
|
|
9
|
+
isPointInPath(p: THREE.Vector3): boolean;
|
|
10
|
+
getVertexes(): THREE.Vector3[];
|
|
11
|
+
getClassType(): string;
|
|
12
|
+
/**
|
|
13
|
+
* 检查当前图形是否为闭合图形
|
|
14
|
+
*/
|
|
15
|
+
isClosed(): boolean;
|
|
16
|
+
/**
|
|
17
|
+
* 手动对自由绘制的点进行排序
|
|
18
|
+
* 注意:只有在确认需要排序时才调用此方法,因为它会改变用户绘制的原始顺序
|
|
19
|
+
*/
|
|
20
|
+
sortPointsManually(): void;
|
|
21
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export * from "./BaseAnnotationDrawable";
|
|
2
|
+
export * from "./BaseAnnotation";
|
|
3
|
+
export * from "./freeDrawDrawable";
|
|
4
|
+
export * from "./FreeDrawAnnotation";
|
|
5
|
+
export * from "./AutoDrawAnnotation";
|
|
6
|
+
export * from "./RectDrawable";
|
|
7
|
+
export * from "./RectAnnotation";
|
|
8
|
+
export * from "./AnnotationPlugin";
|
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
export interface Point {
|
|
2
|
+
x: number;
|
|
3
|
+
y: number;
|
|
4
|
+
z?: number;
|
|
5
|
+
}
|
|
6
|
+
export interface ConnectionPoint {
|
|
7
|
+
id: string;
|
|
8
|
+
position: THREE.Vector3;
|
|
9
|
+
type: "endpoint" | "control";
|
|
10
|
+
segmentIds: string[];
|
|
11
|
+
draggable: boolean;
|
|
12
|
+
snap: {
|
|
13
|
+
enabled: boolean;
|
|
14
|
+
radius: number;
|
|
15
|
+
priority: number;
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
export interface Segment {
|
|
19
|
+
id: string;
|
|
20
|
+
startPointId: string;
|
|
21
|
+
endPointId: string;
|
|
22
|
+
type: "line" | "arc" | "bezier";
|
|
23
|
+
mesh: THREE.Mesh | THREE.Line;
|
|
24
|
+
style?: SegmentStyle;
|
|
25
|
+
breakable: boolean;
|
|
26
|
+
}
|
|
27
|
+
export interface SegmentStyle {
|
|
28
|
+
color?: string;
|
|
29
|
+
width?: number;
|
|
30
|
+
dashArray?: number[];
|
|
31
|
+
opacity?: number;
|
|
32
|
+
}
|
|
33
|
+
export declare enum AnnotationType {
|
|
34
|
+
PARTITION_AREA = "partition",
|
|
35
|
+
PARTITION_DOOR = "partitionDoor",
|
|
36
|
+
PARTITION_WINDOW = "partitionWindow",
|
|
37
|
+
FURNITURE = "furniture",
|
|
38
|
+
EQUIPMENT = "equipment"
|
|
39
|
+
}
|
|
40
|
+
export interface BaseAnnotationProperty {
|
|
41
|
+
type: AnnotationType;
|
|
42
|
+
[key: string]: unknown;
|
|
43
|
+
}
|
|
44
|
+
export interface PartitionAreaProperty extends BaseAnnotationProperty {
|
|
45
|
+
type: AnnotationType.PARTITION_AREA;
|
|
46
|
+
area: number;
|
|
47
|
+
areaUnit?: "m²" | "mm²";
|
|
48
|
+
roomType?: string;
|
|
49
|
+
floorMaterial?: string;
|
|
50
|
+
}
|
|
51
|
+
export interface PartitionDoorProperty extends BaseAnnotationProperty {
|
|
52
|
+
type: AnnotationType.PARTITION_DOOR;
|
|
53
|
+
doorName: string;
|
|
54
|
+
doorType: string;
|
|
55
|
+
doorDirection: number;
|
|
56
|
+
doorArea: number;
|
|
57
|
+
openingAngle?: number;
|
|
58
|
+
material?: string;
|
|
59
|
+
}
|
|
60
|
+
export interface PartitionWindowProperty extends BaseAnnotationProperty {
|
|
61
|
+
type: AnnotationType.PARTITION_WINDOW;
|
|
62
|
+
windowName: string;
|
|
63
|
+
windowType: string;
|
|
64
|
+
windowArea: number;
|
|
65
|
+
openingType?: "fixed" | "sliding" | "casement";
|
|
66
|
+
}
|
|
67
|
+
export declare type AnnotationProperty = PartitionAreaProperty | PartitionDoorProperty | PartitionWindowProperty;
|
|
68
|
+
export interface AnnotationTitleConfig {
|
|
69
|
+
type: AnnotationType;
|
|
70
|
+
titles: string[];
|
|
71
|
+
defaultTitle: string;
|
|
72
|
+
allowCustomTitle: boolean;
|
|
73
|
+
}
|
|
74
|
+
export interface ClosedShape {
|
|
75
|
+
id: string;
|
|
76
|
+
objectId?: number;
|
|
77
|
+
connectionPoints: Map<string, ConnectionPoint>;
|
|
78
|
+
segments: Map<string, Segment>;
|
|
79
|
+
annotationType: AnnotationType;
|
|
80
|
+
title: string;
|
|
81
|
+
property: AnnotationProperty;
|
|
82
|
+
isSelected: boolean;
|
|
83
|
+
isEditing: boolean;
|
|
84
|
+
isVisible: boolean;
|
|
85
|
+
parentId?: string;
|
|
86
|
+
childrenIds: string[];
|
|
87
|
+
direction?: number;
|
|
88
|
+
style?: ShapeStyle;
|
|
89
|
+
createTime: Date;
|
|
90
|
+
updateTime: Date;
|
|
91
|
+
version: number;
|
|
92
|
+
}
|
|
93
|
+
export interface ShapeStyle {
|
|
94
|
+
fillColor?: string;
|
|
95
|
+
strokeColor?: string;
|
|
96
|
+
strokeWidth?: number;
|
|
97
|
+
opacity?: number;
|
|
98
|
+
pattern?: "solid" | "dashed" | "dotted";
|
|
99
|
+
}
|
|
100
|
+
export declare enum ShapeOperationType {
|
|
101
|
+
CREATE = "create",
|
|
102
|
+
UPDATE = "update",
|
|
103
|
+
DELETE = "delete",
|
|
104
|
+
BREAK_SEGMENT = "breakSegment",
|
|
105
|
+
SNAP_TO_POINT = "snapToPoint",
|
|
106
|
+
DRAG_POINT = "dragPoint",
|
|
107
|
+
CONNECT_SEGMENTS = "connectSegments",
|
|
108
|
+
SPLIT_SHAPE = "splitShape",
|
|
109
|
+
MERGE_SHAPE = "mergeShape"
|
|
110
|
+
}
|
|
111
|
+
export interface ShapeOperation {
|
|
112
|
+
type: ShapeOperationType;
|
|
113
|
+
shapeId: string;
|
|
114
|
+
timestamp: Date;
|
|
115
|
+
data: unknown;
|
|
116
|
+
inverse?: ShapeOperation;
|
|
117
|
+
}
|
|
118
|
+
export interface AnnotationManager {
|
|
119
|
+
createShape(type: AnnotationType, points: Point[]): ClosedShape;
|
|
120
|
+
updateShape(id: string, updates: Partial<ClosedShape>): void;
|
|
121
|
+
deleteShape(id: string): void;
|
|
122
|
+
breakSegment(segmentId: string, breakPoint: Point): {
|
|
123
|
+
newSegments: [Segment, Segment];
|
|
124
|
+
newConnectionPoint: ConnectionPoint;
|
|
125
|
+
};
|
|
126
|
+
dragConnectionPoint(pointId: string, newPosition: Point): void;
|
|
127
|
+
snapToNearestPoint(position: Point, snapRadius?: number): ConnectionPoint | null;
|
|
128
|
+
connectSegmentEndpoints(segmentId1: string, segmentId2: string): ConnectionPoint;
|
|
129
|
+
setAnnotationType(shapeId: string, type: AnnotationType): void;
|
|
130
|
+
updateProperty(shapeId: string, property: Partial<AnnotationProperty>): void;
|
|
131
|
+
getTitleOptions(type: AnnotationType): string[];
|
|
132
|
+
setTitle(shapeId: string, title: string): void;
|
|
133
|
+
getShape(id: string): ClosedShape | null;
|
|
134
|
+
getShapesByType(type: AnnotationType): ClosedShape[];
|
|
135
|
+
getSelectedShapes(): ClosedShape[];
|
|
136
|
+
getConnectionPointsInRadius(position: Point, radius: number): ConnectionPoint[];
|
|
137
|
+
getSnappablePoints(): ConnectionPoint[];
|
|
138
|
+
on(event: string, callback: (data: unknown) => void): void;
|
|
139
|
+
off(event: string, callback: (data: unknown) => void): void;
|
|
140
|
+
emit(event: string, data: unknown): void;
|
|
141
|
+
undo(): void;
|
|
142
|
+
redo(): void;
|
|
143
|
+
canUndo(): boolean;
|
|
144
|
+
canRedo(): boolean;
|
|
145
|
+
}
|
|
146
|
+
export interface AnnotationConfig {
|
|
147
|
+
titleConfigs: Record<AnnotationType, AnnotationTitleConfig>;
|
|
148
|
+
defaultStyles: Record<AnnotationType, ShapeStyle>;
|
|
149
|
+
operationSettings: {
|
|
150
|
+
enableAutoSnap: boolean;
|
|
151
|
+
snapDistance: number;
|
|
152
|
+
minSegmentLength: number;
|
|
153
|
+
enableRealTimeValidation: boolean;
|
|
154
|
+
breakPointTolerance: number;
|
|
155
|
+
connectionPointSize: number;
|
|
156
|
+
};
|
|
157
|
+
snapSettings: {
|
|
158
|
+
enabled: boolean;
|
|
159
|
+
defaultRadius: number;
|
|
160
|
+
visualFeedback: boolean;
|
|
161
|
+
snapTypes: ("endpoint" | "control" | "midpoint" | "intersection")[];
|
|
162
|
+
};
|
|
163
|
+
}
|
|
164
|
+
export interface ShapeEvent {
|
|
165
|
+
type: string;
|
|
166
|
+
shape: ClosedShape;
|
|
167
|
+
operation?: ShapeOperation;
|
|
168
|
+
mouse?: {
|
|
169
|
+
position: Point;
|
|
170
|
+
button: number;
|
|
171
|
+
};
|
|
172
|
+
}
|
|
173
|
+
export interface AnnotationValidator {
|
|
174
|
+
validateShape(shape: ClosedShape): ValidationResult;
|
|
175
|
+
validateProperty(property: AnnotationProperty): ValidationResult;
|
|
176
|
+
validateOperation(operation: ShapeOperation): ValidationResult;
|
|
177
|
+
}
|
|
178
|
+
export interface ValidationResult {
|
|
179
|
+
isValid: boolean;
|
|
180
|
+
errors: string[];
|
|
181
|
+
warnings: string[];
|
|
182
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { BaseViewer, Plugin, PluginConfig } from "../../core";
|
|
2
|
+
/**
|
|
3
|
+
* AxisGizmo plugin config.
|
|
4
|
+
*/
|
|
5
|
+
export interface AxisGizmoPluginConfig extends Partial<PluginConfig> {
|
|
6
|
+
/**
|
|
7
|
+
* UI element id to contain the plugin.
|
|
8
|
+
*/
|
|
9
|
+
containerId?: string;
|
|
10
|
+
/**
|
|
11
|
+
* Ignores z-axis. It is useful for DxfViewer.
|
|
12
|
+
*/
|
|
13
|
+
ignoreZAxis: boolean;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* This renderer monitors the host renderer's camera, and keeps a coordinate axes
|
|
17
|
+
* the same direction as host renderer's
|
|
18
|
+
*/
|
|
19
|
+
export declare class AxisGizmoPlugin extends Plugin {
|
|
20
|
+
static DEFAULT_ID: string;
|
|
21
|
+
private cfg;
|
|
22
|
+
private hostCamera?;
|
|
23
|
+
private container?;
|
|
24
|
+
private coordinateAxes?;
|
|
25
|
+
private ignoreZAxis;
|
|
26
|
+
private camera?;
|
|
27
|
+
private scene?;
|
|
28
|
+
private renderer?;
|
|
29
|
+
private css2dRenderer?;
|
|
30
|
+
constructor(viewer: BaseViewer, cfg: AxisGizmoPluginConfig);
|
|
31
|
+
private init;
|
|
32
|
+
private initRenderer;
|
|
33
|
+
private initScene;
|
|
34
|
+
/**
|
|
35
|
+
* Sets hostCamera in case it is changed.
|
|
36
|
+
* It is possible for a viewer to switch camera between a OrthographicCamera and a PerspectiveCamera.
|
|
37
|
+
*/
|
|
38
|
+
private setHostCamera;
|
|
39
|
+
private render;
|
|
40
|
+
private animate;
|
|
41
|
+
private update;
|
|
42
|
+
/**
|
|
43
|
+
* Update axes according to camera direction.
|
|
44
|
+
* Camera's direction is the only input factor for this class. It always look at the origin.
|
|
45
|
+
* @param direction
|
|
46
|
+
*/
|
|
47
|
+
private updateCameraDirection;
|
|
48
|
+
destroy(): void;
|
|
49
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import * as THREE from "three";
|
|
2
|
+
import { CSS2DObject } from "three/examples/jsm/renderers/CSS2DRenderer.js";
|
|
3
|
+
export declare class CoordinateAxes extends THREE.Object3D {
|
|
4
|
+
name: string;
|
|
5
|
+
private readonly AXIS_LENGTH;
|
|
6
|
+
private readonly AXIS_COLOR_X;
|
|
7
|
+
private readonly AXIS_COLOR_Y;
|
|
8
|
+
private readonly AXIS_COLOR_Z;
|
|
9
|
+
constructor(addTexts?: boolean, ignoreZAxis?: boolean);
|
|
10
|
+
addTexts(ignoreZAxis?: boolean): void;
|
|
11
|
+
createText(text: string, color: string, size?: number): CSS2DObject;
|
|
12
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./AxisGizmoPlugin";
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { Tooltip } from "../../components/tool-tip";
|
|
2
|
+
import { IconClass } from "../../core";
|
|
3
|
+
import { BaseViewer } from "../../core/viewers/BaseViewer";
|
|
4
|
+
import { Plugin } from "../../core/viewers/Plugin";
|
|
5
|
+
declare enum BottomBarItemId {
|
|
6
|
+
statistics = "dxfview-statistics",
|
|
7
|
+
cameraInfo = "dxfview-cameraInfo",
|
|
8
|
+
tips = "dxfview-tips"
|
|
9
|
+
}
|
|
10
|
+
interface BottomBarItemConfig {
|
|
11
|
+
icon: IconClass;
|
|
12
|
+
mutexIds?: BottomBarItemId[];
|
|
13
|
+
onActive?: (item: BottomBarItem) => void;
|
|
14
|
+
onDeactive?: (item: BottomBarItem) => void;
|
|
15
|
+
onClick?: (item: BottomBarItem) => void;
|
|
16
|
+
onUpdate?: (item: BottomBarItem) => void;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Bottom bar plugin is a debug tool for developers.
|
|
20
|
+
*/
|
|
21
|
+
export declare class BottomBarPlugin extends Plugin {
|
|
22
|
+
private element;
|
|
23
|
+
itemList: Map<string, BottomBarItem>;
|
|
24
|
+
constructor(viewer: BaseViewer);
|
|
25
|
+
update(): void;
|
|
26
|
+
private init;
|
|
27
|
+
private createItem;
|
|
28
|
+
}
|
|
29
|
+
declare class BottomBarItem {
|
|
30
|
+
readonly viewer: BaseViewer;
|
|
31
|
+
private readonly bottomBar;
|
|
32
|
+
protected readonly menuId: string;
|
|
33
|
+
protected cfg: BottomBarItemConfig;
|
|
34
|
+
private eventBus;
|
|
35
|
+
private itemconfig;
|
|
36
|
+
tooltip: Tooltip;
|
|
37
|
+
element: HTMLElement;
|
|
38
|
+
active: boolean;
|
|
39
|
+
constructor(viewer: BaseViewer, bottomBar: BottomBarPlugin, menuId: string, cfg: BottomBarItemConfig);
|
|
40
|
+
private createButton;
|
|
41
|
+
setActive(active: boolean): void;
|
|
42
|
+
update(): void;
|
|
43
|
+
}
|
|
44
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./BottomBarPlugin";
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import * as THREE from "three";
|
|
2
|
+
import type { InternalFrame } from "./types";
|
|
3
|
+
import type { BaseViewer } from "../../core/viewers";
|
|
4
|
+
/**
|
|
5
|
+
* 覆盖层管理器 - 负责管理用于伪显隐功能的InstancedMesh覆盖层
|
|
6
|
+
* 通过在图框上方放置可缩放的平面网格来实现内容的显示/隐藏效果
|
|
7
|
+
* 支持图形和文字的统一遮罩
|
|
8
|
+
*/
|
|
9
|
+
export declare class CoverLayerManager {
|
|
10
|
+
private coverMesh?;
|
|
11
|
+
private coverGeometry?;
|
|
12
|
+
private coverMaterial?;
|
|
13
|
+
private viewer;
|
|
14
|
+
/**
|
|
15
|
+
* 构造覆盖层管理器
|
|
16
|
+
* @param viewer 3D查看器实例,用于触发渲染更新
|
|
17
|
+
*/
|
|
18
|
+
constructor(viewer: BaseViewer);
|
|
19
|
+
/**
|
|
20
|
+
* 创建覆盖层 - 为每个图框创建对应的覆盖实例
|
|
21
|
+
* 使用InstancedMesh技术高效渲染多个覆盖平面
|
|
22
|
+
* @param outlineGroup 图框轮廓组,覆盖层将添加到此组中
|
|
23
|
+
* @param frames 图框列表,每个图框对应一个覆盖实例
|
|
24
|
+
*/
|
|
25
|
+
createCoverLayer(outlineGroup: THREE.Group, frames: InternalFrame[]): void;
|
|
26
|
+
/**
|
|
27
|
+
* 设置指定覆盖层实例的可见性
|
|
28
|
+
* 通过调整变换矩阵的缩放值来实现显示/隐藏效果
|
|
29
|
+
* @param frames 图框列表
|
|
30
|
+
* @param instanceIndex 实例索引
|
|
31
|
+
* @param visible true=显示覆盖层(隐藏内容), false=隐藏覆盖层(显示内容)
|
|
32
|
+
*/
|
|
33
|
+
setCoverVisible(frames: InternalFrame[], instanceIndex: number, visible: boolean): void;
|
|
34
|
+
/**
|
|
35
|
+
* 清理覆盖层资源
|
|
36
|
+
* 释放几何体和材质内存,防止内存泄漏
|
|
37
|
+
*/
|
|
38
|
+
clearResources(): void;
|
|
39
|
+
/**
|
|
40
|
+
* 获取覆盖层网格实例
|
|
41
|
+
* @returns InstancedMesh实例或undefined
|
|
42
|
+
*/
|
|
43
|
+
getCoverMesh(): THREE.InstancedMesh | undefined;
|
|
44
|
+
}
|