@mlightcad/cad-simple-viewer 1.5.11 → 1.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +23 -8
- package/dist/cad-simple-viewer.js +32135 -25300
- package/dist/cad-simple-viewer.umd.cjs +136 -24
- package/lib/app/AcApDocManager.d.ts +18 -24
- package/lib/app/AcApDocManager.d.ts.map +1 -1
- package/lib/app/AcApDocManager.js +40 -41
- package/lib/app/AcApDocManager.js.map +1 -1
- package/lib/app/AcApSettingManager.d.ts +24 -10
- package/lib/app/AcApSettingManager.d.ts.map +1 -1
- package/lib/app/AcApSettingManager.js +49 -10
- package/lib/app/AcApSettingManager.js.map +1 -1
- package/lib/app/AcApWebworkerReadiness.d.ts +7 -2
- package/lib/app/AcApWebworkerReadiness.d.ts.map +1 -1
- package/lib/app/AcApWebworkerReadiness.js +13 -8
- package/lib/app/AcApWebworkerReadiness.js.map +1 -1
- package/lib/app/AcApWorkerAssets.d.ts +14 -1
- package/lib/app/AcApWorkerAssets.d.ts.map +1 -1
- package/lib/app/AcApWorkerAssets.js +14 -1
- package/lib/app/AcApWorkerAssets.js.map +1 -1
- package/lib/app/index.d.ts +0 -1
- package/lib/app/index.d.ts.map +1 -1
- package/lib/app/index.js +0 -1
- package/lib/app/index.js.map +1 -1
- package/lib/command/AcApRedoCmd.d.ts +1 -1
- package/lib/command/AcApRedoCmd.d.ts.map +1 -1
- package/lib/command/AcApRedoCmd.js +9 -4
- package/lib/command/AcApRedoCmd.js.map +1 -1
- package/lib/command/AcApUndoCmd.d.ts +1 -1
- package/lib/command/AcApUndoCmd.d.ts.map +1 -1
- package/lib/command/AcApUndoCmd.js +9 -4
- package/lib/command/AcApUndoCmd.js.map +1 -1
- package/lib/command/draw/AcApRevCloudCmd.d.ts +48 -0
- package/lib/command/draw/AcApRevCloudCmd.d.ts.map +1 -0
- package/lib/command/draw/AcApRevCloudCmd.js +747 -0
- package/lib/command/draw/AcApRevCloudCmd.js.map +1 -0
- package/lib/command/draw/AcApRevCloudGeom.d.ts +57 -0
- package/lib/command/draw/AcApRevCloudGeom.d.ts.map +1 -0
- package/lib/command/draw/AcApRevCloudGeom.js +373 -0
- package/lib/command/draw/AcApRevCloudGeom.js.map +1 -0
- package/lib/command/draw/AcApSketchCmd.d.ts +59 -0
- package/lib/command/draw/AcApSketchCmd.d.ts.map +1 -0
- package/lib/command/draw/AcApSketchCmd.js +537 -0
- package/lib/command/draw/AcApSketchCmd.js.map +1 -0
- package/lib/command/draw/index.d.ts +3 -0
- package/lib/command/draw/index.d.ts.map +1 -1
- package/lib/command/draw/index.js +3 -0
- package/lib/command/draw/index.js.map +1 -1
- package/lib/command/index.d.ts +2 -1
- package/lib/command/index.d.ts.map +1 -1
- package/lib/command/index.js +2 -1
- package/lib/command/index.js.map +1 -1
- package/lib/command/markup/AcApClearMarkupsCmd.d.ts +10 -0
- package/lib/command/markup/AcApClearMarkupsCmd.d.ts.map +1 -0
- package/lib/command/{review/AcApRevCircleCmd.js → markup/AcApClearMarkupsCmd.js} +19 -49
- package/lib/command/markup/AcApClearMarkupsCmd.js.map +1 -0
- package/lib/command/markup/AcApMarkupArrowCmd.d.ts +10 -0
- package/lib/command/markup/AcApMarkupArrowCmd.d.ts.map +1 -0
- package/lib/command/markup/AcApMarkupArrowCmd.js +164 -0
- package/lib/command/markup/AcApMarkupArrowCmd.js.map +1 -0
- package/lib/command/markup/AcApMarkupCalloutCmd.d.ts +17 -0
- package/lib/command/markup/AcApMarkupCalloutCmd.d.ts.map +1 -0
- package/lib/command/markup/AcApMarkupCalloutCmd.js +259 -0
- package/lib/command/markup/AcApMarkupCalloutCmd.js.map +1 -0
- package/lib/command/markup/AcApMarkupCalloutDrag.d.ts +78 -0
- package/lib/command/markup/AcApMarkupCalloutDrag.d.ts.map +1 -0
- package/lib/command/markup/AcApMarkupCalloutDrag.js +78 -0
- package/lib/command/markup/AcApMarkupCalloutDrag.js.map +1 -0
- package/lib/command/markup/AcApMarkupCircleCmd.d.ts +10 -0
- package/lib/command/markup/AcApMarkupCircleCmd.d.ts.map +1 -0
- package/lib/command/markup/AcApMarkupCircleCmd.js +174 -0
- package/lib/command/markup/AcApMarkupCircleCmd.js.map +1 -0
- package/lib/command/markup/AcApMarkupCloudCmd.d.ts +11 -0
- package/lib/command/markup/AcApMarkupCloudCmd.d.ts.map +1 -0
- package/lib/command/markup/AcApMarkupCloudCmd.js +178 -0
- package/lib/command/markup/AcApMarkupCloudCmd.js.map +1 -0
- package/lib/command/markup/AcApMarkupCmdUtil.d.ts +43 -0
- package/lib/command/markup/AcApMarkupCmdUtil.d.ts.map +1 -0
- package/lib/command/markup/AcApMarkupCmdUtil.js +133 -0
- package/lib/command/markup/AcApMarkupCmdUtil.js.map +1 -0
- package/lib/command/markup/AcApMarkupGeometry.d.ts +57 -0
- package/lib/command/markup/AcApMarkupGeometry.d.ts.map +1 -0
- package/lib/command/markup/AcApMarkupGeometry.js +231 -0
- package/lib/command/markup/AcApMarkupGeometry.js.map +1 -0
- package/lib/command/markup/AcApMarkupHighlightCmd.d.ts +10 -0
- package/lib/command/markup/AcApMarkupHighlightCmd.d.ts.map +1 -0
- package/lib/command/markup/AcApMarkupHighlightCmd.js +166 -0
- package/lib/command/markup/AcApMarkupHighlightCmd.js.map +1 -0
- package/lib/command/markup/AcApMarkupHistory.d.ts +139 -0
- package/lib/command/markup/AcApMarkupHistory.d.ts.map +1 -0
- package/lib/command/markup/AcApMarkupHistory.js +336 -0
- package/lib/command/markup/AcApMarkupHistory.js.map +1 -0
- package/lib/command/markup/AcApMarkupImportExportCmd.d.ts +17 -0
- package/lib/command/markup/AcApMarkupImportExportCmd.d.ts.map +1 -0
- package/lib/command/markup/AcApMarkupImportExportCmd.js +182 -0
- package/lib/command/markup/AcApMarkupImportExportCmd.js.map +1 -0
- package/lib/command/markup/AcApMarkupLineCmd.d.ts +10 -0
- package/lib/command/markup/AcApMarkupLineCmd.d.ts.map +1 -0
- package/lib/command/markup/AcApMarkupLineCmd.js +185 -0
- package/lib/command/markup/AcApMarkupLineCmd.js.map +1 -0
- package/lib/command/markup/AcApMarkupPresenter.d.ts +62 -0
- package/lib/command/markup/AcApMarkupPresenter.d.ts.map +1 -0
- package/lib/command/markup/AcApMarkupPresenter.js +288 -0
- package/lib/command/markup/AcApMarkupPresenter.js.map +1 -0
- package/lib/command/markup/AcApMarkupRectCmd.d.ts +10 -0
- package/lib/command/markup/AcApMarkupRectCmd.d.ts.map +1 -0
- package/lib/command/markup/AcApMarkupRectCmd.js +174 -0
- package/lib/command/markup/AcApMarkupRectCmd.js.map +1 -0
- package/lib/command/markup/AcApMarkupRepublish.d.ts +29 -0
- package/lib/command/markup/AcApMarkupRepublish.d.ts.map +1 -0
- package/lib/command/markup/AcApMarkupRepublish.js +28 -0
- package/lib/command/markup/AcApMarkupRepublish.js.map +1 -0
- package/lib/command/markup/AcApMarkupShapeBuilder.d.ts +88 -0
- package/lib/command/markup/AcApMarkupShapeBuilder.d.ts.map +1 -0
- package/lib/command/markup/AcApMarkupShapeBuilder.js +246 -0
- package/lib/command/markup/AcApMarkupShapeBuilder.js.map +1 -0
- package/lib/command/markup/AcApMarkupShapeCallout.d.ts +46 -0
- package/lib/command/markup/AcApMarkupShapeCallout.d.ts.map +1 -0
- package/lib/command/markup/AcApMarkupShapeCallout.js +356 -0
- package/lib/command/markup/AcApMarkupShapeCallout.js.map +1 -0
- package/lib/command/markup/AcApMarkupSidecar.d.ts +14 -0
- package/lib/command/markup/AcApMarkupSidecar.d.ts.map +1 -0
- package/lib/command/markup/AcApMarkupSidecar.js +196 -0
- package/lib/command/markup/AcApMarkupSidecar.js.map +1 -0
- package/lib/command/markup/AcApMarkupStampCmd.d.ts +10 -0
- package/lib/command/markup/AcApMarkupStampCmd.d.ts.map +1 -0
- package/lib/command/markup/AcApMarkupStampCmd.js +158 -0
- package/lib/command/markup/AcApMarkupStampCmd.js.map +1 -0
- package/lib/command/markup/AcApMarkupStore.d.ts +94 -0
- package/lib/command/markup/AcApMarkupStore.d.ts.map +1 -0
- package/lib/command/markup/AcApMarkupStore.js +327 -0
- package/lib/command/markup/AcApMarkupStore.js.map +1 -0
- package/lib/command/markup/AcApMarkupTextCmd.d.ts +10 -0
- package/lib/command/markup/AcApMarkupTextCmd.d.ts.map +1 -0
- package/lib/command/markup/AcApMarkupTextCmd.js +141 -0
- package/lib/command/markup/AcApMarkupTextCmd.js.map +1 -0
- package/lib/command/markup/AcApMarkupTextEdit.d.ts +88 -0
- package/lib/command/markup/AcApMarkupTextEdit.d.ts.map +1 -0
- package/lib/command/markup/AcApMarkupTextEdit.js +249 -0
- package/lib/command/markup/AcApMarkupTextEdit.js.map +1 -0
- package/lib/command/markup/AcApMarkupTypes.d.ts +118 -0
- package/lib/command/markup/AcApMarkupTypes.d.ts.map +1 -0
- package/lib/command/markup/AcApMarkupTypes.js +8 -0
- package/lib/command/markup/AcApMarkupTypes.js.map +1 -0
- package/lib/command/markup/AcApMarkupUtil.d.ts +41 -0
- package/lib/command/markup/AcApMarkupUtil.d.ts.map +1 -0
- package/lib/command/markup/AcApMarkupUtil.js +135 -0
- package/lib/command/markup/AcApMarkupUtil.js.map +1 -0
- package/lib/command/markup/AcApMarkupVisibilityCmd.d.ts +17 -0
- package/lib/command/markup/AcApMarkupVisibilityCmd.d.ts.map +1 -0
- package/lib/command/{review/AcApRevVisibilityCmd.js → markup/AcApMarkupVisibilityCmd.js} +30 -27
- package/lib/command/markup/AcApMarkupVisibilityCmd.js.map +1 -0
- package/lib/command/markup/entity/AcApMarkupCalloutEntity.d.ts +48 -0
- package/lib/command/markup/entity/AcApMarkupCalloutEntity.d.ts.map +1 -0
- package/lib/command/markup/entity/AcApMarkupCalloutEntity.js +291 -0
- package/lib/command/markup/entity/AcApMarkupCalloutEntity.js.map +1 -0
- package/lib/command/markup/entity/AcApMarkupEntity.d.ts +131 -0
- package/lib/command/markup/entity/AcApMarkupEntity.d.ts.map +1 -0
- package/lib/command/markup/entity/AcApMarkupEntity.js +191 -0
- package/lib/command/markup/entity/AcApMarkupEntity.js.map +1 -0
- package/lib/command/markup/entity/AcApMarkupEntityFactory.d.ts +20 -0
- package/lib/command/markup/entity/AcApMarkupEntityFactory.d.ts.map +1 -0
- package/lib/command/markup/entity/AcApMarkupEntityFactory.js +43 -0
- package/lib/command/markup/entity/AcApMarkupEntityFactory.js.map +1 -0
- package/lib/command/markup/entity/AcApMarkupEntityGrips.d.ts +94 -0
- package/lib/command/markup/entity/AcApMarkupEntityGrips.d.ts.map +1 -0
- package/lib/command/markup/entity/AcApMarkupEntityGrips.js +204 -0
- package/lib/command/markup/entity/AcApMarkupEntityGrips.js.map +1 -0
- package/lib/command/markup/entity/AcApMarkupHighlightEntity.d.ts +27 -0
- package/lib/command/markup/entity/AcApMarkupHighlightEntity.d.ts.map +1 -0
- package/lib/command/markup/entity/AcApMarkupHighlightEntity.js +124 -0
- package/lib/command/markup/entity/AcApMarkupHighlightEntity.js.map +1 -0
- package/lib/command/markup/entity/AcApMarkupSegmentEntity.d.ts +40 -0
- package/lib/command/markup/entity/AcApMarkupSegmentEntity.d.ts.map +1 -0
- package/lib/command/markup/entity/AcApMarkupSegmentEntity.js +294 -0
- package/lib/command/markup/entity/AcApMarkupSegmentEntity.js.map +1 -0
- package/lib/command/markup/entity/AcApMarkupShapeEntity.d.ts +32 -0
- package/lib/command/markup/entity/AcApMarkupShapeEntity.d.ts.map +1 -0
- package/lib/command/markup/entity/AcApMarkupShapeEntity.js +241 -0
- package/lib/command/markup/entity/AcApMarkupShapeEntity.js.map +1 -0
- package/lib/command/markup/entity/AcApMarkupStampEntity.d.ts +23 -0
- package/lib/command/markup/entity/AcApMarkupStampEntity.d.ts.map +1 -0
- package/lib/command/markup/entity/AcApMarkupStampEntity.js +125 -0
- package/lib/command/markup/entity/AcApMarkupStampEntity.js.map +1 -0
- package/lib/command/markup/entity/AcApMarkupTextEntity.d.ts +23 -0
- package/lib/command/markup/entity/AcApMarkupTextEntity.d.ts.map +1 -0
- package/lib/command/markup/entity/AcApMarkupTextEntity.js +129 -0
- package/lib/command/markup/entity/AcApMarkupTextEntity.js.map +1 -0
- package/lib/command/markup/entity/index.d.ts +13 -0
- package/lib/command/markup/entity/index.d.ts.map +1 -0
- package/lib/command/markup/entity/index.js +13 -0
- package/lib/command/markup/entity/index.js.map +1 -0
- package/lib/command/markup/index.d.ts +27 -0
- package/lib/command/markup/index.d.ts.map +1 -0
- package/lib/command/markup/index.js +27 -0
- package/lib/command/markup/index.js.map +1 -0
- package/lib/command/measure/AcApClearMeasurementsCmd.d.ts +5 -12
- package/lib/command/measure/AcApClearMeasurementsCmd.d.ts.map +1 -1
- package/lib/command/measure/AcApClearMeasurementsCmd.js +42 -20
- package/lib/command/measure/AcApClearMeasurementsCmd.js.map +1 -1
- package/lib/command/measure/AcApMeasureAngleCmd.d.ts +13 -3
- package/lib/command/measure/AcApMeasureAngleCmd.d.ts.map +1 -1
- package/lib/command/measure/AcApMeasureAngleCmd.js +76 -210
- package/lib/command/measure/AcApMeasureAngleCmd.js.map +1 -1
- package/lib/command/measure/AcApMeasureArcCmd.d.ts +21 -1
- package/lib/command/measure/AcApMeasureArcCmd.d.ts.map +1 -1
- package/lib/command/measure/AcApMeasureArcCmd.js +103 -97
- package/lib/command/measure/AcApMeasureArcCmd.js.map +1 -1
- package/lib/command/measure/AcApMeasureAreaCmd.d.ts +11 -1
- package/lib/command/measure/AcApMeasureAreaCmd.d.ts.map +1 -1
- package/lib/command/measure/AcApMeasureAreaCmd.js +126 -144
- package/lib/command/measure/AcApMeasureAreaCmd.js.map +1 -1
- package/lib/command/measure/AcApMeasureDistanceCmd.d.ts +24 -15
- package/lib/command/measure/AcApMeasureDistanceCmd.d.ts.map +1 -1
- package/lib/command/measure/AcApMeasureDistanceCmd.js +52 -52
- package/lib/command/measure/AcApMeasureDistanceCmd.js.map +1 -1
- package/lib/command/measure/AcApMeasurePointCmd.d.ts +24 -0
- package/lib/command/measure/AcApMeasurePointCmd.d.ts.map +1 -0
- package/lib/command/measure/AcApMeasurePointCmd.js +114 -0
- package/lib/command/measure/AcApMeasurePointCmd.js.map +1 -0
- package/lib/command/measure/AcApMeasurementGeometry.d.ts +22 -0
- package/lib/command/measure/AcApMeasurementGeometry.d.ts.map +1 -0
- package/lib/command/measure/AcApMeasurementGeometry.js +127 -0
- package/lib/command/measure/AcApMeasurementGeometry.js.map +1 -0
- package/lib/command/measure/AcApMeasurementHistory.d.ts +78 -0
- package/lib/command/measure/AcApMeasurementHistory.d.ts.map +1 -0
- package/lib/command/measure/AcApMeasurementHistory.js +387 -0
- package/lib/command/measure/AcApMeasurementHistory.js.map +1 -0
- package/lib/command/measure/AcApMeasurementImportExportCmd.d.ts +17 -0
- package/lib/command/measure/AcApMeasurementImportExportCmd.d.ts.map +1 -0
- package/lib/command/measure/AcApMeasurementImportExportCmd.js +207 -0
- package/lib/command/measure/AcApMeasurementImportExportCmd.js.map +1 -0
- package/lib/command/measure/AcApMeasurementPlace.d.ts +9 -0
- package/lib/command/measure/AcApMeasurementPlace.d.ts.map +1 -0
- package/lib/command/measure/AcApMeasurementPlace.js +33 -0
- package/lib/command/measure/AcApMeasurementPlace.js.map +1 -0
- package/lib/command/measure/AcApMeasurementSidecar.d.ts +19 -0
- package/lib/command/measure/AcApMeasurementSidecar.d.ts.map +1 -0
- package/lib/command/measure/AcApMeasurementSidecar.js +173 -0
- package/lib/command/measure/AcApMeasurementSidecar.js.map +1 -0
- package/lib/command/measure/AcApMeasurementStore.d.ts +90 -0
- package/lib/command/measure/AcApMeasurementStore.d.ts.map +1 -0
- package/lib/command/measure/AcApMeasurementStore.js +364 -0
- package/lib/command/measure/AcApMeasurementStore.js.map +1 -0
- package/lib/command/measure/AcApMeasurementTypes.d.ts +56 -0
- package/lib/command/measure/AcApMeasurementTypes.d.ts.map +1 -0
- package/lib/command/measure/AcApMeasurementTypes.js +2 -0
- package/lib/command/measure/AcApMeasurementTypes.js.map +1 -0
- package/lib/command/measure/AcApMeasurementVisibilityCmd.d.ts +10 -0
- package/lib/command/measure/AcApMeasurementVisibilityCmd.d.ts.map +1 -0
- package/lib/command/measure/AcApMeasurementVisibilityCmd.js +78 -0
- package/lib/command/measure/AcApMeasurementVisibilityCmd.js.map +1 -0
- package/lib/command/measure/entity/AcApMeasureAngleEntity.d.ts +68 -0
- package/lib/command/measure/entity/AcApMeasureAngleEntity.d.ts.map +1 -0
- package/lib/command/measure/entity/AcApMeasureAngleEntity.js +188 -0
- package/lib/command/measure/entity/AcApMeasureAngleEntity.js.map +1 -0
- package/lib/command/measure/entity/AcApMeasureArcEntity.d.ts +85 -0
- package/lib/command/measure/entity/AcApMeasureArcEntity.d.ts.map +1 -0
- package/lib/command/measure/entity/AcApMeasureArcEntity.js +159 -0
- package/lib/command/measure/entity/AcApMeasureArcEntity.js.map +1 -0
- package/lib/command/measure/entity/AcApMeasureAreaEntity.d.ts +60 -0
- package/lib/command/measure/entity/AcApMeasureAreaEntity.d.ts.map +1 -0
- package/lib/command/measure/entity/AcApMeasureAreaEntity.js +184 -0
- package/lib/command/measure/entity/AcApMeasureAreaEntity.js.map +1 -0
- package/lib/command/measure/entity/AcApMeasureDistanceEntity.d.ts +60 -0
- package/lib/command/measure/entity/AcApMeasureDistanceEntity.d.ts.map +1 -0
- package/lib/command/measure/entity/AcApMeasureDistanceEntity.js +166 -0
- package/lib/command/measure/entity/AcApMeasureDistanceEntity.js.map +1 -0
- package/lib/command/measure/entity/AcApMeasureDrawUtil.d.ts +129 -0
- package/lib/command/measure/entity/AcApMeasureDrawUtil.d.ts.map +1 -0
- package/lib/command/measure/entity/AcApMeasureDrawUtil.js +257 -0
- package/lib/command/measure/entity/AcApMeasureDrawUtil.js.map +1 -0
- package/lib/command/measure/entity/AcApMeasureEntity.d.ts +148 -0
- package/lib/command/measure/entity/AcApMeasureEntity.d.ts.map +1 -0
- package/lib/command/measure/entity/AcApMeasureEntity.js +141 -0
- package/lib/command/measure/entity/AcApMeasureEntity.js.map +1 -0
- package/lib/command/measure/entity/AcApMeasureEntityFactory.d.ts +15 -0
- package/lib/command/measure/entity/AcApMeasureEntityFactory.d.ts.map +1 -0
- package/lib/command/measure/entity/AcApMeasureEntityFactory.js +35 -0
- package/lib/command/measure/entity/AcApMeasureEntityFactory.js.map +1 -0
- package/lib/command/measure/entity/AcApMeasurePointEntity.d.ts +56 -0
- package/lib/command/measure/entity/AcApMeasurePointEntity.d.ts.map +1 -0
- package/lib/command/measure/entity/AcApMeasurePointEntity.js +125 -0
- package/lib/command/measure/entity/AcApMeasurePointEntity.js.map +1 -0
- package/lib/command/measure/entity/index.d.ts +12 -0
- package/lib/command/measure/entity/index.d.ts.map +1 -0
- package/lib/command/measure/entity/index.js +12 -0
- package/lib/command/measure/entity/index.js.map +1 -0
- package/lib/command/measure/index.d.ts +10 -0
- package/lib/command/measure/index.d.ts.map +1 -1
- package/lib/command/measure/index.js +10 -0
- package/lib/command/measure/index.js.map +1 -1
- package/lib/command/modify/AcApCopyCmd.d.ts +1 -1
- package/lib/command/modify/AcApCopyCmd.js +2 -2
- package/lib/command/modify/AcApCopyCmd.js.map +1 -1
- package/lib/command/modify/AcApMoveCmd.js +1 -1
- package/lib/command/modify/AcApMoveCmd.js.map +1 -1
- package/lib/command/modify/AcApOffsetCmd.d.ts +1 -1
- package/lib/command/modify/AcApOffsetCmd.d.ts.map +1 -1
- package/lib/command/modify/AcApOffsetCmd.js +5 -10
- package/lib/command/modify/AcApOffsetCmd.js.map +1 -1
- package/lib/command/modify/AcApRotateCmd.d.ts +1 -1
- package/lib/command/modify/AcApRotateCmd.js +2 -2
- package/lib/command/modify/AcApRotateCmd.js.map +1 -1
- package/lib/command/overlay/AcApHtmlLivePreview.d.ts +121 -0
- package/lib/command/overlay/AcApHtmlLivePreview.d.ts.map +1 -0
- package/lib/command/overlay/AcApHtmlLivePreview.js +193 -0
- package/lib/command/overlay/AcApHtmlLivePreview.js.map +1 -0
- package/lib/command/overlay/AcApOverlayDrawUtil.d.ts +63 -0
- package/lib/command/overlay/AcApOverlayDrawUtil.d.ts.map +1 -0
- package/lib/command/overlay/AcApOverlayDrawUtil.js +115 -0
- package/lib/command/overlay/AcApOverlayDrawUtil.js.map +1 -0
- package/lib/command/overlay/AcApOverlayEntity.d.ts +93 -0
- package/lib/command/overlay/AcApOverlayEntity.d.ts.map +1 -0
- package/lib/command/overlay/AcApOverlayEntity.js +65 -0
- package/lib/command/overlay/AcApOverlayEntity.js.map +1 -0
- package/lib/command/overlay/AcApOverlayGripHost.d.ts +105 -0
- package/lib/command/overlay/AcApOverlayGripHost.d.ts.map +1 -0
- package/lib/command/overlay/AcApOverlayGripHost.js +207 -0
- package/lib/command/overlay/AcApOverlayGripHost.js.map +1 -0
- package/lib/command/overlay/AcApOverlaySerializable.d.ts +20 -0
- package/lib/command/overlay/AcApOverlaySerializable.d.ts.map +1 -0
- package/lib/command/overlay/AcApOverlaySerializable.js +2 -0
- package/lib/command/overlay/AcApOverlaySerializable.js.map +1 -0
- package/lib/command/overlay/index.d.ts +13 -0
- package/lib/command/overlay/index.d.ts.map +1 -0
- package/lib/command/overlay/index.js +13 -0
- package/lib/command/overlay/index.js.map +1 -0
- package/lib/editor/command/AcEdCommand.d.ts.map +1 -1
- package/lib/editor/command/AcEdCommand.js +1 -0
- package/lib/editor/command/AcEdCommand.js.map +1 -1
- package/lib/editor/global/AcEdUiLayout.d.ts +3 -3
- package/lib/editor/global/AcEdUiLayout.d.ts.map +1 -1
- package/lib/editor/global/AcEdUiLayout.js +3 -3
- package/lib/editor/global/AcEdUiLayout.js.map +1 -1
- package/lib/editor/global/AcEdUiTheme.d.ts +1 -1
- package/lib/editor/global/AcEdUiTheme.d.ts.map +1 -1
- package/lib/editor/global/AcEdUiTheme.js +1 -1
- package/lib/editor/global/AcEdUiTheme.js.map +1 -1
- package/lib/editor/global/eventBus.d.ts +5 -0
- package/lib/editor/global/eventBus.d.ts.map +1 -1
- package/lib/editor/global/eventBus.js.map +1 -1
- package/lib/editor/input/ui/AcEdMTextEditor.js +3 -3
- package/lib/editor/input/ui/AcEdMTextEditor.js.map +1 -1
- package/lib/i18n/cs/command.d.ts +60 -0
- package/lib/i18n/cs/command.d.ts.map +1 -1
- package/lib/i18n/cs/command.js +63 -3
- package/lib/i18n/cs/command.js.map +1 -1
- package/lib/i18n/cs/jig.d.ts +1227 -1
- package/lib/i18n/cs/jig.d.ts.map +1 -1
- package/lib/i18n/cs/jig.js +1226 -6
- package/lib/i18n/cs/jig.js.map +1 -1
- package/lib/i18n/cs/main.d.ts +5 -0
- package/lib/i18n/cs/main.d.ts.map +1 -1
- package/lib/i18n/cs/main.js +5 -0
- package/lib/i18n/cs/main.js.map +1 -1
- package/lib/i18n/en/command.d.ts +57 -0
- package/lib/i18n/en/command.d.ts.map +1 -1
- package/lib/i18n/en/command.js +60 -3
- package/lib/i18n/en/command.js.map +1 -1
- package/lib/i18n/en/jig.d.ts +180 -0
- package/lib/i18n/en/jig.d.ts.map +1 -1
- package/lib/i18n/en/jig.js +181 -1
- package/lib/i18n/en/jig.js.map +1 -1
- package/lib/i18n/en/main.d.ts +5 -0
- package/lib/i18n/en/main.d.ts.map +1 -1
- package/lib/i18n/en/main.js +5 -0
- package/lib/i18n/en/main.js.map +1 -1
- package/lib/i18n/tr/command.d.ts +57 -0
- package/lib/i18n/tr/command.d.ts.map +1 -1
- package/lib/i18n/tr/command.js +60 -3
- package/lib/i18n/tr/command.js.map +1 -1
- package/lib/i18n/tr/jig.d.ts +180 -0
- package/lib/i18n/tr/jig.d.ts.map +1 -1
- package/lib/i18n/tr/jig.js +181 -1
- package/lib/i18n/tr/jig.js.map +1 -1
- package/lib/i18n/tr/main.d.ts +7 -0
- package/lib/i18n/tr/main.d.ts.map +1 -1
- package/lib/i18n/tr/main.js +7 -0
- package/lib/i18n/tr/main.js.map +1 -1
- package/lib/i18n/zh/command.d.ts +57 -0
- package/lib/i18n/zh/command.d.ts.map +1 -1
- package/lib/i18n/zh/command.js +60 -3
- package/lib/i18n/zh/command.js.map +1 -1
- package/lib/i18n/zh/jig.d.ts +180 -0
- package/lib/i18n/zh/jig.d.ts.map +1 -1
- package/lib/i18n/zh/jig.js +181 -1
- package/lib/i18n/zh/jig.js.map +1 -1
- package/lib/i18n/zh/main.d.ts +5 -0
- package/lib/i18n/zh/main.d.ts.map +1 -1
- package/lib/i18n/zh/main.js +5 -0
- package/lib/i18n/zh/main.js.map +1 -1
- package/lib/plugin/AcApPluginManager.d.ts.map +1 -1
- package/lib/plugin/AcApPluginManager.js +2 -1
- package/lib/plugin/AcApPluginManager.js.map +1 -1
- package/lib/service/AcApEntitySelection.d.ts +0 -3
- package/lib/service/AcApEntitySelection.d.ts.map +1 -1
- package/lib/service/AcApEntitySelection.js +42 -36
- package/lib/service/AcApEntitySelection.js.map +1 -1
- package/lib/ui/AcApDrawStyle.d.ts +63 -0
- package/lib/ui/AcApDrawStyle.d.ts.map +1 -0
- package/lib/ui/AcApDrawStyle.js +149 -0
- package/lib/ui/AcApDrawStyle.js.map +1 -0
- package/lib/ui/AcApDrawStyleToolbar.d.ts +124 -0
- package/lib/ui/AcApDrawStyleToolbar.d.ts.map +1 -0
- package/lib/ui/AcApDrawStyleToolbar.js +486 -0
- package/lib/ui/AcApDrawStyleToolbar.js.map +1 -0
- package/lib/ui/AcUiDialog.d.ts.map +1 -1
- package/lib/ui/AcUiDialog.js +2 -2
- package/lib/ui/AcUiDialog.js.map +1 -1
- package/lib/ui/index.d.ts +2 -0
- package/lib/ui/index.d.ts.map +1 -1
- package/lib/ui/index.js +2 -0
- package/lib/ui/index.js.map +1 -1
- package/lib/util/AcApDatabaseEdit.d.ts.map +1 -1
- package/lib/util/AcApDatabaseEdit.js +1 -0
- package/lib/util/AcApDatabaseEdit.js.map +1 -1
- package/lib/util/AcApMeasurementUnits.d.ts +52 -0
- package/lib/util/AcApMeasurementUnits.d.ts.map +1 -0
- package/lib/util/AcApMeasurementUnits.js +137 -0
- package/lib/util/AcApMeasurementUnits.js.map +1 -0
- package/lib/util/AcApMeasurementUtil.d.ts +42 -0
- package/lib/util/AcApMeasurementUtil.d.ts.map +1 -0
- package/lib/util/AcApMeasurementUtil.js +98 -0
- package/lib/util/AcApMeasurementUtil.js.map +1 -0
- package/lib/util/AcApScreenHitTest.d.ts +35 -0
- package/lib/util/AcApScreenHitTest.d.ts.map +1 -0
- package/lib/util/AcApScreenHitTest.js +98 -0
- package/lib/util/AcApScreenHitTest.js.map +1 -0
- package/lib/util/index.d.ts +3 -1
- package/lib/util/index.d.ts.map +1 -1
- package/lib/util/index.js +3 -1
- package/lib/util/index.js.map +1 -1
- package/lib/view/AcEdReviewOverlayPick.d.ts +25 -0
- package/lib/view/AcEdReviewOverlayPick.d.ts.map +1 -0
- package/lib/view/AcEdReviewOverlayPick.js +229 -0
- package/lib/view/AcEdReviewOverlayPick.js.map +1 -0
- package/lib/view/AcEdViewKeyHandler.d.ts.map +1 -1
- package/lib/view/AcEdViewKeyHandler.js +53 -0
- package/lib/view/AcEdViewKeyHandler.js.map +1 -1
- package/lib/view/AcTrScene.d.ts +15 -1
- package/lib/view/AcTrScene.d.ts.map +1 -1
- package/lib/view/AcTrScene.js +25 -2
- package/lib/view/AcTrScene.js.map +1 -1
- package/lib/view/AcTrView2d.d.ts +35 -5
- package/lib/view/AcTrView2d.d.ts.map +1 -1
- package/lib/view/AcTrView2d.js +127 -70
- package/lib/view/AcTrView2d.js.map +1 -1
- package/lib/view/index.d.ts +1 -0
- package/lib/view/index.d.ts.map +1 -1
- package/lib/view/index.js +1 -0
- package/lib/view/index.js.map +1 -1
- package/package.json +5 -6
- package/dist/libredwg-parser-worker.js +0 -7525
- package/lib/app/AcApAnnotation.d.ts +0 -47
- package/lib/app/AcApAnnotation.d.ts.map +0 -1
- package/lib/app/AcApAnnotation.js +0 -135
- package/lib/app/AcApAnnotation.js.map +0 -1
- package/lib/command/review/AcApBaseRevCmd.d.ts +0 -36
- package/lib/command/review/AcApBaseRevCmd.d.ts.map +0 -1
- package/lib/command/review/AcApBaseRevCmd.js +0 -68
- package/lib/command/review/AcApBaseRevCmd.js.map +0 -1
- package/lib/command/review/AcApRevCircleCmd.d.ts +0 -18
- package/lib/command/review/AcApRevCircleCmd.d.ts.map +0 -1
- package/lib/command/review/AcApRevCircleCmd.js.map +0 -1
- package/lib/command/review/AcApRevCloudCmd.d.ts +0 -26
- package/lib/command/review/AcApRevCloudCmd.d.ts.map +0 -1
- package/lib/command/review/AcApRevCloudCmd.js +0 -240
- package/lib/command/review/AcApRevCloudCmd.js.map +0 -1
- package/lib/command/review/AcApRevRectCmd.d.ts +0 -18
- package/lib/command/review/AcApRevRectCmd.d.ts.map +0 -1
- package/lib/command/review/AcApRevRectCmd.js +0 -155
- package/lib/command/review/AcApRevRectCmd.js.map +0 -1
- package/lib/command/review/AcApRevVisibilityCmd.d.ts +0 -15
- package/lib/command/review/AcApRevVisibilityCmd.d.ts.map +0 -1
- package/lib/command/review/AcApRevVisibilityCmd.js.map +0 -1
- package/lib/command/review/AcApSketchCmd.d.ts +0 -32
- package/lib/command/review/AcApSketchCmd.d.ts.map +0 -1
- package/lib/command/review/AcApSketchCmd.js +0 -175
- package/lib/command/review/AcApSketchCmd.js.map +0 -1
- package/lib/command/review/index.d.ts +0 -7
- package/lib/command/review/index.d.ts.map +0 -1
- package/lib/command/review/index.js +0 -7
- package/lib/command/review/index.js.map +0 -1
- package/lib/util/AcApMeasurementElementGenerator.d.ts +0 -36
- package/lib/util/AcApMeasurementElementGenerator.d.ts.map +0 -1
- package/lib/util/AcApMeasurementElementGenerator.js +0 -92
- package/lib/util/AcApMeasurementElementGenerator.js.map +0 -1
|
@@ -0,0 +1,257 @@
|
|
|
1
|
+
import { acapColorToCssAlpha, acapCssColor } from '../../../util';
|
|
2
|
+
/**
|
|
3
|
+
* Sizes and clears a measure overlay canvas to match the view viewport.
|
|
4
|
+
*
|
|
5
|
+
* Aligns the canvas with the view's drawing surface (including device pixel
|
|
6
|
+
* ratio), clears previous content, and returns a 2D context scaled so that
|
|
7
|
+
* subsequent drawing uses CSS pixels.
|
|
8
|
+
*
|
|
9
|
+
* @param canvas - Overlay canvas element to prepare
|
|
10
|
+
* @param view - View whose canvas bounds and transforms define the overlay
|
|
11
|
+
* @returns Context and DPR when preparation succeeds; `null` if 2D context is unavailable
|
|
12
|
+
*/
|
|
13
|
+
function prepareMeasureCanvas(canvas, view) {
|
|
14
|
+
var rect = view.canvas.getBoundingClientRect();
|
|
15
|
+
var dpr = window.devicePixelRatio || 1;
|
|
16
|
+
var w = Math.round(rect.width);
|
|
17
|
+
var h = Math.round(rect.height);
|
|
18
|
+
var origin = view.canvasToContainer({ x: 0, y: 0 });
|
|
19
|
+
canvas.style.left = "".concat(origin.x, "px");
|
|
20
|
+
canvas.style.top = "".concat(origin.y, "px");
|
|
21
|
+
canvas.style.width = "".concat(w, "px");
|
|
22
|
+
canvas.style.height = "".concat(h, "px");
|
|
23
|
+
if (canvas.width !== w * dpr || canvas.height !== h * dpr) {
|
|
24
|
+
canvas.width = w * dpr;
|
|
25
|
+
canvas.height = h * dpr;
|
|
26
|
+
}
|
|
27
|
+
var ctx = canvas.getContext('2d');
|
|
28
|
+
if (!ctx)
|
|
29
|
+
return null;
|
|
30
|
+
ctx.clearRect(0, 0, canvas.width, canvas.height);
|
|
31
|
+
ctx.save();
|
|
32
|
+
ctx.scale(dpr, dpr);
|
|
33
|
+
return { ctx: ctx, dpr: dpr };
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Normalizes an angle in radians to the half-open interval `[0, 2π)`.
|
|
37
|
+
*
|
|
38
|
+
* @param a - Angle in radians (any real value)
|
|
39
|
+
* @returns Equivalent angle in `[0, 2π)`
|
|
40
|
+
*/
|
|
41
|
+
var normaliseAngle = function (a) {
|
|
42
|
+
return ((a % (2 * Math.PI)) + 2 * Math.PI) % (2 * Math.PI);
|
|
43
|
+
};
|
|
44
|
+
/**
|
|
45
|
+
* Strokes a single world-space segment onto a measure overlay canvas.
|
|
46
|
+
*
|
|
47
|
+
* @param canvas - Overlay canvas to paint
|
|
48
|
+
* @param view - View for world-to-screen conversion and canvas sizing
|
|
49
|
+
* @param p1 - Segment start in world coordinates
|
|
50
|
+
* @param p2 - Segment end in world coordinates
|
|
51
|
+
* @param color - Stroke color
|
|
52
|
+
* @param lineWidth - Stroke width in CSS pixels (default `2`)
|
|
53
|
+
*/
|
|
54
|
+
export function drawMeasureSegmentOnCanvas(canvas, view, p1, p2, color, lineWidth) {
|
|
55
|
+
if (lineWidth === void 0) { lineWidth = 2; }
|
|
56
|
+
var prepared = prepareMeasureCanvas(canvas, view);
|
|
57
|
+
if (!prepared)
|
|
58
|
+
return;
|
|
59
|
+
var ctx = prepared.ctx;
|
|
60
|
+
var a = view.worldToScreen(p1);
|
|
61
|
+
var b = view.worldToScreen(p2);
|
|
62
|
+
ctx.beginPath();
|
|
63
|
+
ctx.moveTo(a.x, a.y);
|
|
64
|
+
ctx.lineTo(b.x, b.y);
|
|
65
|
+
ctx.strokeStyle = acapCssColor(color);
|
|
66
|
+
ctx.lineWidth = lineWidth;
|
|
67
|
+
ctx.stroke();
|
|
68
|
+
ctx.restore();
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* Draws angle arm lines plus the measurement arc on a measure overlay canvas.
|
|
72
|
+
*
|
|
73
|
+
* Converts `vertex`, `arm1`, and `arm2` to screen space, strokes both arms,
|
|
74
|
+
* then draws the shorter angular sector with a radius derived from the shorter
|
|
75
|
+
* arm length (with a minimum).
|
|
76
|
+
*
|
|
77
|
+
* @param canvas - Overlay canvas to paint
|
|
78
|
+
* @param view - View for world-to-screen conversion and canvas sizing
|
|
79
|
+
* @param vertex - Angle vertex in world coordinates
|
|
80
|
+
* @param arm1 - First arm endpoint in world coordinates
|
|
81
|
+
* @param arm2 - Second arm endpoint in world coordinates
|
|
82
|
+
* @param color - Stroke color
|
|
83
|
+
* @param lineWidth - Stroke width in CSS pixels (default `2`)
|
|
84
|
+
*/
|
|
85
|
+
export function drawMeasureAngleArcOnCanvas(canvas, view, vertex, arm1, arm2, color, lineWidth) {
|
|
86
|
+
if (lineWidth === void 0) { lineWidth = 2; }
|
|
87
|
+
var prepared = prepareMeasureCanvas(canvas, view);
|
|
88
|
+
if (!prepared)
|
|
89
|
+
return;
|
|
90
|
+
var ctx = prepared.ctx;
|
|
91
|
+
var sv = view.worldToScreen(vertex);
|
|
92
|
+
var sa1 = view.worldToScreen(arm1);
|
|
93
|
+
var sa2 = view.worldToScreen(arm2);
|
|
94
|
+
ctx.strokeStyle = acapCssColor(color);
|
|
95
|
+
ctx.lineWidth = lineWidth;
|
|
96
|
+
ctx.beginPath();
|
|
97
|
+
ctx.moveTo(sv.x, sv.y);
|
|
98
|
+
ctx.lineTo(sa1.x, sa1.y);
|
|
99
|
+
ctx.moveTo(sv.x, sv.y);
|
|
100
|
+
ctx.lineTo(sa2.x, sa2.y);
|
|
101
|
+
ctx.stroke();
|
|
102
|
+
var len1 = Math.hypot(sa1.x - sv.x, sa1.y - sv.y);
|
|
103
|
+
var len2 = Math.hypot(sa2.x - sv.x, sa2.y - sv.y);
|
|
104
|
+
var arcR = Math.max(Math.min(len1, len2) * 0.3, 15);
|
|
105
|
+
var startAngle = Math.atan2(sa1.y - sv.y, sa1.x - sv.x);
|
|
106
|
+
var endAngle = Math.atan2(sa2.y - sv.y, sa2.x - sv.x);
|
|
107
|
+
var antiClockwise = normaliseAngle(endAngle - startAngle) > Math.PI;
|
|
108
|
+
ctx.beginPath();
|
|
109
|
+
ctx.arc(sv.x, sv.y, arcR, startAngle, endAngle, antiClockwise);
|
|
110
|
+
ctx.stroke();
|
|
111
|
+
ctx.restore();
|
|
112
|
+
}
|
|
113
|
+
/**
|
|
114
|
+
* Draws a filled polygon for an area measurement on a measure overlay canvas.
|
|
115
|
+
*
|
|
116
|
+
* Requires at least three points. Fills with a translucent tint of `color` and
|
|
117
|
+
* strokes the closed outline.
|
|
118
|
+
*
|
|
119
|
+
* @param canvas - Overlay canvas to paint
|
|
120
|
+
* @param view - View for world-to-screen conversion and canvas sizing
|
|
121
|
+
* @param points - Polygon vertices in world coordinates (closed implicitly)
|
|
122
|
+
* @param color - Fill and stroke color
|
|
123
|
+
* @param lineWidth - Stroke width in CSS pixels (default `2.5`)
|
|
124
|
+
*/
|
|
125
|
+
export function drawMeasureAreaOnCanvas(canvas, view, points, color, lineWidth) {
|
|
126
|
+
if (lineWidth === void 0) { lineWidth = 2.5; }
|
|
127
|
+
var prepared = prepareMeasureCanvas(canvas, view);
|
|
128
|
+
if (!prepared || points.length < 3) {
|
|
129
|
+
prepared === null || prepared === void 0 ? void 0 : prepared.ctx.restore();
|
|
130
|
+
return;
|
|
131
|
+
}
|
|
132
|
+
var ctx = prepared.ctx;
|
|
133
|
+
var spts = points.map(function (p) { return view.worldToScreen(p); });
|
|
134
|
+
ctx.beginPath();
|
|
135
|
+
ctx.moveTo(spts[0].x, spts[0].y);
|
|
136
|
+
for (var i = 1; i < spts.length; i++)
|
|
137
|
+
ctx.lineTo(spts[i].x, spts[i].y);
|
|
138
|
+
ctx.closePath();
|
|
139
|
+
ctx.fillStyle = acapColorToCssAlpha(color, 0.2);
|
|
140
|
+
ctx.fill();
|
|
141
|
+
ctx.strokeStyle = acapCssColor(color);
|
|
142
|
+
ctx.lineWidth = lineWidth;
|
|
143
|
+
ctx.stroke();
|
|
144
|
+
ctx.restore();
|
|
145
|
+
}
|
|
146
|
+
/**
|
|
147
|
+
* Strokes the shorter arc between two points on a circle onto a measure canvas.
|
|
148
|
+
*
|
|
149
|
+
* Screen radius is taken from the distance of `p1` to the projected center so
|
|
150
|
+
* the stroke tracks the circle under the current view transform.
|
|
151
|
+
*
|
|
152
|
+
* @param canvas - Overlay canvas to paint
|
|
153
|
+
* @param view - View for world-to-screen conversion and canvas sizing
|
|
154
|
+
* @param g - Circle center and radius in world coordinates
|
|
155
|
+
* @param p1 - Arc start point in world coordinates (on or near the circle)
|
|
156
|
+
* @param p2 - Arc end point in world coordinates (on or near the circle)
|
|
157
|
+
* @param color - Stroke color
|
|
158
|
+
* @param lineWidth - Stroke width in CSS pixels (default `4`)
|
|
159
|
+
*/
|
|
160
|
+
export function drawMeasureArcOnCanvas(canvas, view, g, p1, p2, color, lineWidth) {
|
|
161
|
+
if (lineWidth === void 0) { lineWidth = 4; }
|
|
162
|
+
var prepared = prepareMeasureCanvas(canvas, view);
|
|
163
|
+
if (!prepared)
|
|
164
|
+
return;
|
|
165
|
+
var ctx = prepared.ctx;
|
|
166
|
+
var sc = view.worldToScreen({ x: g.cx, y: g.cy });
|
|
167
|
+
var ss = view.worldToScreen(p1);
|
|
168
|
+
var se = view.worldToScreen(p2);
|
|
169
|
+
var screenR = Math.hypot(ss.x - sc.x, ss.y - sc.y);
|
|
170
|
+
var sa = Math.atan2(ss.y - sc.y, ss.x - sc.x);
|
|
171
|
+
var ea = Math.atan2(se.y - sc.y, se.x - sc.x);
|
|
172
|
+
var cwSpan = normaliseAngle(ea - sa);
|
|
173
|
+
var antiClockwise = cwSpan > Math.PI;
|
|
174
|
+
ctx.beginPath();
|
|
175
|
+
ctx.arc(sc.x, sc.y, screenR, sa, ea, antiClockwise);
|
|
176
|
+
ctx.strokeStyle = acapCssColor(color);
|
|
177
|
+
ctx.lineWidth = lineWidth;
|
|
178
|
+
ctx.stroke();
|
|
179
|
+
ctx.restore();
|
|
180
|
+
}
|
|
181
|
+
/**
|
|
182
|
+
* Computes the shorter arc length between two points on a circle.
|
|
183
|
+
*
|
|
184
|
+
* @param p1 - First point in world coordinates
|
|
185
|
+
* @param p2 - Second point in world coordinates
|
|
186
|
+
* @param g - Circle center and radius
|
|
187
|
+
* @returns Arc length along the shorter sector (`min(span, 2π − span) × r`)
|
|
188
|
+
*/
|
|
189
|
+
export function measureShortArcLength(p1, p2, g) {
|
|
190
|
+
var a1 = Math.atan2(p1.y - g.cy, p1.x - g.cx);
|
|
191
|
+
var a2 = Math.atan2(p2.y - g.cy, p2.x - g.cx);
|
|
192
|
+
var span = normaliseAngle(a2 - a1);
|
|
193
|
+
return Math.min(span, 2 * Math.PI - span) * g.r;
|
|
194
|
+
}
|
|
195
|
+
/**
|
|
196
|
+
* Finds the midpoint of the shorter arc between two points on a circle.
|
|
197
|
+
*
|
|
198
|
+
* @param p1 - Arc start in world coordinates
|
|
199
|
+
* @param p2 - Arc end in world coordinates
|
|
200
|
+
* @param g - Circle center and radius
|
|
201
|
+
* @returns Midpoint on the shorter arc with `z: 0`
|
|
202
|
+
*/
|
|
203
|
+
export function measureShortArcMid(p1, p2, g) {
|
|
204
|
+
var a1 = Math.atan2(p1.y - g.cy, p1.x - g.cx);
|
|
205
|
+
var a2 = Math.atan2(p2.y - g.cy, p2.x - g.cx);
|
|
206
|
+
var ccwSpan = normaliseAngle(a2 - a1);
|
|
207
|
+
var mid = ccwSpan <= Math.PI ? a1 + ccwSpan / 2 : a1 - (2 * Math.PI - ccwSpan) / 2;
|
|
208
|
+
return { x: g.cx + g.r * Math.cos(mid), y: g.cy + g.r * Math.sin(mid), z: 0 };
|
|
209
|
+
}
|
|
210
|
+
/**
|
|
211
|
+
* Computes polygon area using the shoelace formula.
|
|
212
|
+
*
|
|
213
|
+
* @param pts - Polygon vertices in world coordinates (assumed closed)
|
|
214
|
+
* @returns Absolute area (half the absolute shoelace sum)
|
|
215
|
+
*/
|
|
216
|
+
export function measureShoelaceArea(pts) {
|
|
217
|
+
var area = 0;
|
|
218
|
+
var n = pts.length;
|
|
219
|
+
for (var i = 0; i < n; i++) {
|
|
220
|
+
var j = (i + 1) % n;
|
|
221
|
+
area += pts[i].x * pts[j].y;
|
|
222
|
+
area -= pts[j].x * pts[i].y;
|
|
223
|
+
}
|
|
224
|
+
return Math.abs(area) / 2;
|
|
225
|
+
}
|
|
226
|
+
/**
|
|
227
|
+
* Computes the arithmetic mean of polygon vertices (simple centroid).
|
|
228
|
+
*
|
|
229
|
+
* @param pts - Vertices in world coordinates (must be non-empty)
|
|
230
|
+
* @returns Average `{ x, y }` of the points
|
|
231
|
+
*/
|
|
232
|
+
export function measureCentroid(pts) {
|
|
233
|
+
var x = pts.reduce(function (s, p) { return s + p.x; }, 0) / pts.length;
|
|
234
|
+
var y = pts.reduce(function (s, p) { return s + p.y; }, 0) / pts.length;
|
|
235
|
+
return { x: x, y: y };
|
|
236
|
+
}
|
|
237
|
+
/**
|
|
238
|
+
* Computes the smaller angle at `vertex` between `arm1` and `arm2`, in degrees.
|
|
239
|
+
*
|
|
240
|
+
* Uses atan2 of cross/dot products so the result is in `[0, 180]`.
|
|
241
|
+
*
|
|
242
|
+
* @param vertex - Angle vertex in world coordinates
|
|
243
|
+
* @param arm1 - First arm endpoint in world coordinates
|
|
244
|
+
* @param arm2 - Second arm endpoint in world coordinates
|
|
245
|
+
* @returns Interior (smaller) angle in degrees
|
|
246
|
+
*/
|
|
247
|
+
export function measureAngleDeg(vertex, arm1, arm2) {
|
|
248
|
+
var dx1 = arm1.x - vertex.x;
|
|
249
|
+
var dy1 = arm1.y - vertex.y;
|
|
250
|
+
var dx2 = arm2.x - vertex.x;
|
|
251
|
+
var dy2 = arm2.y - vertex.y;
|
|
252
|
+
var dot = dx1 * dx2 + dy1 * dy2;
|
|
253
|
+
var cross = dx1 * dy2 - dy1 * dx2;
|
|
254
|
+
var rad = Math.atan2(Math.abs(cross), dot);
|
|
255
|
+
return (rad * 180) / Math.PI;
|
|
256
|
+
}
|
|
257
|
+
//# sourceMappingURL=AcApMeasureDrawUtil.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AcApMeasureDrawUtil.js","sourceRoot":"","sources":["../../../../src/command/measure/entity/AcApMeasureDrawUtil.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,mBAAmB,EAAE,YAAY,EAAE,MAAM,eAAe,CAAA;AAYjE;;;;;;;;;;GAUG;AACH,SAAS,oBAAoB,CAC3B,MAAyB,EACzB,IAAkB;IAElB,IAAM,IAAI,GAAG,IAAI,CAAC,MAAM,CAAC,qBAAqB,EAAE,CAAA;IAChD,IAAM,GAAG,GAAG,MAAM,CAAC,gBAAgB,IAAI,CAAC,CAAA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IAC7B,IAAM,GAAG,GAAG,IAAI,CAAC,CAAC,GAAG,MAAM,CAAC,CAAC,CAAA;IAC7B,IAAM,GAAG,GAAG,IAAI,CAAC,CAAC,GAAG,MAAM,CAAC,CAAC,CAAA;IAC7B,IAAM,GAAG,GAAG,IAAI,CAAC,CAAC,GAAG,MAAM,CAAC,CAAC,CAAA;IAC7B,IAAM,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,CAAA;IACjC,IAAM,KAAK,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,CAAA;IACnC,IAAM,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE,GAAG,CAAC,CAAA;IAC5C,OAAO,CAAC,GAAG,GAAG,GAAG,CAAC,GAAG,IAAI,CAAC,EAAE,CAAA;AAC9B,CAAC"}
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
import type { AcDbDatabase, AcGePoint3dLike } from '@mlightcad/data-model';
|
|
2
|
+
import { AcTrHtmlGroup } from '@mlightcad/three-renderer';
|
|
3
|
+
import type { AcApMeasurementStyle } from '../../../util';
|
|
4
|
+
import type { AcTrView2d } from '../../../view';
|
|
5
|
+
import { AcApOverlayEntity, type AcApOverlaySerializable, type AcApOverlayWorldDrawResult } from '../../overlay';
|
|
6
|
+
import { type AcApMeasurementGroupExtras } from '../AcApMeasurementStore';
|
|
7
|
+
import type { AcApMeasurementRecord } from '../AcApMeasurementTypes';
|
|
8
|
+
/**
|
|
9
|
+
* Options shared by measurement entity constructors.
|
|
10
|
+
*
|
|
11
|
+
* Concrete measure entities pass these into {@link AcApMeasureEntity} so id,
|
|
12
|
+
* layout, and visual style are consistent across distance, angle, area, arc,
|
|
13
|
+
* and point measurements.
|
|
14
|
+
*/
|
|
15
|
+
export interface AcApMeasureEntityOptions {
|
|
16
|
+
/** Optional stable id; when omitted, subclasses generate a typed timestamp id. */
|
|
17
|
+
id?: string;
|
|
18
|
+
/** Layout BTR id to bind the HTML group to, or omit for the active layout. */
|
|
19
|
+
layoutId?: string;
|
|
20
|
+
/** Visual style (color, line weight, font size) for CAD and HTML overlays. */
|
|
21
|
+
style: AcApMeasurementStyle;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Result of drawing a measurement: HTML group plus store extras for commit.
|
|
25
|
+
*
|
|
26
|
+
* Extends the overlay world-draw result with {@link extras} consumed by
|
|
27
|
+
* {@link commitMeasurementGroup} when persisting the measurement.
|
|
28
|
+
*
|
|
29
|
+
* Put CAD / listener teardown on {@link AcApOverlayWorldDrawResult.dispose};
|
|
30
|
+
* {@link AcApMeasureEntity.commit} wires that into `extras.dispose` so the
|
|
31
|
+
* store always runs it. Do not duplicate cleanup in `extras.dispose`.
|
|
32
|
+
*/
|
|
33
|
+
export interface AcApMeasureWorldDrawResult extends AcApOverlayWorldDrawResult {
|
|
34
|
+
/** Store payload (style, value, snapshot, redraw) for commit. */
|
|
35
|
+
extras: AcApMeasurementGroupExtras;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Base class for measurement overlays (distance / angle / area / arc / point).
|
|
39
|
+
*
|
|
40
|
+
* Not an HTML leaf — composes {@link AcTrHtmlGroup} and canvas / badge / dot
|
|
41
|
+
* children. Subclasses implement {@link toRecord} and
|
|
42
|
+
* {@link subWorldDrawWithDb}; callers should use {@link commit} rather than
|
|
43
|
+
* the generic overlay `worldDraw` path because unit labels need the database.
|
|
44
|
+
*
|
|
45
|
+
* Implements {@link AcApOverlaySerializable} via {@link toRecord}. Rehydrate
|
|
46
|
+
* with {@link import('./AcApMeasureEntityFactory').createMeasureEntityFromRecord}.
|
|
47
|
+
*/
|
|
48
|
+
export declare abstract class AcApMeasureEntity extends AcApOverlayEntity implements AcApOverlaySerializable<AcApMeasurementRecord> {
|
|
49
|
+
/** Visual style applied to HTML badges/dots and canvas strokes. */
|
|
50
|
+
protected readonly style: AcApMeasurementStyle;
|
|
51
|
+
/** Stable measurement id used for HTML group, store, and sidecar records. */
|
|
52
|
+
protected readonly entityId: string;
|
|
53
|
+
/** Optional layout override from construction options. */
|
|
54
|
+
protected readonly layoutIdOption: string | undefined;
|
|
55
|
+
/**
|
|
56
|
+
* Creates a measure entity with the given id, layout, and style.
|
|
57
|
+
*
|
|
58
|
+
* @param id - Stable measurement identifier
|
|
59
|
+
* @param layoutId - Layout BTR id, or `undefined` to resolve from the view
|
|
60
|
+
* @param style - Measurement visual style
|
|
61
|
+
*/
|
|
62
|
+
constructor(id: string, layoutId: string | undefined, style: AcApMeasurementStyle);
|
|
63
|
+
/**
|
|
64
|
+
* Stable identifier for this measurement entity.
|
|
65
|
+
*
|
|
66
|
+
* @returns The entity id used in the HTML group and store
|
|
67
|
+
*/
|
|
68
|
+
get id(): string;
|
|
69
|
+
/**
|
|
70
|
+
* Builds a serializable snapshot of this measurement.
|
|
71
|
+
*
|
|
72
|
+
* Geometry is taken from construction-time fields; `layoutId` may override
|
|
73
|
+
* the layout stored on the record.
|
|
74
|
+
*
|
|
75
|
+
* @param layoutId - Optional layout BTR id written onto the record
|
|
76
|
+
* @returns Sidecar-ready measurement record
|
|
77
|
+
*/
|
|
78
|
+
abstract toRecord(layoutId?: string): AcApMeasurementRecord;
|
|
79
|
+
/**
|
|
80
|
+
* Hit-tests this measurement's geometry against a canvas point.
|
|
81
|
+
*
|
|
82
|
+
* Delegates to {@link hitTestMeasurementGeometry} using
|
|
83
|
+
* {@link toRecord}'s geometry.
|
|
84
|
+
*
|
|
85
|
+
* @param canvas - Pointer position in canvas/screen coordinates
|
|
86
|
+
* @param worldToScreen - Converts world XY to screen for distance checks
|
|
87
|
+
* @param threshold - Hit tolerance in screen pixels
|
|
88
|
+
* @returns `true` if the point is within threshold of the geometry
|
|
89
|
+
*/
|
|
90
|
+
hitTest(canvas: {
|
|
91
|
+
x: number;
|
|
92
|
+
y: number;
|
|
93
|
+
}, worldToScreen: (point: {
|
|
94
|
+
x: number;
|
|
95
|
+
y: number;
|
|
96
|
+
}) => {
|
|
97
|
+
x: number;
|
|
98
|
+
y: number;
|
|
99
|
+
}, threshold: number): boolean;
|
|
100
|
+
/**
|
|
101
|
+
* Builds visuals and commits them to the measurement store / HTML manager.
|
|
102
|
+
*
|
|
103
|
+
* Calls {@link subWorldDrawWithDb}, then {@link commitMeasurementGroup}
|
|
104
|
+
* with the resulting group and extras. Uses {@link AcApOverlayWorldDrawResult.dispose}
|
|
105
|
+
* as the store's dispose hook so entity cleanup cannot be dropped.
|
|
106
|
+
*
|
|
107
|
+
* @param view - Active 2D view hosting HTML overlays and CAD transients
|
|
108
|
+
* @param db - Drawing database used for unit/format labels
|
|
109
|
+
*/
|
|
110
|
+
commit(view: AcTrView2d, db: AcDbDatabase): void;
|
|
111
|
+
/**
|
|
112
|
+
* Overlay `worldDraw` hook — not supported for measurements.
|
|
113
|
+
*
|
|
114
|
+
* Prefer {@link commit}; measure draw needs the database for unit labels.
|
|
115
|
+
*
|
|
116
|
+
* @param view - Active 2D view (unused)
|
|
117
|
+
* @returns Never returns; always throws
|
|
118
|
+
* @throws Error directing callers to use {@link commit}
|
|
119
|
+
*/
|
|
120
|
+
protected subWorldDraw(view: AcTrView2d): AcApOverlayWorldDrawResult;
|
|
121
|
+
/**
|
|
122
|
+
* Builds the HTML group, CAD transients, and store extras for this measure.
|
|
123
|
+
*
|
|
124
|
+
* @param view - Active 2D view
|
|
125
|
+
* @param db - Drawing database for formatting measured values
|
|
126
|
+
* @returns World-draw result including commit extras
|
|
127
|
+
*/
|
|
128
|
+
protected abstract subWorldDrawWithDb(view: AcTrView2d, db: AcDbDatabase): AcApMeasureWorldDrawResult;
|
|
129
|
+
/**
|
|
130
|
+
* Creates an empty selectable HTML group on the measurement layer.
|
|
131
|
+
*
|
|
132
|
+
* @param view - View used to resolve the active layout when needed
|
|
133
|
+
* @returns New {@link AcTrHtmlGroup} for this entity id
|
|
134
|
+
*/
|
|
135
|
+
protected createGroup(view: AcTrView2d): AcTrHtmlGroup;
|
|
136
|
+
/**
|
|
137
|
+
* Resolves the layout id for HTML overlays.
|
|
138
|
+
*
|
|
139
|
+
* Uses {@link layoutIdOption} when set; otherwise the view's active layout
|
|
140
|
+
* BTR id.
|
|
141
|
+
*
|
|
142
|
+
* @param view - View providing the active layout fallback
|
|
143
|
+
* @returns Layout BTR id, or `undefined` if neither is available
|
|
144
|
+
*/
|
|
145
|
+
protected resolveLayoutId(view: AcTrView2d): string | undefined;
|
|
146
|
+
}
|
|
147
|
+
export type { AcGePoint3dLike };
|
|
148
|
+
//# sourceMappingURL=AcApMeasureEntity.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AcApMeasureEntity.d.ts","sourceRoot":"","sources":["../../../../src/command/measure/entity/AcApMeasureEntity.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,YAAY,EACZ,eAAe,EAChB,MAAM,uBAAuB,CAAA;AAC9B,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAA;AAEzD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAA;AACzD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAC/C,OAAO,EACL,iBAAiB,EACjB,KAAK,uBAAuB,EAC5B,KAAK,0BAA0B,EAChC,MAAM,eAAe,CAAA;AAEtB,OAAO,EACL,KAAK,0BAA0B,EAGhC,MAAM,yBAAyB,CAAA;AAChC,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAA;AAEpE;;;;;;GAMG;AACH,MAAM,WAAW,wBAAwB;IACvC,kFAAkF;IAClF,EAAE,CAAC,EAAE,MAAM,CAAA;IACX,8EAA8E;IAC9E,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,8EAA8E;IAC9E,KAAK,EAAE,oBAAoB,CAAA;CAC5B;AAED;;;;;;;;;GASG;AACH,MAAM,WAAW,0BAA2B,SAAQ,0BAA0B;IAC5E,iEAAiE;IAC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;;OAKG;IACH,SAAS,CAAC,WAAW,CAAC,IAAI,EAAE,UAAU,GAAG,aAAa;IAStD;;;;;;;;OAQG;IACH,SAAS,CAAC,eAAe,CAAC,IAAI,EAAE,UAAU,GAAG,MAAM,GAAG,SAAS;CAGhE;AAED,YAAY,EAAE,eAAe,EAAE,CAAA"}
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
var __extends = (this && this.__extends) || (function () {
|
|
2
|
+
var extendStatics = function (d, b) {
|
|
3
|
+
extendStatics = Object.setPrototypeOf ||
|
|
4
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
5
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
6
|
+
return extendStatics(d, b);
|
|
7
|
+
};
|
|
8
|
+
return function (d, b) {
|
|
9
|
+
if (typeof b !== "function" && b !== null)
|
|
10
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
11
|
+
extendStatics(d, b);
|
|
12
|
+
function __() { this.constructor = d; }
|
|
13
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
14
|
+
};
|
|
15
|
+
})();
|
|
16
|
+
var __assign = (this && this.__assign) || function () {
|
|
17
|
+
__assign = Object.assign || function(t) {
|
|
18
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
19
|
+
s = arguments[i];
|
|
20
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
21
|
+
t[p] = s[p];
|
|
22
|
+
}
|
|
23
|
+
return t;
|
|
24
|
+
};
|
|
25
|
+
return __assign.apply(this, arguments);
|
|
26
|
+
};
|
|
27
|
+
import { AcTrHtmlGroup } from '@mlightcad/three-renderer';
|
|
28
|
+
import { AcApOverlayEntity } from '../../overlay';
|
|
29
|
+
import { hitTestMeasurementGeometry } from '../AcApMeasurementGeometry';
|
|
30
|
+
import { commitMeasurementGroup, MEASUREMENT_LAYER } from '../AcApMeasurementStore';
|
|
31
|
+
/**
|
|
32
|
+
* Base class for measurement overlays (distance / angle / area / arc / point).
|
|
33
|
+
*
|
|
34
|
+
* Not an HTML leaf — composes {@link AcTrHtmlGroup} and canvas / badge / dot
|
|
35
|
+
* children. Subclasses implement {@link toRecord} and
|
|
36
|
+
* {@link subWorldDrawWithDb}; callers should use {@link commit} rather than
|
|
37
|
+
* the generic overlay `worldDraw` path because unit labels need the database.
|
|
38
|
+
*
|
|
39
|
+
* Implements {@link AcApOverlaySerializable} via {@link toRecord}. Rehydrate
|
|
40
|
+
* with {@link import('./AcApMeasureEntityFactory').createMeasureEntityFromRecord}.
|
|
41
|
+
*/
|
|
42
|
+
var AcApMeasureEntity = /** @class */ (function (_super) {
|
|
43
|
+
__extends(AcApMeasureEntity, _super);
|
|
44
|
+
/**
|
|
45
|
+
* Creates a measure entity with the given id, layout, and style.
|
|
46
|
+
*
|
|
47
|
+
* @param id - Stable measurement identifier
|
|
48
|
+
* @param layoutId - Layout BTR id, or `undefined` to resolve from the view
|
|
49
|
+
* @param style - Measurement visual style
|
|
50
|
+
*/
|
|
51
|
+
function AcApMeasureEntity(id, layoutId, style) {
|
|
52
|
+
var _this = _super.call(this) || this;
|
|
53
|
+
_this.entityId = id;
|
|
54
|
+
_this.layoutIdOption = layoutId;
|
|
55
|
+
_this.style = style;
|
|
56
|
+
return _this;
|
|
57
|
+
}
|
|
58
|
+
Object.defineProperty(AcApMeasureEntity.prototype, "id", {
|
|
59
|
+
/**
|
|
60
|
+
* Stable identifier for this measurement entity.
|
|
61
|
+
*
|
|
62
|
+
* @returns The entity id used in the HTML group and store
|
|
63
|
+
*/
|
|
64
|
+
get: function () {
|
|
65
|
+
return this.entityId;
|
|
66
|
+
},
|
|
67
|
+
enumerable: false,
|
|
68
|
+
configurable: true
|
|
69
|
+
});
|
|
70
|
+
/**
|
|
71
|
+
* Hit-tests this measurement's geometry against a canvas point.
|
|
72
|
+
*
|
|
73
|
+
* Delegates to {@link hitTestMeasurementGeometry} using
|
|
74
|
+
* {@link toRecord}'s geometry.
|
|
75
|
+
*
|
|
76
|
+
* @param canvas - Pointer position in canvas/screen coordinates
|
|
77
|
+
* @param worldToScreen - Converts world XY to screen for distance checks
|
|
78
|
+
* @param threshold - Hit tolerance in screen pixels
|
|
79
|
+
* @returns `true` if the point is within threshold of the geometry
|
|
80
|
+
*/
|
|
81
|
+
AcApMeasureEntity.prototype.hitTest = function (canvas, worldToScreen, threshold) {
|
|
82
|
+
return hitTestMeasurementGeometry(this.toRecord().geometry, canvas, worldToScreen, threshold);
|
|
83
|
+
};
|
|
84
|
+
/**
|
|
85
|
+
* Builds visuals and commits them to the measurement store / HTML manager.
|
|
86
|
+
*
|
|
87
|
+
* Calls {@link subWorldDrawWithDb}, then {@link commitMeasurementGroup}
|
|
88
|
+
* with the resulting group and extras. Uses {@link AcApOverlayWorldDrawResult.dispose}
|
|
89
|
+
* as the store's dispose hook so entity cleanup cannot be dropped.
|
|
90
|
+
*
|
|
91
|
+
* @param view - Active 2D view hosting HTML overlays and CAD transients
|
|
92
|
+
* @param db - Drawing database used for unit/format labels
|
|
93
|
+
*/
|
|
94
|
+
AcApMeasureEntity.prototype.commit = function (view, db) {
|
|
95
|
+
var drawn = this.subWorldDrawWithDb(view, db);
|
|
96
|
+
commitMeasurementGroup(view, drawn.group, __assign(__assign({}, drawn.extras), { dispose: drawn.dispose }));
|
|
97
|
+
};
|
|
98
|
+
/**
|
|
99
|
+
* Overlay `worldDraw` hook — not supported for measurements.
|
|
100
|
+
*
|
|
101
|
+
* Prefer {@link commit}; measure draw needs the database for unit labels.
|
|
102
|
+
*
|
|
103
|
+
* @param view - Active 2D view (unused)
|
|
104
|
+
* @returns Never returns; always throws
|
|
105
|
+
* @throws Error directing callers to use {@link commit}
|
|
106
|
+
*/
|
|
107
|
+
AcApMeasureEntity.prototype.subWorldDraw = function (view) {
|
|
108
|
+
void view;
|
|
109
|
+
throw new Error('Use AcApMeasureEntity.commit(view, db) instead of worldDraw');
|
|
110
|
+
};
|
|
111
|
+
/**
|
|
112
|
+
* Creates an empty selectable HTML group on the measurement layer.
|
|
113
|
+
*
|
|
114
|
+
* @param view - View used to resolve the active layout when needed
|
|
115
|
+
* @returns New {@link AcTrHtmlGroup} for this entity id
|
|
116
|
+
*/
|
|
117
|
+
AcApMeasureEntity.prototype.createGroup = function (view) {
|
|
118
|
+
return new AcTrHtmlGroup({
|
|
119
|
+
id: this.entityId,
|
|
120
|
+
layer: MEASUREMENT_LAYER,
|
|
121
|
+
layoutId: this.resolveLayoutId(view),
|
|
122
|
+
selectable: true
|
|
123
|
+
});
|
|
124
|
+
};
|
|
125
|
+
/**
|
|
126
|
+
* Resolves the layout id for HTML overlays.
|
|
127
|
+
*
|
|
128
|
+
* Uses {@link layoutIdOption} when set; otherwise the view's active layout
|
|
129
|
+
* BTR id.
|
|
130
|
+
*
|
|
131
|
+
* @param view - View providing the active layout fallback
|
|
132
|
+
* @returns Layout BTR id, or `undefined` if neither is available
|
|
133
|
+
*/
|
|
134
|
+
AcApMeasureEntity.prototype.resolveLayoutId = function (view) {
|
|
135
|
+
var _a;
|
|
136
|
+
return (_a = this.layoutIdOption) !== null && _a !== void 0 ? _a : view.activeLayoutBtrId;
|
|
137
|
+
};
|
|
138
|
+
return AcApMeasureEntity;
|
|
139
|
+
}(AcApOverlayEntity));
|
|
140
|
+
export { AcApMeasureEntity };
|
|
141
|
+
//# sourceMappingURL=AcApMeasureEntity.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AcApMeasureEntity.js","sourceRoot":"","sources":["../../../../src/command/measure/entity/AcApMeasureEntity.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAIA,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAA;AAIzD,OAAO,EACL,iBAAiB,EAGlB,MAAM,eAAe,CAAA;AACtB,OAAO,EAAE,0BAA0B,EAAE,MAAM,4BAA4B,CAAA;AACvE,OAA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AAC,IAAI,CAAC;YACpC,UAAU,EAAE,IAAI;SACjB,CAAC,CAAA;IACJ,CAAC;IAED;;;;;;;;OAQG;IACO,2CAAe,GAAzB,UAA0B,IAAgB;;QACxC,OAAO,MAAA,IAAI,CAAC,cAAc,mCAAI,IAAI,CAAC,iBAAiB,CAAA;IACtD,CAAC;IACH,wBAAC;AAAD,CAAC,AArJD,CACU,iBAAiB,GAoJ1B"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { AcApMeasurementRecord } from '../AcApMeasurementTypes';
|
|
2
|
+
import type { AcApMeasureEntity } from './AcApMeasureEntity';
|
|
3
|
+
/**
|
|
4
|
+
* Creates a concrete measure entity from a sidecar / store record (deserialize).
|
|
5
|
+
*
|
|
6
|
+
* Pair with {@link AcApMeasureEntity.toRecord} for the serialize half of the
|
|
7
|
+
* overlay persistence protocol. Deserializes the record's style and dispatches
|
|
8
|
+
* on `geometry.type` to the matching entity constructor (`distance`, `angle`,
|
|
9
|
+
* `area`, `arc`, or `point`).
|
|
10
|
+
*
|
|
11
|
+
* @param record - Persisted measurement record to rehydrate
|
|
12
|
+
* @returns Measure entity ready for {@link AcApMeasureEntity.commit}
|
|
13
|
+
*/
|
|
14
|
+
export declare function createMeasureEntityFromRecord(record: AcApMeasurementRecord): AcApMeasureEntity;
|
|
15
|
+
//# sourceMappingURL=AcApMeasureEntityFactory.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AcApMeasureEntityFactory.d.ts","sourceRoot":"","sources":["../../../../src/command/measure/entity/AcApMeasureEntityFactory.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAA;AAKpE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAA;AAG5D;;;;;;;;;;GAUG;AACH,wBAAgB,6BAA6B,CAC3C,MAAM,EAAE,qBAAqB,GAC5B,iBAAiB,CAoCnB"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { deserializeMeasurementStyle } from '../AcApMeasurementSidecar';
|
|
2
|
+
import { AcApMeasureAngleEntity } from './AcApMeasureAngleEntity';
|
|
3
|
+
import { AcApMeasureArcEntity } from './AcApMeasureArcEntity';
|
|
4
|
+
import { AcApMeasureAreaEntity } from './AcApMeasureAreaEntity';
|
|
5
|
+
import { AcApMeasureDistanceEntity } from './AcApMeasureDistanceEntity';
|
|
6
|
+
import { AcApMeasurePointEntity } from './AcApMeasurePointEntity';
|
|
7
|
+
/**
|
|
8
|
+
* Creates a concrete measure entity from a sidecar / store record (deserialize).
|
|
9
|
+
*
|
|
10
|
+
* Pair with {@link AcApMeasureEntity.toRecord} for the serialize half of the
|
|
11
|
+
* overlay persistence protocol. Deserializes the record's style and dispatches
|
|
12
|
+
* on `geometry.type` to the matching entity constructor (`distance`, `angle`,
|
|
13
|
+
* `area`, `arc`, or `point`).
|
|
14
|
+
*
|
|
15
|
+
* @param record - Persisted measurement record to rehydrate
|
|
16
|
+
* @returns Measure entity ready for {@link AcApMeasureEntity.commit}
|
|
17
|
+
*/
|
|
18
|
+
export function createMeasureEntityFromRecord(record) {
|
|
19
|
+
var style = deserializeMeasurementStyle(record.style);
|
|
20
|
+
var options = { id: record.id, layoutId: record.layoutId, style: style };
|
|
21
|
+
var geom = record.geometry;
|
|
22
|
+
switch (geom.type) {
|
|
23
|
+
case 'distance':
|
|
24
|
+
return new AcApMeasureDistanceEntity({ x: geom.start.x, y: geom.start.y, z: 0 }, { x: geom.end.x, y: geom.end.y, z: 0 }, options);
|
|
25
|
+
case 'angle':
|
|
26
|
+
return new AcApMeasureAngleEntity({ x: geom.vertex.x, y: geom.vertex.y, z: 0 }, { x: geom.arm1.x, y: geom.arm1.y, z: 0 }, { x: geom.arm2.x, y: geom.arm2.y, z: 0 }, options);
|
|
27
|
+
case 'area':
|
|
28
|
+
return new AcApMeasureAreaEntity(geom.points.map(function (p) { return ({ x: p.x, y: p.y, z: 0 }); }), options);
|
|
29
|
+
case 'arc':
|
|
30
|
+
return new AcApMeasureArcEntity({ cx: geom.center.x, cy: geom.center.y, r: geom.radius }, geom.start, geom.end, options);
|
|
31
|
+
case 'point':
|
|
32
|
+
return new AcApMeasurePointEntity({ x: geom.position.x, y: geom.position.y, z: 0 }, options);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
//# sourceMappingURL=AcApMeasureEntityFactory.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AcApMeasureEntityFactory.js","sourceRoot":"","sources":["../../../../src/command/measure/entity/AcApMeasureEntityFactory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,2BAA2B,EAAE,MAAM,2BAA2B,CAAA;AAEvE,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAA;AACjE,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAA;AAC7D,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAA;AAC/D,OAAO,EAAE,yBAAyB,EAAE,MAAM,6BAA6B,CAAA;AAEvE,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAA;AAEjE;;;;;;;;;;GAUG;AACH,MAAM,UAAU,6BAA6B,CAC3C,MAA6B;IAE7B,IAAM,KAAK,GAAG,2BAA2B,CAAC,MAAM,CAAC,KAAK,CAAC,CAAA;IACvD,IAAM,OAAO,GAAG,EAAE,EAAE,EAAE,MAAM,CAAC,EAAE,EAAE,QAAQ,EAAE,MAAM,CAAC,QAAQ,EAAE,KAAK,OAAA,EAAE,CAAA;IACnE,IAAM,IAAI,GAAG,MAAM,CAAC,QAAQ,CAAA;IAC5B,QAAQ,IAAI,CAAC,IAAI,EAAE,CAAC;QAClB,KAAK,UAAU;YACb,OAAO,IAAI,yBAAyB,CAClC,EAAE,CAAC,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,CA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