dxfview 0.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -0
- package/dist/dxfview.esm.min.js +7 -0
- package/dist/types/components/dxf-layout-bar/DxfLayoutBar.d.ts +26 -0
- package/dist/types/components/dxf-layout-bar/index.d.ts +1 -0
- package/dist/types/components/pop-panel/PopPanel.d.ts +14 -0
- package/dist/types/components/pop-panel/index.d.ts +1 -0
- package/dist/types/components/progress-bar/ProgressBar.d.ts +34 -0
- package/dist/types/components/progress-bar/index.d.ts +1 -0
- package/dist/types/components/settings/ProjectSettingsDef.d.ts +44 -0
- package/dist/types/components/settings/index.d.ts +1 -0
- package/dist/types/components/tool-tip/Tooltip.d.ts +20 -0
- package/dist/types/components/tool-tip/index.d.ts +1 -0
- package/dist/types/core/Configs.d.ts +238 -0
- package/dist/types/core/Constants.d.ts +164 -0
- package/dist/types/core/Units.d.ts +16 -0
- package/dist/types/core/VersionManager.d.ts +3 -0
- package/dist/types/core/camera-controls/CameraControls.d.ts +773 -0
- package/dist/types/core/camera-controls/Constants.d.ts +2 -0
- package/dist/types/core/camera-controls/EventDispatcher.d.ts +41 -0
- package/dist/types/core/camera-controls/index.d.ts +2 -0
- package/dist/types/core/camera-controls/types.d.ts +112 -0
- package/dist/types/core/camera-controls/utils/extractClientCoordFromEvent.d.ts +3 -0
- package/dist/types/core/camera-controls/utils/math-utils.d.ts +11 -0
- package/dist/types/core/camera-controls/utils/notSupportedInOrthographicCamera.d.ts +2 -0
- package/dist/types/core/canvas/CanvasRender.d.ts +52 -0
- package/dist/types/core/canvas/Constants.d.ts +28 -0
- package/dist/types/core/canvas/Drawable.d.ts +87 -0
- package/dist/types/core/canvas/DrawableList.d.ts +29 -0
- package/dist/types/core/canvas/index.d.ts +4 -0
- package/dist/types/core/compare/BaseDxfCompareHelper.d.ts +104 -0
- package/dist/types/core/compare/CompareDrawable.d.ts +17 -0
- package/dist/types/core/compare/DxfCompareHelper.d.ts +69 -0
- package/dist/types/core/compare/DxfCompareMarkupManager.d.ts +11 -0
- package/dist/types/core/compare/index.d.ts +4 -0
- package/dist/types/core/controls/CameraControlsEx.d.ts +34 -0
- package/dist/types/core/controls/index.d.ts +1 -0
- package/dist/types/core/dxf/DxfCompare.d.ts +151 -0
- package/dist/types/core/dxf/DxfConstants.d.ts +15 -0
- package/dist/types/core/dxf/DxfLoader.d.ts +526 -0
- package/dist/types/core/dxf/DxfObject.d.ts +32 -0
- package/dist/types/core/dxf/DxfUtils.d.ts +79 -0
- package/dist/types/core/dxf/HatchPatternShaders.d.ts +12 -0
- package/dist/types/core/dxf/LinePatternShaders.d.ts +12 -0
- package/dist/types/core/dxf/bspline.d.ts +8 -0
- package/dist/types/core/dxf/dxfom-mtext.d.ts +46 -0
- package/dist/types/core/dxf/dxfom-text.d.ts +16 -0
- package/dist/types/core/dxf/index.d.ts +10 -0
- package/dist/types/core/dxf/round10.d.ts +2 -0
- package/dist/types/core/dxf-parser/AutoCadColorIndex.d.ts +8 -0
- package/dist/types/core/dxf-parser/DxfBaseReader.d.ts +12 -0
- package/dist/types/core/dxf-parser/DxfBinaryReader.d.ts +14 -0
- package/dist/types/core/dxf-parser/DxfParser.d.ts +327 -0
- package/dist/types/core/dxf-parser/DxfTextReader.d.ts +31 -0
- package/dist/types/core/dxf-parser/ParseHelpers.d.ts +36 -0
- package/dist/types/core/dxf-parser/entities/3dface.d.ts +11 -0
- package/dist/types/core/dxf-parser/entities/arc.d.ts +16 -0
- package/dist/types/core/dxf-parser/entities/attdef.d.ts +31 -0
- package/dist/types/core/dxf-parser/entities/attrib.d.ts +31 -0
- package/dist/types/core/dxf-parser/entities/circle.d.ts +13 -0
- package/dist/types/core/dxf-parser/entities/dimension.d.ts +22 -0
- package/dist/types/core/dxf-parser/entities/ellipse.d.ts +15 -0
- package/dist/types/core/dxf-parser/entities/geomtry.d.ts +40 -0
- package/dist/types/core/dxf-parser/entities/hatch.d.ts +108 -0
- package/dist/types/core/dxf-parser/entities/image.d.ts +37 -0
- package/dist/types/core/dxf-parser/entities/insert.d.ts +20 -0
- package/dist/types/core/dxf-parser/entities/leader.d.ts +23 -0
- package/dist/types/core/dxf-parser/entities/line.d.ts +10 -0
- package/dist/types/core/dxf-parser/entities/lwpolyline.d.ts +21 -0
- package/dist/types/core/dxf-parser/entities/mleader.d.ts +101 -0
- package/dist/types/core/dxf-parser/entities/mtext.d.ts +18 -0
- package/dist/types/core/dxf-parser/entities/ole2frame.d.ts +20 -0
- package/dist/types/core/dxf-parser/entities/point.d.ts +11 -0
- package/dist/types/core/dxf-parser/entities/polyline.d.ts +20 -0
- package/dist/types/core/dxf-parser/entities/ray.d.ts +10 -0
- package/dist/types/core/dxf-parser/entities/region.d.ts +10 -0
- package/dist/types/core/dxf-parser/entities/seqend.d.ts +8 -0
- package/dist/types/core/dxf-parser/entities/solid.d.ts +10 -0
- package/dist/types/core/dxf-parser/entities/spline.d.ts +23 -0
- package/dist/types/core/dxf-parser/entities/table.d.ts +42 -0
- package/dist/types/core/dxf-parser/entities/text.d.ts +18 -0
- package/dist/types/core/dxf-parser/entities/vertex.d.ts +20 -0
- package/dist/types/core/dxf-parser/entities/viewport.d.ts +46 -0
- package/dist/types/core/dxf-parser/entities/xline.d.ts +10 -0
- package/dist/types/core/dxf-parser/index.d.ts +27 -0
- package/dist/types/core/dxf-parser/objects/common.d.ts +15 -0
- package/dist/types/core/dxf-parser/objects/dictionary.d.ts +19 -0
- package/dist/types/core/dxf-parser/objects/imagedef.d.ts +24 -0
- package/dist/types/core/dxf-parser/objects/layout.d.ts +29 -0
- package/dist/types/core/dxf-parser/objects/sortentstable.d.ts +12 -0
- package/dist/types/core/dxf-parser/objects/spatialfilter.d.ts +22 -0
- package/dist/types/core/dxf-parser/objects/xrecord.d.ts +11 -0
- package/dist/types/core/font/BaseFont.d.ts +88 -0
- package/dist/types/core/font/FontManager.d.ts +107 -0
- package/dist/types/core/font/MeshFont.d.ts +44 -0
- package/dist/types/core/font/ShxFont.d.ts +108 -0
- package/dist/types/core/font/index.d.ts +1 -0
- package/dist/types/core/font/shx/ExtraLettersTemplate.d.ts +1 -0
- package/dist/types/core/font/shx/Shx.constants.d.ts +11 -0
- package/dist/types/core/font/shx/ShxParser.d.ts +18 -0
- package/dist/types/core/font/shx/TextShape.d.ts +24 -0
- package/dist/types/core/font/shx/gbk/index.d.ts +4 -0
- package/dist/types/core/font/shx/index.d.ts +1 -0
- package/dist/types/core/font/shx/util/BitConverter.d.ts +18 -0
- package/dist/types/core/geometry-offset/Edge.d.ts +27 -0
- package/dist/types/core/geometry-offset/Offset.d.ts +46 -0
- package/dist/types/core/geometry-offset/index.d.ts +1 -0
- package/dist/types/core/helpers/BinaryReader.d.ts +24 -0
- package/dist/types/core/helpers/BoxSelectHelper.d.ts +44 -0
- package/dist/types/core/helpers/LoadingHelper.d.ts +46 -0
- package/dist/types/core/helpers/MobileTouchHelperDrawable.d.ts +26 -0
- package/dist/types/core/helpers/OSnapHelper.d.ts +167 -0
- package/dist/types/core/helpers/ObjectPixelSizeHelper.d.ts +13 -0
- package/dist/types/core/helpers/PickMarkupHelper.d.ts +29 -0
- package/dist/types/core/helpers/RafHelper.d.ts +18 -0
- package/dist/types/core/helpers/ZoomToRectHelper.d.ts +17 -0
- package/dist/types/core/helpers/index.d.ts +9 -0
- package/dist/types/core/index.d.ts +18 -0
- package/dist/types/core/indexeddb/AnnotationTable.d.ts +14 -0
- package/dist/types/core/indexeddb/BaseTable.d.ts +36 -0
- package/dist/types/core/indexeddb/DxfDataTable.d.ts +22 -0
- package/dist/types/core/indexeddb/FontDataTable.d.ts +32 -0
- package/dist/types/core/indexeddb/IndexedDbManager.d.ts +29 -0
- package/dist/types/core/indexeddb/ViewpointTable.d.ts +14 -0
- package/dist/types/core/indexeddb/index.d.ts +6 -0
- package/dist/types/core/input/InputManager.d.ts +161 -0
- package/dist/types/core/input/index.d.ts +1 -0
- package/dist/types/core/license/AutoConfig.d.ts +17 -0
- package/dist/types/core/license/LicenseManager.d.ts +107 -0
- package/dist/types/core/license/PublicKey.d.ts +1 -0
- package/dist/types/core/license/index.d.ts +1 -0
- package/dist/types/core/markup/ArrowMarkup.d.ts +14 -0
- package/dist/types/core/markup/BaseMarkup.d.ts +28 -0
- package/dist/types/core/markup/CircleMarkup.d.ts +12 -0
- package/dist/types/core/markup/CloudLineMarkup.d.ts +10 -0
- package/dist/types/core/markup/CloudRectMarkup.d.ts +11 -0
- package/dist/types/core/markup/CloudRectWithTextMarkup.d.ts +43 -0
- package/dist/types/core/markup/Constants.d.ts +17 -0
- package/dist/types/core/markup/DotMarkup.d.ts +9 -0
- package/dist/types/core/markup/EllipseMarkup.d.ts +12 -0
- package/dist/types/core/markup/LeaderLineMarkup.d.ts +25 -0
- package/dist/types/core/markup/MarkupManager.d.ts +91 -0
- package/dist/types/core/markup/PolylineMarkup.d.ts +11 -0
- package/dist/types/core/markup/RectMarkup.d.ts +10 -0
- package/dist/types/core/markup/TextMarkup.d.ts +40 -0
- package/dist/types/core/markup/XMarkup.d.ts +10 -0
- package/dist/types/core/markup/index.d.ts +13 -0
- package/dist/types/core/model/Constants.d.ts +51 -0
- package/dist/types/core/model/Model.d.ts +18 -0
- package/dist/types/core/model/Model2d.d.ts +115 -0
- package/dist/types/core/model/index.d.ts +3 -0
- package/dist/types/core/patches/Constants.d.ts +4 -0
- package/dist/types/core/patches/Line.d.ts +2 -0
- package/dist/types/core/patches/Mesh.d.ts +2 -0
- package/dist/types/core/patches/Points.d.ts +2 -0
- package/dist/types/core/patches/index.d.ts +4 -0
- package/dist/types/core/undo-redo/AddAnnotationCommand.d.ts +11 -0
- package/dist/types/core/undo-redo/AddMarkupCommand.d.ts +10 -0
- package/dist/types/core/undo-redo/AddMeasurementCommand.d.ts +9 -0
- package/dist/types/core/undo-redo/Command.d.ts +6 -0
- package/dist/types/core/undo-redo/RemoveAnnotationCommand.d.ts +11 -0
- package/dist/types/core/undo-redo/RemoveMarkupCommand.d.ts +10 -0
- package/dist/types/core/undo-redo/RemoveMeasurementCommand.d.ts +9 -0
- package/dist/types/core/undo-redo/UndoRedoManager.d.ts +21 -0
- package/dist/types/core/undo-redo/UpdateMarkupCommand.d.ts +11 -0
- package/dist/types/core/undo-redo/index.d.ts +9 -0
- package/dist/types/core/utils/CSS2DObjectUtils.d.ts +14 -0
- package/dist/types/core/utils/ColorUtils.d.ts +21 -0
- package/dist/types/core/utils/CommonUtils.d.ts +125 -0
- package/dist/types/core/utils/CoordinateUtils.d.ts +81 -0
- package/dist/types/core/utils/DecimalPrecisionUtils.d.ts +4 -0
- package/dist/types/core/utils/DeviceUtils.d.ts +15 -0
- package/dist/types/core/utils/EdgeUtils.d.ts +14 -0
- package/dist/types/core/utils/Event.d.ts +33 -0
- package/dist/types/core/utils/FpsUtils.d.ts +13 -0
- package/dist/types/core/utils/GeometryUtils.d.ts +111 -0
- package/dist/types/core/utils/Locale.d.ts +190 -0
- package/dist/types/core/utils/LogUtils.d.ts +7 -0
- package/dist/types/core/utils/MaterialUtils.d.ts +40 -0
- package/dist/types/core/utils/MathUtils.d.ts +59 -0
- package/dist/types/core/utils/MergeUtils.d.ts +638 -0
- package/dist/types/core/utils/ObjectUtils.d.ts +87 -0
- package/dist/types/core/utils/PolygonUtils.d.ts +8 -0
- package/dist/types/core/utils/SVGObjectUtils.d.ts +16 -0
- package/dist/types/core/utils/SceneUtils.d.ts +26 -0
- package/dist/types/core/utils/SectionUtils.d.ts +11 -0
- package/dist/types/core/utils/UnitConversionUtils.d.ts +31 -0
- package/dist/types/core/utils/index.d.ts +21 -0
- package/dist/types/core/viewers/BaseViewer.d.ts +265 -0
- package/dist/types/core/viewers/DxfViewer.d.ts +1372 -0
- package/dist/types/core/viewers/Plugin.d.ts +29 -0
- package/dist/types/core/viewers/ViewerEvent.d.ts +178 -0
- package/dist/types/core/viewers/index.d.ts +4 -0
- package/dist/types/export.doc.d.ts +10 -0
- package/dist/types/fetch-polyfill.d.ts +2 -0
- package/dist/types/index.d.ts +8 -0
- package/dist/types/plugins/annotation/AnnotationPlugin.d.ts +139 -0
- package/dist/types/plugins/annotation/AutoDrawAnnotation.d.ts +63 -0
- package/dist/types/plugins/annotation/BaseAnnotation.d.ts +113 -0
- package/dist/types/plugins/annotation/BaseAnnotationDrawable.d.ts +139 -0
- package/dist/types/plugins/annotation/CopyAnnotation.d.ts +36 -0
- package/dist/types/plugins/annotation/CopyDrawable.d.ts +26 -0
- package/dist/types/plugins/annotation/FreeDrawAnnotation.d.ts +59 -0
- package/dist/types/plugins/annotation/RectAnnotation.d.ts +53 -0
- package/dist/types/plugins/annotation/RectDrawable.d.ts +42 -0
- package/dist/types/plugins/annotation/ShapeFinder.d.ts +51 -0
- package/dist/types/plugins/annotation/freeDrawDrawable.d.ts +21 -0
- package/dist/types/plugins/annotation/index.d.ts +8 -0
- package/dist/types/plugins/annotation/type.d.ts +182 -0
- package/dist/types/plugins/axis-gizmo/AxisGizmoPlugin.d.ts +49 -0
- package/dist/types/plugins/axis-gizmo/CoordinateAxes.d.ts +12 -0
- package/dist/types/plugins/axis-gizmo/index.d.ts +1 -0
- package/dist/types/plugins/bottom-bar/BottomBarPlugin.d.ts +44 -0
- package/dist/types/plugins/bottom-bar/index.d.ts +1 -0
- package/dist/types/plugins/divide/CoverLayerManager.d.ts +44 -0
- package/dist/types/plugins/divide/DivGeometryUtils.d.ts +66 -0
- package/dist/types/plugins/divide/DividePlugin.d.ts +181 -0
- package/dist/types/plugins/divide/FrameAnnotation.d.ts +142 -0
- package/dist/types/plugins/divide/FrameDrawable.d.ts +75 -0
- package/dist/types/plugins/divide/index.d.ts +6 -0
- package/dist/types/plugins/divide/types.d.ts +38 -0
- package/dist/types/plugins/hotpoint/HotpointPlugin.d.ts +93 -0
- package/dist/types/plugins/hotpoint/index.d.ts +1 -0
- package/dist/types/plugins/index.d.ts +12 -0
- package/dist/types/plugins/layer-manager/LayerManagerPlugin.d.ts +59 -0
- package/dist/types/plugins/layer-manager/index.d.ts +1 -0
- package/dist/types/plugins/local-model-uploader/IUploader.d.ts +10 -0
- package/dist/types/plugins/local-model-uploader/LocalDxfUploader.d.ts +19 -0
- package/dist/types/plugins/local-model-uploader/index.d.ts +1 -0
- package/dist/types/plugins/measure/AngleMeasureDrawable.d.ts +12 -0
- package/dist/types/plugins/measure/AngleMeasurement.d.ts +16 -0
- package/dist/types/plugins/measure/AreaMeasureDrawable.d.ts +14 -0
- package/dist/types/plugins/measure/AreaMeasurement.d.ts +31 -0
- package/dist/types/plugins/measure/BaseMeasureDrawable.d.ts +35 -0
- package/dist/types/plugins/measure/BaseMeasurement.d.ts +127 -0
- package/dist/types/plugins/measure/CoordinateMeasureDrawable.d.ts +10 -0
- package/dist/types/plugins/measure/CoordinateMeasurement.d.ts +15 -0
- package/dist/types/plugins/measure/DistanceMeasureDrawable.d.ts +15 -0
- package/dist/types/plugins/measure/DistanceMeasurement.d.ts +28 -0
- package/dist/types/plugins/measure/MeasurementPlugin.d.ts +131 -0
- package/dist/types/plugins/measure/index.d.ts +3 -0
- package/dist/types/plugins/overview-map/ImageDrawable.d.ts +41 -0
- package/dist/types/plugins/overview-map/LineDrawable.d.ts +20 -0
- package/dist/types/plugins/overview-map/OverviewMapDrawable.d.ts +24 -0
- package/dist/types/plugins/overview-map/OverviewMapPlugin.d.ts +156 -0
- package/dist/types/plugins/overview-map/TextDrawable.d.ts +50 -0
- package/dist/types/plugins/overview-map/index.d.ts +5 -0
- package/dist/types/plugins/screenshot/ScreenshotPlugin.d.ts +88 -0
- package/dist/types/plugins/screenshot/index.d.ts +1 -0
- package/dist/types/plugins/stats/StatsPlugin.d.ts +20 -0
- package/dist/types/plugins/stats/index.d.ts +1 -0
- package/dist/types/plugins/toolbars/DxfViewerToolbarPlugin.d.ts +67 -0
- package/dist/types/plugins/toolbars/MarkupToolbar.d.ts +33 -0
- package/dist/types/plugins/toolbars/Toolbar.config.d.ts +5 -0
- package/dist/types/plugins/toolbars/Toolbar.constants.d.ts +96 -0
- package/dist/types/plugins/toolbars/Toolbar.d.ts +102 -0
- package/dist/types/plugins/toolbars/index.d.ts +5 -0
- package/dist/types/version.d.ts +2 -0
- package/package.json +90 -0
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { DxfBaseReader, IGroup } from "../DxfBaseReader";
|
|
2
|
+
import IGeometry, { IEntity, IPoint } from "./geomtry";
|
|
3
|
+
export interface ITextEntity extends IEntity {
|
|
4
|
+
startPoint: IPoint;
|
|
5
|
+
endPoint: IPoint;
|
|
6
|
+
textHeight: number;
|
|
7
|
+
xScale: number;
|
|
8
|
+
rotation: number;
|
|
9
|
+
text: string;
|
|
10
|
+
textStyle: string;
|
|
11
|
+
mirrored: number;
|
|
12
|
+
halign: number;
|
|
13
|
+
valign: number;
|
|
14
|
+
}
|
|
15
|
+
export default class Text implements IGeometry {
|
|
16
|
+
ForEntityName: "TEXT";
|
|
17
|
+
parseEntity(scanner: DxfBaseReader, curr: IGroup): ITextEntity;
|
|
18
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { DxfBaseReader, IGroup } from "../DxfBaseReader";
|
|
2
|
+
import IGeometry, { IEntity, IPoint } from './geomtry';
|
|
3
|
+
export interface IVertexEntity extends IEntity, IPoint {
|
|
4
|
+
bulge: number;
|
|
5
|
+
curveFittingVertex: boolean;
|
|
6
|
+
curveFitTangent: boolean;
|
|
7
|
+
splineVertex: boolean;
|
|
8
|
+
splineControlPoint: boolean;
|
|
9
|
+
threeDPolylineVertex: boolean;
|
|
10
|
+
threeDPolylineMesh: boolean;
|
|
11
|
+
polyfaceMeshVertex: boolean;
|
|
12
|
+
faceA: number;
|
|
13
|
+
faceB: number;
|
|
14
|
+
faceC: number;
|
|
15
|
+
faceD: number;
|
|
16
|
+
}
|
|
17
|
+
export default class Vertex implements IGeometry {
|
|
18
|
+
ForEntityName: "VERTEX";
|
|
19
|
+
parseEntity(scanner: DxfBaseReader, curr: IGroup): IVertexEntity;
|
|
20
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { DxfBaseReader, IGroup } from "../DxfBaseReader";
|
|
2
|
+
import IGeometry, { IEntity, IPoint } from "./geomtry";
|
|
3
|
+
export interface IViewportEntity extends IEntity {
|
|
4
|
+
centerPoint: IPoint;
|
|
5
|
+
width_paperSpace: number;
|
|
6
|
+
height_paperSpace: number;
|
|
7
|
+
viewportStatus: number;
|
|
8
|
+
viewportId: string;
|
|
9
|
+
centerPoint_dcs: IPoint;
|
|
10
|
+
snapBasePoint_dcs: IPoint;
|
|
11
|
+
snapSpacing_dcs: IPoint;
|
|
12
|
+
gridSpacing_dcs: IPoint;
|
|
13
|
+
viewDirection: IPoint;
|
|
14
|
+
viewTarget: IPoint;
|
|
15
|
+
perspectiveLens: number;
|
|
16
|
+
frontClippingPlaneZ: number;
|
|
17
|
+
backClippingPlaneZ: number;
|
|
18
|
+
viewHeight: number;
|
|
19
|
+
snapAngle: number;
|
|
20
|
+
viewTwistAngle: number;
|
|
21
|
+
circleZoomPercent: number;
|
|
22
|
+
frozenLayerHandles: string[];
|
|
23
|
+
viewportStatusFlags: number;
|
|
24
|
+
viewportClippingBoundaryhandleId: string;
|
|
25
|
+
plotStyleSheetName: string;
|
|
26
|
+
renderMode: number;
|
|
27
|
+
viewportFlag_ucs: number;
|
|
28
|
+
ucsIcon: string;
|
|
29
|
+
ucsOrigin: IPoint;
|
|
30
|
+
ucsXAxis: IPoint;
|
|
31
|
+
ucsYAxis: IPoint;
|
|
32
|
+
ucsTableRecordHandle: string;
|
|
33
|
+
baseUcsTableRecordHandle: string;
|
|
34
|
+
orthographicType: number;
|
|
35
|
+
elevation: number;
|
|
36
|
+
shadePlotMode: number;
|
|
37
|
+
frequency: number;
|
|
38
|
+
lightingFlag: number;
|
|
39
|
+
lightingType: number;
|
|
40
|
+
viewBrightness: number;
|
|
41
|
+
viewContrast: number;
|
|
42
|
+
}
|
|
43
|
+
export default class Viewport implements IGeometry {
|
|
44
|
+
ForEntityName: "VIEWPORT";
|
|
45
|
+
parseEntity(scanner: DxfBaseReader, curr: IGroup): IViewportEntity;
|
|
46
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { DxfBaseReader, IGroup } from "../DxfBaseReader";
|
|
2
|
+
import IGeometry, { IEntity, IPoint } from './geomtry';
|
|
3
|
+
export interface IXLineEntity extends IEntity {
|
|
4
|
+
vertices: IPoint[];
|
|
5
|
+
directionVector: IPoint;
|
|
6
|
+
}
|
|
7
|
+
export default class XLine implements IGeometry {
|
|
8
|
+
ForEntityName: "XLINE";
|
|
9
|
+
parseEntity(scanner: DxfBaseReader, curr: IGroup): IXLineEntity;
|
|
10
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
export { default, default as DxfParser } from "./DxfParser";
|
|
2
|
+
export type { IDxf, IBlock, ILayerTypesTable, ILayersTable, ITables, IViewportTable, IBaseTable, ILayer, ILayerTableDefinition, ILineType, ILineTypeTableDefinition, ITable, ITableDefinitions, IViewport, IViewportTableDefinition, } from "./DxfParser";
|
|
3
|
+
export type { IEntity, IPoint } from "./entities/geomtry";
|
|
4
|
+
export type { I3DfaceEntity } from "./entities/3dface";
|
|
5
|
+
export type { IArcEntity } from "./entities/arc";
|
|
6
|
+
export type { IAttdefEntity } from "./entities/attdef";
|
|
7
|
+
export type { ICircleEntity } from "./entities/circle";
|
|
8
|
+
export type { IDimensionEntity } from "./entities/dimension";
|
|
9
|
+
export type { ILeaderEntity } from "./entities/mleader";
|
|
10
|
+
export type { IEllipseEntity } from "./entities/ellipse";
|
|
11
|
+
export type { IHatchEntity } from "./entities/hatch";
|
|
12
|
+
export type { IInsertEntity } from "./entities/insert";
|
|
13
|
+
export type { ILineEntity } from "./entities/line";
|
|
14
|
+
export type { ILwpolylineEntity } from "./entities/lwpolyline";
|
|
15
|
+
export type { IMtextEntity } from "./entities/mtext";
|
|
16
|
+
export type { IPointEntity } from "./entities/point";
|
|
17
|
+
export type { IPolylineEntity } from "./entities/polyline";
|
|
18
|
+
export type { ISolidEntity } from "./entities/solid";
|
|
19
|
+
export type { ISplineEntity } from "./entities/spline";
|
|
20
|
+
export type { ITextEntity } from "./entities/text";
|
|
21
|
+
export type { ITableEntity, TableCell } from "./entities/table";
|
|
22
|
+
export type { IVertexEntity } from "./entities/vertex";
|
|
23
|
+
export type { IViewportEntity } from "./entities/viewport";
|
|
24
|
+
export type { IObject } from "./objects/common";
|
|
25
|
+
export type { IImageDefObject } from "./objects/imagedef";
|
|
26
|
+
export type { ILayoutObject } from "./objects/layout";
|
|
27
|
+
export type { ISortEntsObject, ISortEntsTableObject } from "./objects/sortentstable";
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { DxfBaseReader, IGroup } from "../DxfBaseReader";
|
|
2
|
+
export interface IObject {
|
|
3
|
+
type: string;
|
|
4
|
+
handle: string;
|
|
5
|
+
ownerHandle: string;
|
|
6
|
+
extendedData?: {
|
|
7
|
+
customStrings?: string[];
|
|
8
|
+
applicationName?: string;
|
|
9
|
+
};
|
|
10
|
+
}
|
|
11
|
+
export declare type ObjectName = "ACAD_PROXY_OBJECT" | "ACDBDICTIONARYWDFLT" | "ACDBPLACEHOLDER" | "DATATABLE" | "DICTIONARY" | "DICTIONARYVAR" | "DIMASSOC" | "FIELD" | "GEODATA" | "IDBUFFER" | "IMAGEDEF" | "IMAGEDEF_REACTOR" | "LAYER_INDEX" | "LAYER_FILTER" | "LAYOUT" | "LIGHTLIST" | "MATERIAL" | "MLINESTYLE" | "OBJECT_PTR" | "PLOTSETTINGS" | "RASTERVARIABLES" | "RENDER" | "SECTION" | "SPATIAL_INDEX" | "SPATIAL_FILTER" | "SORTENTSTABLE" | "TABLESTYLE" | "UNDERLAYDEFINITION" | "VISUALSTYLE" | "VBA_PROJECT" | "WIPEOUTVARIABLES" | "XRECORD";
|
|
12
|
+
export interface IObjectParser {
|
|
13
|
+
ForObjectName: ObjectName;
|
|
14
|
+
parseObject(scanner: DxfBaseReader, curr: IGroup): IObject;
|
|
15
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { DxfBaseReader, IGroup } from "../DxfBaseReader";
|
|
2
|
+
import { IObject, IObjectParser } from "./common";
|
|
3
|
+
export declare enum DictionaryCloningFlags {
|
|
4
|
+
NotApplicable = 0,
|
|
5
|
+
KeepExisting = 1,
|
|
6
|
+
UseClone = 2,
|
|
7
|
+
XrefName = 3,
|
|
8
|
+
Name = 4,
|
|
9
|
+
UnmangleName = 5
|
|
10
|
+
}
|
|
11
|
+
export interface IDictionaryObject extends IObject {
|
|
12
|
+
entries: Record<string, string>;
|
|
13
|
+
isHardOwner: boolean;
|
|
14
|
+
cloningFlag: DictionaryCloningFlags;
|
|
15
|
+
}
|
|
16
|
+
export declare class Dictionary implements IObjectParser {
|
|
17
|
+
ForObjectName: "DICTIONARY";
|
|
18
|
+
parseObject(scanner: DxfBaseReader, curr: IGroup): IDictionaryObject;
|
|
19
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { DxfBaseReader, IGroup } from "../DxfBaseReader";
|
|
2
|
+
import { IPoint } from "../entities/geomtry";
|
|
3
|
+
import { IObject, IObjectParser } from "./common";
|
|
4
|
+
export declare enum ImgaeDefLoaded {
|
|
5
|
+
Unloaded = 0,
|
|
6
|
+
Loaded = 1
|
|
7
|
+
}
|
|
8
|
+
export declare enum ImageDefResolutionUnits {
|
|
9
|
+
NoUnits = 0,
|
|
10
|
+
Centimeters = 2,
|
|
11
|
+
Inches = 5
|
|
12
|
+
}
|
|
13
|
+
export interface IImageDefObject extends IObject {
|
|
14
|
+
classVersion: number;
|
|
15
|
+
filename: string;
|
|
16
|
+
imageSize: IPoint;
|
|
17
|
+
pixelSize: IPoint;
|
|
18
|
+
loaded: ImgaeDefLoaded;
|
|
19
|
+
resolutionUnits: ImageDefResolutionUnits;
|
|
20
|
+
}
|
|
21
|
+
export declare class ImageDef implements IObjectParser {
|
|
22
|
+
ForObjectName: "IMAGEDEF";
|
|
23
|
+
parseObject(scanner: DxfBaseReader, curr: IGroup): IImageDefObject;
|
|
24
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { IObject, IObjectParser } from './common';
|
|
2
|
+
import { DxfBaseReader, IGroup } from '../DxfBaseReader';
|
|
3
|
+
import { IPoint } from '../entities/geomtry';
|
|
4
|
+
/**
|
|
5
|
+
* @internal
|
|
6
|
+
*/
|
|
7
|
+
export interface ILayoutObject extends IObject {
|
|
8
|
+
plotSettings?: object;
|
|
9
|
+
layoutName: string;
|
|
10
|
+
flag: number;
|
|
11
|
+
tabOrder: number;
|
|
12
|
+
minLimit: IPoint;
|
|
13
|
+
maxLimit: IPoint;
|
|
14
|
+
basePoint: IPoint;
|
|
15
|
+
minExtent: IPoint;
|
|
16
|
+
maxExtent: IPoint;
|
|
17
|
+
elevation: number;
|
|
18
|
+
origin: IPoint;
|
|
19
|
+
XAxis: IPoint;
|
|
20
|
+
YAxis: IPoint;
|
|
21
|
+
orthographicType: number;
|
|
22
|
+
blockTableHandle: string;
|
|
23
|
+
viewportHandle: string;
|
|
24
|
+
associatedBlockName: string;
|
|
25
|
+
}
|
|
26
|
+
export declare class Layout implements IObjectParser {
|
|
27
|
+
ForObjectName: "LAYOUT";
|
|
28
|
+
parseObject(scanner: DxfBaseReader, curr: IGroup): ILayoutObject;
|
|
29
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { DxfBaseReader, IGroup } from "../DxfBaseReader";
|
|
2
|
+
import { IObject, IObjectParser } from "./common";
|
|
3
|
+
export interface ISortEntsObject extends IObject {
|
|
4
|
+
entityHandles: string[][];
|
|
5
|
+
}
|
|
6
|
+
export interface ISortEntsTableObject extends IObject {
|
|
7
|
+
sortEntsObject: ISortEntsObject;
|
|
8
|
+
}
|
|
9
|
+
export declare class SortEntsTable implements IObjectParser {
|
|
10
|
+
ForObjectName: "SORTENTSTABLE";
|
|
11
|
+
parseObject(scanner: DxfBaseReader, curr: IGroup): ISortEntsTableObject;
|
|
12
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { DxfBaseReader, IGroup } from "../DxfBaseReader";
|
|
2
|
+
import { IPoint } from "../entities/geomtry";
|
|
3
|
+
import { IObject, IObjectParser } from "./common";
|
|
4
|
+
export interface ISpatialFilterObject extends IObject {
|
|
5
|
+
origin: IPoint;
|
|
6
|
+
numberOfPointsOnClipBoundary: number;
|
|
7
|
+
vertices: IPoint[];
|
|
8
|
+
extrusionDirectionX: number;
|
|
9
|
+
extrusionDirectionY: number;
|
|
10
|
+
extrusionDirectionZ: number;
|
|
11
|
+
clipBoundaryVisible: boolean;
|
|
12
|
+
frontClippingPlaneFlag: boolean;
|
|
13
|
+
frontClippingPlaneDistance: number;
|
|
14
|
+
backClippingPlaneFlag: boolean;
|
|
15
|
+
backClippingPlaneDistance: number;
|
|
16
|
+
matrix: number[];
|
|
17
|
+
invertBlockMatrix: number[];
|
|
18
|
+
}
|
|
19
|
+
export declare class SpatialFilter implements IObjectParser {
|
|
20
|
+
ForObjectName: "SPATIAL_FILTER";
|
|
21
|
+
parseObject(scanner: DxfBaseReader, curr: IGroup): ISpatialFilterObject;
|
|
22
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { DxfBaseReader, IGroup } from "../DxfBaseReader";
|
|
2
|
+
import { IObject, IObjectParser } from "./common";
|
|
3
|
+
import { DictionaryCloningFlags } from "./dictionary";
|
|
4
|
+
export interface IXRecord extends IObject {
|
|
5
|
+
binaryData: string | undefined;
|
|
6
|
+
cloningFlag: DictionaryCloningFlags;
|
|
7
|
+
}
|
|
8
|
+
export declare class XRecord implements IObjectParser {
|
|
9
|
+
ForObjectName: "XRECORD";
|
|
10
|
+
parseObject(scanner: DxfBaseReader, curr: IGroup): IXRecord;
|
|
11
|
+
}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import { Font } from "three/examples/jsm/loaders/FontLoader.js";
|
|
2
|
+
import { FontDataTableRecord } from "../indexeddb";
|
|
3
|
+
import { Orientation } from "./shx";
|
|
4
|
+
/**
|
|
5
|
+
* 字体基类
|
|
6
|
+
* 继承自 THREE.Font,提供字体的基础功能和抽象接口
|
|
7
|
+
*/
|
|
8
|
+
export declare abstract class BaseFont extends Font {
|
|
9
|
+
/** 字体信息描述 */
|
|
10
|
+
info: string;
|
|
11
|
+
/** 字体方向(水平或垂直) */
|
|
12
|
+
orientation: Orientation;
|
|
13
|
+
/** 基线上方高度 */
|
|
14
|
+
baseUp: number;
|
|
15
|
+
/** 基线下方深度 */
|
|
16
|
+
baseDown: number;
|
|
17
|
+
/** 字体文件头信息 */
|
|
18
|
+
fileHeader: string;
|
|
19
|
+
/** 字体文件版本 */
|
|
20
|
+
fileVersion: string;
|
|
21
|
+
/** 字体文件名 */
|
|
22
|
+
fileName: string;
|
|
23
|
+
/** 字体数据,具体格式由子类定义 */
|
|
24
|
+
data: any;
|
|
25
|
+
/** 字体优先级顺序 */
|
|
26
|
+
order: number;
|
|
27
|
+
/** 不支持的字符记录,仅用于日志统计 */
|
|
28
|
+
unsupportedChars: Record<string, number>;
|
|
29
|
+
/**
|
|
30
|
+
* 构造函数
|
|
31
|
+
* @param fileName 字体文件名
|
|
32
|
+
* @param fileData 字体文件数据
|
|
33
|
+
*/
|
|
34
|
+
constructor(fileName: string, fileData: any);
|
|
35
|
+
/**
|
|
36
|
+
* 获取指定字符的形状
|
|
37
|
+
* @param char 字符
|
|
38
|
+
* @param size 字体大小
|
|
39
|
+
* @returns THREE.Shape对象或undefined
|
|
40
|
+
*/
|
|
41
|
+
abstract getCharShape(char: string, size: number): THREE.Shape | undefined;
|
|
42
|
+
/**
|
|
43
|
+
* 获取未找到字符时的替代形状
|
|
44
|
+
* @param size 字体大小
|
|
45
|
+
* @returns THREE.Shape对象或undefined
|
|
46
|
+
*/
|
|
47
|
+
abstract getNotFoundTextShape(size: number): THREE.Shape | undefined;
|
|
48
|
+
/**
|
|
49
|
+
* 添加不支持的字符到记录中
|
|
50
|
+
* 仅用于日志统计用途
|
|
51
|
+
* @param char 不支持的字符
|
|
52
|
+
*/
|
|
53
|
+
protected addUnsupportedChar(char: string): void;
|
|
54
|
+
/**
|
|
55
|
+
* 获取字体文件数据对象
|
|
56
|
+
* @returns 包含字体所有属性的对象
|
|
57
|
+
*/
|
|
58
|
+
protected getFontFile(): {
|
|
59
|
+
order: number;
|
|
60
|
+
data: any;
|
|
61
|
+
info: string;
|
|
62
|
+
orientation: Orientation;
|
|
63
|
+
baseUp: number;
|
|
64
|
+
baseDown: number;
|
|
65
|
+
fileName: string;
|
|
66
|
+
fileHeader: string;
|
|
67
|
+
fileVersion: string;
|
|
68
|
+
};
|
|
69
|
+
/**
|
|
70
|
+
* 从数据库记录设置字体文件属性
|
|
71
|
+
* @param data 字体数据表记录
|
|
72
|
+
*/
|
|
73
|
+
setFontFile(data: FontDataTableRecord): void;
|
|
74
|
+
/**
|
|
75
|
+
* 将字体数据缓存到 IndexedDB 中
|
|
76
|
+
* @returns Promise<void>
|
|
77
|
+
*/
|
|
78
|
+
setFontDataToIndexedDb(): Promise<void>;
|
|
79
|
+
/**
|
|
80
|
+
* 从 IndexedDB 中获取字体数据
|
|
81
|
+
* @returns Promise<FontDataTableRecord> 字体数据表记录
|
|
82
|
+
*/
|
|
83
|
+
getFontDataByIndexedDb(): Promise<FontDataTableRecord>;
|
|
84
|
+
/**
|
|
85
|
+
* 释放字体数据,清空内存占用
|
|
86
|
+
*/
|
|
87
|
+
releaseFontData(): void;
|
|
88
|
+
}
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
import * as THREE from "three";
|
|
2
|
+
import { TextGeometry } from "three/examples/jsm/geometries/TextGeometry.js";
|
|
3
|
+
import { BaseFont } from "./BaseFont";
|
|
4
|
+
/**
|
|
5
|
+
* 字体管理器
|
|
6
|
+
* 负责加载、管理和使用不同类型的字体文件
|
|
7
|
+
*/
|
|
8
|
+
export declare class FontManager {
|
|
9
|
+
private loader;
|
|
10
|
+
protected fontMap: Map<string, BaseFont>;
|
|
11
|
+
protected fileNames?: string[];
|
|
12
|
+
unsupportedChars: Record<string, number>;
|
|
13
|
+
missingFonts: Record<string, number>;
|
|
14
|
+
static enableFontCache: boolean;
|
|
15
|
+
constructor();
|
|
16
|
+
/**
|
|
17
|
+
* 加载字体文件
|
|
18
|
+
* @param urls 字体文件URL数组,顺序代表优先级
|
|
19
|
+
* @returns Promise<void>
|
|
20
|
+
* @description 最佳字体顺序:先加载线性字体,再加载ttf字体,字体类型优先加载西文字体,再加载中文字体
|
|
21
|
+
* @description 微软雅黑是Win平台上最值得选择的中文字体,但不是默认查看器,需要设置;Arial、Tahoma等无衬线字体是西文字体的主力
|
|
22
|
+
* @description 目前苹果推出的最新字体San Francisco显示效果最优雅,但只有最新系统才能支持,而黑体-简体和Helvetica能获得更多系统版本支持,显示效果也相近,可以接受
|
|
23
|
+
* @example font-family: Helvetica, Tahoma, Arial, "PingFang SC", "Hiragino Sans GB", "Heiti SC", "Microsoft YaHei", "WenQuanYi Micro Hei", sans-serif;
|
|
24
|
+
*/
|
|
25
|
+
loadFonts(urls: string[]): Promise<void>;
|
|
26
|
+
/**
|
|
27
|
+
* 根据字体名称和大小获取文本形状
|
|
28
|
+
* @param text 文本内容
|
|
29
|
+
* @param fontName 字体名称
|
|
30
|
+
* @param size 字体大小
|
|
31
|
+
* @returns 文本形状数据
|
|
32
|
+
*/
|
|
33
|
+
getTextShape(text: string, fontName: string, size: number): THREE.Shape[] | undefined;
|
|
34
|
+
/**
|
|
35
|
+
* 获取字符形状
|
|
36
|
+
* @param char 字符
|
|
37
|
+
* @param fontName 字体名称
|
|
38
|
+
* @param size 字体大小
|
|
39
|
+
* @returns 字符的几何形状
|
|
40
|
+
*/
|
|
41
|
+
getCharShape(char: string, fontName: string, size: number): THREE.BufferGeometry<THREE.NormalBufferAttributes> | TextGeometry | undefined;
|
|
42
|
+
/**
|
|
43
|
+
* 获取未找到文本的默认形状
|
|
44
|
+
* @param size 字体大小
|
|
45
|
+
* @returns 默认文本形状的几何体
|
|
46
|
+
*/
|
|
47
|
+
getNotFoundTextShape(size: number): THREE.BufferGeometry<THREE.NormalBufferAttributes> | THREE.ExtrudeGeometry | undefined;
|
|
48
|
+
/**
|
|
49
|
+
* 检查所有字体是否已加载
|
|
50
|
+
* @param fontUrls 字体URL数组
|
|
51
|
+
* @returns 是否所有字体都已加载
|
|
52
|
+
*/
|
|
53
|
+
private checkAllFontsLoaded;
|
|
54
|
+
/**
|
|
55
|
+
* 从IndexedDB获取字体数据
|
|
56
|
+
*/
|
|
57
|
+
getFontFromIndexeddb(): Promise<void>;
|
|
58
|
+
/**
|
|
59
|
+
* 检查指定字体是否为SHX字体
|
|
60
|
+
* @param fontName 字体名称
|
|
61
|
+
* @returns 是否为SHX字体
|
|
62
|
+
*/
|
|
63
|
+
isShxFont(fontName: string): boolean | undefined;
|
|
64
|
+
/**
|
|
65
|
+
* 获取不支持的字符(仅用于日志记录)
|
|
66
|
+
* @returns 不支持的字符记录
|
|
67
|
+
*/
|
|
68
|
+
getUnsupportedChar(): Record<string, number>;
|
|
69
|
+
/**
|
|
70
|
+
* 释放字体数据
|
|
71
|
+
*/
|
|
72
|
+
releaseFontData(): void;
|
|
73
|
+
/**
|
|
74
|
+
* 销毁字体管理器
|
|
75
|
+
*/
|
|
76
|
+
destroy(): void;
|
|
77
|
+
/**
|
|
78
|
+
* 判断是否为SHX文件
|
|
79
|
+
* @param url 文件URL
|
|
80
|
+
* @returns 是否为SHX文件
|
|
81
|
+
*/
|
|
82
|
+
static isShxFile(url: string): boolean;
|
|
83
|
+
/**
|
|
84
|
+
* 判断是否为TTF文件
|
|
85
|
+
* @param url 文件URL
|
|
86
|
+
* @returns 是否为TTF文件
|
|
87
|
+
*/
|
|
88
|
+
static isTtfFile(url: string): boolean;
|
|
89
|
+
/**
|
|
90
|
+
* 判断是否为JSON文件
|
|
91
|
+
* @param url 文件URL
|
|
92
|
+
* @returns 是否为JSON文件
|
|
93
|
+
*/
|
|
94
|
+
static isJsonFile(url: string): boolean;
|
|
95
|
+
/**
|
|
96
|
+
* 从URL中提取文件名
|
|
97
|
+
* @param url 文件URL
|
|
98
|
+
* @returns 文件名
|
|
99
|
+
*/
|
|
100
|
+
static getFileName(url: string): string;
|
|
101
|
+
/**
|
|
102
|
+
* 从URL中提取文件扩展名
|
|
103
|
+
* @param url 文件URL
|
|
104
|
+
* @returns 文件扩展名
|
|
105
|
+
*/
|
|
106
|
+
static getExtension(url: string): string;
|
|
107
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import * as THREE from "three";
|
|
2
|
+
import { FontDataTableRecord } from "../indexeddb";
|
|
3
|
+
import { BaseFont } from "./BaseFont";
|
|
4
|
+
/**
|
|
5
|
+
* 网格字体类,继承自BaseFont
|
|
6
|
+
* 支持TTF等矢量字体格式,可生成THREE.js的Shape对象用于文本渲染
|
|
7
|
+
*/
|
|
8
|
+
export declare class MeshFont extends BaseFont {
|
|
9
|
+
/** 是否翻转字体路径 */
|
|
10
|
+
reversed: boolean;
|
|
11
|
+
/**
|
|
12
|
+
* 构造函数
|
|
13
|
+
* @param fileName 字体文件名
|
|
14
|
+
* @param fileData 字体文件数据,可以是JSON对象、数据库记录或ArrayBuffer
|
|
15
|
+
*/
|
|
16
|
+
constructor(fileName: string, fileData: object | FontDataTableRecord | ArrayBuffer);
|
|
17
|
+
/**
|
|
18
|
+
* 生成文本的Shape数组
|
|
19
|
+
* @param text 文本内容
|
|
20
|
+
* @param size 字体大小
|
|
21
|
+
* @returns Shape数组
|
|
22
|
+
*/
|
|
23
|
+
generateShapes(text: string, size: number): THREE.Shape[];
|
|
24
|
+
/**
|
|
25
|
+
* 获取单个字符的Shape对象
|
|
26
|
+
* @param char 字符
|
|
27
|
+
* @param size 字体大小
|
|
28
|
+
* @returns THREE.Shape对象,如果字符不存在则返回undefined
|
|
29
|
+
*/
|
|
30
|
+
getCharShape(char: string, size: number): THREE.Shape | undefined;
|
|
31
|
+
/**
|
|
32
|
+
* 获取找不到字符时的替代Shape
|
|
33
|
+
* 当字符不存在时,使用"?"作为替代显示
|
|
34
|
+
* @param size 字体大小
|
|
35
|
+
* @returns "?"字符的Shape对象
|
|
36
|
+
*/
|
|
37
|
+
getNotFoundTextShape(size: number): THREE.Shape | undefined;
|
|
38
|
+
/**
|
|
39
|
+
* 解析TTF字体数据
|
|
40
|
+
* @param data TTF字体的ArrayBuffer数据
|
|
41
|
+
* @returns 解析后的字体数据对象
|
|
42
|
+
*/
|
|
43
|
+
private parseTTF;
|
|
44
|
+
}
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import * as THREE from "three";
|
|
2
|
+
import { BaseFont } from "./BaseFont";
|
|
3
|
+
import { ShxFontType } from "./shx/Shx.constants";
|
|
4
|
+
import { TextShape } from "./shx/TextShape";
|
|
5
|
+
import { FontDataTableRecord } from "../../core/indexeddb";
|
|
6
|
+
/**
|
|
7
|
+
* SHX字体类,继承自BaseFont
|
|
8
|
+
* 专门用于处理AutoCAD的SHX格式字体文件
|
|
9
|
+
* 支持shapes、bigfont、unifont三种字体类型
|
|
10
|
+
*/
|
|
11
|
+
export declare class ShxFont extends BaseFont {
|
|
12
|
+
/** 是否为扩展字体 */
|
|
13
|
+
isExtend: boolean;
|
|
14
|
+
/** 是否为Unicode字体 */
|
|
15
|
+
isUniCode: boolean;
|
|
16
|
+
/** 是否为嵌入式字体 */
|
|
17
|
+
isEmbedded: boolean;
|
|
18
|
+
/** 默认字体大小 */
|
|
19
|
+
static DEFAULT_SIZE: number;
|
|
20
|
+
/** 字体类型,默认为Unifont */
|
|
21
|
+
fontType: ShxFontType;
|
|
22
|
+
/** TextShape缓存,用于提高性能,键值格式为 `${code}_${size}` */
|
|
23
|
+
private textShapesCache;
|
|
24
|
+
/** 字符图形数据缓存,键为字符编码 */
|
|
25
|
+
private graphicData;
|
|
26
|
+
/**
|
|
27
|
+
* 构造函数
|
|
28
|
+
* @param fileName 字体文件名
|
|
29
|
+
* @param fileData 字体文件数据,可以是ArrayBuffer或数据库记录
|
|
30
|
+
*/
|
|
31
|
+
constructor(fileName: string, fileData: ArrayBuffer | FontDataTableRecord);
|
|
32
|
+
/**
|
|
33
|
+
* 生成文本的形状数组
|
|
34
|
+
* @param text 要生成形状的文本
|
|
35
|
+
* @param size 字体大小
|
|
36
|
+
* @returns TextShape数组
|
|
37
|
+
*/
|
|
38
|
+
generateShapes(text: string, size: number): TextShape[];
|
|
39
|
+
/**
|
|
40
|
+
* 根据字符获取TextShape对象
|
|
41
|
+
* @param char 字符
|
|
42
|
+
* @param size 字体大小
|
|
43
|
+
* @returns TextShape对象或undefined
|
|
44
|
+
*/
|
|
45
|
+
getCharShape(char: string, size: number): TextShape | undefined;
|
|
46
|
+
/**
|
|
47
|
+
* 根据字符编码获取TextShape对象
|
|
48
|
+
* @param code 字符编码
|
|
49
|
+
* @param size 字体大小
|
|
50
|
+
* @returns TextShape对象或undefined
|
|
51
|
+
*/
|
|
52
|
+
getGraphicDataByCode(code: number, size: number): TextShape | undefined;
|
|
53
|
+
/**
|
|
54
|
+
* 根据字符编码、字体大小和偏移量获取TextShape对象
|
|
55
|
+
* @param code 字符编码
|
|
56
|
+
* @param size 字体大小
|
|
57
|
+
* @param translate 偏移向量
|
|
58
|
+
* @returns 带偏移的TextShape对象或undefined
|
|
59
|
+
*/
|
|
60
|
+
getGraphicDataByCodeWithOffset(code: number, size: number, translate: THREE.Vector2): TextShape | undefined;
|
|
61
|
+
/**
|
|
62
|
+
* 解析BigFont类型的字体文件
|
|
63
|
+
* @param reader 二进制读取器
|
|
64
|
+
*/
|
|
65
|
+
private parseBigFont;
|
|
66
|
+
/**
|
|
67
|
+
* 解析UniFont类型的字体文件
|
|
68
|
+
* @param reader 二进制读取器
|
|
69
|
+
*/
|
|
70
|
+
private parseUniFont;
|
|
71
|
+
/**
|
|
72
|
+
* 解析Shape类型的字体文件
|
|
73
|
+
* @param reader 二进制读取器
|
|
74
|
+
*/
|
|
75
|
+
private parseShapeFont;
|
|
76
|
+
/**
|
|
77
|
+
* 获取未找到字符时的替代形状
|
|
78
|
+
* 对于不支持的字符,使用"?"作为替代
|
|
79
|
+
* @param size 字体大小
|
|
80
|
+
* @returns TextShape对象或undefined
|
|
81
|
+
*/
|
|
82
|
+
getNotFoundTextShape(size: number): TextShape | undefined;
|
|
83
|
+
/**
|
|
84
|
+
* 获取字体文件信息
|
|
85
|
+
* @returns 字体文件数据对象
|
|
86
|
+
*/
|
|
87
|
+
protected getFontFile(): {
|
|
88
|
+
fontType: ShxFontType;
|
|
89
|
+
order: number;
|
|
90
|
+
data: any;
|
|
91
|
+
info: string;
|
|
92
|
+
orientation: import("./shx/Shx.constants").Orientation;
|
|
93
|
+
baseUp: number;
|
|
94
|
+
baseDown: number;
|
|
95
|
+
fileName: string;
|
|
96
|
+
fileHeader: string;
|
|
97
|
+
fileVersion: string;
|
|
98
|
+
};
|
|
99
|
+
/**
|
|
100
|
+
* 设置字体文件信息
|
|
101
|
+
* @param data 字体数据库记录
|
|
102
|
+
*/
|
|
103
|
+
setFontFile(data: FontDataTableRecord): void;
|
|
104
|
+
/**
|
|
105
|
+
* 释放字体数据,清理缓存
|
|
106
|
+
*/
|
|
107
|
+
releaseFontData(): void;
|
|
108
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./FontManager";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const letters: Record<string, Array<Array<Array<number>>>>;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { ShxFont } from "../ShxFont";
|
|
2
|
+
import { TextShape } from "./TextShape";
|
|
3
|
+
import { BinaryReader } from "../../../core/helpers/BinaryReader";
|
|
4
|
+
export declare class ShxParser {
|
|
5
|
+
static FILE_STOP_FLAG: string[];
|
|
6
|
+
protected static CIRCLE_SPAN: number;
|
|
7
|
+
static parserHeader(reader: BinaryReader, stopMatch: string[]): string;
|
|
8
|
+
/**
|
|
9
|
+
* Gets code id of a char.
|
|
10
|
+
*/
|
|
11
|
+
static getCode(char: string): number;
|
|
12
|
+
/**
|
|
13
|
+
* Parses code data and generates TextShape.
|
|
14
|
+
*/
|
|
15
|
+
static parserCode(file: ShxFont, data: Uint8Array, scale: number): TextShape;
|
|
16
|
+
private static skipCode;
|
|
17
|
+
private static generateArcPoints;
|
|
18
|
+
}
|