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.
Files changed (258) hide show
  1. package/README.md +1 -0
  2. package/dist/dxfview.esm.min.js +7 -0
  3. package/dist/types/components/dxf-layout-bar/DxfLayoutBar.d.ts +26 -0
  4. package/dist/types/components/dxf-layout-bar/index.d.ts +1 -0
  5. package/dist/types/components/pop-panel/PopPanel.d.ts +14 -0
  6. package/dist/types/components/pop-panel/index.d.ts +1 -0
  7. package/dist/types/components/progress-bar/ProgressBar.d.ts +34 -0
  8. package/dist/types/components/progress-bar/index.d.ts +1 -0
  9. package/dist/types/components/settings/ProjectSettingsDef.d.ts +44 -0
  10. package/dist/types/components/settings/index.d.ts +1 -0
  11. package/dist/types/components/tool-tip/Tooltip.d.ts +20 -0
  12. package/dist/types/components/tool-tip/index.d.ts +1 -0
  13. package/dist/types/core/Configs.d.ts +238 -0
  14. package/dist/types/core/Constants.d.ts +164 -0
  15. package/dist/types/core/Units.d.ts +16 -0
  16. package/dist/types/core/VersionManager.d.ts +3 -0
  17. package/dist/types/core/camera-controls/CameraControls.d.ts +773 -0
  18. package/dist/types/core/camera-controls/Constants.d.ts +2 -0
  19. package/dist/types/core/camera-controls/EventDispatcher.d.ts +41 -0
  20. package/dist/types/core/camera-controls/index.d.ts +2 -0
  21. package/dist/types/core/camera-controls/types.d.ts +112 -0
  22. package/dist/types/core/camera-controls/utils/extractClientCoordFromEvent.d.ts +3 -0
  23. package/dist/types/core/camera-controls/utils/math-utils.d.ts +11 -0
  24. package/dist/types/core/camera-controls/utils/notSupportedInOrthographicCamera.d.ts +2 -0
  25. package/dist/types/core/canvas/CanvasRender.d.ts +52 -0
  26. package/dist/types/core/canvas/Constants.d.ts +28 -0
  27. package/dist/types/core/canvas/Drawable.d.ts +87 -0
  28. package/dist/types/core/canvas/DrawableList.d.ts +29 -0
  29. package/dist/types/core/canvas/index.d.ts +4 -0
  30. package/dist/types/core/compare/BaseDxfCompareHelper.d.ts +104 -0
  31. package/dist/types/core/compare/CompareDrawable.d.ts +17 -0
  32. package/dist/types/core/compare/DxfCompareHelper.d.ts +69 -0
  33. package/dist/types/core/compare/DxfCompareMarkupManager.d.ts +11 -0
  34. package/dist/types/core/compare/index.d.ts +4 -0
  35. package/dist/types/core/controls/CameraControlsEx.d.ts +34 -0
  36. package/dist/types/core/controls/index.d.ts +1 -0
  37. package/dist/types/core/dxf/DxfCompare.d.ts +151 -0
  38. package/dist/types/core/dxf/DxfConstants.d.ts +15 -0
  39. package/dist/types/core/dxf/DxfLoader.d.ts +526 -0
  40. package/dist/types/core/dxf/DxfObject.d.ts +32 -0
  41. package/dist/types/core/dxf/DxfUtils.d.ts +79 -0
  42. package/dist/types/core/dxf/HatchPatternShaders.d.ts +12 -0
  43. package/dist/types/core/dxf/LinePatternShaders.d.ts +12 -0
  44. package/dist/types/core/dxf/bspline.d.ts +8 -0
  45. package/dist/types/core/dxf/dxfom-mtext.d.ts +46 -0
  46. package/dist/types/core/dxf/dxfom-text.d.ts +16 -0
  47. package/dist/types/core/dxf/index.d.ts +10 -0
  48. package/dist/types/core/dxf/round10.d.ts +2 -0
  49. package/dist/types/core/dxf-parser/AutoCadColorIndex.d.ts +8 -0
  50. package/dist/types/core/dxf-parser/DxfBaseReader.d.ts +12 -0
  51. package/dist/types/core/dxf-parser/DxfBinaryReader.d.ts +14 -0
  52. package/dist/types/core/dxf-parser/DxfParser.d.ts +327 -0
  53. package/dist/types/core/dxf-parser/DxfTextReader.d.ts +31 -0
  54. package/dist/types/core/dxf-parser/ParseHelpers.d.ts +36 -0
  55. package/dist/types/core/dxf-parser/entities/3dface.d.ts +11 -0
  56. package/dist/types/core/dxf-parser/entities/arc.d.ts +16 -0
  57. package/dist/types/core/dxf-parser/entities/attdef.d.ts +31 -0
  58. package/dist/types/core/dxf-parser/entities/attrib.d.ts +31 -0
  59. package/dist/types/core/dxf-parser/entities/circle.d.ts +13 -0
  60. package/dist/types/core/dxf-parser/entities/dimension.d.ts +22 -0
  61. package/dist/types/core/dxf-parser/entities/ellipse.d.ts +15 -0
  62. package/dist/types/core/dxf-parser/entities/geomtry.d.ts +40 -0
  63. package/dist/types/core/dxf-parser/entities/hatch.d.ts +108 -0
  64. package/dist/types/core/dxf-parser/entities/image.d.ts +37 -0
  65. package/dist/types/core/dxf-parser/entities/insert.d.ts +20 -0
  66. package/dist/types/core/dxf-parser/entities/leader.d.ts +23 -0
  67. package/dist/types/core/dxf-parser/entities/line.d.ts +10 -0
  68. package/dist/types/core/dxf-parser/entities/lwpolyline.d.ts +21 -0
  69. package/dist/types/core/dxf-parser/entities/mleader.d.ts +101 -0
  70. package/dist/types/core/dxf-parser/entities/mtext.d.ts +18 -0
  71. package/dist/types/core/dxf-parser/entities/ole2frame.d.ts +20 -0
  72. package/dist/types/core/dxf-parser/entities/point.d.ts +11 -0
  73. package/dist/types/core/dxf-parser/entities/polyline.d.ts +20 -0
  74. package/dist/types/core/dxf-parser/entities/ray.d.ts +10 -0
  75. package/dist/types/core/dxf-parser/entities/region.d.ts +10 -0
  76. package/dist/types/core/dxf-parser/entities/seqend.d.ts +8 -0
  77. package/dist/types/core/dxf-parser/entities/solid.d.ts +10 -0
  78. package/dist/types/core/dxf-parser/entities/spline.d.ts +23 -0
  79. package/dist/types/core/dxf-parser/entities/table.d.ts +42 -0
  80. package/dist/types/core/dxf-parser/entities/text.d.ts +18 -0
  81. package/dist/types/core/dxf-parser/entities/vertex.d.ts +20 -0
  82. package/dist/types/core/dxf-parser/entities/viewport.d.ts +46 -0
  83. package/dist/types/core/dxf-parser/entities/xline.d.ts +10 -0
  84. package/dist/types/core/dxf-parser/index.d.ts +27 -0
  85. package/dist/types/core/dxf-parser/objects/common.d.ts +15 -0
  86. package/dist/types/core/dxf-parser/objects/dictionary.d.ts +19 -0
  87. package/dist/types/core/dxf-parser/objects/imagedef.d.ts +24 -0
  88. package/dist/types/core/dxf-parser/objects/layout.d.ts +29 -0
  89. package/dist/types/core/dxf-parser/objects/sortentstable.d.ts +12 -0
  90. package/dist/types/core/dxf-parser/objects/spatialfilter.d.ts +22 -0
  91. package/dist/types/core/dxf-parser/objects/xrecord.d.ts +11 -0
  92. package/dist/types/core/font/BaseFont.d.ts +88 -0
  93. package/dist/types/core/font/FontManager.d.ts +107 -0
  94. package/dist/types/core/font/MeshFont.d.ts +44 -0
  95. package/dist/types/core/font/ShxFont.d.ts +108 -0
  96. package/dist/types/core/font/index.d.ts +1 -0
  97. package/dist/types/core/font/shx/ExtraLettersTemplate.d.ts +1 -0
  98. package/dist/types/core/font/shx/Shx.constants.d.ts +11 -0
  99. package/dist/types/core/font/shx/ShxParser.d.ts +18 -0
  100. package/dist/types/core/font/shx/TextShape.d.ts +24 -0
  101. package/dist/types/core/font/shx/gbk/index.d.ts +4 -0
  102. package/dist/types/core/font/shx/index.d.ts +1 -0
  103. package/dist/types/core/font/shx/util/BitConverter.d.ts +18 -0
  104. package/dist/types/core/geometry-offset/Edge.d.ts +27 -0
  105. package/dist/types/core/geometry-offset/Offset.d.ts +46 -0
  106. package/dist/types/core/geometry-offset/index.d.ts +1 -0
  107. package/dist/types/core/helpers/BinaryReader.d.ts +24 -0
  108. package/dist/types/core/helpers/BoxSelectHelper.d.ts +44 -0
  109. package/dist/types/core/helpers/LoadingHelper.d.ts +46 -0
  110. package/dist/types/core/helpers/MobileTouchHelperDrawable.d.ts +26 -0
  111. package/dist/types/core/helpers/OSnapHelper.d.ts +167 -0
  112. package/dist/types/core/helpers/ObjectPixelSizeHelper.d.ts +13 -0
  113. package/dist/types/core/helpers/PickMarkupHelper.d.ts +29 -0
  114. package/dist/types/core/helpers/RafHelper.d.ts +18 -0
  115. package/dist/types/core/helpers/ZoomToRectHelper.d.ts +17 -0
  116. package/dist/types/core/helpers/index.d.ts +9 -0
  117. package/dist/types/core/index.d.ts +18 -0
  118. package/dist/types/core/indexeddb/AnnotationTable.d.ts +14 -0
  119. package/dist/types/core/indexeddb/BaseTable.d.ts +36 -0
  120. package/dist/types/core/indexeddb/DxfDataTable.d.ts +22 -0
  121. package/dist/types/core/indexeddb/FontDataTable.d.ts +32 -0
  122. package/dist/types/core/indexeddb/IndexedDbManager.d.ts +29 -0
  123. package/dist/types/core/indexeddb/ViewpointTable.d.ts +14 -0
  124. package/dist/types/core/indexeddb/index.d.ts +6 -0
  125. package/dist/types/core/input/InputManager.d.ts +161 -0
  126. package/dist/types/core/input/index.d.ts +1 -0
  127. package/dist/types/core/license/AutoConfig.d.ts +17 -0
  128. package/dist/types/core/license/LicenseManager.d.ts +107 -0
  129. package/dist/types/core/license/PublicKey.d.ts +1 -0
  130. package/dist/types/core/license/index.d.ts +1 -0
  131. package/dist/types/core/markup/ArrowMarkup.d.ts +14 -0
  132. package/dist/types/core/markup/BaseMarkup.d.ts +28 -0
  133. package/dist/types/core/markup/CircleMarkup.d.ts +12 -0
  134. package/dist/types/core/markup/CloudLineMarkup.d.ts +10 -0
  135. package/dist/types/core/markup/CloudRectMarkup.d.ts +11 -0
  136. package/dist/types/core/markup/CloudRectWithTextMarkup.d.ts +43 -0
  137. package/dist/types/core/markup/Constants.d.ts +17 -0
  138. package/dist/types/core/markup/DotMarkup.d.ts +9 -0
  139. package/dist/types/core/markup/EllipseMarkup.d.ts +12 -0
  140. package/dist/types/core/markup/LeaderLineMarkup.d.ts +25 -0
  141. package/dist/types/core/markup/MarkupManager.d.ts +91 -0
  142. package/dist/types/core/markup/PolylineMarkup.d.ts +11 -0
  143. package/dist/types/core/markup/RectMarkup.d.ts +10 -0
  144. package/dist/types/core/markup/TextMarkup.d.ts +40 -0
  145. package/dist/types/core/markup/XMarkup.d.ts +10 -0
  146. package/dist/types/core/markup/index.d.ts +13 -0
  147. package/dist/types/core/model/Constants.d.ts +51 -0
  148. package/dist/types/core/model/Model.d.ts +18 -0
  149. package/dist/types/core/model/Model2d.d.ts +115 -0
  150. package/dist/types/core/model/index.d.ts +3 -0
  151. package/dist/types/core/patches/Constants.d.ts +4 -0
  152. package/dist/types/core/patches/Line.d.ts +2 -0
  153. package/dist/types/core/patches/Mesh.d.ts +2 -0
  154. package/dist/types/core/patches/Points.d.ts +2 -0
  155. package/dist/types/core/patches/index.d.ts +4 -0
  156. package/dist/types/core/undo-redo/AddAnnotationCommand.d.ts +11 -0
  157. package/dist/types/core/undo-redo/AddMarkupCommand.d.ts +10 -0
  158. package/dist/types/core/undo-redo/AddMeasurementCommand.d.ts +9 -0
  159. package/dist/types/core/undo-redo/Command.d.ts +6 -0
  160. package/dist/types/core/undo-redo/RemoveAnnotationCommand.d.ts +11 -0
  161. package/dist/types/core/undo-redo/RemoveMarkupCommand.d.ts +10 -0
  162. package/dist/types/core/undo-redo/RemoveMeasurementCommand.d.ts +9 -0
  163. package/dist/types/core/undo-redo/UndoRedoManager.d.ts +21 -0
  164. package/dist/types/core/undo-redo/UpdateMarkupCommand.d.ts +11 -0
  165. package/dist/types/core/undo-redo/index.d.ts +9 -0
  166. package/dist/types/core/utils/CSS2DObjectUtils.d.ts +14 -0
  167. package/dist/types/core/utils/ColorUtils.d.ts +21 -0
  168. package/dist/types/core/utils/CommonUtils.d.ts +125 -0
  169. package/dist/types/core/utils/CoordinateUtils.d.ts +81 -0
  170. package/dist/types/core/utils/DecimalPrecisionUtils.d.ts +4 -0
  171. package/dist/types/core/utils/DeviceUtils.d.ts +15 -0
  172. package/dist/types/core/utils/EdgeUtils.d.ts +14 -0
  173. package/dist/types/core/utils/Event.d.ts +33 -0
  174. package/dist/types/core/utils/FpsUtils.d.ts +13 -0
  175. package/dist/types/core/utils/GeometryUtils.d.ts +111 -0
  176. package/dist/types/core/utils/Locale.d.ts +190 -0
  177. package/dist/types/core/utils/LogUtils.d.ts +7 -0
  178. package/dist/types/core/utils/MaterialUtils.d.ts +40 -0
  179. package/dist/types/core/utils/MathUtils.d.ts +59 -0
  180. package/dist/types/core/utils/MergeUtils.d.ts +638 -0
  181. package/dist/types/core/utils/ObjectUtils.d.ts +87 -0
  182. package/dist/types/core/utils/PolygonUtils.d.ts +8 -0
  183. package/dist/types/core/utils/SVGObjectUtils.d.ts +16 -0
  184. package/dist/types/core/utils/SceneUtils.d.ts +26 -0
  185. package/dist/types/core/utils/SectionUtils.d.ts +11 -0
  186. package/dist/types/core/utils/UnitConversionUtils.d.ts +31 -0
  187. package/dist/types/core/utils/index.d.ts +21 -0
  188. package/dist/types/core/viewers/BaseViewer.d.ts +265 -0
  189. package/dist/types/core/viewers/DxfViewer.d.ts +1372 -0
  190. package/dist/types/core/viewers/Plugin.d.ts +29 -0
  191. package/dist/types/core/viewers/ViewerEvent.d.ts +178 -0
  192. package/dist/types/core/viewers/index.d.ts +4 -0
  193. package/dist/types/export.doc.d.ts +10 -0
  194. package/dist/types/fetch-polyfill.d.ts +2 -0
  195. package/dist/types/index.d.ts +8 -0
  196. package/dist/types/plugins/annotation/AnnotationPlugin.d.ts +139 -0
  197. package/dist/types/plugins/annotation/AutoDrawAnnotation.d.ts +63 -0
  198. package/dist/types/plugins/annotation/BaseAnnotation.d.ts +113 -0
  199. package/dist/types/plugins/annotation/BaseAnnotationDrawable.d.ts +139 -0
  200. package/dist/types/plugins/annotation/CopyAnnotation.d.ts +36 -0
  201. package/dist/types/plugins/annotation/CopyDrawable.d.ts +26 -0
  202. package/dist/types/plugins/annotation/FreeDrawAnnotation.d.ts +59 -0
  203. package/dist/types/plugins/annotation/RectAnnotation.d.ts +53 -0
  204. package/dist/types/plugins/annotation/RectDrawable.d.ts +42 -0
  205. package/dist/types/plugins/annotation/ShapeFinder.d.ts +51 -0
  206. package/dist/types/plugins/annotation/freeDrawDrawable.d.ts +21 -0
  207. package/dist/types/plugins/annotation/index.d.ts +8 -0
  208. package/dist/types/plugins/annotation/type.d.ts +182 -0
  209. package/dist/types/plugins/axis-gizmo/AxisGizmoPlugin.d.ts +49 -0
  210. package/dist/types/plugins/axis-gizmo/CoordinateAxes.d.ts +12 -0
  211. package/dist/types/plugins/axis-gizmo/index.d.ts +1 -0
  212. package/dist/types/plugins/bottom-bar/BottomBarPlugin.d.ts +44 -0
  213. package/dist/types/plugins/bottom-bar/index.d.ts +1 -0
  214. package/dist/types/plugins/divide/CoverLayerManager.d.ts +44 -0
  215. package/dist/types/plugins/divide/DivGeometryUtils.d.ts +66 -0
  216. package/dist/types/plugins/divide/DividePlugin.d.ts +181 -0
  217. package/dist/types/plugins/divide/FrameAnnotation.d.ts +142 -0
  218. package/dist/types/plugins/divide/FrameDrawable.d.ts +75 -0
  219. package/dist/types/plugins/divide/index.d.ts +6 -0
  220. package/dist/types/plugins/divide/types.d.ts +38 -0
  221. package/dist/types/plugins/hotpoint/HotpointPlugin.d.ts +93 -0
  222. package/dist/types/plugins/hotpoint/index.d.ts +1 -0
  223. package/dist/types/plugins/index.d.ts +12 -0
  224. package/dist/types/plugins/layer-manager/LayerManagerPlugin.d.ts +59 -0
  225. package/dist/types/plugins/layer-manager/index.d.ts +1 -0
  226. package/dist/types/plugins/local-model-uploader/IUploader.d.ts +10 -0
  227. package/dist/types/plugins/local-model-uploader/LocalDxfUploader.d.ts +19 -0
  228. package/dist/types/plugins/local-model-uploader/index.d.ts +1 -0
  229. package/dist/types/plugins/measure/AngleMeasureDrawable.d.ts +12 -0
  230. package/dist/types/plugins/measure/AngleMeasurement.d.ts +16 -0
  231. package/dist/types/plugins/measure/AreaMeasureDrawable.d.ts +14 -0
  232. package/dist/types/plugins/measure/AreaMeasurement.d.ts +31 -0
  233. package/dist/types/plugins/measure/BaseMeasureDrawable.d.ts +35 -0
  234. package/dist/types/plugins/measure/BaseMeasurement.d.ts +127 -0
  235. package/dist/types/plugins/measure/CoordinateMeasureDrawable.d.ts +10 -0
  236. package/dist/types/plugins/measure/CoordinateMeasurement.d.ts +15 -0
  237. package/dist/types/plugins/measure/DistanceMeasureDrawable.d.ts +15 -0
  238. package/dist/types/plugins/measure/DistanceMeasurement.d.ts +28 -0
  239. package/dist/types/plugins/measure/MeasurementPlugin.d.ts +131 -0
  240. package/dist/types/plugins/measure/index.d.ts +3 -0
  241. package/dist/types/plugins/overview-map/ImageDrawable.d.ts +41 -0
  242. package/dist/types/plugins/overview-map/LineDrawable.d.ts +20 -0
  243. package/dist/types/plugins/overview-map/OverviewMapDrawable.d.ts +24 -0
  244. package/dist/types/plugins/overview-map/OverviewMapPlugin.d.ts +156 -0
  245. package/dist/types/plugins/overview-map/TextDrawable.d.ts +50 -0
  246. package/dist/types/plugins/overview-map/index.d.ts +5 -0
  247. package/dist/types/plugins/screenshot/ScreenshotPlugin.d.ts +88 -0
  248. package/dist/types/plugins/screenshot/index.d.ts +1 -0
  249. package/dist/types/plugins/stats/StatsPlugin.d.ts +20 -0
  250. package/dist/types/plugins/stats/index.d.ts +1 -0
  251. package/dist/types/plugins/toolbars/DxfViewerToolbarPlugin.d.ts +67 -0
  252. package/dist/types/plugins/toolbars/MarkupToolbar.d.ts +33 -0
  253. package/dist/types/plugins/toolbars/Toolbar.config.d.ts +5 -0
  254. package/dist/types/plugins/toolbars/Toolbar.constants.d.ts +96 -0
  255. package/dist/types/plugins/toolbars/Toolbar.d.ts +102 -0
  256. package/dist/types/plugins/toolbars/index.d.ts +5 -0
  257. package/dist/types/version.d.ts +2 -0
  258. package/package.json +90 -0
