@shapediver/viewer.rendering-engine.intersection-restriction-engine 3.16.8 → 3.16.10

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 (95) hide show
  1. package/dist/api/implementation/AbstractRestrictionApi.d.ts +12 -12
  2. package/dist/api/implementation/AbstractRestrictionApi.js +46 -46
  3. package/dist/api/implementation/AbstractRestrictionApi.js.map +1 -1
  4. package/dist/api/implementation/AbstractSnapRestrictionApi.d.ts +12 -12
  5. package/dist/api/implementation/AbstractSnapRestrictionApi.js +46 -46
  6. package/dist/api/implementation/AbstractSnapRestrictionApi.js.map +1 -1
  7. package/dist/api/implementation/camera_plane/CameraPlaneRestrictionApi.d.ts +6 -6
  8. package/dist/api/implementation/camera_plane/CameraPlaneRestrictionApi.js +23 -23
  9. package/dist/api/implementation/camera_plane/CameraPlaneRestrictionApi.js.map +1 -1
  10. package/dist/api/implementation/geometry/GeometryRestrictionApi.d.ts +14 -14
  11. package/dist/api/implementation/geometry/GeometryRestrictionApi.js +53 -53
  12. package/dist/api/implementation/geometry/GeometryRestrictionApi.js.map +1 -1
  13. package/dist/api/implementation/line/LineRestrictionApi.d.ts +10 -10
  14. package/dist/api/implementation/line/LineRestrictionApi.js +39 -39
  15. package/dist/api/implementation/line/LineRestrictionApi.js.map +1 -1
  16. package/dist/api/implementation/plane/PlaneRestrictionApi.d.ts +19 -19
  17. package/dist/api/implementation/plane/PlaneRestrictionApi.js +66 -66
  18. package/dist/api/implementation/plane/PlaneRestrictionApi.js.map +1 -1
  19. package/dist/api/implementation/plane/snap/AngularRestrictionApi.d.ts +9 -9
  20. package/dist/api/implementation/plane/snap/AngularRestrictionApi.js +39 -39
  21. package/dist/api/implementation/plane/snap/AngularRestrictionApi.js.map +1 -1
  22. package/dist/api/implementation/plane/snap/AxisRestrictionApi.d.ts +6 -6
  23. package/dist/api/implementation/plane/snap/AxisRestrictionApi.js +23 -23
  24. package/dist/api/implementation/plane/snap/AxisRestrictionApi.js.map +1 -1
  25. package/dist/api/implementation/plane/snap/GridRestrictionApi.d.ts +9 -9
  26. package/dist/api/implementation/plane/snap/GridRestrictionApi.js +39 -39
  27. package/dist/api/implementation/plane/snap/GridRestrictionApi.js.map +1 -1
  28. package/dist/api/implementation/point/PointRestrictionApi.d.ts +9 -9
  29. package/dist/api/implementation/point/PointRestrictionApi.js +36 -36
  30. package/dist/api/implementation/point/PointRestrictionApi.js.map +1 -1
  31. package/dist/api/interfaces/IRestrictionApi.d.ts +10 -10
  32. package/dist/api/interfaces/IRestrictionApi.js +2 -2
  33. package/dist/api/interfaces/ISnapRestrictionApi.d.ts +12 -12
  34. package/dist/api/interfaces/ISnapRestrictionApi.js +2 -2
  35. package/dist/implementation/EventManager.d.ts +25 -25
  36. package/dist/implementation/EventManager.d.ts.map +1 -1
  37. package/dist/implementation/EventManager.js +62 -62
  38. package/dist/implementation/EventManager.js.map +1 -1
  39. package/dist/implementation/GeometryMathManager.d.ts +87 -87
  40. package/dist/implementation/GeometryMathManager.js +260 -260
  41. package/dist/implementation/GeometryMathManager.js.map +1 -1
  42. package/dist/implementation/RestrictionManager.d.ts +28 -28
  43. package/dist/implementation/RestrictionManager.js +323 -323
  44. package/dist/implementation/RestrictionManager.js.map +1 -1
  45. package/dist/implementation/restrictions/AbstractRestriction.d.ts +42 -42
  46. package/dist/implementation/restrictions/AbstractRestriction.js +164 -154
  47. package/dist/implementation/restrictions/AbstractRestriction.js.map +1 -1
  48. package/dist/implementation/restrictions/AbstractSnapRestriction.d.ts +35 -35
  49. package/dist/implementation/restrictions/AbstractSnapRestriction.js +150 -140
  50. package/dist/implementation/restrictions/AbstractSnapRestriction.js.map +1 -1
  51. package/dist/implementation/restrictions/RestrictionsHelper.d.ts +10 -10
  52. package/dist/implementation/restrictions/RestrictionsHelper.d.ts.map +1 -1
  53. package/dist/implementation/restrictions/RestrictionsHelper.js +50 -50
  54. package/dist/implementation/restrictions/RestrictionsHelper.js.map +1 -1
  55. package/dist/implementation/restrictions/camera_plane/CameraPlaneRestriction.d.ts +17 -17
  56. package/dist/implementation/restrictions/camera_plane/CameraPlaneRestriction.js +62 -62
  57. package/dist/implementation/restrictions/camera_plane/CameraPlaneRestriction.js.map +1 -1
  58. package/dist/implementation/restrictions/geometry/GeometryRestriction.d.ts +92 -92
  59. package/dist/implementation/restrictions/geometry/GeometryRestriction.js +410 -400
  60. package/dist/implementation/restrictions/geometry/GeometryRestriction.js.map +1 -1
  61. package/dist/implementation/restrictions/line/LineRestriction.d.ts +58 -58
  62. package/dist/implementation/restrictions/line/LineRestriction.js +291 -281
  63. package/dist/implementation/restrictions/line/LineRestriction.js.map +1 -1
  64. package/dist/implementation/restrictions/plane/PlaneRestriction.d.ts +65 -65
  65. package/dist/implementation/restrictions/plane/PlaneRestriction.js +306 -306
  66. package/dist/implementation/restrictions/plane/PlaneRestriction.js.map +1 -1
  67. package/dist/implementation/restrictions/plane/snap/AngularRestriction.d.ts +39 -39
  68. package/dist/implementation/restrictions/plane/snap/AngularRestriction.d.ts.map +1 -1
  69. package/dist/implementation/restrictions/plane/snap/AngularRestriction.js +346 -346
  70. package/dist/implementation/restrictions/plane/snap/AngularRestriction.js.map +1 -1
  71. package/dist/implementation/restrictions/plane/snap/AxisRestriction.d.ts +27 -27
  72. package/dist/implementation/restrictions/plane/snap/AxisRestriction.d.ts.map +1 -1
  73. package/dist/implementation/restrictions/plane/snap/AxisRestriction.js +239 -229
  74. package/dist/implementation/restrictions/plane/snap/AxisRestriction.js.map +1 -1
  75. package/dist/implementation/restrictions/plane/snap/GridRestriction.d.ts +39 -39
  76. package/dist/implementation/restrictions/plane/snap/GridRestriction.d.ts.map +1 -1
  77. package/dist/implementation/restrictions/plane/snap/GridRestriction.js +318 -308
  78. package/dist/implementation/restrictions/plane/snap/GridRestriction.js.map +1 -1
  79. package/dist/implementation/restrictions/point/PointRestriction.d.ts +45 -45
  80. package/dist/implementation/restrictions/point/PointRestriction.js +166 -156
  81. package/dist/implementation/restrictions/point/PointRestriction.js.map +1 -1
  82. package/dist/index.d.ts +29 -29
  83. package/dist/index.js +37 -37
  84. package/dist/interfaces/IDragAnchor.d.ts +8 -8
  85. package/dist/interfaces/IDragAnchor.js +2 -2
  86. package/dist/interfaces/IRestriction.d.ts +117 -117
  87. package/dist/interfaces/IRestriction.d.ts.map +1 -1
  88. package/dist/interfaces/IRestriction.js +23 -23
  89. package/dist/interfaces/IRestriction.js.map +1 -1
  90. package/dist/interfaces/IRestrictionManager.d.ts +13 -13
  91. package/dist/interfaces/IRestrictionManager.js +2 -2
  92. package/dist/interfaces/ISnapRestriction.d.ts +81 -81
  93. package/dist/interfaces/ISnapRestriction.d.ts.map +1 -1
  94. package/dist/interfaces/ISnapRestriction.js +3 -3
  95. package/package.json +10 -10
