@shapediver/viewer.rendering-engine.intersection-restriction-engine 3.16.8 → 3.16.9
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/api/implementation/AbstractRestrictionApi.d.ts +12 -12
- package/dist/api/implementation/AbstractRestrictionApi.js +46 -46
- package/dist/api/implementation/AbstractRestrictionApi.js.map +1 -1
- package/dist/api/implementation/AbstractSnapRestrictionApi.d.ts +12 -12
- package/dist/api/implementation/AbstractSnapRestrictionApi.js +46 -46
- package/dist/api/implementation/AbstractSnapRestrictionApi.js.map +1 -1
- package/dist/api/implementation/camera_plane/CameraPlaneRestrictionApi.d.ts +6 -6
- package/dist/api/implementation/camera_plane/CameraPlaneRestrictionApi.js +23 -23
- package/dist/api/implementation/camera_plane/CameraPlaneRestrictionApi.js.map +1 -1
- package/dist/api/implementation/geometry/GeometryRestrictionApi.d.ts +14 -14
- package/dist/api/implementation/geometry/GeometryRestrictionApi.js +53 -53
- package/dist/api/implementation/geometry/GeometryRestrictionApi.js.map +1 -1
- package/dist/api/implementation/line/LineRestrictionApi.d.ts +10 -10
- package/dist/api/implementation/line/LineRestrictionApi.js +39 -39
- package/dist/api/implementation/line/LineRestrictionApi.js.map +1 -1
- package/dist/api/implementation/plane/PlaneRestrictionApi.d.ts +19 -19
- package/dist/api/implementation/plane/PlaneRestrictionApi.js +66 -66
- package/dist/api/implementation/plane/PlaneRestrictionApi.js.map +1 -1
- package/dist/api/implementation/plane/snap/AngularRestrictionApi.d.ts +9 -9
- package/dist/api/implementation/plane/snap/AngularRestrictionApi.js +39 -39
- package/dist/api/implementation/plane/snap/AngularRestrictionApi.js.map +1 -1
- package/dist/api/implementation/plane/snap/AxisRestrictionApi.d.ts +6 -6
- package/dist/api/implementation/plane/snap/AxisRestrictionApi.js +23 -23
- package/dist/api/implementation/plane/snap/AxisRestrictionApi.js.map +1 -1
- package/dist/api/implementation/plane/snap/GridRestrictionApi.d.ts +9 -9
- package/dist/api/implementation/plane/snap/GridRestrictionApi.js +39 -39
- package/dist/api/implementation/plane/snap/GridRestrictionApi.js.map +1 -1
- package/dist/api/implementation/point/PointRestrictionApi.d.ts +9 -9
- package/dist/api/implementation/point/PointRestrictionApi.js +36 -36
- package/dist/api/implementation/point/PointRestrictionApi.js.map +1 -1
- package/dist/api/interfaces/IRestrictionApi.d.ts +10 -10
- package/dist/api/interfaces/IRestrictionApi.js +2 -2
- package/dist/api/interfaces/ISnapRestrictionApi.d.ts +12 -12
- package/dist/api/interfaces/ISnapRestrictionApi.js +2 -2
- package/dist/implementation/EventManager.d.ts +25 -25
- package/dist/implementation/EventManager.d.ts.map +1 -1
- package/dist/implementation/EventManager.js +62 -62
- package/dist/implementation/EventManager.js.map +1 -1
- package/dist/implementation/GeometryMathManager.d.ts +87 -87
- package/dist/implementation/GeometryMathManager.js +260 -260
- package/dist/implementation/GeometryMathManager.js.map +1 -1
- package/dist/implementation/RestrictionManager.d.ts +28 -28
- package/dist/implementation/RestrictionManager.js +323 -323
- package/dist/implementation/RestrictionManager.js.map +1 -1
- package/dist/implementation/restrictions/AbstractRestriction.d.ts +42 -42
- package/dist/implementation/restrictions/AbstractRestriction.js +164 -154
- package/dist/implementation/restrictions/AbstractRestriction.js.map +1 -1
- package/dist/implementation/restrictions/AbstractSnapRestriction.d.ts +35 -35
- package/dist/implementation/restrictions/AbstractSnapRestriction.js +150 -140
- package/dist/implementation/restrictions/AbstractSnapRestriction.js.map +1 -1
- package/dist/implementation/restrictions/RestrictionsHelper.d.ts +10 -10
- package/dist/implementation/restrictions/RestrictionsHelper.d.ts.map +1 -1
- package/dist/implementation/restrictions/RestrictionsHelper.js +50 -50
- package/dist/implementation/restrictions/RestrictionsHelper.js.map +1 -1
- package/dist/implementation/restrictions/camera_plane/CameraPlaneRestriction.d.ts +17 -17
- package/dist/implementation/restrictions/camera_plane/CameraPlaneRestriction.js +62 -62
- package/dist/implementation/restrictions/camera_plane/CameraPlaneRestriction.js.map +1 -1
- package/dist/implementation/restrictions/geometry/GeometryRestriction.d.ts +92 -92
- package/dist/implementation/restrictions/geometry/GeometryRestriction.js +410 -400
- package/dist/implementation/restrictions/geometry/GeometryRestriction.js.map +1 -1
- package/dist/implementation/restrictions/line/LineRestriction.d.ts +58 -58
- package/dist/implementation/restrictions/line/LineRestriction.js +291 -281
- package/dist/implementation/restrictions/line/LineRestriction.js.map +1 -1
- package/dist/implementation/restrictions/plane/PlaneRestriction.d.ts +65 -65
- package/dist/implementation/restrictions/plane/PlaneRestriction.js +306 -306
- package/dist/implementation/restrictions/plane/PlaneRestriction.js.map +1 -1
- package/dist/implementation/restrictions/plane/snap/AngularRestriction.d.ts +39 -39
- package/dist/implementation/restrictions/plane/snap/AngularRestriction.d.ts.map +1 -1
- package/dist/implementation/restrictions/plane/snap/AngularRestriction.js +346 -346
- package/dist/implementation/restrictions/plane/snap/AngularRestriction.js.map +1 -1
- package/dist/implementation/restrictions/plane/snap/AxisRestriction.d.ts +27 -27
- package/dist/implementation/restrictions/plane/snap/AxisRestriction.d.ts.map +1 -1
- package/dist/implementation/restrictions/plane/snap/AxisRestriction.js +239 -229
- package/dist/implementation/restrictions/plane/snap/AxisRestriction.js.map +1 -1
- package/dist/implementation/restrictions/plane/snap/GridRestriction.d.ts +39 -39
- package/dist/implementation/restrictions/plane/snap/GridRestriction.d.ts.map +1 -1
- package/dist/implementation/restrictions/plane/snap/GridRestriction.js +318 -308
- package/dist/implementation/restrictions/plane/snap/GridRestriction.js.map +1 -1
- package/dist/implementation/restrictions/point/PointRestriction.d.ts +45 -45
- package/dist/implementation/restrictions/point/PointRestriction.js +166 -156
- package/dist/implementation/restrictions/point/PointRestriction.js.map +1 -1
- package/dist/index.d.ts +29 -29
- package/dist/index.js +37 -37
- package/dist/interfaces/IDragAnchor.d.ts +8 -8
- package/dist/interfaces/IDragAnchor.js +2 -2
- package/dist/interfaces/IRestriction.d.ts +117 -117
- package/dist/interfaces/IRestriction.d.ts.map +1 -1
- package/dist/interfaces/IRestriction.js +23 -23
- package/dist/interfaces/IRestriction.js.map +1 -1
- package/dist/interfaces/IRestrictionManager.d.ts +13 -13
- package/dist/interfaces/IRestrictionManager.js +2 -2
- package/dist/interfaces/ISnapRestriction.d.ts +81 -81
- package/dist/interfaces/ISnapRestriction.d.ts.map +1 -1
- package/dist/interfaces/ISnapRestriction.js +3 -3
- 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 (
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
};
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
__classPrivateFieldSet(this,
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
__classPrivateFieldGet(this,
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
// #
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
}
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
const
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
__classPrivateFieldGet(this, _AxisRestriction_planeRestriction, "f").
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
0,
|
|
220
|
-
0,
|
|
221
|
-
1,
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
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":"
|
|
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;QAE7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AAM,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
|
|
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
|