@x-viewer/core 0.9.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.
Files changed (238) hide show
  1. package/README.md +2 -0
  2. package/dist/index.esm.js +11790 -0
  3. package/dist/types/Locale.d.ts +23 -0
  4. package/dist/types/components/dxf-layout-bar/DxfLayoutBar.d.ts +26 -0
  5. package/dist/types/components/dxf-layout-bar/index.d.ts +1 -0
  6. package/dist/types/components/tool-tip/Tooltip.d.ts +20 -0
  7. package/dist/types/components/tool-tip/index.d.ts +1 -0
  8. package/dist/types/core/Configs.d.ts +288 -0
  9. package/dist/types/core/Constants.d.ts +81 -0
  10. package/dist/types/core/Units.d.ts +16 -0
  11. package/dist/types/core/VersionManager.d.ts +14 -0
  12. package/dist/types/core/camera/CameraManager.d.ts +80 -0
  13. package/dist/types/core/camera/index.d.ts +1 -0
  14. package/dist/types/core/camera-controls/CameraControls.d.ts +744 -0
  15. package/dist/types/core/camera-controls/Constants.d.ts +2 -0
  16. package/dist/types/core/camera-controls/EventDispatcher.d.ts +41 -0
  17. package/dist/types/core/camera-controls/index.d.ts +3 -0
  18. package/dist/types/core/camera-controls/types.d.ts +112 -0
  19. package/dist/types/core/camera-controls/utils/extractClientCoordFromEvent.d.ts +3 -0
  20. package/dist/types/core/camera-controls/utils/math-utils.d.ts +14 -0
  21. package/dist/types/core/camera-controls/utils/notSupportedInOrthographicCamera.d.ts +2 -0
  22. package/dist/types/core/canvas/CanvasRender.d.ts +52 -0
  23. package/dist/types/core/canvas/Constants.d.ts +31 -0
  24. package/dist/types/core/canvas/Drawable.d.ts +98 -0
  25. package/dist/types/core/canvas/DrawableList.d.ts +40 -0
  26. package/dist/types/core/canvas/MarkerDrawable.d.ts +30 -0
  27. package/dist/types/core/canvas/PathDrawable.d.ts +39 -0
  28. package/dist/types/core/canvas/index.d.ts +6 -0
  29. package/dist/types/core/compare/BaseDxfCompareHelper.d.ts +104 -0
  30. package/dist/types/core/compare/CompareDrawable.d.ts +18 -0
  31. package/dist/types/core/compare/DxfCompareHelper.d.ts +69 -0
  32. package/dist/types/core/compare/DxfCompareMarkupManager.d.ts +11 -0
  33. package/dist/types/core/compare/index.d.ts +4 -0
  34. package/dist/types/core/components/Container.d.ts +38 -0
  35. package/dist/types/core/components/ProgressBar.d.ts +31 -0
  36. package/dist/types/core/components/Spinner.d.ts +16 -0
  37. package/dist/types/core/components/index.d.ts +3 -0
  38. package/dist/types/core/controls/CameraControlsEx.d.ts +37 -0
  39. package/dist/types/core/controls/Control.d.ts +17 -0
  40. package/dist/types/core/controls/OrbitControls.d.ts +13 -0
  41. package/dist/types/core/controls/PlanControls.d.ts +13 -0
  42. package/dist/types/core/controls/index.d.ts +4 -0
  43. package/dist/types/core/dxf/DxfCompare.d.ts +151 -0
  44. package/dist/types/core/dxf/DxfConstants.d.ts +33 -0
  45. package/dist/types/core/dxf/DxfLoader.d.ts +557 -0
  46. package/dist/types/core/dxf/DxfObject.d.ts +33 -0
  47. package/dist/types/core/dxf/DxfUtils.d.ts +45 -0
  48. package/dist/types/core/dxf/HatchPatternShaders.d.ts +12 -0
  49. package/dist/types/core/dxf/LinePatternShaders.d.ts +12 -0
  50. package/dist/types/core/dxf/bspline.d.ts +7 -0
  51. package/dist/types/core/dxf/dxfom-mtext.d.ts +46 -0
  52. package/dist/types/core/dxf/dxfom-text.d.ts +16 -0
  53. package/dist/types/core/dxf/index.d.ts +10 -0
  54. package/dist/types/core/dxf/round10.d.ts +1 -0
  55. package/dist/types/core/dxf-parser/AutoCadColorIndex.d.ts +8 -0
  56. package/dist/types/core/dxf-parser/DxfBaseReader.d.ts +12 -0
  57. package/dist/types/core/dxf-parser/DxfBinaryReader.d.ts +14 -0
  58. package/dist/types/core/dxf-parser/DxfParser.d.ts +324 -0
  59. package/dist/types/core/dxf-parser/DxfTextReader.d.ts +31 -0
  60. package/dist/types/core/dxf-parser/ParseHelpers.d.ts +45 -0
  61. package/dist/types/core/dxf-parser/entities/3dface.d.ts +13 -0
  62. package/dist/types/core/dxf-parser/entities/arc.d.ts +18 -0
  63. package/dist/types/core/dxf-parser/entities/attdef.d.ts +33 -0
  64. package/dist/types/core/dxf-parser/entities/attrib.d.ts +33 -0
  65. package/dist/types/core/dxf-parser/entities/circle.d.ts +15 -0
  66. package/dist/types/core/dxf-parser/entities/dimension.d.ts +24 -0
  67. package/dist/types/core/dxf-parser/entities/ellipse.d.ts +17 -0
  68. package/dist/types/core/dxf-parser/entities/geomtry.d.ts +42 -0
  69. package/dist/types/core/dxf-parser/entities/hatch.d.ts +110 -0
  70. package/dist/types/core/dxf-parser/entities/image.d.ts +39 -0
  71. package/dist/types/core/dxf-parser/entities/insert.d.ts +22 -0
  72. package/dist/types/core/dxf-parser/entities/leader.d.ts +23 -0
  73. package/dist/types/core/dxf-parser/entities/line.d.ts +12 -0
  74. package/dist/types/core/dxf-parser/entities/lwpolyline.d.ts +23 -0
  75. package/dist/types/core/dxf-parser/entities/mleader.d.ts +103 -0
  76. package/dist/types/core/dxf-parser/entities/mtext.d.ts +20 -0
  77. package/dist/types/core/dxf-parser/entities/ole2frame.d.ts +22 -0
  78. package/dist/types/core/dxf-parser/entities/point.d.ts +13 -0
  79. package/dist/types/core/dxf-parser/entities/polyline.d.ts +22 -0
  80. package/dist/types/core/dxf-parser/entities/ray.d.ts +12 -0
  81. package/dist/types/core/dxf-parser/entities/region.d.ts +12 -0
  82. package/dist/types/core/dxf-parser/entities/seqend.d.ts +10 -0
  83. package/dist/types/core/dxf-parser/entities/solid.d.ts +12 -0
  84. package/dist/types/core/dxf-parser/entities/spline.d.ts +25 -0
  85. package/dist/types/core/dxf-parser/entities/table.d.ts +44 -0
  86. package/dist/types/core/dxf-parser/entities/text.d.ts +20 -0
  87. package/dist/types/core/dxf-parser/entities/vertex.d.ts +22 -0
  88. package/dist/types/core/dxf-parser/entities/viewport.d.ts +56 -0
  89. package/dist/types/core/dxf-parser/entities/xline.d.ts +12 -0
  90. package/dist/types/core/dxf-parser/index.d.ts +27 -0
  91. package/dist/types/core/dxf-parser/objects/common.d.ts +26 -0
  92. package/dist/types/core/dxf-parser/objects/dictionary.d.ts +23 -0
  93. package/dist/types/core/dxf-parser/objects/imagedef.d.ts +24 -0
  94. package/dist/types/core/dxf-parser/objects/layout.d.ts +29 -0
  95. package/dist/types/core/dxf-parser/objects/sortentstable.d.ts +12 -0
  96. package/dist/types/core/dxf-parser/objects/spatialfilter.d.ts +22 -0
  97. package/dist/types/core/dxf-parser/objects/xrecord.d.ts +11 -0
  98. package/dist/types/core/effect/EffectManager.d.ts +43 -0
  99. package/dist/types/core/effect/index.d.ts +1 -0
  100. package/dist/types/core/font/BaseFont.d.ts +41 -0
  101. package/dist/types/core/font/FontManager.d.ts +52 -0
  102. package/dist/types/core/font/MeshFont.d.ts +14 -0
  103. package/dist/types/core/font/ShxFont.d.ts +49 -0
  104. package/dist/types/core/font/index.d.ts +1 -0
  105. package/dist/types/core/font/shx/ExtraLettersTemplate.d.ts +4 -0
  106. package/dist/types/core/font/shx/Shx.constants.d.ts +20 -0
  107. package/dist/types/core/font/shx/ShxParser.d.ts +18 -0
  108. package/dist/types/core/font/shx/TextShape.d.ts +24 -0
  109. package/dist/types/core/font/shx/gbk/index.d.ts +4 -0
  110. package/dist/types/core/font/shx/index.d.ts +1 -0
  111. package/dist/types/core/font/shx/util/BitConverter.d.ts +18 -0
  112. package/dist/types/core/geometry-offset/Edge.d.ts +27 -0
  113. package/dist/types/core/geometry-offset/Offset.d.ts +46 -0
  114. package/dist/types/core/geometry-offset/index.d.ts +1 -0
  115. package/dist/types/core/helpers/BinaryReader.d.ts +23 -0
  116. package/dist/types/core/helpers/BoxSelectHelper.d.ts +44 -0
  117. package/dist/types/core/helpers/InstantiateHelper.d.ts +26 -0
  118. package/dist/types/core/helpers/LoadingHelper.d.ts +65 -0
  119. package/dist/types/core/helpers/MeshBvhHelper.d.ts +15 -0
  120. package/dist/types/core/helpers/MobileTouchHelperDrawable.d.ts +26 -0
  121. package/dist/types/core/helpers/OSnapHelper.d.ts +159 -0
  122. package/dist/types/core/helpers/ObjectPixelSizeHelper.d.ts +13 -0
  123. package/dist/types/core/helpers/PickMarkupHelper.d.ts +29 -0
  124. package/dist/types/core/helpers/RafHelper.d.ts +18 -0
  125. package/dist/types/core/helpers/ZoomToRectHelper.d.ts +20 -0
  126. package/dist/types/core/helpers/index.d.ts +11 -0
  127. package/dist/types/core/index.d.ts +24 -0
  128. package/dist/types/core/indexeddb/BaseTable.d.ts +36 -0
  129. package/dist/types/core/indexeddb/DxfDataTable.d.ts +22 -0
  130. package/dist/types/core/indexeddb/FontDataTable.d.ts +32 -0
  131. package/dist/types/core/indexeddb/IndexedDbManager.d.ts +49 -0
  132. package/dist/types/core/indexeddb/index.d.ts +4 -0
  133. package/dist/types/core/input-manager/InputManager.d.ts +147 -0
  134. package/dist/types/core/input-manager/index.d.ts +1 -0
  135. package/dist/types/core/interactions/Interaction.d.ts +10 -0
  136. package/dist/types/core/interactions/Viewer2dInteraction.d.ts +17 -0
  137. package/dist/types/core/interactions/Viewer3dInteraction.d.ts +26 -0
  138. package/dist/types/core/interactions/index.d.ts +1 -0
  139. package/dist/types/core/materials/BimTilesHighlightMaterial.d.ts +21 -0
  140. package/dist/types/core/materials/BimTilesMaterial.d.ts +26 -0
  141. package/dist/types/core/materials/BimTilesPickMaterial.d.ts +9 -0
  142. package/dist/types/core/materials/BimTilesTransparentMaterial.d.ts +20 -0
  143. package/dist/types/core/materials/StandardMaterialEx.d.ts +16 -0
  144. package/dist/types/core/materials/constants.d.ts +0 -0
  145. package/dist/types/core/materials/index.d.ts +5 -0
  146. package/dist/types/core/model/Constants.d.ts +58 -0
  147. package/dist/types/core/model/Model.d.ts +18 -0
  148. package/dist/types/core/model/Model2d.d.ts +142 -0
  149. package/dist/types/core/model/Model3d.d.ts +137 -0
  150. package/dist/types/core/model/bimtiles/BatchedMeshesParser.d.ts +26 -0
  151. package/dist/types/core/model/bimtiles/BimTilesConfigParser.d.ts +43 -0
  152. package/dist/types/core/model/bimtiles/BimTilesData.d.ts +280 -0
  153. package/dist/types/core/model/bimtiles/BimTilesMaterialManager.d.ts +139 -0
  154. package/dist/types/core/model/bimtiles/BimTilesModel.d.ts +67 -0
  155. package/dist/types/core/model/bimtiles/BimTilesPropertyParser.d.ts +42 -0
  156. package/dist/types/core/model/bimtiles/BimTilesRenderer.d.ts +49 -0
  157. package/dist/types/core/model/bimtiles/InstancedMeshesParser.d.ts +37 -0
  158. package/dist/types/core/model/bimtiles/TileParser.d.ts +11 -0
  159. package/dist/types/core/model/bimtiles/Utils.d.ts +29 -0
  160. package/dist/types/core/model/index.d.ts +6 -0
  161. package/dist/types/core/patches/Constants.d.ts +6 -0
  162. package/dist/types/core/patches/Line.d.ts +2 -0
  163. package/dist/types/core/patches/Mesh.d.ts +2 -0
  164. package/dist/types/core/patches/Points.d.ts +2 -0
  165. package/dist/types/core/patches/index.d.ts +4 -0
  166. package/dist/types/core/patches/shaders/ShaderChunk.d.ts +2 -0
  167. package/dist/types/core/patches/shaders/shaderChunk/common_ex.glsl.d.ts +2 -0
  168. package/dist/types/core/patches/shaders/shaderChunk/id_pars_vertex.glsl.d.ts +2 -0
  169. package/dist/types/core/patches/shaders/shaderChunk/id_vertex.glsl.d.ts +2 -0
  170. package/dist/types/core/patches/shaders/shaderChunk/outine_bc_vertex.glsl.d.ts +2 -0
  171. package/dist/types/core/patches/shaders/shaderChunk/outline_bc_fragment.glsl.d.ts +2 -0
  172. package/dist/types/core/patches/shaders/shaderChunk/outline_bc_pars_fragment.glsl.d.ts +2 -0
  173. package/dist/types/core/patches/shaders/shaderChunk/outline_bc_pars_vertex.glsl.d.ts +2 -0
  174. package/dist/types/core/patches/shaders/shaderChunk/state_fragment.glsl.d.ts +2 -0
  175. package/dist/types/core/patches/shaders/shaderChunk/state_highlight_fragment.glsl.d.ts +2 -0
  176. package/dist/types/core/patches/shaders/shaderChunk/state_pars_fragment.glsl.d.ts +2 -0
  177. package/dist/types/core/patches/shaders/shaderChunk/state_transparent_fragment.glsl.d.ts +2 -0
  178. package/dist/types/core/patches/shaders/shaderLib/pick_ex.glsl.d.ts +2 -0
  179. package/dist/types/core/patches/shaders/shaderLib/standard_ex.glsl.d.ts +2 -0
  180. package/dist/types/core/pick/PickManager.d.ts +52 -0
  181. package/dist/types/core/pick/index.d.ts +1 -0
  182. package/dist/types/core/scene/SceneManager.d.ts +48 -0
  183. package/dist/types/core/scene/index.d.ts +1 -0
  184. package/dist/types/core/shp-js/BitView.d.ts +12 -0
  185. package/dist/types/core/shp-js/SHPLoader.d.ts +12 -0
  186. package/dist/types/core/shp-js/Shp.d.ts +10 -0
  187. package/dist/types/core/shp-js/ShpThree.d.ts +23 -0
  188. package/dist/types/core/shp-js/index.d.ts +4 -0
  189. package/dist/types/core/text-texture/TextTexture.d.ts +45 -0
  190. package/dist/types/core/text-texture/index.d.ts +1 -0
  191. package/dist/types/core/undo/Command.d.ts +6 -0
  192. package/dist/types/core/undo/UndoManager.d.ts +24 -0
  193. package/dist/types/core/undo/index.d.ts +2 -0
  194. package/dist/types/core/utils/CSS2DObjectUtils.d.ts +14 -0
  195. package/dist/types/core/utils/CancelablePromise.d.ts +6 -0
  196. package/dist/types/core/utils/ColorUtils.d.ts +25 -0
  197. package/dist/types/core/utils/CommonUtils.d.ts +141 -0
  198. package/dist/types/core/utils/CoordinateUtils.d.ts +81 -0
  199. package/dist/types/core/utils/DecimalPrecisionUtils.d.ts +10 -0
  200. package/dist/types/core/utils/DeviceUtils.d.ts +15 -0
  201. package/dist/types/core/utils/EdgeUtils.d.ts +14 -0
  202. package/dist/types/core/utils/Event.d.ts +33 -0
  203. package/dist/types/core/utils/ExportUtils.d.ts +61 -0
  204. package/dist/types/core/utils/FpsUtils.d.ts +13 -0
  205. package/dist/types/core/utils/GeometryUtils.d.ts +78 -0
  206. package/dist/types/core/utils/LodashUtils.d.ts +208 -0
  207. package/dist/types/core/utils/LogUtils.d.ts +29 -0
  208. package/dist/types/core/utils/MaterialUtils.d.ts +40 -0
  209. package/dist/types/core/utils/MathUtils.d.ts +41 -0
  210. package/dist/types/core/utils/MergeUtils.d.ts +126 -0
  211. package/dist/types/core/utils/ObjectUtils.d.ts +216 -0
  212. package/dist/types/core/utils/PolygonUtils.d.ts +9 -0
  213. package/dist/types/core/utils/SVGObjectUtils.d.ts +22 -0
  214. package/dist/types/core/utils/SceneUtils.d.ts +26 -0
  215. package/dist/types/core/utils/SectionUtils.d.ts +11 -0
  216. package/dist/types/core/utils/SimplifyUtils.d.ts +15 -0
  217. package/dist/types/core/utils/TextureUtils.d.ts +16 -0
  218. package/dist/types/core/utils/UVUtils.d.ts +21 -0
  219. package/dist/types/core/utils/UnitConversionUtils.d.ts +31 -0
  220. package/dist/types/core/utils/index.d.ts +26 -0
  221. package/dist/types/core/viewers/BaseViewer.d.ts +253 -0
  222. package/dist/types/core/viewers/BimTilesViewer.d.ts +130 -0
  223. package/dist/types/core/viewers/Constants.d.ts +9 -0
  224. package/dist/types/core/viewers/Plugin.d.ts +30 -0
  225. package/dist/types/core/viewers/Viewer2d.d.ts +413 -0
  226. package/dist/types/core/viewers/Viewer3d.d.ts +136 -0
  227. package/dist/types/core/viewers/Viewer3dLite.d.ts +144 -0
  228. package/dist/types/core/viewers/ViewerEvent.d.ts +108 -0
  229. package/dist/types/core/viewers/index.d.ts +8 -0
  230. package/dist/types/core/webcam/WebCam.d.ts +28 -0
  231. package/dist/types/core/webcam/index.d.ts +1 -0
  232. package/dist/types/core/workers/CreateMeshBvh.worker.d.ts +1 -0
  233. package/dist/types/core/workers/GenerateMeshBvhWorker.d.ts +17 -0
  234. package/dist/types/core/workers/index.d.ts +1 -0
  235. package/dist/types/export.doc.d.ts +9 -0
  236. package/dist/types/index.d.ts +23 -0
  237. package/dist/types/version.d.ts +2 -0
  238. package/package.json +88 -0