@@ -1,230 +1,240 @@
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 _AxisRestriction_activationKeyPlane, _AxisRestriction_activationKeyX, _AxisRestriction_activationKeyY, _AxisRestriction_activationKeyZ, _AxisRestriction_planeRestriction, _AxisRestriction_active, _AxisRestriction_axesHelper, _AxisRestriction_geometryMathManager, _AxisRestriction_priority;
37
- Object.defineProperty(exports, "__esModule", { value: true });
38
- exports.AxisRestriction = void 0;
39
- const viewer_1 = require("@shapediver/viewer");
40
- const gl_matrix_1 = require("gl-matrix");
41
- const THREE = __importStar(require("three"));
42
- const AbstractSnapRestriction_1 = require("../../AbstractSnapRestriction");
43
- // #endregion Type aliases (1)
44
- // #region Classes (1)
45
- class AxisRestriction extends AbstractSnapRestriction_1.AbstractSnapRestriction {
46
- // #endregion Properties (9)
47
- // #region Constructors (1)
48
- constructor(viewport, geometryMathManager, parentNode, planeRestriction, properties) {
49
- super(viewport, parentNode, "axis", properties);
50
- // #region Properties (9)
51
- _AxisRestriction_activationKeyPlane.set(this, void 0);
52
- _AxisRestriction_activationKeyX.set(this, void 0);
53
- _AxisRestriction_activationKeyY.set(this, void 0);
54
- _AxisRestriction_activationKeyZ.set(this, void 0);
55
- _AxisRestriction_planeRestriction.set(this, void 0);
56
- _AxisRestriction_active.set(this, false);
57
- _AxisRestriction_axesHelper.set(this, void 0);
58
- _AxisRestriction_geometryMathManager.set(this, void 0);
59
- _AxisRestriction_priority.set(this, 0);
60
- __classPrivateFieldSet(this, _AxisRestriction_planeRestriction, planeRestriction, "f");
61
- __classPrivateFieldSet(this, _AxisRestriction_geometryMathManager, geometryMathManager, "f");
62
- __classPrivateFieldSet(this, _AxisRestriction_activationKeyX, (properties === null || properties === void 0 ? void 0 : properties.activationKeyX) || "x", "f");
63
- __classPrivateFieldSet(this, _AxisRestriction_activationKeyY, (properties === null || properties === void 0 ? void 0 : properties.activationKeyY) || "y", "f");
64
- __classPrivateFieldSet(this, _AxisRestriction_activationKeyZ, (properties === null || properties === void 0 ? void 0 : properties.activationKeyZ) || "z", "f");
65
- __classPrivateFieldSet(this, _AxisRestriction_activationKeyPlane, (properties === null || properties === void 0 ? void 0 : properties.activationKeyPlane) || "p", "f");
66
- __classPrivateFieldSet(this, _AxisRestriction_priority, (properties === null || properties === void 0 ? void 0 : properties.priority) || 1, "f");
67
- // create the axes visualization
68
- this.createAxesVisualization();
69
- }
70
- // #endregion Constructors (1)
71
- // #region Public Getters And Setters (5)
72
- get active() {
73
- return __classPrivateFieldGet(this, _AxisRestriction_active, "f");
74
- }
75
- set active(value) {
76
- __classPrivateFieldSet(this, _AxisRestriction_active, value, "f");
77
- if (__classPrivateFieldGet(this, _AxisRestriction_axesHelper, "f"))
78
- __classPrivateFieldGet(this, _AxisRestriction_axesHelper, "f").visible = value;
79
- }
80
- get enabledEditable() {
81
- return this._enabledEditable;
82
- }
83
- get priority() {
84
- return __classPrivateFieldGet(this, _AxisRestriction_priority, "f");
85
- }
86
- set priority(value) {
87
- __classPrivateFieldSet(this, _AxisRestriction_priority, value, "f");
88
- }
89
- // #endregion Public Getters And Setters (5)
90
- // #region Public Methods (2)
91
- snap(ray, point, distance, metaData) {
92
- var _a, _b, _c, _d;
93
- if (this.enabled === false)
94
- return;
95
- if (!metaData || !metaData.startPoint)
96
- return;
97
- const xPressed = ((_a = metaData === null || metaData === void 0 ? void 0 : metaData.pressedKeys) === null || _a === void 0 ? void 0 : _a.length) === 1 &&
98
- (metaData === null || metaData === void 0 ? void 0 : metaData.pressedKeys[0]) === __classPrivateFieldGet(this, _AxisRestriction_activationKeyX, "f");
99
- const yPressed = ((_b = metaData === null || metaData === void 0 ? void 0 : metaData.pressedKeys) === null || _b === void 0 ? void 0 : _b.length) === 1 &&
100
- (metaData === null || metaData === void 0 ? void 0 : metaData.pressedKeys[0]) === __classPrivateFieldGet(this, _AxisRestriction_activationKeyY, "f");
101
- const zPressed = ((_c = metaData === null || metaData === void 0 ? void 0 : metaData.pressedKeys) === null || _c === void 0 ? void 0 : _c.length) === 1 &&
102
- (metaData === null || metaData === void 0 ? void 0 : metaData.pressedKeys[0]) === __classPrivateFieldGet(this, _AxisRestriction_activationKeyZ, "f");
103
- const pPressed = ((_d = metaData === null || metaData === void 0 ? void 0 : metaData.pressedKeys) === null || _d === void 0 ? void 0 : _d.length) === 1 &&
104
- (metaData === null || metaData === void 0 ? void 0 : metaData.pressedKeys[0]) === __classPrivateFieldGet(this, _AxisRestriction_activationKeyPlane, "f");
105
- // we move the axes helper to the reference point
106
- if (__classPrivateFieldGet(this, _AxisRestriction_axesHelper, "f") && (xPressed || yPressed || zPressed)) {
107
- __classPrivateFieldGet(this, _AxisRestriction_axesHelper, "f").position.copy(new THREE.Vector3(metaData.startPoint[0], metaData.startPoint[1], metaData.startPoint[2]));
108
- __classPrivateFieldGet(this, _AxisRestriction_axesHelper, "f").visible = false;
109
- }
110
- if (xPressed) {
111
- const snappedPoint = __classPrivateFieldGet(this, _AxisRestriction_geometryMathManager, "f").closestPoint({
112
- origin: metaData.startPoint,
113
- direction: __classPrivateFieldGet(this, _AxisRestriction_planeRestriction, "f").vectorU,
114
- }, point);
115
- const closestPointOnRay = __classPrivateFieldGet(this, _AxisRestriction_geometryMathManager, "f").closestPoint(ray, snappedPoint);
116
- return {
117
- targetPoint: snappedPoint,
118
- closestIntersectionPoint: closestPointOnRay,
119
- distanceOriginToClosestIntersectionPointSquared: gl_matrix_1.vec3.sqrDist(ray.origin, closestPointOnRay),
120
- distanceClosestPointToTargetPointSquared: gl_matrix_1.vec3.sqrDist(snappedPoint, closestPointOnRay),
121
- restriction: __classPrivateFieldGet(this, _AxisRestriction_planeRestriction, "f"),
122
- snapRestriction: this,
123
- };
124
- }
125
- else if (yPressed) {
126
- const snappedPoint = __classPrivateFieldGet(this, _AxisRestriction_geometryMathManager, "f").closestPoint({
127
- origin: metaData.startPoint,
128
- direction: __classPrivateFieldGet(this, _AxisRestriction_planeRestriction, "f").vectorV,
129
- }, point);
130
- const closestPointOnRay = __classPrivateFieldGet(this, _AxisRestriction_geometryMathManager, "f").closestPoint(ray, snappedPoint);
131
- return {
132
- targetPoint: snappedPoint,
133
- closestIntersectionPoint: closestPointOnRay,
134
- distanceOriginToClosestIntersectionPointSquared: gl_matrix_1.vec3.sqrDist(ray.origin, closestPointOnRay),
135
- distanceClosestPointToTargetPointSquared: gl_matrix_1.vec3.sqrDist(snappedPoint, closestPointOnRay),
136
- restriction: __classPrivateFieldGet(this, _AxisRestriction_planeRestriction, "f"),
137
- snapRestriction: this,
138
- };
139
- }
140
- else if (zPressed) {
141
- const snappedPoint = __classPrivateFieldGet(this, _AxisRestriction_geometryMathManager, "f").closestPointsRayRay({
142
- origin: metaData.startPoint,
143
- direction: __classPrivateFieldGet(this, _AxisRestriction_planeRestriction, "f").normal,
144
- }, ray).closestPointOnRay1;
145
- const closestPointOnRay = __classPrivateFieldGet(this, _AxisRestriction_geometryMathManager, "f").closestPoint(ray, snappedPoint);
146
- return {
147
- targetPoint: snappedPoint,
148
- closestIntersectionPoint: closestPointOnRay,
149
- distanceOriginToClosestIntersectionPointSquared: gl_matrix_1.vec3.sqrDist(ray.origin, closestPointOnRay),
150
- distanceClosestPointToTargetPointSquared: gl_matrix_1.vec3.sqrDist(snappedPoint, closestPointOnRay),
151
- restriction: __classPrivateFieldGet(this, _AxisRestriction_planeRestriction, "f"),
152
- snapRestriction: this,
153
- };
154
- }
155
- else if (pPressed) {
156
- const snappedPoint = __classPrivateFieldGet(this, _AxisRestriction_geometryMathManager, "f").closestPointOnPlane(__classPrivateFieldGet(this, _AxisRestriction_planeRestriction, "f").origin, __classPrivateFieldGet(this, _AxisRestriction_planeRestriction, "f").normal, point);
157
- const closestPointOnRay = __classPrivateFieldGet(this, _AxisRestriction_geometryMathManager, "f").closestPoint(ray, snappedPoint);
158
- return {
159
- targetPoint: snappedPoint,
160
- closestIntersectionPoint: closestPointOnRay,
161
- distanceOriginToClosestIntersectionPointSquared: gl_matrix_1.vec3.sqrDist(ray.origin, closestPointOnRay),
162
- distanceClosestPointToTargetPointSquared: gl_matrix_1.vec3.sqrDist(snappedPoint, closestPointOnRay),
163
- restriction: __classPrivateFieldGet(this, _AxisRestriction_planeRestriction, "f"),
164
- snapRestriction: this,
165
- };
166
- }
167
- }
168
- updatePlaneDefinition() {
169
- this.createAxesVisualization();
170
- }
171
- // #endregion Public Methods (2)
172
- // #region Protected Methods (1)
173
- visibilityChanged(visible) {
174
- if (visible === false) {
175
- if (__classPrivateFieldGet(this, _AxisRestriction_axesHelper, "f")) {
176
- __classPrivateFieldGet(this, _AxisRestriction_axesHelper, "f").visible = false;
177
- }
178
- }
179
- }
180
- // #endregion Protected Methods (1)
181
- // #region Private Methods (1)
182
- createAxesVisualization() {
183
- if (!this._createHelperObjects)
184
- return;
185
- if (__classPrivateFieldGet(this, _AxisRestriction_axesHelper, "f")) {
186
- this._object3D.remove(__classPrivateFieldGet(this, _AxisRestriction_axesHelper, "f"));
187
- __classPrivateFieldGet(this, _AxisRestriction_axesHelper, "f").dispose();
188
- }
189
- const bb = new viewer_1.Box();
190
- for (let i = 0; i < viewer_1.sceneTree.root.children.length; i++) {
191
- if (viewer_1.sceneTree.root.children[i].sessionNode === true) {
192
- bb.union(viewer_1.sceneTree.root.children[i].boundingBox);
193
- }
194
- }
195
- const radius = bb.boundingSphere.radius;
196
- __classPrivateFieldSet(this, _AxisRestriction_axesHelper, new THREE.AxesHelper(radius), "f");
197
- __classPrivateFieldGet(this, _AxisRestriction_axesHelper, "f").position.copy(new THREE.Vector3(__classPrivateFieldGet(this, _AxisRestriction_planeRestriction, "f").origin[0], __classPrivateFieldGet(this, _AxisRestriction_planeRestriction, "f").origin[1], __classPrivateFieldGet(this, _AxisRestriction_planeRestriction, "f").origin[2]));
198
- __classPrivateFieldGet(this, _AxisRestriction_axesHelper, "f").visible = false;
199
- __classPrivateFieldGet(this, _AxisRestriction_axesHelper, "f").renderOrder = 100;
200
- __classPrivateFieldGet(this, _AxisRestriction_axesHelper, "f").material.depthTest =
201
- false;
202
- __classPrivateFieldGet(this, _AxisRestriction_axesHelper, "f").material.transparent =
203
- true;
204
- // three.js uses a right-handed coordinate system, so we need to rotate the axes helper
205
- const rotationMatrix = new THREE.Matrix4().fromArray([
206
- __classPrivateFieldGet(this, _AxisRestriction_planeRestriction, "f").vectorU[0],
207
- __classPrivateFieldGet(this, _AxisRestriction_planeRestriction, "f").vectorU[1],
208
- __classPrivateFieldGet(this, _AxisRestriction_planeRestriction, "f").vectorU[2],
209
- 0,
210
- __classPrivateFieldGet(this, _AxisRestriction_planeRestriction, "f").vectorV[0],
211
- __classPrivateFieldGet(this, _AxisRestriction_planeRestriction, "f").vectorV[1],
212
- __classPrivateFieldGet(this, _AxisRestriction_planeRestriction, "f").vectorV[2],
213
- 0,
214
- __classPrivateFieldGet(this, _AxisRestriction_planeRestriction, "f").normal[0],
215
- __classPrivateFieldGet(this, _AxisRestriction_planeRestriction, "f").normal[1],
216
- __classPrivateFieldGet(this, _AxisRestriction_planeRestriction, "f").normal[2],
217
- 0,
218
- 0,
219
- 0,
220
- 0,
221
- 1,
222
- ]);
223
- __classPrivateFieldGet(this, _AxisRestriction_axesHelper, "f").rotation.setFromRotationMatrix(rotationMatrix);
224
- this._object3D.add(__classPrivateFieldGet(this, _AxisRestriction_axesHelper, "f"));
225
- }
226
- }
227
- exports.AxisRestriction = AxisRestriction;
228
- _AxisRestriction_activationKeyPlane = new WeakMap(), _AxisRestriction_activationKeyX = new WeakMap(), _AxisRestriction_activationKeyY = new WeakMap(), _AxisRestriction_activationKeyZ = new WeakMap(), _AxisRestriction_planeRestriction = new WeakMap(), _AxisRestriction_active = new WeakMap(), _AxisRestriction_axesHelper = new WeakMap(), _AxisRestriction_geometryMathManager = new WeakMap(), _AxisRestriction_priority = new WeakMap();
229
- // #endregion Classes (1)
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 () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
35
+ var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
36
+ if (kind === "m") throw new TypeError("Private method is not writable");
37
+ if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
38
+ 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");
39
+ return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
40
+ };
41
+ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
42
+ if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
43
+ 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");
44
+ return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
45
+ };
46
+ var _AxisRestriction_activationKeyPlane, _AxisRestriction_activationKeyX, _AxisRestriction_activationKeyY, _AxisRestriction_activationKeyZ, _AxisRestriction_planeRestriction, _AxisRestriction_active, _AxisRestriction_axesHelper, _AxisRestriction_geometryMathManager, _AxisRestriction_priority;
47
+ Object.defineProperty(exports, "__esModule", { value: true });
48
+ exports.AxisRestriction = void 0;
49
+ const viewer_1 = require("@shapediver/viewer");
50
+ const gl_matrix_1 = require("gl-matrix");
51
+ const THREE = __importStar(require("three"));
52
+ const AbstractSnapRestriction_1 = require("../../AbstractSnapRestriction");
53
+ // #endregion Type aliases (1)
54
+ // #region Classes (1)
55
+ class AxisRestriction extends AbstractSnapRestriction_1.AbstractSnapRestriction {
56
+ // #endregion Properties (9)
57
+ // #region Constructors (1)
58
+ constructor(viewport, geometryMathManager, parentNode, planeRestriction, properties) {
59
+ super(viewport, parentNode, "axis", properties);
60
+ // #region Properties (9)
61
+ _AxisRestriction_activationKeyPlane.set(this, void 0);
62
+ _AxisRestriction_activationKeyX.set(this, void 0);
63
+ _AxisRestriction_activationKeyY.set(this, void 0);
64
+ _AxisRestriction_activationKeyZ.set(this, void 0);
65
+ _AxisRestriction_planeRestriction.set(this, void 0);
66
+ _AxisRestriction_active.set(this, false);
67
+ _AxisRestriction_axesHelper.set(this, void 0);
68
+ _AxisRestriction_geometryMathManager.set(this, void 0);
69
+ _AxisRestriction_priority.set(this, 0);
70
+ __classPrivateFieldSet(this, _AxisRestriction_planeRestriction, planeRestriction, "f");
71
+ __classPrivateFieldSet(this, _AxisRestriction_geometryMathManager, geometryMathManager, "f");
72
+ __classPrivateFieldSet(this, _AxisRestriction_activationKeyX, (properties === null || properties === void 0 ? void 0 : properties.activationKeyX) || "x", "f");
73
+ __classPrivateFieldSet(this, _AxisRestriction_activationKeyY, (properties === null || properties === void 0 ? void 0 : properties.activationKeyY) || "y", "f");
74
+ __classPrivateFieldSet(this, _AxisRestriction_activationKeyZ, (properties === null || properties === void 0 ? void 0 : properties.activationKeyZ) || "z", "f");
75
+ __classPrivateFieldSet(this, _AxisRestriction_activationKeyPlane, (properties === null || properties === void 0 ? void 0 : properties.activationKeyPlane) || "p", "f");
76
+ __classPrivateFieldSet(this, _AxisRestriction_priority, (properties === null || properties === void 0 ? void 0 : properties.priority) || 1, "f");
77
+ // create the axes visualization
78
+ this.createAxesVisualization();
79
+ }
80
+ // #endregion Constructors (1)
81
+ // #region Public Getters And Setters (5)
82
+ get active() {
83
+ return __classPrivateFieldGet(this, _AxisRestriction_active, "f");
84
+ }
85
+ set active(value) {
86
+ __classPrivateFieldSet(this, _AxisRestriction_active, value, "f");
87
+ if (__classPrivateFieldGet(this, _AxisRestriction_axesHelper, "f"))
88
+ __classPrivateFieldGet(this, _AxisRestriction_axesHelper, "f").visible = value;
89
+ }
90
+ get enabledEditable() {
91
+ return this._enabledEditable;
92
+ }
93
+ get priority() {
94
+ return __classPrivateFieldGet(this, _AxisRestriction_priority, "f");
95
+ }
96
+ set priority(value) {
97
+ __classPrivateFieldSet(this, _AxisRestriction_priority, value, "f");
98
+ }
99
+ // #endregion Public Getters And Setters (5)
100
+ // #region Public Methods (2)
101
+ snap(ray, point, distance, metaData) {
102
+ var _a, _b, _c, _d;
103
+ if (this.enabled === false)
104
+ return;
105
+ if (!metaData || !metaData.startPoint)
106
+ return;
107
+ const xPressed = ((_a = metaData === null || metaData === void 0 ? void 0 : metaData.pressedKeys) === null || _a === void 0 ? void 0 : _a.length) === 1 &&
108
+ (metaData === null || metaData === void 0 ? void 0 : metaData.pressedKeys[0]) === __classPrivateFieldGet(this, _AxisRestriction_activationKeyX, "f");
109
+ const yPressed = ((_b = metaData === null || metaData === void 0 ? void 0 : metaData.pressedKeys) === null || _b === void 0 ? void 0 : _b.length) === 1 &&
110
+ (metaData === null || metaData === void 0 ? void 0 : metaData.pressedKeys[0]) === __classPrivateFieldGet(this, _AxisRestriction_activationKeyY, "f");
111
+ const zPressed = ((_c = metaData === null || metaData === void 0 ? void 0 : metaData.pressedKeys) === null || _c === void 0 ? void 0 : _c.length) === 1 &&
112
+ (metaData === null || metaData === void 0 ? void 0 : metaData.pressedKeys[0]) === __classPrivateFieldGet(this, _AxisRestriction_activationKeyZ, "f");
113
+ const pPressed = ((_d = metaData === null || metaData === void 0 ? void 0 : metaData.pressedKeys) === null || _d === void 0 ? void 0 : _d.length) === 1 &&
114
+ (metaData === null || metaData === void 0 ? void 0 : metaData.pressedKeys[0]) === __classPrivateFieldGet(this, _AxisRestriction_activationKeyPlane, "f");
115
+ // we move the axes helper to the reference point
116
+ if (__classPrivateFieldGet(this, _AxisRestriction_axesHelper, "f") && (xPressed || yPressed || zPressed)) {
117
+ __classPrivateFieldGet(this, _AxisRestriction_axesHelper, "f").position.copy(new THREE.Vector3(metaData.startPoint[0], metaData.startPoint[1], metaData.startPoint[2]));
118
+ __classPrivateFieldGet(this, _AxisRestriction_axesHelper, "f").visible = false;
119
+ }
120
+ if (xPressed) {
121
+ const snappedPoint = __classPrivateFieldGet(this, _AxisRestriction_geometryMathManager, "f").closestPoint({
122
+ origin: metaData.startPoint,
123
+ direction: __classPrivateFieldGet(this, _AxisRestriction_planeRestriction, "f").vectorU,
124
+ }, point);
125
+ const closestPointOnRay = __classPrivateFieldGet(this, _AxisRestriction_geometryMathManager, "f").closestPoint(ray, snappedPoint);
126
+ return {
127
+ targetPoint: snappedPoint,
128
+ closestIntersectionPoint: closestPointOnRay,
129
+ distanceOriginToClosestIntersectionPointSquared: gl_matrix_1.vec3.sqrDist(ray.origin, closestPointOnRay),
130
+ distanceClosestPointToTargetPointSquared: gl_matrix_1.vec3.sqrDist(snappedPoint, closestPointOnRay),
131
+ restriction: __classPrivateFieldGet(this, _AxisRestriction_planeRestriction, "f"),
132
+ snapRestriction: this,
133
+ };
134
+ }
135
+ else if (yPressed) {
136
+ const snappedPoint = __classPrivateFieldGet(this, _AxisRestriction_geometryMathManager, "f").closestPoint({
137
+ origin: metaData.startPoint,
138
+ direction: __classPrivateFieldGet(this, _AxisRestriction_planeRestriction, "f").vectorV,
139
+ }, point);
140
+ const closestPointOnRay = __classPrivateFieldGet(this, _AxisRestriction_geometryMathManager, "f").closestPoint(ray, snappedPoint);
141
+ return {
142
+ targetPoint: snappedPoint,
143
+ closestIntersectionPoint: closestPointOnRay,
144
+ distanceOriginToClosestIntersectionPointSquared: gl_matrix_1.vec3.sqrDist(ray.origin, closestPointOnRay),
145
+ distanceClosestPointToTargetPointSquared: gl_matrix_1.vec3.sqrDist(snappedPoint, closestPointOnRay),
146
+ restriction: __classPrivateFieldGet(this, _AxisRestriction_planeRestriction, "f"),
147
+ snapRestriction: this,
148
+ };
149
+ }
150
+ else if (zPressed) {
151
+ const snappedPoint = __classPrivateFieldGet(this, _AxisRestriction_geometryMathManager, "f").closestPointsRayRay({
152
+ origin: metaData.startPoint,
153
+ direction: __classPrivateFieldGet(this, _AxisRestriction_planeRestriction, "f").normal,
154
+ }, ray).closestPointOnRay1;
155
+ const closestPointOnRay = __classPrivateFieldGet(this, _AxisRestriction_geometryMathManager, "f").closestPoint(ray, snappedPoint);
156
+ return {
157
+ targetPoint: snappedPoint,
158
+ closestIntersectionPoint: closestPointOnRay,
159
+ distanceOriginToClosestIntersectionPointSquared: gl_matrix_1.vec3.sqrDist(ray.origin, closestPointOnRay),
160
+ distanceClosestPointToTargetPointSquared: gl_matrix_1.vec3.sqrDist(snappedPoint, closestPointOnRay),
161
+ restriction: __classPrivateFieldGet(this, _AxisRestriction_planeRestriction, "f"),
162
+ snapRestriction: this,
163
+ };
164
+ }
165
+ else if (pPressed) {
166
+ const snappedPoint = __classPrivateFieldGet(this, _AxisRestriction_geometryMathManager, "f").closestPointOnPlane(__classPrivateFieldGet(this, _AxisRestriction_planeRestriction, "f").origin, __classPrivateFieldGet(this, _AxisRestriction_planeRestriction, "f").normal, point);
167
+ const closestPointOnRay = __classPrivateFieldGet(this, _AxisRestriction_geometryMathManager, "f").closestPoint(ray, snappedPoint);
168
+ return {
169
+ targetPoint: snappedPoint,
170
+ closestIntersectionPoint: closestPointOnRay,
171
+ distanceOriginToClosestIntersectionPointSquared: gl_matrix_1.vec3.sqrDist(ray.origin, closestPointOnRay),
172
+ distanceClosestPointToTargetPointSquared: gl_matrix_1.vec3.sqrDist(snappedPoint, closestPointOnRay),
173
+ restriction: __classPrivateFieldGet(this, _AxisRestriction_planeRestriction, "f"),
174
+ snapRestriction: this,
175
+ };
176
+ }
177
+ }
178
+ updatePlaneDefinition() {
179
+ this.createAxesVisualization();
180
+ }
181
+ // #endregion Public Methods (2)
182
+ // #region Protected Methods (1)
183
+ visibilityChanged(visible) {
184
+ if (visible === false) {
185
+ if (__classPrivateFieldGet(this, _AxisRestriction_axesHelper, "f")) {
186
+ __classPrivateFieldGet(this, _AxisRestriction_axesHelper, "f").visible = false;
187
+ }
188
+ }
189
+ }
190
+ // #endregion Protected Methods (1)
191
+ // #region Private Methods (1)
192
+ createAxesVisualization() {
193
+ if (!this._createHelperObjects)
194
+ return;
195
+ if (__classPrivateFieldGet(this, _AxisRestriction_axesHelper, "f")) {
196
+ this._object3D.remove(__classPrivateFieldGet(this, _AxisRestriction_axesHelper, "f"));
197
+ __classPrivateFieldGet(this, _AxisRestriction_axesHelper, "f").dispose();
198
+ }
199
+ const bb = new viewer_1.Box();
200
+ for (let i = 0; i < viewer_1.sceneTree.root.children.length; i++) {
201
+ if (viewer_1.sceneTree.root.children[i].sessionNode === true) {
202
+ bb.union(viewer_1.sceneTree.root.children[i].boundingBox);
203
+ }
204
+ }
205
+ const radius = bb.boundingSphere.radius;
206
+ __classPrivateFieldSet(this, _AxisRestriction_axesHelper, new THREE.AxesHelper(radius), "f");
207
+ __classPrivateFieldGet(this, _AxisRestriction_axesHelper, "f").position.copy(new THREE.Vector3(__classPrivateFieldGet(this, _AxisRestriction_planeRestriction, "f").origin[0], __classPrivateFieldGet(this, _AxisRestriction_planeRestriction, "f").origin[1], __classPrivateFieldGet(this, _AxisRestriction_planeRestriction, "f").origin[2]));
208
+ __classPrivateFieldGet(this, _AxisRestriction_axesHelper, "f").visible = false;
209
+ __classPrivateFieldGet(this, _AxisRestriction_axesHelper, "f").renderOrder = 100;
210
+ __classPrivateFieldGet(this, _AxisRestriction_axesHelper, "f").material.depthTest =
211
+ false;
212
+ __classPrivateFieldGet(this, _AxisRestriction_axesHelper, "f").material.transparent =
213
+ true;
214
+ // three.js uses a right-handed coordinate system, so we need to rotate the axes helper
215
+ const rotationMatrix = new THREE.Matrix4().fromArray([
216
+ __classPrivateFieldGet(this, _AxisRestriction_planeRestriction, "f").vectorU[0],
217
+ __classPrivateFieldGet(this, _AxisRestriction_planeRestriction, "f").vectorU[1],
218
+ __classPrivateFieldGet(this, _AxisRestriction_planeRestriction, "f").vectorU[2],
219
+ 0,
220
+ __classPrivateFieldGet(this, _AxisRestriction_planeRestriction, "f").vectorV[0],
221
+ __classPrivateFieldGet(this, _AxisRestriction_planeRestriction, "f").vectorV[1],
222
+ __classPrivateFieldGet(this, _AxisRestriction_planeRestriction, "f").vectorV[2],
223
+ 0,
224
+ __classPrivateFieldGet(this, _AxisRestriction_planeRestriction, "f").normal[0],
225
+ __classPrivateFieldGet(this, _AxisRestriction_planeRestriction, "f").normal[1],
226
+ __classPrivateFieldGet(this, _AxisRestriction_planeRestriction, "f").normal[2],
227
+ 0,
228
+ 0,
229
+ 0,
230
+ 0,
231
+ 1,
232
+ ]);
233
+ __classPrivateFieldGet(this, _AxisRestriction_axesHelper, "f").rotation.setFromRotationMatrix(rotationMatrix);
234
+ this._object3D.add(__classPrivateFieldGet(this, _AxisRestriction_axesHelper, "f"));
235
+ }
236
+ }
237
+ exports.AxisRestriction = AxisRestriction;
238
+ _AxisRestriction_activationKeyPlane = new WeakMap(), _AxisRestriction_activationKeyX = new WeakMap(), _AxisRestriction_activationKeyY = new WeakMap(), _AxisRestriction_activationKeyZ = new WeakMap(), _AxisRestriction_planeRestriction = new WeakMap(), _AxisRestriction_active = new WeakMap(), _AxisRestriction_axesHelper = new WeakMap(), _AxisRestriction_geometryMathManager = new WeakMap(), _AxisRestriction_priority = new WeakMap();
239
+ // #endregion Classes (1)
230
240
  //# sourceMappingURL=AxisRestriction.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"AxisRestriction.js","sourceRoot":"","sources":["../../../../../src/implementation/restrictions/plane/snap/AxisRestriction.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+CAA2E;AAE3E,yCAA+B;AAC/B,6CAA+B;AAU/B,2EAAsE;AAYtE,8BAA8B;AAE9B,sBAAsB;AAEtB,MAAa,eACZ,SAAQ,iDAAuB;IAgB/B,4BAA4B;IAE5B,2BAA2B;IAE3B,YACC,QAAsB,EACtB,mBAAwC,EACxC,UAAqB,EACrB,gBAAkC,EAClC,UAAsC;QAEtC,KAAK,CAAC,QAAQ,EAAE,UAAU,EAAE,MAAM,EAAE,UAAU,CAAC,CAAC;QAxBjD,yBAAyB;QAEzB,sDAAqC;QACrC,kDAAiC;QACjC,kDAAiC;QACjC,kDAAiC;QACjC,oDAA6C;QAE7C,kCAAmB,KAAK,EAAC;QACzB,8CAA+B;QAC/B,uDAA0C;QAC1C,oCAAoB,CAAC,EAAC;QAcrB,uBAAA,IAAI,qCAAqB,gBAAgB,MAAA,CAAC;QAC1C,uBAAA,IAAI,wCAAwB,mBAAmB,MAAA,CAAC;QAEhD,uBAAA,IAAI,mCAAmB,CAAA,UAAU,aA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I,mCAAY,CAAC,CAAC;IACtC,CAAC;CAGD;AAzSD,0CAySC;;AAED,yBAAyB"}
