@shapediver/viewer.features.drawing-tools 3.4.3 → 3.5.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 (148) hide show
  1. package/dist/api/implementation/DrawingToolsApi.d.ts +1 -2
  2. package/dist/api/implementation/DrawingToolsApi.d.ts.map +1 -1
  3. package/dist/api/implementation/DrawingToolsApi.js +21 -12
  4. package/dist/api/implementation/DrawingToolsApi.js.map +1 -1
  5. package/dist/api/interfaces/IDrawingToolsApi.d.ts +2 -6
  6. package/dist/api/interfaces/IDrawingToolsApi.d.ts.map +1 -1
  7. package/dist/business/implementation/DrawingToolsManager.d.ts +6 -8
  8. package/dist/business/implementation/DrawingToolsManager.d.ts.map +1 -1
  9. package/dist/business/implementation/DrawingToolsManager.js +14 -14
  10. package/dist/business/implementation/DrawingToolsManager.js.map +1 -1
  11. package/dist/business/implementation/managers/HistoryManager.d.ts +1 -2
  12. package/dist/business/implementation/managers/HistoryManager.d.ts.map +1 -1
  13. package/dist/business/implementation/managers/HistoryManager.js.map +1 -1
  14. package/dist/business/implementation/managers/TextVisualizationManager.d.ts +1 -2
  15. package/dist/business/implementation/managers/TextVisualizationManager.d.ts.map +1 -1
  16. package/dist/business/implementation/managers/TextVisualizationManager.js +8 -8
  17. package/dist/business/implementation/managers/TextVisualizationManager.js.map +1 -1
  18. package/dist/business/implementation/managers/geometry/GeometryManager.d.ts +3 -4
  19. package/dist/business/implementation/managers/geometry/GeometryManager.d.ts.map +1 -1
  20. package/dist/business/implementation/managers/geometry/GeometryManager.js +2 -2
  21. package/dist/business/implementation/managers/geometry/GeometryManager.js.map +1 -1
  22. package/dist/business/implementation/managers/geometry/helpers/GeometryManagerHelper.d.ts +2 -2
  23. package/dist/business/implementation/managers/geometry/helpers/GeometryManagerHelper.d.ts.map +1 -1
  24. package/dist/business/implementation/managers/geometry/helpers/GeometryManagerHelper.js +4 -0
  25. package/dist/business/implementation/managers/geometry/helpers/GeometryManagerHelper.js.map +1 -1
  26. package/dist/business/implementation/managers/interaction/InteractionManager.d.ts +3 -4
  27. package/dist/business/implementation/managers/interaction/InteractionManager.d.ts.map +1 -1
  28. package/dist/business/implementation/managers/interaction/InteractionManager.js +23 -7
  29. package/dist/business/implementation/managers/interaction/InteractionManager.js.map +1 -1
  30. package/dist/business/implementation/managers/interaction/handlers/DeletionInteractionHandler.js +1 -1
  31. package/dist/business/implementation/managers/interaction/handlers/DeletionInteractionHandler.js.map +1 -1
  32. package/dist/business/implementation/managers/interaction/handlers/InsertionInteractionHandler.d.ts +2 -0
  33. package/dist/business/implementation/managers/interaction/handlers/InsertionInteractionHandler.d.ts.map +1 -1
  34. package/dist/business/implementation/managers/interaction/handlers/InsertionInteractionHandler.js +30 -7
  35. package/dist/business/implementation/managers/interaction/handlers/InsertionInteractionHandler.js.map +1 -1
  36. package/dist/business/implementation/managers/interaction/handlers/MidPointInteractionHandler.js +1 -1
  37. package/dist/business/implementation/managers/interaction/handlers/MidPointInteractionHandler.js.map +1 -1
  38. package/dist/business/implementation/managers/interaction/helpers/InteractionManagerHelper.d.ts.map +1 -1
  39. package/dist/business/implementation/managers/interaction/helpers/InteractionManagerHelper.js +6 -3
  40. package/dist/business/implementation/managers/interaction/helpers/InteractionManagerHelper.js.map +1 -1
  41. package/dist/business/interfaces/IDrawingToolsManager.d.ts +6 -38
  42. package/dist/business/interfaces/IDrawingToolsManager.d.ts.map +1 -1
  43. package/dist/business/interfaces/IDrawingToolsManager.js.map +1 -1
  44. package/dist/index.d.ts +6 -15
  45. package/dist/index.d.ts.map +1 -1
  46. package/dist/index.js +11 -13
  47. package/dist/index.js.map +1 -1
  48. package/package.json +11 -10
  49. package/dist/api/implementation/restrictions/AbstractRestrictionApi.d.ts +0 -10
  50. package/dist/api/implementation/restrictions/AbstractRestrictionApi.d.ts.map +0 -1
  51. package/dist/api/implementation/restrictions/AbstractRestrictionApi.js +0 -38
  52. package/dist/api/implementation/restrictions/AbstractRestrictionApi.js.map +0 -1
  53. package/dist/api/implementation/restrictions/AbstractSnapRestrictionApi.d.ts +0 -11
  54. package/dist/api/implementation/restrictions/AbstractSnapRestrictionApi.d.ts.map +0 -1
  55. package/dist/api/implementation/restrictions/AbstractSnapRestrictionApi.js +0 -40
  56. package/dist/api/implementation/restrictions/AbstractSnapRestrictionApi.js.map +0 -1
  57. package/dist/api/implementation/restrictions/geometry/GeometryRestrictionApi.d.ts +0 -15
  58. package/dist/api/implementation/restrictions/geometry/GeometryRestrictionApi.d.ts.map +0 -1
  59. package/dist/api/implementation/restrictions/geometry/GeometryRestrictionApi.js +0 -54
  60. package/dist/api/implementation/restrictions/geometry/GeometryRestrictionApi.js.map +0 -1
  61. package/dist/api/implementation/restrictions/plane/PlaneRestrictionApi.d.ts +0 -20
  62. package/dist/api/implementation/restrictions/plane/PlaneRestrictionApi.d.ts.map +0 -1
  63. package/dist/api/implementation/restrictions/plane/PlaneRestrictionApi.js +0 -67
  64. package/dist/api/implementation/restrictions/plane/PlaneRestrictionApi.js.map +0 -1
  65. package/dist/api/implementation/restrictions/plane/snap/AngularRestrictionApi.d.ts +0 -10
  66. package/dist/api/implementation/restrictions/plane/snap/AngularRestrictionApi.d.ts.map +0 -1
  67. package/dist/api/implementation/restrictions/plane/snap/AngularRestrictionApi.js +0 -40
  68. package/dist/api/implementation/restrictions/plane/snap/AngularRestrictionApi.js.map +0 -1
  69. package/dist/api/implementation/restrictions/plane/snap/AxisRestrictionApi.d.ts +0 -7
  70. package/dist/api/implementation/restrictions/plane/snap/AxisRestrictionApi.d.ts.map +0 -1
  71. package/dist/api/implementation/restrictions/plane/snap/AxisRestrictionApi.js +0 -24
  72. package/dist/api/implementation/restrictions/plane/snap/AxisRestrictionApi.js.map +0 -1
  73. package/dist/api/implementation/restrictions/plane/snap/GridRestrictionApi.d.ts +0 -10
  74. package/dist/api/implementation/restrictions/plane/snap/GridRestrictionApi.d.ts.map +0 -1
  75. package/dist/api/implementation/restrictions/plane/snap/GridRestrictionApi.js +0 -40
  76. package/dist/api/implementation/restrictions/plane/snap/GridRestrictionApi.js.map +0 -1
  77. package/dist/api/interfaces/IRestrictionApi.d.ts +0 -11
  78. package/dist/api/interfaces/IRestrictionApi.d.ts.map +0 -1
  79. package/dist/api/interfaces/IRestrictionApi.js +0 -3
  80. package/dist/api/interfaces/IRestrictionApi.js.map +0 -1
  81. package/dist/api/interfaces/ISnapRestrictionApi.d.ts +0 -13
  82. package/dist/api/interfaces/ISnapRestrictionApi.d.ts.map +0 -1
  83. package/dist/api/interfaces/ISnapRestrictionApi.js +0 -3
  84. package/dist/api/interfaces/ISnapRestrictionApi.js.map +0 -1
  85. package/dist/business/implementation/managers/geometry/GeometryMathManager.d.ts +0 -82
  86. package/dist/business/implementation/managers/geometry/GeometryMathManager.d.ts.map +0 -1
  87. package/dist/business/implementation/managers/geometry/GeometryMathManager.js +0 -245
  88. package/dist/business/implementation/managers/geometry/GeometryMathManager.js.map +0 -1
  89. package/dist/business/implementation/managers/interaction/EventManager.d.ts +0 -26
  90. package/dist/business/implementation/managers/interaction/EventManager.d.ts.map +0 -1
  91. package/dist/business/implementation/managers/interaction/EventManager.js +0 -63
  92. package/dist/business/implementation/managers/interaction/EventManager.js.map +0 -1
  93. package/dist/business/implementation/managers/interaction/RestrictionManager.d.ts +0 -19
  94. package/dist/business/implementation/managers/interaction/RestrictionManager.d.ts.map +0 -1
  95. package/dist/business/implementation/managers/interaction/RestrictionManager.js +0 -113
  96. package/dist/business/implementation/managers/interaction/RestrictionManager.js.map +0 -1
  97. package/dist/business/implementation/managers/interaction/restrictions/AbstractRestriction.d.ts +0 -19
  98. package/dist/business/implementation/managers/interaction/restrictions/AbstractRestriction.d.ts.map +0 -1
  99. package/dist/business/implementation/managers/interaction/restrictions/AbstractRestriction.js +0 -105
  100. package/dist/business/implementation/managers/interaction/restrictions/AbstractRestriction.js.map +0 -1
  101. package/dist/business/implementation/managers/interaction/restrictions/AbstractSnapRestriction.d.ts +0 -31
  102. package/dist/business/implementation/managers/interaction/restrictions/AbstractSnapRestriction.d.ts.map +0 -1
  103. package/dist/business/implementation/managers/interaction/restrictions/AbstractSnapRestriction.js +0 -125
  104. package/dist/business/implementation/managers/interaction/restrictions/AbstractSnapRestriction.js.map +0 -1
  105. package/dist/business/implementation/managers/interaction/restrictions/geometry/GeometryRestriction.d.ts +0 -40
  106. package/dist/business/implementation/managers/interaction/restrictions/geometry/GeometryRestriction.d.ts.map +0 -1
  107. package/dist/business/implementation/managers/interaction/restrictions/geometry/GeometryRestriction.js +0 -257
  108. package/dist/business/implementation/managers/interaction/restrictions/geometry/GeometryRestriction.js.map +0 -1
  109. package/dist/business/implementation/managers/interaction/restrictions/plane/PlaneRestriction.d.ts +0 -66
  110. package/dist/business/implementation/managers/interaction/restrictions/plane/PlaneRestriction.d.ts.map +0 -1
  111. package/dist/business/implementation/managers/interaction/restrictions/plane/PlaneRestriction.js +0 -244
  112. package/dist/business/implementation/managers/interaction/restrictions/plane/PlaneRestriction.js.map +0 -1
  113. package/dist/business/implementation/managers/interaction/restrictions/plane/snap/AngularRestriction.d.ts +0 -39
  114. package/dist/business/implementation/managers/interaction/restrictions/plane/snap/AngularRestriction.d.ts.map +0 -1
  115. package/dist/business/implementation/managers/interaction/restrictions/plane/snap/AngularRestriction.js +0 -317
  116. package/dist/business/implementation/managers/interaction/restrictions/plane/snap/AngularRestriction.js.map +0 -1
  117. package/dist/business/implementation/managers/interaction/restrictions/plane/snap/AxisRestriction.d.ts +0 -27
  118. package/dist/business/implementation/managers/interaction/restrictions/plane/snap/AxisRestriction.d.ts.map +0 -1
  119. package/dist/business/implementation/managers/interaction/restrictions/plane/snap/AxisRestriction.js +0 -165
  120. package/dist/business/implementation/managers/interaction/restrictions/plane/snap/AxisRestriction.js.map +0 -1
  121. package/dist/business/implementation/managers/interaction/restrictions/plane/snap/GridRestriction.d.ts +0 -39
  122. package/dist/business/implementation/managers/interaction/restrictions/plane/snap/GridRestriction.d.ts.map +0 -1
  123. package/dist/business/implementation/managers/interaction/restrictions/plane/snap/GridRestriction.js +0 -212
  124. package/dist/business/implementation/managers/interaction/restrictions/plane/snap/GridRestriction.js.map +0 -1
  125. package/dist/business/implementation/utils/numberCleaner.d.ts +0 -2
  126. package/dist/business/implementation/utils/numberCleaner.d.ts.map +0 -1
  127. package/dist/business/implementation/utils/numberCleaner.js +0 -9
  128. package/dist/business/implementation/utils/numberCleaner.js.map +0 -1
  129. package/dist/business/interfaces/IManager.d.ts +0 -4
  130. package/dist/business/interfaces/IManager.d.ts.map +0 -1
  131. package/dist/business/interfaces/IManager.js +0 -3
  132. package/dist/business/interfaces/IManager.js.map +0 -1
  133. package/dist/business/interfaces/IRestriction.d.ts +0 -40
  134. package/dist/business/interfaces/IRestriction.d.ts.map +0 -1
  135. package/dist/business/interfaces/IRestriction.js +0 -12
  136. package/dist/business/interfaces/IRestriction.js.map +0 -1
  137. package/dist/business/interfaces/IRestrictionBase.d.ts +0 -19
  138. package/dist/business/interfaces/IRestrictionBase.d.ts.map +0 -1
  139. package/dist/business/interfaces/IRestrictionBase.js +0 -5
  140. package/dist/business/interfaces/IRestrictionBase.js.map +0 -1
  141. package/dist/business/interfaces/ISnapRestriction.d.ts +0 -52
  142. package/dist/business/interfaces/ISnapRestriction.d.ts.map +0 -1
  143. package/dist/business/interfaces/ISnapRestriction.js +0 -4
  144. package/dist/business/interfaces/ISnapRestriction.js.map +0 -1
  145. package/dist/three/CSS2DRenderer.d.ts +0 -32
  146. package/dist/three/CSS2DRenderer.d.ts.map +0 -1
  147. package/dist/three/CSS2DRenderer.js +0 -137
  148. package/dist/three/CSS2DRenderer.js.map +0 -1