@@ -0,0 +1,56 @@
1
+ import { DwgViewportEntity } from "@mlightcad/libredwg-web";
2
+ import IGeometry, { IEntity, IPoint } from "./geomtry";
3
+ import { DxfBaseReader, IGroup } from "../DxfBaseReader";
4
+ /**
5
+ * Viewport is usually used in paper space.
6
+ */
7
+ export interface IViewportEntity extends IEntity {
8
+ centerPoint: IPoint;
9
+ width_paperSpace: number;
10
+ height_paperSpace: number;
11
+ viewportStatus: number;
12
+ /**
13
+ * Not a handle hex string, but a int value? Usually is "1", "2", "3", etc.
14
+ * viewportId "1" means the Model space viewport.
15
+ * "2", "3", ... are paper space viewports.
16
+ */
17
+ viewportId: number;
18
+ centerPoint_dcs: IPoint;
19
+ snapBasePoint_dcs: IPoint;
20
+ snapSpacing_dcs: IPoint;
21
+ gridSpacing_dcs: IPoint;
22
+ viewDirection: IPoint;
23
+ viewTarget: IPoint;
24
+ perspectiveLens: number;
25
+ frontClippingPlaneZ: number;
26
+ backClippingPlaneZ: number;
27
+ viewHeight: number;
28
+ snapAngle: number;
29
+ viewTwistAngle: number;
30
+ circleZoomPercent: number;
31
+ frozenLayerHandles: string[];
32
+ viewportStatusFlags: number;
33
+ viewportClippingBoundaryhandleId: string;
34
+ plotStyleSheetName: string;
35
+ renderMode: number;
36
+ viewportFlag_ucs: number;
37
+ ucsIcon: string;
38
+ ucsOrigin: IPoint;
39
+ ucsXAxis: IPoint;
40
+ ucsYAxis: IPoint;
41
+ ucsTableRecordHandle: string;
42
+ baseUcsTableRecordHandle: string;
43
+ orthographicType: number;
44
+ elevation: number;
45
+ shadePlotMode: number;
46
+ frequency: number;
47
+ lightingFlag: number;
48
+ lightingType: number;
49
+ viewBrightness: number;
50
+ viewContrast: number;
51
+ }
52
+ export default class Viewport implements IGeometry {
53
+ ForEntityName: "VIEWPORT";
54
+ parseEntity(scanner: DxfBaseReader, curr: IGroup): IViewportEntity;
55
+ parseDwgEntity(entity: DwgViewportEntity): IEntity;
56
+ }
@@ -0,0 +1,12 @@
1
+ import { DwgXlineEntity } from "@mlightcad/libredwg-web";
2
+ import { DxfBaseReader, IGroup } from "../DxfBaseReader";
3
+ import IGeometry, { IEntity, IPoint } from './geomtry';
4
+ export interface IXLineEntity extends IEntity {
5
+ vertices: IPoint[];
6
+ directionVector: IPoint;
7
+ }
8
+ export default class XLine implements IGeometry {
9
+ ForEntityName: "XLINE";
10
+ parseEntity(scanner: DxfBaseReader, curr: IGroup): IXLineEntity;
11
+ parseDwgEntity(entity: DwgXlineEntity): IEntity;
12
+ }
@@ -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,26 @@
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 interface IClass {
12
+ applicationName: string;
13
+ className: string;
14
+ cpp_class_name: string;
15
+ dxfName: string;
16
+ capabilitiesFlag: number;
17
+ proxyPackage?: string;
18
+ instanceCount?: number;
19
+ isAnEntityFlag?: boolean;
20
+ isProxy?: boolean;
21
+ }
22
+ export 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";
23
+ export interface IObjectParser {
24
+ ForObjectName: ObjectName;
25
+ parseObject(scanner: DxfBaseReader, curr: IGroup): IObject;
26
+ }
@@ -0,0 +1,23 @@
1
+ import { IObject, IObjectParser } from "./common";
2
+ import { DxfBaseReader, IGroup } from "../DxfBaseReader";
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
+ /**
13
+ * Key is handle hex string.
14
+ * Value is a string representing the name of the entry.
15
+ */
16
+ entries: Record<string, string>;
17
+ isHardOwner: boolean;
18
+ cloningFlag: DictionaryCloningFlags;
19
+ }
20
+ export declare class Dictionary implements IObjectParser {
21
+ ForObjectName: "DICTIONARY";
22
+ parseObject(scanner: DxfBaseReader, curr: IGroup): IDictionaryObject;
23
+ }
@@ -0,0 +1,24 @@
1
+ import { IObject, IObjectParser } from "./common";
2
+ import { DxfBaseReader, IGroup } from "../DxfBaseReader";
3
+ import { IPoint } from "../entities/geomtry";
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 { IObject, IObjectParser } from "./common";
2
+ import { DxfBaseReader, IGroup } from "../DxfBaseReader";
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 { IObject, IObjectParser } from "./common";
2
+ import { DxfBaseReader, IGroup } from "../DxfBaseReader";
3
+ import { IPoint } from "../entities/geomtry";
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 { IObject, IObjectParser } from "./common";
2
+ import { DictionaryCloningFlags } from "./dictionary";
3
+ import { DxfBaseReader, IGroup } from "../DxfBaseReader";
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,43 @@
1
+ import * as THREE from "three";
2
+ import { type BaseViewer } from "../viewers";
3
+ /**
4
+ * Visual effect manager for viewers.
5
+ */
6
+ export declare class EffectManager {
7
+ private viewer;
8
+ private composerEnabled;
9
+ private composer?;
10
+ private renderPass?;
11
+ private effectFxaaPass?;
12
+ private saoPass?;
13
+ private ssaoPass?;
14
+ private outlinePass?;
15
+ private ssaaRenderPass?;
16
+ private bloomPass?;
17
+ private unrealBloomPass?;
18
+ private vertexNormalsHelpers?;
19
+ constructor(viewer: BaseViewer);
20
+ get enabled(): boolean;
21
+ set enabled(enable: boolean);
22
+ get renderPassEnabled(): boolean;
23
+ set renderPassEnabled(enable: boolean);
24
+ get fxaaPassEnabled(): boolean;
25
+ set fxaaPassEnabled(enable: boolean);
26
+ get saoPassEnabled(): boolean;
27
+ set saoPassEnabled(enable: boolean);
28
+ get ssaoPassEnabled(): boolean;
29
+ set ssaoPassEnabled(enable: boolean);
30
+ get outlinePassEnabled(): boolean;
31
+ set outlinePassEnabled(enable: boolean);
32
+ get ssaaPassEnabled(): boolean;
33
+ set ssaaPassEnabled(enable: boolean);
34
+ get bloomPassEnabled(): boolean;
35
+ set bloomPassEnabled(enable: boolean);
36
+ get unrealBloomPassEnabled(): boolean;
37
+ set unrealBloomPassEnabled(enable: boolean);
38
+ setOutlinePassSelectObjects(objects: THREE.Object3D[]): void;
39
+ enableModelEdges(enable: boolean): void;
40
+ showVertexNormals(show: boolean, size?: number): void;
41
+ render(): void;
42
+ destroy(): void;
43
+ }
@@ -0,0 +1 @@
1
+ export * from "./EffectManager";
@@ -0,0 +1,41 @@
1
+ import * as THREE from "three";
2
+ import { Font } from "three/examples/jsm/loaders/FontLoader.js";
3
+ import { Orientation } from "./shx";
4
+ import { FontDataTableRecord } from "../indexeddb";
5
+ export declare abstract class BaseFont extends Font {
6
+ info: string;
7
+ orientation: Orientation;
8
+ baseUp: number;
9
+ baseDown: number;
10
+ fileHeader: string;
11
+ fileVersion: string;
12
+ fileName: string;
13
+ data: any;
14
+ order: number;
15
+ unsupportedChars: Record<string, number>;
16
+ constructor(fileName: string, fileData: any);
17
+ abstract getCharShape(char: string, size: number): THREE.Shape | undefined;
18
+ abstract getNotFoundTextShape(size: number): THREE.Shape | undefined;
19
+ /**
20
+ * Just for log usage
21
+ */
22
+ protected addUnsupportedChar(char: string): void;
23
+ protected getFontFile(): {
24
+ order: number;
25
+ data: any;
26
+ info: string;
27
+ orientation: Orientation;
28
+ baseUp: number;
29
+ baseDown: number;
30
+ fileName: string;
31
+ fileHeader: string;
32
+ fileVersion: string;
33
+ };
34
+ setFontFile(data: FontDataTableRecord): void;
35
+ /**
36
+ * Catches dxf data into indexedDb
37
+ */
38
+ setFontDataToIndexedDb(): Promise<void>;
39
+ getFontDataByIndexedDb(): Promise<FontDataTableRecord>;
40
+ releaseFontData(): void;
41
+ }
@@ -0,0 +1,52 @@
1
+ import * as THREE from "three";
2
+ import { BaseFont } from "./BaseFont";
3
+ export declare class FontManager {
4
+ private loader;
5
+ protected fontMap: Map<string, BaseFont>;
6
+ protected fileNames?: string[];
7
+ unsupportedChars: Record<string, number>;
8
+ missingFonts: Record<string, number>;
9
+ enableFontCache: boolean;
10
+ constructor();
11
+ /**
12
+ *
13
+ * @param urls The order represents the priority
14
+ * @returns
15
+ * @description The best fonts order is: Load linear fonts first followed by ttf fonts, font types load Western fonts first in loaded chinese fonts.
16
+ * @description Microsoft Yahei is the most worthy choice of Chinese font on the Win platform, but it is not the default viewer and needs to be set; Sans-serif fonts such as Arial and Tahoma are the main fonts for Western fonts.
17
+ * @description At present, the latest font launched by Apple and San Francisco for Apple, the display effect is also the most elegant, but only the latest system can support, while blackface - Jane and Helvetica can get more system version support, the display effect is also similar, can be accepted.
18
+ * @example font-family: Helvetica, Tahoma, Arial, "PingFang SC", "Hiragino Sans GB", "Heiti SC", "Microsoft YaHei", "WenQuanYi Micro Hei", sans-serif;
19
+ */
20
+ loadFonts(urls: string[]): Promise<void>;
21
+ /**
22
+ *
23
+ * @param text
24
+ * @param fontName
25
+ * @param size
26
+ * @returns
27
+ * @description Gets text shape by fontName and size.
28
+ */
29
+ getTextShape(text: string, fontName: string, size: number): THREE.Shape[] | undefined;
30
+ /**
31
+ *
32
+ * @param fontName
33
+ * @param char
34
+ * @param size
35
+ * @returns
36
+ */
37
+ getCharShape(char: string, fontName: string, size: number): THREE.BufferGeometry<THREE.NormalBufferAttributes, THREE.BufferGeometryEventMap> | undefined;
38
+ getNotFoundTextShape(size: number): THREE.BufferGeometry<THREE.NormalBufferAttributes, THREE.BufferGeometryEventMap> | undefined;
39
+ private checkAllFontsLoaded;
40
+ getFontFromIndexeddb(): Promise<void>;
41
+ isShxFont(fontName: string): boolean | undefined;
42
+ /**
43
+ * Just for log usage
44
+ */
45
+ getUnsupportedChar(): Record<string, number>;
46
+ releaseFontData(): void;
47
+ destroy(): void;
48
+ static isShxFile(url: string): boolean;
49
+ static isTtfFile(url: string): boolean;
50
+ static isJsonFile(url: string): boolean;
51
+ static getFileName(url: string): string;
52
+ }
@@ -0,0 +1,14 @@
1
+ import * as THREE from "three";
2
+ import { BaseFont } from "./BaseFont";
3
+ import { FontDataTableRecord } from "../indexeddb";
4
+ export declare class MeshFont extends BaseFont {
5
+ reversed: boolean;
6
+ constructor(fileName: string, fileData: object | FontDataTableRecord | ArrayBuffer);
7
+ generateShapes(text: string, size: number): THREE.Shape[];
8
+ getCharShape(char: string, size: number): THREE.Shape | undefined;
9
+ /**
10
+ * For an unsupported char, use "?" as a replacement.
11
+ */
12
+ getNotFoundTextShape(size: number): THREE.Shape | undefined;
13
+ private parseTTF;
14
+ }
@@ -0,0 +1,49 @@
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
+ export declare class ShxFont extends BaseFont {
7
+ static readonly DEFAULT_SIZE = 12;
8
+ isExtend: boolean;
9
+ isUniCode: boolean;
10
+ isEmbedded: boolean;
11
+ fontType: ShxFontType;
12
+ private textShapesCache;
13
+ private graphicData;
14
+ constructor(fileName: string, fileData: ArrayBuffer | FontDataTableRecord);
15
+ generateShapes(text: string, size: number): TextShape[];
16
+ /**
17
+ * Gets TextShape by a char
18
+ */
19
+ getCharShape(char: string, size: number): TextShape | undefined;
20
+ /**
21
+ * Gets TextShape by a char code
22
+ */
23
+ getGraphicDataByCode(code: number, size: number): TextShape | undefined;
24
+ /**
25
+ * Gets TextShape by char's code, font size and offset
26
+ */
27
+ getGraphicDataByCodeWithOffset(code: number, size: number, translate: THREE.Vector2): TextShape | undefined;
28
+ private parseBigFont;
29
+ private parseUniFont;
30
+ private parseShapeFont;
31
+ /**
32
+ * For an unsupported char, use "?" as a replacement.
33
+ */
34
+ getNotFoundTextShape(size: number): TextShape | undefined;
35
+ protected getFontFile(): {
36
+ fontType: ShxFontType;
37
+ order: number;
38
+ data: any;
39
+ info: string;
40
+ orientation: import("./shx/Shx.constants").Orientation;
41
+ baseUp: number;
42
+ baseDown: number;
43
+ fileName: string;
44
+ fileHeader: string;
45
+ fileVersion: string;
46
+ };
47
+ setFontFile(data: FontDataTableRecord): void;
48
+ releaseFontData(): void;
49
+ }
@@ -0,0 +1 @@
1
+ export * from "./FontManager";
@@ -0,0 +1,4 @@
1
+ /**
2
+ * Extra letters/chars that don't exist in any font file can be defined here.
3
+ */
4
+ export declare const ExtraLetters: Record<string, Array<Array<Array<number>>>>;
@@ -0,0 +1,20 @@
1
+ /**
2
+ * Text orientation.
3
+ */
4
+ export declare enum Orientation {
5
+ Horizontal = 0,
6
+ Vertical = 1,
7
+ All = 2
8
+ }
9
+ /**
10
+ * Shx font type.
11
+ */
12
+ export declare enum ShxFontType {
13
+ Shapes = 0,
14
+ Bigfont = 1,
15
+ Unifont = 2
16
+ }
17
+ /**
18
+ * Default font size.
19
+ */
20
+ export declare const DefaultFontSize = 12;
@@ -0,0 +1,18 @@
1
+ import { TextShape } from "./TextShape";
2
+ import type { ShxFont } from "../ShxFont";
3
+ import { BinaryReader } from "../../../core/helpers/BinaryReader";
4
+ export declare class ShxParser {
5
+ static readonly FILE_STOP_FLAG: string[];
6
+ static readonly 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
+ }
@@ -0,0 +1,24 @@
1
+ import * as THREE from "three";
2
+ /**
3
+ * Text shape, to describe a specific character.
4
+ */
5
+ export declare class TextShape extends THREE.Shape {
6
+ width: number;
7
+ lastPoint: THREE.Vector2;
8
+ polylines: Array<Array<THREE.Vector2>>;
9
+ private bounds;
10
+ constructor(lastPoint: THREE.Vector2, polylines: Array<Array<THREE.Vector2>>);
11
+ /**
12
+ * Gets an offsetted new TextShape
13
+ */
14
+ offset(vector: THREE.Vector2): TextShape;
15
+ /**
16
+ * Gets an transformed new TextShape
17
+ */
18
+ transform(matrix: THREE.Matrix3): TextShape;
19
+ protected calcWidth(polylines: THREE.Vector2[][]): number;
20
+ /**
21
+ * Converts a TextShape to THREE.BufferGeometry
22
+ */
23
+ toThreeGeometry(): THREE.BufferGeometry<THREE.NormalBufferAttributes, THREE.BufferGeometryEventMap>;
24
+ }
@@ -0,0 +1,4 @@
1
+ export declare function encode(str: string): Uint8Array;
2
+ export declare function traditionalChineseToSimpliled(text: string): string;
3
+ export declare function isChinese(text: string): boolean;
4
+ export declare function isTraditionalChinese(text: string): boolean;
@@ -0,0 +1 @@
1
+ export * from "./Shx.constants";
@@ -0,0 +1,18 @@
1
+ export declare class BitConverter {
2
+ static GetBytes(value: string | number | boolean | []): Uint8Array;
3
+ static Get1Bytes(value: number | boolean | []): Uint8Array;
4
+ static byteTosbyte(byte: number): number;
5
+ static ToBoolean(value: Uint8Array, startIndex: number): boolean;
6
+ static ToInt8(value: Uint8Array, startIndex: number): number;
7
+ static ToUInt8(value: Uint8Array, startIndex: number): number;
8
+ static ToInt16(value: Uint8Array, startIndex: number): number;
9
+ static ToInt32(value: Uint8Array, startIndex: number): number;
10
+ static ToUInt16(value: Uint8Array, startIndex: number): number;
11
+ static ToUInt32(value: Uint8Array, startIndex: number): number;
12
+ static ToChar(value: Uint8Array, startIndex: number): string;
13
+ static ToAscii(value: Uint8Array, startIndex: number): string;
14
+ static ToAsciiString(value: Uint8Array, startIndex: number, length: number): string;
15
+ static ToUTF16String(value: Uint8Array, startIndex: number, length: number): string;
16
+ static ToFloat32(value: Uint8Array, startIndex: number): number;
17
+ static ToFloat64(value: Uint8Array, startIndex: number): number;
18
+ }
@@ -0,0 +1,27 @@
1
+ import type { Pair } from "polygon-clipping";
2
+ /**
3
+ * Offset edge
4
+ * @internal
5
+ */
6
+ export declare class Edge {
7
+ current: Pair;
8
+ next: Pair;
9
+ inNormal: Pair;
10
+ outNormal: Pair;
11
+ constructor(current: Pair, next: Pair);
12
+ /**
13
+ * Creates outwards normal
14
+ */
15
+ private outwardsNormal;
16
+ /**
17
+ * Creates inwards normal
18
+ */
19
+ private inwardsNormal;
20
+ /**
21
+ * Offsets the edge by dx, dy
22
+ */
23
+ offset(dx: number, dy: number): Edge;
24
+ inverseOffset(dx: number, dy: number): Edge;
25
+ inverse(): Edge;
26
+ static offsetEdge(current: Pair, next: Pair, dx: number, dy: number): Edge;
27
+ }
@@ -0,0 +1,46 @@
1
+ import type { MultiPolygon, Pair, Polygon, Ring } from "polygon-clipping";
2
+ import { Edge } from "./Edge";
3
+ /**
4
+ * Offset builder
5
+ * @internal
6
+ */
7
+ export declare class Offset {
8
+ vertices: Pair | Ring | Polygon;
9
+ edges: Edge[] | Edge[][];
10
+ private arcSegments;
11
+ private distance;
12
+ constructor(vertices: Pair | Ring | Polygon, arcSegments?: number);
13
+ /**
14
+ * Recursively process contour to create normals
15
+ */
16
+ private processContour;
17
+ setArcSegments(arcSegments: number): this;
18
+ /**
19
+ * Creates arch between two edges
20
+ *
21
+ * @param {Array.<Object>} vertices
22
+ * @param {Object} center
23
+ * @param {Number} radius
24
+ * @param {Object} startVertex
25
+ * @param {Object} endVertex
26
+ * @param {Number} segments
27
+ * @param {Boolean} bOutwards
28
+ */
29
+ private createArc;
30
+ setDistance(dist: number): this;
31
+ private ensureLastPoint;
32
+ /**
33
+ * Decides by the sign if it's a padding or a margin
34
+ */
35
+ offset(dist: number): Pair | Ring | Polygon | MultiPolygon;
36
+ private offsetSegment;
37
+ private margin;
38
+ private padding;
39
+ offsetLine(dist: number): Pair | Ring | Polygon | MultiPolygon;
40
+ /**
41
+ * Just offsets lines, no fill
42
+ */
43
+ private offsetLines;
44
+ private offsetContour;
45
+ offsetPoint(distance: number): MultiPolygon;
46
+ }
@@ -0,0 +1 @@
1
+ export * from "./Offset";