@@ -0,0 +1,2 @@
1
+ export declare const PI_2: number;
2
+ export declare const PI_HALF: number;
@@ -0,0 +1,41 @@
1
+ export declare type Listener = (event?: DispatcherEvent) => void;
2
+ export interface DispatcherEvent {
3
+ type: string;
4
+ [key: string]: any;
5
+ }
6
+ export declare class EventDispatcher {
7
+ private _listeners;
8
+ /**
9
+ * Adds the specified event listener.
10
+ * @param type event name
11
+ * @param listener handler function
12
+ * @category Methods
13
+ */
14
+ addEventListener(type: string, listener: Listener): void;
15
+ /**
16
+ * Presence of the specified event listener.
17
+ * @param type event name
18
+ * @param listener handler function
19
+ * @category Methods
20
+ */
21
+ hasEventListener(type: string, listener: Listener): boolean;
22
+ /**
23
+ * Removes the specified event listener
24
+ * @param type event name
25
+ * @param listener handler function
26
+ * @category Methods
27
+ */
28
+ removeEventListener(type: string, listener: Listener): void;
29
+ /**
30
+ * Removes all event listeners
31
+ * @param type event name
32
+ * @category Methods
33
+ */
34
+ removeAllEventListeners(type?: string): void;
35
+ /**
36
+ * Fire an event type.
37
+ * @param event DispatcherEvent
38
+ * @category Methods
39
+ */
40
+ dispatchEvent(event: DispatcherEvent): void;
41
+ }
@@ -0,0 +1,2 @@
1
+ import { CameraControls } from './CameraControls';
2
+ export default CameraControls;
@@ -0,0 +1,112 @@
1
+ import type * as _THREE from 'three';
2
+ export interface THREESubset {
3
+ Vector2: typeof _THREE.Vector2;
4
+ Vector3: typeof _THREE.Vector3;
5
+ Vector4: typeof _THREE.Vector4;
6
+ Quaternion: typeof _THREE.Quaternion;
7
+ Matrix4: typeof _THREE.Matrix4;
8
+ Spherical: typeof _THREE.Spherical;
9
+ Box3: typeof _THREE.Box3;
10
+ Sphere: typeof _THREE.Sphere;
11
+ Raycaster: typeof _THREE.Raycaster;
12
+ [key: string]: any;
13
+ }
14
+ export declare type Ref = {
15
+ value: number;
16
+ };
17
+ export declare const MOUSE_BUTTON: {
18
+ readonly LEFT: 1;
19
+ readonly RIGHT: 2;
20
+ readonly MIDDLE: 4;
21
+ };
22
+ export declare type MOUSE_BUTTON = typeof MOUSE_BUTTON[keyof typeof MOUSE_BUTTON];
23
+ export declare const ACTION: Readonly<{
24
+ readonly NONE: 0;
25
+ readonly ROTATE: 1;
26
+ readonly TRUCK: 2;
27
+ readonly OFFSET: 4;
28
+ readonly DOLLY: 8;
29
+ readonly ZOOM: 16;
30
+ readonly TOUCH_ROTATE: 32;
31
+ readonly TOUCH_TRUCK: 64;
32
+ readonly TOUCH_OFFSET: 128;
33
+ readonly TOUCH_DOLLY: 256;
34
+ readonly TOUCH_ZOOM: 512;
35
+ readonly TOUCH_DOLLY_TRUCK: 1024;
36
+ readonly TOUCH_DOLLY_OFFSET: 2048;
37
+ readonly TOUCH_DOLLY_ROTATE: 4096;
38
+ readonly TOUCH_ZOOM_TRUCK: 8192;
39
+ readonly TOUCH_ZOOM_OFFSET: 16384;
40
+ readonly TOUCH_ZOOM_ROTATE: 32768;
41
+ }>;
42
+ export declare type ACTION = number;
43
+ export interface PointerInput {
44
+ pointerId: number;
45
+ clientX: number;
46
+ clientY: number;
47
+ deltaX: number;
48
+ deltaY: number;
49
+ mouseButton: MOUSE_BUTTON | null;
50
+ }
51
+ /**
52
+ * @internal
53
+ */
54
+ export declare type mouseButtonAction = typeof ACTION.ROTATE | typeof ACTION.TRUCK | typeof ACTION.OFFSET | typeof ACTION.DOLLY | typeof ACTION.ZOOM | typeof ACTION.NONE;
55
+ /**
56
+ * @internal
57
+ */
58
+ export declare type mouseWheelAction = typeof ACTION.ROTATE | typeof ACTION.TRUCK | typeof ACTION.OFFSET | typeof ACTION.DOLLY | typeof ACTION.ZOOM | typeof ACTION.NONE;
59
+ /**
60
+ * @internal
61
+ */
62
+ export declare type singleTouchAction = typeof ACTION.TOUCH_ROTATE | typeof ACTION.TOUCH_TRUCK | typeof ACTION.TOUCH_OFFSET | typeof ACTION.DOLLY | typeof ACTION.ZOOM | typeof ACTION.NONE;
63
+ /**
64
+ * @internal
65
+ */
66
+ export declare type multiTouchAction = typeof ACTION.TOUCH_DOLLY_ROTATE | typeof ACTION.TOUCH_DOLLY_TRUCK | typeof ACTION.TOUCH_DOLLY_OFFSET | typeof ACTION.TOUCH_ZOOM_ROTATE | typeof ACTION.TOUCH_ZOOM_TRUCK | typeof ACTION.TOUCH_ZOOM_OFFSET | typeof ACTION.TOUCH_DOLLY | typeof ACTION.TOUCH_ZOOM | typeof ACTION.TOUCH_ROTATE | typeof ACTION.TOUCH_TRUCK | typeof ACTION.TOUCH_OFFSET | typeof ACTION.NONE;
67
+ export interface MouseButtons {
68
+ left: mouseButtonAction;
69
+ middle: mouseButtonAction;
70
+ right: mouseButtonAction;
71
+ wheel: mouseWheelAction;
72
+ }
73
+ export interface Touches {
74
+ one: singleTouchAction;
75
+ two: multiTouchAction;
76
+ three: multiTouchAction;
77
+ }
78
+ export interface FitToOptions {
79
+ cover: boolean;
80
+ paddingLeft: number;
81
+ paddingRight: number;
82
+ paddingBottom: number;
83
+ paddingTop: number;
84
+ }
85
+ export interface CameraControlsEventMap {
86
+ update: {
87
+ type: 'update';
88
+ };
89
+ wake: {
90
+ type: 'wake';
91
+ };
92
+ rest: {
93
+ type: 'rest';
94
+ };
95
+ sleep: {
96
+ type: 'sleep';
97
+ };
98
+ transitionstart: {
99
+ type: 'transitionstart';
100
+ };
101
+ controlstart: {
102
+ type: 'controlstart';
103
+ };
104
+ control: {
105
+ type: 'control';
106
+ };
107
+ controlend: {
108
+ type: 'controlend';
109
+ };
110
+ }
111
+ export declare function isPerspectiveCamera(camera: _THREE.Camera): camera is _THREE.PerspectiveCamera;
112
+ export declare function isOrthographicCamera(camera: _THREE.Camera): camera is _THREE.OrthographicCamera;
@@ -0,0 +1,3 @@
1
+ import type * as _THREE from 'three';
2
+ import type { PointerInput } from '../types';
3
+ export declare function extractClientCoordFromEvent(pointers: PointerInput[], out: _THREE.Vector2): void;
@@ -0,0 +1,11 @@
1
+ import type * as _THREE from 'three';
2
+ import type { Ref } from '../types';
3
+ export declare const DEG2RAD: number;
4
+ export declare function clamp(value: number, min: number, max: number): number;
5
+ export declare function approxZero(number: number, error?: number): boolean;
6
+ export declare function approxEquals(a: number, b: number, error?: number): boolean;
7
+ export declare function roundToStep(value: number, step: number): number;
8
+ export declare function infinityToMaxNumber(value: number): number;
9
+ export declare function maxNumberToInfinity(value: number): number;
10
+ export declare function smoothDamp(current: number, target: number, currentVelocityRef: Ref, smoothTime: number, maxSpeed: number | undefined, deltaTime: number): number;
11
+ export declare function smoothDampVec3(current: _THREE.Vector3, target: _THREE.Vector3, currentVelocityRef: _THREE.Vector3, smoothTime: number, maxSpeed: number | undefined, deltaTime: number, out: _THREE.Vector3): _THREE.Vector3;
@@ -0,0 +1,2 @@
1
+ import * as _THREE from 'three';
2
+ export declare function notSupportedInOrthographicCamera(camera: _THREE.OrthographicCamera | _THREE.PerspectiveCamera, message: string): camera is _THREE.OrthographicCamera;
@@ -0,0 +1,52 @@
1
+ import * as THREE from "three";
2
+ import { DrawableData } from "./Constants";
3
+ import { Drawable } from "./Drawable";
4
+ import type { DrawableList } from "./DrawableList";
5
+ import { Event } from "../../core/utils";
6
+ import type { DxfViewer } from "../../core/viewers";
7
+ /**
8
+ * @internal
9
+ */
10
+ export declare type constructorReturnType<T> = new (...arg: any) => T;
11
+ /**
12
+ * @internal
13
+ */
14
+ export declare class CanvasRender extends Event {
15
+ private viewer;
16
+ private drawableLists;
17
+ private canvas?;
18
+ context?: CanvasRenderingContext2D;
19
+ private frustum;
20
+ private projScreenMatrix;
21
+ static _registerDrawableClass(drawable: constructorReturnType<Drawable>): void;
22
+ static createDrawable(data: DrawableData): Drawable<Record<string, unknown>>;
23
+ constructor(viewer: DxfViewer);
24
+ get is3d(): boolean;
25
+ get container(): HTMLElement;
26
+ get camera(): THREE.Camera;
27
+ get raycaster(): THREE.Raycaster;
28
+ private init;
29
+ private initCanvas;
30
+ private toHighDpr;
31
+ clearCanvas(): void;
32
+ addDrawableList(drawableList: DrawableList): void;
33
+ render(): void;
34
+ setSize(width: number, height: number): void;
35
+ getSortedDrawables(onlyVisible?: boolean): Drawable<Record<string, unknown>>[];
36
+ getDrawablesByPosition(p: THREE.Vector3, raycaster?: THREE.Raycaster): Drawable[];
37
+ getDrawableById(id: string): Drawable<Record<string, unknown>> | undefined;
38
+ measureTextLength(text: string, font: string): number;
39
+ /**
40
+ *
41
+ * @param option
42
+ * @returns
43
+ * @deprecated
44
+ */
45
+ screenshot(option?: {
46
+ type: string;
47
+ quality: number;
48
+ }): Promise<string | undefined>;
49
+ getImage(filter: (drawable: Drawable) => boolean): Promise<HTMLImageElement>;
50
+ getCanvas(): HTMLCanvasElement | undefined;
51
+ destroy(): void;
52
+ }
@@ -0,0 +1,28 @@
1
+ /**
2
+ * Drawable data, including measurement data, markup data, etc.
3
+ */
4
+ export interface DrawableData {
5
+ /**
6
+ * id is used by business logic to manage(find, update, delete, etc.) drawables
7
+ */
8
+ id: string;
9
+ /**
10
+ * Two dimension float array stores 2d or 3d points.
11
+ * e.g., You can use "[[1, 1], [2.5, 3]]" to represent a distance measurement result,
12
+ * "[1, 1]" is the first point, and "[2.5, 3]" is the second point.
13
+ */
14
+ points: number[][];
15
+ lineWidth?: number;
16
+ /**
17
+ * Line color is number array. e.g: [r, g, b, a]
18
+ */
19
+ lineColor?: number[];
20
+ /**
21
+ * Fill color is number array. e.g: [r, g, b, a]
22
+ */
23
+ fillColor?: number[];
24
+ /**
25
+ * Drawable dta type
26
+ */
27
+ type: string;
28
+ }
@@ -0,0 +1,87 @@
1
+ import * as THREE from "three";
2
+ import { DrawableData } from "./Constants";
3
+ import { Event } from "../../core/utils";
4
+ /**
5
+ * @internal
6
+ */
7
+ export declare abstract class Drawable<DrawableEvents extends Record<string, unknown> = Record<string, unknown>> extends Event<DrawableEvents> {
8
+ protected readonly DEFAULT_LINE_WIDTH = 1;
9
+ protected readonly DEFAULT_STROKE_STYLE: number[];
10
+ protected readonly DEFAULT_FILL_STYLE: number[];
11
+ id: string;
12
+ protected lineWidth: number;
13
+ protected lineColor: number[];
14
+ protected fillColor: number[];
15
+ x: number;
16
+ y: number;
17
+ width: number;
18
+ height: number;
19
+ protected points: THREE.Vector3[];
20
+ userData: Record<any, any>;
21
+ protected tolerance: number;
22
+ visible: boolean;
23
+ selected: boolean;
24
+ /**
25
+ * render order, the bigger number is on the top
26
+ */
27
+ renderOrder: number;
28
+ needsFrustumCulled: boolean;
29
+ protected editPointSize: number;
30
+ protected editPointFillColor: string;
31
+ protected editPointStrokeColor: string;
32
+ protected matrix: THREE.Matrix4;
33
+ protected ctx?: CanvasRenderingContext2D;
34
+ constructor(id?: string);
35
+ setTolerance(t: number): void;
36
+ render(ctx: CanvasRenderingContext2D, camera: THREE.Camera): void;
37
+ getData(): DrawableData;
38
+ setData(data: DrawableData): void;
39
+ getVertexes(): THREE.Vector3[];
40
+ setLineWidth(lineWidth?: number): void;
41
+ setLineColor(color?: number[]): void;
42
+ setFillColor(color?: number[]): void;
43
+ isSelected(): boolean;
44
+ getCenter(): THREE.Vector3;
45
+ transToScreenCoord(vector: THREE.Vector3, camera: THREE.Camera): THREE.Vector2;
46
+ /**
47
+ *
48
+ * @param ctx
49
+ * @param camera
50
+ * @describe just for debug bounds
51
+ */
52
+ private drawBounds;
53
+ /**
54
+ *
55
+ * @param ctx
56
+ * @param camera
57
+ * @describe just for debug
58
+ */
59
+ private drawCenter;
60
+ /**
61
+ *
62
+ * @param p is world position
63
+ * @param raycaster just for 3d intersect
64
+ * @returns boolean
65
+ * @describe is point interact drawable, use to select drawable, the same as threejs object raycast
66
+ */
67
+ abstract isPointInPath(p: THREE.Vector3, raycaster?: THREE.Raycaster): boolean;
68
+ getBounds(): THREE.Box3;
69
+ /**
70
+ *
71
+ * @param ctx
72
+ * @param camera
73
+ * @describe abstract draw method
74
+ */
75
+ abstract draw(ctx: CanvasRenderingContext2D, camera: THREE.Camera): void;
76
+ /**
77
+ *
78
+ * @param ctx
79
+ * @param camera
80
+ * @describe abstract drawSelect method
81
+ */
82
+ abstract drawSelect(ctx: CanvasRenderingContext2D, camera: THREE.Camera): void;
83
+ /**
84
+ * @describe class type for serialize
85
+ */
86
+ abstract getClassType(): string;
87
+ }
@@ -0,0 +1,29 @@
1
+ import { DrawableData } from "./Constants";
2
+ import { Drawable } from "./Drawable";
3
+ import { Event } from "../../core/utils";
4
+ declare type DrawableListEvents = {
5
+ addDrawable: DrawableData;
6
+ updateDrawable: DrawableData;
7
+ removeDrawable: DrawableData;
8
+ };
9
+ /**
10
+ * DrawableList:按类别管理一组 Drawable(绘制元素)。
11
+ * - 提供增删改查接口
12
+ * - 在增删改操作时通过事件通知外部(例如 UI 同步)
13
+ * @internal
14
+ */
15
+ export declare class DrawableList extends Event<DrawableListEvents> {
16
+ private category;
17
+ private drawableMap;
18
+ constructor(category: string);
19
+ addDrawable(drawable: Drawable): void;
20
+ updateDrawable(drawable: Drawable, newData: DrawableData): void;
21
+ removeDrawable(drawable: Drawable): void;
22
+ getDrawableById(id: string): Drawable<Record<string, unknown>> | undefined;
23
+ clear(): void;
24
+ getDrawables(): Map<string, Drawable<Record<string, unknown>>>;
25
+ getDrawableDatas(): DrawableData[];
26
+ setDrawableDatas(drawableDatas: DrawableData[]): void;
27
+ getDrawableByPosition(p: THREE.Vector3, raycaster?: THREE.Raycaster): Drawable<Record<string, unknown>>;
28
+ }
29
+ export {};
@@ -0,0 +1,4 @@
1
+ export * from "./CanvasRender";
2
+ export * from "./DrawableList";
3
+ export * from "./Drawable";
4
+ export * from "./Constants";
@@ -0,0 +1,104 @@
1
+ import * as THREE from "three";
2
+ import { ProgressBar } from "../../components/progress-bar";
3
+ import { DxfCompareConfig, DxfModelConfig, DxfViewerConfig } from "../../core/Configs";
4
+ import { DxfChange, DxfLoader } from "../../core/dxf";
5
+ import { FontManager } from "../../core/font";
6
+ import { DxfViewer } from "../../core/viewers/DxfViewer";
7
+ /**
8
+ * Dxf compare helper with one viewport.
9
+ * @example
10
+ * ``` html
11
+ * <div id="app">
12
+ * <div id="myCanvas" style="width: 100%; height: 100%; display: inline-block;"></div>
13
+ * </div>
14
+ * ```
15
+ * ``` typescript
16
+ * const viewerCfg = { containerId: "myCanvas" };
17
+ * const modelCfg1 = { modelId: "id_1", src: "http://www.abc.com/sample1.dxf" };
18
+ * const modelCfg2 = { modelId: "id_2", src: "http://www.abc.com/sample2.dxf" };
19
+ * const fontFiles = ["http://www.abc.com/hztxt.shx", "http://www.abc.com/simplex.shx"];
20
+ *
21
+ * const compareHelper = new BaseDxfCompareHelper(viewerCfg);
22
+ * await compareHelper.setFont(fontFiles);
23
+ * await compareHelper.compare(modelCfg1, modelCfg2);
24
+ * ```
25
+ */
26
+ export declare class BaseDxfCompareHelper {
27
+ /**
28
+ * DxfViewer of DxfCompareHelper.
29
+ */
30
+ viewer: DxfViewer;
31
+ protected fontManager?: FontManager;
32
+ protected loader: DxfLoader;
33
+ protected loadingManager?: THREE.LoadingManager;
34
+ protected changes?: Record<string, DxfChange>;
35
+ protected container: HTMLElement;
36
+ protected spinner?: HTMLDivElement;
37
+ protected jobCount: number;
38
+ protected loadingProgressBar?: ProgressBar;
39
+ constructor(viewerCfg: DxfViewerConfig);
40
+ protected initSpinner(): void;
41
+ /**
42
+ * @description {en} Sets font.
43
+ * This needs to be called before loading a dxf, it won't affect any loaded text.
44
+ * It accepts shx or typeface formats. For typeface, it only support passing in 1 font file in the array for now.
45
+ * @description {zh} 设置字体。
46
+ * 需要在加载dxf之前调用,不会影响已加载的文字。
47
+ * 支持shx或typeface格式。对于typeface,目前只支持传入1个字体文件。
48
+ * @param urls
49
+ * - {en} font file urls.
50
+ * - {zh} 字体文件链接。
51
+ * @example
52
+ * ```typescript
53
+ * compareHelper.setFont(["https://example.com/xxx.shx"]);
54
+ * ```
55
+ */
56
+ setFont(urls: string[]): Promise<void>;
57
+ /**
58
+ * Compares two dxf files. Note that:
59
+ * - It only compares model spaces.
60
+ * - It shouldn't load anything else before and after compare.
61
+ * @param modelCfg1 The first dxf to be compared
62
+ * @param modelCfg2 The second dxf to be compared
63
+ * @param onProgress loading progress
64
+ */
65
+ compare(modelCfg1: DxfModelConfig, modelCfg2: DxfModelConfig, compareCfg?: DxfCompareConfig, onProgress?: (event: ProgressEvent) => void): Promise<void>;
66
+ /**
67
+ * @description {en} Gets compare changes.
68
+ * @description {zh} 获取对比变动.
69
+ * @returns
70
+ * - {en} Compare changes.
71
+ * - {zh} 对比变动列表。
72
+ * @example
73
+ * ``` typescript
74
+ * const changes = compareHelper.getChanges();
75
+ * console.log(changes);
76
+ * ```
77
+ */
78
+ getChanges(): Record<number, DxfChange> | undefined;
79
+ /**
80
+ * @description {en} Zooms to a compare change.
81
+ * @description {zh} 聚焦到图纸的一处变动。
82
+ * @param changeId
83
+ * - {en} Change id, which is an incremental integer starts from 1.
84
+ * - {zh} 变动id,该id是从数字1开始自增的整数。
85
+ * @example
86
+ * ``` typescript
87
+ * const changeId = 1;
88
+ * compareHelper.zoomToChange(changeId);
89
+ * ```
90
+ */
91
+ zoomToChange(changeId: number): void;
92
+ /**
93
+ * Sets spinner visibility
94
+ */
95
+ protected setSpinnerVisibility(visible: boolean): void;
96
+ /**
97
+ * Increases job count, and show spinner accordingly
98
+ */
99
+ protected increaseJobCount(): void;
100
+ /**
101
+ * Decreases job count, and hide spinner accordingly
102
+ */
103
+ protected decreaseJobCount(): void;
104
+ }
@@ -0,0 +1,17 @@
1
+ import * as THREE from "three";
2
+ import { Drawable } from "../../core/canvas";
3
+ /**
4
+ * @internal
5
+ */
6
+ export declare class CompareDrawable extends Drawable {
7
+ boxes: THREE.Box3[];
8
+ lineSegments: THREE.Vector3[][];
9
+ constructor(id: string, boxes: THREE.Box3[]);
10
+ private calculateCloudLineSegments;
11
+ draw(ctx: CanvasRenderingContext2D, camera: THREE.Camera): void;
12
+ private drawBox;
13
+ drawSelect(ctx: CanvasRenderingContext2D, camera: THREE.Camera): void;
14
+ isPointInPath(p: THREE.Vector3): boolean;
15
+ getBounds(): THREE.Box3;
16
+ getClassType(): string;
17
+ }
@@ -0,0 +1,69 @@
1
+ import { BaseDxfCompareHelper } from "./BaseDxfCompareHelper";
2
+ import { DxfCompareConfig, DxfModelConfig, DxfViewerConfig } from "../../core/Configs";
3
+ import { DxfViewer } from "../../core/viewers/DxfViewer";
4
+ /**
5
+ * Dxf compare helper with two viewports.
6
+ * @example
7
+ * ``` html
8
+ * <div id="app">
9
+ * <div id="myCanvas1" style="width: 50%; height: 100%; display: inline-block;"></div>
10
+ * <div id="myCanvas2" style="width: 50%; height: 100%; display: inline-block; padding-left: 1px;"></div>
11
+ * </div>
12
+ * ```
13
+ * ``` typescript
14
+ * const viewerCfg1 = { containerId: "myCanvas1" };
15
+ * const viewerCfg2 = { containerId: "myCanvas2" };
16
+ * const modelCfg1 = { modelId: "id_1", src: "http://www.abc.com/sample1.dxf" };
17
+ * const modelCfg2 = { modelId: "id_2", src: "http://www.abc.com/sample2.dxf" };
18
+ * const fontFiles = ["http://www.abc.com/hztxt.shx", "http://www.abc.com/simplex.shx"];
19
+ *
20
+ * const compareHelper = new DxfCompareHelper(viewerCfg1, viewerCfg2);
21
+ * await compareHelper.setFont(fontFiles);
22
+ * await compareHelper.compare(modelCfg1, modelCfg2);
23
+ * compareHelper.enableSyncCamera(true);
24
+ * ```
25
+ */
26
+ export declare class DxfCompareHelper extends BaseDxfCompareHelper {
27
+ /**
28
+ * The second DxfViewer of DxfCompareHelper.
29
+ */
30
+ viewer2: DxfViewer;
31
+ /**
32
+ * Enables to synchronize camera position when another camera is moved.
33
+ */
34
+ protected syncCamera: boolean;
35
+ constructor(viewerCfg1: DxfViewerConfig, viewerCfg2: DxfViewerConfig);
36
+ protected initSyncCameraEvent(): void;
37
+ /**
38
+ * @description {en} Enables to synchronize camera position when another camera is moved.
39
+ * @description {zh} 设置开启或关闭同步相机视角。
40
+ * @example
41
+ * ```typescript
42
+ * compareHelper.enableSyncCamera(true);
43
+ * ```
44
+ */
45
+ enableSyncCamera(enable: boolean): void;
46
+ private syncCameraControls;
47
+ /**
48
+ * Compares two dxf files. Note that:
49
+ * - It only compares model spaces.
50
+ * - It shouldn't load anything else before and after compare.
51
+ * @param modelCfg1 The first dxf to be compared
52
+ * @param modelCfg2 The second dxf to be compared
53
+ * @param onProgress loading progress
54
+ */
55
+ compare(modelCfg1: DxfModelConfig, modelCfg2: DxfModelConfig, compareCfg?: DxfCompareConfig, onProgress?: (event: ProgressEvent) => void): Promise<void>;
56
+ /**
57
+ * @description {en} Zooms to a compare change.
58
+ * @description {zh} 聚焦到图纸的一处变动。
59
+ * @param changeId
60
+ * - {en} Change id, which is an incremental integer starts from 1.
61
+ * - {zh} 变动id,该id是从数字1开始自增的整数。
62
+ * @example
63
+ * ``` typescript
64
+ * const changeId = 1;
65
+ * compareHelper.zoomToChange(changeId);
66
+ * ```
67
+ */
68
+ zoomToChange(changeId: number): void;
69
+ }
@@ -0,0 +1,11 @@
1
+ import type { DxfViewer } from "../viewers";
2
+ import { DxfChange } from "../../core/dxf";
3
+ import { Event } from "../../core/utils";
4
+ export declare class DxfCompareMarkupManager extends Event {
5
+ private viewer;
6
+ private overlayRender?;
7
+ private drawableList;
8
+ constructor(viewer: DxfViewer);
9
+ drawCompareDrawable(changes: Record<string, DxfChange>): void;
10
+ setCompareDrawableVisible(visilbe: boolean): void;
11
+ }
@@ -0,0 +1,4 @@
1
+ export * from "./CompareDrawable";
2
+ export * from "./DxfCompareMarkupManager";
3
+ export * from "./DxfCompareHelper";
4
+ export * from "./BaseDxfCompareHelper";
@@ -0,0 +1,34 @@
1
+ import * as THREE from "three";
2
+ import { CameraControls } from "../camera-controls/CameraControls";
3
+ export declare class CameraControlsEx extends CameraControls {
4
+ minZoom: number;
5
+ draggingSmoothTime: number;
6
+ private dollySpeedBackup;
7
+ private azimuthRotateSpeedBackup;
8
+ private polarRotateSpeedBackup;
9
+ private truckSpeedBackup;
10
+ private domElementKeyEvents?;
11
+ keyTruckSpeed: number;
12
+ keys: {
13
+ left: string;
14
+ up: string;
15
+ right: string;
16
+ bottom: string;
17
+ };
18
+ constructor(object: THREE.PerspectiveCamera | THREE.OrthographicCamera, domElement?: HTMLElement);
19
+ get enableZoom(): boolean;
20
+ set enableZoom(value: boolean);
21
+ get enableRotate(): boolean;
22
+ set enableRotate(value: boolean);
23
+ get enableTruck(): boolean;
24
+ set enableTruck(value: boolean);
25
+ private onKeyDown;
26
+ private onKeyUp;
27
+ listenToKeyEvents(): void;
28
+ stopListenToKeyEvents(): void;
29
+ /**
30
+ * Dispose the OrbitControls instance itself, remove all eventListeners.
31
+ * @category Methods
32
+ */
33
+ dispose(): void;
34
+ }
@@ -0,0 +1 @@
1
+ export * from "./CameraControlsEx";