@shapediver/viewer.rendering-engine.intersection-restriction-engine 3.7.5 → 3.8.1
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/dist/implementation/RestrictionManager.d.ts.map +1 -1
- package/dist/implementation/RestrictionManager.js +55 -26
- package/dist/implementation/RestrictionManager.js.map +1 -1
- package/dist/implementation/restrictions/AbstractRestriction.d.ts +0 -1
- package/dist/implementation/restrictions/AbstractRestriction.d.ts.map +1 -1
- package/dist/implementation/restrictions/AbstractRestriction.js +6 -5
- package/dist/implementation/restrictions/AbstractRestriction.js.map +1 -1
- package/dist/implementation/restrictions/AbstractSnapRestriction.d.ts +1 -1
- package/dist/implementation/restrictions/AbstractSnapRestriction.d.ts.map +1 -1
- package/dist/implementation/restrictions/camera_plane/CameraPlaneRestriction.d.ts +2 -2
- package/dist/implementation/restrictions/camera_plane/CameraPlaneRestriction.d.ts.map +1 -1
- package/dist/implementation/restrictions/camera_plane/CameraPlaneRestriction.js +4 -5
- package/dist/implementation/restrictions/camera_plane/CameraPlaneRestriction.js.map +1 -1
- package/dist/implementation/restrictions/geometry/GeometryRestriction.d.ts +34 -3
- package/dist/implementation/restrictions/geometry/GeometryRestriction.d.ts.map +1 -1
- package/dist/implementation/restrictions/geometry/GeometryRestriction.js +54 -21
- package/dist/implementation/restrictions/geometry/GeometryRestriction.js.map +1 -1
- package/dist/implementation/restrictions/line/LineRestriction.d.ts +12 -3
- package/dist/implementation/restrictions/line/LineRestriction.d.ts.map +1 -1
- package/dist/implementation/restrictions/line/LineRestriction.js +50 -8
- package/dist/implementation/restrictions/line/LineRestriction.js.map +1 -1
- package/dist/implementation/restrictions/plane/PlaneRestriction.d.ts +2 -3
- package/dist/implementation/restrictions/plane/PlaneRestriction.d.ts.map +1 -1
- package/dist/implementation/restrictions/plane/PlaneRestriction.js +9 -10
- package/dist/implementation/restrictions/plane/PlaneRestriction.js.map +1 -1
- package/dist/implementation/restrictions/plane/snap/AngularRestriction.d.ts +1 -1
- package/dist/implementation/restrictions/plane/snap/AngularRestriction.d.ts.map +1 -1
- package/dist/implementation/restrictions/plane/snap/AngularRestriction.js +6 -6
- package/dist/implementation/restrictions/plane/snap/AngularRestriction.js.map +1 -1
- package/dist/implementation/restrictions/plane/snap/AxisRestriction.d.ts +1 -1
- package/dist/implementation/restrictions/plane/snap/AxisRestriction.d.ts.map +1 -1
- package/dist/implementation/restrictions/plane/snap/AxisRestriction.js +6 -5
- package/dist/implementation/restrictions/plane/snap/AxisRestriction.js.map +1 -1
- package/dist/implementation/restrictions/plane/snap/GridRestriction.d.ts +1 -1
- package/dist/implementation/restrictions/plane/snap/GridRestriction.d.ts.map +1 -1
- package/dist/implementation/restrictions/plane/snap/GridRestriction.js +2 -2
- package/dist/implementation/restrictions/plane/snap/GridRestriction.js.map +1 -1
- package/dist/implementation/restrictions/point/PointRestriction.d.ts +9 -3
- package/dist/implementation/restrictions/point/PointRestriction.d.ts.map +1 -1
- package/dist/implementation/restrictions/point/PointRestriction.js +29 -17
- package/dist/implementation/restrictions/point/PointRestriction.js.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/interfaces/IRestriction.d.ts +51 -38
- package/dist/interfaces/IRestriction.d.ts.map +1 -1
- package/dist/interfaces/IRestriction.js +5 -10
- package/dist/interfaces/IRestriction.js.map +1 -1
- package/dist/interfaces/ISnapRestriction.d.ts +2 -1
- package/dist/interfaces/ISnapRestriction.d.ts.map +1 -1
- package/dist/interfaces/ISnapRestriction.js.map +1 -1
- package/package.json +9 -9
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RestrictionManager.d.ts","sourceRoot":"","sources":["../../src/implementation/RestrictionManager.ts"],"names":[],"mappings":"AAEA,OAAO,EACH,2BAA2B,EAC3B,0BAA0B,EAC1B,YAAY,EAEZ,cAAc,EAEd,qBAAqB,
|
|
1
|
+
{"version":3,"file":"RestrictionManager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AC,MAAM;IAId,OAAO,CAAC,KAAK;IAIb,OAAO,CAAC,IAAI;CAKf"}
|
|
@@ -22,7 +22,6 @@ const GeometryRestriction_1 = require("./restrictions/geometry/GeometryRestricti
|
|
|
22
22
|
const viewer_shared_node_tree_1 = require("@shapediver/viewer.shared.node-tree");
|
|
23
23
|
const viewer_1 = require("@shapediver/viewer");
|
|
24
24
|
const LineRestriction_1 = require("./restrictions/line/LineRestriction");
|
|
25
|
-
const gl_matrix_1 = require("gl-matrix");
|
|
26
25
|
const PlaneRestriction_1 = require("./restrictions/plane/PlaneRestriction");
|
|
27
26
|
const PointRestriction_1 = require("./restrictions/point/PointRestriction");
|
|
28
27
|
const viewer_shared_services_1 = require("@shapediver/viewer.shared.services");
|
|
@@ -136,46 +135,76 @@ class RestrictionManager {
|
|
|
136
135
|
return __classPrivateFieldGet(this, _RestrictionManager_restrictions, "f")[token];
|
|
137
136
|
}
|
|
138
137
|
rayTrace(ray, metaData) {
|
|
139
|
-
|
|
138
|
+
const restrictionResults = [];
|
|
140
139
|
metaData.pressedKeys = this.getPressedKeys();
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
for (const restriction of restrictionsSorted) {
|
|
144
|
-
if (rayTracingResult && rayTracingResult.restriction.priority > restriction.priority)
|
|
145
|
-
break;
|
|
140
|
+
for (const restrictionId in __classPrivateFieldGet(this, _RestrictionManager_restrictions, "f")) {
|
|
141
|
+
const restriction = __classPrivateFieldGet(this, _RestrictionManager_restrictions, "f")[restrictionId];
|
|
146
142
|
const hit = restriction.rayTrace(ray, metaData);
|
|
147
143
|
if (!hit)
|
|
148
144
|
continue;
|
|
149
|
-
const
|
|
150
|
-
if (
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
145
|
+
const distanceSquared = hit.distanceOriginToClosestIntersectionPointSquared;
|
|
146
|
+
if (distanceSquared >= Infinity)
|
|
147
|
+
continue;
|
|
148
|
+
restrictionResults.push(hit);
|
|
149
|
+
}
|
|
150
|
+
if (restrictionResults.length === 0)
|
|
151
|
+
return;
|
|
152
|
+
// first, sort the results by distance
|
|
153
|
+
restrictionResults.sort((a, b) => a.distanceOriginToClosestIntersectionPointSquared - b.distanceOriginToClosestIntersectionPointSquared);
|
|
154
|
+
/**
|
|
155
|
+
* We iterate over the results and check if the restriction with the higher priority has a radius
|
|
156
|
+
* and if the hit of the restriction with the higher priority is within the radius of the restriction with the lower priority.
|
|
157
|
+
*
|
|
158
|
+
* If this is the case, we set the restriction with the higher priority as the hit restriction.
|
|
159
|
+
*/
|
|
160
|
+
let restrictionResult = restrictionResults[0];
|
|
161
|
+
for (const result of restrictionResults) {
|
|
162
|
+
// if the priority of the restriction is higher than the priority of the restriction that is currently hit
|
|
163
|
+
if (result.restriction.priority > restrictionResult.restriction.priority) {
|
|
164
|
+
// check if the closest point of the restriction with the higher priority is within the radius of the restriction with the lower priority
|
|
165
|
+
const hitHigherPriority = result.closestIntersectionPoint;
|
|
166
|
+
if (restrictionResult.restriction instanceof PointRestriction_1.PointRestriction || restrictionResult.restriction instanceof LineRestriction_1.LineRestriction) {
|
|
167
|
+
if (restrictionResult.restriction.isWithinRadius(hitHigherPriority)) {
|
|
168
|
+
restrictionResult = result;
|
|
169
|
+
}
|
|
160
170
|
}
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
171
|
+
}
|
|
172
|
+
else if (result.restriction.priority === restrictionResult.restriction.priority) {
|
|
173
|
+
// 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 || result.restriction instanceof LineRestriction_1.LineRestriction) {
|
|
175
|
+
if (result.distanceClosestPointToTargetPointSquared < restrictionResult.distanceClosestPointToTargetPointSquared) {
|
|
176
|
+
restrictionResult = result;
|
|
177
|
+
}
|
|
167
178
|
}
|
|
168
179
|
}
|
|
169
180
|
}
|
|
170
181
|
// deactivate the visualization of all restrictions that are not hit
|
|
171
182
|
for (const restriction of Object.values(__classPrivateFieldGet(this, _RestrictionManager_restrictions, "f"))) {
|
|
172
|
-
if (
|
|
183
|
+
if (restrictionResult && restriction !== restrictionResult.restriction) {
|
|
173
184
|
for (const snapRestriction of Object.values(restriction.snapRestrictions)) {
|
|
174
185
|
snapRestriction.active = false;
|
|
175
186
|
}
|
|
176
187
|
}
|
|
177
188
|
}
|
|
178
|
-
|
|
189
|
+
if ((0, IRestriction_1.isDraggingRestriction)(metaData)) {
|
|
190
|
+
const { matrix, dragAnchor } = (0, RestrictionsHelper_1.calculateDragMatrix)(restrictionResult.targetPoint, restrictionResult.restriction.rotation, metaData.dragOrigin, metaData.dragAnchors, restrictionResult.closestIntersectionPoint);
|
|
191
|
+
return {
|
|
192
|
+
restriction: restrictionResult.restriction,
|
|
193
|
+
point: restrictionResult.targetPoint,
|
|
194
|
+
closestPointOnRay: restrictionResult.closestIntersectionPoint,
|
|
195
|
+
distanceSquared: restrictionResult.distanceOriginToClosestIntersectionPointSquared,
|
|
196
|
+
dragAnchor: dragAnchor,
|
|
197
|
+
transformation: matrix
|
|
198
|
+
};
|
|
199
|
+
}
|
|
200
|
+
else {
|
|
201
|
+
return {
|
|
202
|
+
restriction: restrictionResult.restriction,
|
|
203
|
+
point: restrictionResult.targetPoint,
|
|
204
|
+
closestPointOnRay: restrictionResult.closestIntersectionPoint,
|
|
205
|
+
distanceSquared: restrictionResult.distanceOriginToClosestIntersectionPointSquared,
|
|
206
|
+
};
|
|
207
|
+
}
|
|
179
208
|
}
|
|
180
209
|
removeRestriction(token) {
|
|
181
210
|
if (__classPrivateFieldGet(this, _RestrictionManager_restrictions, "f")[token]) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RestrictionManager.js","sourceRoot":"","sources":["../../src/implementation/RestrictionManager.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,0EAAwE;AACxE,+FAA8H;AAC9H,
|
|
1
|
+
{"version":3,"file":"RestrictionManager.js","sourceRoot":"","sources":["../../src/implementation/RestrictionManager.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,0EAAwE;AACxE,+FAA8H;AAC9H,6DASoC;AACpC,iDAA8C;AAC9C,+DAA4D;AAC5D,qFAAiH;AAGjH,iFAA0E;AAC1E,+CAA6D;AAE7D,yEAAiG;AAEjG,4EAAqG;AACrG,4EAAqG;AACrG,+EAAmE;AAEnE,MAAa,kBAAkB;IA2B3B,6BAA6B;IAE7B,2BAA2B;IAE3B,YACI,QAAsB,EACtB,aAAwB,kBAAS,CAAC,IAAI,EACtC,YAAsC,EACtC,QAAiC;QAlCrC,0BAA0B;QAE1B,mDAAqC;QACrC,0DAAmD;QACnD,iDAAgC;QAChC,2CAA4D,EAAE,EAAC;QAC/D,uCAA6C;YACzC,cAAc,EAAE,IAAI;YACpB,4BAA4B,EAAE,CAAC;YAC/B,KAAK,EAAE;gBACH,KAAK,EAAE,SAAS;aACnB;YACD,WAAW,EAAE,KAAK;YAClB,MAAM,EAAE;gBACJ,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE;gBACtE,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,SAAS;aACzH;SACJ,EAAC;QACF,4CAA0B,sCAAa,CAAC,QAAQ,EAAC;QACjD,+CAAiC;QAEjC,qCAAmB,KAAK,EAAC;QACzB,0CAA2C,EAAE,EAAC;QAC9C,6DAAmC;QACnC,2DAAyC,KAAK,EAAC;QAY3C,uBAAA,IAAI,gCAAa,QAAQ,MAAA,CAAC;QAC1B,uBAAA,IAAI,kCAAe,UAAU,MAAA,CAAC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AAA,IAAI,uCAAa,CAAC,KAAK,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;IACzC,CAAC;IAEO,MAAM,CAAC,KAAmB,EAAE,GAAS;QACzC,IAAI,IAAI,CAAC,MAAM;YAAE,OAAO;IAC5B,CAAC;IAEO,KAAK;QACT,IAAI,IAAI,CAAC,MAAM;YAAE,OAAO;IAC5B,CAAC;IAEO,IAAI;QACR,IAAI,IAAI,CAAC,MAAM;YAAE,OAAO;IAC5B,CAAC;CAGJ;AAjSD,gDAiSC"}
|
|
@@ -10,7 +10,6 @@ export declare abstract class AbstractRestriction implements IRestriction {
|
|
|
10
10
|
protected _enabled: boolean;
|
|
11
11
|
protected _enabledEditable: boolean;
|
|
12
12
|
protected _object3D: THREE.Object3D;
|
|
13
|
-
protected _priority: number;
|
|
14
13
|
protected _snapRestrictions: {
|
|
15
14
|
[key: string]: ISnapRestriction;
|
|
16
15
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AbstractRestriction.d.ts","sourceRoot":"","sources":["../../../src/implementation/restrictions/AbstractRestriction.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,IAAI,EAAE,MAAM,yDAAyD,CAAC;AAC/E,OAAO,EACH,YAAY,EACZ,gBAAgB,EAChB,mBAAmB,EACnB,qBAAqB,EACrB,iBAAiB,EACpB,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAAE,gBAAgB,EAAE,MAAM,mCAAmC,CAAC;AACrE,OAAO,EAAE,SAAS,EAAY,MAAM,qCAAqC,CAAC;AAC1E,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAElD,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEjC,8BAAsB,mBAAoB,YAAW,YAAY;;
|
|
1
|
+
{"version":3,"file":"AbstractRestriction.d.ts","sourceRoot":"","sources":["../../../src/implementation/restrictions/AbstractRestriction.ts"],"names":[],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AI,OAAO,CAEtC;IAED,IAAW,iBAAiB,CAAC,KAAK,EAAE,OAAO,EAI1C;IAED,IAAW,gBAAgB,IAAI;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,gBAAgB,CAAC;KAAE,CAElE;IAED,IAAW,IAAI,IAAI,gBAAgB,CAElC;IAMM,mBAAmB,IAAI,IAAI;aAUlB,QAAQ,CAAC,GAAG,EAAE,IAAI,EAAE,QAAQ,CAAC,EAAE,mBAAmB,GAAG,iBAAiB,GAAG,SAAS;IAMlG,SAAS,CAAC,QAAQ,CAAC,iBAAiB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI;IAM5D,OAAO,CAAC,sBAAsB;CAiBjC"}
|
|
@@ -33,7 +33,7 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
|
|
|
33
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
34
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
35
35
|
};
|
|
36
|
-
var _AbstractRestriction_id, _AbstractRestriction_parentNode, _AbstractRestriction_type, _AbstractRestriction_viewport, _AbstractRestriction_visualizationNode, _AbstractRestriction_rotation, _AbstractRestriction_showVisualization;
|
|
36
|
+
var _AbstractRestriction_id, _AbstractRestriction_parentNode, _AbstractRestriction_type, _AbstractRestriction_viewport, _AbstractRestriction_visualizationNode, _AbstractRestriction_priority, _AbstractRestriction_rotation, _AbstractRestriction_showVisualization;
|
|
37
37
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
38
38
|
exports.AbstractRestriction = void 0;
|
|
39
39
|
const THREE = __importStar(require("three"));
|
|
@@ -50,17 +50,18 @@ class AbstractRestriction {
|
|
|
50
50
|
_AbstractRestriction_type.set(this, void 0);
|
|
51
51
|
_AbstractRestriction_viewport.set(this, void 0);
|
|
52
52
|
_AbstractRestriction_visualizationNode.set(this, new viewer_shared_node_tree_1.TreeNode('RestrictionVisualizationNode'));
|
|
53
|
+
_AbstractRestriction_priority.set(this, void 0);
|
|
53
54
|
_AbstractRestriction_rotation.set(this, void 0);
|
|
54
55
|
_AbstractRestriction_showVisualization.set(this, false);
|
|
55
56
|
this._enabled = true;
|
|
56
57
|
this._enabledEditable = true;
|
|
57
|
-
this._priority = -1;
|
|
58
58
|
this._snapRestrictions = {};
|
|
59
59
|
__classPrivateFieldSet(this, _AbstractRestriction_parentNode, parentNode, "f");
|
|
60
60
|
__classPrivateFieldSet(this, _AbstractRestriction_viewport, viewport, "f");
|
|
61
61
|
__classPrivateFieldSet(this, _AbstractRestriction_id, id, "f");
|
|
62
62
|
__classPrivateFieldSet(this, _AbstractRestriction_type, properties.type, "f");
|
|
63
63
|
__classPrivateFieldSet(this, _AbstractRestriction_rotation, properties.rotation || { axis: gl_matrix_1.vec3.fromValues(0, 0, 1), angle: 0 }, "f");
|
|
64
|
+
__classPrivateFieldSet(this, _AbstractRestriction_priority, properties.priority || -1, "f");
|
|
64
65
|
this.createGridHelperObject();
|
|
65
66
|
}
|
|
66
67
|
// #endregion Constructors (1)
|
|
@@ -78,10 +79,10 @@ class AbstractRestriction {
|
|
|
78
79
|
return __classPrivateFieldGet(this, _AbstractRestriction_id, "f");
|
|
79
80
|
}
|
|
80
81
|
get priority() {
|
|
81
|
-
return this
|
|
82
|
+
return __classPrivateFieldGet(this, _AbstractRestriction_priority, "f");
|
|
82
83
|
}
|
|
83
84
|
set priority(value) {
|
|
84
|
-
this
|
|
85
|
+
__classPrivateFieldSet(this, _AbstractRestriction_priority, value, "f");
|
|
85
86
|
}
|
|
86
87
|
get rotation() {
|
|
87
88
|
return __classPrivateFieldGet(this, _AbstractRestriction_rotation, "f");
|
|
@@ -126,5 +127,5 @@ class AbstractRestriction {
|
|
|
126
127
|
}
|
|
127
128
|
}
|
|
128
129
|
exports.AbstractRestriction = AbstractRestriction;
|
|
129
|
-
_AbstractRestriction_id = new WeakMap(), _AbstractRestriction_parentNode = new WeakMap(), _AbstractRestriction_type = new WeakMap(), _AbstractRestriction_viewport = new WeakMap(), _AbstractRestriction_visualizationNode = new WeakMap(), _AbstractRestriction_rotation = new WeakMap(), _AbstractRestriction_showVisualization = new WeakMap();
|
|
130
|
+
_AbstractRestriction_id = new WeakMap(), _AbstractRestriction_parentNode = new WeakMap(), _AbstractRestriction_type = new WeakMap(), _AbstractRestriction_viewport = new WeakMap(), _AbstractRestriction_visualizationNode = new WeakMap(), _AbstractRestriction_priority = new WeakMap(), _AbstractRestriction_rotation = new WeakMap(), _AbstractRestriction_showVisualization = new WeakMap();
|
|
130
131
|
//# sourceMappingURL=AbstractRestriction.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AbstractRestriction.js","sourceRoot":"","sources":["../../../src/implementation/restrictions/AbstractRestriction.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,6CAA+B;AAU/B,iFAA0E;AAE1E,mIAA2F;AAC3F,yCAAiC;AAEjC,MAAsB,mBAAmB;IAkBrC,6BAA6B;IAE7B,2BAA2B;IAE3B,YAAY,QAAsB,EAAE,UAAqB,EAAE,EAAU,EAAE,UAAiC;QArBxG,0BAA0B;QAE1B,0CAAqB;QACrB,kDAAgC;QAChC,4CAAiC;QACjC,gDAAiC;QACjC,iDAAwC,IAAI,kCAAQ,CAAC,8BAA8B,CAAC,EAAC;QAErF,gDAA0C;QAC1C,iDAA8B,KAAK,EAAC;QAE1B,aAAQ,GAAY,IAAI,CAAC;QACzB,qBAAgB,GAAY,IAAI,CAAC;QAEjC,
|
|
1
|
+
{"version":3,"file":"AbstractRestriction.js","sourceRoot":"","sources":["../../../src/implementation/restrictions/AbstractRestriction.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,6CAA+B;AAU/B,iFAA0E;AAE1E,mIAA2F;AAC3F,yCAAiC;AAEjC,MAAsB,mBAAmB;IAkBrC,6BA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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;IAChD,CAAC;CAGJ;AAhID,kDAgIC"}
|
|
@@ -25,7 +25,7 @@ export declare abstract class AbstractSnapRestriction implements ISnapRestrictio
|
|
|
25
25
|
get showVisualization(): boolean;
|
|
26
26
|
set showVisualization(value: boolean);
|
|
27
27
|
removeVisualization(): void;
|
|
28
|
-
abstract snap(ray: IRay, point: vec3, metaData?: RestrictionMetaData): RestrictionResult | undefined;
|
|
28
|
+
abstract snap(ray: IRay, point: vec3, distance: number, metaData?: RestrictionMetaData): RestrictionResult | undefined;
|
|
29
29
|
protected abstract visibilityChanged(visible: boolean): void;
|
|
30
30
|
private createGridHelperObject;
|
|
31
31
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AbstractSnapRestriction.d.ts","sourceRoot":"","sources":["../../../src/implementation/restrictions/AbstractSnapRestriction.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,IAAI,EAAE,MAAM,yDAAyD,CAAC;AAC/E,OAAO,EAAE,gBAAgB,EAAE,MAAM,mCAAmC,CAAC;AACrE,OAAO,EAAE,SAAS,EAAY,MAAM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AUlB,IAAI,CAAC,GAAG,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,mBAAmB,GAAG,iBAAiB,GAAG,SAAS;IAM7H,SAAS,CAAC,QAAQ,CAAC,iBAAiB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI;IAM5D,OAAO,CAAC,sBAAsB;CAiBjC"}
|
|
@@ -5,11 +5,11 @@ import { IRestriction, RestrictionMetaData, RestrictionPropertiesBase, Restricti
|
|
|
5
5
|
import { ISnapRestriction } from '../../../interfaces/ISnapRestriction';
|
|
6
6
|
import { ITreeNode, IViewportApi } from '@shapediver/viewer';
|
|
7
7
|
import { IVisualizationSettings } from '../../../interfaces/IVisualizationSettings';
|
|
8
|
-
export
|
|
8
|
+
export interface CameraPlaneRestrictionProperties extends RestrictionPropertiesBase {
|
|
9
|
+
}
|
|
9
10
|
export declare class CameraPlaneRestriction extends AbstractRestriction implements IRestriction {
|
|
10
11
|
#private;
|
|
11
12
|
constructor(viewport: IViewportApi, geometryMathManager: GeometryMathManager, parentNode: ITreeNode, id: string, settings: IVisualizationSettings, properties: CameraPlaneRestrictionProperties);
|
|
12
|
-
get priority(): number;
|
|
13
13
|
get snapRestrictions(): {
|
|
14
14
|
[key: string]: ISnapRestriction;
|
|
15
15
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CameraPlaneRestriction.d.ts","sourceRoot":"","sources":["../../../../src/implementation/restrictions/camera_plane/CameraPlaneRestriction.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAC7D,OAAO,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAEhE,OAAO,EAAE,IAAI,EAAE,MAAM,yDAAyD,CAAC;AAC/E,OAAO,EACH,YAAY,EACZ,mBAAmB,EACnB,yBAAyB,EACzB,iBAAiB,EACpB,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EAAE,gBAAgB,EAAE,MAAM,sCAAsC,CAAC;AACxE,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAC7D,OAAO,EAAE,sBAAsB,EAAE,MAAM,4CAA4C,CAAC;
|
|
1
|
+
{"version":3,"file":"CameraPlaneRestriction.d.ts","sourceRoot":"","sources":["../../../../src/implementation/restrictions/camera_plane/CameraPlaneRestriction.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAC7D,OAAO,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAEhE,OAAO,EAAE,IAAI,EAAE,MAAM,yDAAyD,CAAC;AAC/E,OAAO,EACH,YAAY,EACZ,mBAAmB,EACnB,yBAAyB,EACzB,iBAAiB,EACpB,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EAAE,gBAAgB,EAAE,MAAM,sCAAsC,CAAC;AACxE,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAC7D,OAAO,EAAE,sBAAsB,EAAE,MAAM,4CAA4C,CAAC;AAMpF,MAAM,WAAW,gCAAiC,SAAQ,yBAAyB;CAAG;AAMtF,qBAAa,sBAAuB,SAAQ,mBAAoB,YAAW,YAAY;;gBAYvE,QAAQ,EAAE,YAAY,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,UAAU,EAAE,SAAS,EAAE,EAAE,EAAE,MAAM,EAAE,QAAQ,EAAE,sBAAsB,EAAE,UAAU,EAAE,gCAAgC;IAU/L,IAAW,gBAAgB,IAAI;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,gBAAgB,CAAC;KAAE,CAElE;IAMM,QAAQ,CAAC,GAAG,EAAE,IAAI,EAAE,QAAQ,EAAE,mBAAmB,GAAG,iBAAiB,GAAG,SAAS;IAsBxF,SAAS,CAAC,iBAAiB,IAAI,IAAI;CAGtC"}
|
|
@@ -31,9 +31,6 @@ class CameraPlaneRestriction extends AbstractRestriction_1.AbstractRestriction {
|
|
|
31
31
|
}
|
|
32
32
|
// #endregion Constructors (1)
|
|
33
33
|
// #region Public Getters And Setters (2)
|
|
34
|
-
get priority() {
|
|
35
|
-
return -1;
|
|
36
|
-
}
|
|
37
34
|
get snapRestrictions() {
|
|
38
35
|
return __classPrivateFieldGet(this, _CameraPlaneRestriction_snapRestrictions, "f");
|
|
39
36
|
}
|
|
@@ -47,8 +44,10 @@ class CameraPlaneRestriction extends AbstractRestriction_1.AbstractRestriction {
|
|
|
47
44
|
if (distance && distance > 0) {
|
|
48
45
|
const point = gl_matrix_1.vec3.add(gl_matrix_1.vec3.create(), gl_matrix_1.vec3.multiply(gl_matrix_1.vec3.create(), ray.direction, gl_matrix_1.vec3.fromValues(distance, distance, distance)), ray.origin);
|
|
49
46
|
return {
|
|
50
|
-
|
|
51
|
-
|
|
47
|
+
closestIntersectionPoint: point,
|
|
48
|
+
distanceOriginToClosestIntersectionPointSquared: distance * distance,
|
|
49
|
+
targetPoint: point,
|
|
50
|
+
distanceClosestPointToTargetPointSquared: 0,
|
|
52
51
|
restriction: this
|
|
53
52
|
};
|
|
54
53
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CameraPlaneRestriction.js","sourceRoot":"","sources":["../../../../src/implementation/restrictions/camera_plane/CameraPlaneRestriction.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,gEAA6D;AAE7D,uEAA+D;AAW/D,yCAAiC;
|
|
1
|
+
{"version":3,"file":"CameraPlaneRestriction.js","sourceRoot":"","sources":["../../../../src/implementation/restrictions/camera_plane/CameraPlaneRestriction.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,gEAA6D;AAE7D,uEAA+D;AAW/D,yCAAiC;AAOjC,8BAA8B;AAE9B,sBAAsB;AAEtB,MAAa,sBAAuB,SAAQ,yCAAmB;IAQ3D,4BAA4B;IAE5B,2BAA2B;IAE3B,YAAY,QAAsB,EAAE,mBAA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,CAAC,CAAC,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;YAC9I,OAAO;gBACH,wBAAwB,EAAE,KAAK;gBAC/B,+CAA+C,EAAE,QAAQ,GAAG,QAAQ;gBACpE,WAAW,EAAE,KAAK;gBAClB,wCAAwC,EAAE,CAAC;gBAC3C,WAAW,EAAE,IAAI;aACpB,CAAC;SACL;QACD,OAAO;IACX,CAAC;IAED,gCAAgC;IAEhC,gCAAgC;IAEtB,iBAAiB,KAAW,CAAC;CAG1C;AAvDD,wDAuDC;;AAED,yBAAyB"}
|
|
@@ -6,7 +6,7 @@ import { ISnapRestriction } from '../../../interfaces/ISnapRestriction';
|
|
|
6
6
|
import { ITreeNode } from '@shapediver/viewer.shared.node-tree';
|
|
7
7
|
import { IViewportApi } from '@shapediver/viewer';
|
|
8
8
|
import { IVisualizationSettings } from '../../../interfaces/IVisualizationSettings';
|
|
9
|
-
export
|
|
9
|
+
export interface GeometryRestrictionProperties extends RestrictionPropertiesBase {
|
|
10
10
|
/**
|
|
11
11
|
* The nodes to restrict the interaction to.
|
|
12
12
|
*/
|
|
@@ -19,11 +19,30 @@ export declare type GeometryRestrictionProperties = {
|
|
|
19
19
|
* The color of the wireframe.
|
|
20
20
|
*/
|
|
21
21
|
wireframeColor?: string;
|
|
22
|
-
|
|
22
|
+
/**
|
|
23
|
+
* If the restriction should snap to vertices. (default: true)
|
|
24
|
+
*/
|
|
25
|
+
snapToVertices?: boolean;
|
|
26
|
+
/**
|
|
27
|
+
* The radius in which the restriction should snap to vertices. (default: 2.5% of the scene bounding sphere radius in screen space)
|
|
28
|
+
*/
|
|
29
|
+
snapToVerticesRadius?: number;
|
|
30
|
+
/**
|
|
31
|
+
* If the restriction should snap to edges. (default: true)
|
|
32
|
+
*/
|
|
33
|
+
snapToEdges?: boolean;
|
|
34
|
+
/**
|
|
35
|
+
* The radius in which the restriction should snap to edges. (default: 2.5% of the scene bounding sphere radius in screen space)
|
|
36
|
+
*/
|
|
37
|
+
snapToEdgesRadius?: number;
|
|
38
|
+
/**
|
|
39
|
+
* If the restriction should snap to faces. (default: true)
|
|
40
|
+
*/
|
|
41
|
+
snapToFaces?: boolean;
|
|
42
|
+
}
|
|
23
43
|
export declare class GeometryRestriction extends AbstractRestriction implements IRestriction {
|
|
24
44
|
#private;
|
|
25
45
|
constructor(viewport: IViewportApi, geometryMathManager: GeometryMathManager, parentNode: ITreeNode, id: string, settings: IVisualizationSettings, properties: GeometryRestrictionProperties);
|
|
26
|
-
get priority(): number;
|
|
27
46
|
get snapRestrictions(): {
|
|
28
47
|
[key: string]: ISnapRestriction;
|
|
29
48
|
};
|
|
@@ -37,5 +56,17 @@ export declare class GeometryRestriction extends AbstractRestriction implements
|
|
|
37
56
|
updateNodes(nodes: ITreeNode[]): void;
|
|
38
57
|
protected visibilityChanged(): void;
|
|
39
58
|
private updateIntersectionThresholds;
|
|
59
|
+
private constructRestrictionResult;
|
|
60
|
+
/**
|
|
61
|
+
* We check the distance between two points.
|
|
62
|
+
* If a radius is given, we check if the distance is smaller than the radius.
|
|
63
|
+
* If no radius is given, we move to the screen space distance check.
|
|
64
|
+
*
|
|
65
|
+
* @param point1
|
|
66
|
+
* @param point2
|
|
67
|
+
* @param radius
|
|
68
|
+
* @returns
|
|
69
|
+
*/
|
|
70
|
+
private checkDistance;
|
|
40
71
|
}
|
|
41
72
|
//# sourceMappingURL=GeometryRestriction.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GeometryRestriction.d.ts","sourceRoot":"","sources":["../../../../src/implementation/restrictions/geometry/GeometryRestriction.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAG7D,OAAO,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAChE,OAAO,EAAE,IAAI,EAAE,MAAM,yDAAyD,CAAC;AAC/E,OAAO,EACH,YAAY,EACZ,mBAAmB,EACnB,yBAAyB,EACzB,iBAAiB,EACpB,MAAM,kCAAkC,CAAC;AAE1C,OAAO,EAAE,gBAAgB,EAAE,MAAM,sCAAsC,CAAC;AACxE,OAAO,EAAE,SAAS,EAAE,MAAM,qCAAqC,CAAC;AAChE,OAAO,EAAE,YAAY,EAAa,MAAM,oBAAoB,CAAC;AAC7D,OAAO,EAAE,sBAAsB,EAAE,MAAM,4CAA4C,CAAC;AAKpF,
|
|
1
|
+
{"version":3,"file":"GeometryRestriction.d.ts","sourceRoot":"","sources":["../../../../src/implementation/restrictions/geometry/GeometryRestriction.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAG7D,OAAO,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAChE,OAAO,EAAE,IAAI,EAAE,MAAM,yDAAyD,CAAC;AAC/E,OAAO,EACH,YAAY,EACZ,mBAAmB,EACnB,yBAAyB,EACzB,iBAAiB,EACpB,MAAM,kCAAkC,CAAC;AAE1C,OAAO,EAAE,gBAAgB,EAAE,MAAM,sCAAsC,CAAC;AACxE,OAAO,EAAE,SAAS,EAAE,MAAM,qCAAqC,CAAC;AAChE,OAAO,EAAE,YAAY,EAAa,MAAM,oBAAoB,CAAC;AAC7D,OAAO,EAAE,sBAAsB,EAAE,MAAM,4CAA4C,CAAC;AAKpF,MAAM,WAAW,6BAA8B,SAAQ,yBAAyB;IAC5E;;OAEG;IACH,KAAK,EAAE,SAAS,EAAE,CAAC;IACnB;;OAEG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;OAEG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB;;OAEG;IACH,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB;;OAEG;IACH,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B;;OAEG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB;;OAEG;IACH,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B;;OAEG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;CACzB;AAMD,qBAAa,mBAAoB,SAAQ,mBAAoB,YAAW,YAAY;;gBAmCpE,QAAQ,EAAE,YAAY,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,UAAU,EAAE,SAAS,EAAE,EAAE,EAAE,MAAM,EAAE,QAAQ,EAAE,sBAAsB,EAAE,UAAU,EAAE,6BAA6B;IA+B5L,IAAW,gBAAgB,IAAI;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,gBAAgB,CAAC;KAAE,CAElE;IAED,IAAW,WAAW,IAAI,OAAO,CAEhC;IAED,IAAW,WAAW,CAAC,KAAK,EAAE,OAAO,EAEpC;IAED,IAAW,WAAW,IAAI,OAAO,CAEhC;IAED,IAAW,WAAW,CAAC,KAAK,EAAE,OAAO,EAEpC;IAED,IAAW,cAAc,IAAI,OAAO,CAEnC;IAED,IAAW,cAAc,CAAC,KAAK,EAAE,OAAO,EAEvC;IAMM,QAAQ,CAAC,GAAG,EAAE,IAAI,EAAE,QAAQ,CAAC,EAAE,mBAAmB,GAAG,iBAAiB,GAAG,SAAS;IA2GlF,WAAW,CAAC,KAAK,EAAE,SAAS,EAAE;IAmCrC,SAAS,CAAC,iBAAiB,IAAI,IAAI;IAMnC,OAAO,CAAC,4BAA4B;IAMpC,OAAO,CAAC,0BAA0B;IAWlC;;;;;;;;;OASG;IACH,OAAO,CAAC,aAAa;CAaxB"}
|
|
@@ -33,7 +33,7 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
|
|
|
33
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
34
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
35
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;
|
|
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_snapToEdgesRadius, _GeometryRestriction_snapToFaces, _GeometryRestriction_snapToVertices, _GeometryRestriction_snapToVerticesRadius, _GeometryRestriction_visualizationObject, _GeometryRestriction_wireframe, _GeometryRestriction_wireframeColor;
|
|
37
37
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
38
38
|
exports.GeometryRestriction = void 0;
|
|
39
39
|
const THREE = __importStar(require("three"));
|
|
@@ -48,7 +48,7 @@ class GeometryRestriction extends AbstractRestriction_1.AbstractRestriction {
|
|
|
48
48
|
// #endregion Properties (17)
|
|
49
49
|
// #region Constructors (1)
|
|
50
50
|
constructor(viewport, geometryMathManager, parentNode, id, settings, properties) {
|
|
51
|
-
var _a, _b;
|
|
51
|
+
var _a, _b, _c, _d, _e;
|
|
52
52
|
super(viewport, parentNode, id, properties);
|
|
53
53
|
// #region Properties (17)
|
|
54
54
|
_GeometryRestriction_eventEngine.set(this, viewer_shared_services_1.EventEngine.instance);
|
|
@@ -70,8 +70,10 @@ class GeometryRestriction extends AbstractRestriction_1.AbstractRestriction {
|
|
|
70
70
|
_GeometryRestriction_settings.set(this, void 0);
|
|
71
71
|
_GeometryRestriction_snapRestrictions.set(this, {});
|
|
72
72
|
_GeometryRestriction_snapToEdges.set(this, true);
|
|
73
|
+
_GeometryRestriction_snapToEdgesRadius.set(this, void 0);
|
|
73
74
|
_GeometryRestriction_snapToFaces.set(this, true);
|
|
74
75
|
_GeometryRestriction_snapToVertices.set(this, true);
|
|
76
|
+
_GeometryRestriction_snapToVerticesRadius.set(this, void 0);
|
|
75
77
|
_GeometryRestriction_visualizationObject.set(this, new THREE.Object3D());
|
|
76
78
|
_GeometryRestriction_wireframe.set(this, void 0);
|
|
77
79
|
_GeometryRestriction_wireframeColor.set(this, void 0);
|
|
@@ -80,6 +82,11 @@ class GeometryRestriction extends AbstractRestriction_1.AbstractRestriction {
|
|
|
80
82
|
__classPrivateFieldSet(this, _GeometryRestriction_geometryMathManager, geometryMathManager, "f");
|
|
81
83
|
__classPrivateFieldSet(this, _GeometryRestriction_wireframe, (_a = properties.wireframe) !== null && _a !== void 0 ? _a : true, "f");
|
|
82
84
|
__classPrivateFieldSet(this, _GeometryRestriction_wireframeColor, (_b = properties.wireframeColor) !== null && _b !== void 0 ? _b : __classPrivateFieldGet(this, _GeometryRestriction_settings, "f").points.color_1, "f");
|
|
85
|
+
__classPrivateFieldSet(this, _GeometryRestriction_snapToVertices, (_c = properties.snapToVertices) !== null && _c !== void 0 ? _c : true, "f");
|
|
86
|
+
__classPrivateFieldSet(this, _GeometryRestriction_snapToEdges, (_d = properties.snapToEdges) !== null && _d !== void 0 ? _d : true, "f");
|
|
87
|
+
__classPrivateFieldSet(this, _GeometryRestriction_snapToFaces, (_e = properties.snapToFaces) !== null && _e !== void 0 ? _e : true, "f");
|
|
88
|
+
__classPrivateFieldSet(this, _GeometryRestriction_snapToVerticesRadius, properties.snapToVerticesRadius, "f");
|
|
89
|
+
__classPrivateFieldSet(this, _GeometryRestriction_snapToEdgesRadius, properties.snapToEdgesRadius, "f");
|
|
83
90
|
__classPrivateFieldSet(this, _GeometryRestriction_sceneBoundingSphereRadius, viewer_1.sceneTree.root.boundingBox.boundingSphere.radius, "f");
|
|
84
91
|
this.updateIntersectionThresholds();
|
|
85
92
|
__classPrivateFieldGet(this, _GeometryRestriction_eventEngine, "f").addListener(viewer_shared_services_1.EVENTTYPE.SCENE.SCENE_BOUNDING_BOX_CHANGE, (e) => {
|
|
@@ -94,9 +101,6 @@ class GeometryRestriction extends AbstractRestriction_1.AbstractRestriction {
|
|
|
94
101
|
}
|
|
95
102
|
// #endregion Constructors (1)
|
|
96
103
|
// #region Public Getters And Setters (8)
|
|
97
|
-
get priority() {
|
|
98
|
-
return 0;
|
|
99
|
-
}
|
|
100
104
|
get snapRestrictions() {
|
|
101
105
|
return __classPrivateFieldGet(this, _GeometryRestriction_snapRestrictions, "f");
|
|
102
106
|
}
|
|
@@ -151,12 +155,12 @@ class GeometryRestriction extends AbstractRestriction_1.AbstractRestriction {
|
|
|
151
155
|
const vertex = new THREE.Vector3();
|
|
152
156
|
vertex.fromBufferAttribute(positionAttribute, intersections[0].index);
|
|
153
157
|
object.localToWorld(vertex);
|
|
154
|
-
return
|
|
158
|
+
return this.constructRestrictionResult(gl_matrix_1.vec3.fromValues(vertex.x, vertex.y, vertex.z), intersections[0].distance, intersections[0].pointOnLine);
|
|
155
159
|
}
|
|
156
160
|
const intersectionPoint = intersections[0].point;
|
|
157
161
|
const intersectionPointVec3 = gl_matrix_1.vec3.fromValues(intersectionPoint.x, intersectionPoint.y, intersectionPoint.z);
|
|
158
162
|
if (!intersections[0].face)
|
|
159
|
-
return
|
|
163
|
+
return this.constructRestrictionResult(intersectionPointVec3, intersections[0].distance, intersections[0].pointOnLine);
|
|
160
164
|
if (__classPrivateFieldGet(this, _GeometryRestriction_snapToVertices, "f") === true || __classPrivateFieldGet(this, _GeometryRestriction_snapToEdges, "f") === true) {
|
|
161
165
|
const vertexA = new THREE.Vector3();
|
|
162
166
|
vertexA.fromBufferAttribute(positionAttribute, intersections[0].face.a);
|
|
@@ -171,18 +175,18 @@ class GeometryRestriction extends AbstractRestriction_1.AbstractRestriction {
|
|
|
171
175
|
object.localToWorld(vertexC);
|
|
172
176
|
const vertexCVec3 = gl_matrix_1.vec3.fromValues(vertexC.x, vertexC.y, vertexC.z);
|
|
173
177
|
if (__classPrivateFieldGet(this, _GeometryRestriction_snapToVertices, "f") === true) {
|
|
174
|
-
const distanceA =
|
|
175
|
-
const distanceB =
|
|
176
|
-
const distanceC =
|
|
178
|
+
const distanceA = this.checkDistance(intersectionPointVec3, vertexAVec3, __classPrivateFieldGet(this, _GeometryRestriction_snapToVerticesRadius, "f"));
|
|
179
|
+
const distanceB = this.checkDistance(intersectionPointVec3, vertexBVec3, __classPrivateFieldGet(this, _GeometryRestriction_snapToVerticesRadius, "f"));
|
|
180
|
+
const distanceC = this.checkDistance(intersectionPointVec3, vertexCVec3, __classPrivateFieldGet(this, _GeometryRestriction_snapToVerticesRadius, "f"));
|
|
177
181
|
// part 1 - check if the intersection point is close to a vertex
|
|
178
182
|
if (distanceA.check && distanceA.distanceSquared < distanceB.distanceSquared && distanceA.distanceSquared < distanceC.distanceSquared) {
|
|
179
|
-
return
|
|
183
|
+
return this.constructRestrictionResult(vertexAVec3, intersections[0].distance, intersections[0].pointOnLine);
|
|
180
184
|
}
|
|
181
185
|
else if (distanceB.check && distanceB.distanceSquared < distanceA.distanceSquared && distanceB.distanceSquared < distanceC.distanceSquared) {
|
|
182
|
-
return
|
|
186
|
+
return this.constructRestrictionResult(vertexBVec3, intersections[0].distance, intersections[0].pointOnLine);
|
|
183
187
|
}
|
|
184
188
|
else if (distanceC.check && distanceC.distanceSquared < distanceA.distanceSquared && distanceC.distanceSquared < distanceB.distanceSquared) {
|
|
185
|
-
return
|
|
189
|
+
return this.constructRestrictionResult(vertexCVec3, intersections[0].distance, intersections[0].pointOnLine);
|
|
186
190
|
}
|
|
187
191
|
}
|
|
188
192
|
if (__classPrivateFieldGet(this, _GeometryRestriction_snapToEdges, "f") === true) {
|
|
@@ -192,24 +196,24 @@ class GeometryRestriction extends AbstractRestriction_1.AbstractRestriction {
|
|
|
192
196
|
const closestPointOnEdgeBC = __classPrivateFieldGet(this, _GeometryRestriction_geometryMathManager, "f").closestPointOnLine(vertexBVec3, vertexCVec3, intersectionPointVec3);
|
|
193
197
|
const closestPointOnEdgeCA = __classPrivateFieldGet(this, _GeometryRestriction_geometryMathManager, "f").closestPointOnLine(vertexCVec3, vertexAVec3, intersectionPointVec3);
|
|
194
198
|
// create the distances
|
|
195
|
-
const distanceAB =
|
|
196
|
-
const distanceBC =
|
|
197
|
-
const distanceCA =
|
|
199
|
+
const distanceAB = this.checkDistance(intersectionPointVec3, closestPointOnEdgeAB, __classPrivateFieldGet(this, _GeometryRestriction_snapToEdgesRadius, "f"));
|
|
200
|
+
const distanceBC = this.checkDistance(intersectionPointVec3, closestPointOnEdgeBC, __classPrivateFieldGet(this, _GeometryRestriction_snapToEdgesRadius, "f"));
|
|
201
|
+
const distanceCA = this.checkDistance(intersectionPointVec3, closestPointOnEdgeCA, __classPrivateFieldGet(this, _GeometryRestriction_snapToEdgesRadius, "f"));
|
|
198
202
|
// check if the intersection point is close to an edge
|
|
199
203
|
if (distanceAB.check && distanceAB.distanceSquared < distanceBC.distanceSquared && distanceAB.distanceSquared < distanceCA.distanceSquared) {
|
|
200
|
-
return
|
|
204
|
+
return this.constructRestrictionResult(closestPointOnEdgeAB, intersections[0].distance, intersections[0].pointOnLine);
|
|
201
205
|
}
|
|
202
206
|
else if (distanceBC.check && distanceBC.distanceSquared < distanceAB.distanceSquared && distanceBC.distanceSquared < distanceCA.distanceSquared) {
|
|
203
|
-
return
|
|
207
|
+
return this.constructRestrictionResult(closestPointOnEdgeBC, intersections[0].distance, intersections[0].pointOnLine);
|
|
204
208
|
}
|
|
205
209
|
else if (distanceCA.check && distanceCA.distanceSquared < distanceAB.distanceSquared && distanceCA.distanceSquared < distanceBC.distanceSquared) {
|
|
206
|
-
return
|
|
210
|
+
return this.constructRestrictionResult(closestPointOnEdgeCA, intersections[0].distance, intersections[0].pointOnLine);
|
|
207
211
|
}
|
|
208
212
|
}
|
|
209
213
|
}
|
|
210
214
|
if (__classPrivateFieldGet(this, _GeometryRestriction_snapToFaces, "f") === true) {
|
|
211
215
|
// part 3 - face intersection
|
|
212
|
-
return
|
|
216
|
+
return this.constructRestrictionResult(gl_matrix_1.vec3.fromValues(intersectionPoint.x, intersectionPoint.y, intersectionPoint.z), intersections[0].distance);
|
|
213
217
|
}
|
|
214
218
|
}
|
|
215
219
|
return;
|
|
@@ -252,8 +256,37 @@ class GeometryRestriction extends AbstractRestriction_1.AbstractRestriction {
|
|
|
252
256
|
__classPrivateFieldGet(this, _GeometryRestriction_rayCasterParams, "f").Line.threshold = __classPrivateFieldGet(this, _GeometryRestriction_sceneBoundingSphereRadius, "f") * __classPrivateFieldGet(this, _GeometryRestriction_lineIntersectionPercentage, "f");
|
|
253
257
|
__classPrivateFieldGet(this, _GeometryRestriction_rayCasterParams, "f").Line2.threshold = __classPrivateFieldGet(this, _GeometryRestriction_sceneBoundingSphereRadius, "f") * __classPrivateFieldGet(this, _GeometryRestriction_lineIntersectionPercentage, "f");
|
|
254
258
|
}
|
|
259
|
+
constructRestrictionResult(targetPoint, distanceOriginToClosestIntersectionPoint, closestPointOnRay) {
|
|
260
|
+
const closestPointOnRayVec3 = closestPointOnRay ? gl_matrix_1.vec3.fromValues(closestPointOnRay.x, closestPointOnRay.y, closestPointOnRay.z) : targetPoint;
|
|
261
|
+
return {
|
|
262
|
+
closestIntersectionPoint: closestPointOnRay ? gl_matrix_1.vec3.fromValues(closestPointOnRay.x, closestPointOnRay.y, closestPointOnRay.z) : targetPoint,
|
|
263
|
+
distanceOriginToClosestIntersectionPointSquared: distanceOriginToClosestIntersectionPoint * distanceOriginToClosestIntersectionPoint,
|
|
264
|
+
targetPoint,
|
|
265
|
+
distanceClosestPointToTargetPointSquared: closestPointOnRayVec3 !== targetPoint ? gl_matrix_1.vec3.sqrDist(closestPointOnRayVec3, targetPoint) : 0,
|
|
266
|
+
restriction: this
|
|
267
|
+
};
|
|
268
|
+
}
|
|
269
|
+
/**
|
|
270
|
+
* We check the distance between two points.
|
|
271
|
+
* If a radius is given, we check if the distance is smaller than the radius.
|
|
272
|
+
* If no radius is given, we move to the screen space distance check.
|
|
273
|
+
*
|
|
274
|
+
* @param point1
|
|
275
|
+
* @param point2
|
|
276
|
+
* @param radius
|
|
277
|
+
* @returns
|
|
278
|
+
*/
|
|
279
|
+
checkDistance(point1, point2, radius) {
|
|
280
|
+
if (radius !== undefined) {
|
|
281
|
+
const distance = gl_matrix_1.vec3.sqrDist(point1, point2);
|
|
282
|
+
return { distanceSquared: distance * distance, check: distance < radius };
|
|
283
|
+
}
|
|
284
|
+
else {
|
|
285
|
+
return __classPrivateFieldGet(this, _GeometryRestriction_geometryMathManager, "f").screenSpaceDistanceCheck(point1, point2, __classPrivateFieldGet(this, _GeometryRestriction_settings, "f").points.size_0 * __classPrivateFieldGet(this, _GeometryRestriction_settings, "f").distanceMultiplicationFactor);
|
|
286
|
+
}
|
|
287
|
+
}
|
|
255
288
|
}
|
|
256
289
|
exports.GeometryRestriction = GeometryRestriction;
|
|
257
|
-
_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();
|
|
290
|
+
_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_snapToEdgesRadius = new WeakMap(), _GeometryRestriction_snapToFaces = new WeakMap(), _GeometryRestriction_snapToVertices = new WeakMap(), _GeometryRestriction_snapToVerticesRadius = new WeakMap(), _GeometryRestriction_visualizationObject = new WeakMap(), _GeometryRestriction_wireframe = new WeakMap(), _GeometryRestriction_wireframeColor = new WeakMap();
|
|
258
291
|
// #endregion Classes (1)
|
|
259
292
|
//# sourceMappingURL=GeometryRestriction.js.map
|