@shapediver/viewer.rendering-engine.intersection-restriction-engine 3.9.0 → 3.9.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/api/implementation/AbstractRestrictionApi.d.ts +2 -2
- package/dist/api/implementation/AbstractRestrictionApi.d.ts.map +1 -1
- package/dist/api/implementation/AbstractRestrictionApi.js.map +1 -1
- package/dist/api/implementation/AbstractSnapRestrictionApi.d.ts +2 -2
- package/dist/api/implementation/AbstractSnapRestrictionApi.d.ts.map +1 -1
- package/dist/api/implementation/AbstractSnapRestrictionApi.js.map +1 -1
- package/dist/api/implementation/camera_plane/CameraPlaneRestrictionApi.d.ts +2 -2
- package/dist/api/implementation/camera_plane/CameraPlaneRestrictionApi.d.ts.map +1 -1
- package/dist/api/implementation/camera_plane/CameraPlaneRestrictionApi.js.map +1 -1
- package/dist/api/implementation/geometry/GeometryRestrictionApi.d.ts +3 -3
- package/dist/api/implementation/geometry/GeometryRestrictionApi.d.ts.map +1 -1
- package/dist/api/implementation/geometry/GeometryRestrictionApi.js.map +1 -1
- package/dist/api/implementation/line/LineRestrictionApi.d.ts +3 -3
- package/dist/api/implementation/line/LineRestrictionApi.d.ts.map +1 -1
- package/dist/api/implementation/line/LineRestrictionApi.js.map +1 -1
- package/dist/api/implementation/plane/PlaneRestrictionApi.d.ts +6 -6
- package/dist/api/implementation/plane/PlaneRestrictionApi.d.ts.map +1 -1
- package/dist/api/implementation/plane/PlaneRestrictionApi.js.map +1 -1
- package/dist/api/implementation/plane/snap/AngularRestrictionApi.d.ts +2 -2
- package/dist/api/implementation/plane/snap/AngularRestrictionApi.d.ts.map +1 -1
- package/dist/api/implementation/plane/snap/AngularRestrictionApi.js.map +1 -1
- package/dist/api/implementation/plane/snap/AxisRestrictionApi.d.ts +2 -2
- package/dist/api/implementation/plane/snap/AxisRestrictionApi.d.ts.map +1 -1
- package/dist/api/implementation/plane/snap/AxisRestrictionApi.js.map +1 -1
- package/dist/api/implementation/plane/snap/GridRestrictionApi.d.ts +2 -2
- package/dist/api/implementation/plane/snap/GridRestrictionApi.d.ts.map +1 -1
- package/dist/api/implementation/plane/snap/GridRestrictionApi.js.map +1 -1
- package/dist/api/implementation/point/PointRestrictionApi.d.ts +3 -3
- package/dist/api/implementation/point/PointRestrictionApi.d.ts.map +1 -1
- package/dist/api/implementation/point/PointRestrictionApi.js.map +1 -1
- package/dist/api/interfaces/IRestrictionApi.d.ts.map +1 -1
- package/dist/api/interfaces/ISnapRestrictionApi.d.ts +1 -1
- package/dist/api/interfaces/ISnapRestrictionApi.d.ts.map +1 -1
- package/dist/implementation/EventManager.d.ts +3 -3
- package/dist/implementation/EventManager.d.ts.map +1 -1
- package/dist/implementation/EventManager.js.map +1 -1
- package/dist/implementation/GeometryMathManager.d.ts +4 -4
- package/dist/implementation/GeometryMathManager.d.ts.map +1 -1
- package/dist/implementation/GeometryMathManager.js +25 -13
- package/dist/implementation/GeometryMathManager.js.map +1 -1
- package/dist/implementation/RestrictionManager.d.ts +7 -6
- package/dist/implementation/RestrictionManager.d.ts.map +1 -1
- package/dist/implementation/RestrictionManager.js +65 -29
- package/dist/implementation/RestrictionManager.js.map +1 -1
- package/dist/implementation/restrictions/AbstractRestriction.d.ts +7 -7
- package/dist/implementation/restrictions/AbstractRestriction.d.ts.map +1 -1
- package/dist/implementation/restrictions/AbstractRestriction.js +8 -5
- package/dist/implementation/restrictions/AbstractRestriction.js.map +1 -1
- package/dist/implementation/restrictions/AbstractSnapRestriction.d.ts +7 -7
- package/dist/implementation/restrictions/AbstractSnapRestriction.d.ts.map +1 -1
- package/dist/implementation/restrictions/AbstractSnapRestriction.js +4 -4
- package/dist/implementation/restrictions/AbstractSnapRestriction.js.map +1 -1
- package/dist/implementation/restrictions/RestrictionsHelper.d.ts +2 -2
- package/dist/implementation/restrictions/RestrictionsHelper.d.ts.map +1 -1
- package/dist/implementation/restrictions/RestrictionsHelper.js +7 -3
- package/dist/implementation/restrictions/RestrictionsHelper.js.map +1 -1
- package/dist/implementation/restrictions/camera_plane/CameraPlaneRestriction.d.ts +7 -7
- package/dist/implementation/restrictions/camera_plane/CameraPlaneRestriction.d.ts.map +1 -1
- package/dist/implementation/restrictions/camera_plane/CameraPlaneRestriction.js +2 -2
- package/dist/implementation/restrictions/camera_plane/CameraPlaneRestriction.js.map +1 -1
- package/dist/implementation/restrictions/geometry/GeometryRestriction.d.ts +8 -8
- package/dist/implementation/restrictions/geometry/GeometryRestriction.d.ts.map +1 -1
- package/dist/implementation/restrictions/geometry/GeometryRestriction.js +67 -30
- package/dist/implementation/restrictions/geometry/GeometryRestriction.js.map +1 -1
- package/dist/implementation/restrictions/line/LineRestriction.d.ts +20 -9
- package/dist/implementation/restrictions/line/LineRestriction.d.ts.map +1 -1
- package/dist/implementation/restrictions/line/LineRestriction.js +66 -9
- package/dist/implementation/restrictions/line/LineRestriction.js.map +1 -1
- package/dist/implementation/restrictions/plane/PlaneRestriction.d.ts +11 -11
- package/dist/implementation/restrictions/plane/PlaneRestriction.d.ts.map +1 -1
- package/dist/implementation/restrictions/plane/PlaneRestriction.js +34 -16
- package/dist/implementation/restrictions/plane/PlaneRestriction.js.map +1 -1
- package/dist/implementation/restrictions/plane/snap/AngularRestriction.d.ts +9 -9
- package/dist/implementation/restrictions/plane/snap/AngularRestriction.d.ts.map +1 -1
- package/dist/implementation/restrictions/plane/snap/AngularRestriction.js +87 -35
- package/dist/implementation/restrictions/plane/snap/AngularRestriction.js.map +1 -1
- package/dist/implementation/restrictions/plane/snap/AxisRestriction.d.ts +8 -8
- package/dist/implementation/restrictions/plane/snap/AxisRestriction.d.ts.map +1 -1
- package/dist/implementation/restrictions/plane/snap/AxisRestriction.js +79 -24
- package/dist/implementation/restrictions/plane/snap/AxisRestriction.js.map +1 -1
- package/dist/implementation/restrictions/plane/snap/GridRestriction.d.ts +8 -8
- package/dist/implementation/restrictions/plane/snap/GridRestriction.d.ts.map +1 -1
- package/dist/implementation/restrictions/plane/snap/GridRestriction.js +118 -23
- package/dist/implementation/restrictions/plane/snap/GridRestriction.js.map +1 -1
- package/dist/implementation/restrictions/point/PointRestriction.d.ts +8 -8
- package/dist/implementation/restrictions/point/PointRestriction.d.ts.map +1 -1
- package/dist/implementation/restrictions/point/PointRestriction.js +5 -4
- package/dist/implementation/restrictions/point/PointRestriction.js.map +1 -1
- package/dist/index.d.ts +29 -29
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +18 -18
- package/dist/index.js.map +1 -1
- package/dist/interfaces/IDragAnchor.d.ts +1 -1
- package/dist/interfaces/IDragAnchor.d.ts.map +1 -1
- package/dist/interfaces/IRestriction.d.ts +14 -13
- package/dist/interfaces/IRestriction.d.ts.map +1 -1
- package/dist/interfaces/IRestriction.js +2 -2
- package/dist/interfaces/IRestriction.js.map +1 -1
- package/dist/interfaces/IRestrictionManager.d.ts +2 -2
- package/dist/interfaces/IRestrictionManager.d.ts.map +1 -1
- package/dist/interfaces/ISnapRestriction.d.ts +3 -3
- package/dist/interfaces/ISnapRestriction.d.ts.map +1 -1
- package/dist/interfaces/ISnapRestriction.js.map +1 -1
- package/dist/interfaces/IVisualizationSettings.d.ts +1 -1
- package/dist/interfaces/IVisualizationSettings.d.ts.map +1 -1
- package/package.json +52 -52
|
@@ -10,21 +10,21 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
|
|
|
10
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
11
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
12
12
|
};
|
|
13
|
-
var _RestrictionManager_eventManager, _RestrictionManager_geometryMathManager, _RestrictionManager_parentNode, _RestrictionManager_restrictions, _RestrictionManager_settings, _RestrictionManager_uuidGenerator, _RestrictionManager_viewport, _RestrictionManager_closed, _RestrictionManager_keysPressed, _RestrictionManager_restrictionManagerNode, _RestrictionManager_showRestrictionVisualization;
|
|
13
|
+
var _RestrictionManager_eventManager, _RestrictionManager_geometryMathManager, _RestrictionManager_parentNode, _RestrictionManager_restrictions, _RestrictionManager_settings, _RestrictionManager_uuidGenerator, _RestrictionManager_viewport, _RestrictionManager_closed, _RestrictionManager_keysPressed, _RestrictionManager_keysToggled, _RestrictionManager_restrictionManagerNode, _RestrictionManager_showRestrictionVisualization;
|
|
14
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
15
|
exports.RestrictionManager = void 0;
|
|
16
|
-
const
|
|
17
|
-
const
|
|
16
|
+
const viewer_1 = require("@shapediver/viewer");
|
|
17
|
+
const viewer_shared_node_tree_1 = require("@shapediver/viewer.shared.node-tree");
|
|
18
|
+
const viewer_shared_services_1 = require("@shapediver/viewer.shared.services");
|
|
18
19
|
const IRestriction_1 = require("../interfaces/IRestriction");
|
|
19
20
|
const EventManager_1 = require("./EventManager");
|
|
20
21
|
const GeometryMathManager_1 = require("./GeometryMathManager");
|
|
22
|
+
const CameraPlaneRestriction_1 = require("./restrictions/camera_plane/CameraPlaneRestriction");
|
|
21
23
|
const GeometryRestriction_1 = require("./restrictions/geometry/GeometryRestriction");
|
|
22
|
-
const viewer_shared_node_tree_1 = require("@shapediver/viewer.shared.node-tree");
|
|
23
|
-
const viewer_1 = require("@shapediver/viewer");
|
|
24
24
|
const LineRestriction_1 = require("./restrictions/line/LineRestriction");
|
|
25
25
|
const PlaneRestriction_1 = require("./restrictions/plane/PlaneRestriction");
|
|
26
26
|
const PointRestriction_1 = require("./restrictions/point/PointRestriction");
|
|
27
|
-
const
|
|
27
|
+
const RestrictionsHelper_1 = require("./restrictions/RestrictionsHelper");
|
|
28
28
|
class RestrictionManager {
|
|
29
29
|
// #endregion Properties (11)
|
|
30
30
|
// #region Constructors (1)
|
|
@@ -38,23 +38,34 @@ class RestrictionManager {
|
|
|
38
38
|
distanceLabels: true,
|
|
39
39
|
distanceMultiplicationFactor: 2,
|
|
40
40
|
lines: {
|
|
41
|
-
color:
|
|
41
|
+
color: "#0d44f0",
|
|
42
42
|
},
|
|
43
43
|
pointLabels: false,
|
|
44
44
|
points: {
|
|
45
|
-
size_0: 15,
|
|
46
|
-
|
|
47
|
-
|
|
45
|
+
size_0: 15,
|
|
46
|
+
size_1: 20,
|
|
47
|
+
size_2: 15,
|
|
48
|
+
size_3: 20,
|
|
49
|
+
size_4: 15,
|
|
50
|
+
size_5: 20,
|
|
51
|
+
color_0: "#0d44f0",
|
|
52
|
+
color_1: "#197aeb",
|
|
53
|
+
color_2: "#9e27d8",
|
|
54
|
+
color_3: "#bc47fd",
|
|
55
|
+
color_4: "#00ff78",
|
|
56
|
+
color_5: "#00ff78",
|
|
57
|
+
},
|
|
48
58
|
});
|
|
49
59
|
_RestrictionManager_uuidGenerator.set(this, viewer_shared_services_1.UuidGenerator.instance);
|
|
50
60
|
_RestrictionManager_viewport.set(this, void 0);
|
|
51
61
|
_RestrictionManager_closed.set(this, false);
|
|
52
62
|
_RestrictionManager_keysPressed.set(this, {});
|
|
63
|
+
_RestrictionManager_keysToggled.set(this, {});
|
|
53
64
|
_RestrictionManager_restrictionManagerNode.set(this, void 0);
|
|
54
65
|
_RestrictionManager_showRestrictionVisualization.set(this, false);
|
|
55
66
|
__classPrivateFieldSet(this, _RestrictionManager_viewport, viewport, "f");
|
|
56
67
|
__classPrivateFieldSet(this, _RestrictionManager_parentNode, parentNode, "f");
|
|
57
|
-
__classPrivateFieldSet(this, _RestrictionManager_restrictionManagerNode, new viewer_shared_node_tree_1.TreeNode(
|
|
68
|
+
__classPrivateFieldSet(this, _RestrictionManager_restrictionManagerNode, new viewer_shared_node_tree_1.TreeNode("RestrictionManager"), "f");
|
|
58
69
|
__classPrivateFieldGet(this, _RestrictionManager_parentNode, "f").addChild(__classPrivateFieldGet(this, _RestrictionManager_restrictionManagerNode, "f"));
|
|
59
70
|
__classPrivateFieldGet(this, _RestrictionManager_parentNode, "f").updateVersion(false, false);
|
|
60
71
|
if (settings)
|
|
@@ -66,7 +77,7 @@ class RestrictionManager {
|
|
|
66
77
|
onOut: this.onOut.bind(this),
|
|
67
78
|
onMove: this.onMove.bind(this),
|
|
68
79
|
onKeyDown: this.onKeyDown.bind(this),
|
|
69
|
-
onKeyUp: this.onKeyUp.bind(this)
|
|
80
|
+
onKeyUp: this.onKeyUp.bind(this),
|
|
70
81
|
}), "f");
|
|
71
82
|
if (restrictions) {
|
|
72
83
|
for (const r of restrictions) {
|
|
@@ -126,10 +137,13 @@ class RestrictionManager {
|
|
|
126
137
|
__classPrivateFieldGet(this, _RestrictionManager_parentNode, "f").updateVersion(false, false);
|
|
127
138
|
__classPrivateFieldGet(this, _RestrictionManager_eventManager, "f").close();
|
|
128
139
|
__classPrivateFieldGet(this, _RestrictionManager_geometryMathManager, "f").close();
|
|
129
|
-
Object.keys(__classPrivateFieldGet(this, _RestrictionManager_restrictions, "f")).forEach(key => this.removeRestriction(key));
|
|
140
|
+
Object.keys(__classPrivateFieldGet(this, _RestrictionManager_restrictions, "f")).forEach((key) => this.removeRestriction(key));
|
|
130
141
|
}
|
|
131
142
|
getPressedKeys() {
|
|
132
|
-
return Object.keys(__classPrivateFieldGet(this, _RestrictionManager_keysPressed, "f")).filter(key => __classPrivateFieldGet(this, _RestrictionManager_keysPressed, "f")[key] === true);
|
|
143
|
+
return Object.keys(__classPrivateFieldGet(this, _RestrictionManager_keysPressed, "f")).filter((key) => __classPrivateFieldGet(this, _RestrictionManager_keysPressed, "f")[key] === true);
|
|
144
|
+
}
|
|
145
|
+
getToggleKeys() {
|
|
146
|
+
return Object.keys(__classPrivateFieldGet(this, _RestrictionManager_keysToggled, "f")).filter((key) => __classPrivateFieldGet(this, _RestrictionManager_keysToggled, "f")[key] === true);
|
|
133
147
|
}
|
|
134
148
|
getRestriction(token) {
|
|
135
149
|
return __classPrivateFieldGet(this, _RestrictionManager_restrictions, "f")[token];
|
|
@@ -137,6 +151,7 @@ class RestrictionManager {
|
|
|
137
151
|
rayTrace(ray, metaData) {
|
|
138
152
|
const restrictionResults = [];
|
|
139
153
|
metaData.pressedKeys = this.getPressedKeys();
|
|
154
|
+
metaData.toggledKeys = this.getToggleKeys();
|
|
140
155
|
for (const restrictionId in __classPrivateFieldGet(this, _RestrictionManager_restrictions, "f")) {
|
|
141
156
|
const restriction = __classPrivateFieldGet(this, _RestrictionManager_restrictions, "f")[restrictionId];
|
|
142
157
|
const hit = restriction.rayTrace(ray, metaData);
|
|
@@ -150,7 +165,8 @@ class RestrictionManager {
|
|
|
150
165
|
if (restrictionResults.length === 0)
|
|
151
166
|
return;
|
|
152
167
|
// first, sort the results by distance
|
|
153
|
-
restrictionResults.sort((a, b) => a.distanceOriginToClosestIntersectionPointSquared -
|
|
168
|
+
restrictionResults.sort((a, b) => a.distanceOriginToClosestIntersectionPointSquared -
|
|
169
|
+
b.distanceOriginToClosestIntersectionPointSquared);
|
|
154
170
|
/**
|
|
155
171
|
* We iterate over the results and check if the restriction with the higher priority has a radius
|
|
156
172
|
* and if the hit of the restriction with the higher priority is within the radius of the restriction with the lower priority.
|
|
@@ -160,19 +176,24 @@ class RestrictionManager {
|
|
|
160
176
|
let restrictionResult = restrictionResults[0];
|
|
161
177
|
for (const result of restrictionResults) {
|
|
162
178
|
// if the priority of the restriction is higher than the priority of the restriction that is currently hit
|
|
163
|
-
if (result.restriction.priority >
|
|
179
|
+
if (result.restriction.priority >
|
|
180
|
+
restrictionResult.restriction.priority) {
|
|
164
181
|
// check if the closest point of the restriction with the higher priority is within the radius of the restriction with the lower priority
|
|
165
182
|
const hitHigherPriority = result.closestIntersectionPoint;
|
|
166
|
-
if (restrictionResult.restriction instanceof PointRestriction_1.PointRestriction ||
|
|
183
|
+
if (restrictionResult.restriction instanceof PointRestriction_1.PointRestriction ||
|
|
184
|
+
restrictionResult.restriction instanceof LineRestriction_1.LineRestriction) {
|
|
167
185
|
if (restrictionResult.restriction.isWithinRadius(hitHigherPriority)) {
|
|
168
186
|
restrictionResult = result;
|
|
169
187
|
}
|
|
170
188
|
}
|
|
171
189
|
}
|
|
172
|
-
else if (result.restriction.priority ===
|
|
190
|
+
else if (result.restriction.priority ===
|
|
191
|
+
restrictionResult.restriction.priority) {
|
|
173
192
|
// if the priority is the same, we check the distance id the type is a point or line restriction
|
|
174
|
-
if (result.restriction instanceof PointRestriction_1.PointRestriction ||
|
|
175
|
-
|
|
193
|
+
if (result.restriction instanceof PointRestriction_1.PointRestriction ||
|
|
194
|
+
result.restriction instanceof LineRestriction_1.LineRestriction) {
|
|
195
|
+
if (result.distanceClosestPointToTargetPointSquared <
|
|
196
|
+
restrictionResult.distanceClosestPointToTargetPointSquared) {
|
|
176
197
|
restrictionResult = result;
|
|
177
198
|
}
|
|
178
199
|
}
|
|
@@ -184,7 +205,9 @@ class RestrictionManager {
|
|
|
184
205
|
const filter = (node, geometryData) => {
|
|
185
206
|
if (node.visible === false)
|
|
186
207
|
return false;
|
|
187
|
-
if (geometryData &&
|
|
208
|
+
if (geometryData &&
|
|
209
|
+
geometryData.material &&
|
|
210
|
+
geometryData.material.opacity < 1.0)
|
|
188
211
|
return false;
|
|
189
212
|
return true;
|
|
190
213
|
};
|
|
@@ -192,21 +215,30 @@ class RestrictionManager {
|
|
|
192
215
|
const sceneRayTrace = __classPrivateFieldGet(this, _RestrictionManager_viewport, "f").raytraceScene(ray.origin, ray.direction, [filter]);
|
|
193
216
|
if (sceneRayTrace.length > 0) {
|
|
194
217
|
const squaredDistanceSceneRayTrace = sceneRayTrace[0].distance * sceneRayTrace[0].distance;
|
|
195
|
-
if (squaredDistanceSceneRayTrace <
|
|
218
|
+
if (squaredDistanceSceneRayTrace <
|
|
219
|
+
restrictionResult.distanceOriginToClosestIntersectionPointSquared) {
|
|
196
220
|
// the second check is to make sure that the geometry data of the geometry restriction and the scene ray trace is available
|
|
197
|
-
if (restrictionResult.restriction.type !==
|
|
221
|
+
if (restrictionResult.restriction.type !==
|
|
222
|
+
IRestriction_1.RESTRICTION_TYPE.GEOMETRY ||
|
|
223
|
+
(restrictionResult.restriction.type ===
|
|
224
|
+
IRestriction_1.RESTRICTION_TYPE.GEOMETRY &&
|
|
225
|
+
(!restrictionResult.restrictionIntersectionData ||
|
|
226
|
+
!sceneRayTrace[0].data)))
|
|
198
227
|
return;
|
|
199
228
|
const geometryRestrictionIntersectionData = restrictionResult.restrictionIntersectionData;
|
|
200
229
|
// it is NOT the same geometry
|
|
201
|
-
if (!(geometryRestrictionIntersectionData.geometryData
|
|
202
|
-
|
|
230
|
+
if (!(geometryRestrictionIntersectionData.geometryData
|
|
231
|
+
.id === sceneRayTrace[0].data.id &&
|
|
232
|
+
geometryRestrictionIntersectionData.geometryData
|
|
233
|
+
.version === sceneRayTrace[0].data.version))
|
|
203
234
|
return;
|
|
204
235
|
}
|
|
205
236
|
}
|
|
206
237
|
}
|
|
207
238
|
// deactivate the visualization of all restrictions that are not hit
|
|
208
239
|
for (const restriction of Object.values(__classPrivateFieldGet(this, _RestrictionManager_restrictions, "f"))) {
|
|
209
|
-
if (restrictionResult &&
|
|
240
|
+
if (restrictionResult &&
|
|
241
|
+
restriction !== restrictionResult.restriction) {
|
|
210
242
|
for (const snapRestriction of Object.values(restriction.snapRestrictions)) {
|
|
211
243
|
snapRestriction.active = false;
|
|
212
244
|
}
|
|
@@ -220,7 +252,7 @@ class RestrictionManager {
|
|
|
220
252
|
closestPointOnRay: restrictionResult.closestIntersectionPoint,
|
|
221
253
|
distanceSquared: restrictionResult.distanceOriginToClosestIntersectionPointSquared,
|
|
222
254
|
dragAnchor: dragAnchor,
|
|
223
|
-
transformation: matrix
|
|
255
|
+
transformation: matrix,
|
|
224
256
|
};
|
|
225
257
|
}
|
|
226
258
|
else {
|
|
@@ -234,7 +266,7 @@ class RestrictionManager {
|
|
|
234
266
|
}
|
|
235
267
|
removeRestriction(token) {
|
|
236
268
|
if (__classPrivateFieldGet(this, _RestrictionManager_restrictions, "f")[token]) {
|
|
237
|
-
Object.values(__classPrivateFieldGet(this, _RestrictionManager_restrictions, "f")[token].snapRestrictions).forEach(r => r.removeVisualization());
|
|
269
|
+
Object.values(__classPrivateFieldGet(this, _RestrictionManager_restrictions, "f")[token].snapRestrictions).forEach((r) => r.removeVisualization());
|
|
238
270
|
__classPrivateFieldGet(this, _RestrictionManager_restrictions, "f")[token].removeVisualization();
|
|
239
271
|
delete __classPrivateFieldGet(this, _RestrictionManager_restrictions, "f")[token];
|
|
240
272
|
return true;
|
|
@@ -251,6 +283,10 @@ class RestrictionManager {
|
|
|
251
283
|
if (this.closed)
|
|
252
284
|
return;
|
|
253
285
|
__classPrivateFieldGet(this, _RestrictionManager_keysPressed, "f")[event.key] = true;
|
|
286
|
+
if (__classPrivateFieldGet(this, _RestrictionManager_keysToggled, "f")[event.key] === undefined)
|
|
287
|
+
__classPrivateFieldGet(this, _RestrictionManager_keysToggled, "f")[event.key] = true;
|
|
288
|
+
else
|
|
289
|
+
__classPrivateFieldGet(this, _RestrictionManager_keysToggled, "f")[event.key] = !__classPrivateFieldGet(this, _RestrictionManager_keysToggled, "f")[event.key];
|
|
254
290
|
}
|
|
255
291
|
onKeyUp(event) {
|
|
256
292
|
if (this.closed)
|
|
@@ -271,5 +307,5 @@ class RestrictionManager {
|
|
|
271
307
|
}
|
|
272
308
|
}
|
|
273
309
|
exports.RestrictionManager = RestrictionManager;
|
|
274
|
-
_RestrictionManager_eventManager = new WeakMap(), _RestrictionManager_geometryMathManager = new WeakMap(), _RestrictionManager_parentNode = new WeakMap(), _RestrictionManager_restrictions = new WeakMap(), _RestrictionManager_settings = new WeakMap(), _RestrictionManager_uuidGenerator = new WeakMap(), _RestrictionManager_viewport = new WeakMap(), _RestrictionManager_closed = new WeakMap(), _RestrictionManager_keysPressed = new WeakMap(), _RestrictionManager_restrictionManagerNode = new WeakMap(), _RestrictionManager_showRestrictionVisualization = new WeakMap();
|
|
310
|
+
_RestrictionManager_eventManager = new WeakMap(), _RestrictionManager_geometryMathManager = new WeakMap(), _RestrictionManager_parentNode = new WeakMap(), _RestrictionManager_restrictions = new WeakMap(), _RestrictionManager_settings = new WeakMap(), _RestrictionManager_uuidGenerator = new WeakMap(), _RestrictionManager_viewport = new WeakMap(), _RestrictionManager_closed = new WeakMap(), _RestrictionManager_keysPressed = new WeakMap(), _RestrictionManager_keysToggled = new WeakMap(), _RestrictionManager_restrictionManagerNode = new WeakMap(), _RestrictionManager_showRestrictionVisualization = new WeakMap();
|
|
275
311
|
//# sourceMappingURL=RestrictionManager.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RestrictionManager.js","sourceRoot":"","sources":["../../src/implementation/RestrictionManager.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"RestrictionManager.js","sourceRoot":"","sources":["../../src/implementation/RestrictionManager.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,+CAA2D;AAC3D,iFAAwE;AACxE,+EAAiE;AAMjE,6DASoC;AAGpC,iDAA4C;AAC5C,+DAA0D;AAC1D,+FAG4D;AAC5D,qFAIqD;AACrD,yEAG6C;AAC7C,4EAG+C;AAC/C,4EAG+C;AAC/C,0EAAsE;AAEtE,MAAa,kBAAkB;IAsC9B,6BAA6B;IAE7B,2BAA2B;IAE3B,YACC,QAAsB,EACtB,aAAwB,kBAAS,CAAC,IAAI,EACtC,YAAsC,EACtC,QAAiC;QA7ClC,0BAA0B;QAE1B,mDAAqC;QACrC,0DAAmD;QACnD,iDAAgC;QAChC,2CAA0D,EAAE,EAAC;QAC7D,uCAA6C;YAC5C,cAAc,EAAE,IAAI;YACpB,4BAA4B,EAAE,CAAC;YAC/B,KAAK,EAAE;gBACN,KAAK,EAAE,SAAS;aAChB;YACD,WAAW,EAAE,KAAK;YAClB,MAAM,EAAE;gBACP,MAAM,EAAE,EAAE;gBACV,MAAM,EAAE,EAAE;gBACV,MAAM,EAAE,EAAE;gBACV,MAAM,EAAE,EAAE;gBACV,MAAM,EAAE,EAAE;gBACV,MAAM,EAAE,EAAE;gBACV,OAAO,EAAE,SAAS;gBAClB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AAK;QACZ,IAAI,IAAI,CAAC,MAAM;YAAE,OAAO;IACzB,CAAC;IAEO,IAAI;QACX,IAAI,IAAI,CAAC,MAAM;YAAE,OAAO;IACzB,CAAC;CAGD;AAraD,gDAqaC"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
1
|
+
import { IViewportApi } from "@shapediver/viewer";
|
|
2
|
+
import { ITreeNode } from "@shapediver/viewer.shared.node-tree";
|
|
3
|
+
import { IRay } from "@shapediver/viewer.shared.types";
|
|
4
|
+
import { vec3 } from "gl-matrix";
|
|
5
|
+
import * as THREE from "three";
|
|
6
|
+
import { IRestriction, RestrictionMetaData, RestrictionProperties, RestrictionResult, RESTRICTION_TYPE } from "../../interfaces/IRestriction";
|
|
7
|
+
import { ISnapRestriction } from "../../interfaces/ISnapRestriction";
|
|
8
8
|
export declare abstract class AbstractRestriction implements IRestriction {
|
|
9
9
|
#private;
|
|
10
10
|
protected _enabled: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AbstractRestriction.d.ts","sourceRoot":"","sources":["../../../src/implementation/restrictions/AbstractRestriction.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"AbstractRestriction.d.ts","sourceRoot":"","sources":["../../../src/implementation/restrictions/AbstractRestriction.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,YAAY,EAAC,MAAM,oBAAoB,CAAC;AAEhD,OAAO,EAAC,SAAS,EAAW,MAAM,qCAAqC,CAAC;AACxE,OAAO,EAAC,IAAI,EAAC,MAAM,iCAAiC,CAAC;AACrD,OAAO,EAAC,IAAI,EAAC,MAAM,WAAW,CAAC;AAC/B,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EACN,YAAY,EACZ,mBAAmB,EACnB,qBAAqB,EACrB,iB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B,QAAQ,CACvB,GAAG,EAAE,IAAI,EACT,QAAQ,CAAC,EAAE,mBAAmB,GAC5B,iBAAiB,GAAG,SAAS;IAMhC,SAAS,CAAC,QAAQ,CAAC,iBAAiB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI;IAM5D,OAAO,CAAC,sBAAsB;CAiB9B"}
|
|
@@ -36,10 +36,10 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
|
|
|
36
36
|
var _AbstractRestriction_id, _AbstractRestriction_parentNode, _AbstractRestriction_type, _AbstractRestriction_viewport, _AbstractRestriction_visualizationNode, _AbstractRestriction_hideable, _AbstractRestriction_priority, _AbstractRestriction_rotation, _AbstractRestriction_showVisualization;
|
|
37
37
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
38
38
|
exports.AbstractRestriction = void 0;
|
|
39
|
-
const THREE = __importStar(require("three"));
|
|
40
|
-
const viewer_shared_node_tree_1 = require("@shapediver/viewer.shared.node-tree");
|
|
41
39
|
const viewer_rendering_engine_rendering_engine_threejs_1 = require("@shapediver/viewer.rendering-engine.rendering-engine-threejs");
|
|
40
|
+
const viewer_shared_node_tree_1 = require("@shapediver/viewer.shared.node-tree");
|
|
42
41
|
const gl_matrix_1 = require("gl-matrix");
|
|
42
|
+
const THREE = __importStar(require("three"));
|
|
43
43
|
class AbstractRestriction {
|
|
44
44
|
// #endregion Properties (12)
|
|
45
45
|
// #region Constructors (1)
|
|
@@ -49,7 +49,7 @@ class AbstractRestriction {
|
|
|
49
49
|
_AbstractRestriction_parentNode.set(this, void 0);
|
|
50
50
|
_AbstractRestriction_type.set(this, void 0);
|
|
51
51
|
_AbstractRestriction_viewport.set(this, void 0);
|
|
52
|
-
_AbstractRestriction_visualizationNode.set(this, new viewer_shared_node_tree_1.TreeNode(
|
|
52
|
+
_AbstractRestriction_visualizationNode.set(this, new viewer_shared_node_tree_1.TreeNode("RestrictionVisualizationNode"));
|
|
53
53
|
_AbstractRestriction_hideable.set(this, false);
|
|
54
54
|
_AbstractRestriction_priority.set(this, void 0);
|
|
55
55
|
_AbstractRestriction_rotation.set(this, void 0);
|
|
@@ -61,7 +61,10 @@ class AbstractRestriction {
|
|
|
61
61
|
__classPrivateFieldSet(this, _AbstractRestriction_viewport, viewport, "f");
|
|
62
62
|
__classPrivateFieldSet(this, _AbstractRestriction_id, id, "f");
|
|
63
63
|
__classPrivateFieldSet(this, _AbstractRestriction_type, properties.type, "f");
|
|
64
|
-
__classPrivateFieldSet(this, _AbstractRestriction_rotation, properties.rotation || {
|
|
64
|
+
__classPrivateFieldSet(this, _AbstractRestriction_rotation, properties.rotation || {
|
|
65
|
+
axis: gl_matrix_1.vec3.fromValues(0, 0, 1),
|
|
66
|
+
angle: 0,
|
|
67
|
+
}, "f");
|
|
65
68
|
__classPrivateFieldSet(this, _AbstractRestriction_priority, properties.priority || -1, "f");
|
|
66
69
|
__classPrivateFieldSet(this, _AbstractRestriction_hideable, properties.hideable || false, "f");
|
|
67
70
|
this.createGridHelperObject();
|
|
@@ -124,7 +127,7 @@ class AbstractRestriction {
|
|
|
124
127
|
createGridHelperObject() {
|
|
125
128
|
this._object3D = new THREE.Object3D();
|
|
126
129
|
this._object3D.visible = false;
|
|
127
|
-
const node = new viewer_shared_node_tree_1.TreeNode(
|
|
130
|
+
const node = new viewer_shared_node_tree_1.TreeNode("ThreeJsDataNode");
|
|
128
131
|
const data = new viewer_rendering_engine_rendering_engine_threejs_1.ThreejsData(this._object3D);
|
|
129
132
|
node.addData(data);
|
|
130
133
|
__classPrivateFieldGet(this, _AbstractRestriction_visualizationNode, "f").addChild(node);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AbstractRestriction.js","sourceRoot":"","sources":["../../../src/implementation/restrictions/AbstractRestriction.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"AbstractRestriction.js","sourceRoot":"","sources":["../../../src/implementation/restrictions/AbstractRest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AY,CAAC,WAAW,CAAC,uBAAA,IAAI,8CAAmB,CAAC,CAAC;QACtD,uBAAA,IAAI,uCAAY,CAAC,aAAa,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;QAC7C,uBAAA,IAAI,qCAAU,CAAC,UAAU,CAAC,uBAAA,IAAI,uCAAY,CAAC,CAAC;IAC7C,CAAC;IAiBD,4CAA4C;IAE5C,8BAA8B;IAEtB,sBAAsB;QAC7B,IAAI,CAAC,SAAS,GAAG,IAAI,KAAK,CAAC,QAAQ,EAAE,CAAC;QACtC,IAAI,CAAC,SAAS,CAAC,OAAO,GAAG,KAAK,CAAC;QAE/B,MAAM,IAAI,GAAG,IAAI,kCAAQ,CAAC,iBAAiB,CAAC,CAAC;QAE7C,MAAM,IAAI,GAAG,IAAI,8DAAW,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;QAC7C,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;QAEnB,uBAAA,IAAI,8CAAmB,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;QACvC,uBAAA,IAAI,8CAAmB,CAAC,aAAa,EAAE,CAAC;QACxC,uBAAA,IAAI,uCAAY,CAAC,QAAQ,CAAC,uBAAA,IAAI,8CAAmB,CAAC,CAAC;QACnD,uBAAA,IAAI,uCAAY,CAAC,aAAa,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;QAC7C,uBAAA,IAAI,qCAAU,CAAC,UAAU,CAAC,uBAAA,IAAI,uCAAY,CAAC,CAAC;IAC7C,CAAC;CAGD;AAvJD,kDAuJC"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
6
|
-
import { RestrictionMetaData, RestrictionResult } from
|
|
7
|
-
import {
|
|
1
|
+
import { IViewportApi } from "@shapediver/viewer";
|
|
2
|
+
import { ITreeNode } from "@shapediver/viewer.shared.node-tree";
|
|
3
|
+
import { IRay } from "@shapediver/viewer.shared.types";
|
|
4
|
+
import { vec3 } from "gl-matrix";
|
|
5
|
+
import * as THREE from "three";
|
|
6
|
+
import { RestrictionMetaData, RestrictionResult } from "../../interfaces/IRestriction";
|
|
7
|
+
import { ISnapRestriction } from "../../interfaces/ISnapRestriction";
|
|
8
8
|
export declare abstract class AbstractSnapRestriction implements ISnapRestriction {
|
|
9
9
|
#private;
|
|
10
10
|
protected _active: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AbstractSnapRestriction.d.ts","sourceRoot":"","sources":["../../../src/implementation/restrictions/AbstractSnapRestriction.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"AbstractSnapRestriction.d.ts","sourceRoot":"","sources":["../../../src/implementation/restrictions/AbstractSnapRestriction.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,YAAY,EAAC,MAAM,oBAAoB,CAAC;AAEhD,OAAO,EAAC,SAAS,EAAW,MAAM,qCAAqC,CAAC;AACxE,OAAO,EAAC,IAAI,EAAC,MAAM,iCAAiC,CAAC;AACrD,OAAO,EAAC,IAAI,EAAC,MAAM,WAAW,CAAC;AAC/B,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EACN,mBAAmB,EACnB,iBAAiB,EACjB,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAAC,gBAAgB,EAAC,MAAM,mCAAmC,CAAC;AAEnE,8BAAsB,uBAAwB,YAAW,gBAAgB;;IAYxE,SAAS,CAAC,OAAO,EAAE,OAAO,CAAS;IACnC,SAAS,CAAC,QAAQ,EAAE,OAAO,CAAQ;IACnC,SAAS,CAAC,gBAAgB,EAAE,OAAO,CAAQ;IAC3C,SAAS,CAAC,SAAS,EAAG,KAAK,CAAC,QAAQ,CAAC;IACrC,SAAS,CAAC,SAAS,EAAE,MAAM,CAAK;gBAMpB,QAAQ,EAAE,YAAY,EAAE,UAAU,EAAE,SAAS,EAAE,EAAE,EAAE,MAAM;IAWrE,IAAW,MAAM,IAAI,OAAO,CAE3B;IAED,IAAW,MAAM,CAAC,KAAK,EAAE,OAAO,EAE/B;IAED,IAAW,OAAO,IAAI,OAAO,CAE5B;IAED,IAAW,OAAO,CAAC,KAAK,EAAE,OAAO,EAKhC;IAED,IAAW,eAAe,IAAI,OAAO,CAEpC;IAED,IAAW,eAAe,CAAC,KAAK,EAAE,OAAO,EAExC;IAED,IAAW,EAAE,IAAI,MAAM,CAEtB;IAED,IAAW,QAAQ,IAAI,MAAM,CAE5B;IAED,IAAW,QAAQ,CAAC,KAAK,EAAE,MAAM,EAEhC;IAED,IAAW,iBAAiB,IAAI,OAAO,CAEtC;IAED,IAAW,iBAAiB,CAAC,KAAK,EAAE,OAAO,EAI1C;IAMM,mBAAmB,IAAI,IAAI;aAUlB,IAAI,CACnB,GAAG,EAAE,IAAI,EACT,KAAK,EAAE,IAAI,EACX,QAAQ,EAAE,MAAM,EAChB,QAAQ,CAAC,EAAE,mBAAmB,GAC5B,iBAAiB,GAAG,SAAS;IAMhC,SAAS,CAAC,QAAQ,CAAC,iBAAiB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI;IAM5D,OAAO,CAAC,sBAAsB;CAiB9B"}
|
|
@@ -36,9 +36,9 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
|
|
|
36
36
|
var _AbstractSnapRestriction_id, _AbstractSnapRestriction_parentNode, _AbstractSnapRestriction_viewport, _AbstractSnapRestriction_visualizationNode, _AbstractSnapRestriction_showVisualization;
|
|
37
37
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
38
38
|
exports.AbstractSnapRestriction = void 0;
|
|
39
|
-
const THREE = __importStar(require("three"));
|
|
40
|
-
const viewer_shared_node_tree_1 = require("@shapediver/viewer.shared.node-tree");
|
|
41
39
|
const viewer_rendering_engine_rendering_engine_threejs_1 = require("@shapediver/viewer.rendering-engine.rendering-engine-threejs");
|
|
40
|
+
const viewer_shared_node_tree_1 = require("@shapediver/viewer.shared.node-tree");
|
|
41
|
+
const THREE = __importStar(require("three"));
|
|
42
42
|
class AbstractSnapRestriction {
|
|
43
43
|
// #endregion Properties (10)
|
|
44
44
|
// #region Constructors (1)
|
|
@@ -47,7 +47,7 @@ class AbstractSnapRestriction {
|
|
|
47
47
|
_AbstractSnapRestriction_id.set(this, void 0);
|
|
48
48
|
_AbstractSnapRestriction_parentNode.set(this, void 0);
|
|
49
49
|
_AbstractSnapRestriction_viewport.set(this, void 0);
|
|
50
|
-
_AbstractSnapRestriction_visualizationNode.set(this, new viewer_shared_node_tree_1.TreeNode(
|
|
50
|
+
_AbstractSnapRestriction_visualizationNode.set(this, new viewer_shared_node_tree_1.TreeNode("RestrictionVisualizationNode"));
|
|
51
51
|
_AbstractSnapRestriction_showVisualization.set(this, false);
|
|
52
52
|
this._active = false;
|
|
53
53
|
this._enabled = true;
|
|
@@ -110,7 +110,7 @@ class AbstractSnapRestriction {
|
|
|
110
110
|
createGridHelperObject() {
|
|
111
111
|
this._object3D = new THREE.Object3D();
|
|
112
112
|
this._object3D.visible = false;
|
|
113
|
-
const node = new viewer_shared_node_tree_1.TreeNode(
|
|
113
|
+
const node = new viewer_shared_node_tree_1.TreeNode("ThreeJsDataNode");
|
|
114
114
|
const data = new viewer_rendering_engine_rendering_engine_threejs_1.ThreejsData(this._object3D);
|
|
115
115
|
node.addData(data);
|
|
116
116
|
__classPrivateFieldGet(this, _AbstractSnapRestriction_visualizationNode, "f").addChild(node);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AbstractSnapRestriction.js","sourceRoot":"","sources":["../../../src/implementation/restrictions/AbstractSnapRestriction.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"AbstractSnapRestriction.js","sourceRoot":"","sources":["../../../src/implementation/restrictions/AbstractSnapRestriction.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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IAAI,kDAAmB,CAAC,aAAa,EAAE,CAAC;QACxC,uBAAA,IAAI,2CAAY,CAAC,QAAQ,CAAC,uBAAA,IAAI,kDAAmB,CAAC,CAAC;QACnD,uBAAA,IAAI,2CAAY,CAAC,aAAa,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;QAC7C,uBAAA,IAAI,yCAAU,CAAC,UAAU,CAAC,uBAAA,IAAI,2CAAY,CAAC,CAAC;IAC7C,CAAC;CAGD;AAlID,0DAkIC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { mat4, vec3 } from "gl-matrix";
|
|
2
|
+
import { IDragAnchor } from "../../interfaces/IDragAnchor";
|
|
3
3
|
export declare const calculateDragMatrix: (snapPoint: vec3, snapRotation: {
|
|
4
4
|
axis: vec3;
|
|
5
5
|
angle: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RestrictionsHelper.d.ts","sourceRoot":"","sources":["../../../src/implementation/restrictions/RestrictionsHelper.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"RestrictionsHelper.d.ts","sourceRoot":"","sources":["../../../src/implementation/restrictions/RestrictionsHelper.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,IAAI,EAAE,IAAI,EAAC,MAAM,WAAW,CAAC;AACrC,OAAO,EAAC,WAAW,EAAC,MAAM,8BAA8B,CAAC;AAEzD,eAAO,MAAM,mBAAmB,cACpB,IAAI,gBACD;IACb,IAAI,EAAE,IAAI,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;CACd,cACW,IAAI,wDAEF,IAAI,KAChB;IACF,MAAM,EAAE,IAAI,CAAC;IACb,UAAU,CAAC,EAAE,WAAW,CAAC;IACzB,KAAK,EAAE,IAAI,CAAC;CA0CZ,CAAC"}
|
|
@@ -6,17 +6,21 @@ const calculateDragMatrix = (snapPoint, snapRotation, dragOrigin, dragAnchors =
|
|
|
6
6
|
if (dragAnchors.length > 0) {
|
|
7
7
|
const results = [];
|
|
8
8
|
for (let i = 0; i < dragAnchors.length; i++) {
|
|
9
|
-
const matrix = calculateMatrix(dragAnchors[i].position, dragAnchors[i].rotation || {
|
|
9
|
+
const matrix = calculateMatrix(dragAnchors[i].position, dragAnchors[i].rotation || {
|
|
10
|
+
axis: gl_matrix_1.vec3.fromValues(0, 0, 1),
|
|
11
|
+
angle: 0,
|
|
12
|
+
}, snapPoint, snapRotation);
|
|
10
13
|
const point = gl_matrix_1.vec3.transformMat4(gl_matrix_1.vec3.create(), dragOrigin, matrix);
|
|
11
14
|
results.push({ matrix, point, dragAnchor: dragAnchors[i] });
|
|
12
15
|
}
|
|
13
|
-
results.sort((a, b) => gl_matrix_1.vec3.distance(a.point, closestPoint) -
|
|
16
|
+
results.sort((a, b) => gl_matrix_1.vec3.distance(a.point, closestPoint) -
|
|
17
|
+
gl_matrix_1.vec3.distance(b.point, closestPoint));
|
|
14
18
|
return results[0];
|
|
15
19
|
}
|
|
16
20
|
else {
|
|
17
21
|
return {
|
|
18
22
|
matrix: calculateMatrix(dragOrigin, { axis: gl_matrix_1.vec3.fromValues(0, 0, 1), angle: 0 }, snapPoint, snapRotation),
|
|
19
|
-
point: dragOrigin
|
|
23
|
+
point: dragOrigin,
|
|
20
24
|
};
|
|
21
25
|
}
|
|
22
26
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RestrictionsHelper.js","sourceRoot":"","sources":["../../../src/implementation/restrictions/RestrictionsHelper.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"RestrictionsHelper.js","sourceRoot":"","sources":["../../../src/implementation/restrictions/RestrictionsHelper.ts"],"names":[],"mappings":";;;AAAA,yCAAqC;AAG9B,MAAM,mBAAmB,GAAG,CAClC,SAAe,EACf,YAGC,EACD,UAAgB,EAChB,cAA6B,EAAE,EAC/B,YAAkB,EAKjB,EAAE;IACH,IAAI,WAAW,CAAC,MAAM,GAAG,CAAC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IACF,MAAM,iBAAiB,GAAG,gBAAI,CAAC,eAAe,CAC7C,gBAAI,CAAC,MAAM,EAAE,EACb,eAAe,CACf,CAAC;IAEF,OAAO,gBAAI,CAAC,QAAQ,CAAC,gBAAI,CAAC,MAAM,EAAE,EAAE,cAAc,EAAE,iBAAiB,CAAC,CAAC;AACxE,CAAC,CAAC"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
1
|
+
import { ITreeNode, IViewportApi } from "@shapediver/viewer";
|
|
2
|
+
import { IRay } from "@shapediver/viewer.shared.types";
|
|
3
|
+
import { IRestriction, RestrictionMetaData, RestrictionPropertiesBase, RestrictionResult } from "../../../interfaces/IRestriction";
|
|
4
|
+
import { ISnapRestriction } from "../../../interfaces/ISnapRestriction";
|
|
5
|
+
import { IVisualizationSettings } from "../../../interfaces/IVisualizationSettings";
|
|
6
|
+
import { GeometryMathManager } from "../../GeometryMathManager";
|
|
7
|
+
import { AbstractRestriction } from "../AbstractRestriction";
|
|
8
8
|
export interface CameraPlaneRestrictionProperties extends RestrictionPropertiesBase {
|
|
9
9
|
}
|
|
10
10
|
export declare class CameraPlaneRestriction extends AbstractRestriction implements IRestriction {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CameraPlaneRestriction.d.ts","sourceRoot":"","sources":["../../../../src/implementation/restrictions/camera_plane/CameraPlaneRestriction.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"CameraPlaneRestriction.d.ts","sourceRoot":"","sources":["../../../../src/implementation/restrictions/camera_plane/CameraPlaneRestriction.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAE,YAAY,EAAC,MAAM,oBAAoB,CAAC;AAE3D,OAAO,EAAC,IAAI,EAAC,MAAM,iCAAiC,CAAC;AAErD,OAAO,EACN,YAAY,EACZ,mBAAmB,EACnB,yBAAyB,EACzB,iBAAiB,EACjB,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EAAC,gBAAgB,EAAC,MAAM,sCAAsC,CAAC;AACtE,OAAO,EAAC,sBAAsB,EAAC,MAAM,4CAA4C,CAAC;AAClF,OAAO,EAAC,mBAAmB,EAAC,MAAM,2BAA2B,CAAC;AAC9D,OAAO,EAAC,mBAAmB,EAAC,MAAM,wBAAwB,CAAC;AAK3D,MAAM,WAAW,gCAChB,SAAQ,yBAAyB;CAAG;AAMrC,qBAAa,sBACZ,SAAQ,mBACR,YAAW,YAAY;;gBActB,QAAQ,EAAE,YAAY,EACtB,mBAAmB,EAAE,mBAAmB,EACxC,UAAU,EAAE,SAAS,EACrB,EAAE,EAAE,MAAM,EACV,QAAQ,EAAE,sBAAsB,EAChC,UAAU,EAAE,gCAAgC;IAW7C,IAAW,gBAAgB,IAAI;QAAC,CAAC,GAAG,EAAE,MAAM,GAAG,gBAAgB,CAAA;KAAC,CAE/D;IAMM,QAAQ,CACd,GAAG,EAAE,IAAI,EACT,QAAQ,EAAE,mBAAmB,GAC3B,iBAAiB,GAAG,SAAS;IAyChC,SAAS,CAAC,iBAAiB,IAAI,IAAI;CAGnC"}
|
|
@@ -13,9 +13,9 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
|
|
|
13
13
|
var _CameraPlaneRestriction_viewport, _CameraPlaneRestriction_dragPlane, _CameraPlaneRestriction_snapRestrictions;
|
|
14
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
15
|
exports.CameraPlaneRestriction = void 0;
|
|
16
|
-
const AbstractRestriction_1 = require("../AbstractRestriction");
|
|
17
16
|
const viewer_shared_math_1 = require("@shapediver/viewer.shared.math");
|
|
18
17
|
const gl_matrix_1 = require("gl-matrix");
|
|
18
|
+
const AbstractRestriction_1 = require("../AbstractRestriction");
|
|
19
19
|
// #endregion Type aliases (1)
|
|
20
20
|
// #region Classes (1)
|
|
21
21
|
class CameraPlaneRestriction extends AbstractRestriction_1.AbstractRestriction {
|
|
@@ -48,7 +48,7 @@ class CameraPlaneRestriction extends AbstractRestriction_1.AbstractRestriction {
|
|
|
48
48
|
distanceOriginToClosestIntersectionPointSquared: distance * distance,
|
|
49
49
|
targetPoint: point,
|
|
50
50
|
distanceClosestPointToTargetPointSquared: 0,
|
|
51
|
-
restriction: this
|
|
51
|
+
restriction: this,
|
|
52
52
|
};
|
|
53
53
|
}
|
|
54
54
|
return;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CameraPlaneRestriction.js","sourceRoot":"","sources":["../../../../src/implementation/restrictions/camera_plane/CameraPlaneRestriction.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"CameraPlaneRestriction.js","sourceRoot":"","sources":["../../../../src/implementation/restrictions/camera_plane/CameraPlaneRestriction.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AACA,uEAA6D;AAE7D,yCAA+B;AAU/B,gEAA2D;AAQ3D,8BAA8B;AAE9B,sBAAsB;AAEtB,MAAa,sBACZ,SAAQ,yCAAmB;IAU3B,4BAA4B;IAE5B,2BAA2B;IAE3B,YACC,QAAsB,EACtB,mBAAwC,EACxC,UAAqB,EACrB,EAAU,EACV,QAAgC,EAChC,UAA4C;QAE5C,KAAK,CAAC,QAAQ,EAAE,UAAU,EAAE,EAAE,EAAE,UAAU,CAAC,CAAC;QAnB7C,yBAAyB;QAEzB,mDAAiC;QAEjC,oDAAoB;QACpB,mDAAuD,EAAE,EAAC;QAgBzD,uBAAA,IAAI,oCAAa,QAAQ,MAAA,CAAC;IAC3B,CAAC;IAED,8BAA8B;IAE9B,yCAAyC;IAEzC,IAAW,gBAAgB;QAC1B,OAAO,uBAAA,IAAI,gDAAkB,CAAC;IAC/B,CAAC;IAED,4CAA4C;IAE5C,6BAA6B;IAEtB,QAAQ,CACd,GAAS,EACT,QAA6B;;QAE7B,MAAM,eAAe,GAAG,gBA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