@shapediver/viewer.features.drawing-tools 3.1.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 (209) hide show
  1. package/LICENSE +73 -0
  2. package/README.md +161 -0
  3. package/dist/api/implementation/DrawingToolsApi.d.ts +31 -0
  4. package/dist/api/implementation/DrawingToolsApi.d.ts.map +1 -0
  5. package/dist/api/implementation/DrawingToolsApi.js +111 -0
  6. package/dist/api/implementation/DrawingToolsApi.js.map +1 -0
  7. package/dist/api/implementation/restrictions/AbstractRestrictionApi.d.ts +10 -0
  8. package/dist/api/implementation/restrictions/AbstractRestrictionApi.d.ts.map +1 -0
  9. package/dist/api/implementation/restrictions/AbstractRestrictionApi.js +38 -0
  10. package/dist/api/implementation/restrictions/AbstractRestrictionApi.js.map +1 -0
  11. package/dist/api/implementation/restrictions/AbstractSnapRestrictionApi.d.ts +11 -0
  12. package/dist/api/implementation/restrictions/AbstractSnapRestrictionApi.d.ts.map +1 -0
  13. package/dist/api/implementation/restrictions/AbstractSnapRestrictionApi.js +40 -0
  14. package/dist/api/implementation/restrictions/AbstractSnapRestrictionApi.js.map +1 -0
  15. package/dist/api/implementation/restrictions/axis/AxisRestrictionApi.d.ts +7 -0
  16. package/dist/api/implementation/restrictions/axis/AxisRestrictionApi.d.ts.map +1 -0
  17. package/dist/api/implementation/restrictions/axis/AxisRestrictionApi.js +24 -0
  18. package/dist/api/implementation/restrictions/axis/AxisRestrictionApi.js.map +1 -0
  19. package/dist/api/implementation/restrictions/geometry/GeometryRestrictionApi.d.ts +15 -0
  20. package/dist/api/implementation/restrictions/geometry/GeometryRestrictionApi.d.ts.map +1 -0
  21. package/dist/api/implementation/restrictions/geometry/GeometryRestrictionApi.js +54 -0
  22. package/dist/api/implementation/restrictions/geometry/GeometryRestrictionApi.js.map +1 -0
  23. package/dist/api/implementation/restrictions/plane/PlaneRestrictionApi.d.ts +18 -0
  24. package/dist/api/implementation/restrictions/plane/PlaneRestrictionApi.d.ts.map +1 -0
  25. package/dist/api/implementation/restrictions/plane/PlaneRestrictionApi.js +61 -0
  26. package/dist/api/implementation/restrictions/plane/PlaneRestrictionApi.js.map +1 -0
  27. package/dist/api/implementation/restrictions/plane/snap/AngularRestrictionApi.d.ts +10 -0
  28. package/dist/api/implementation/restrictions/plane/snap/AngularRestrictionApi.d.ts.map +1 -0
  29. package/dist/api/implementation/restrictions/plane/snap/AngularRestrictionApi.js +40 -0
  30. package/dist/api/implementation/restrictions/plane/snap/AngularRestrictionApi.js.map +1 -0
  31. package/dist/api/implementation/restrictions/plane/snap/GridRestrictionApi.d.ts +10 -0
  32. package/dist/api/implementation/restrictions/plane/snap/GridRestrictionApi.d.ts.map +1 -0
  33. package/dist/api/implementation/restrictions/plane/snap/GridRestrictionApi.js +40 -0
  34. package/dist/api/implementation/restrictions/plane/snap/GridRestrictionApi.js.map +1 -0
  35. package/dist/api/interfaces/IDrawingToolsApi.d.ts +89 -0
  36. package/dist/api/interfaces/IDrawingToolsApi.d.ts.map +1 -0
  37. package/dist/api/interfaces/IDrawingToolsApi.js +3 -0
  38. package/dist/api/interfaces/IDrawingToolsApi.js.map +1 -0
  39. package/dist/api/interfaces/IRestrictionApi.d.ts +11 -0
  40. package/dist/api/interfaces/IRestrictionApi.d.ts.map +1 -0
  41. package/dist/api/interfaces/IRestrictionApi.js +3 -0
  42. package/dist/api/interfaces/IRestrictionApi.js.map +1 -0
  43. package/dist/api/interfaces/ISnapRestrictionApi.d.ts +13 -0
  44. package/dist/api/interfaces/ISnapRestrictionApi.d.ts.map +1 -0
  45. package/dist/api/interfaces/ISnapRestrictionApi.js +3 -0
  46. package/dist/api/interfaces/ISnapRestrictionApi.js.map +1 -0
  47. package/dist/business/implementation/DrawingToolsManager.d.ts +95 -0
  48. package/dist/business/implementation/DrawingToolsManager.d.ts.map +1 -0
  49. package/dist/business/implementation/DrawingToolsManager.js +544 -0
  50. package/dist/business/implementation/DrawingToolsManager.js.map +1 -0
  51. package/dist/business/implementation/managers/HistoryManager.d.ts +19 -0
  52. package/dist/business/implementation/managers/HistoryManager.d.ts.map +1 -0
  53. package/dist/business/implementation/managers/HistoryManager.js +89 -0
  54. package/dist/business/implementation/managers/HistoryManager.js.map +1 -0
  55. package/dist/business/implementation/managers/TextVisualizationManager.d.ts +14 -0
  56. package/dist/business/implementation/managers/TextVisualizationManager.d.ts.map +1 -0
  57. package/dist/business/implementation/managers/TextVisualizationManager.js +228 -0
  58. package/dist/business/implementation/managers/TextVisualizationManager.js.map +1 -0
  59. package/dist/business/implementation/managers/geometry/GeometryManager.d.ts +23 -0
  60. package/dist/business/implementation/managers/geometry/GeometryManager.d.ts.map +1 -0
  61. package/dist/business/implementation/managers/geometry/GeometryManager.js +82 -0
  62. package/dist/business/implementation/managers/geometry/GeometryManager.js.map +1 -0
  63. package/dist/business/implementation/managers/geometry/GeometryMathManager.d.ts +73 -0
  64. package/dist/business/implementation/managers/geometry/GeometryMathManager.d.ts.map +1 -0
  65. package/dist/business/implementation/managers/geometry/GeometryMathManager.js +230 -0
  66. package/dist/business/implementation/managers/geometry/GeometryMathManager.js.map +1 -0
  67. package/dist/business/implementation/managers/geometry/GeometryState.d.ts +46 -0
  68. package/dist/business/implementation/managers/geometry/GeometryState.d.ts.map +1 -0
  69. package/dist/business/implementation/managers/geometry/GeometryState.js +323 -0
  70. package/dist/business/implementation/managers/geometry/GeometryState.js.map +1 -0
  71. package/dist/business/implementation/managers/geometry/helpers/GeometryManagerHelper.d.ts +16 -0
  72. package/dist/business/implementation/managers/geometry/helpers/GeometryManagerHelper.d.ts.map +1 -0
  73. package/dist/business/implementation/managers/geometry/helpers/GeometryManagerHelper.js +157 -0
  74. package/dist/business/implementation/managers/geometry/helpers/GeometryManagerHelper.js.map +1 -0
  75. package/dist/business/implementation/managers/interaction/EventManager.d.ts +26 -0
  76. package/dist/business/implementation/managers/interaction/EventManager.d.ts.map +1 -0
  77. package/dist/business/implementation/managers/interaction/EventManager.js +63 -0
  78. package/dist/business/implementation/managers/interaction/EventManager.js.map +1 -0
  79. package/dist/business/implementation/managers/interaction/InteractionManager.d.ts +39 -0
  80. package/dist/business/implementation/managers/interaction/InteractionManager.d.ts.map +1 -0
  81. package/dist/business/implementation/managers/interaction/InteractionManager.js +237 -0
  82. package/dist/business/implementation/managers/interaction/InteractionManager.js.map +1 -0
  83. package/dist/business/implementation/managers/interaction/RestrictionManager.d.ts +19 -0
  84. package/dist/business/implementation/managers/interaction/RestrictionManager.d.ts.map +1 -0
  85. package/dist/business/implementation/managers/interaction/RestrictionManager.js +117 -0
  86. package/dist/business/implementation/managers/interaction/RestrictionManager.js.map +1 -0
  87. package/dist/business/implementation/managers/interaction/handlers/DeletionInteractionHandler.d.ts +10 -0
  88. package/dist/business/implementation/managers/interaction/handlers/DeletionInteractionHandler.d.ts.map +1 -0
  89. package/dist/business/implementation/managers/interaction/handlers/DeletionInteractionHandler.js +52 -0
  90. package/dist/business/implementation/managers/interaction/handlers/DeletionInteractionHandler.js.map +1 -0
  91. package/dist/business/implementation/managers/interaction/handlers/InsertionInteractionHandler.d.ts +14 -0
  92. package/dist/business/implementation/managers/interaction/handlers/InsertionInteractionHandler.d.ts.map +1 -0
  93. package/dist/business/implementation/managers/interaction/handlers/InsertionInteractionHandler.js +135 -0
  94. package/dist/business/implementation/managers/interaction/handlers/InsertionInteractionHandler.js.map +1 -0
  95. package/dist/business/implementation/managers/interaction/handlers/MidPointInteractionHandler.d.ts +16 -0
  96. package/dist/business/implementation/managers/interaction/handlers/MidPointInteractionHandler.d.ts.map +1 -0
  97. package/dist/business/implementation/managers/interaction/handlers/MidPointInteractionHandler.js +113 -0
  98. package/dist/business/implementation/managers/interaction/handlers/MidPointInteractionHandler.js.map +1 -0
  99. package/dist/business/implementation/managers/interaction/helpers/InteractionManagerHelper.d.ts +58 -0
  100. package/dist/business/implementation/managers/interaction/helpers/InteractionManagerHelper.d.ts.map +1 -0
  101. package/dist/business/implementation/managers/interaction/helpers/InteractionManagerHelper.js +377 -0
  102. package/dist/business/implementation/managers/interaction/helpers/InteractionManagerHelper.js.map +1 -0
  103. package/dist/business/implementation/managers/interaction/restrictions/AbstractRestriction.d.ts +19 -0
  104. package/dist/business/implementation/managers/interaction/restrictions/AbstractRestriction.d.ts.map +1 -0
  105. package/dist/business/implementation/managers/interaction/restrictions/AbstractRestriction.js +105 -0
  106. package/dist/business/implementation/managers/interaction/restrictions/AbstractRestriction.js.map +1 -0
  107. package/dist/business/implementation/managers/interaction/restrictions/axis/AxisRestriction.d.ts +22 -0
  108. package/dist/business/implementation/managers/interaction/restrictions/axis/AxisRestriction.d.ts.map +1 -0
  109. package/dist/business/implementation/managers/interaction/restrictions/axis/AxisRestriction.js +96 -0
  110. package/dist/business/implementation/managers/interaction/restrictions/axis/AxisRestriction.js.map +1 -0
  111. package/dist/business/implementation/managers/interaction/restrictions/geometry/GeometryRestriction.d.ts +39 -0
  112. package/dist/business/implementation/managers/interaction/restrictions/geometry/GeometryRestriction.d.ts.map +1 -0
  113. package/dist/business/implementation/managers/interaction/restrictions/geometry/GeometryRestriction.js +215 -0
  114. package/dist/business/implementation/managers/interaction/restrictions/geometry/GeometryRestriction.js.map +1 -0
  115. package/dist/business/implementation/managers/interaction/restrictions/plane/PlaneRestriction.d.ts +58 -0
  116. package/dist/business/implementation/managers/interaction/restrictions/plane/PlaneRestriction.d.ts.map +1 -0
  117. package/dist/business/implementation/managers/interaction/restrictions/plane/PlaneRestriction.js +180 -0
  118. package/dist/business/implementation/managers/interaction/restrictions/plane/PlaneRestriction.js.map +1 -0
  119. package/dist/business/implementation/managers/interaction/restrictions/plane/snap/AngularRestriction.d.ts +38 -0
  120. package/dist/business/implementation/managers/interaction/restrictions/plane/snap/AngularRestriction.d.ts.map +1 -0
  121. package/dist/business/implementation/managers/interaction/restrictions/plane/snap/AngularRestriction.js +308 -0
  122. package/dist/business/implementation/managers/interaction/restrictions/plane/snap/AngularRestriction.js.map +1 -0
  123. package/dist/business/implementation/managers/interaction/restrictions/plane/snap/GridRestriction.d.ts +37 -0
  124. package/dist/business/implementation/managers/interaction/restrictions/plane/snap/GridRestriction.d.ts.map +1 -0
  125. package/dist/business/implementation/managers/interaction/restrictions/plane/snap/GridRestriction.js +228 -0
  126. package/dist/business/implementation/managers/interaction/restrictions/plane/snap/GridRestriction.js.map +1 -0
  127. package/dist/business/implementation/utils/numberCleaner.d.ts +2 -0
  128. package/dist/business/implementation/utils/numberCleaner.d.ts.map +1 -0
  129. package/dist/business/implementation/utils/numberCleaner.js +9 -0
  130. package/dist/business/implementation/utils/numberCleaner.js.map +1 -0
  131. package/dist/business/interfaces/IDrawingToolsManager.d.ts +270 -0
  132. package/dist/business/interfaces/IDrawingToolsManager.d.ts.map +1 -0
  133. package/dist/business/interfaces/IDrawingToolsManager.js +16 -0
  134. package/dist/business/interfaces/IDrawingToolsManager.js.map +1 -0
  135. package/dist/business/interfaces/IManager.d.ts +4 -0
  136. package/dist/business/interfaces/IManager.d.ts.map +1 -0
  137. package/dist/business/interfaces/IManager.js +3 -0
  138. package/dist/business/interfaces/IManager.js.map +1 -0
  139. package/dist/business/interfaces/IRestriction.d.ts +41 -0
  140. package/dist/business/interfaces/IRestriction.d.ts.map +1 -0
  141. package/dist/business/interfaces/IRestriction.js +13 -0
  142. package/dist/business/interfaces/IRestriction.js.map +1 -0
  143. package/dist/business/interfaces/IRestrictionBase.d.ts +19 -0
  144. package/dist/business/interfaces/IRestrictionBase.d.ts.map +1 -0
  145. package/dist/business/interfaces/IRestrictionBase.js +5 -0
  146. package/dist/business/interfaces/IRestrictionBase.js.map +1 -0
  147. package/dist/business/interfaces/ISnapRestriction.d.ts +50 -0
  148. package/dist/business/interfaces/ISnapRestriction.d.ts.map +1 -0
  149. package/dist/business/interfaces/ISnapRestriction.js +4 -0
  150. package/dist/business/interfaces/ISnapRestriction.js.map +1 -0
  151. package/dist/business/interfaces/events/EventResponseMapping.d.ts +19 -0
  152. package/dist/business/interfaces/events/EventResponseMapping.d.ts.map +1 -0
  153. package/dist/business/interfaces/events/EventResponseMapping.js +4 -0
  154. package/dist/business/interfaces/events/EventResponseMapping.js.map +1 -0
  155. package/dist/business/interfaces/events/IDrawingToolsEvent.d.ts +12 -0
  156. package/dist/business/interfaces/events/IDrawingToolsEvent.d.ts.map +1 -0
  157. package/dist/business/interfaces/events/IDrawingToolsEvent.js +3 -0
  158. package/dist/business/interfaces/events/IDrawingToolsEvent.js.map +1 -0
  159. package/dist/index.d.ts +32 -0
  160. package/dist/index.d.ts.map +1 -0
  161. package/dist/index.js +45 -0
  162. package/dist/index.js.map +1 -0
  163. package/dist/three/CSS2DRenderer.d.ts +32 -0
  164. package/dist/three/CSS2DRenderer.d.ts.map +1 -0
  165. package/dist/three/CSS2DRenderer.js +137 -0
  166. package/dist/three/CSS2DRenderer.js.map +1 -0
  167. package/package.json +55 -0
  168. package/src/api/implementation/DrawingToolsApi.ts +135 -0
  169. package/src/api/implementation/restrictions/AbstractRestrictionApi.ts +34 -0
  170. package/src/api/implementation/restrictions/AbstractSnapRestrictionApi.ts +36 -0
  171. package/src/api/implementation/restrictions/axis/AxisRestrictionApi.ts +19 -0
  172. package/src/api/implementation/restrictions/geometry/GeometryRestrictionApi.ts +56 -0
  173. package/src/api/implementation/restrictions/plane/PlaneRestrictionApi.ts +63 -0
  174. package/src/api/implementation/restrictions/plane/snap/AngularRestrictionApi.ts +35 -0
  175. package/src/api/implementation/restrictions/plane/snap/GridRestrictionApi.ts +35 -0
  176. package/src/api/interfaces/IDrawingToolsApi.ts +99 -0
  177. package/src/api/interfaces/IRestrictionApi.ts +15 -0
  178. package/src/api/interfaces/ISnapRestrictionApi.ts +18 -0
  179. package/src/business/implementation/DrawingToolsManager.ts +619 -0
  180. package/src/business/implementation/managers/HistoryManager.ts +101 -0
  181. package/src/business/implementation/managers/TextVisualizationManager.ts +245 -0
  182. package/src/business/implementation/managers/geometry/GeometryManager.ts +95 -0
  183. package/src/business/implementation/managers/geometry/GeometryMathManager.ts +273 -0
  184. package/src/business/implementation/managers/geometry/GeometryState.ts +436 -0
  185. package/src/business/implementation/managers/geometry/helpers/GeometryManagerHelper.ts +170 -0
  186. package/src/business/implementation/managers/interaction/EventManager.ts +80 -0
  187. package/src/business/implementation/managers/interaction/InteractionManager.ts +268 -0
  188. package/src/business/implementation/managers/interaction/RestrictionManager.ts +135 -0
  189. package/src/business/implementation/managers/interaction/handlers/DeletionInteractionHandler.ts +48 -0
  190. package/src/business/implementation/managers/interaction/handlers/InsertionInteractionHandler.ts +149 -0
  191. package/src/business/implementation/managers/interaction/handlers/MidPointInteractionHandler.ts +127 -0
  192. package/src/business/implementation/managers/interaction/helpers/InteractionManagerHelper.ts +411 -0
  193. package/src/business/implementation/managers/interaction/restrictions/AbstractRestriction.ts +99 -0
  194. package/src/business/implementation/managers/interaction/restrictions/axis/AxisRestriction.ts +107 -0
  195. package/src/business/implementation/managers/interaction/restrictions/geometry/GeometryRestriction.ts +237 -0
  196. package/src/business/implementation/managers/interaction/restrictions/plane/PlaneRestriction.ts +257 -0
  197. package/src/business/implementation/managers/interaction/restrictions/plane/snap/AngularRestriction.ts +384 -0
  198. package/src/business/implementation/managers/interaction/restrictions/plane/snap/GridRestriction.ts +262 -0
  199. package/src/business/implementation/utils/numberCleaner.ts +5 -0
  200. package/src/business/interfaces/IDrawingToolsManager.ts +313 -0
  201. package/src/business/interfaces/IManager.ts +7 -0
  202. package/src/business/interfaces/IRestriction.ts +64 -0
  203. package/src/business/interfaces/IRestrictionBase.ts +33 -0
  204. package/src/business/interfaces/ISnapRestriction.ts +70 -0
  205. package/src/business/interfaces/events/EventResponseMapping.ts +19 -0
  206. package/src/business/interfaces/events/IDrawingToolsEvent.ts +16 -0
  207. package/src/index.ts +72 -0
  208. package/src/three/CSS2DRenderer.ts +212 -0
  209. package/tsconfig.json +17 -0
