@mlightcad/cad-simple-viewer 1.4.13 → 1.5.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/dist/index.js +16972 -11328
- package/dist/index.umd.cjs +158 -34
- package/dist/libredwg-parser-worker.js +4828 -4464
- package/dist/mtext-renderer-worker.js +3587 -3534
- package/lib/app/AcApDocManager.d.ts +14 -5
- package/lib/app/AcApDocManager.d.ts.map +1 -1
- package/lib/app/AcApDocManager.js +62 -19
- package/lib/app/AcApDocManager.js.map +1 -1
- package/lib/command/AcApLogCmd.d.ts +1 -1
- package/lib/command/AcApLogCmd.d.ts.map +1 -1
- package/lib/command/AcApLogCmd.js +1 -1
- package/lib/command/AcApLogCmd.js.map +1 -1
- package/lib/command/AcApOpenCmd.d.ts +1 -1
- package/lib/command/AcApOpenCmd.d.ts.map +1 -1
- package/lib/command/AcApOpenCmd.js +1 -2
- package/lib/command/AcApOpenCmd.js.map +1 -1
- package/lib/command/AcApPanCmd.d.ts +1 -1
- package/lib/command/AcApPanCmd.d.ts.map +1 -1
- package/lib/command/AcApPanCmd.js +1 -2
- package/lib/command/AcApPanCmd.js.map +1 -1
- package/lib/command/AcApQNewCmd.d.ts +1 -1
- package/lib/command/AcApQNewCmd.d.ts.map +1 -1
- package/lib/command/AcApQNewCmd.js +1 -1
- package/lib/command/AcApQNewCmd.js.map +1 -1
- package/lib/command/AcApRegenCmd.d.ts +1 -1
- package/lib/command/AcApRegenCmd.d.ts.map +1 -1
- package/lib/command/AcApRegenCmd.js +1 -1
- package/lib/command/AcApRegenCmd.js.map +1 -1
- package/lib/command/AcApSelectCmd.d.ts +1 -1
- package/lib/command/AcApSelectCmd.d.ts.map +1 -1
- package/lib/command/AcApSelectCmd.js +1 -2
- package/lib/command/AcApSelectCmd.js.map +1 -1
- package/lib/command/{AcApConvertToDxfCmd.d.ts → convert/AcApConvertToDxfCmd.d.ts} +2 -2
- package/lib/command/convert/AcApConvertToDxfCmd.d.ts.map +1 -0
- package/lib/command/{AcApConvertToDxfCmd.js → convert/AcApConvertToDxfCmd.js} +1 -1
- package/lib/command/convert/AcApConvertToDxfCmd.js.map +1 -0
- package/lib/command/{AcApConvertToPngCmd.d.ts → convert/AcApConvertToPngCmd.d.ts} +23 -5
- package/lib/command/convert/AcApConvertToPngCmd.d.ts.map +1 -0
- package/lib/command/{AcApConvertToPngCmd.js → convert/AcApConvertToPngCmd.js} +88 -15
- package/lib/command/convert/AcApConvertToPngCmd.js.map +1 -0
- package/lib/command/{AcApConvertToSvgCmd.d.ts → convert/AcApConvertToSvgCmd.d.ts} +2 -2
- package/lib/command/convert/AcApConvertToSvgCmd.d.ts.map +1 -0
- package/lib/command/{AcApConvertToSvgCmd.js → convert/AcApConvertToSvgCmd.js} +1 -1
- package/lib/command/convert/AcApConvertToSvgCmd.js.map +1 -0
- package/lib/command/convert/AcApDxfConvertor.d.ts.map +1 -0
- package/lib/command/{AcApDxfConvertor.js → convert/AcApDxfConvertor.js} +1 -1
- package/lib/command/convert/AcApDxfConvertor.js.map +1 -0
- package/lib/command/{AcApPngConvertor.d.ts → convert/AcApPngConvertor.d.ts} +20 -35
- package/lib/command/convert/AcApPngConvertor.d.ts.map +1 -0
- package/lib/command/{AcApPngConvertor.js → convert/AcApPngConvertor.js} +99 -71
- package/lib/command/convert/AcApPngConvertor.js.map +1 -0
- package/lib/command/convert/AcApSvgConvertor.d.ts.map +1 -0
- package/lib/command/{AcApSvgConvertor.js → convert/AcApSvgConvertor.js} +1 -1
- package/lib/command/convert/AcApSvgConvertor.js.map +1 -0
- package/lib/command/convert/index.d.ts +6 -0
- package/lib/command/convert/index.d.ts.map +1 -0
- package/lib/command/convert/index.js +6 -0
- package/lib/command/convert/index.js.map +1 -0
- package/lib/command/draw/AcApArcCmd.d.ts +297 -0
- package/lib/command/draw/AcApArcCmd.d.ts.map +1 -0
- package/lib/command/{AcApArcCmd.js → draw/AcApArcCmd.js} +793 -12
- package/lib/command/draw/AcApArcCmd.js.map +1 -0
- package/lib/command/{AcApCircleCmd.d.ts → draw/AcApCircleCmd.d.ts} +2 -2
- package/lib/command/draw/AcApCircleCmd.d.ts.map +1 -0
- package/lib/command/{AcApCircleCmd.js → draw/AcApCircleCmd.js} +3 -3
- package/lib/command/draw/AcApCircleCmd.js.map +1 -0
- package/lib/command/{AcApDimLinearCmd.d.ts → draw/AcApDimLinearCmd.d.ts} +2 -2
- package/lib/command/draw/AcApDimLinearCmd.d.ts.map +1 -0
- package/lib/command/{AcApDimLinearCmd.js → draw/AcApDimLinearCmd.js} +3 -3
- package/lib/command/draw/AcApDimLinearCmd.js.map +1 -0
- package/lib/command/{AcApEllipseCmd.d.ts → draw/AcApEllipseCmd.d.ts} +2 -2
- package/lib/command/draw/AcApEllipseCmd.d.ts.map +1 -0
- package/lib/command/{AcApEllipseCmd.js → draw/AcApEllipseCmd.js} +3 -3
- package/lib/command/draw/AcApEllipseCmd.js.map +1 -0
- package/lib/command/{AcApHatchCmd.d.ts → draw/AcApHatchCmd.d.ts} +54 -17
- package/lib/command/draw/AcApHatchCmd.d.ts.map +1 -0
- package/lib/command/{AcApHatchCmd.js → draw/AcApHatchCmd.js} +122 -30
- package/lib/command/draw/AcApHatchCmd.js.map +1 -0
- package/lib/command/{AcApLineCmd.d.ts → draw/AcApLineCmd.d.ts} +2 -2
- package/lib/command/draw/AcApLineCmd.d.ts.map +1 -0
- package/lib/command/{AcApLineCmd.js → draw/AcApLineCmd.js} +3 -3
- package/lib/command/draw/AcApLineCmd.js.map +1 -0
- package/lib/command/draw/AcApMLineCmd.d.ts +31 -0
- package/lib/command/draw/AcApMLineCmd.d.ts.map +1 -0
- package/lib/command/draw/AcApMLineCmd.js +531 -0
- package/lib/command/draw/AcApMLineCmd.js.map +1 -0
- package/lib/command/{AcApMTextCmd.d.ts → draw/AcApMTextCmd.d.ts} +2 -2
- package/lib/command/draw/AcApMTextCmd.d.ts.map +1 -0
- package/lib/command/{AcApMTextCmd.js → draw/AcApMTextCmd.js} +3 -3
- package/lib/command/draw/AcApMTextCmd.js.map +1 -0
- package/lib/command/draw/AcApPointCmd.d.ts +16 -0
- package/lib/command/draw/AcApPointCmd.d.ts.map +1 -0
- package/lib/command/draw/AcApPointCmd.js +98 -0
- package/lib/command/draw/AcApPointCmd.js.map +1 -0
- package/lib/command/{AcApPolygonCmd.d.ts → draw/AcApPolygonCmd.d.ts} +2 -2
- package/lib/command/draw/AcApPolygonCmd.d.ts.map +1 -0
- package/lib/command/{AcApPolygonCmd.js → draw/AcApPolygonCmd.js} +3 -3
- package/lib/command/draw/AcApPolygonCmd.js.map +1 -0
- package/lib/command/{AcApPolylineCmd.d.ts → draw/AcApPolylineCmd.d.ts} +2 -2
- package/lib/command/draw/AcApPolylineCmd.d.ts.map +1 -0
- package/lib/command/{AcApPolylineCmd.js → draw/AcApPolylineCmd.js} +3 -3
- package/lib/command/draw/AcApPolylineCmd.js.map +1 -0
- package/lib/command/draw/AcApRayCmd.d.ts +10 -0
- package/lib/command/draw/AcApRayCmd.d.ts.map +1 -0
- package/lib/command/draw/AcApRayCmd.js +145 -0
- package/lib/command/draw/AcApRayCmd.js.map +1 -0
- package/lib/command/{AcApRectCmd.d.ts → draw/AcApRectCmd.d.ts} +2 -2
- package/lib/command/draw/AcApRectCmd.d.ts.map +1 -0
- package/lib/command/{AcApRectCmd.js → draw/AcApRectCmd.js} +3 -3
- package/lib/command/draw/AcApRectCmd.js.map +1 -0
- package/lib/command/{AcApSplineCmd.d.ts → draw/AcApSplineCmd.d.ts} +2 -2
- package/lib/command/draw/AcApSplineCmd.d.ts.map +1 -0
- package/lib/command/{AcApSplineCmd.js → draw/AcApSplineCmd.js} +3 -3
- package/lib/command/draw/AcApSplineCmd.js.map +1 -0
- package/lib/command/draw/AcApXLineCmd.d.ts +25 -0
- package/lib/command/draw/AcApXLineCmd.d.ts.map +1 -0
- package/lib/command/draw/AcApXLineCmd.js +210 -0
- package/lib/command/draw/AcApXLineCmd.js.map +1 -0
- package/lib/command/draw/index.d.ts +16 -0
- package/lib/command/draw/index.d.ts.map +1 -0
- package/lib/command/draw/index.js +16 -0
- package/lib/command/draw/index.js.map +1 -0
- package/lib/command/index.d.ts +6 -32
- package/lib/command/index.d.ts.map +1 -1
- package/lib/command/index.js +6 -32
- package/lib/command/index.js.map +1 -1
- package/lib/command/layer/AcApLayerCloseCmd.d.ts +23 -0
- package/lib/command/layer/AcApLayerCloseCmd.d.ts.map +1 -0
- package/lib/command/layer/AcApLayerCloseCmd.js +86 -0
- package/lib/command/layer/AcApLayerCloseCmd.js.map +1 -0
- package/lib/command/{AcApLayerCmd.d.ts → layer/AcApLayerCmd.d.ts} +3 -5
- package/lib/command/layer/AcApLayerCmd.d.ts.map +1 -0
- package/lib/command/{AcApLayerCmd.js → layer/AcApLayerCmd.js} +5 -8
- package/lib/command/layer/AcApLayerCmd.js.map +1 -0
- package/lib/command/layer/AcApLayerCurCmd.d.ts +43 -0
- package/lib/command/layer/AcApLayerCurCmd.d.ts.map +1 -0
- package/lib/command/layer/AcApLayerCurCmd.js +183 -0
- package/lib/command/layer/AcApLayerCurCmd.js.map +1 -0
- package/lib/command/layer/AcApLayerDelCmd.d.ts +112 -0
- package/lib/command/layer/AcApLayerDelCmd.d.ts.map +1 -0
- package/lib/command/layer/AcApLayerDelCmd.js +446 -0
- package/lib/command/layer/AcApLayerDelCmd.js.map +1 -0
- package/lib/command/layer/AcApLayerFreezeCmd.d.ts +103 -0
- package/lib/command/layer/AcApLayerFreezeCmd.d.ts.map +1 -0
- package/lib/command/layer/AcApLayerFreezeCmd.js +398 -0
- package/lib/command/layer/AcApLayerFreezeCmd.js.map +1 -0
- package/lib/command/layer/AcApLayerIsoCmd.d.ts +99 -0
- package/lib/command/layer/AcApLayerIsoCmd.d.ts.map +1 -0
- package/lib/command/layer/AcApLayerIsoCmd.js +485 -0
- package/lib/command/layer/AcApLayerIsoCmd.js.map +1 -0
- package/lib/command/layer/AcApLayerIsoState.d.ts +68 -0
- package/lib/command/layer/AcApLayerIsoState.d.ts.map +1 -0
- package/lib/command/layer/AcApLayerIsoState.js +53 -0
- package/lib/command/layer/AcApLayerIsoState.js.map +1 -0
- package/lib/command/layer/AcApLayerLockCmd.d.ts +50 -0
- package/lib/command/layer/AcApLayerLockCmd.d.ts.map +1 -0
- package/lib/command/layer/AcApLayerLockCmd.js +175 -0
- package/lib/command/layer/AcApLayerLockCmd.js.map +1 -0
- package/lib/command/layer/AcApLayerOffCmd.d.ts +95 -0
- package/lib/command/layer/AcApLayerOffCmd.d.ts.map +1 -0
- package/lib/command/layer/AcApLayerOffCmd.js +384 -0
- package/lib/command/layer/AcApLayerOffCmd.js.map +1 -0
- package/lib/command/layer/AcApLayerOnCmd.d.ts +30 -0
- package/lib/command/layer/AcApLayerOnCmd.d.ts.map +1 -0
- package/lib/command/layer/AcApLayerOnCmd.js +138 -0
- package/lib/command/layer/AcApLayerOnCmd.js.map +1 -0
- package/lib/command/layer/AcApLayerPCmd.d.ts +83 -0
- package/lib/command/layer/AcApLayerPCmd.d.ts.map +1 -0
- package/lib/command/layer/AcApLayerPCmd.js +241 -0
- package/lib/command/layer/AcApLayerPCmd.js.map +1 -0
- package/lib/command/layer/AcApLayerThawCmd.d.ts +37 -0
- package/lib/command/layer/AcApLayerThawCmd.d.ts.map +1 -0
- package/lib/command/layer/AcApLayerThawCmd.js +150 -0
- package/lib/command/layer/AcApLayerThawCmd.js.map +1 -0
- package/lib/command/layer/AcApLayerUnisoCmd.d.ts +52 -0
- package/lib/command/layer/AcApLayerUnisoCmd.d.ts.map +1 -0
- package/lib/command/layer/AcApLayerUnisoCmd.js +199 -0
- package/lib/command/layer/AcApLayerUnisoCmd.js.map +1 -0
- package/lib/command/layer/AcApLayerUnlockCmd.d.ts +50 -0
- package/lib/command/layer/AcApLayerUnlockCmd.d.ts.map +1 -0
- package/lib/command/layer/AcApLayerUnlockCmd.js +175 -0
- package/lib/command/layer/AcApLayerUnlockCmd.js.map +1 -0
- package/lib/command/layer/index.d.ts +14 -0
- package/lib/command/layer/index.d.ts.map +1 -0
- package/lib/command/layer/index.js +14 -0
- package/lib/command/layer/index.js.map +1 -0
- package/lib/command/{AcApClearMeasurementsCmd.d.ts → measure/AcApClearMeasurementsCmd.d.ts} +2 -2
- package/lib/command/measure/AcApClearMeasurementsCmd.d.ts.map +1 -0
- package/lib/command/{AcApClearMeasurementsCmd.js → measure/AcApClearMeasurementsCmd.js} +1 -1
- package/lib/command/measure/AcApClearMeasurementsCmd.js.map +1 -0
- package/lib/command/{AcApMeasureAngleCmd.d.ts → measure/AcApMeasureAngleCmd.d.ts} +2 -2
- package/lib/command/measure/AcApMeasureAngleCmd.d.ts.map +1 -0
- package/lib/command/{AcApMeasureAngleCmd.js → measure/AcApMeasureAngleCmd.js} +3 -3
- package/lib/command/measure/AcApMeasureAngleCmd.js.map +1 -0
- package/lib/command/{AcApMeasureArcCmd.d.ts → measure/AcApMeasureArcCmd.d.ts} +2 -2
- package/lib/command/measure/AcApMeasureArcCmd.d.ts.map +1 -0
- package/lib/command/{AcApMeasureArcCmd.js → measure/AcApMeasureArcCmd.js} +3 -3
- package/lib/command/measure/AcApMeasureArcCmd.js.map +1 -0
- package/lib/command/{AcApMeasureAreaCmd.d.ts → measure/AcApMeasureAreaCmd.d.ts} +2 -2
- package/lib/command/measure/AcApMeasureAreaCmd.d.ts.map +1 -0
- package/lib/command/{AcApMeasureAreaCmd.js → measure/AcApMeasureAreaCmd.js} +3 -3
- package/lib/command/measure/AcApMeasureAreaCmd.js.map +1 -0
- package/lib/command/{AcApMeasureDistanceCmd.d.ts → measure/AcApMeasureDistanceCmd.d.ts} +2 -2
- package/lib/command/measure/AcApMeasureDistanceCmd.d.ts.map +1 -0
- package/lib/command/{AcApMeasureDistanceCmd.js → measure/AcApMeasureDistanceCmd.js} +3 -3
- package/lib/command/measure/AcApMeasureDistanceCmd.js.map +1 -0
- package/lib/command/measure/index.d.ts +6 -0
- package/lib/command/measure/index.d.ts.map +1 -0
- package/lib/command/measure/index.js +6 -0
- package/lib/command/measure/index.js.map +1 -0
- package/lib/command/modify/AcApCopyCmd.d.ts +94 -0
- package/lib/command/modify/AcApCopyCmd.d.ts.map +1 -0
- package/lib/command/modify/AcApCopyCmd.js +549 -0
- package/lib/command/modify/AcApCopyCmd.js.map +1 -0
- package/lib/command/{AcApEraseCmd.d.ts → modify/AcApEraseCmd.d.ts} +2 -2
- package/lib/command/modify/AcApEraseCmd.d.ts.map +1 -0
- package/lib/command/{AcApEraseCmd.js → modify/AcApEraseCmd.js} +3 -5
- package/lib/command/modify/AcApEraseCmd.js.map +1 -0
- package/lib/command/{AcApMoveCmd.d.ts → modify/AcApMoveCmd.d.ts} +2 -2
- package/lib/command/modify/AcApMoveCmd.d.ts.map +1 -0
- package/lib/command/{AcApMoveCmd.js → modify/AcApMoveCmd.js} +3 -4
- package/lib/command/modify/AcApMoveCmd.js.map +1 -0
- package/lib/command/modify/AcApRotateCmd.d.ts +81 -0
- package/lib/command/modify/AcApRotateCmd.d.ts.map +1 -0
- package/lib/command/modify/AcApRotateCmd.js +487 -0
- package/lib/command/modify/AcApRotateCmd.js.map +1 -0
- package/lib/command/modify/index.d.ts +5 -0
- package/lib/command/modify/index.d.ts.map +1 -0
- package/lib/command/modify/index.js +5 -0
- package/lib/command/modify/index.js.map +1 -0
- package/lib/command/{AcApBaseRevCmd.d.ts → review/AcApBaseRevCmd.d.ts} +2 -2
- package/lib/command/review/AcApBaseRevCmd.d.ts.map +1 -0
- package/lib/command/{AcApBaseRevCmd.js → review/AcApBaseRevCmd.js} +2 -2
- package/lib/command/review/AcApBaseRevCmd.js.map +1 -0
- package/lib/command/{AcApRevCircleCmd.d.ts → review/AcApRevCircleCmd.d.ts} +1 -1
- package/lib/command/review/AcApRevCircleCmd.d.ts.map +1 -0
- package/lib/command/{AcApRevCircleCmd.js → review/AcApRevCircleCmd.js} +4 -4
- package/lib/command/review/AcApRevCircleCmd.js.map +1 -0
- package/lib/command/{AcApRevCloudCmd.d.ts → review/AcApRevCloudCmd.d.ts} +2 -2
- package/lib/command/review/AcApRevCloudCmd.d.ts.map +1 -0
- package/lib/command/{AcApRevCloudCmd.js → review/AcApRevCloudCmd.js} +3 -3
- package/lib/command/review/AcApRevCloudCmd.js.map +1 -0
- package/lib/command/{AcApRevRectCmd.d.ts → review/AcApRevRectCmd.d.ts} +1 -1
- package/lib/command/review/AcApRevRectCmd.d.ts.map +1 -0
- package/lib/command/{AcApRevRectCmd.js → review/AcApRevRectCmd.js} +3 -3
- package/lib/command/review/AcApRevRectCmd.js.map +1 -0
- package/lib/command/{AcApRevVisibilityCmd.d.ts → review/AcApRevVisibilityCmd.d.ts} +1 -1
- package/lib/command/review/AcApRevVisibilityCmd.d.ts.map +1 -0
- package/lib/command/{AcApRevVisibilityCmd.js → review/AcApRevVisibilityCmd.js} +2 -2
- package/lib/command/review/AcApRevVisibilityCmd.js.map +1 -0
- package/lib/command/{AcApSketchCmd.d.ts → review/AcApSketchCmd.d.ts} +2 -2
- package/lib/command/review/AcApSketchCmd.d.ts.map +1 -0
- package/lib/command/{AcApSketchCmd.js → review/AcApSketchCmd.js} +3 -3
- package/lib/command/review/AcApSketchCmd.js.map +1 -0
- package/lib/command/review/index.d.ts +7 -0
- package/lib/command/review/index.d.ts.map +1 -0
- package/lib/command/review/index.js +7 -0
- package/lib/command/review/index.js.map +1 -0
- package/lib/editor/global/eventBus.d.ts +4 -6
- package/lib/editor/global/eventBus.d.ts.map +1 -1
- package/lib/editor/global/eventBus.js.map +1 -1
- package/lib/editor/input/AcEditor.d.ts +17 -0
- package/lib/editor/input/AcEditor.d.ts.map +1 -1
- package/lib/editor/input/AcEditor.js +23 -0
- package/lib/editor/input/AcEditor.js.map +1 -1
- package/lib/editor/input/prompt/AcEdPromptBoxOptions.d.ts +6 -0
- package/lib/editor/input/prompt/AcEdPromptBoxOptions.d.ts.map +1 -1
- package/lib/editor/input/prompt/AcEdPromptBoxOptions.js +16 -0
- package/lib/editor/input/prompt/AcEdPromptBoxOptions.js.map +1 -1
- package/lib/editor/input/prompt/AcEdPromptPointOptions.d.ts +6 -0
- package/lib/editor/input/prompt/AcEdPromptPointOptions.d.ts.map +1 -1
- package/lib/editor/input/prompt/AcEdPromptPointOptions.js +16 -0
- package/lib/editor/input/prompt/AcEdPromptPointOptions.js.map +1 -1
- package/lib/editor/input/ui/AcEdCommandLine.d.ts +25 -23
- package/lib/editor/input/ui/AcEdCommandLine.d.ts.map +1 -1
- package/lib/editor/input/ui/AcEdCommandLine.js +101 -43
- package/lib/editor/input/ui/AcEdCommandLine.js.map +1 -1
- package/lib/editor/input/ui/AcEdFloatingInput.d.ts.map +1 -1
- package/lib/editor/input/ui/AcEdFloatingInput.js +4 -2
- package/lib/editor/input/ui/AcEdFloatingInput.js.map +1 -1
- package/lib/editor/input/ui/AcEdInputManager.d.ts +21 -0
- package/lib/editor/input/ui/AcEdInputManager.d.ts.map +1 -1
- package/lib/editor/input/ui/AcEdInputManager.js +34 -4
- package/lib/editor/input/ui/AcEdInputManager.js.map +1 -1
- package/lib/editor/input/ui/AcEdMessageType.d.ts +10 -0
- package/lib/editor/input/ui/AcEdMessageType.d.ts.map +1 -0
- package/lib/editor/input/ui/AcEdMessageType.js +2 -0
- package/lib/editor/input/ui/AcEdMessageType.js.map +1 -0
- package/lib/editor/input/ui/index.d.ts +1 -0
- package/lib/editor/input/ui/index.d.ts.map +1 -1
- package/lib/editor/input/ui/index.js +1 -0
- package/lib/editor/input/ui/index.js.map +1 -1
- package/lib/editor/view/AcEdBaseView.d.ts +3 -8
- package/lib/editor/view/AcEdBaseView.d.ts.map +1 -1
- package/lib/editor/view/AcEdBaseView.js +3 -5
- package/lib/editor/view/AcEdBaseView.js.map +1 -1
- package/lib/editor/view/AcEdHoverController.d.ts +2 -3
- package/lib/editor/view/AcEdHoverController.d.ts.map +1 -1
- package/lib/editor/view/AcEdHoverController.js +7 -0
- package/lib/editor/view/AcEdHoverController.js.map +1 -1
- package/lib/editor/view/AcEdSelectionAction.d.ts +108 -0
- package/lib/editor/view/AcEdSelectionAction.d.ts.map +1 -0
- package/lib/editor/view/AcEdSelectionAction.js +74 -0
- package/lib/editor/view/AcEdSelectionAction.js.map +1 -0
- package/lib/editor/view/index.d.ts +1 -0
- package/lib/editor/view/index.d.ts.map +1 -1
- package/lib/editor/view/index.js +1 -0
- package/lib/editor/view/index.js.map +1 -1
- package/lib/i18n/en/command.d.ts +135 -15
- package/lib/i18n/en/command.d.ts.map +1 -1
- package/lib/i18n/en/command.js +144 -24
- package/lib/i18n/en/command.js.map +1 -1
- package/lib/i18n/en/jig.d.ts +571 -212
- package/lib/i18n/en/jig.d.ts.map +1 -1
- package/lib/i18n/en/jig.js +661 -302
- package/lib/i18n/en/jig.js.map +1 -1
- package/lib/i18n/zh/command.d.ts +135 -15
- package/lib/i18n/zh/command.d.ts.map +1 -1
- package/lib/i18n/zh/command.js +145 -25
- package/lib/i18n/zh/command.js.map +1 -1
- package/lib/i18n/zh/jig.d.ts +571 -212
- package/lib/i18n/zh/jig.d.ts.map +1 -1
- package/lib/i18n/zh/jig.js +660 -301
- package/lib/i18n/zh/jig.js.map +1 -1
- package/lib/spatialIndex/AcTrHierarchicalSpatialIndex.d.ts +136 -2
- package/lib/spatialIndex/AcTrHierarchicalSpatialIndex.d.ts.map +1 -1
- package/lib/spatialIndex/AcTrHierarchicalSpatialIndex.js +154 -16
- package/lib/spatialIndex/AcTrHierarchicalSpatialIndex.js.map +1 -1
- package/lib/view/AcTrLayout.d.ts +17 -0
- package/lib/view/AcTrLayout.d.ts.map +1 -1
- package/lib/view/AcTrLayout.js +34 -2
- package/lib/view/AcTrLayout.js.map +1 -1
- package/lib/view/AcTrPickResultUtil.d.ts +4 -0
- package/lib/view/AcTrPickResultUtil.d.ts.map +1 -0
- package/lib/view/AcTrPickResultUtil.js +54 -0
- package/lib/view/AcTrPickResultUtil.js.map +1 -0
- package/lib/view/AcTrView2d.d.ts +25 -0
- package/lib/view/AcTrView2d.d.ts.map +1 -1
- package/lib/view/AcTrView2d.js +225 -100
- package/lib/view/AcTrView2d.js.map +1 -1
- package/package.json +6 -6
- package/lib/command/AcApArcCmd.d.ts +0 -140
- package/lib/command/AcApArcCmd.d.ts.map +0 -1
- package/lib/command/AcApArcCmd.js.map +0 -1
- package/lib/command/AcApBaseRevCmd.d.ts.map +0 -1
- package/lib/command/AcApBaseRevCmd.js.map +0 -1
- package/lib/command/AcApCircleCmd.d.ts.map +0 -1
- package/lib/command/AcApCircleCmd.js.map +0 -1
- package/lib/command/AcApClearMeasurementsCmd.d.ts.map +0 -1
- package/lib/command/AcApClearMeasurementsCmd.js.map +0 -1
- package/lib/command/AcApConvertToDxfCmd.d.ts.map +0 -1
- package/lib/command/AcApConvertToDxfCmd.js.map +0 -1
- package/lib/command/AcApConvertToPngCmd.d.ts.map +0 -1
- package/lib/command/AcApConvertToPngCmd.js.map +0 -1
- package/lib/command/AcApConvertToSvgCmd.d.ts.map +0 -1
- package/lib/command/AcApConvertToSvgCmd.js.map +0 -1
- package/lib/command/AcApDimLinearCmd.d.ts.map +0 -1
- package/lib/command/AcApDimLinearCmd.js.map +0 -1
- package/lib/command/AcApDxfConvertor.d.ts.map +0 -1
- package/lib/command/AcApDxfConvertor.js.map +0 -1
- package/lib/command/AcApEllipseCmd.d.ts.map +0 -1
- package/lib/command/AcApEllipseCmd.js.map +0 -1
- package/lib/command/AcApEraseCmd.d.ts.map +0 -1
- package/lib/command/AcApEraseCmd.js.map +0 -1
- package/lib/command/AcApHatchCmd.d.ts.map +0 -1
- package/lib/command/AcApHatchCmd.js.map +0 -1
- package/lib/command/AcApLayerCmd.d.ts.map +0 -1
- package/lib/command/AcApLayerCmd.js.map +0 -1
- package/lib/command/AcApLineCmd.d.ts.map +0 -1
- package/lib/command/AcApLineCmd.js.map +0 -1
- package/lib/command/AcApMTextCmd.d.ts.map +0 -1
- package/lib/command/AcApMTextCmd.js.map +0 -1
- package/lib/command/AcApMeasureAngleCmd.d.ts.map +0 -1
- package/lib/command/AcApMeasureAngleCmd.js.map +0 -1
- package/lib/command/AcApMeasureArcCmd.d.ts.map +0 -1
- package/lib/command/AcApMeasureArcCmd.js.map +0 -1
- package/lib/command/AcApMeasureAreaCmd.d.ts.map +0 -1
- package/lib/command/AcApMeasureAreaCmd.js.map +0 -1
- package/lib/command/AcApMeasureDistanceCmd.d.ts.map +0 -1
- package/lib/command/AcApMeasureDistanceCmd.js.map +0 -1
- package/lib/command/AcApMoveCmd.d.ts.map +0 -1
- package/lib/command/AcApMoveCmd.js.map +0 -1
- package/lib/command/AcApPngConvertor.d.ts.map +0 -1
- package/lib/command/AcApPngConvertor.js.map +0 -1
- package/lib/command/AcApPolygonCmd.d.ts.map +0 -1
- package/lib/command/AcApPolygonCmd.js.map +0 -1
- package/lib/command/AcApPolylineCmd.d.ts.map +0 -1
- package/lib/command/AcApPolylineCmd.js.map +0 -1
- package/lib/command/AcApRectCmd.d.ts.map +0 -1
- package/lib/command/AcApRectCmd.js.map +0 -1
- package/lib/command/AcApRevCircleCmd.d.ts.map +0 -1
- package/lib/command/AcApRevCircleCmd.js.map +0 -1
- package/lib/command/AcApRevCloudCmd.d.ts.map +0 -1
- package/lib/command/AcApRevCloudCmd.js.map +0 -1
- package/lib/command/AcApRevRectCmd.d.ts.map +0 -1
- package/lib/command/AcApRevRectCmd.js.map +0 -1
- package/lib/command/AcApRevVisibilityCmd.d.ts.map +0 -1
- package/lib/command/AcApRevVisibilityCmd.js.map +0 -1
- package/lib/command/AcApSketchCmd.d.ts.map +0 -1
- package/lib/command/AcApSketchCmd.js.map +0 -1
- package/lib/command/AcApSplineCmd.d.ts.map +0 -1
- package/lib/command/AcApSplineCmd.js.map +0 -1
- package/lib/command/AcApSvgConvertor.d.ts.map +0 -1
- package/lib/command/AcApSvgConvertor.js.map +0 -1
- /package/lib/command/{AcApDxfConvertor.d.ts → convert/AcApDxfConvertor.d.ts} +0 -0
- /package/lib/command/{AcApSvgConvertor.d.ts → convert/AcApSvgConvertor.d.ts} +0 -0
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
var __read = (this && this.__read) || function (o, n) {
|
|
2
|
+
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
3
|
+
if (!m) return o;
|
|
4
|
+
var i = m.call(o), r, ar = [], e;
|
|
5
|
+
try {
|
|
6
|
+
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
7
|
+
}
|
|
8
|
+
catch (error) { e = { error: error }; }
|
|
9
|
+
finally {
|
|
10
|
+
try {
|
|
11
|
+
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
12
|
+
}
|
|
13
|
+
finally { if (e) throw e.error; }
|
|
14
|
+
}
|
|
15
|
+
return ar;
|
|
16
|
+
};
|
|
17
|
+
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
18
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
19
|
+
if (ar || !(i in from)) {
|
|
20
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
21
|
+
ar[i] = from[i];
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
25
|
+
};
|
|
26
|
+
export function sortPickResults(results, point) {
|
|
27
|
+
return __spreadArray([], __read(results), false).sort(function (a, b) { return comparePickResults(a, b, point); });
|
|
28
|
+
}
|
|
29
|
+
function comparePickResults(a, b, point) {
|
|
30
|
+
var areaDelta = bboxArea(a) - bboxArea(b);
|
|
31
|
+
if (Math.abs(areaDelta) > Number.EPSILON)
|
|
32
|
+
return areaDelta;
|
|
33
|
+
var distanceDelta = squaredDistanceToBox(point, a) - squaredDistanceToBox(point, b);
|
|
34
|
+
if (Math.abs(distanceDelta) > Number.EPSILON)
|
|
35
|
+
return distanceDelta;
|
|
36
|
+
return 0;
|
|
37
|
+
}
|
|
38
|
+
function bboxArea(item) {
|
|
39
|
+
return Math.max(item.maxX - item.minX, 0) * Math.max(item.maxY - item.minY, 0);
|
|
40
|
+
}
|
|
41
|
+
function squaredDistanceToBox(point, item) {
|
|
42
|
+
var dx = point.x < item.minX
|
|
43
|
+
? item.minX - point.x
|
|
44
|
+
: point.x > item.maxX
|
|
45
|
+
? point.x - item.maxX
|
|
46
|
+
: 0;
|
|
47
|
+
var dy = point.y < item.minY
|
|
48
|
+
? item.minY - point.y
|
|
49
|
+
: point.y > item.maxY
|
|
50
|
+
? point.y - item.maxY
|
|
51
|
+
: 0;
|
|
52
|
+
return dx * dx + dy * dy;
|
|
53
|
+
}
|
|
54
|
+
//# sourceMappingURL=AcTrPickResultUtil.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AcTrPickResultUtil.js","sourceRoot":"","sources":["../../src/view/AcTrPickResultUtil.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAIA,MAAM,UAAU,eAAe,CAC7B,OAAuC,EACvC,KAAsB;IAEtB,OAAO,yBAAI,OAAO,UAAE,IAAI,CAAC,UAAC,CAAC,EAAE,CAAC,IAAK,OAAA,kBAAkB,CAAC,CAAC,EAAE,CAAC,EAAE,KAAK,CAAC,EAA/B,CAA+B,CAAC,CAAA;AACrE,CAAC;AAED,SAAS,kBAAkB,CACzB,CAA+B,EAC/B,CAA+B,EAC/B,KAAsB;IAEtB,IAAM,SAAS,GAAG,QAAQ,CAAC,CAAC,CAAC,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAA;IAC3C,IAAI,IAAI,CAAC,GAAG,CAAC,SAAS,CAAC,GAAG,MAAM,CAAC,OAAO;QAAE,OAAO,SAAS,CAAA;IAE1D,IAAM,aAAa,GACjB,oBAAoB,CAAC,KAAK,EAAE,CAAC,CAAC,GAAG,oBAAoB,CAAC,KAAK,EAAE,CAAC,CAAC,CAAA;IACjE,IAAI,IAAI,CAAC,GAAG,CAAC,aAAa,CAAC,GAAG,MAAM,CAAC,OAAO;QAAE,OAAO,aAAa,CAAA;IAElE,OAAO,CAAC,CAAA;AACV,CAAC;AAED,SAAS,QAAQ,CAAC,IAAkC;IAClD,OAAO,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC,CAAA;AAChF,CAAC;AAED,SAAS,oBAAoB,CAC3B,KAAsB,EACtB,IAAkC;IAElC,IAAM,EAAE,GACN,KAAK,CAAC,CAAC,GAAG,IAAI,CAAC,IAAI;QACjB,CAAC,CAAC,IAAI,CAAC,IAAI,GAAG,KAAK,CAAC,CAAC;QACrB,CAAC,CAAC,KAAK,CAAC,CAAC,GAAG,IAAI,CAAC,IAAI;YACnB,CAAC,CAAC,KAAK,CAAC,CAAC,GAAG,IAAI,CAAC,IAAI;YACrB,CAAC,CAAC,CAAC,CAAA;IACT,IAAM,EAAE,GACN,KAAK,CAAC,CAAC,GAAG,IAAI,CAAC,IAAI;QACjB,CAAC,CAAC,IAAI,CAAC,IAAI,GAAG,KAAK,CAAC,CAAC;QACrB,CAAC,CAAC,KAAK,CAAC,CAAC,GAAG,IAAI,CAAC,IAAI;YACnB,CAAC,CAAC,KAAK,CAAC,CAAC,GAAG,IAAI,CAAC,IAAI;YACrB,CAAC,CAAC,CAAC,CAAA;IAET,OAAO,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,CAAA;AAC1B,CAAC"}
|
package/lib/view/AcTrView2d.d.ts
CHANGED
|
@@ -83,6 +83,7 @@ export declare class AcTrView2d extends AcEdBaseView {
|
|
|
83
83
|
* @param options.background - Optional background color as hex number (default: 0x000000)
|
|
84
84
|
*/
|
|
85
85
|
constructor(options?: AcTrView2dOptions);
|
|
86
|
+
private getPointerSelectionAction;
|
|
86
87
|
/**
|
|
87
88
|
* Initializes the viewer after renderer and camera are created.
|
|
88
89
|
*
|
|
@@ -315,6 +316,30 @@ export declare class AcTrView2d extends AcEdBaseView {
|
|
|
315
316
|
*/
|
|
316
317
|
private batchConvert;
|
|
317
318
|
private handleGroup;
|
|
319
|
+
/**
|
|
320
|
+
* Remaps layer metadata/material bindings from a source layer to the effective render layer.
|
|
321
|
+
*
|
|
322
|
+
* During block decomposition, one INSERT may be split into multiple layer buckets. For
|
|
323
|
+
* children authored on layer "0", AutoCAD requires inheriting the INSERT's own layer.
|
|
324
|
+
* This method applies that inheritance by mutating each child's `userData.layerName` and
|
|
325
|
+
* re-binding materials via renderer cache, so subsequent layer-level style changes still
|
|
326
|
+
* hit the correct material instances.
|
|
327
|
+
*
|
|
328
|
+
* @param objects - Root objects in the current layer bucket to traverse and remap.
|
|
329
|
+
* @param sourceLayerName - Layer name found in block definition before inheritance.
|
|
330
|
+
* @param effectiveLayerName - Final layer name used by rendering and style updates.
|
|
331
|
+
*/
|
|
332
|
+
private remapInheritedLayerObjects;
|
|
333
|
+
/**
|
|
334
|
+
* Some DXF conversion paths lose `isByLayerColor` on layer-0 block contents while still
|
|
335
|
+
* retaining other ByLayer markers (lineType/lineWeight/transparency). For AutoCAD-compatible
|
|
336
|
+
* INSERT inheritance, treat such colors as inheritable when remapping from layer "0".
|
|
337
|
+
*/
|
|
338
|
+
private promoteLayerZeroByLayerColor;
|
|
339
|
+
/**
|
|
340
|
+
* Builds the resolved layer traits used when layer-0 block content inherits an INSERT layer.
|
|
341
|
+
*/
|
|
342
|
+
private getEffectiveLayerTraits;
|
|
318
343
|
private decreaseNumOfEntitiesToProcess;
|
|
319
344
|
}
|
|
320
345
|
//# sourceMappingURL=AcTrView2d.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AcTrView2d.d.ts","sourceRoot":"","sources":["../../src/view/AcTrView2d.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,UAAU,EAEV,oBAAoB,EACpB,yBAAyB,EACzB,UAAU,EACV,YAAY,EAMZ,SAAS,EACT,SAAS,EACT,WAAW,EACX,eAAe,
|
|
1
|
+
{"version":3,"file":"AcTrView2d.d.ts","sourceRoot":"","sources":["../../src/view/AcTrView2d.ts"],"names":[],"mappings":"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"}
|
package/lib/view/AcTrView2d.js
CHANGED
|
@@ -73,15 +73,16 @@ var __values = (this && this.__values) || function(o) {
|
|
|
73
73
|
};
|
|
74
74
|
import { acdbHostApplicationServices, AcDbRasterImage, AcDbRay, AcDbSysVarManager, AcDbViewport, AcDbXline, AcGeBox2d, AcGePoint2d, log } from '@mlightcad/data-model';
|
|
75
75
|
import { AcDbSystemVariables } from '@mlightcad/data-model';
|
|
76
|
-
import { AcTrEntity, AcTrGroup, AcTrRenderer, AcTrViewportView } from '@mlightcad/three-renderer';
|
|
76
|
+
import { AcTrEntity, AcTrGroup, AcTrRenderer, AcTrViewportView, getMaterialMetadata, hasByLayerBinding, setMaterialMetadata } from '@mlightcad/three-renderer';
|
|
77
77
|
import * as THREE from 'three';
|
|
78
78
|
import Stats from 'three/examples/jsm/libs/stats.module';
|
|
79
79
|
import { CSS2DRenderer } from 'three/examples/jsm/renderers/CSS2DRenderer.js';
|
|
80
80
|
import { AcApDocManager, AcApSettingManager } from '../app';
|
|
81
|
-
import { AcEdBaseView, AcEdConditionWaiter, AcEdCorsorType, AcEdViewMode, applyUiThemeFromBackground, eventBus } from '../editor';
|
|
81
|
+
import { AcEdBaseView, AcEdConditionWaiter, AcEdCorsorType, AcEdViewMode, applyUiThemeFromBackground, eventBus, resolvePointerSelectionAction } from '../editor';
|
|
82
82
|
import { AcTrGeometryUtil } from '../util';
|
|
83
83
|
import { AcTrLayoutView } from './AcTrLayoutView';
|
|
84
84
|
import { AcTrLayoutViewManager } from './AcTrLayoutViewManager';
|
|
85
|
+
import { sortPickResults } from './AcTrPickResultUtil';
|
|
85
86
|
import { AcTrScene } from './AcTrScene';
|
|
86
87
|
/**
|
|
87
88
|
* Default view option values
|
|
@@ -179,11 +180,44 @@ var AcTrView2d = /** @class */ (function (_super) {
|
|
|
179
180
|
// Initialize background color through setter to keep renderer/cursor/foreground in sync.
|
|
180
181
|
_this.backgroundColor = mergedOptions.background || 0x000000;
|
|
181
182
|
_this._stats = _this.createStats(AcApSettingManager.instance.isShowStats);
|
|
183
|
+
// Two sysvars can drive the canvas background:
|
|
184
|
+
//
|
|
185
|
+
// - WHITEBKCOLOR (boolean): the low-level "is the paper white?" flag
|
|
186
|
+
// that the View has always honoured.
|
|
187
|
+
// - COLORTHEME (number): the AutoCAD-standard theme selector where
|
|
188
|
+
// 0 = dark theme (black bg) and 1 = light theme (white bg).
|
|
189
|
+
//
|
|
190
|
+
// The Vue composable `useDark` (cad-viewer) toggles only COLORTHEME
|
|
191
|
+
// when the user flips the theme. Without this bridge, toggling the
|
|
192
|
+
// UI theme left WHITEBKCOLOR stale and the canvas kept its previous
|
|
193
|
+
// background even though `changeForeground` had been fired through
|
|
194
|
+
// MTEXT/line inversion — producing e.g. a black canvas in light mode
|
|
195
|
+
// or a white canvas in dark mode.
|
|
196
|
+
//
|
|
197
|
+
// Listening to both sysvars keeps either entry point working. The
|
|
198
|
+
// two remain independent (settable in isolation) because setting
|
|
199
|
+
// `this.backgroundColor` is idempotent and the handler for each
|
|
200
|
+
// sysvar only fires when that specific variable changes.
|
|
182
201
|
AcDbSysVarManager.instance().events.sysVarChanged.addEventListener(function (args) {
|
|
183
|
-
|
|
202
|
+
var nameLower = args.name.toLowerCase();
|
|
203
|
+
if (nameLower === AcDbSystemVariables.WHITEBKCOLOR.toLowerCase()) {
|
|
184
204
|
var useWhiteBackgroundColor = args.newVal;
|
|
185
205
|
_this.backgroundColor = useWhiteBackgroundColor ? 0xffffff : 0;
|
|
186
206
|
}
|
|
207
|
+
else if (nameLower === AcDbSystemVariables.COLORTHEME.toLowerCase()) {
|
|
208
|
+
// COLORTHEME is registered with type 'number' in the data-model
|
|
209
|
+
// (0 = dark, 1 = light), but the sysvar bus does not strictly
|
|
210
|
+
// coerce values. Normalise defensively so plugins setting the
|
|
211
|
+
// value as a string or boolean still behave correctly.
|
|
212
|
+
var newVal = args.newVal;
|
|
213
|
+
var isLight = typeof newVal === 'number'
|
|
214
|
+
? newVal === 1
|
|
215
|
+
: typeof newVal === 'boolean'
|
|
216
|
+
? newVal
|
|
217
|
+
: String(newVal).toLowerCase() === 'light' ||
|
|
218
|
+
String(newVal) === '1';
|
|
219
|
+
_this.backgroundColor = isLight ? 0xffffff : 0;
|
|
220
|
+
}
|
|
187
221
|
});
|
|
188
222
|
AcApSettingManager.instance.events.modified.addEventListener(function (args) {
|
|
189
223
|
if (args.key == 'isShowStats') {
|
|
@@ -227,7 +261,7 @@ var AcTrView2d = /** @class */ (function (_super) {
|
|
|
227
261
|
var width = Math.abs(p1.x - p2.x);
|
|
228
262
|
var height = Math.abs(p1.y - p2.y);
|
|
229
263
|
var mode = _this.getSelectionMode(selectionStartCanvas, curCanvas);
|
|
230
|
-
var action = _this.
|
|
264
|
+
var action = _this.getPointerSelectionAction(e);
|
|
231
265
|
var style = _this.getSelectionPreviewStyle(mode, action);
|
|
232
266
|
Object.assign(selectionPreviewEl.style, {
|
|
233
267
|
left: "".concat(left, "px"),
|
|
@@ -248,7 +282,7 @@ var AcTrView2d = /** @class */ (function (_super) {
|
|
|
248
282
|
});
|
|
249
283
|
var endWcs = _this.screenToWorld(endCanvas);
|
|
250
284
|
clearSelectionPreview();
|
|
251
|
-
var action = _this.
|
|
285
|
+
var action = _this.getPointerSelectionAction(e);
|
|
252
286
|
if (_this.isSelectionClick(selectionStartCanvas, endCanvas)) {
|
|
253
287
|
var picked = _this.pick(endWcs);
|
|
254
288
|
if (picked.length > 0) {
|
|
@@ -321,6 +355,9 @@ var AcTrView2d = /** @class */ (function (_super) {
|
|
|
321
355
|
_this._numOfEntitiesToProcess = 0;
|
|
322
356
|
return _this;
|
|
323
357
|
}
|
|
358
|
+
AcTrView2d.prototype.getPointerSelectionAction = function (e) {
|
|
359
|
+
return resolvePointerSelectionAction(e);
|
|
360
|
+
};
|
|
324
361
|
/**
|
|
325
362
|
* Initializes the viewer after renderer and camera are created.
|
|
326
363
|
*
|
|
@@ -431,6 +468,9 @@ var AcTrView2d = /** @class */ (function (_super) {
|
|
|
431
468
|
set: function (value) {
|
|
432
469
|
this._renderer.setClearColor(value);
|
|
433
470
|
this._renderer.changeForeground(value == 0 ? 0xffffff : 0);
|
|
471
|
+
// Store the canvas colour for theme-sensitive materials created after this
|
|
472
|
+
// point. `changeForeground` above keeps ACI 7 linework and hatches visible.
|
|
473
|
+
this._renderer.currentBackgroundColor = value;
|
|
434
474
|
this.editor.setCursorColor(value == 0 ? 'white' : 'black');
|
|
435
475
|
applyUiThemeFromBackground(value);
|
|
436
476
|
this._isDirty = true;
|
|
@@ -627,24 +667,14 @@ var AcTrView2d = /** @class */ (function (_super) {
|
|
|
627
667
|
var firstQueryResults = this._scene.search(box);
|
|
628
668
|
var threshold = Math.max(box.size.width / 2, box.size.height / 2);
|
|
629
669
|
var raycaster_1 = activeLayoutView.resetRaycaster(point, threshold);
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
});
|
|
639
|
-
}
|
|
640
|
-
else {
|
|
641
|
-
firstQueryResults.forEach(function (item) {
|
|
642
|
-
var objectId = item.id;
|
|
643
|
-
if (activeLayout.isIntersectWith(objectId, raycaster_1)) {
|
|
644
|
-
results.push(item);
|
|
645
|
-
}
|
|
646
|
-
});
|
|
647
|
-
}
|
|
670
|
+
firstQueryResults.forEach(function (item) {
|
|
671
|
+
var objectId = item.id;
|
|
672
|
+
if (activeLayout.isIntersectWith(objectId, raycaster_1)) {
|
|
673
|
+
results.push(item);
|
|
674
|
+
}
|
|
675
|
+
});
|
|
676
|
+
var sortedResults = sortPickResults(results, point);
|
|
677
|
+
return pickOneOnly ? sortedResults.slice(0, 1) : sortedResults;
|
|
648
678
|
}
|
|
649
679
|
return results;
|
|
650
680
|
};
|
|
@@ -674,12 +704,27 @@ var AcTrView2d = /** @class */ (function (_super) {
|
|
|
674
704
|
* @inheritdoc
|
|
675
705
|
*/
|
|
676
706
|
AcTrView2d.prototype.addLayer = function (layer) {
|
|
677
|
-
this._scene.addLayer({
|
|
707
|
+
var updatedLayers = this._scene.addLayer({
|
|
678
708
|
name: layer.name,
|
|
679
709
|
isFrozen: layer.isFrozen,
|
|
680
710
|
isOff: layer.isOff,
|
|
681
711
|
color: layer.color
|
|
682
712
|
});
|
|
713
|
+
var traits = {
|
|
714
|
+
layer: layer.name,
|
|
715
|
+
color: layer.color.clone(),
|
|
716
|
+
rgbColor: layer.color.RGB,
|
|
717
|
+
lineType: layer.lineStyle,
|
|
718
|
+
lineWeight: layer.lineWeight,
|
|
719
|
+
transparency: layer.transparency
|
|
720
|
+
};
|
|
721
|
+
var materials = this._renderer.updateLayerMaterial(layer.name, traits);
|
|
722
|
+
updatedLayers.forEach(function (updatedLayer) {
|
|
723
|
+
for (var id in materials) {
|
|
724
|
+
var material = materials[id];
|
|
725
|
+
updatedLayer.updateMaterial(Number(id), material);
|
|
726
|
+
}
|
|
727
|
+
});
|
|
683
728
|
this._isDirty = true;
|
|
684
729
|
};
|
|
685
730
|
/**
|
|
@@ -973,83 +1018,75 @@ var AcTrView2d = /** @class */ (function (_super) {
|
|
|
973
1018
|
*/
|
|
974
1019
|
AcTrView2d.prototype.batchConvert = function (entities) {
|
|
975
1020
|
return __awaiter(this, void 0, void 0, function () {
|
|
976
|
-
var
|
|
977
|
-
var _this = this;
|
|
1021
|
+
var i, entity, threeEntity, isExtendBbox, layoutView, viewportView, fileName, error_1;
|
|
978
1022
|
return __generator(this, function (_a) {
|
|
979
1023
|
switch (_a.label) {
|
|
980
1024
|
case 0:
|
|
981
|
-
_loop_1 = function (i) {
|
|
982
|
-
var entity, threeEntity, isExtendBbox_1, layoutView, viewportView, fileName;
|
|
983
|
-
return __generator(this, function (_b) {
|
|
984
|
-
switch (_b.label) {
|
|
985
|
-
case 0:
|
|
986
|
-
entity = entities[i];
|
|
987
|
-
threeEntity = this_1.drawEntity(entity, true);
|
|
988
|
-
if (!threeEntity) return [3 /*break*/, 4];
|
|
989
|
-
threeEntity.objectId = entity.objectId;
|
|
990
|
-
threeEntity.ownerId = entity.ownerId;
|
|
991
|
-
threeEntity.layerName = entity.layer;
|
|
992
|
-
threeEntity.visible = entity.visibility;
|
|
993
|
-
if (!(threeEntity instanceof AcTrGroup &&
|
|
994
|
-
!threeEntity.isOnTheSameLayer)) return [3 /*break*/, 1];
|
|
995
|
-
this_1.handleGroup(threeEntity);
|
|
996
|
-
this_1.decreaseNumOfEntitiesToProcess();
|
|
997
|
-
return [3 /*break*/, 3];
|
|
998
|
-
case 1:
|
|
999
|
-
isExtendBbox_1 = !(entity instanceof AcDbRay || entity instanceof AcDbXline);
|
|
1000
|
-
return [4 /*yield*/, threeEntity
|
|
1001
|
-
.draw()
|
|
1002
|
-
.then(function () {
|
|
1003
|
-
_this._scene.addEntity(threeEntity, isExtendBbox_1);
|
|
1004
|
-
// Release memory occupied by this entity
|
|
1005
|
-
threeEntity.dispose();
|
|
1006
|
-
_this._isDirty = true;
|
|
1007
|
-
})
|
|
1008
|
-
.finally(function () {
|
|
1009
|
-
_this.decreaseNumOfEntitiesToProcess();
|
|
1010
|
-
})];
|
|
1011
|
-
case 2:
|
|
1012
|
-
_b.sent();
|
|
1013
|
-
_b.label = 3;
|
|
1014
|
-
case 3:
|
|
1015
|
-
if (entity instanceof AcDbViewport) {
|
|
1016
|
-
// In paper space layouts, there is always a system-defined "default" viewport that exists as
|
|
1017
|
-
// the bottom-most item. This viewport doesn't show any entities and is mainly for internal
|
|
1018
|
-
// AutoCAD purposes. The viewport id number of this system-defined "default" viewport is 1.
|
|
1019
|
-
if (entity.number !== 1) {
|
|
1020
|
-
layoutView = this_1._layoutViewManager.getAt(entity.ownerId);
|
|
1021
|
-
if (layoutView) {
|
|
1022
|
-
viewportView = new AcTrViewportView(layoutView, entity.toGiViewport(), this_1._renderer);
|
|
1023
|
-
layoutView.addViewport(viewportView);
|
|
1024
|
-
}
|
|
1025
|
-
}
|
|
1026
|
-
}
|
|
1027
|
-
else if (entity instanceof AcDbRasterImage) {
|
|
1028
|
-
fileName = entity.imageFileName;
|
|
1029
|
-
if (fileName)
|
|
1030
|
-
this_1._missedImages.set(entity.objectId, fileName);
|
|
1031
|
-
}
|
|
1032
|
-
return [3 /*break*/, 5];
|
|
1033
|
-
case 4:
|
|
1034
|
-
this_1.decreaseNumOfEntitiesToProcess();
|
|
1035
|
-
_b.label = 5;
|
|
1036
|
-
case 5: return [2 /*return*/];
|
|
1037
|
-
}
|
|
1038
|
-
});
|
|
1039
|
-
};
|
|
1040
|
-
this_1 = this;
|
|
1041
1025
|
i = 0;
|
|
1042
1026
|
_a.label = 1;
|
|
1043
1027
|
case 1:
|
|
1044
|
-
if (!(i < entities.length)) return [3 /*break*/,
|
|
1045
|
-
|
|
1028
|
+
if (!(i < entities.length)) return [3 /*break*/, 9];
|
|
1029
|
+
entity = entities[i];
|
|
1030
|
+
_a.label = 2;
|
|
1046
1031
|
case 2:
|
|
1047
|
-
_a.
|
|
1048
|
-
|
|
1032
|
+
_a.trys.push([2, 6, 7, 8]);
|
|
1033
|
+
threeEntity = this.drawEntity(entity, true);
|
|
1034
|
+
if (!threeEntity)
|
|
1035
|
+
return [3 /*break*/, 8];
|
|
1036
|
+
threeEntity.objectId = entity.objectId;
|
|
1037
|
+
threeEntity.ownerId = entity.ownerId;
|
|
1038
|
+
threeEntity.layerName = entity.layer;
|
|
1039
|
+
threeEntity.visible = entity.visibility;
|
|
1040
|
+
if (threeEntity instanceof AcTrGroup &&
|
|
1041
|
+
threeEntity.isOnTheSameLayer) {
|
|
1042
|
+
// Even when a block expands to a single layer bucket, children authored on
|
|
1043
|
+
// layer "0" still inherit the INSERT layer for ByLayer traits (color, etc.).
|
|
1044
|
+
this.remapInheritedLayerObjects(threeEntity.children, '0', threeEntity.layerName);
|
|
1045
|
+
}
|
|
1046
|
+
if (!(threeEntity instanceof AcTrGroup &&
|
|
1047
|
+
!threeEntity.isOnTheSameLayer)) return [3 /*break*/, 3];
|
|
1048
|
+
this.handleGroup(threeEntity);
|
|
1049
|
+
return [3 /*break*/, 5];
|
|
1049
1050
|
case 3:
|
|
1051
|
+
isExtendBbox = !(entity instanceof AcDbRay || entity instanceof AcDbXline);
|
|
1052
|
+
return [4 /*yield*/, threeEntity.draw()];
|
|
1053
|
+
case 4:
|
|
1054
|
+
_a.sent();
|
|
1055
|
+
this._scene.addEntity(threeEntity, isExtendBbox);
|
|
1056
|
+
// Release memory occupied by this entity
|
|
1057
|
+
threeEntity.dispose();
|
|
1058
|
+
this._isDirty = true;
|
|
1059
|
+
_a.label = 5;
|
|
1060
|
+
case 5:
|
|
1061
|
+
if (entity instanceof AcDbViewport) {
|
|
1062
|
+
// In paper space layouts, there is always a system-defined "default" viewport that exists as
|
|
1063
|
+
// the bottom-most item. This viewport doesn't show any entities and is mainly for internal
|
|
1064
|
+
// AutoCAD purposes. The viewport id number of this system-defined "default" viewport is 1.
|
|
1065
|
+
if (entity.number !== 1) {
|
|
1066
|
+
layoutView = this._layoutViewManager.getAt(entity.ownerId);
|
|
1067
|
+
if (layoutView) {
|
|
1068
|
+
viewportView = new AcTrViewportView(layoutView, entity.toGiViewport(), this._renderer);
|
|
1069
|
+
layoutView.addViewport(viewportView);
|
|
1070
|
+
}
|
|
1071
|
+
}
|
|
1072
|
+
}
|
|
1073
|
+
else if (entity instanceof AcDbRasterImage) {
|
|
1074
|
+
fileName = entity.imageFileName;
|
|
1075
|
+
if (fileName)
|
|
1076
|
+
this._missedImages.set(entity.objectId, fileName);
|
|
1077
|
+
}
|
|
1078
|
+
return [3 /*break*/, 8];
|
|
1079
|
+
case 6:
|
|
1080
|
+
error_1 = _a.sent();
|
|
1081
|
+
log.error("[AcTrView2d] Failed to convert entity ".concat(entity.objectId, " (").concat(entity.type, "):"), error_1);
|
|
1082
|
+
return [3 /*break*/, 8];
|
|
1083
|
+
case 7:
|
|
1084
|
+
this.decreaseNumOfEntitiesToProcess();
|
|
1085
|
+
return [7 /*endfinally*/];
|
|
1086
|
+
case 8:
|
|
1050
1087
|
++i;
|
|
1051
1088
|
return [3 /*break*/, 1];
|
|
1052
|
-
case
|
|
1089
|
+
case 9: return [2 /*return*/];
|
|
1053
1090
|
}
|
|
1054
1091
|
});
|
|
1055
1092
|
});
|
|
@@ -1094,21 +1131,29 @@ var AcTrView2d = /** @class */ (function (_super) {
|
|
|
1094
1131
|
var groupObjectId = group.objectId;
|
|
1095
1132
|
var groupLayerName = group.layerName;
|
|
1096
1133
|
var groupBox = group.box;
|
|
1134
|
+
var groupChildBoxes = group.boxes.map(function (box) { return (__assign({}, box)); });
|
|
1097
1135
|
objectsGroupByLayer.forEach(function (objects, layerName) {
|
|
1098
|
-
//
|
|
1099
|
-
//
|
|
1100
|
-
|
|
1101
|
-
//
|
|
1102
|
-
//
|
|
1103
|
-
//
|
|
1136
|
+
// AutoCAD block rule: entities authored on layer "0" inherit the INSERT's layer.
|
|
1137
|
+
// Non-zero layers keep their original layer name.
|
|
1138
|
+
var effectiveLayerName = layerName === '0' ? groupLayerName : layerName;
|
|
1139
|
+
// Keep runtime layer metadata/material cache aligned with the inherited layer so
|
|
1140
|
+
// later layer style edits (color, linetype, lineweight, transparency) target this
|
|
1141
|
+
// object set correctly.
|
|
1142
|
+
_this.remapInheritedLayerObjects(objects, layerName, effectiveLayerName);
|
|
1143
|
+
// One INSERT can expand to children from multiple layers. Here we create one
|
|
1144
|
+
// render entity per layer bucket but preserve the INSERT object id for all
|
|
1145
|
+
// buckets, so selection/highlight still maps back to the same database object.
|
|
1146
|
+
// Within each layer bucket, the object id remains unique in scene indexing.
|
|
1104
1147
|
var entity = new AcTrEntity(styleManager);
|
|
1105
1148
|
entity.applyMatrix4(group.matrix);
|
|
1106
1149
|
entity.objectId = groupObjectId;
|
|
1107
1150
|
entity.ownerId = group.ownerId;
|
|
1108
|
-
//
|
|
1109
|
-
//
|
|
1110
|
-
entity.layerName =
|
|
1151
|
+
// If block-definition entities are on layer "0", this bucket now uses the layer
|
|
1152
|
+
// of the block reference itself (effectiveLayerName).
|
|
1153
|
+
entity.layerName = effectiveLayerName;
|
|
1111
1154
|
entity.box = groupBox;
|
|
1155
|
+
var entityUserData = entity.userData;
|
|
1156
|
+
entityUserData.spatialIndexChildBoxes = groupChildBoxes;
|
|
1112
1157
|
// Important:
|
|
1113
1158
|
// DO NOT USE spread operator when adding objects because it may be one very large array
|
|
1114
1159
|
// and can result in maximum call stack size exceeded
|
|
@@ -1121,6 +1166,86 @@ var AcTrView2d = /** @class */ (function (_super) {
|
|
|
1121
1166
|
group.dispose();
|
|
1122
1167
|
this._isDirty = true;
|
|
1123
1168
|
};
|
|
1169
|
+
/**
|
|
1170
|
+
* Remaps layer metadata/material bindings from a source layer to the effective render layer.
|
|
1171
|
+
*
|
|
1172
|
+
* During block decomposition, one INSERT may be split into multiple layer buckets. For
|
|
1173
|
+
* children authored on layer "0", AutoCAD requires inheriting the INSERT's own layer.
|
|
1174
|
+
* This method applies that inheritance by mutating each child's `userData.layerName` and
|
|
1175
|
+
* re-binding materials via renderer cache, so subsequent layer-level style changes still
|
|
1176
|
+
* hit the correct material instances.
|
|
1177
|
+
*
|
|
1178
|
+
* @param objects - Root objects in the current layer bucket to traverse and remap.
|
|
1179
|
+
* @param sourceLayerName - Layer name found in block definition before inheritance.
|
|
1180
|
+
* @param effectiveLayerName - Final layer name used by rendering and style updates.
|
|
1181
|
+
*/
|
|
1182
|
+
AcTrView2d.prototype.remapInheritedLayerObjects = function (objects, sourceLayerName, effectiveLayerName) {
|
|
1183
|
+
var e_3, _a;
|
|
1184
|
+
var _this = this;
|
|
1185
|
+
if (sourceLayerName === effectiveLayerName)
|
|
1186
|
+
return;
|
|
1187
|
+
var renderer = this._renderer;
|
|
1188
|
+
var layerTraits = this.getEffectiveLayerTraits(effectiveLayerName);
|
|
1189
|
+
try {
|
|
1190
|
+
for (var objects_1 = __values(objects), objects_1_1 = objects_1.next(); !objects_1_1.done; objects_1_1 = objects_1.next()) {
|
|
1191
|
+
var object = objects_1_1.value;
|
|
1192
|
+
object.traverse(function (child) {
|
|
1193
|
+
if (child.userData.layerName === sourceLayerName) {
|
|
1194
|
+
child.userData.layerName = effectiveLayerName;
|
|
1195
|
+
}
|
|
1196
|
+
if (!('material' in child))
|
|
1197
|
+
return;
|
|
1198
|
+
var material = child.material;
|
|
1199
|
+
if (Array.isArray(material)) {
|
|
1200
|
+
var materials = material;
|
|
1201
|
+
child.material = materials.map(function (entry) {
|
|
1202
|
+
return renderer.getLayerBoundMaterial(_this.promoteLayerZeroByLayerColor(entry, sourceLayerName), effectiveLayerName, layerTraits);
|
|
1203
|
+
});
|
|
1204
|
+
return;
|
|
1205
|
+
}
|
|
1206
|
+
var remappedMaterial = renderer.getLayerBoundMaterial(_this.promoteLayerZeroByLayerColor(material, sourceLayerName), effectiveLayerName, layerTraits);
|
|
1207
|
+
child.material = remappedMaterial;
|
|
1208
|
+
child.userData.styleMaterialId = remappedMaterial.id;
|
|
1209
|
+
});
|
|
1210
|
+
}
|
|
1211
|
+
}
|
|
1212
|
+
catch (e_3_1) { e_3 = { error: e_3_1 }; }
|
|
1213
|
+
finally {
|
|
1214
|
+
try {
|
|
1215
|
+
if (objects_1_1 && !objects_1_1.done && (_a = objects_1.return)) _a.call(objects_1);
|
|
1216
|
+
}
|
|
1217
|
+
finally { if (e_3) throw e_3.error; }
|
|
1218
|
+
}
|
|
1219
|
+
};
|
|
1220
|
+
/**
|
|
1221
|
+
* Some DXF conversion paths lose `isByLayerColor` on layer-0 block contents while still
|
|
1222
|
+
* retaining other ByLayer markers (lineType/lineWeight/transparency). For AutoCAD-compatible
|
|
1223
|
+
* INSERT inheritance, treat such colors as inheritable when remapping from layer "0".
|
|
1224
|
+
*/
|
|
1225
|
+
AcTrView2d.prototype.promoteLayerZeroByLayerColor = function (material, sourceLayerName) {
|
|
1226
|
+
var metadata = getMaterialMetadata(material);
|
|
1227
|
+
var hasAnyOtherByLayerBinding = hasByLayerBinding(metadata) && metadata.isByLayerColor !== true;
|
|
1228
|
+
if (sourceLayerName === '0' && hasAnyOtherByLayerBinding) {
|
|
1229
|
+
setMaterialMetadata(material, { isByLayerColor: true });
|
|
1230
|
+
}
|
|
1231
|
+
return material;
|
|
1232
|
+
};
|
|
1233
|
+
/**
|
|
1234
|
+
* Builds the resolved layer traits used when layer-0 block content inherits an INSERT layer.
|
|
1235
|
+
*/
|
|
1236
|
+
AcTrView2d.prototype.getEffectiveLayerTraits = function (layerName) {
|
|
1237
|
+
var layer = AcApDocManager.instance.curDocument.database.tables.layerTable.getAt(layerName);
|
|
1238
|
+
if (!layer)
|
|
1239
|
+
return undefined;
|
|
1240
|
+
return {
|
|
1241
|
+
layer: layer.name,
|
|
1242
|
+
color: layer.color.clone(),
|
|
1243
|
+
rgbColor: layer.color.RGB,
|
|
1244
|
+
lineType: layer.lineStyle,
|
|
1245
|
+
lineWeight: layer.lineWeight,
|
|
1246
|
+
transparency: layer.transparency
|
|
1247
|
+
};
|
|
1248
|
+
};
|
|
1124
1249
|
AcTrView2d.prototype.decreaseNumOfEntitiesToProcess = function () {
|
|
1125
1250
|
this._numOfEntitiesToProcess--;
|
|
1126
1251
|
if (this._numOfEntitiesToProcess < 0) {
|