1
+ {"version":3,"file":"AxisRestriction.js","sourceRoot":"","sources":["../../../../../src/implementation/restrictions/plane/snap/AxisRestriction.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+CAA2E;AAE3E,yCAA+B;AAC/B,6CAA+B;AAU/B,2EAAsE;AAYtE,8BAA8B;AAE9B,sBAAsB;AAEtB,MAAa,eACZ,SAAQ,iDAAuB;IAgB/B,4BAA4B;IAE5B,2BAA2B;IAE3B,YACC,QAAsB,EACtB,mBAAwC,EACxC,UAAqB,EACrB,gBAAkC,EAClC,UAAsC;QAEtC,KAAK,CAAC,QAAQ,EAAE,UAAU,EAAE,MAAM,EAAE,UAAU,CAAC,CAAC;QAxBjD,yBAAyB;QAEhB,sDAA4B;QAC5B,kDAAwB;QACxB,kDAAwB;QACxB,kDAAwB;QACxB,oDAAoC;QAE7C,kCAAmB,KAAK,EAAC;QACzB,8CAA+B;QAC/B,uDAA0C;QAC1C,oCAAoB,CAAC,EAAC;QAcrB,uBAAA,IAAI,qCAAqB,gBAAgB,MAAA,CAAC;QAC1C,uBAAA,IAAI,wCAAwB,mBAAmB,MAAA,CAAC;QAEhD,uBAAA,IAAI,mCAAmB,CAAA,UAAU,aAAV,UAAU,uBAAV,UAAU,CAAE,cAAc,KAAI,GAAG,MAAA,CAAC;QACzD,uBAAA,IAAI,mCAAmB,CAAA,UAAU,aAAV,UAAU,uBAAV,UAAU,CAAE,cAAc,KAAI,GAAG,MAAA,CAAC;QACzD,uBAAA,IAAI,mCAAmB,CAAA,UAAU,aAAV,UAAU,uBAAV,UAAU,CAAE,cAAc,KAAI,GAAG,MAAA,CAAC;QACzD,uBAAA,IAAI,uCAAuB,CAAA,UAAU,aAAV,UAAU,uBAAV,UAAU,CAAE,kBAAkB,KAAI,GAAG,MAAA,CAAC;QAEjE,uBAAA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C;QAClC,uBAAA,IAAI,mCAAY,CAAC,QAAoC,CAAC,SAAS;YAC/D,KAAK,CAAC;QACN,uBAAA,IAAI,mCAAY,CAAC,QAAoC,CAAC,WAAW;YACjE,IAAI,CAAC;QAEN,uFAAuF;QACvF,MAAM,cAAc,GAAG,IAAI,KAAK,CAAC,OAAO,EAAE,CAAC,SAAS,CAAC;YACpD,uBAAA,IAAI,yCAAkB,CAAC,OAAO,CAAC,CAAC,CAAC;YACjC,uBAAA,IAAI,yCAAkB,CAAC,OAAO,CAAC,CAAC,CAAC;YACjC,uBAAA,IAAI,yCAAkB,CAAC,OAAO,CAAC,CAAC,CAAC;YACjC,CAAC;YACD,uBAAA,IAAI,yCAAkB,CAAC,OAAO,CAAC,CAAC,CAAC;YACjC,uBAAA,IAAI,yCAAkB,CAAC,OAAO,CAAC,CAAC,CAAC;YACjC,uBAAA,IAAI,yCAAkB,CAAC,OAAO,CAAC,CAAC,CAAC;YACjC,CAAC;YACD,uBAAA,IAAI,yCAAkB,CAAC,MAAM,CAAC,CAAC,CAAC;YAChC,uBAAA,IAAI,yCAAkB,CAAC,MAAM,CAAC,CAAC,CAAC;YAChC,uBAAA,IAAI,yCAAkB,CAAC,MAAM,CAAC,CAAC,CAAC;YAChC,CAAC;YACD,CAAC;YACD,CAAC;YACD,CAAC;YACD,CAAC;SACD,CAAC,CAAC;QAEH,uBAAA,IAAI,mCAAY,CAAC,QAAQ,CAAC,qBAAqB,CAAC,cAAc,CAAC,CAAC;QAEhE,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,uBAAA,IAAI,mCAAY,CAAC,CAAC;IACtC,CAAC;CAGD;AAzSD,0CAySC;;AAED,yBAAyB"}
@@ -1,40 +1,40 @@
1
- import { ITreeNode, IViewportApi } from "@shapediver/viewer";
2
- import { IRay } from "@shapediver/viewer.shared.types";
3
- import { vec3 } from "gl-matrix";
4
- import { RestrictionMetaData, RestrictionResult } from "../../../../interfaces/IRestriction";
5
- import { ISnapRestriction, SnapRestrictionProperties } from "../../../../interfaces/ISnapRestriction";
6
- import { GeometryMathManager } from "../../../GeometryMathManager";
7
- import { AbstractSnapRestriction } from "../../AbstractSnapRestriction";
8
- import { PlaneRestriction } from "../PlaneRestriction";
9
- /**
10
- * Properties for the grid restriction
11
- */
12
- export declare type GridRestrictionProperties = {
13
- /**
14
- * Size of the grid unit
15
- */
16
- gridUnit?: number;
17
- /**
18
- * If the grid unit is editable for change to the end user.
19
- * If it is not editable, the grid unit cannot be changed from the default value.
20
- */
21
- gridUnitEditable?: boolean;
22
- } & SnapRestrictionProperties;
23
- export declare class GridRestriction extends AbstractSnapRestriction implements ISnapRestriction {
24
- #private;
25
- constructor(viewport: IViewportApi, geometryMathManager: GeometryMathManager, parentNode: ITreeNode, planeRestriction: PlaneRestriction, properties?: GridRestrictionProperties);
26
- get active(): boolean;
27
- set active(value: boolean);
28
- get enabledEditable(): boolean;
29
- get gridUnit(): number;
30
- set gridUnit(value: number);
31
- get gridUnitEditable(): boolean;
32
- get priority(): number;
33
- set priority(value: number);
34
- snap(ray: IRay, point: vec3, distance: number, metaData: RestrictionMetaData): RestrictionResult | undefined;
35
- updatePlaneDefinition(): void;
36
- protected visibilityChanged(visible: boolean): void;
37
- private createGridVisualization;
38
- private createOffsetFromUnit;
39
- }
1
+ import { ITreeNode, IViewportApi } from "@shapediver/viewer";
2
+ import { IRay } from "@shapediver/viewer.shared.types";
3
+ import { vec3 } from "gl-matrix";
4
+ import { RestrictionMetaData, RestrictionResult } from "../../../../interfaces/IRestriction";
5
+ import { ISnapRestriction, SnapRestrictionProperties } from "../../../../interfaces/ISnapRestriction";
6
+ import { GeometryMathManager } from "../../../GeometryMathManager";
7
+ import { AbstractSnapRestriction } from "../../AbstractSnapRestriction";
8
+ import { PlaneRestriction } from "../PlaneRestriction";
9
+ /**
10
+ * Properties for the grid restriction
11
+ */
12
+ export type GridRestrictionProperties = {
13
+ /**
14
+ * Size of the grid unit
15
+ */
16
+ gridUnit?: number;
17
+ /**
18
+ * If the grid unit is editable for change to the end user.
19
+ * If it is not editable, the grid unit cannot be changed from the default value.
20
+ */
21
+ gridUnitEditable?: boolean;
22
+ } & SnapRestrictionProperties;
23
+ export declare class GridRestriction extends AbstractSnapRestriction implements ISnapRestriction {
24
+ #private;
25
+ constructor(viewport: IViewportApi, geometryMathManager: GeometryMathManager, parentNode: ITreeNode, planeRestriction: PlaneRestriction, properties?: GridRestrictionProperties);
26
+ get active(): boolean;
27
+ set active(value: boolean);
28
+ get enabledEditable(): boolean;
29
+ get gridUnit(): number;
30
+ set gridUnit(value: number);
31
+ get gridUnitEditable(): boolean;
32
+ get priority(): number;
33
+ set priority(value: number);
34
+ snap(ray: IRay, point: vec3, distance: number, metaData: RestrictionMetaData): RestrictionResult | undefined;
35
+ updatePlaneDefinition(): void;
36
+ protected visibilityChanged(visible: boolean): void;
37
+ private createGridVisualization;
38
+ private createOffsetFromUnit;
39
+ }
40
40
  //# sourceMappingURL=GridRestriction.d.ts.map