@@ -1,257 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
25
- var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
26
- if (kind === "m") throw new TypeError("Private method is not writable");
27
- if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
28
- 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");
29
- return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
30
- };
31
- var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
32
- if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
33
- 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");
34
- return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
35
- };
36
- var _GeometryRestriction_eventEngine, _GeometryRestriction_rayCasterParams, _GeometryRestriction_raycaster, _GeometryRestriction_viewport, _GeometryRestriction_geometryMathManager, _GeometryRestriction_lineIntersectionPercentage, _GeometryRestriction_nodes, _GeometryRestriction_pointIntersectionPercentage, _GeometryRestriction_sceneBoundingSphereRadius, _GeometryRestriction_settings, _GeometryRestriction_snapRestrictions, _GeometryRestriction_snapToEdges, _GeometryRestriction_snapToFaces, _GeometryRestriction_snapToVertices, _GeometryRestriction_visualizationObject, _GeometryRestriction_wireframe, _GeometryRestriction_wireframeColor;
37
- Object.defineProperty(exports, "__esModule", { value: true });
38
- exports.GeometryRestriction = void 0;
39
- const THREE = __importStar(require("three"));
40
- const AbstractRestriction_1 = require("../AbstractRestriction");
41
- const viewer_shared_math_1 = require("@shapediver/viewer.shared.math");
42
- const viewer_shared_services_1 = require("@shapediver/viewer.shared.services");
43
- const gl_matrix_1 = require("gl-matrix");
44
- const viewer_1 = require("@shapediver/viewer");
45
- // #endregion Type aliases (1)
46
- // #region Classes (1)
47
- class GeometryRestriction extends AbstractRestriction_1.AbstractRestriction {
48
- // #endregion Properties (17)
49
- // #region Constructors (1)
50
- constructor(drawingToolsManager, id, properties) {
51
- var _a, _b;
52
- super(drawingToolsManager, id);
53
- // #region Properties (17)
54
- _GeometryRestriction_eventEngine.set(this, viewer_shared_services_1.EventEngine.instance);
55
- _GeometryRestriction_rayCasterParams.set(this, {
56
- Line: { threshold: 1 },
57
- Line2: { threshold: 1 },
58
- Points: { threshold: 1 },
59
- Mesh: {},
60
- LOD: {},
61
- Sprite: {}
62
- });
63
- _GeometryRestriction_raycaster.set(this, new THREE.Raycaster());
64
- _GeometryRestriction_viewport.set(this, void 0);
65
- _GeometryRestriction_geometryMathManager.set(this, void 0);
66
- _GeometryRestriction_lineIntersectionPercentage.set(this, 0.025);
67
- _GeometryRestriction_nodes.set(this, []);
68
- _GeometryRestriction_pointIntersectionPercentage.set(this, 0.025);
69
- _GeometryRestriction_sceneBoundingSphereRadius.set(this, 0);
70
- _GeometryRestriction_settings.set(this, void 0);
71
- _GeometryRestriction_snapRestrictions.set(this, {});
72
- _GeometryRestriction_snapToEdges.set(this, true);
73
- _GeometryRestriction_snapToFaces.set(this, true);
74
- _GeometryRestriction_snapToVertices.set(this, true);
75
- _GeometryRestriction_visualizationObject.set(this, new THREE.Object3D());
76
- _GeometryRestriction_wireframe.set(this, void 0);
77
- _GeometryRestriction_wireframeColor.set(this, void 0);
78
- __classPrivateFieldSet(this, _GeometryRestriction_viewport, drawingToolsManager.viewport, "f");
79
- __classPrivateFieldSet(this, _GeometryRestriction_settings, drawingToolsManager.settings, "f");
80
- __classPrivateFieldSet(this, _GeometryRestriction_geometryMathManager, drawingToolsManager.geometryMathManager, "f");
81
- __classPrivateFieldSet(this, _GeometryRestriction_wireframe, (_a = properties.wireframe) !== null && _a !== void 0 ? _a : true, "f");
82
- __classPrivateFieldSet(this, _GeometryRestriction_wireframeColor, (_b = properties.wireframeColor) !== null && _b !== void 0 ? _b : __classPrivateFieldGet(this, _GeometryRestriction_settings, "f").visualization.points.color_1, "f");
83
- __classPrivateFieldSet(this, _GeometryRestriction_sceneBoundingSphereRadius, viewer_1.sceneTree.root.boundingBox.boundingSphere.radius, "f");
84
- this.updateIntersectionThresholds();
85
- __classPrivateFieldGet(this, _GeometryRestriction_eventEngine, "f").addListener(viewer_shared_services_1.EVENTTYPE.SCENE.SCENE_BOUNDING_BOX_CHANGE, (e) => {
86
- const event = e;
87
- if (event.viewportId === __classPrivateFieldGet(this, _GeometryRestriction_viewport, "f").id) {
88
- const boundingBox = new viewer_shared_math_1.Box(event.boundingBox.min, event.boundingBox.max);
89
- __classPrivateFieldSet(this, _GeometryRestriction_sceneBoundingSphereRadius, boundingBox.boundingSphere.radius, "f");
90
- this.updateIntersectionThresholds();
91
- }
92
- });
93
- this.updateNodes(properties.nodes);
94
- }
95
- // #endregion Constructors (1)
96
- // #region Public Getters And Setters (8)
97
- get priority() {
98
- return 0;
99
- }
100
- get snapRestrictions() {
101
- return __classPrivateFieldGet(this, _GeometryRestriction_snapRestrictions, "f");
102
- }
103
- get snapToEdges() {
104
- return __classPrivateFieldGet(this, _GeometryRestriction_snapToEdges, "f");
105
- }
106
- set snapToEdges(value) {
107
- __classPrivateFieldSet(this, _GeometryRestriction_snapToEdges, value, "f");
108
- }
109
- get snapToFaces() {
110
- return __classPrivateFieldGet(this, _GeometryRestriction_snapToFaces, "f");
111
- }
112
- set snapToFaces(value) {
113
- __classPrivateFieldSet(this, _GeometryRestriction_snapToFaces, value, "f");
114
- }
115
- get snapToVertices() {
116
- return __classPrivateFieldGet(this, _GeometryRestriction_snapToVertices, "f");
117
- }
118
- set snapToVertices(value) {
119
- __classPrivateFieldSet(this, _GeometryRestriction_snapToVertices, value, "f");
120
- }
121
- // #endregion Public Getters And Setters (8)
122
- // #region Public Methods (2)
123
- rayTrace(ray, metaData) {
124
- if (this.enabled === false)
125
- return;
126
- if (__classPrivateFieldGet(this, _GeometryRestriction_snapToVertices, "f") === false && __classPrivateFieldGet(this, _GeometryRestriction_snapToEdges, "f") === false && __classPrivateFieldGet(this, _GeometryRestriction_snapToFaces, "f") === false)
127
- return;
128
- // assign raycaster parameters
129
- __classPrivateFieldGet(this, _GeometryRestriction_raycaster, "f").params = __classPrivateFieldGet(this, _GeometryRestriction_rayCasterParams, "f");
130
- __classPrivateFieldGet(this, _GeometryRestriction_raycaster, "f").ray.direction.set(ray.direction[0], ray.direction[1], ray.direction[2]);
131
- __classPrivateFieldGet(this, _GeometryRestriction_raycaster, "f").ray.origin.set(ray.origin[0], ray.origin[1], ray.origin[2]);
132
- // intersect all nodes
133
- let intersections = [];
134
- __classPrivateFieldGet(this, _GeometryRestriction_nodes, "f").forEach(node => {
135
- const threeJsObject = node.convertedObject[__classPrivateFieldGet(this, _GeometryRestriction_viewport, "f").id];
136
- if (threeJsObject) {
137
- const currentIntersections = __classPrivateFieldGet(this, _GeometryRestriction_raycaster, "f").intersectObject(threeJsObject);
138
- intersections = intersections.concat(currentIntersections);
139
- }
140
- });
141
- // sort
142
- intersections.sort((a, b) => a.distance - b.distance);
143
- // return first intersection
144
- if (intersections.length > 0) {
145
- const object = intersections[0].object;
146
- const geometry = object.geometry;
147
- const positionAttribute = geometry.getAttribute('position');
148
- if (object instanceof THREE.Points && intersections[0].index !== undefined) {
149
- if (!__classPrivateFieldGet(this, _GeometryRestriction_snapToVertices, "f"))
150
- return;
151
- const vertex = new THREE.Vector3();
152
- vertex.fromBufferAttribute(positionAttribute, intersections[0].index);
153
- object.localToWorld(vertex);
154
- return gl_matrix_1.vec3.fromValues(vertex.x, vertex.y, vertex.z);
155
- }
156
- const intersectionPoint = intersections[0].point;
157
- const intersectionPointVec3 = gl_matrix_1.vec3.fromValues(intersectionPoint.x, intersectionPoint.y, intersectionPoint.z);
158
- if (!intersections[0].face)
159
- return intersectionPointVec3;
160
- if (__classPrivateFieldGet(this, _GeometryRestriction_snapToVertices, "f") === true || __classPrivateFieldGet(this, _GeometryRestriction_snapToEdges, "f") === true) {
161
- const vertexA = new THREE.Vector3();
162
- vertexA.fromBufferAttribute(positionAttribute, intersections[0].face.a);
163
- object.localToWorld(vertexA);
164
- const vertexAVec3 = gl_matrix_1.vec3.fromValues(vertexA.x, vertexA.y, vertexA.z);
165
- const vertexB = new THREE.Vector3();
166
- vertexB.fromBufferAttribute(positionAttribute, intersections[0].face.b);
167
- object.localToWorld(vertexB);
168
- const vertexBVec3 = gl_matrix_1.vec3.fromValues(vertexB.x, vertexB.y, vertexB.z);
169
- const vertexC = new THREE.Vector3();
170
- vertexC.fromBufferAttribute(positionAttribute, intersections[0].face.c);
171
- object.localToWorld(vertexC);
172
- const vertexCVec3 = gl_matrix_1.vec3.fromValues(vertexC.x, vertexC.y, vertexC.z);
173
- if (__classPrivateFieldGet(this, _GeometryRestriction_snapToVertices, "f") === true) {
174
- const distanceA = __classPrivateFieldGet(this, _GeometryRestriction_geometryMathManager, "f").screenSpaceDistanceCheck(intersectionPointVec3, vertexAVec3, __classPrivateFieldGet(this, _GeometryRestriction_settings, "f").visualization.points.size_0 * __classPrivateFieldGet(this, _GeometryRestriction_settings, "f").visualization.distanceMultiplicationFactor);
175
- const distanceB = __classPrivateFieldGet(this, _GeometryRestriction_geometryMathManager, "f").screenSpaceDistanceCheck(intersectionPointVec3, vertexBVec3, __classPrivateFieldGet(this, _GeometryRestriction_settings, "f").visualization.points.size_0 * __classPrivateFieldGet(this, _GeometryRestriction_settings, "f").visualization.distanceMultiplicationFactor);
176
- const distanceC = __classPrivateFieldGet(this, _GeometryRestriction_geometryMathManager, "f").screenSpaceDistanceCheck(intersectionPointVec3, vertexCVec3, __classPrivateFieldGet(this, _GeometryRestriction_settings, "f").visualization.points.size_0 * __classPrivateFieldGet(this, _GeometryRestriction_settings, "f").visualization.distanceMultiplicationFactor);
177
- // part 1 - check if the intersection point is close to a vertex
178
- if (distanceA.check && distanceA.distanceSquared < distanceB.distanceSquared && distanceA.distanceSquared < distanceC.distanceSquared) {
179
- return gl_matrix_1.vec3.fromValues(vertexA.x, vertexA.y, vertexA.z);
180
- }
181
- else if (distanceB.check && distanceB.distanceSquared < distanceA.distanceSquared && distanceB.distanceSquared < distanceC.distanceSquared) {
182
- return gl_matrix_1.vec3.fromValues(vertexB.x, vertexB.y, vertexB.z);
183
- }
184
- else if (distanceC.check && distanceC.distanceSquared < distanceA.distanceSquared && distanceC.distanceSquared < distanceB.distanceSquared) {
185
- return gl_matrix_1.vec3.fromValues(vertexC.x, vertexC.y, vertexC.z);
186
- }
187
- }
188
- if (__classPrivateFieldGet(this, _GeometryRestriction_snapToEdges, "f") === true) {
189
- // part 2 - check if the intersection point is close to an edge
190
- // create the closest points on the edges
191
- const closestPointOnEdgeAB = __classPrivateFieldGet(this, _GeometryRestriction_geometryMathManager, "f").closestPointOnLine(vertexAVec3, vertexBVec3, intersectionPointVec3);
192
- const closestPointOnEdgeBC = __classPrivateFieldGet(this, _GeometryRestriction_geometryMathManager, "f").closestPointOnLine(vertexBVec3, vertexCVec3, intersectionPointVec3);
193
- const closestPointOnEdgeCA = __classPrivateFieldGet(this, _GeometryRestriction_geometryMathManager, "f").closestPointOnLine(vertexCVec3, vertexAVec3, intersectionPointVec3);
194
- // create the distances
195
- const distanceAB = __classPrivateFieldGet(this, _GeometryRestriction_geometryMathManager, "f").screenSpaceDistanceCheck(intersectionPointVec3, closestPointOnEdgeAB, __classPrivateFieldGet(this, _GeometryRestriction_settings, "f").visualization.points.size_0 * __classPrivateFieldGet(this, _GeometryRestriction_settings, "f").visualization.distanceMultiplicationFactor);
196
- const distanceBC = __classPrivateFieldGet(this, _GeometryRestriction_geometryMathManager, "f").screenSpaceDistanceCheck(intersectionPointVec3, closestPointOnEdgeBC, __classPrivateFieldGet(this, _GeometryRestriction_settings, "f").visualization.points.size_0 * __classPrivateFieldGet(this, _GeometryRestriction_settings, "f").visualization.distanceMultiplicationFactor);
197
- const distanceCA = __classPrivateFieldGet(this, _GeometryRestriction_geometryMathManager, "f").screenSpaceDistanceCheck(intersectionPointVec3, closestPointOnEdgeCA, __classPrivateFieldGet(this, _GeometryRestriction_settings, "f").visualization.points.size_0 * __classPrivateFieldGet(this, _GeometryRestriction_settings, "f").visualization.distanceMultiplicationFactor);
198
- // check if the intersection point is close to an edge
199
- if (distanceAB.check && distanceAB.distanceSquared < distanceBC.distanceSquared && distanceAB.distanceSquared < distanceCA.distanceSquared) {
200
- return closestPointOnEdgeAB;
201
- }
202
- else if (distanceBC.check && distanceBC.distanceSquared < distanceAB.distanceSquared && distanceBC.distanceSquared < distanceCA.distanceSquared) {
203
- return closestPointOnEdgeBC;
204
- }
205
- else if (distanceCA.check && distanceCA.distanceSquared < distanceAB.distanceSquared && distanceCA.distanceSquared < distanceBC.distanceSquared) {
206
- return closestPointOnEdgeCA;
207
- }
208
- }
209
- }
210
- if (__classPrivateFieldGet(this, _GeometryRestriction_snapToFaces, "f") === true) {
211
- // part 3 - face intersection
212
- return gl_matrix_1.vec3.fromValues(intersectionPoint.x, intersectionPoint.y, intersectionPoint.z);
213
- }
214
- }
215
- return;
216
- }
217
- updateNodes(nodes) {
218
- __classPrivateFieldSet(this, _GeometryRestriction_nodes, nodes, "f");
219
- if (__classPrivateFieldGet(this, _GeometryRestriction_wireframe, "f")) {
220
- __classPrivateFieldGet(this, _GeometryRestriction_visualizationObject, "f").traverse((object) => {
221
- if (object instanceof THREE.LineSegments) {
222
- object.geometry.dispose();
223
- object.material.dispose();
224
- }
225
- });
226
- this._object3D.remove(__classPrivateFieldGet(this, _GeometryRestriction_visualizationObject, "f"));
227
- __classPrivateFieldSet(this, _GeometryRestriction_visualizationObject, new THREE.Object3D(), "f");
228
- __classPrivateFieldGet(this, _GeometryRestriction_nodes, "f").forEach(node => {
229
- const threeJsObject = node.convertedObject[__classPrivateFieldGet(this, _GeometryRestriction_viewport, "f").id];
230
- if (threeJsObject) {
231
- threeJsObject.traverse((object) => {
232
- if (object instanceof THREE.Mesh) {
233
- const wireframe = new THREE.WireframeGeometry(object.geometry);
234
- const line = new THREE.LineSegments(wireframe, new THREE.LineBasicMaterial({ color: new THREE.Color(__classPrivateFieldGet(this, _GeometryRestriction_wireframeColor, "f")) }));
235
- __classPrivateFieldGet(this, _GeometryRestriction_visualizationObject, "f").add(line);
236
- }
237
- });
238
- }
239
- });
240
- this._object3D.add(__classPrivateFieldGet(this, _GeometryRestriction_visualizationObject, "f"));
241
- }
242
- }
243
- // #endregion Public Methods (2)
244
- // #region Protected Methods (1)
245
- visibilityChanged() { }
246
- // #endregion Protected Methods (1)
247
- // #region Private Methods (1)
248
- updateIntersectionThresholds() {
249
- __classPrivateFieldGet(this, _GeometryRestriction_rayCasterParams, "f").Points.threshold = __classPrivateFieldGet(this, _GeometryRestriction_sceneBoundingSphereRadius, "f") * __classPrivateFieldGet(this, _GeometryRestriction_pointIntersectionPercentage, "f");
250
- __classPrivateFieldGet(this, _GeometryRestriction_rayCasterParams, "f").Line.threshold = __classPrivateFieldGet(this, _GeometryRestriction_sceneBoundingSphereRadius, "f") * __classPrivateFieldGet(this, _GeometryRestriction_lineIntersectionPercentage, "f");
251
- __classPrivateFieldGet(this, _GeometryRestriction_rayCasterParams, "f").Line2.threshold = __classPrivateFieldGet(this, _GeometryRestriction_sceneBoundingSphereRadius, "f") * __classPrivateFieldGet(this, _GeometryRestriction_lineIntersectionPercentage, "f");
252
- }
253
- }
254
- exports.GeometryRestriction = GeometryRestriction;
255
- _GeometryRestriction_eventEngine = new WeakMap(), _GeometryRestriction_rayCasterParams = new WeakMap(), _GeometryRestriction_raycaster = new WeakMap(), _GeometryRestriction_viewport = new WeakMap(), _GeometryRestriction_geometryMathManager = new WeakMap(), _GeometryRestriction_lineIntersectionPercentage = new WeakMap(), _GeometryRestriction_nodes = new WeakMap(), _GeometryRestriction_pointIntersectionPercentage = new WeakMap(), _GeometryRestriction_sceneBoundingSphereRadius = new WeakMap(), _GeometryRestriction_settings = new WeakMap(), _GeometryRestriction_snapRestrictions = new WeakMap(), _GeometryRestriction_snapToEdges = new WeakMap(), _GeometryRestriction_snapToFaces = new WeakMap(), _GeometryRestriction_snapToVertices = new WeakMap(), _GeometryRestriction_visualizationObject = new WeakMap(), _GeometryRestriction_wireframe = new WeakMap(), _GeometryRestriction_wireframeColor = new WeakMap();
256
- // #endregion Classes (1)
257
- //# sourceMappingURL=GeometryRestriction.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"GeometryRestriction.js","sourceRoot":"","sources":["../../../../../../../src/business/implementation/managers/interaction/restrictions/geometry/GeometryRestriction.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,6CAA+B;AAC/B,gEAA6D;AAC7D,uEAAqD;AAErD,+EAA4E;AAQ5E,yCAAiC;AACjC,+CAA+C;AAmB/C,8BAA8B;AAE9B,sBAAsB;AAEtB,MAAa,mBAAoB,SAAQ,yCAAmB;IA6BxD,6BAA6B;IAE7B,2BAA2B;IAE3B,YAAY,mBAAwC,EAAE,EAAU,EAAE,UAAyC;;QACvG,KAAK,CAAC,mBAAmB,EAAE,EAAE,CAAC,CAAC;QAjCnC,0BAA0B;QAE1B,2CAAqC,oCAAW,CAAC,QAAQ,EAAC;QAC1D,+CAAuD;YACnD,IAAI,EAAE,EAAE,SAAS,EAAE,CAAC,EAAE;YACtB,KAAK,EAAE,EAAE,SAAS,EAAE,CAAC,EAAE;YACvB,MAAM,EAAE,EAAE,SAAS,EAAE,CAAC,EAAE;YACxB,IAAI,EAAE,EAAE;YAC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,MAAM,CAAC,QAAQ,CAAC,CAAC;4BAC/D,MAAM,IAAI,GAAG,IAAI,KAAK,CAAC,YAAY,CAAC,SAAS,EAAE,IAAI,KAAK,CAAC,iBAAiB,CAAC,EAAE,KAAK,EAAE,IAAI,KAAK,CAAC,KAAK,CAAC,uBAAA,IAAI,2CAAgB,CAAC,EAAE,CAAC,CAAC,CAAC;4BAC9H,uBAAA,IAAI,gDAAqB,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;yBACvC;oBACL,CAAC,CAAC,CAAC;iBACN;YACL,CAAC,CAAC,CAAC;YACH,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,uBAAA,IAAI,gDAAqB,CAAC,CAAC;SACjD;IACL,CAAC;IAED,gCAAgC;IAEhC,gCAAgC;IAEtB,iBAAiB,KAAW,CAAC;IAEvC,mCAAmC;IAEnC,8BAA8B;IAEtB,4BAA4B;QAChC,uBAAA,IAAI,4CAAiB,CAAC,MAAM,CAAC,SAAS,GAAG,uBAAA,IAAI,sDAA2B,GAAG,uBAAA,IAAI,wDAA6B,CAAC;QAC7G,uBAAA,IAAI,4CAAiB,CAAC,IAAI,CAAC,SAAS,GAAG,uBAAA,IAAI,sDAA2B,GAAG,uBAAA,IAAI,uDAA4B,CAAC;QAC1G,uBAAA,IAAI,4CAAiB,CAAC,KAAM,CAAC,SAAS,GAAG,uBAAA,IAAI,sDAA2B,GAAG,uBAAA,IAAI,uDAA4B,CAAC;IAChH,CAAC;CAGJ;AAxPD,kDAwPC;;AAED,yBAAyB"}
@@ -1,66 +0,0 @@
1
- import { AbstractRestriction } from '../AbstractRestriction';
2
- import { AngularRestriction, AngularRestrictionProperties } from './snap/AngularRestriction';
3
- import { AxisRestriction, AxisRestrictionProperties } from './snap/AxisRestriction';
4
- import { DrawingToolsManager } from '../../../../DrawingToolsManager';
5
- import { GridRestriction, GridRestrictionProperties } from './snap/GridRestriction';
6
- import { IRay } from '@shapediver/viewer.features.interaction';
7
- import { IRestriction, RestrictionMetaData, RestrictionProperties } from '../../../../../interfaces/IRestriction';
8
- import { ISnapRestriction } from '../../../../../interfaces/ISnapRestriction';
9
- import { mat4, vec3 } from 'gl-matrix';
10
- export declare type PlaneRestrictionProperties = {
11
- /**
12
- * The origin of the plane.
13
- *
14
- * @default vec3.fromValues(0, 0, 0)
15
- */
16
- origin?: vec3;
17
- /**
18
- * Vector U of the plane
19
- * with the cross product of vector_u and vector_v the normal of the plane can be calculated
20
- */
21
- vector_u?: vec3;
22
- /**
23
- * Vector V of the plane
24
- * with the cross product of vector_u and vector_v the normal of the plane can be calculated
25
- */
26
- vector_v?: vec3;
27
- /**
28
- * grid snap restriction
29
- */
30
- gridSnapRestriction?: GridRestrictionProperties;
31
- /**
32
- * angular snap restriction
33
- */
34
- angularSnapRestriction?: AngularRestrictionProperties;
35
- /**
36
- * axis snap restriction
37
- */
38
- axisSnapRestriction?: AxisRestrictionProperties;
39
- } & RestrictionProperties;
40
- export declare class PlaneRestriction extends AbstractRestriction implements IRestriction {
41
- #private;
42
- constructor(drawingToolsManager: DrawingToolsManager, id: string, properties: PlaneRestrictionProperties);
43
- get angularRestriction(): AngularRestriction;
44
- get axisRestriction(): AxisRestriction;
45
- get gridRestriction(): GridRestriction;
46
- get normal(): vec3;
47
- get origin(): vec3;
48
- set origin(value: vec3);
49
- get priority(): number;
50
- get snapRestrictions(): {
51
- [key: string]: ISnapRestriction;
52
- };
53
- get transformationFromXYPlaneMatrix(): mat4;
54
- get transformationToXYPlaneMatrix(): mat4;
55
- get vectorU(): vec3;
56
- set vectorU(value: vec3);
57
- get vectorV(): vec3;
58
- set vectorV(value: vec3);
59
- rayTrace(ray: IRay, metaData?: RestrictionMetaData): vec3 | undefined;
60
- protected visibilityChanged(): void;
61
- private createDefaultPlane;
62
- private createTransformationMatrices;
63
- private snap;
64
- private updatePlaneDefinition;
65
- }
66
- //# sourceMappingURL=PlaneRestriction.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"PlaneRestriction.d.ts","sourceRoot":"","sources":["../../../../../../../src/business/implementation/managers/interaction/restrictions/plane/PlaneRestriction.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAC7D,OAAO,EAAE,kBAAkB,EAAE,4BAA4B,EAAE,MAAM,2BAA2B,CAAC;AAC7F,OAAO,EAAE,eAAe,EAAE,yBAAyB,EAAE,MAAM,wBAAwB,CAAC;AAOpF,OAAO,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AACtE,OAAO,EAAE,eAAe,EAAE,yBAAyB,EAAE,MAAM,wBAAwB,CAAC;AACpF,OAAO,EAAE,IAAI,EAAgB,MAAM,yCAAyC,CAAC;AAC7E,OAAO,EAAE,YAAY,EAAE,mBAAmB,EAAE,qBAAqB,EAAE,MAAM,wCAAwC,CAAC;AAClH,OAAO,EAAE,gBAAgB,EAAE,MAAM,4CAA4C,CAAC;AAC9E,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAKvC,oBAAY,0BAA0B,GAAG;IACrC;;;;OAIG;IACH,MAAM,CAAC,EAAE,IAAI,CAAA;IAEb;;;OAGG;IACH,QAAQ,CAAC,EAAE,IAAI,CAAC;IAEhB;;;OAGG;IACH,QAAQ,CAAC,EAAE,IAAI,CAAC;IAEhB;;OAEG;IACH,mBAAmB,CAAC,EAAE,yBAAyB,CAAC;IAEhD;;OAEG;IACH,sBAAsB,CAAC,EAAE,4BAA4B,CAAC;IAEtD;;OAEG;IACH,mBAAmB,CAAC,EAAE,yBAAyB,CAAC;CACnD,GAAG,qBAAqB,CAAC;AAM1B,qBAAa,gBAAiB,SAAQ,mBAAoB,YAAW,YAAY;;gBAuBjE,mBAAmB,EAAE,mBAAmB,EAAE,EAAE,EAAE,MAAM,EAAE,UAAU,EAAE,0BAA0B;IAyBxG,IAAW,kBAAkB,IAAI,kBAAkB,CAElD;IAED,IAAW,eAAe,IAAI,eAAe,CAE5C;IAED,IAAW,eAAe,IAAI,eAAe,CAE5C;IAED,IAAW,MAAM,IAAI,IAAI,CAExB;IAED,IAAW,MAAM,IAAI,IAAI,CAExB;IAED,IAAW,MAAM,CAAC,KAAK,EAAE,IAAI,EAG5B;IAED,IAAW,QAAQ,IAAI,MAAM,CAE5B;IAED,IAAW,gBAAgB,IAAI;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,gBAAgB,CAAC;KAAE,CAElE;IAED,IAAW,+BAA+B,IAAI,IAAI,CAEjD;IAED,IAAW,6BAA6B,IAAI,IAAI,CAE/C;IAED,IAAW,OAAO,IAAI,IAAI,CAEzB;IAED,IAAW,OAAO,CAAC,KAAK,EAAE,IAAI,EAG7B;IAED,IAAW,OAAO,IAAI,IAAI,CAEzB;IAED,IAAW,OAAO,CAAC,KAAK,EAAE,IAAI,EAG7B;IAMM,QAAQ,CAAC,GAAG,EAAE,IAAI,EAAE,QAAQ,CAAC,EAAE,mBAAmB,GAAG,IAAI,GAAG,SAAS;IAmB5E,SAAS,CAAC,iBAAiB,IAAI,IAAI;IAMnC,OAAO,CAAC,kBAAkB;IAqB1B,OAAO,CAAC,4BAA4B;IAuBpC,OAAO,CAAC,IAAI;IA4CZ,OAAO,CAAC,qBAAqB;CAmDhC"}
@@ -1,244 +0,0 @@
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 _PlaneRestriction_properties, _PlaneRestriction_uuidGenerator, _PlaneRestriction_viewport, _PlaneRestriction_angularRestriction, _PlaneRestriction_axisRestriction, _PlaneRestriction_cameraId, _PlaneRestriction_gridRestriction, _PlaneRestriction_normal, _PlaneRestriction_origin, _PlaneRestriction_snapRestrictions, _PlaneRestriction_transformationFromXYPlaneMatrix, _PlaneRestriction_transformationToXYPlaneMatrix, _PlaneRestriction_vectorU, _PlaneRestriction_vectorV;
14
- Object.defineProperty(exports, "__esModule", { value: true });
15
- exports.PlaneRestriction = void 0;
16
- const AbstractRestriction_1 = require("../AbstractRestriction");
17
- const AngularRestriction_1 = require("./snap/AngularRestriction");
18
- const AxisRestriction_1 = require("./snap/AxisRestriction");
19
- const viewer_1 = require("@shapediver/viewer");
20
- const GridRestriction_1 = require("./snap/GridRestriction");
21
- const gl_matrix_1 = require("gl-matrix");
22
- const viewer_shared_services_1 = require("@shapediver/viewer.shared.services");
23
- // #endregion Type aliases (1)
24
- // #region Classes (1)
25
- class PlaneRestriction extends AbstractRestriction_1.AbstractRestriction {
26
- // #endregion Properties (14)
27
- // #region Constructors (1)
28
- constructor(drawingToolsManager, id, properties) {
29
- super(drawingToolsManager, id);
30
- // #region Properties (14)
31
- _PlaneRestriction_properties.set(this, void 0);
32
- _PlaneRestriction_uuidGenerator.set(this, viewer_shared_services_1.UuidGenerator.instance);
33
- _PlaneRestriction_viewport.set(this, void 0);
34
- _PlaneRestriction_angularRestriction.set(this, void 0);
35
- _PlaneRestriction_axisRestriction.set(this, void 0);
36
- _PlaneRestriction_cameraId.set(this, '');
37
- _PlaneRestriction_gridRestriction.set(this, void 0);
38
- _PlaneRestriction_normal.set(this, gl_matrix_1.vec3.create());
39
- _PlaneRestriction_origin.set(this, gl_matrix_1.vec3.create());
40
- _PlaneRestriction_snapRestrictions.set(this, void 0);
41
- _PlaneRestriction_transformationFromXYPlaneMatrix.set(this, gl_matrix_1.mat4.create());
42
- _PlaneRestriction_transformationToXYPlaneMatrix.set(this, gl_matrix_1.mat4.create());
43
- _PlaneRestriction_vectorU.set(this, gl_matrix_1.vec3.create());
44
- _PlaneRestriction_vectorV.set(this, gl_matrix_1.vec3.create());
45
- __classPrivateFieldSet(this, _PlaneRestriction_viewport, drawingToolsManager.viewport, "f");
46
- __classPrivateFieldSet(this, _PlaneRestriction_cameraId, __classPrivateFieldGet(this, _PlaneRestriction_viewport, "f").camera.id, "f");
47
- __classPrivateFieldSet(this, _PlaneRestriction_properties, properties, "f");
48
- __classPrivateFieldSet(this, _PlaneRestriction_gridRestriction, new GridRestriction_1.GridRestriction(drawingToolsManager, this, __classPrivateFieldGet(this, _PlaneRestriction_properties, "f").gridSnapRestriction), "f");
49
- __classPrivateFieldSet(this, _PlaneRestriction_angularRestriction, new AngularRestriction_1.AngularRestriction(drawingToolsManager, this, __classPrivateFieldGet(this, _PlaneRestriction_properties, "f").angularSnapRestriction), "f");
50
- __classPrivateFieldSet(this, _PlaneRestriction_axisRestriction, new AxisRestriction_1.AxisRestriction(drawingToolsManager, this, __classPrivateFieldGet(this, _PlaneRestriction_properties, "f").axisSnapRestriction), "f");
51
- this.updatePlaneDefinition();
52
- __classPrivateFieldSet(this, _PlaneRestriction_snapRestrictions, {
53
- grid: __classPrivateFieldGet(this, _PlaneRestriction_gridRestriction, "f"),
54
- angular: __classPrivateFieldGet(this, _PlaneRestriction_angularRestriction, "f"),
55
- axis: __classPrivateFieldGet(this, _PlaneRestriction_axisRestriction, "f")
56
- }, "f");
57
- }
58
- // #endregion Constructors (1)
59
- // #region Public Getters And Setters (14)
60
- get angularRestriction() {
61
- return __classPrivateFieldGet(this, _PlaneRestriction_angularRestriction, "f");
62
- }
63
- get axisRestriction() {
64
- return __classPrivateFieldGet(this, _PlaneRestriction_axisRestriction, "f");
65
- }
66
- get gridRestriction() {
67
- return __classPrivateFieldGet(this, _PlaneRestriction_gridRestriction, "f");
68
- }
69
- get normal() {
70
- return __classPrivateFieldGet(this, _PlaneRestriction_normal, "f");
71
- }
72
- get origin() {
73
- return __classPrivateFieldGet(this, _PlaneRestriction_origin, "f");
74
- }
75
- set origin(value) {
76
- __classPrivateFieldSet(this, _PlaneRestriction_origin, value, "f");
77
- this.updatePlaneDefinition();
78
- }
79
- get priority() {
80
- return -1;
81
- }
82
- get snapRestrictions() {
83
- return __classPrivateFieldGet(this, _PlaneRestriction_snapRestrictions, "f");
84
- }
85
- get transformationFromXYPlaneMatrix() {
86
- return __classPrivateFieldGet(this, _PlaneRestriction_transformationFromXYPlaneMatrix, "f");
87
- }
88
- get transformationToXYPlaneMatrix() {
89
- return __classPrivateFieldGet(this, _PlaneRestriction_transformationToXYPlaneMatrix, "f");
90
- }
91
- get vectorU() {
92
- return __classPrivateFieldGet(this, _PlaneRestriction_vectorU, "f");
93
- }
94
- set vectorU(value) {
95
- __classPrivateFieldGet(this, _PlaneRestriction_properties, "f").vector_u = value;
96
- this.updatePlaneDefinition();
97
- }
98
- get vectorV() {
99
- return __classPrivateFieldGet(this, _PlaneRestriction_vectorV, "f");
100
- }
101
- set vectorV(value) {
102
- __classPrivateFieldGet(this, _PlaneRestriction_properties, "f").vector_v = value;
103
- this.updatePlaneDefinition();
104
- }
105
- // #endregion Public Getters And Setters (14)
106
- // #region Public Methods (1)
107
- rayTrace(ray, metaData) {
108
- if (this.enabled === false)
109
- return gl_matrix_1.vec3.create();
110
- if (__classPrivateFieldGet(this, _PlaneRestriction_cameraId, "f") !== __classPrivateFieldGet(this, _PlaneRestriction_viewport, "f").camera.id)
111
- this.updatePlaneDefinition();
112
- let origin = __classPrivateFieldGet(this, _PlaneRestriction_origin, "f");
113
- if (metaData === null || metaData === void 0 ? void 0 : metaData.referencePoint)
114
- origin = gl_matrix_1.vec3.sub(gl_matrix_1.vec3.create(), __classPrivateFieldGet(this, _PlaneRestriction_origin, "f"), gl_matrix_1.vec3.scale(gl_matrix_1.vec3.create(), __classPrivateFieldGet(this, _PlaneRestriction_normal, "f"), gl_matrix_1.vec3.dot(gl_matrix_1.vec3.sub(gl_matrix_1.vec3.create(), __classPrivateFieldGet(this, _PlaneRestriction_origin, "f"), metaData.referencePoint), __classPrivateFieldGet(this, _PlaneRestriction_normal, "f"))));
115
- // find intersection of ray and plane
116
- const t = (gl_matrix_1.vec3.dot(origin, __classPrivateFieldGet(this, _PlaneRestriction_normal, "f")) - gl_matrix_1.vec3.dot(ray.origin, __classPrivateFieldGet(this, _PlaneRestriction_normal, "f"))) / gl_matrix_1.vec3.dot(ray.direction, __classPrivateFieldGet(this, _PlaneRestriction_normal, "f"));
117
- const intersection = gl_matrix_1.vec3.add(gl_matrix_1.vec3.create(), ray.origin, gl_matrix_1.vec3.multiply(gl_matrix_1.vec3.create(), ray.direction, gl_matrix_1.vec3.fromValues(t, t, t)));
118
- return this.snap(ray, intersection, metaData);
119
- }
120
- // #endregion Public Methods (1)
121
- // #region Protected Methods (1)
122
- visibilityChanged() { }
123
- // #endregion Protected Methods (1)
124
- // #region Private Methods (4)
125
- createDefaultPlane(camera) {
126
- if (camera.type === viewer_1.CAMERA_TYPE.PERSPECTIVE ||
127
- (camera.type === viewer_1.CAMERA_TYPE.ORTHOGRAPHIC && camera.direction === viewer_1.ORTHOGRAPHIC_CAMERA_DIRECTION.CUSTOM)) {
128
- __classPrivateFieldSet(this, _PlaneRestriction_vectorU, gl_matrix_1.vec3.fromValues(1, 0, 0), "f");
129
- __classPrivateFieldSet(this, _PlaneRestriction_vectorV, gl_matrix_1.vec3.fromValues(0, 1, 0), "f");
130
- __classPrivateFieldSet(this, _PlaneRestriction_normal, gl_matrix_1.vec3.fromValues(0, 0, 1), "f");
131
- __classPrivateFieldSet(this, _PlaneRestriction_origin, gl_matrix_1.vec3.fromValues(0, 0, 0), "f");
132
- }
133
- else {
134
- const orthographicCamera = camera;
135
- const direction = gl_matrix_1.vec3.normalize(gl_matrix_1.vec3.create(), gl_matrix_1.vec3.sub(gl_matrix_1.vec3.create(), orthographicCamera.target, orthographicCamera.position));
136
- const up = orthographicCamera.direction === viewer_1.ORTHOGRAPHIC_CAMERA_DIRECTION.TOP || orthographicCamera.direction === viewer_1.ORTHOGRAPHIC_CAMERA_DIRECTION.BOTTOM ?
137
- gl_matrix_1.vec3.fromValues(0, 1, 0) : gl_matrix_1.vec3.fromValues(0, 0, 1);
138
- __classPrivateFieldSet(this, _PlaneRestriction_origin, gl_matrix_1.vec3.fromValues(0, 0, 0), "f");
139
- __classPrivateFieldSet(this, _PlaneRestriction_normal, gl_matrix_1.vec3.negate(gl_matrix_1.vec3.create(), direction), "f");
140
- __classPrivateFieldSet(this, _PlaneRestriction_vectorU, gl_matrix_1.vec3.clone(up), "f");
141
- __classPrivateFieldSet(this, _PlaneRestriction_vectorV, gl_matrix_1.vec3.normalize(gl_matrix_1.vec3.create(), gl_matrix_1.vec3.cross(gl_matrix_1.vec3.create(), __classPrivateFieldGet(this, _PlaneRestriction_normal, "f"), __classPrivateFieldGet(this, _PlaneRestriction_vectorU, "f"))), "f");
142
- }
143
- }
144
- createTransformationMatrices() {
145
- // Calculate the transformation matrix for the rotation
146
- const rotationMatrix = gl_matrix_1.mat4.fromValues(__classPrivateFieldGet(this, _PlaneRestriction_vectorU, "f")[0], __classPrivateFieldGet(this, _PlaneRestriction_vectorV, "f")[0], __classPrivateFieldGet(this, _PlaneRestriction_normal, "f")[0], 0, __classPrivateFieldGet(this, _PlaneRestriction_vectorU, "f")[1], __classPrivateFieldGet(this, _PlaneRestriction_vectorV, "f")[1], __classPrivateFieldGet(this, _PlaneRestriction_normal, "f")[1], 0, __classPrivateFieldGet(this, _PlaneRestriction_vectorU, "f")[2], __classPrivateFieldGet(this, _PlaneRestriction_vectorV, "f")[2], __classPrivateFieldGet(this, _PlaneRestriction_normal, "f")[2], 0, 0, 0, 0, 1);
147
- let rotationMatrixInverse = gl_matrix_1.mat4.invert(gl_matrix_1.mat4.create(), rotationMatrix);
148
- if (!rotationMatrixInverse)
149
- rotationMatrixInverse = gl_matrix_1.mat4.create();
150
- const pivotMatrix = gl_matrix_1.mat4.fromTranslation(gl_matrix_1.mat4.create(), gl_matrix_1.vec3.fromValues(__classPrivateFieldGet(this, _PlaneRestriction_origin, "f")[0], __classPrivateFieldGet(this, _PlaneRestriction_origin, "f")[1], __classPrivateFieldGet(this, _PlaneRestriction_origin, "f")[2]));
151
- const pivotMatrixInverse = gl_matrix_1.mat4.fromTranslation(gl_matrix_1.mat4.create(), gl_matrix_1.vec3.fromValues(-__classPrivateFieldGet(this, _PlaneRestriction_origin, "f")[0], -__classPrivateFieldGet(this, _PlaneRestriction_origin, "f")[1], -__classPrivateFieldGet(this, _PlaneRestriction_origin, "f")[2]));
152
- gl_matrix_1.mat4.multiply(__classPrivateFieldGet(this, _PlaneRestriction_transformationToXYPlaneMatrix, "f"), pivotMatrix, rotationMatrix);
153
- gl_matrix_1.mat4.multiply(__classPrivateFieldGet(this, _PlaneRestriction_transformationToXYPlaneMatrix, "f"), __classPrivateFieldGet(this, _PlaneRestriction_transformationToXYPlaneMatrix, "f"), pivotMatrixInverse);
154
- gl_matrix_1.mat4.multiply(__classPrivateFieldGet(this, _PlaneRestriction_transformationFromXYPlaneMatrix, "f"), pivotMatrix, rotationMatrixInverse);
155
- gl_matrix_1.mat4.multiply(__classPrivateFieldGet(this, _PlaneRestriction_transformationFromXYPlaneMatrix, "f"), __classPrivateFieldGet(this, _PlaneRestriction_transformationFromXYPlaneMatrix, "f"), pivotMatrixInverse);
156
- }
157
- snap(ray, point, metaData) {
158
- if (this.enabled === false)
159
- return;
160
- if (__classPrivateFieldGet(this, _PlaneRestriction_cameraId, "f") !== __classPrivateFieldGet(this, _PlaneRestriction_viewport, "f").camera.id)
161
- this.updatePlaneDefinition();
162
- const sortedSnapRestrictions = Object.values(__classPrivateFieldGet(this, _PlaneRestriction_snapRestrictions, "f")).sort((a, b) => b.priority - a.priority);
163
- // group snap restrictions by priority
164
- const groupedSnapRestrictions = {};
165
- for (const snapRestriction of sortedSnapRestrictions) {
166
- if (!groupedSnapRestrictions[snapRestriction.priority])
167
- groupedSnapRestrictions[snapRestriction.priority] = [];
168
- groupedSnapRestrictions[snapRestriction.priority].push(snapRestriction);
169
- }
170
- // call snap method for each group
171
- for (const snapRestrictions of Object.values(groupedSnapRestrictions)) {
172
- const results = [];
173
- for (const snapRestriction of snapRestrictions) {
174
- results.push(snapRestriction.snap(ray, point, metaData));
175
- }
176
- const indexedResults = results.map((value, index) => ({ index, value }));
177
- // find the result that is closest to the point and set the snap restriction to active
178
- indexedResults.sort((a, b) => {
179
- if (!a.value)
180
- return 1;
181
- if (!b.value)
182
- return -1;
183
- return gl_matrix_1.vec3.squaredDistance(point, a.value) - gl_matrix_1.vec3.squaredDistance(point, b.value);
184
- });
185
- for (const snapRestriction of snapRestrictions) {
186
- snapRestriction.active = false;
187
- }
188
- // if a snap restriction returned a result, return it
189
- if (indexedResults[0].value !== undefined) {
190
- snapRestrictions[indexedResults[0].index].active = true;
191
- return indexedResults[0].value;
192
- }
193
- }
194
- return point;
195
- }
196
- updatePlaneDefinition() {
197
- const camera = __classPrivateFieldGet(this, _PlaneRestriction_viewport, "f").camera;
198
- __classPrivateFieldSet(this, _PlaneRestriction_cameraId, camera.id, "f");
199
- const origin = __classPrivateFieldGet(this, _PlaneRestriction_properties, "f").origin ? gl_matrix_1.vec3.clone(__classPrivateFieldGet(this, _PlaneRestriction_properties, "f").origin) : gl_matrix_1.vec3.fromValues(0, 0, 0);
200
- const vectorU = __classPrivateFieldGet(this, _PlaneRestriction_properties, "f").vector_u ? gl_matrix_1.vec3.clone(__classPrivateFieldGet(this, _PlaneRestriction_properties, "f").vector_u) : undefined;
201
- const vectorV = __classPrivateFieldGet(this, _PlaneRestriction_properties, "f").vector_v ? gl_matrix_1.vec3.clone(__classPrivateFieldGet(this, _PlaneRestriction_properties, "f").vector_v) : undefined;
202
- const planeDefined = origin && vectorU && vectorV;
203
- let normal = gl_matrix_1.vec3.fromValues(0, 0, 1);
204
- if (planeDefined) {
205
- gl_matrix_1.vec3.normalize(vectorU, vectorU);
206
- gl_matrix_1.vec3.normalize(vectorV, vectorV);
207
- normal = gl_matrix_1.vec3.normalize(gl_matrix_1.vec3.create(), gl_matrix_1.vec3.cross(gl_matrix_1.vec3.create(), vectorU, vectorV));
208
- if (gl_matrix_1.vec3.dot(vectorU, vectorV) !== 0)
209
- gl_matrix_1.vec3.normalize(vectorV, gl_matrix_1.vec3.cross(gl_matrix_1.vec3.create(), normal, vectorU));
210
- if (camera.type === viewer_1.CAMERA_TYPE.ORTHOGRAPHIC) {
211
- const cameraApi = camera;
212
- const cameraDirection = gl_matrix_1.vec3.normalize(gl_matrix_1.vec3.create(), gl_matrix_1.vec3.sub(gl_matrix_1.vec3.create(), cameraApi.target, cameraApi.position));
213
- // if the dot product of the camera direction and the normal tells us that they are parallel
214
- // the plane is perpendicular to the camera direction
215
- if (Math.abs(gl_matrix_1.vec3.dot(cameraDirection, normal)) < 0.0001) {
216
- this.createDefaultPlane(camera);
217
- }
218
- else {
219
- __classPrivateFieldSet(this, _PlaneRestriction_vectorU, vectorU, "f");
220
- __classPrivateFieldSet(this, _PlaneRestriction_vectorV, vectorV, "f");
221
- __classPrivateFieldSet(this, _PlaneRestriction_normal, normal, "f");
222
- __classPrivateFieldSet(this, _PlaneRestriction_origin, origin, "f");
223
- }
224
- }
225
- else {
226
- __classPrivateFieldSet(this, _PlaneRestriction_vectorU, vectorU, "f");
227
- __classPrivateFieldSet(this, _PlaneRestriction_vectorV, vectorV, "f");
228
- __classPrivateFieldSet(this, _PlaneRestriction_normal, normal, "f");
229
- __classPrivateFieldSet(this, _PlaneRestriction_origin, origin, "f");
230
- }
231
- }
232
- else {
233
- this.createDefaultPlane(camera);
234
- }
235
- this.createTransformationMatrices();
236
- __classPrivateFieldGet(this, _PlaneRestriction_gridRestriction, "f").updatePlaneDefinition();
237
- __classPrivateFieldGet(this, _PlaneRestriction_angularRestriction, "f").updatePlaneDefinition();
238
- __classPrivateFieldGet(this, _PlaneRestriction_axisRestriction, "f").updatePlaneDefinition();
239
- }
240
- }
241
- exports.PlaneRestriction = PlaneRestriction;
242
- _PlaneRestriction_properties = new WeakMap(), _PlaneRestriction_uuidGenerator = new WeakMap(), _PlaneRestriction_viewport = new WeakMap(), _PlaneRestriction_angularRestriction = new WeakMap(), _PlaneRestriction_axisRestriction = new WeakMap(), _PlaneRestriction_cameraId = new WeakMap(), _PlaneRestriction_gridRestriction = new WeakMap(), _PlaneRestriction_normal = new WeakMap(), _PlaneRestriction_origin = new WeakMap(), _PlaneRestriction_snapRestrictions = new WeakMap(), _PlaneRestriction_transformationFromXYPlaneMatrix = new WeakMap(), _PlaneRestriction_transformationToXYPlaneMatrix = new WeakMap(), _PlaneRestriction_vectorU = new WeakMap(), _PlaneRestriction_vectorV = new WeakMap();
243
- // #endregion Classes (1)
244
- //# sourceMappingURL=PlaneRestriction.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"PlaneRestriction.js","sourceRoot":"","sources":["../../../../../../../src/business/implementation/managers/interaction/restrictions/plane/PlaneRestriction.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,gEAA6D;AAC7D,kEAA6F;AAC7F,4DAAoF;AACpF,+CAK4B;AAE5B,4DAAoF;AAIpF,yCAAuC;AACvC,+EAAmE;AAwCnE,8BAA8B;AAE9B,sBAAsB;AAEtB,MAAa,gBAAiB,SAAQ,yCAAmB;IAmBrD,6BAA6B;IAE7B,2BAA2B;IAE3B,YAAY,mBAAwC,EAAE,EAAU,EAAE,UAAsC;QACpG,KAAK,CAAC,mBAAmB,EAAE,EAAE,CAAC,CAAC;QAvBnC,0BAA0B;QAE1B,+CAAiD;QACjD,0CAA0B,sCAAa,CAAC,QAAQ,EAAC;QACjD,6CAAiC;QAEjC,uDAAwC;QACxC,oDAAkC;QAClC,qCAAoB,EAAE,EAAC;QACvB,oDAAkC;QAClC,mCAAgB,gBAAI,CAAC,MAAM,EAAE,EAAC;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