@mlightcad/cad-simple-viewer 1.5.10 → 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 +35023 -70495
- package/dist/cad-simple-viewer.umd.cjs +143 -420
- package/lib/app/AcApDocManager.d.ts +50 -39
- package/lib/app/AcApDocManager.d.ts.map +1 -1
- package/lib/app/AcApDocManager.js +146 -72
- 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/convert/AcApConvertToPngCmd.d.ts.map +1 -1
- package/lib/command/convert/AcApConvertToPngCmd.js +5 -1
- package/lib/command/convert/AcApConvertToPngCmd.js.map +1 -1
- package/lib/command/convert/AcApPngConvertor.d.ts +4 -1
- package/lib/command/convert/AcApPngConvertor.d.ts.map +1 -1
- package/lib/command/convert/AcApPngConvertor.js +131 -78
- package/lib/command/convert/AcApPngConvertor.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/AcEditor.d.ts +6 -0
- package/lib/editor/input/AcEditor.d.ts.map +1 -1
- package/lib/editor/input/AcEditor.js +10 -0
- package/lib/editor/input/AcEditor.js.map +1 -1
- package/lib/editor/input/prompt/AcEdPromptBoxOptions.d.ts +7 -0
- package/lib/editor/input/prompt/AcEdPromptBoxOptions.d.ts.map +1 -1
- package/lib/editor/input/prompt/AcEdPromptBoxOptions.js +17 -0
- package/lib/editor/input/prompt/AcEdPromptBoxOptions.js.map +1 -1
- package/lib/editor/input/ui/AcEdInputManager.d.ts +9 -0
- package/lib/editor/input/ui/AcEdInputManager.d.ts.map +1 -1
- package/lib/editor/input/ui/AcEdInputManager.js +17 -0
- package/lib/editor/input/ui/AcEdInputManager.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/AcApScriptParser.d.ts +13 -0
- package/lib/util/AcApScriptParser.d.ts.map +1 -0
- package/lib/util/AcApScriptParser.js +55 -0
- package/lib/util/AcApScriptParser.js.map +1 -0
- package/lib/util/index.d.ts +4 -1
- package/lib/util/index.d.ts.map +1 -1
- package/lib/util/index.js +4 -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 +46 -5
- package/lib/view/AcTrView2d.d.ts.map +1 -1
- package/lib/view/AcTrView2d.js +179 -74
- 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 +7 -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,246 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Markup shape geometry builders (revision cloud and rectangle) for HTML canvas.
|
|
3
|
+
*/
|
|
4
|
+
var __values = (this && this.__values) || function(o) {
|
|
5
|
+
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
|
|
6
|
+
if (m) return m.call(o);
|
|
7
|
+
if (o && typeof o.length === "number") return {
|
|
8
|
+
next: function () {
|
|
9
|
+
if (o && i >= o.length) o = void 0;
|
|
10
|
+
return { value: o && o[i++], done: !o };
|
|
11
|
+
}
|
|
12
|
+
};
|
|
13
|
+
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* Target screen diameter in CSS pixels for each revision-cloud lobe.
|
|
17
|
+
*/
|
|
18
|
+
var CLOUD_DIAMETER_PIXELS = 8;
|
|
19
|
+
/**
|
|
20
|
+
* Convert a screen-space pixel length to world distance at a reference point.
|
|
21
|
+
*
|
|
22
|
+
* @param view - View used for world ↔ screen conversion.
|
|
23
|
+
* @param pixelDistance - Length in CSS pixels.
|
|
24
|
+
* @param referencePoint - World point near which the scale is sampled.
|
|
25
|
+
* @returns Approximate world-space length of `pixelDistance`.
|
|
26
|
+
*/
|
|
27
|
+
function pixelToWorldDistance(view, pixelDistance, referencePoint) {
|
|
28
|
+
var screenPoint1 = view.worldToScreen(referencePoint);
|
|
29
|
+
var screenPoint2 = { x: screenPoint1.x + pixelDistance, y: screenPoint1.y };
|
|
30
|
+
var worldPoint2 = view.screenToWorld(screenPoint2);
|
|
31
|
+
return Math.abs(worldPoint2.x - referencePoint.x);
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Build closed revision-cloud vertices (points + bulges) between two corners.
|
|
35
|
+
*
|
|
36
|
+
* Lobe size tracks the current view scale ({@link CLOUD_DIAMETER_PIXELS}).
|
|
37
|
+
*
|
|
38
|
+
* @param firstPoint - One corner of the cloud AABB.
|
|
39
|
+
* @param secondPoint - Opposite corner of the cloud AABB.
|
|
40
|
+
* @param view - View used to size lobes in screen pixels.
|
|
41
|
+
* @returns Closed ring of vertices (last segment uses the last bulge → first point).
|
|
42
|
+
*/
|
|
43
|
+
export function markupCloudVertices(firstPoint, secondPoint, view) {
|
|
44
|
+
var minX = Math.min(firstPoint.x, secondPoint.x);
|
|
45
|
+
var maxX = Math.max(firstPoint.x, secondPoint.x);
|
|
46
|
+
var minY = Math.min(firstPoint.y, secondPoint.y);
|
|
47
|
+
var maxY = Math.max(firstPoint.y, secondPoint.y);
|
|
48
|
+
var width = maxX - minX;
|
|
49
|
+
var height = maxY - minY;
|
|
50
|
+
var centerPoint = { x: (minX + maxX) / 2, y: (minY + maxY) / 2 };
|
|
51
|
+
var cloudDiameter = pixelToWorldDistance(view, CLOUD_DIAMETER_PIXELS, centerPoint);
|
|
52
|
+
var chordLength = Math.max(cloudDiameter, 1e-6);
|
|
53
|
+
var numSegmentsX = Math.max(4, Math.ceil(width / chordLength) * 2);
|
|
54
|
+
var numSegmentsY = Math.max(4, Math.ceil(height / chordLength) * 2);
|
|
55
|
+
var vertices = [];
|
|
56
|
+
var segmentIndex = 0;
|
|
57
|
+
/**
|
|
58
|
+
* Alternating bulge for scalloped cloud edges.
|
|
59
|
+
*
|
|
60
|
+
* @param outward - When `true`, bulge pushes outside the AABB.
|
|
61
|
+
* @returns Polyline bulge factor.
|
|
62
|
+
*/
|
|
63
|
+
var calculateBulge = function (outward) { return (outward ? 0.4 : -0.4); };
|
|
64
|
+
for (var i = 0; i <= numSegmentsX; i++) {
|
|
65
|
+
var t = i / numSegmentsX;
|
|
66
|
+
vertices.push({
|
|
67
|
+
x: minX + width * t,
|
|
68
|
+
y: minY,
|
|
69
|
+
bulge: i < numSegmentsX ? calculateBulge(segmentIndex++ % 2 === 0) : 0
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
for (var i = 1; i <= numSegmentsY; i++) {
|
|
73
|
+
var t = i / numSegmentsY;
|
|
74
|
+
vertices.push({
|
|
75
|
+
x: maxX,
|
|
76
|
+
y: minY + height * t,
|
|
77
|
+
bulge: i < numSegmentsY ? calculateBulge(segmentIndex++ % 2 === 0) : 0
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
for (var i = 1; i <= numSegmentsX; i++) {
|
|
81
|
+
var t = 1 - i / numSegmentsX;
|
|
82
|
+
vertices.push({
|
|
83
|
+
x: minX + width * t,
|
|
84
|
+
y: maxY,
|
|
85
|
+
bulge: i < numSegmentsX ? calculateBulge(segmentIndex++ % 2 === 0) : 0
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
for (var i = 1; i < numSegmentsY; i++) {
|
|
89
|
+
var t = 1 - i / numSegmentsY;
|
|
90
|
+
vertices.push({
|
|
91
|
+
x: minX,
|
|
92
|
+
y: minY + height * t,
|
|
93
|
+
bulge: i < numSegmentsY - 1 ? calculateBulge(segmentIndex++ % 2 === 0) : 0
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
// Closing segment (last → first) uses bulge 0, matching the prior polyline builder.
|
|
97
|
+
return vertices;
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* Axis-aligned rectangle corners as a closed polyline (world).
|
|
101
|
+
*
|
|
102
|
+
* @param first - One corner.
|
|
103
|
+
* @param second - Opposite corner.
|
|
104
|
+
* @returns Four corners in order from `first`.
|
|
105
|
+
*/
|
|
106
|
+
export function markupRectCorners(first, second) {
|
|
107
|
+
return [
|
|
108
|
+
{ x: first.x, y: first.y },
|
|
109
|
+
{ x: second.x, y: first.y },
|
|
110
|
+
{ x: second.x, y: second.y },
|
|
111
|
+
{ x: first.x, y: second.y }
|
|
112
|
+
];
|
|
113
|
+
}
|
|
114
|
+
/**
|
|
115
|
+
* Tessellate one bulged segment into world points (excluding `p1`, including end).
|
|
116
|
+
*
|
|
117
|
+
* @param p1 - Segment start.
|
|
118
|
+
* @param p2 - Segment end.
|
|
119
|
+
* @param bulge - AutoCAD bulge (`tan(includedAngle/4)`).
|
|
120
|
+
* @param samples - Interior samples along the arc (≥ 1 when bulged).
|
|
121
|
+
*/
|
|
122
|
+
function tessellateBulgeSegment(p1, p2, bulge, samples) {
|
|
123
|
+
if (samples === void 0) { samples = 6; }
|
|
124
|
+
if (Math.abs(bulge) < 1e-8) {
|
|
125
|
+
return [{ x: p2.x, y: p2.y }];
|
|
126
|
+
}
|
|
127
|
+
var dx = p2.x - p1.x;
|
|
128
|
+
var dy = p2.y - p1.y;
|
|
129
|
+
var d = Math.hypot(dx, dy);
|
|
130
|
+
if (d < 1e-12) {
|
|
131
|
+
return [{ x: p2.x, y: p2.y }];
|
|
132
|
+
}
|
|
133
|
+
var cx = (p1.x + p2.x) / 2 - (dy * (1 - bulge * bulge)) / (4 * bulge);
|
|
134
|
+
var cy = (p1.y + p2.y) / 2 + (dx * (1 - bulge * bulge)) / (4 * bulge);
|
|
135
|
+
var r = Math.hypot(p1.x - cx, p1.y - cy);
|
|
136
|
+
var a0 = Math.atan2(p1.y - cy, p1.x - cx);
|
|
137
|
+
var a1 = Math.atan2(p2.y - cy, p2.x - cx);
|
|
138
|
+
var delta = a1 - a0;
|
|
139
|
+
// Positive bulge → CCW (left of chord); negative → CW.
|
|
140
|
+
if (bulge > 0) {
|
|
141
|
+
if (delta <= 0)
|
|
142
|
+
delta += Math.PI * 2;
|
|
143
|
+
}
|
|
144
|
+
else {
|
|
145
|
+
if (delta >= 0)
|
|
146
|
+
delta -= Math.PI * 2;
|
|
147
|
+
}
|
|
148
|
+
var out = [];
|
|
149
|
+
var steps = Math.max(2, samples);
|
|
150
|
+
for (var i = 1; i <= steps; i++) {
|
|
151
|
+
var t = i / steps;
|
|
152
|
+
var a = a0 + delta * t;
|
|
153
|
+
out.push({ x: cx + r * Math.cos(a), y: cy + r * Math.sin(a) });
|
|
154
|
+
}
|
|
155
|
+
return out;
|
|
156
|
+
}
|
|
157
|
+
/**
|
|
158
|
+
* Expand cloud vertices to a dense polyline suitable for canvas stroke.
|
|
159
|
+
*
|
|
160
|
+
* @param vertices - Closed cloud ring with bulges.
|
|
161
|
+
* @returns Tessellated world points (closed ring, first point not repeated).
|
|
162
|
+
*/
|
|
163
|
+
export function tessellateMarkupCloud(vertices) {
|
|
164
|
+
var e_1, _a;
|
|
165
|
+
if (vertices.length < 2)
|
|
166
|
+
return vertices.map(function (v) { return ({ x: v.x, y: v.y }); });
|
|
167
|
+
var points = [
|
|
168
|
+
{ x: vertices[0].x, y: vertices[0].y }
|
|
169
|
+
];
|
|
170
|
+
for (var i = 0; i < vertices.length; i++) {
|
|
171
|
+
var a = vertices[i];
|
|
172
|
+
var b = vertices[(i + 1) % vertices.length];
|
|
173
|
+
var seg = tessellateBulgeSegment({ x: a.x, y: a.y }, { x: b.x, y: b.y }, a.bulge);
|
|
174
|
+
try {
|
|
175
|
+
for (var seg_1 = (e_1 = void 0, __values(seg)), seg_1_1 = seg_1.next(); !seg_1_1.done; seg_1_1 = seg_1.next()) {
|
|
176
|
+
var p = seg_1_1.value;
|
|
177
|
+
points.push(p);
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
181
|
+
finally {
|
|
182
|
+
try {
|
|
183
|
+
if (seg_1_1 && !seg_1_1.done && (_a = seg_1.return)) _a.call(seg_1);
|
|
184
|
+
}
|
|
185
|
+
finally { if (e_1) throw e_1.error; }
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
return points;
|
|
189
|
+
}
|
|
190
|
+
/**
|
|
191
|
+
* Stroke a revision cloud on a canvas context (screen projection).
|
|
192
|
+
*
|
|
193
|
+
* @param ctx - Canvas 2D context in CSS pixel space.
|
|
194
|
+
* @param view - View for world → screen.
|
|
195
|
+
* @param first - One AABB corner (world).
|
|
196
|
+
* @param second - Opposite AABB corner (world).
|
|
197
|
+
* @param color - CSS stroke color.
|
|
198
|
+
* @param lineWidth - Stroke width in CSS pixels.
|
|
199
|
+
* @param offset - Optional live drag translation in world space.
|
|
200
|
+
*/
|
|
201
|
+
export function strokeMarkupCloud(ctx, view, first, second, color, lineWidth, offset) {
|
|
202
|
+
var _a, _b;
|
|
203
|
+
var dx = (_a = offset === null || offset === void 0 ? void 0 : offset.dx) !== null && _a !== void 0 ? _a : 0;
|
|
204
|
+
var dy = (_b = offset === null || offset === void 0 ? void 0 : offset.dy) !== null && _b !== void 0 ? _b : 0;
|
|
205
|
+
var vertices = markupCloudVertices(first, second, view);
|
|
206
|
+
var world = tessellateMarkupCloud(vertices).map(function (p) { return ({
|
|
207
|
+
x: p.x + dx,
|
|
208
|
+
y: p.y + dy
|
|
209
|
+
}); });
|
|
210
|
+
if (world.length < 2)
|
|
211
|
+
return;
|
|
212
|
+
var screen = world.map(function (p) { return view.worldToScreen(p); });
|
|
213
|
+
ctx.strokeStyle = color;
|
|
214
|
+
ctx.lineWidth = lineWidth;
|
|
215
|
+
ctx.beginPath();
|
|
216
|
+
ctx.moveTo(screen[0].x, screen[0].y);
|
|
217
|
+
for (var i = 1; i < screen.length; i++) {
|
|
218
|
+
ctx.lineTo(screen[i].x, screen[i].y);
|
|
219
|
+
}
|
|
220
|
+
ctx.closePath();
|
|
221
|
+
ctx.stroke();
|
|
222
|
+
}
|
|
223
|
+
/**
|
|
224
|
+
* @deprecated Prefer {@link markupCloudVertices} / {@link strokeMarkupCloud}.
|
|
225
|
+
* Kept for callers that still need an in-memory vertex list via the old name.
|
|
226
|
+
*/
|
|
227
|
+
export function buildMarkupCloud(_cloud, firstPoint, secondPoint, view) {
|
|
228
|
+
var vertices = markupCloudVertices(firstPoint, secondPoint, view);
|
|
229
|
+
_cloud.reset(false);
|
|
230
|
+
for (var i = 0; i < vertices.length; i++) {
|
|
231
|
+
_cloud.addVertexAt(i, { x: vertices[i].x, y: vertices[i].y }, vertices[i].bulge);
|
|
232
|
+
}
|
|
233
|
+
_cloud.closed = true;
|
|
234
|
+
}
|
|
235
|
+
/**
|
|
236
|
+
* @deprecated Prefer {@link markupRectCorners}.
|
|
237
|
+
*/
|
|
238
|
+
export function buildMarkupRect(rect, first, second) {
|
|
239
|
+
var corners = markupRectCorners(first, second);
|
|
240
|
+
rect.reset(false);
|
|
241
|
+
for (var i = 0; i < corners.length; i++) {
|
|
242
|
+
rect.addVertexAt(i, corners[i]);
|
|
243
|
+
}
|
|
244
|
+
rect.closed = true;
|
|
245
|
+
}
|
|
246
|
+
//# sourceMappingURL=AcApMarkupShapeBuilder.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AcApMarkupShapeBuilder.js","sourceRoot":"","sources":["../../../src/command/markup/AcApMarkupShapeBuilder.ts"],"names":[],"mappings":"AAAA;;GAEG;;;;;;;;;;;;AAMH;;GAEG;AACH,IAAM,qBAAqB,GAAG,CAAC,CAAA;AAe/B;;;;;;;GAOG;AACH,SAAS,oBAAoB,CAC3B,IAAkB,EAClB,aAAqB,EACrB,cAA+B;IAE/B,IAAM,YAAY,GAAG,IAAI,CAAC,aAAa,CAAC,c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(cloud / rect / circle) that can
|
|
3
|
+
* optionally attach a leader + text box (no arrow), matching Design Review
|
|
4
|
+
* “callout with shape” behavior. Default: callout attachment enabled.
|
|
5
|
+
*
|
|
6
|
+
* Design Review placement:
|
|
7
|
+
* 1. Draw the shape
|
|
8
|
+
* 2. Move the cursor to place the text box — leader tip is computed on the
|
|
9
|
+
* shape outline toward the cursor (user does not pick the tip)
|
|
10
|
+
* 3. Type text in the capsule
|
|
11
|
+
*/
|
|
12
|
+
import { AcGePoint3dLike } from '@mlightcad/data-model';
|
|
13
|
+
import type { AcApContext } from '../../app';
|
|
14
|
+
import type { AcApMarkupAttachedCallout, AcApMarkupPoint2d } from './AcApMarkupTypes';
|
|
15
|
+
/** Shape outline used to auto-place the leader tip on the perimeter. */
|
|
16
|
+
export type AcApMarkupShapeOutline = {
|
|
17
|
+
kind: 'rect' | 'cloud';
|
|
18
|
+
corner1: AcApMarkupPoint2d;
|
|
19
|
+
corner2: AcApMarkupPoint2d;
|
|
20
|
+
} | {
|
|
21
|
+
kind: 'circle';
|
|
22
|
+
center: AcApMarkupPoint2d;
|
|
23
|
+
radius: number;
|
|
24
|
+
};
|
|
25
|
+
/** Whether newly created cloud/rect/circle markups should prompt for a callout. */
|
|
26
|
+
export declare function isMarkupShapeCalloutEnabled(): boolean;
|
|
27
|
+
/** Enable or disable the shape-callout option for subsequent shape commands. */
|
|
28
|
+
export declare function setMarkupShapeCalloutEnabled(enabled: boolean): void;
|
|
29
|
+
/**
|
|
30
|
+
* Prompt for the first corner of a shape, with Callout / NoCallout keywords
|
|
31
|
+
* to toggle the session option (default ON).
|
|
32
|
+
*/
|
|
33
|
+
export declare function promptShapeFirstCorner(context: AcApContext, messageKey: string): Promise<AcGePoint3dLike | undefined>;
|
|
34
|
+
/**
|
|
35
|
+
* AutoCAD Design Review–style leader tip: intersection of the ray from the
|
|
36
|
+
* shape center toward the cursor with the shape outer frame (AABB for
|
|
37
|
+
* rect/cloud, circle perimeter for circle).
|
|
38
|
+
*/
|
|
39
|
+
export declare function computeLeaderTipOnShape(outline: AcApMarkupShapeOutline, toward: AcApMarkupPoint2d): AcApMarkupPoint2d;
|
|
40
|
+
/**
|
|
41
|
+
* After a shape is placed, if the callout option is on, prompt for text
|
|
42
|
+
* location (leader tip is auto-computed on the outline). Returns undefined
|
|
43
|
+
* when the option is off or cancelled.
|
|
44
|
+
*/
|
|
45
|
+
export declare function promptAttachedCallout(context: AcApContext, outline: AcApMarkupShapeOutline): Promise<AcApMarkupAttachedCallout | undefined>;
|
|
46
|
+
//# sourceMappingURL=AcApMarkupShapeCallout.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AcApMarkupShapeCallout.d.ts","sourceRoot":"","sources":["../../../src/command/markup/AcApMarkupShapeCallout.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAEL,eAAe,EAChB,MAAM,uBAAuB,CAAA;AAO9B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,WAAW,CAAA;AAuB5C,OAAO,KAAK,EACV,yBAAyB,EACzB,iBAAiB,EAClB,MAAM,mBAAmB,CAAA;AAY1B,wEAAwE;AACxE,MAAM,MAAM,sBAAsB,GAC9B;IACE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAA;IACtB,OAAO,EAAE,iBAAiB,CAAA;IAC1B,OAAO,EAAE,iBAAiB,CAAA;CAC3B,GACD;IACE,IAAI,EAAE,QAAQ,CAAA;IACd,MAAM,EAAE,iBAAiB,CAAA;IACzB,MAAM,EAAE,MAAM,CAAA;CACf,CAAA;AAEL,mFAAmF;AACnF,wBAAgB,2BAA2B,IAAI,OAAO,CAErD;AAED,gFAAgF;AAChF,wBAAgB,4BAA4B,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAEnE;AAED;;;GAGG;AACH,wBAAsB,sBAAsB,CAC1C,OAAO,EAAE,WAAW,EACpB,UAAU,EAAE,MAAM,GACjB,OAAO,CAAC,eAAe,GAAG,SAAS,CAAC,CAmCtC;AAYD;;;;GAIG;AACH,wBAAgB,uBAAuB,CACrC,OAAO,EAAE,sBAAsB,EAC/B,MAAM,EAAE,iBAAiB,GACxB,iBAAiB,CAiCnB;AAgLD;;;;GAIG;AACH,wBAAsB,qBAAqB,CACzC,OAAO,EAAE,WAAW,EACpB,OAAO,EAAE,sBAAsB,GAC9B,OAAO,CAAC,yBAAyB,GAAG,SAAS,CAAC,CAgChD"}
|
|
@@ -0,0 +1,356 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared option + prompts for shape markups (cloud / rect / circle) that can
|
|
3
|
+
* optionally attach a leader + text box (no arrow), matching Design Review
|
|
4
|
+
* “callout with shape” behavior. Default: callout attachment enabled.
|
|
5
|
+
*
|
|
6
|
+
* Design Review placement:
|
|
7
|
+
* 1. Draw the shape
|
|
8
|
+
* 2. Move the cursor to place the text box — leader tip is computed on the
|
|
9
|
+
* shape outline toward the cursor (user does not pick the tip)
|
|
10
|
+
* 3. Type text in the capsule
|
|
11
|
+
*/
|
|
12
|
+
var __extends = (this && this.__extends) || (function () {
|
|
13
|
+
var extendStatics = function (d, b) {
|
|
14
|
+
extendStatics = Object.setPrototypeOf ||
|
|
15
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
16
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
17
|
+
return extendStatics(d, b);
|
|
18
|
+
};
|
|
19
|
+
return function (d, b) {
|
|
20
|
+
if (typeof b !== "function" && b !== null)
|
|
21
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
22
|
+
extendStatics(d, b);
|
|
23
|
+
function __() { this.constructor = d; }
|
|
24
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
25
|
+
};
|
|
26
|
+
})();
|
|
27
|
+
var __assign = (this && this.__assign) || function () {
|
|
28
|
+
__assign = Object.assign || function(t) {
|
|
29
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
30
|
+
s = arguments[i];
|
|
31
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
32
|
+
t[p] = s[p];
|
|
33
|
+
}
|
|
34
|
+
return t;
|
|
35
|
+
};
|
|
36
|
+
return __assign.apply(this, arguments);
|
|
37
|
+
};
|
|
38
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
39
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
40
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
41
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
42
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
43
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
44
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
45
|
+
});
|
|
46
|
+
};
|
|
47
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
48
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
|
49
|
+
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
50
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
51
|
+
function step(op) {
|
|
52
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
53
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
54
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
55
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
56
|
+
switch (op[0]) {
|
|
57
|
+
case 0: case 1: t = op; break;
|
|
58
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
59
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
60
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
61
|
+
default:
|
|
62
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
63
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
64
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
65
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
66
|
+
if (t[2]) _.ops.pop();
|
|
67
|
+
_.trys.pop(); continue;
|
|
68
|
+
}
|
|
69
|
+
op = body.call(thisArg, _);
|
|
70
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
71
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
72
|
+
}
|
|
73
|
+
};
|
|
74
|
+
import { AcTrHtmlCallout, AcTrHtmlDot } from '@mlightcad/three-renderer';
|
|
75
|
+
import { AcEdPreviewJig, AcEdPromptPointOptions, AcEdPromptStatus } from '../../editor';
|
|
76
|
+
import { AcApI18n } from '../../i18n';
|
|
77
|
+
import { AcApHtmlLivePreview, acapLiveRectCorners, acapStrokeLiveCircle, acapStrokeLivePolyline, acapStrokeLiveSegment } from '../overlay/AcApHtmlLivePreview';
|
|
78
|
+
import { promptMarkupCapsuleText } from './AcApMarkupCmdUtil';
|
|
79
|
+
import { markupCloudVertices, tessellateMarkupCloud } from './AcApMarkupShapeBuilder';
|
|
80
|
+
import { MARKUP_LIVE_LAYER } from './AcApMarkupStore';
|
|
81
|
+
import { defaultMarkupColor, getMarkupFontSize, getMarkupLineWeight, markupCanvasLineWidth, subscribeMarkupDrawStyle } from './AcApMarkupUtil';
|
|
82
|
+
/** Session flag: whether shape markups attach a callout by default. */
|
|
83
|
+
var shapeCalloutEnabled = true;
|
|
84
|
+
/** Whether newly created cloud/rect/circle markups should prompt for a callout. */
|
|
85
|
+
export function isMarkupShapeCalloutEnabled() {
|
|
86
|
+
return shapeCalloutEnabled;
|
|
87
|
+
}
|
|
88
|
+
/** Enable or disable the shape-callout option for subsequent shape commands. */
|
|
89
|
+
export function setMarkupShapeCalloutEnabled(enabled) {
|
|
90
|
+
shapeCalloutEnabled = enabled;
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* Prompt for the first corner of a shape, with Callout / NoCallout keywords
|
|
94
|
+
* to toggle the session option (default ON).
|
|
95
|
+
*/
|
|
96
|
+
export function promptShapeFirstCorner(context, messageKey) {
|
|
97
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
98
|
+
var statusKey, prompt_1, result, kw;
|
|
99
|
+
var _a;
|
|
100
|
+
return __generator(this, function (_b) {
|
|
101
|
+
switch (_b.label) {
|
|
102
|
+
case 0:
|
|
103
|
+
if (!true) return [3 /*break*/, 2];
|
|
104
|
+
statusKey = shapeCalloutEnabled
|
|
105
|
+
? 'jig.markup.shape.calloutOn'
|
|
106
|
+
: 'jig.markup.shape.calloutOff';
|
|
107
|
+
prompt_1 = new AcEdPromptPointOptions("".concat(AcApI18n.t(messageKey), " ").concat(AcApI18n.t(statusKey)));
|
|
108
|
+
prompt_1.keywords.add(AcApI18n.t('jig.markup.shape.keywords.callout.display'), AcApI18n.t('jig.markup.shape.keywords.callout.global'), AcApI18n.t('jig.markup.shape.keywords.callout.local'));
|
|
109
|
+
prompt_1.keywords.add(AcApI18n.t('jig.markup.shape.keywords.noCallout.display'), AcApI18n.t('jig.markup.shape.keywords.noCallout.global'), AcApI18n.t('jig.markup.shape.keywords.noCallout.local'));
|
|
110
|
+
return [4 /*yield*/, context.view.editor.getPoint(prompt_1)];
|
|
111
|
+
case 1:
|
|
112
|
+
result = _b.sent();
|
|
113
|
+
if (result.status === AcEdPromptStatus.Keyword) {
|
|
114
|
+
kw = (_a = result.stringResult) !== null && _a !== void 0 ? _a : '';
|
|
115
|
+
if (kw === 'Callout') {
|
|
116
|
+
shapeCalloutEnabled = true;
|
|
117
|
+
return [3 /*break*/, 0];
|
|
118
|
+
}
|
|
119
|
+
if (kw === 'NoCallout') {
|
|
120
|
+
shapeCalloutEnabled = false;
|
|
121
|
+
return [3 /*break*/, 0];
|
|
122
|
+
}
|
|
123
|
+
return [3 /*break*/, 0];
|
|
124
|
+
}
|
|
125
|
+
if (result.status !== AcEdPromptStatus.OK)
|
|
126
|
+
return [2 /*return*/, undefined];
|
|
127
|
+
return [2 /*return*/, result.value];
|
|
128
|
+
case 2: return [2 /*return*/];
|
|
129
|
+
}
|
|
130
|
+
});
|
|
131
|
+
});
|
|
132
|
+
}
|
|
133
|
+
function shapeCenter(outline) {
|
|
134
|
+
if (outline.kind === 'circle') {
|
|
135
|
+
return __assign({}, outline.center);
|
|
136
|
+
}
|
|
137
|
+
return {
|
|
138
|
+
x: (outline.corner1.x + outline.corner2.x) / 2,
|
|
139
|
+
y: (outline.corner1.y + outline.corner2.y) / 2
|
|
140
|
+
};
|
|
141
|
+
}
|
|
142
|
+
/**
|
|
143
|
+
* AutoCAD Design Review–style leader tip: intersection of the ray from the
|
|
144
|
+
* shape center toward the cursor with the shape outer frame (AABB for
|
|
145
|
+
* rect/cloud, circle perimeter for circle).
|
|
146
|
+
*/
|
|
147
|
+
export function computeLeaderTipOnShape(outline, toward) {
|
|
148
|
+
if (outline.kind === 'circle') {
|
|
149
|
+
var center = outline.center, radius = outline.radius;
|
|
150
|
+
var dx_1 = toward.x - center.x;
|
|
151
|
+
var dy_1 = toward.y - center.y;
|
|
152
|
+
var len = Math.hypot(dx_1, dy_1);
|
|
153
|
+
if (len < 1e-9 || radius <= 0) {
|
|
154
|
+
return { x: center.x + radius, y: center.y };
|
|
155
|
+
}
|
|
156
|
+
var s_1 = radius / len;
|
|
157
|
+
return { x: center.x + dx_1 * s_1, y: center.y + dy_1 * s_1 };
|
|
158
|
+
}
|
|
159
|
+
var minX = Math.min(outline.corner1.x, outline.corner2.x);
|
|
160
|
+
var maxX = Math.max(outline.corner1.x, outline.corner2.x);
|
|
161
|
+
var minY = Math.min(outline.corner1.y, outline.corner2.y);
|
|
162
|
+
var maxY = Math.max(outline.corner1.y, outline.corner2.y);
|
|
163
|
+
var cx = (minX + maxX) / 2;
|
|
164
|
+
var cy = (minY + maxY) / 2;
|
|
165
|
+
var hx = (maxX - minX) / 2;
|
|
166
|
+
var hy = (maxY - minY) / 2;
|
|
167
|
+
var dx = toward.x - cx;
|
|
168
|
+
var dy = toward.y - cy;
|
|
169
|
+
if (Math.abs(dx) < 1e-9 && Math.abs(dy) < 1e-9) {
|
|
170
|
+
return { x: maxX, y: cy };
|
|
171
|
+
}
|
|
172
|
+
// Scale direction so the point lands on the nearer AABB edge.
|
|
173
|
+
var sx = Math.abs(dx) > 1e-9 ? hx / Math.abs(dx) : Number.POSITIVE_INFINITY;
|
|
174
|
+
var sy = Math.abs(dy) > 1e-9 ? hy / Math.abs(dy) : Number.POSITIVE_INFINITY;
|
|
175
|
+
var s = Math.min(sx, sy);
|
|
176
|
+
return { x: cx + dx * s, y: cy + dy * s };
|
|
177
|
+
}
|
|
178
|
+
/** Collect tessellated cloud outline vertices (HTML stroke; no AcDb). */
|
|
179
|
+
function cloudLivePoints(corner1, corner2, view) {
|
|
180
|
+
return tessellateMarkupCloud(markupCloudVertices(corner1, corner2, view));
|
|
181
|
+
}
|
|
182
|
+
/**
|
|
183
|
+
* Live preview while placing a shape-attached callout:
|
|
184
|
+
* keeps the shape visible, auto-updates leader tip on the outline, and shows
|
|
185
|
+
* leader (no arrow) + text bubble following the cursor.
|
|
186
|
+
*/
|
|
187
|
+
var AcApMarkupShapeCalloutJig = /** @class */ (function (_super) {
|
|
188
|
+
__extends(AcApMarkupShapeCalloutJig, _super);
|
|
189
|
+
function AcApMarkupShapeCalloutJig(view, outline, color) {
|
|
190
|
+
var _this = _super.call(this, view) || this;
|
|
191
|
+
_this._view = view;
|
|
192
|
+
_this._outline = outline;
|
|
193
|
+
_this._color = color;
|
|
194
|
+
_this._ht = _this._view.htmlTransientManager;
|
|
195
|
+
var center = shapeCenter(outline);
|
|
196
|
+
_this._tip = computeLeaderTipOnShape(outline, {
|
|
197
|
+
x: center.x + 1,
|
|
198
|
+
y: center.y
|
|
199
|
+
});
|
|
200
|
+
_this._anchor = __assign({}, _this._tip);
|
|
201
|
+
var stamp = Date.now();
|
|
202
|
+
_this._tipDotId = "live-shape-callout-tip-".concat(stamp);
|
|
203
|
+
_this._bubbleId = "live-shape-callout-bubble-".concat(stamp);
|
|
204
|
+
var layoutId = _this._view.activeLayoutBtrId;
|
|
205
|
+
_this._tipDot = new AcTrHtmlDot({
|
|
206
|
+
id: _this._tipDotId,
|
|
207
|
+
color: color,
|
|
208
|
+
worldPosition: _this._tip,
|
|
209
|
+
layer: MARKUP_LIVE_LAYER,
|
|
210
|
+
layoutId: layoutId
|
|
211
|
+
});
|
|
212
|
+
_this._ht.add(_this._tipDot);
|
|
213
|
+
_this._bubble = new AcTrHtmlCallout({
|
|
214
|
+
id: _this._bubbleId,
|
|
215
|
+
color: color,
|
|
216
|
+
text: '',
|
|
217
|
+
fontSize: getMarkupFontSize(),
|
|
218
|
+
worldPosition: _this._tip,
|
|
219
|
+
layer: MARKUP_LIVE_LAYER,
|
|
220
|
+
layoutId: layoutId
|
|
221
|
+
});
|
|
222
|
+
_this._ht.add(_this._bubble);
|
|
223
|
+
_this._preview = new AcApHtmlLivePreview(_this._view, "live-shape-callout-stroke-".concat(stamp), MARKUP_LIVE_LAYER);
|
|
224
|
+
_this._unsubDrawStyle = subscribeMarkupDrawStyle(function () {
|
|
225
|
+
return _this.applyCurrentStyle();
|
|
226
|
+
});
|
|
227
|
+
_this.paintPreview();
|
|
228
|
+
_this._view.isHtmlDirty = true;
|
|
229
|
+
return _this;
|
|
230
|
+
}
|
|
231
|
+
Object.defineProperty(AcApMarkupShapeCalloutJig.prototype, "entity", {
|
|
232
|
+
/** HTML-only preview — no CAD transient. */
|
|
233
|
+
get: function () {
|
|
234
|
+
return null;
|
|
235
|
+
},
|
|
236
|
+
enumerable: false,
|
|
237
|
+
configurable: true
|
|
238
|
+
});
|
|
239
|
+
AcApMarkupShapeCalloutJig.prototype.update = function (anchor) {
|
|
240
|
+
var toward = { x: anchor.x, y: anchor.y };
|
|
241
|
+
this._tip = computeLeaderTipOnShape(this._outline, toward);
|
|
242
|
+
this._anchor = toward;
|
|
243
|
+
this._tipDot.setPosition(this._tip);
|
|
244
|
+
this._bubble.setPosition(toward);
|
|
245
|
+
this.paintPreview();
|
|
246
|
+
this._view.isHtmlDirty = true;
|
|
247
|
+
};
|
|
248
|
+
Object.defineProperty(AcApMarkupShapeCalloutJig.prototype, "capsule", {
|
|
249
|
+
/** Capsule used for in-place text entry after the bubble is placed. */
|
|
250
|
+
get: function () {
|
|
251
|
+
return this._bubble;
|
|
252
|
+
},
|
|
253
|
+
enumerable: false,
|
|
254
|
+
configurable: true
|
|
255
|
+
});
|
|
256
|
+
/**
|
|
257
|
+
* Keep the shape + leader + bubble visible while the user enters text.
|
|
258
|
+
* Cleanup is done by {@link disposePreview}.
|
|
259
|
+
*/
|
|
260
|
+
AcApMarkupShapeCalloutJig.prototype.end = function () {
|
|
261
|
+
// Intentionally do not remove the HTML overlays.
|
|
262
|
+
};
|
|
263
|
+
/** Remove frozen preview graphics after text entry (or cancel). */
|
|
264
|
+
AcApMarkupShapeCalloutJig.prototype.disposePreview = function () {
|
|
265
|
+
var _a;
|
|
266
|
+
(_a = this._unsubDrawStyle) === null || _a === void 0 ? void 0 : _a.call(this);
|
|
267
|
+
this._unsubDrawStyle = undefined;
|
|
268
|
+
this._preview.acapDispose();
|
|
269
|
+
this._ht.remove(this._tipDotId);
|
|
270
|
+
this._ht.remove(this._bubbleId);
|
|
271
|
+
this._view.isHtmlDirty = true;
|
|
272
|
+
};
|
|
273
|
+
/** Apply session draw style to the frozen preview (including during text entry). */
|
|
274
|
+
AcApMarkupShapeCalloutJig.prototype.applyCurrentStyle = function () {
|
|
275
|
+
this._color = defaultMarkupColor();
|
|
276
|
+
this._tipDot.setColor(this._color);
|
|
277
|
+
this._bubble.setColor(this._color);
|
|
278
|
+
this._bubble.setFontSize(getMarkupFontSize());
|
|
279
|
+
this.paintPreview();
|
|
280
|
+
this._view.isHtmlDirty = true;
|
|
281
|
+
};
|
|
282
|
+
AcApMarkupShapeCalloutJig.prototype.paintPreview = function () {
|
|
283
|
+
var outline = this._outline;
|
|
284
|
+
var color = this._color;
|
|
285
|
+
var lineWidth = markupCanvasLineWidth(getMarkupLineWeight());
|
|
286
|
+
var tip = this._tip;
|
|
287
|
+
var anchor = this._anchor;
|
|
288
|
+
var viewForCloud = this._view;
|
|
289
|
+
this._preview.acapSetDraw(function (ctx, view) {
|
|
290
|
+
if (outline.kind === 'circle') {
|
|
291
|
+
acapStrokeLiveCircle(ctx, view, outline.center, outline.radius, color, lineWidth);
|
|
292
|
+
}
|
|
293
|
+
else if (outline.kind === 'cloud') {
|
|
294
|
+
var points = cloudLivePoints(outline.corner1, outline.corner2, viewForCloud);
|
|
295
|
+
acapStrokeLivePolyline(ctx, view, points, color, lineWidth, {
|
|
296
|
+
closed: true
|
|
297
|
+
});
|
|
298
|
+
}
|
|
299
|
+
else {
|
|
300
|
+
acapStrokeLivePolyline(ctx, view, acapLiveRectCorners(outline.corner1, outline.corner2), color, lineWidth, { closed: true });
|
|
301
|
+
}
|
|
302
|
+
// Design Review style: leader without arrowhead.
|
|
303
|
+
acapStrokeLiveSegment(ctx, view, tip, anchor, color, lineWidth);
|
|
304
|
+
});
|
|
305
|
+
};
|
|
306
|
+
return AcApMarkupShapeCalloutJig;
|
|
307
|
+
}(AcEdPreviewJig));
|
|
308
|
+
/**
|
|
309
|
+
* After a shape is placed, if the callout option is on, prompt for text
|
|
310
|
+
* location (leader tip is auto-computed on the outline). Returns undefined
|
|
311
|
+
* when the option is off or cancelled.
|
|
312
|
+
*/
|
|
313
|
+
export function promptAttachedCallout(context, outline) {
|
|
314
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
315
|
+
var color, jig, anchorPrompt, anchorResult, anchor, tip, text;
|
|
316
|
+
return __generator(this, function (_a) {
|
|
317
|
+
switch (_a.label) {
|
|
318
|
+
case 0:
|
|
319
|
+
if (!shapeCalloutEnabled)
|
|
320
|
+
return [2 /*return*/, undefined];
|
|
321
|
+
color = defaultMarkupColor();
|
|
322
|
+
jig = new AcApMarkupShapeCalloutJig(context.view, outline, color);
|
|
323
|
+
_a.label = 1;
|
|
324
|
+
case 1:
|
|
325
|
+
_a.trys.push([1, , 4, 5]);
|
|
326
|
+
anchorPrompt = new AcEdPromptPointOptions(AcApI18n.t('jig.markup.shape.calloutAnchor'));
|
|
327
|
+
// Leader is drawn by the jig from the auto tip; do not draw a fixed base line.
|
|
328
|
+
anchorPrompt.useBasePoint = false;
|
|
329
|
+
anchorPrompt.jig = jig;
|
|
330
|
+
return [4 /*yield*/, context.view.editor.getPoint(anchorPrompt)];
|
|
331
|
+
case 2:
|
|
332
|
+
anchorResult = _a.sent();
|
|
333
|
+
if (anchorResult.status !== AcEdPromptStatus.OK)
|
|
334
|
+
return [2 /*return*/, undefined];
|
|
335
|
+
anchor = anchorResult.value;
|
|
336
|
+
tip = computeLeaderTipOnShape(outline, {
|
|
337
|
+
x: anchor.x,
|
|
338
|
+
y: anchor.y
|
|
339
|
+
});
|
|
340
|
+
return [4 /*yield*/, promptMarkupCapsuleText(jig.capsule)];
|
|
341
|
+
case 3:
|
|
342
|
+
text = _a.sent();
|
|
343
|
+
return [2 /*return*/, {
|
|
344
|
+
tip: tip,
|
|
345
|
+
anchor: { x: anchor.x, y: anchor.y },
|
|
346
|
+
text: text || undefined
|
|
347
|
+
}];
|
|
348
|
+
case 4:
|
|
349
|
+
jig.disposePreview();
|
|
350
|
+
return [7 /*endfinally*/];
|
|
351
|
+
case 5: return [2 /*return*/];
|
|
352
|
+
}
|
|
353
|
+
});
|
|
354
|
+
});
|
|
355
|
+
}
|
|
356
|
+
//# sourceMappingURL=AcApMarkupShapeCallout.js.map
|