@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,11 @@
1
+ import type { Viewer2d } 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: Viewer2d);
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,38 @@
1
+ export declare class Container {
2
+ width: number;
3
+ height: number;
4
+ /**
5
+ * The root container which will be created to under the container user passed in,
6
+ * it typically contains a viewer container and a widget container.
7
+ */
8
+ container: HTMLDivElement;
9
+ /**
10
+ * The viewer container, which contains
11
+ * - canvas of three.js
12
+ * - canvas for overlay renderer
13
+ * - css2d object renderer
14
+ */
15
+ viewerContainer?: HTMLDivElement;
16
+ /**
17
+ * The vidget container, may contain:
18
+ * - Axis gizmo
19
+ * - Progress bar
20
+ * - Toolbar ui
21
+ * - Context menu
22
+ */
23
+ widgetContainer?: HTMLDivElement;
24
+ constructor(containerId: string);
25
+ /**
26
+ * Creates a viewerContainer under the container that user passed in.
27
+ * There are some benefits to create a new one. e.g., its style won't affect
28
+ * the container div user passed in.
29
+ */
30
+ private initViewerContainer;
31
+ /**
32
+ *
33
+ * @description Create a div for ui widget, if widget need position, just relative container, maybe remove later.
34
+ */
35
+ private initWidgetContainer;
36
+ get needResize(): boolean;
37
+ destroy(): void;
38
+ }
@@ -0,0 +1,31 @@
1
+ import type { Container } from "./Container";
2
+ export interface ProgressItem {
3
+ div: HTMLDivElement;
4
+ onProgress?: (event: ProgressEvent) => void;
5
+ }
6
+ /**
7
+ * Build in ProgressBar, used to indicate current progress.
8
+ */
9
+ export declare class ProgressBar {
10
+ private element;
11
+ private progressItems;
12
+ private replaceReg;
13
+ constructor(container: Container);
14
+ addProgressItem(id: string, message?: string, onProgress?: (event: ProgressEvent) => void): void;
15
+ removeProgressItem(id: string): void;
16
+ /**
17
+ * Updates a progress item
18
+ * @param progressItemId
19
+ * @param message
20
+ * @param progress number between 0-100
21
+ */
22
+ updateProgress(progressItemId: string, message?: string, progress?: number): void;
23
+ updateProgressBar(id: string, progress: number | ProgressEvent, min?: number, max?: number): void;
24
+ setVisible(visible: boolean): void;
25
+ /**
26
+ * Removes a progress item after some time
27
+ * @param progressItemId
28
+ */
29
+ delayRemoveProgressItem(progressItemId: string, delayInMs?: number): void;
30
+ destroy(): void;
31
+ }
@@ -0,0 +1,16 @@
1
+ import type { Container } from "./Container";
2
+ /**
3
+ * Build in Spinner, used to indicate the progress is busy.
4
+ */
5
+ export declare class Spinner {
6
+ private element;
7
+ private jobCount;
8
+ constructor(container: Container);
9
+ /**
10
+ * Sets spinner visibility
11
+ */
12
+ private setSpinnerVisibility;
13
+ increaseJobCount(): void;
14
+ decreaseJobCount(): void;
15
+ destroy(): void;
16
+ }
@@ -0,0 +1,3 @@
1
+ export * from "./Spinner";
2
+ export * from "./Container";
3
+ export * from "./ProgressBar";
@@ -0,0 +1,37 @@
1
+ import * as THREE from "three";
2
+ import { CameraControls } from "../camera-controls/CameraControls";
3
+ /**
4
+ * @deprecated
5
+ */
6
+ export declare class CameraControlsEx extends CameraControls {
7
+ minZoom: number;
8
+ draggingSmoothTime: number;
9
+ private dollySpeedBackup;
10
+ private azimuthRotateSpeedBackup;
11
+ private polarRotateSpeedBackup;
12
+ private truckSpeedBackup;
13
+ private domElementKeyEvents?;
14
+ keyTruckSpeed: number;
15
+ keys: {
16
+ left: string;
17
+ up: string;
18
+ right: string;
19
+ bottom: string;
20
+ };
21
+ constructor(object: THREE.PerspectiveCamera | THREE.OrthographicCamera, domElement?: HTMLElement);
22
+ get enableZoom(): boolean;
23
+ set enableZoom(value: boolean);
24
+ get enableRotate(): boolean;
25
+ set enableRotate(value: boolean);
26
+ get enableTruck(): boolean;
27
+ set enableTruck(value: boolean);
28
+ private onKeyDown;
29
+ private onKeyUp;
30
+ listenToKeyEvents(): void;
31
+ stopListenToKeyEvents(): void;
32
+ /**
33
+ * Dispose the OrbitControls instance itself, remove all eventListeners.
34
+ * @category Methods
35
+ */
36
+ dispose(): void;
37
+ }
@@ -0,0 +1,17 @@
1
+ import * as THREE from "three";
2
+ /**
3
+ * Controls mode.
4
+ */
5
+ export declare enum ControlsMode {
6
+ Orbit = 0,
7
+ FirstPerson = 1,
8
+ Plan = 2
9
+ }
10
+ /**
11
+ * Base class for controls.
12
+ */
13
+ export interface BaseControls {
14
+ mode: ControlsMode;
15
+ setupControl(): void;
16
+ adjustCameraByBBox(bbox: THREE.Box3): void;
17
+ }
@@ -0,0 +1,13 @@
1
+ import * as THREE from "three";
2
+ import { BaseControls, ControlsMode } from "./Control";
3
+ import type { CameraManager } from "../../core/camera/CameraManager";
4
+ /**
5
+ * Controls for 3d viewers.
6
+ */
7
+ export declare class OrbitControls implements BaseControls {
8
+ readonly mode = ControlsMode.Orbit;
9
+ private cameraManager;
10
+ constructor(cameraManager: CameraManager);
11
+ setupControl(): void;
12
+ adjustCameraByBBox(box: THREE.Box3): void;
13
+ }
@@ -0,0 +1,13 @@
1
+ import * as THREE from "three";
2
+ import { BaseControls, ControlsMode } from "./Control";
3
+ import type { CameraManager } from "../../core/camera";
4
+ /**
5
+ * Controls for 2d viewers.
6
+ */
7
+ export declare class PlanControls implements BaseControls {
8
+ readonly mode = ControlsMode.Plan;
9
+ private cameraManager;
10
+ constructor(cameraManager: CameraManager);
11
+ setupControl(): void;
12
+ adjustCameraByBBox(box: THREE.Box3): void;
13
+ }
@@ -0,0 +1,4 @@
1
+ export * from "./Control";
2
+ export * from "./OrbitControls";
3
+ export * from "./PlanControls";
4
+ export * from "./CameraControlsEx";
@@ -0,0 +1,151 @@
1
+ import * as THREE from "three";
2
+ import type { DxfEntity } from "./DxfLoader";
3
+ import type { DxfCompareConfig } from "../../core/Configs";
4
+ import { IDxf } from "../../core/dxf-parser";
5
+ /**
6
+ * Dxf change type, which can be "Added", "Removed" or "Modified".
7
+ *
8
+ * Note that a "Modified" change can be represented as a "Removed" and an "Added" types.
9
+ *
10
+ * The system can display "Added" object in a specific color (green, etc.),
11
+ * and "Removed" in another color (red, etc.).
12
+ */
13
+ export declare enum DxfChangeType {
14
+ Added = "Added",
15
+ Removed = "Removed",
16
+ Modified = "Modified",
17
+ NoChange = "NoChange"
18
+ }
19
+ /**
20
+ * Dxf compare detail changes.
21
+ * It supports:
22
+ * - color
23
+ * - lineType
24
+ * - constantWidth (polyline width)
25
+ */
26
+ export type DxfDetailChanges = {
27
+ [propName: string]: {
28
+ /**
29
+ * The old value.
30
+ */
31
+ old: unknown;
32
+ /**
33
+ * The new value.
34
+ */
35
+ new: unknown;
36
+ };
37
+ };
38
+ /**
39
+ * Describes a dxf change
40
+ */
41
+ export interface DxfChange {
42
+ /**
43
+ * An integer type id. It is unique in the lifecycle of a Viewer2d.
44
+ */
45
+ id: number;
46
+ /**
47
+ * Change type, which can be "Added", "Removed", "Modified" or "NoChange".
48
+ */
49
+ type: DxfChangeType;
50
+ /**
51
+ * AutoCAD entity handle as hex string.
52
+ */
53
+ handle: string;
54
+ /**
55
+ * AutoCAD entity handle as hex string.
56
+ * @internal
57
+ */
58
+ parentHandles?: string[];
59
+ /**
60
+ * @internal
61
+ */
62
+ box?: THREE.Box3;
63
+ detailChanges?: DxfDetailChanges;
64
+ }
65
+ /**
66
+ * Used to compare two drawings/dxfs.
67
+ * - Consider model space only.
68
+ * - Consider entity's geometry, position, scale, etc.
69
+ * - Ignore layer's visibility, freeze settings.
70
+ * - Ignore entity's properties like linetype, fill pattern, font, color, etc.
71
+ * - Ignore spatial filter (xclip) of block reference.
72
+ * - We compare entities with the same handle and type. e.g.
73
+ * - if line A from dxf1 has the same handle with arc A from dxf2, then line A is "Removed", arc A is "Added".
74
+ * - For color, it compares color setting rather than the actual color. E.g.
75
+ * - If a color setting is "ByLayer", but the layer's color is changed. We take this case as unchanged.
76
+ * - If a color setting is "ByLayer", the setting is changed to "ByBlock", while the layer and block actually have the same color. We take this case as changed.
77
+ * @internal
78
+ */
79
+ export declare class DxfCompare {
80
+ static readonly ENTITY_COLOR_ADDED = 65280;
81
+ static readonly ENTITY_COLOR_REMOVED = 16711680;
82
+ static readonly ENTITY_COLOR_NO_CHANGE = 10066329;
83
+ static readonly ENTITY_COLOR_MARKUP = 16744231;
84
+ private dxf1;
85
+ private dxf2;
86
+ private changes;
87
+ private comparedBlocks;
88
+ private isComparingBlock;
89
+ private isComparingDimension;
90
+ private enableDetailComparision;
91
+ static readonly ENTITY_TYPES_TO_IGNORE: string[];
92
+ constructor(dxf1: IDxf, dxf2: IDxf, compareCfg?: DxfCompareConfig);
93
+ private getLayerFrozen;
94
+ /**
95
+ * Compares model spaces of two dxf files.
96
+ * Returns DxfChange map, the key is incremental integer starts from 1.
97
+ * It is unique in the lifecycle of a Viewer2d.
98
+ */
99
+ compare(onProgress?: (event: ProgressEvent) => void): Promise<Record<number, DxfChange>>;
100
+ private isDimensionBlock;
101
+ compareInsertOrDemensionEntities(a: DxfEntity, b: DxfEntity, parentHandle1?: string, parentHandle2?: string): {
102
+ type: DxfChangeType;
103
+ handle: string;
104
+ parentHandles?: string[] | undefined;
105
+ }[] | undefined;
106
+ private compareBlock;
107
+ private compareEntities;
108
+ private bIgnoreChildEntitiesOriginalType;
109
+ private entitiesEqual;
110
+ private getColor;
111
+ private getLineType;
112
+ private addModificationItem;
113
+ private baseEntitiesEqual;
114
+ private arcsEqual;
115
+ private linesEqual;
116
+ private polylinesEqual;
117
+ private textsEqual;
118
+ private solidsEqual;
119
+ private pointEntitiesEqual;
120
+ private splinesEqual;
121
+ private mtextsEqual;
122
+ private ellipsesEqual;
123
+ private attDefsEqual;
124
+ private attribsEqual;
125
+ private hatchesEqual;
126
+ private viewportsEqual;
127
+ private leadersEqual;
128
+ private mleadersEqual;
129
+ private ole2framesEqual;
130
+ private insertsEqual;
131
+ private dimensionsEqual;
132
+ private regionsEqual;
133
+ private vectorsEqual;
134
+ private pointsEqual;
135
+ private vertexEntityEqual;
136
+ private numbersEqual;
137
+ private numberEqual;
138
+ private vectorArraysEqual;
139
+ private verticesEqual;
140
+ private verticesArrayEqual;
141
+ private vertexEntitiesEqual;
142
+ private hatchEdgesEqual;
143
+ private hatchEdgeArraysEqual;
144
+ private hatchBoundaryPathsEqual;
145
+ private hatchBoundaryPathArraysEqual;
146
+ private mleaderLineEqual;
147
+ private mleaderLinesEqual;
148
+ private mleaderLeaderEqual;
149
+ private mleaderLeadersEqual;
150
+ private mleaderContextEqual;
151
+ }
@@ -0,0 +1,33 @@
1
+ /**
2
+ * Constants used by dxf
3
+ */
4
+ export declare const ByLayer = "BYLAYER";
5
+ export declare const ByBlock = "BYBLOCK";
6
+ export declare const DefaultLineType = "CONTINUOUS";
7
+ export declare const ColorIndexByBlock = 0;
8
+ export declare const ColorIndexByLayer = 256;
9
+ export declare const DefaultLayer = "0";
10
+ /**
11
+ * The Model space viewport, aka, the default viewport id is 1.
12
+ * Paper space viewports are 2, 3, ...
13
+ */
14
+ export declare const DefaultViewportId = 1;
15
+ /**
16
+ * The render order for entities.
17
+ * AutoCAD has well defined render order for each entity. But we have trouble
18
+ * to make the order the same as in AutoCAD. If we cannot, we'll simply make
19
+ * entities follow this order.
20
+ */
21
+ export declare enum DxfRenderOrder {
22
+ Mesh = -1,
23
+ MeshWithPattern = 0,
24
+ LineWithWidth = 1,
25
+ Line = 2,
26
+ LineWithPattern = 3,
27
+ Point = 4,
28
+ Text = 5
29
+ }
30
+ /**
31
+ * For nested types, we need to compare their inner entities.
32
+ */
33
+ export declare const NestedCompareTypes: string[];