package/LICENSE ADDED
@@ -0,0 +1,73 @@
1
+ Required Notice: Copyright 2023 ShapeDiver GmbH (https://www.shapediver.com)
2
+
3
+ https://polyformproject.org/licenses/noncommercial/1.0.0
4
+
5
+ Acceptance
6
+
7
+ In order to get any license under these terms, you must agree to them as both strict obligations and conditions to all your licenses.
8
+
9
+ Copyright License
10
+
11
+ The licensor grants you a copyright license for the software to do everything you might do with the software that would otherwise infringe the licensor’s copyright in it for any permitted purpose. However, you may only distribute the software according to Distribution License and make changes or new works based on the software according to Changes and New Works License.
12
+
13
+ Distribution License
14
+
15
+ The licensor grants you an additional copyright license to distribute copies of the software. Your license to distribute covers distributing the software with changes and new works permitted by Changes and New Works License.
16
+
17
+ Notices
18
+
19
+ You must ensure that anyone who gets a copy of any part of the software from you also gets a copy of these terms or the URL for them above, as well as copies of any plain-text lines beginning with Required Notice: that the licensor provided with the software. For example:
20
+
21
+ Required Notice: Copyright 2023 ShapeDiver GmbH (https://www.shapediver.com)
22
+
23
+ Changes and New Works License
24
+
25
+ The licensor grants you an additional copyright license to make changes and new works based on the software for any permitted purpose.
26
+
27
+ Patent License
28
+
29
+ The licensor grants you a patent license for the software that covers patent claims the licensor can license, or becomes able to license, that you would infringe by using the software.
30
+
31
+ Noncommercial Purposes
32
+
33
+ Any noncommercial purpose is a permitted purpose.
34
+
35
+ Personal Uses
36
+
37
+ Personal use for research, experiment, and testing for the benefit of public knowledge, personal study, private entertainment, hobby projects, amateur pursuits, or religious observance, without any anticipated commercial application, is use for a permitted purpose.
38
+
39
+ Noncommercial Organizations
40
+
41
+ Use by any charitable organization, educational institution, public research organization, public safety or health organization, environmental protection organization, or government institution is use for a permitted purpose regardless of the source of funding or obligations resulting from the funding.
42
+
43
+ Fair Use
44
+
45
+ You may have “fair use” rights for the software under the law. These terms do not limit them.
46
+
47
+ No Other Rights
48
+
49
+ These terms do not allow you to sublicense or transfer any of your licenses to anyone else, or prevent the licensor from granting licenses to anyone else. These terms do not imply any other licenses.
50
+
51
+ Patent Defense
52
+
53
+ If you make any written claim that the software infringes or contributes to infringement of any patent, your patent license for the software granted under these terms ends immediately. If your company makes such a claim, your patent license ends immediately for work on behalf of your company.
54
+
55
+ Violations
56
+
57
+ The first time you are notified in writing that you have violated any of these terms, or done anything with the software not covered by your licenses, your licenses can nonetheless continue if you come into full compliance with these terms, and take practical steps to correct past violations, within 32 days of receiving notice. Otherwise, all your licenses end immediately.
58
+
59
+ No Liability
60
+
61
+ As far as the law allows, the software comes as is, without any warranty or condition, and the licensor will not be liable to you for any damages arising out of these terms or the use or nature of the software, under any kind of legal claim.
62
+
63
+ Definitions
64
+
65
+ The licensor is the individual or entity offering these terms, and the software is the software the licensor makes available under these terms.
66
+
67
+ You refers to the individual or entity agreeing to these terms.
68
+
69
+ Your company is any legal entity, sole proprietorship, or other kind of organization that you work for, plus all organizations that have control over, are under the control of, or are under common control with that organization. Control means ownership of substantially all the assets of an entity, or the power to direct its management and policies by vote, contract, or otherwise. Control can be direct or indirect.
70
+
71
+ Your licenses are all the licenses granted to you for the software under these terms.
72
+
73
+ Use means anything you do with the software requiring one of your licenses.
package/README.md ADDED
@@ -0,0 +1,161 @@
1
+ # `@shapediver/viewer.features.drawing-tools`
2
+
3
+ This is the npm package for the ShapeDiver Viewer Drawing Tools feature. Please have a look at our [help desk section](https://help.shapediver.com/doc/drawing-tools) for this feature.
4
+
5
+ For more information on ShapeDiver, please visit our [homepage](https://shapediver.com/). If you need help, have a look at our [help desk](https://help.shapediver.com/doc/Viewer.1836580882.html).
6
+
7
+ ## Installation
8
+ ```
9
+ npm install --save @shapediver/viewer.features.drawing-tools
10
+ ```
11
+
12
+ ## Usage
13
+
14
+ As this is an additional package to the `@shapediver/viewer` package, we omit the initial setup. Please have a look [here](https://viewer.shapediver.com/v3/latest/api/index.html).
15
+
16
+ ### Initialization
17
+
18
+ The drawing tools can be initialized with the function `createDrawingTools`, create a new instance of the drawing tools. The following input can be provided to the function:
19
+
20
+ - viewport: the viewport API in which the drawing tools should be created
21
+ - callbacks: the `onUpdate` and `onCancel` callbacks are called by the drawing tools whenever the drawing tools are either updated or cancelled
22
+ - settings: the settings with which the Drawing Tools are initialized (see below)
23
+
24
+ ### Drawing Tools Settings
25
+
26
+ The settings that can be provided to the drawing tools are separated into four sections:
27
+
28
+ #### geometry
29
+
30
+ The geometry settings of the drawing tool.
31
+ Here you can define the points, the mode and specific details of the geometry.
32
+
33
+ | Property | Description |
34
+ | :-------- | :------ |
35
+ | points | The points that are used when starting the drawing tool. The points are defined as an array of arrays, where each array contains the x, y and z coordinates of the point. If the mode is set to 'lines', the points are connected in the order they are defined. If the mode is set to 'points', the points are not connected. |
36
+ | mode | The mode of the geometry. If the mode is set to 'lines', the points are connected in the order they are defined. If the mode is set to 'points', the points are not connected. |
37
+ | minPoints | The minimum amount of points, if undefined, the geometry is not restricted. This value is checked whenever the user tries to update or finish the drawing tool. |
38
+ | maxPoints | The maximum amount of points, if undefined, the geometry is not restricted. This value is checked whenever the user tries to update or finish the drawing tool. |
39
+ | strictMinMaxPoints | If the number of points is strictly checked during the drawing process. If this setting is set to true, once the minimum or maximum amount of points is reached, the user cannot add or remove points that would violate the restriction. If this setting is set to false, the user can add or remove points even if the minimum or maximum amount of points is exceeded temporarily. Once the user tries to update or finish the drawing tool, the amount of points is checked in either case. |
40
+ | close | If the mode is set to 'lines', if it is a closed line or not. If the mode is set to 'points', this setting is ignored. A line can be closed by connecting the last point with the first point. |
41
+ | autoClose | If the mode is set to 'lines', if the line is automatically closed. If the mode is set to 'points', this setting is ignored. The first and last point are always connected if the line is automatically closed. |
42
+
43
+ #### restrictions
44
+
45
+ The restrictions of the drawing tool.
46
+
47
+ Here you can define the restrictions that are used when interacting with the drawing tool.
48
+ At least one restriction is required, the plane and axis restrictions are added by default if no restrictions are defined.
49
+
50
+ Each restriction is defined by a type and the corresponding properties of that restriction. For further details on this please see the [API documentation](https://viewer.shapediver.com/v3/latest/api/features/drawing-tools/index.html).
51
+
52
+ #### visualization
53
+
54
+ The visualization settings of the drawing tool.
55
+ Here you can define the visualization of the drawing tool.
56
+
57
+ | Property | Description |
58
+ | :-------- | :------ |
59
+ | distanceMultiplicationFactor | The multiplication factor of the point size when interactions are performed. If the factor is set to 2, the point size is doubled when interacting. |
60
+ | pointLabels | If the point labels are shown. The point labels display the position of the points. |
61
+ | distanceLabels | If the distance labels are shown. The distance labels display the distance between the points. |
62
+ | points | The material properties of the points. For more details please have a look at the [API documentation](https://viewer.shapediver.com/v3/latest/api/interfaces/IMaterialMultiPointDataProperties.html). |
63
+ | lines | The material properties of the lines. For more details please have a look at the [API documentation](https://viewer.shapediver.com/v3/latest/api/interfaces/IMaterialBasicLineData.html). |
64
+
65
+ #### controls
66
+
67
+ The control settings of the drawing tool.
68
+ Here you can define which keys are used for the different actions of the drawing tool.
69
+
70
+ | Property | Description |
71
+ | :-------- | :------ |
72
+ | insert | The key that is used to insert a point. |
73
+ | delete | The key that is used to delete a point. |
74
+ | confirm | The key that is used to confirm actions. |
75
+ | cancel | The key that is used to cancel drawing. |
76
+ | undo | The keys that are used to undo the last action. |
77
+ | redo | The keys that are used to redo the last action. |
78
+
79
+ #### general
80
+
81
+ The general settings of the drawing tool.
82
+ Here you can define general settings of the drawing tool.
83
+
84
+ | Property | Description |
85
+ | :-------- | :------ |
86
+ | autoStart | If the drawing tool is started automatically when no points are defined. |
87
+ | autoUpdate | If the drawing tool is updated automatically when the drawing is changed. |
88
+ | closeOnUpdate | If the drawing tool is closed when the drawing is updated. |
89
+ | displayUnit | The unit that will be displayed in the distance and point labels. |
90
+
91
+ ## Code Example
92
+
93
+ ```typescript
94
+ import {
95
+ addListener,
96
+ createSession,
97
+ createViewport,
98
+ EVENTTYPE_DRAWING_TOOLS,
99
+ IEvent
100
+ } from '@shapediver/viewer';
101
+ import {
102
+ createDrawingTools,
103
+ IDrawingToolsApi,
104
+ IDrawingToolsEvent,
105
+ PointsData,
106
+ Settings
107
+ } from '@shapediver/viewer.features.drawing-tools';
108
+
109
+ (async () => {
110
+ // create a viewport
111
+ const viewport = await createViewport({
112
+ canvas: document.getElementById('canvas') as HTMLCanvasElement
113
+ });
114
+ // create a session
115
+ const session = await createSession({
116
+ ticket: 'YOUR_TICKET',
117
+ modelViewUrl: 'YOUR_MODEL_VIEW_URL'
118
+ });
119
+
120
+ /**
121
+ * Define the settings you want to use for the drawing tools
122
+ */
123
+ const customizationProperties: Settings = {
124
+
125
+ };
126
+
127
+ /**
128
+ * Callback function for the drawing tool
129
+ * executed when the drawing tool is updated
130
+ *
131
+ * @param geometryData
132
+ */
133
+ const onUpdate = async (pointsData: PointsData) => {
134
+ console.log('Drawing tools updated', pointsData);
135
+ };
136
+
137
+ /**
138
+ * Callback function for the drawing tool
139
+ * executed when the drawing tool is cancelled
140
+ */
141
+ const onCancel = () => {
142
+ console.log('Drawing tools cancelled');
143
+ };
144
+
145
+ /**
146
+ * Add an event when the condition for the minimum number of points is not met.
147
+ */
148
+ addListener(EVENTTYPE_DRAWING_TOOLS.MINIMUM_POINTS, (event: IEvent) => {
149
+ console.log((event as IDrawingToolsEvent).message);
150
+ });
151
+
152
+ /**
153
+ * Add an event when the maximum number of points has been exceeded.
154
+ */
155
+ addListener(EVENTTYPE_DRAWING_TOOLS.MAXIMUM_POINTS, (event: IEvent) => {
156
+ console.log((event as IDrawingToolsEvent).message);
157
+ });
158
+
159
+ const drawingToolsApi: IDrawingToolsApi | undefined = createDrawingTools(viewport, { onUpdate, onCancel }, customizationProperties);
160
+
161
+ ```
@@ -0,0 +1,31 @@
1
+ import { Callbacks, DefaultTextures, PointsData, SettingsOptional } from '../../business/interfaces/IDrawingToolsManager';
2
+ import { IDrawingToolsApi } from '../interfaces/IDrawingToolsApi';
3
+ import { IRestrictionApi } from '../interfaces/IRestrictionApi';
4
+ import { IViewportApi } from '@shapediver/viewer';
5
+ import { RestrictionProperties } from '../../business/interfaces/IRestriction';
6
+ import { vec3 } from 'gl-matrix';
7
+ export declare class DrawingToolsApi implements IDrawingToolsApi {
8
+ #private;
9
+ constructor(viewport: IViewportApi, callbacks: Callbacks, settings: SettingsOptional, defaultTextures?: DefaultTextures);
10
+ get closed(): boolean;
11
+ get pointsData(): PointsData;
12
+ get restrictions(): {
13
+ [key: string]: IRestrictionApi;
14
+ };
15
+ get showDistanceLabels(): boolean;
16
+ set showDistanceLabels(value: boolean);
17
+ get showPointLabels(): boolean;
18
+ set showPointLabels(value: boolean);
19
+ addPoint(index: number, position?: vec3 | undefined): void;
20
+ addRestriction(properties: RestrictionProperties, incomingToken?: string): IRestrictionApi | undefined;
21
+ canRedo(): boolean;
22
+ canUndo(): boolean;
23
+ cancel(): void;
24
+ close(): void;
25
+ redo(): void;
26
+ removePoint(index: number): void;
27
+ removeRestriction(token: string): void;
28
+ undo(): void;
29
+ update(): PointsData | undefined;
30
+ }
31
+ //# sourceMappingURL=DrawingToolsApi.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DrawingToolsApi.d.ts","sourceRoot":"","sources":["../../../src/api/implementation/DrawingToolsApi.ts"],"names":[],"mappings":"AAEA,OAAO,EACH,SAAS,EACT,eAAe,EAEf,UAAU,EACV,gBAAgB,EACnB,MAAM,gDAAgD,CAAC;AAIxD,OAAO,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AAClE,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAChE,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAGlD,OAAO,EAAE,qBAAqB,EAAE,MAAM,wCAAwC,CAAC;AAC/E,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,qBAAa,eAAgB,YAAW,gBAAgB;;gBAUxC,QAAQ,EAAE,YAAY,EAAE,SAAS,EAAE,SAAS,EAAE,QAAQ,EAAE,gBAAgB,EAAE,eAAe,CAAC,EAAE,eAAe;IAiBvH,IAAW,MAAM,IAAI,OAAO,CAE3B;IAED,IAAW,UAAU,IAAI,UAAU,CAElC;IAED,IAAW,YAAY,IAAI;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,eAAe,CAAC;KAAE,CAE7D;IAED,IAAW,kBAAkB,IAAI,OAAO,CAEvC;IAED,IAAW,kBAAkB,CAAC,KAAK,EAAE,OAAO,EAE3C;IAED,IAAW,eAAe,IAAI,OAAO,CAEpC;IAED,IAAW,eAAe,CAAC,KAAK,EAAE,OAAO,EAExC;IAMM,QAAQ,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,IAAI,GAAG,SAAS,GAAG,IAAI;IAI1D,cAAc,CAAC,UAAU,EAAE,qBAAqB,EAAE,aAAa,CAAC,EAAE,MAAM,GAAG,eAAe,GAAG,SAAS;IActG,OAAO,IAAI,OAAO;IAIlB,OAAO,IAAI,OAAO;IAIlB,MAAM,IAAI,IAAI;IAId,KAAK,IAAI,IAAI;IAIb,IAAI,IAAI,IAAI;IAIZ,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;IAIhC,iBAAiB,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;IAKtC,IAAI,IAAI,IAAI;IAIZ,MAAM,IAAI,UAAU,GAAG,SAAS;CAK1C"}
@@ -0,0 +1,111 @@
1
+ "use strict";
2
+ var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
3
+ if (kind === "m") throw new TypeError("Private method is not writable");
4
+ if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
5
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
6
+ return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
7
+ };
8
+ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
9
+ if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
10
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
11
+ return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
12
+ };
13
+ var _DrawingToolsApi_drawingToolsManager, _DrawingToolsApi_restrictions;
14
+ Object.defineProperty(exports, "__esModule", { value: true });
15
+ exports.DrawingToolsApi = void 0;
16
+ const AxisRestriction_1 = require("../../business/implementation/managers/interaction/restrictions/axis/AxisRestriction");
17
+ const AxisRestrictionApi_1 = require("./restrictions/axis/AxisRestrictionApi");
18
+ const DrawingToolsManager_1 = require("../../business/implementation/DrawingToolsManager");
19
+ const GeometryRestriction_1 = require("../../business/implementation/managers/interaction/restrictions/geometry/GeometryRestriction");
20
+ const GeometryRestrictionApi_1 = require("./restrictions/geometry/GeometryRestrictionApi");
21
+ const PlaneRestriction_1 = require("../../business/implementation/managers/interaction/restrictions/plane/PlaneRestriction");
22
+ const PlaneRestrictionApi_1 = require("./restrictions/plane/PlaneRestrictionApi");
23
+ class DrawingToolsApi {
24
+ // #endregion Properties (2)
25
+ // #region Constructors (1)
26
+ constructor(viewport, callbacks, settings, defaultTextures) {
27
+ // #region Properties (2)
28
+ _DrawingToolsApi_drawingToolsManager.set(this, void 0);
29
+ _DrawingToolsApi_restrictions.set(this, {});
30
+ __classPrivateFieldSet(this, _DrawingToolsApi_drawingToolsManager, new DrawingToolsManager_1.DrawingToolsManager(viewport, callbacks, settings, defaultTextures), "f");
31
+ for (const token in __classPrivateFieldGet(this, _DrawingToolsApi_drawingToolsManager, "f").restrictions) {
32
+ if (__classPrivateFieldGet(this, _DrawingToolsApi_drawingToolsManager, "f").restrictions[token] instanceof PlaneRestriction_1.PlaneRestriction)
33
+ __classPrivateFieldGet(this, _DrawingToolsApi_restrictions, "f")[token] = new PlaneRestrictionApi_1.PlaneRestrictionApi(__classPrivateFieldGet(this, _DrawingToolsApi_drawingToolsManager, "f").restrictions[token]);
34
+ if (__classPrivateFieldGet(this, _DrawingToolsApi_drawingToolsManager, "f").restrictions[token] instanceof GeometryRestriction_1.GeometryRestriction)
35
+ __classPrivateFieldGet(this, _DrawingToolsApi_restrictions, "f")[token] = new GeometryRestrictionApi_1.GeometryRestrictionApi(__classPrivateFieldGet(this, _DrawingToolsApi_drawingToolsManager, "f").restrictions[token]);
36
+ if (__classPrivateFieldGet(this, _DrawingToolsApi_drawingToolsManager, "f").restrictions[token] instanceof AxisRestriction_1.AxisRestriction)
37
+ __classPrivateFieldGet(this, _DrawingToolsApi_restrictions, "f")[token] = new AxisRestrictionApi_1.AxisRestrictionApi(__classPrivateFieldGet(this, _DrawingToolsApi_drawingToolsManager, "f").restrictions[token]);
38
+ }
39
+ }
40
+ // #endregion Constructors (1)
41
+ // #region Public Getters And Setters (7)
42
+ get closed() {
43
+ return __classPrivateFieldGet(this, _DrawingToolsApi_drawingToolsManager, "f").closed;
44
+ }
45
+ get pointsData() {
46
+ return __classPrivateFieldGet(this, _DrawingToolsApi_drawingToolsManager, "f").getPointsData();
47
+ }
48
+ get restrictions() {
49
+ return __classPrivateFieldGet(this, _DrawingToolsApi_restrictions, "f");
50
+ }
51
+ get showDistanceLabels() {
52
+ return __classPrivateFieldGet(this, _DrawingToolsApi_drawingToolsManager, "f").showDistanceLabels;
53
+ }
54
+ set showDistanceLabels(value) {
55
+ __classPrivateFieldGet(this, _DrawingToolsApi_drawingToolsManager, "f").showDistanceLabels = value;
56
+ }
57
+ get showPointLabels() {
58
+ return __classPrivateFieldGet(this, _DrawingToolsApi_drawingToolsManager, "f").showPointLabels;
59
+ }
60
+ set showPointLabels(value) {
61
+ __classPrivateFieldGet(this, _DrawingToolsApi_drawingToolsManager, "f").showPointLabels = value;
62
+ }
63
+ // #endregion Public Getters And Setters (7)
64
+ // #region Public Methods (11)
65
+ addPoint(index, position) {
66
+ __classPrivateFieldGet(this, _DrawingToolsApi_drawingToolsManager, "f").addPoint(index, position);
67
+ }
68
+ addRestriction(properties, incomingToken) {
69
+ const token = __classPrivateFieldGet(this, _DrawingToolsApi_drawingToolsManager, "f").addRestriction(properties, incomingToken);
70
+ if (!token)
71
+ return;
72
+ if (__classPrivateFieldGet(this, _DrawingToolsApi_drawingToolsManager, "f").restrictions[token] instanceof PlaneRestriction_1.PlaneRestriction)
73
+ __classPrivateFieldGet(this, _DrawingToolsApi_restrictions, "f")[token] = new PlaneRestrictionApi_1.PlaneRestrictionApi(__classPrivateFieldGet(this, _DrawingToolsApi_drawingToolsManager, "f").restrictions[token]);
74
+ if (__classPrivateFieldGet(this, _DrawingToolsApi_drawingToolsManager, "f").restrictions[token] instanceof GeometryRestriction_1.GeometryRestriction)
75
+ __classPrivateFieldGet(this, _DrawingToolsApi_restrictions, "f")[token] = new GeometryRestrictionApi_1.GeometryRestrictionApi(__classPrivateFieldGet(this, _DrawingToolsApi_drawingToolsManager, "f").restrictions[token]);
76
+ if (__classPrivateFieldGet(this, _DrawingToolsApi_drawingToolsManager, "f").restrictions[token] instanceof AxisRestriction_1.AxisRestriction)
77
+ __classPrivateFieldGet(this, _DrawingToolsApi_restrictions, "f")[token] = new AxisRestrictionApi_1.AxisRestrictionApi(__classPrivateFieldGet(this, _DrawingToolsApi_drawingToolsManager, "f").restrictions[token]);
78
+ return __classPrivateFieldGet(this, _DrawingToolsApi_restrictions, "f")[token];
79
+ }
80
+ canRedo() {
81
+ return __classPrivateFieldGet(this, _DrawingToolsApi_drawingToolsManager, "f").canRedo();
82
+ }
83
+ canUndo() {
84
+ return __classPrivateFieldGet(this, _DrawingToolsApi_drawingToolsManager, "f").canUndo();
85
+ }
86
+ cancel() {
87
+ __classPrivateFieldGet(this, _DrawingToolsApi_drawingToolsManager, "f").cancel();
88
+ }
89
+ close() {
90
+ __classPrivateFieldGet(this, _DrawingToolsApi_drawingToolsManager, "f").close();
91
+ }
92
+ redo() {
93
+ __classPrivateFieldGet(this, _DrawingToolsApi_drawingToolsManager, "f").redo();
94
+ }
95
+ removePoint(index) {
96
+ __classPrivateFieldGet(this, _DrawingToolsApi_drawingToolsManager, "f").removePoint(index);
97
+ }
98
+ removeRestriction(token) {
99
+ __classPrivateFieldGet(this, _DrawingToolsApi_drawingToolsManager, "f").removeRestriction(token);
100
+ delete __classPrivateFieldGet(this, _DrawingToolsApi_restrictions, "f")[token];
101
+ }
102
+ undo() {
103
+ __classPrivateFieldGet(this, _DrawingToolsApi_drawingToolsManager, "f").undo();
104
+ }
105
+ update() {
106
+ return __classPrivateFieldGet(this, _DrawingToolsApi_drawingToolsManager, "f").update();
107
+ }
108
+ }
109
+ exports.DrawingToolsApi = DrawingToolsApi;
110
+ _DrawingToolsApi_drawingToolsManager = new WeakMap(), _DrawingToolsApi_restrictions = new WeakMap();
111
+ //# sourceMappingURL=DrawingToolsApi.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DrawingToolsApi.js","sourceRoot":"","sources":["../../../src/api/implementation/DrawingToolsApi.ts"],"names":[],"mappings":"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"}
@@ -0,0 +1,10 @@
1
+ import { IRestrictionApi } from '../../interfaces/IRestrictionApi';
2
+ import { IRestrictionBase } from '../../../business/interfaces/IRestrictionBase';
3
+ export declare abstract class AbstractRestrictionApi implements IRestrictionApi {
4
+ #private;
5
+ constructor(restriction: IRestrictionBase);
6
+ get enabled(): boolean;
7
+ set enabled(value: boolean);
8
+ get id(): string;
9
+ }
10
+ //# sourceMappingURL=AbstractRestrictionApi.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AbstractRestrictionApi.d.ts","sourceRoot":"","sources":["../../../../src/api/implementation/restrictions/AbstractRestrictionApi.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAC;AACnE,OAAO,EAAE,gBAAgB,EAAE,MAAM,+CAA+C,CAAC;AAEjF,8BAAsB,sBAAuB,YAAW,eAAe;;gBASvD,WAAW,EAAE,gBAAgB;IAQzC,IAAW,OAAO,IAAI,OAAO,CAE5B;IAED,IAAW,OAAO,CAAC,KAAK,EAAE,OAAO,EAEhC;IAED,IAAW,EAAE,IAAI,MAAM,CAEtB;CAGJ"}
@@ -0,0 +1,38 @@
1
+ "use strict";
2
+ var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
3
+ if (kind === "m") throw new TypeError("Private method is not writable");
4
+ if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
5
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
6
+ return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
7
+ };
8
+ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
9
+ if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
10
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
11
+ return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
12
+ };
13
+ var _AbstractRestrictionApi_restriction;
14
+ Object.defineProperty(exports, "__esModule", { value: true });
15
+ exports.AbstractRestrictionApi = void 0;
16
+ class AbstractRestrictionApi {
17
+ // #endregion Properties (1)
18
+ // #region Constructors (1)
19
+ constructor(restriction) {
20
+ // #region Properties (1)
21
+ _AbstractRestrictionApi_restriction.set(this, void 0);
22
+ __classPrivateFieldSet(this, _AbstractRestrictionApi_restriction, restriction, "f");
23
+ }
24
+ // #endregion Constructors (1)
25
+ // #region Public Getters And Setters (5)
26
+ get enabled() {
27
+ return __classPrivateFieldGet(this, _AbstractRestrictionApi_restriction, "f").enabled;
28
+ }
29
+ set enabled(value) {
30
+ __classPrivateFieldGet(this, _AbstractRestrictionApi_restriction, "f").enabled = value;
31
+ }
32
+ get id() {
33
+ return __classPrivateFieldGet(this, _AbstractRestrictionApi_restriction, "f").id;
34
+ }
35
+ }
36
+ exports.AbstractRestrictionApi = AbstractRestrictionApi;
37
+ _AbstractRestrictionApi_restriction = new WeakMap();
38
+ //# sourceMappingURL=AbstractRestrictionApi.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AbstractRestrictionApi.js","sourceRoot":"","sources":["../../../../src/api/implementation/restrictions/AbstractRestrictionApi.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAGA,MAAsB,sBAAsB;IAKxC,4BAA4B;IAE5B,2BAA2B;IAE3B,YAAY,WAA6B;QARzC,yBAAyB;QAEzB,sDAAwC;QAOpC,uBAAA,IAAI,uCAAgB,WAAW,MAAA,CAAC;IACpC,CAAC;IAED,8BAA8B;IAE9B,yCAAyC;IAEzC,IAAW,OAAO;QACd,OAAO,uBAAA,IAAI,2CAAa,CAAC,OAAO,CAAC;IACrC,CAAC;IAED,IAAW,OAAO,CAAC,KAAc;QAC7B,uBAAA,IAAI,2CAAa,CAAC,OAAO,GAAG,KAAK,CAAC;IACtC,CAAC;IAED,IAAW,EAAE;QACT,OAAO,uBAAA,IAAI,2CAAa,CAAC,EAAE,CAAC;IAChC,CAAC;CAGJ;AA9BD,wDA8BC"}
@@ -0,0 +1,11 @@
1
+ import { ISnapRestriction } from '../../../business/interfaces/ISnapRestriction';
2
+ import { ISnapRestrictionApi } from '../../interfaces/ISnapRestrictionApi';
3
+ import { AbstractRestrictionApi } from './AbstractRestrictionApi';
4
+ export declare abstract class AbstractSnapRestrictionApi extends AbstractRestrictionApi implements ISnapRestrictionApi {
5
+ #private;
6
+ constructor(restriction: ISnapRestriction);
7
+ get enabledEditable(): boolean;
8
+ get priority(): number;
9
+ set priority(value: number);
10
+ }
11
+ //# sourceMappingURL=AbstractSnapRestrictionApi.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AbstractSnapRestrictionApi.d.ts","sourceRoot":"","sources":["../../../../src/api/implementation/restrictions/AbstractSnapRestrictionApi.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,+CAA+C,CAAC;AACjF,OAAO,EAAE,mBAAmB,EAAE,MAAM,sCAAsC,CAAC;AAC3E,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAElE,8BAAsB,0BAA2B,SAAQ,sBAAuB,YAAW,mBAAmB;;gBAS9F,WAAW,EAAE,gBAAgB;IASzC,IAAW,eAAe,IAAI,OAAO,CAEpC;IAED,IAAW,QAAQ,IAAI,MAAM,CAE5B;IAED,IAAW,QAAQ,CAAC,KAAK,EAAE,MAAM,EAEhC;CAGJ"}
@@ -0,0 +1,40 @@
1
+ "use strict";
2
+ var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
3
+ if (kind === "m") throw new TypeError("Private method is not writable");
4
+ if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
5
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
6
+ return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
7
+ };
8
+ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
9
+ if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
10
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
11
+ return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
12
+ };
13
+ var _AbstractSnapRestrictionApi_restriction;
14
+ Object.defineProperty(exports, "__esModule", { value: true });
15
+ exports.AbstractSnapRestrictionApi = void 0;
16
+ const AbstractRestrictionApi_1 = require("./AbstractRestrictionApi");
17
+ class AbstractSnapRestrictionApi extends AbstractRestrictionApi_1.AbstractRestrictionApi {
18
+ // #endregion Properties (1)
19
+ // #region Constructors (1)
20
+ constructor(restriction) {
21
+ super(restriction);
22
+ // #region Properties (1)
23
+ _AbstractSnapRestrictionApi_restriction.set(this, void 0);
24
+ __classPrivateFieldSet(this, _AbstractSnapRestrictionApi_restriction, restriction, "f");
25
+ }
26
+ // #endregion Constructors (1)
27
+ // #region Public Getters And Setters (3)
28
+ get enabledEditable() {
29
+ return __classPrivateFieldGet(this, _AbstractSnapRestrictionApi_restriction, "f").enabledEditable;
30
+ }
31
+ get priority() {
32
+ return __classPrivateFieldGet(this, _AbstractSnapRestrictionApi_restriction, "f").priority;
33
+ }
34
+ set priority(value) {
35
+ __classPrivateFieldGet(this, _AbstractSnapRestrictionApi_restriction, "f").priority = value;
36
+ }
37
+ }
38
+ exports.AbstractSnapRestrictionApi = AbstractSnapRestrictionApi;
39
+ _AbstractSnapRestrictionApi_restriction = new WeakMap();
40
+ //# sourceMappingURL=AbstractSnapRestrictionApi.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AbstractSnapRestrictionApi.js","sourceRoot":"","sources":["../../../../src/api/implementation/restrictions/AbstractSnapRestrictionApi.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAEA,qEAAkE;AAElE,MAAsB,0BAA2B,SAAQ,+CAAsB;IAK3E,4BAA4B;IAE5B,2BAA2B;IAE3B,YAAY,WAA6B;QACrC,KAAK,CAAC,WAAW,CAAC,CAAC;QATvB,yBAAyB;QAEzB,0DAAwC;QAQpC,uBAAA,IAAI,2CAAgB,WAAW,MAAA,CAAC;IACpC,CAAC;IAED,8BAA8B;IAE9B,yCAAyC;IAEzC,IAAW,eAAe;QACtB,OAAO,uBAAA,IAAI,+CAAa,CAAC,eAAe,CAAC;IAC7C,CAAC;IAED,IAAW,QAAQ;QACf,OAAO,uBAAA,IAAI,+CAAa,CAAC,QAAQ,CAAC;IACtC,CAAC;IAED,IAAW,QAAQ,CAAC,KAAa;QAC7B,uBAAA,IAAI,+CAAa,CAAC,QAAQ,GAAG,KAAK,CAAC;IACvC,CAAC;CAGJ;AA/BD,gEA+BC"}
@@ -0,0 +1,7 @@
1
+ import { AbstractRestrictionApi } from '../AbstractRestrictionApi';
2
+ import { AxisRestriction } from '../../../../business/implementation/managers/interaction/restrictions/axis/AxisRestriction';
3
+ export declare class AxisRestrictionApi extends AbstractRestrictionApi {
4
+ #private;
5
+ constructor(restriction: AxisRestriction);
6
+ }
7
+ //# sourceMappingURL=AxisRestrictionApi.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AxisRestrictionApi.d.ts","sourceRoot":"","sources":["../../../../../src/api/implementation/restrictions/axis/AxisRestrictionApi.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,2BAA2B,CAAC;AACnE,OAAO,EAAE,eAAe,EAAE,MAAM,4FAA4F,CAAC;AAE7H,qBAAa,kBAAmB,SAAQ,sBAAsB;;gBAS9C,WAAW,EAAE,eAAe;CAM3C"}
@@ -0,0 +1,24 @@
1
+ "use strict";
2
+ var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
3
+ if (kind === "m") throw new TypeError("Private method is not writable");
4
+ if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
5
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
6
+ return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
7
+ };
8
+ var _AxisRestrictionApi_axisRestriction;
9
+ Object.defineProperty(exports, "__esModule", { value: true });
10
+ exports.AxisRestrictionApi = void 0;
11
+ const AbstractRestrictionApi_1 = require("../AbstractRestrictionApi");
12
+ class AxisRestrictionApi extends AbstractRestrictionApi_1.AbstractRestrictionApi {
13
+ // #endregion Properties (1)
14
+ // #region Constructors (1)
15
+ constructor(restriction) {
16
+ super(restriction);
17
+ // #region Properties (1)
18
+ _AxisRestrictionApi_axisRestriction.set(this, void 0);
19
+ __classPrivateFieldSet(this, _AxisRestrictionApi_axisRestriction, restriction, "f");
20
+ }
21
+ }
22
+ exports.AxisRestrictionApi = AxisRestrictionApi;
23
+ _AxisRestrictionApi_axisRestriction = new WeakMap();
24
+ //# sourceMappingURL=AxisRestrictionApi.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AxisRestrictionApi.js","sourceRoot":"","sources":["../../../../../src/api/implementation/restrictions/axis/AxisRestrictionApi.ts"],"names":[],"mappings":";;;;;;;;;;AAAA,sEAAmE;AAGnE,MAAa,kBAAmB,SAAQ,+CAAsB;IAK1D,4BAA4B;IAE5B,2BAA2B;IAE3B,YAAY,WAA4B;QACpC,KAAK,CAAC,WAAW,CAAC,CAAC;QATvB,yBAAyB;QAEzB,sDAA2C;QAQvC,uBAAA,IAAI,uCAAoB,WAAW,MAAA,CAAC;IACxC,CAAC;CAGJ;AAfD,gDAeC"}
@@ -0,0 +1,15 @@
1
+ import { AbstractRestrictionApi } from '../AbstractRestrictionApi';
2
+ import { GeometryRestriction } from '../../../../business/implementation/managers/interaction/restrictions/geometry/GeometryRestriction';
3
+ import { ITreeNode } from '@shapediver/viewer.shared.node-tree';
4
+ export declare class GeometryRestrictionApi extends AbstractRestrictionApi {
5
+ #private;
6
+ constructor(restriction: GeometryRestriction);
7
+ get snapToEdges(): boolean;
8
+ set snapToEdges(value: boolean);
9
+ get snapToFaces(): boolean;
10
+ set snapToFaces(value: boolean);
11
+ get snapToVertices(): boolean;
12
+ set snapToVertices(value: boolean);
13
+ updateNodes(nodes: ITreeNode[]): void;
14
+ }
15
+ //# sourceMappingURL=GeometryRestrictionApi.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GeometryRestrictionApi.d.ts","sourceRoot":"","sources":["../../../../../src/api/implementation/restrictions/geometry/GeometryRestrictionApi.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,2BAA2B,CAAC;AACnE,OAAO,EAAE,mBAAmB,EAAE,MAAM,oGAAoG,CAAC;AACzI,OAAO,EAAE,SAAS,EAAE,MAAM,qCAAqC,CAAC;AAEhE,qBAAa,sBAAuB,SAAQ,sBAAsB;;gBASlD,WAAW,EAAE,mBAAmB;IAS5C,IAAW,WAAW,IAAI,OAAO,CAEhC;IAED,IAAW,WAAW,CAAC,KAAK,EAAE,OAAO,EAEpC;IAED,IAAW,WAAW,IAAI,OAAO,CAEhC;IAED,IAAW,WAAW,CAAC,KAAK,EAAE,OAAO,EAEpC;IAED,IAAW,cAAc,IAAI,OAAO,CAEnC;IAED,IAAW,cAAc,CAAC,KAAK,EAAE,OAAO,EAEvC;IAMM,WAAW,CAAC,KAAK,EAAE,SAAS,EAAE,GAAG,IAAI;CAK/C"}
@@ -0,0 +1,54 @@
1
+ "use strict";
2
+ var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
3
+ if (kind === "m") throw new TypeError("Private method is not writable");
4
+ if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
5
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
6
+ return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
7
+ };
8
+ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
9
+ if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
10
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
11
+ return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
12
+ };
13
+ var _GeometryRestrictionApi_geometryRestriction;
14
+ Object.defineProperty(exports, "__esModule", { value: true });
15
+ exports.GeometryRestrictionApi = void 0;
16
+ const AbstractRestrictionApi_1 = require("../AbstractRestrictionApi");
17
+ class GeometryRestrictionApi extends AbstractRestrictionApi_1.AbstractRestrictionApi {
18
+ // #endregion Properties (1)
19
+ // #region Constructors (1)
20
+ constructor(restriction) {
21
+ super(restriction);
22
+ // #region Properties (1)
23
+ _GeometryRestrictionApi_geometryRestriction.set(this, void 0);
24
+ __classPrivateFieldSet(this, _GeometryRestrictionApi_geometryRestriction, restriction, "f");
25
+ }
26
+ // #endregion Constructors (1)
27
+ // #region Public Getters And Setters (6)
28
+ get snapToEdges() {
29
+ return __classPrivateFieldGet(this, _GeometryRestrictionApi_geometryRestriction, "f").snapToEdges;
30
+ }
31
+ set snapToEdges(value) {
32
+ __classPrivateFieldGet(this, _GeometryRestrictionApi_geometryRestriction, "f").snapToEdges = value;
33
+ }
34
+ get snapToFaces() {
35
+ return __classPrivateFieldGet(this, _GeometryRestrictionApi_geometryRestriction, "f").snapToFaces;
36
+ }
37
+ set snapToFaces(value) {
38
+ __classPrivateFieldGet(this, _GeometryRestrictionApi_geometryRestriction, "f").snapToFaces = value;
39
+ }
40
+ get snapToVertices() {
41
+ return __classPrivateFieldGet(this, _GeometryRestrictionApi_geometryRestriction, "f").snapToVertices;
42
+ }
43
+ set snapToVertices(value) {
44
+ __classPrivateFieldGet(this, _GeometryRestrictionApi_geometryRestriction, "f").snapToVertices = value;
45
+ }
46
+ // #endregion Public Getters And Setters (6)
47
+ // #region Public Methods (1)
48
+ updateNodes(nodes) {
49
+ __classPrivateFieldGet(this, _GeometryRestrictionApi_geometryRestriction, "f").updateNodes(nodes);
50
+ }
51
+ }
52
+ exports.GeometryRestrictionApi = GeometryRestrictionApi;
53
+ _GeometryRestrictionApi_geometryRestriction = new WeakMap();
54
+ //# sourceMappingURL=GeometryRestrictionApi.js.map