@shapediver/viewer.features.drawing-tools 3.4.3 → 3.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/api/implementation/DrawingToolsApi.d.ts +1 -2
- package/dist/api/implementation/DrawingToolsApi.d.ts.map +1 -1
- package/dist/api/implementation/DrawingToolsApi.js +21 -12
- package/dist/api/implementation/DrawingToolsApi.js.map +1 -1
- package/dist/api/interfaces/IDrawingToolsApi.d.ts +2 -6
- package/dist/api/interfaces/IDrawingToolsApi.d.ts.map +1 -1
- package/dist/business/implementation/DrawingToolsManager.d.ts +6 -8
- package/dist/business/implementation/DrawingToolsManager.d.ts.map +1 -1
- package/dist/business/implementation/DrawingToolsManager.js +14 -14
- package/dist/business/implementation/DrawingToolsManager.js.map +1 -1
- package/dist/business/implementation/managers/HistoryManager.d.ts +1 -2
- package/dist/business/implementation/managers/HistoryManager.d.ts.map +1 -1
- package/dist/business/implementation/managers/HistoryManager.js.map +1 -1
- package/dist/business/implementation/managers/TextVisualizationManager.d.ts +1 -2
- package/dist/business/implementation/managers/TextVisualizationManager.d.ts.map +1 -1
- package/dist/business/implementation/managers/TextVisualizationManager.js +8 -8
- package/dist/business/implementation/managers/TextVisualizationManager.js.map +1 -1
- package/dist/business/implementation/managers/geometry/GeometryManager.d.ts +3 -4
- package/dist/business/implementation/managers/geometry/GeometryManager.d.ts.map +1 -1
- package/dist/business/implementation/managers/geometry/GeometryManager.js +2 -2
- package/dist/business/implementation/managers/geometry/GeometryManager.js.map +1 -1
- package/dist/business/implementation/managers/geometry/helpers/GeometryManagerHelper.d.ts +2 -2
- package/dist/business/implementation/managers/geometry/helpers/GeometryManagerHelper.d.ts.map +1 -1
- package/dist/business/implementation/managers/geometry/helpers/GeometryManagerHelper.js +4 -0
- package/dist/business/implementation/managers/geometry/helpers/GeometryManagerHelper.js.map +1 -1
- package/dist/business/implementation/managers/interaction/InteractionManager.d.ts +3 -4
- package/dist/business/implementation/managers/interaction/InteractionManager.d.ts.map +1 -1
- package/dist/business/implementation/managers/interaction/InteractionManager.js +23 -7
- package/dist/business/implementation/managers/interaction/InteractionManager.js.map +1 -1
- package/dist/business/implementation/managers/interaction/handlers/DeletionInteractionHandler.js +1 -1
- package/dist/business/implementation/managers/interaction/handlers/DeletionInteractionHandler.js.map +1 -1
- package/dist/business/implementation/managers/interaction/handlers/InsertionInteractionHandler.d.ts +2 -0
- package/dist/business/implementation/managers/interaction/handlers/InsertionInteractionHandler.d.ts.map +1 -1
- package/dist/business/implementation/managers/interaction/handlers/InsertionInteractionHandler.js +30 -7
- package/dist/business/implementation/managers/interaction/handlers/InsertionInteractionHandler.js.map +1 -1
- package/dist/business/implementation/managers/interaction/handlers/MidPointInteractionHandler.js +1 -1
- package/dist/business/implementation/managers/interaction/handlers/MidPointInteractionHandler.js.map +1 -1
- package/dist/business/implementation/managers/interaction/helpers/InteractionManagerHelper.d.ts.map +1 -1
- package/dist/business/implementation/managers/interaction/helpers/InteractionManagerHelper.js +6 -3
- package/dist/business/implementation/managers/interaction/helpers/InteractionManagerHelper.js.map +1 -1
- package/dist/business/interfaces/IDrawingToolsManager.d.ts +6 -38
- package/dist/business/interfaces/IDrawingToolsManager.d.ts.map +1 -1
- package/dist/business/interfaces/IDrawingToolsManager.js.map +1 -1
- package/dist/index.d.ts +6 -15
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +11 -13
- package/dist/index.js.map +1 -1
- package/package.json +11 -10
- package/dist/api/implementation/restrictions/AbstractRestrictionApi.d.ts +0 -10
- package/dist/api/implementation/restrictions/AbstractRestrictionApi.d.ts.map +0 -1
- package/dist/api/implementation/restrictions/AbstractRestrictionApi.js +0 -38
- package/dist/api/implementation/restrictions/AbstractRestrictionApi.js.map +0 -1
- package/dist/api/implementation/restrictions/AbstractSnapRestrictionApi.d.ts +0 -11
- package/dist/api/implementation/restrictions/AbstractSnapRestrictionApi.d.ts.map +0 -1
- package/dist/api/implementation/restrictions/AbstractSnapRestrictionApi.js +0 -40
- package/dist/api/implementation/restrictions/AbstractSnapRestrictionApi.js.map +0 -1
- package/dist/api/implementation/restrictions/geometry/GeometryRestrictionApi.d.ts +0 -15
- package/dist/api/implementation/restrictions/geometry/GeometryRestrictionApi.d.ts.map +0 -1
- package/dist/api/implementation/restrictions/geometry/GeometryRestrictionApi.js +0 -54
- package/dist/api/implementation/restrictions/geometry/GeometryRestrictionApi.js.map +0 -1
- package/dist/api/implementation/restrictions/plane/PlaneRestrictionApi.d.ts +0 -20
- package/dist/api/implementation/restrictions/plane/PlaneRestrictionApi.d.ts.map +0 -1
- package/dist/api/implementation/restrictions/plane/PlaneRestrictionApi.js +0 -67
- package/dist/api/implementation/restrictions/plane/PlaneRestrictionApi.js.map +0 -1
- package/dist/api/implementation/restrictions/plane/snap/AngularRestrictionApi.d.ts +0 -10
- package/dist/api/implementation/restrictions/plane/snap/AngularRestrictionApi.d.ts.map +0 -1
- package/dist/api/implementation/restrictions/plane/snap/AngularRestrictionApi.js +0 -40
- package/dist/api/implementation/restrictions/plane/snap/AngularRestrictionApi.js.map +0 -1
- package/dist/api/implementation/restrictions/plane/snap/AxisRestrictionApi.d.ts +0 -7
- package/dist/api/implementation/restrictions/plane/snap/AxisRestrictionApi.d.ts.map +0 -1
- package/dist/api/implementation/restrictions/plane/snap/AxisRestrictionApi.js +0 -24
- package/dist/api/implementation/restrictions/plane/snap/AxisRestrictionApi.js.map +0 -1
- package/dist/api/implementation/restrictions/plane/snap/GridRestrictionApi.d.ts +0 -10
- package/dist/api/implementation/restrictions/plane/snap/GridRestrictionApi.d.ts.map +0 -1
- package/dist/api/implementation/restrictions/plane/snap/GridRestrictionApi.js +0 -40
- package/dist/api/implementation/restrictions/plane/snap/GridRestrictionApi.js.map +0 -1
- package/dist/api/interfaces/IRestrictionApi.d.ts +0 -11
- package/dist/api/interfaces/IRestrictionApi.d.ts.map +0 -1
- package/dist/api/interfaces/IRestrictionApi.js +0 -3
- package/dist/api/interfaces/IRestrictionApi.js.map +0 -1
- package/dist/api/interfaces/ISnapRestrictionApi.d.ts +0 -13
- package/dist/api/interfaces/ISnapRestrictionApi.d.ts.map +0 -1
- package/dist/api/interfaces/ISnapRestrictionApi.js +0 -3
- package/dist/api/interfaces/ISnapRestrictionApi.js.map +0 -1
- package/dist/business/implementation/managers/geometry/GeometryMathManager.d.ts +0 -82
- package/dist/business/implementation/managers/geometry/GeometryMathManager.d.ts.map +0 -1
- package/dist/business/implementation/managers/geometry/GeometryMathManager.js +0 -245
- package/dist/business/implementation/managers/geometry/GeometryMathManager.js.map +0 -1
- package/dist/business/implementation/managers/interaction/EventManager.d.ts +0 -26
- package/dist/business/implementation/managers/interaction/EventManager.d.ts.map +0 -1
- package/dist/business/implementation/managers/interaction/EventManager.js +0 -63
- package/dist/business/implementation/managers/interaction/EventManager.js.map +0 -1
- package/dist/business/implementation/managers/interaction/RestrictionManager.d.ts +0 -19
- package/dist/business/implementation/managers/interaction/RestrictionManager.d.ts.map +0 -1
- package/dist/business/implementation/managers/interaction/RestrictionManager.js +0 -113
- package/dist/business/implementation/managers/interaction/RestrictionManager.js.map +0 -1
- package/dist/business/implementation/managers/interaction/restrictions/AbstractRestriction.d.ts +0 -19
- package/dist/business/implementation/managers/interaction/restrictions/AbstractRestriction.d.ts.map +0 -1
- package/dist/business/implementation/managers/interaction/restrictions/AbstractRestriction.js +0 -105
- package/dist/business/implementation/managers/interaction/restrictions/AbstractRestriction.js.map +0 -1
- package/dist/business/implementation/managers/interaction/restrictions/AbstractSnapRestriction.d.ts +0 -31
- package/dist/business/implementation/managers/interaction/restrictions/AbstractSnapRestriction.d.ts.map +0 -1
- package/dist/business/implementation/managers/interaction/restrictions/AbstractSnapRestriction.js +0 -125
- package/dist/business/implementation/managers/interaction/restrictions/AbstractSnapRestriction.js.map +0 -1
- package/dist/business/implementation/managers/interaction/restrictions/geometry/GeometryRestriction.d.ts +0 -40
- package/dist/business/implementation/managers/interaction/restrictions/geometry/GeometryRestriction.d.ts.map +0 -1
- package/dist/business/implementation/managers/interaction/restrictions/geometry/GeometryRestriction.js +0 -257
- package/dist/business/implementation/managers/interaction/restrictions/geometry/GeometryRestriction.js.map +0 -1
- package/dist/business/implementation/managers/interaction/restrictions/plane/PlaneRestriction.d.ts +0 -66
- package/dist/business/implementation/managers/interaction/restrictions/plane/PlaneRestriction.d.ts.map +0 -1
- package/dist/business/implementation/managers/interaction/restrictions/plane/PlaneRestriction.js +0 -244
- package/dist/business/implementation/managers/interaction/restrictions/plane/PlaneRestriction.js.map +0 -1
- package/dist/business/implementation/managers/interaction/restrictions/plane/snap/AngularRestriction.d.ts +0 -39
- package/dist/business/implementation/managers/interaction/restrictions/plane/snap/AngularRestriction.d.ts.map +0 -1
- package/dist/business/implementation/managers/interaction/restrictions/plane/snap/AngularRestriction.js +0 -317
- package/dist/business/implementation/managers/interaction/restrictions/plane/snap/AngularRestriction.js.map +0 -1
- package/dist/business/implementation/managers/interaction/restrictions/plane/snap/AxisRestriction.d.ts +0 -27
- package/dist/business/implementation/managers/interaction/restrictions/plane/snap/AxisRestriction.d.ts.map +0 -1
- package/dist/business/implementation/managers/interaction/restrictions/plane/snap/AxisRestriction.js +0 -165
- package/dist/business/implementation/managers/interaction/restrictions/plane/snap/AxisRestriction.js.map +0 -1
- package/dist/business/implementation/managers/interaction/restrictions/plane/snap/GridRestriction.d.ts +0 -39
- package/dist/business/implementation/managers/interaction/restrictions/plane/snap/GridRestriction.d.ts.map +0 -1
- package/dist/business/implementation/managers/interaction/restrictions/plane/snap/GridRestriction.js +0 -212
- package/dist/business/implementation/managers/interaction/restrictions/plane/snap/GridRestriction.js.map +0 -1
- package/dist/business/implementation/utils/numberCleaner.d.ts +0 -2
- package/dist/business/implementation/utils/numberCleaner.d.ts.map +0 -1
- package/dist/business/implementation/utils/numberCleaner.js +0 -9
- package/dist/business/implementation/utils/numberCleaner.js.map +0 -1
- package/dist/business/interfaces/IManager.d.ts +0 -4
- package/dist/business/interfaces/IManager.d.ts.map +0 -1
- package/dist/business/interfaces/IManager.js +0 -3
- package/dist/business/interfaces/IManager.js.map +0 -1
- package/dist/business/interfaces/IRestriction.d.ts +0 -40
- package/dist/business/interfaces/IRestriction.d.ts.map +0 -1
- package/dist/business/interfaces/IRestriction.js +0 -12
- package/dist/business/interfaces/IRestriction.js.map +0 -1
- package/dist/business/interfaces/IRestrictionBase.d.ts +0 -19
- package/dist/business/interfaces/IRestrictionBase.d.ts.map +0 -1
- package/dist/business/interfaces/IRestrictionBase.js +0 -5
- package/dist/business/interfaces/IRestrictionBase.js.map +0 -1
- package/dist/business/interfaces/ISnapRestriction.d.ts +0 -52
- package/dist/business/interfaces/ISnapRestriction.d.ts.map +0 -1
- package/dist/business/interfaces/ISnapRestriction.js +0 -4
- package/dist/business/interfaces/ISnapRestriction.js.map +0 -1
- package/dist/three/CSS2DRenderer.d.ts +0 -32
- package/dist/three/CSS2DRenderer.d.ts.map +0 -1
- package/dist/three/CSS2DRenderer.js +0 -137
- package/dist/three/CSS2DRenderer.js.map +0 -1
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import { AbstractRestriction } from '../../AbstractRestriction';
|
|
2
|
-
import { DrawingToolsManager } from '../../../../../DrawingToolsManager';
|
|
3
|
-
import { IRay } from '@shapediver/viewer.features.interaction';
|
|
4
|
-
import { ISnapRestriction, SnapRestrictionProperties } from '../../../../../../interfaces/ISnapRestriction';
|
|
5
|
-
import { PlaneRestriction } from '../PlaneRestriction';
|
|
6
|
-
import { RestrictionMetaData } from '../../../../../../interfaces/IRestriction';
|
|
7
|
-
import { vec3 } from 'gl-matrix';
|
|
8
|
-
export declare type AngularRestrictionProperties = {
|
|
9
|
-
/**
|
|
10
|
-
* Step size for the angles
|
|
11
|
-
*/
|
|
12
|
-
angleStep?: number;
|
|
13
|
-
/**
|
|
14
|
-
* If the angle step is editable for change to the end user.
|
|
15
|
-
* If it is not editable, the angle step cannot be changed from the default value.
|
|
16
|
-
*/
|
|
17
|
-
angleStepEditable?: boolean;
|
|
18
|
-
} & SnapRestrictionProperties;
|
|
19
|
-
export declare class AngularRestriction extends AbstractRestriction implements ISnapRestriction {
|
|
20
|
-
#private;
|
|
21
|
-
constructor(drawingToolsManager: DrawingToolsManager, planeRestriction: PlaneRestriction, properties?: AngularRestrictionProperties);
|
|
22
|
-
get active(): boolean;
|
|
23
|
-
set active(value: boolean);
|
|
24
|
-
get angleStep(): number;
|
|
25
|
-
set angleStep(value: number);
|
|
26
|
-
get angleStepEditable(): boolean;
|
|
27
|
-
get enabledEditable(): boolean;
|
|
28
|
-
get priority(): number;
|
|
29
|
-
set priority(value: number);
|
|
30
|
-
snap(ray: IRay, point: vec3, metaData?: RestrictionMetaData): vec3 | undefined;
|
|
31
|
-
updatePlaneDefinition(): void;
|
|
32
|
-
protected visibilityChanged(visible: boolean): void;
|
|
33
|
-
private calculateAngles;
|
|
34
|
-
private createGrid;
|
|
35
|
-
private getAngularDifference;
|
|
36
|
-
private getNextIndex;
|
|
37
|
-
private getPreviousIndex;
|
|
38
|
-
}
|
|
39
|
-
//# sourceMappingURL=AngularRestriction.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"AngularRestriction.d.ts","sourceRoot":"","sources":["../../../../../../../../src/business/implementation/managers/interaction/restrictions/plane/snap/AngularRestriction.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAEhE,OAAO,EAAE,mBAAmB,EAAE,MAAM,oCAAoC,CAAC;AAEzE,OAAO,EAAE,IAAI,EAAE,MAAM,yCAAyC,CAAC;AAC/D,OAAO,EAAE,gBAAgB,EAAE,yBAAyB,EAAE,MAAM,+CAA+C,CAAC;AAE5G,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,EAAE,mBAAmB,EAAE,MAAM,2CAA2C,CAAC;AAGhF,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAIjC,oBAAY,4BAA4B,GAAG;IACvC;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;;OAGG;IACH,iBAAiB,CAAC,EAAE,OAAO,CAAC;CAC/B,GAAG,yBAAyB,CAAC;AAM9B,qBAAa,kBAAmB,SAAQ,mBAAoB,YAAW,gBAAgB;;gBAyBvE,mBAAmB,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,UAAU,CAAC,EAAE,4BAA4B;IAwBnI,IAAW,MAAM,IAAI,OAAO,CAE3B;IAED,IAAW,MAAM,CAAC,KAAK,EAAE,OAAO,EAU/B;IAED,IAAW,SAAS,IAAI,MAAM,CAE7B;IAED,IAAW,SAAS,CAAC,KAAK,EAAE,MAAM,EAKjC;IAED,IAAW,iBAAiB,IAAI,OAAO,CAEtC;IAED,IAAW,eAAe,IAAI,OAAO,CAEpC;IAED,IAAW,QAAQ,IAAI,MAAM,CAE5B;IAED,IAAW,QAAQ,CAAC,KAAK,EAAE,MAAM,EAEhC;IAMM,IAAI,CAAC,GAAG,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,QAAQ,CAAC,EAAE,mBAAmB,GAAG,IAAI,GAAG,SAAS;IA+H9E,qBAAqB,IAAI,IAAI;IAMpC,SAAS,CAAC,iBAAiB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI;IAWnD,OAAO,CAAC,eAAe;IAOvB,OAAO,CAAC,UAAU;IAiElB,OAAO,CAAC,oBAAoB;IAsC5B,OAAO,CAAC,YAAY;IAIpB,OAAO,CAAC,gBAAgB;CAK3B"}
|
|
@@ -1,317 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
|
3
|
-
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
4
|
-
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
5
|
-
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
6
|
-
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
7
|
-
};
|
|
8
|
-
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
9
|
-
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
10
|
-
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
11
|
-
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
12
|
-
};
|
|
13
|
-
var _AngularRestriction_activationKey, _AngularRestriction_drawingToolsManager, _AngularRestriction_geometryMathManager, _AngularRestriction_planeRestriction, _AngularRestriction_settings, _AngularRestriction_active, _AngularRestriction_activePolarGrids, _AngularRestriction_angleStep, _AngularRestriction_angleStepEditable, _AngularRestriction_angles, _AngularRestriction_labelNext, _AngularRestriction_labelPrevious, _AngularRestriction_priority;
|
|
14
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
-
exports.AngularRestriction = void 0;
|
|
16
|
-
const AbstractRestriction_1 = require("../../AbstractRestriction");
|
|
17
|
-
const CSS2DRenderer_1 = require("../../../../../../../three/CSS2DRenderer");
|
|
18
|
-
const numberCleaner_1 = require("../../../../../utils/numberCleaner");
|
|
19
|
-
const viewer_1 = require("@shapediver/viewer");
|
|
20
|
-
const gl_matrix_1 = require("gl-matrix");
|
|
21
|
-
// #endregion Type aliases (1)
|
|
22
|
-
// #region Classes (1)
|
|
23
|
-
class AngularRestriction extends AbstractRestriction_1.AbstractRestriction {
|
|
24
|
-
// #endregion Properties (13)
|
|
25
|
-
// #region Constructors (1)
|
|
26
|
-
constructor(drawingToolsManager, planeRestriction, properties) {
|
|
27
|
-
var _a, _b, _c;
|
|
28
|
-
super(drawingToolsManager, 'angular');
|
|
29
|
-
// #region Properties (13)
|
|
30
|
-
_AngularRestriction_activationKey.set(this, void 0);
|
|
31
|
-
_AngularRestriction_drawingToolsManager.set(this, void 0);
|
|
32
|
-
_AngularRestriction_geometryMathManager.set(this, void 0);
|
|
33
|
-
_AngularRestriction_planeRestriction.set(this, void 0);
|
|
34
|
-
_AngularRestriction_settings.set(this, void 0);
|
|
35
|
-
_AngularRestriction_active.set(this, false);
|
|
36
|
-
_AngularRestriction_activePolarGrids.set(this, {
|
|
37
|
-
next: false,
|
|
38
|
-
previous: false
|
|
39
|
-
});
|
|
40
|
-
_AngularRestriction_angleStep.set(this, void 0);
|
|
41
|
-
_AngularRestriction_angleStepEditable.set(this, true);
|
|
42
|
-
_AngularRestriction_angles.set(this, []);
|
|
43
|
-
_AngularRestriction_labelNext.set(this, void 0);
|
|
44
|
-
_AngularRestriction_labelPrevious.set(this, void 0);
|
|
45
|
-
_AngularRestriction_priority.set(this, 0);
|
|
46
|
-
__classPrivateFieldSet(this, _AngularRestriction_drawingToolsManager, drawingToolsManager, "f");
|
|
47
|
-
__classPrivateFieldSet(this, _AngularRestriction_geometryMathManager, drawingToolsManager.geometryMathManager, "f");
|
|
48
|
-
__classPrivateFieldSet(this, _AngularRestriction_settings, drawingToolsManager.settings, "f");
|
|
49
|
-
__classPrivateFieldSet(this, _AngularRestriction_planeRestriction, planeRestriction, "f");
|
|
50
|
-
__classPrivateFieldSet(this, _AngularRestriction_activationKey, (properties === null || properties === void 0 ? void 0 : properties.activationKey) || 'a', "f");
|
|
51
|
-
this.enabled = (_a = properties === null || properties === void 0 ? void 0 : properties.enabled) !== null && _a !== void 0 ? _a : false;
|
|
52
|
-
this._enabledEditable = (_b = properties === null || properties === void 0 ? void 0 : properties.enabledEditable) !== null && _b !== void 0 ? _b : true;
|
|
53
|
-
__classPrivateFieldSet(this, _AngularRestriction_angleStep, (properties === null || properties === void 0 ? void 0 : properties.angleStep) || Math.PI / 12, "f");
|
|
54
|
-
__classPrivateFieldSet(this, _AngularRestriction_angleStepEditable, (_c = properties === null || properties === void 0 ? void 0 : properties.angleStepEditable) !== null && _c !== void 0 ? _c : true, "f");
|
|
55
|
-
__classPrivateFieldSet(this, _AngularRestriction_priority, (properties === null || properties === void 0 ? void 0 : properties.priority) || 0, "f");
|
|
56
|
-
// calculate the angles
|
|
57
|
-
this.calculateAngles();
|
|
58
|
-
}
|
|
59
|
-
// #endregion Constructors (1)
|
|
60
|
-
// #region Public Getters And Setters (8)
|
|
61
|
-
get active() {
|
|
62
|
-
return __classPrivateFieldGet(this, _AngularRestriction_active, "f");
|
|
63
|
-
}
|
|
64
|
-
set active(value) {
|
|
65
|
-
__classPrivateFieldSet(this, _AngularRestriction_active, value, "f");
|
|
66
|
-
if (value === false) {
|
|
67
|
-
if (__classPrivateFieldGet(this, _AngularRestriction_labelNext, "f"))
|
|
68
|
-
__classPrivateFieldGet(this, _AngularRestriction_labelNext, "f").visible = false;
|
|
69
|
-
if (__classPrivateFieldGet(this, _AngularRestriction_labelPrevious, "f"))
|
|
70
|
-
__classPrivateFieldGet(this, _AngularRestriction_labelPrevious, "f").visible = false;
|
|
71
|
-
}
|
|
72
|
-
else {
|
|
73
|
-
if (__classPrivateFieldGet(this, _AngularRestriction_labelNext, "f") && __classPrivateFieldGet(this, _AngularRestriction_activePolarGrids, "f").next)
|
|
74
|
-
__classPrivateFieldGet(this, _AngularRestriction_labelNext, "f").visible = true;
|
|
75
|
-
if (__classPrivateFieldGet(this, _AngularRestriction_labelPrevious, "f") && __classPrivateFieldGet(this, _AngularRestriction_activePolarGrids, "f").previous)
|
|
76
|
-
__classPrivateFieldGet(this, _AngularRestriction_labelPrevious, "f").visible = true;
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
get angleStep() {
|
|
80
|
-
return __classPrivateFieldGet(this, _AngularRestriction_angleStep, "f");
|
|
81
|
-
}
|
|
82
|
-
set angleStep(value) {
|
|
83
|
-
if (__classPrivateFieldGet(this, _AngularRestriction_angleStepEditable, "f") === false)
|
|
84
|
-
return;
|
|
85
|
-
__classPrivateFieldSet(this, _AngularRestriction_angleStep, value, "f");
|
|
86
|
-
this.calculateAngles();
|
|
87
|
-
}
|
|
88
|
-
get angleStepEditable() {
|
|
89
|
-
return __classPrivateFieldGet(this, _AngularRestriction_angleStepEditable, "f");
|
|
90
|
-
}
|
|
91
|
-
get enabledEditable() {
|
|
92
|
-
return this._enabledEditable;
|
|
93
|
-
}
|
|
94
|
-
get priority() {
|
|
95
|
-
return __classPrivateFieldGet(this, _AngularRestriction_priority, "f");
|
|
96
|
-
}
|
|
97
|
-
set priority(value) {
|
|
98
|
-
__classPrivateFieldSet(this, _AngularRestriction_priority, value, "f");
|
|
99
|
-
}
|
|
100
|
-
// #endregion Public Getters And Setters (8)
|
|
101
|
-
// #region Public Methods (2)
|
|
102
|
-
snap(ray, point, metaData) {
|
|
103
|
-
// if the restriction is not enabled OR the activation key is set and the key is not pressed, return
|
|
104
|
-
if (this.enabled === false && __classPrivateFieldGet(this, _AngularRestriction_drawingToolsManager, "f").keyPressed(__classPrivateFieldGet(this, _AngularRestriction_activationKey, "f")) === false)
|
|
105
|
-
return;
|
|
106
|
-
if (__classPrivateFieldGet(this, _AngularRestriction_labelNext, "f"))
|
|
107
|
-
__classPrivateFieldGet(this, _AngularRestriction_labelNext, "f").visible = false;
|
|
108
|
-
if (__classPrivateFieldGet(this, _AngularRestriction_labelPrevious, "f"))
|
|
109
|
-
__classPrivateFieldGet(this, _AngularRestriction_labelPrevious, "f").visible = false;
|
|
110
|
-
__classPrivateFieldSet(this, _AngularRestriction_activePolarGrids, {
|
|
111
|
-
next: false,
|
|
112
|
-
previous: false
|
|
113
|
-
}, "f");
|
|
114
|
-
const positionArray = __classPrivateFieldGet(this, _AngularRestriction_drawingToolsManager, "f").positionArray;
|
|
115
|
-
let previousIndex, nextIndex;
|
|
116
|
-
if (metaData !== undefined && metaData.index !== undefined) {
|
|
117
|
-
previousIndex = this.getPreviousIndex(metaData.index);
|
|
118
|
-
nextIndex = this.getNextIndex(metaData.index);
|
|
119
|
-
}
|
|
120
|
-
else {
|
|
121
|
-
// if no index was provided, it is a new point
|
|
122
|
-
previousIndex = positionArray.length / 3 - 1;
|
|
123
|
-
nextIndex = 0;
|
|
124
|
-
}
|
|
125
|
-
const previousPreviousIndex = this.getPreviousIndex(previousIndex);
|
|
126
|
-
const nextNextIndex = this.getNextIndex(nextIndex);
|
|
127
|
-
if (positionArray.length / 3 < 2)
|
|
128
|
-
return;
|
|
129
|
-
/**
|
|
130
|
-
* Explanation of the algorithm:
|
|
131
|
-
* 1. Project the point onto the XY-Plane
|
|
132
|
-
* 2. Find the next point and the previous point
|
|
133
|
-
* 3. Project the next and previous point onto the XY-Plane
|
|
134
|
-
* 4. Calculate the angle between the point and the next and previous point
|
|
135
|
-
* 5. Determine which if the angles are in the range to snap to
|
|
136
|
-
* a. If both are in the range, snap to the intersection of the two lines
|
|
137
|
-
* b. If only one is in the range, snap to the intersection of the line and the plane
|
|
138
|
-
* c. If none is in the range, return
|
|
139
|
-
* 6. Reverse the projection to the original coordinate system
|
|
140
|
-
*/
|
|
141
|
-
// get the next and previous point from the position array
|
|
142
|
-
const nextPointFromData = gl_matrix_1.vec3.fromValues(positionArray.at((nextIndex * 3)), positionArray.at((nextIndex * 3) + 1), positionArray.at((nextIndex * 3) + 2));
|
|
143
|
-
const nextNextPointFromData = gl_matrix_1.vec3.fromValues(positionArray.at((nextNextIndex * 3)), positionArray.at((nextNextIndex * 3) + 1), positionArray.at((nextNextIndex * 3) + 2));
|
|
144
|
-
const previousPointFromData = gl_matrix_1.vec3.fromValues(positionArray.at((previousIndex * 3)), positionArray.at((previousIndex * 3) + 1), positionArray.at((previousIndex * 3) + 2));
|
|
145
|
-
const previousPreviousPointFromData = gl_matrix_1.vec3.fromValues(positionArray.at((previousPreviousIndex * 3)), positionArray.at((previousPreviousIndex * 3) + 1), positionArray.at((previousPreviousIndex * 3) + 2));
|
|
146
|
-
// project them onto the same plane as the point
|
|
147
|
-
const nextPointProjected = gl_matrix_1.vec3.sub(gl_matrix_1.vec3.create(), nextPointFromData, gl_matrix_1.vec3.scale(gl_matrix_1.vec3.create(), __classPrivateFieldGet(this, _AngularRestriction_planeRestriction, "f").normal, gl_matrix_1.vec3.dot(gl_matrix_1.vec3.sub(gl_matrix_1.vec3.create(), nextPointFromData, point), __classPrivateFieldGet(this, _AngularRestriction_planeRestriction, "f").normal)));
|
|
148
|
-
const nextNextPointProjected = gl_matrix_1.vec3.sub(gl_matrix_1.vec3.create(), nextNextPointFromData, gl_matrix_1.vec3.scale(gl_matrix_1.vec3.create(), __classPrivateFieldGet(this, _AngularRestriction_planeRestriction, "f").normal, gl_matrix_1.vec3.dot(gl_matrix_1.vec3.sub(gl_matrix_1.vec3.create(), nextNextPointFromData, point), __classPrivateFieldGet(this, _AngularRestriction_planeRestriction, "f").normal)));
|
|
149
|
-
const previousPointProjected = gl_matrix_1.vec3.sub(gl_matrix_1.vec3.create(), previousPointFromData, gl_matrix_1.vec3.scale(gl_matrix_1.vec3.create(), __classPrivateFieldGet(this, _AngularRestriction_planeRestriction, "f").normal, gl_matrix_1.vec3.dot(gl_matrix_1.vec3.sub(gl_matrix_1.vec3.create(), previousPointFromData, point), __classPrivateFieldGet(this, _AngularRestriction_planeRestriction, "f").normal)));
|
|
150
|
-
const previousPreviousPointProjected = gl_matrix_1.vec3.sub(gl_matrix_1.vec3.create(), previousPreviousPointFromData, gl_matrix_1.vec3.scale(gl_matrix_1.vec3.create(), __classPrivateFieldGet(this, _AngularRestriction_planeRestriction, "f").normal, gl_matrix_1.vec3.dot(gl_matrix_1.vec3.sub(gl_matrix_1.vec3.create(), previousPreviousPointFromData, point), __classPrivateFieldGet(this, _AngularRestriction_planeRestriction, "f").normal)));
|
|
151
|
-
// project the point onto the XY-Plane
|
|
152
|
-
const pointProjected = gl_matrix_1.vec3.transformMat4(gl_matrix_1.vec3.create(), point, __classPrivateFieldGet(this, _AngularRestriction_planeRestriction, "f").transformationToXYPlaneMatrix);
|
|
153
|
-
gl_matrix_1.vec3.transformMat4(nextPointProjected, nextPointProjected, __classPrivateFieldGet(this, _AngularRestriction_planeRestriction, "f").transformationToXYPlaneMatrix);
|
|
154
|
-
gl_matrix_1.vec3.transformMat4(nextNextPointProjected, nextNextPointProjected, __classPrivateFieldGet(this, _AngularRestriction_planeRestriction, "f").transformationToXYPlaneMatrix);
|
|
155
|
-
gl_matrix_1.vec3.transformMat4(previousPointProjected, previousPointProjected, __classPrivateFieldGet(this, _AngularRestriction_planeRestriction, "f").transformationToXYPlaneMatrix);
|
|
156
|
-
gl_matrix_1.vec3.transformMat4(previousPreviousPointProjected, previousPreviousPointProjected, __classPrivateFieldGet(this, _AngularRestriction_planeRestriction, "f").transformationToXYPlaneMatrix);
|
|
157
|
-
// calculate the angle between the next and previous point and the point to restrict on the axis
|
|
158
|
-
const { angularDifference: angularDifferenceNext, crossProduct: crossProductNext, closestAngle: closestAngleNext } = this.getAngularDifference({ start: nextPointProjected, end: nextNextPointProjected }, { start: nextPointProjected, end: pointProjected });
|
|
159
|
-
const { angularDifference: angularDifferencePrevious, crossProduct: crossProductPrevious, closestAngle: closestAnglePrevious } = this.getAngularDifference({ start: previousPointProjected, end: previousPreviousPointProjected }, { start: previousPointProjected, end: pointProjected });
|
|
160
|
-
// calculate the distances in screen space so we can check how close it is
|
|
161
|
-
const resultPointNextAngle = gl_matrix_1.vec3.rotateZ(gl_matrix_1.vec3.create(), pointProjected, nextPointProjected, crossProductNext[2] < 0 ? -angularDifferenceNext : angularDifferenceNext);
|
|
162
|
-
const screenSpaceDistanceCheckNextAngle = __classPrivateFieldGet(this, _AngularRestriction_geometryMathManager, "f").screenSpaceDistanceCheck(resultPointNextAngle, pointProjected, __classPrivateFieldGet(this, _AngularRestriction_settings, "f").visualization.points.size_0 * __classPrivateFieldGet(this, _AngularRestriction_settings, "f").visualization.distanceMultiplicationFactor);
|
|
163
|
-
const resultPointPreviousAngle = gl_matrix_1.vec3.rotateZ(gl_matrix_1.vec3.create(), pointProjected, previousPointProjected, crossProductPrevious[2] < 0 ? -angularDifferencePrevious : angularDifferencePrevious);
|
|
164
|
-
const screenSpaceDistanceCheckPreviousAngle = __classPrivateFieldGet(this, _AngularRestriction_geometryMathManager, "f").screenSpaceDistanceCheck(resultPointPreviousAngle, pointProjected, __classPrivateFieldGet(this, _AngularRestriction_settings, "f").visualization.points.size_0 * __classPrivateFieldGet(this, _AngularRestriction_settings, "f").visualization.distanceMultiplicationFactor);
|
|
165
|
-
if (screenSpaceDistanceCheckNextAngle.check === false && screenSpaceDistanceCheckPreviousAngle.check === false)
|
|
166
|
-
return;
|
|
167
|
-
// snap to clear defined point if both distances are smaller than threshold
|
|
168
|
-
if (positionArray.length > 6 && screenSpaceDistanceCheckNextAngle.check === true && screenSpaceDistanceCheckPreviousAngle.check === true) {
|
|
169
|
-
const rayDirectionNext = gl_matrix_1.vec3.normalize(gl_matrix_1.vec3.create(), gl_matrix_1.vec3.sub(gl_matrix_1.vec3.create(), resultPointNextAngle, nextPointProjected));
|
|
170
|
-
const rayDirectionPrevious = gl_matrix_1.vec3.normalize(gl_matrix_1.vec3.create(), gl_matrix_1.vec3.sub(gl_matrix_1.vec3.create(), resultPointPreviousAngle, previousPointProjected));
|
|
171
|
-
const crossProduct = gl_matrix_1.vec3.cross(gl_matrix_1.vec3.create(), rayDirectionNext, rayDirectionPrevious);
|
|
172
|
-
const crossProductLength = gl_matrix_1.vec3.length(crossProduct);
|
|
173
|
-
if (crossProductLength < 0.001) {
|
|
174
|
-
gl_matrix_1.vec3.transformMat4(resultPointNextAngle, resultPointNextAngle, __classPrivateFieldGet(this, _AngularRestriction_planeRestriction, "f").transformationFromXYPlaneMatrix);
|
|
175
|
-
return resultPointNextAngle;
|
|
176
|
-
}
|
|
177
|
-
const t = gl_matrix_1.vec3.sub(gl_matrix_1.vec3.create(), previousPointProjected, nextPointProjected);
|
|
178
|
-
const u = gl_matrix_1.vec3.cross(gl_matrix_1.vec3.create(), t, rayDirectionPrevious);
|
|
179
|
-
const v = gl_matrix_1.vec3.cross(gl_matrix_1.vec3.create(), t, rayDirectionNext);
|
|
180
|
-
const tValue = gl_matrix_1.vec3.dot(u, crossProduct) / Math.pow(crossProductLength, 2);
|
|
181
|
-
const uValue = gl_matrix_1.vec3.dot(v, crossProduct) / Math.pow(crossProductLength, 2);
|
|
182
|
-
if (tValue < 0 || uValue < 0) {
|
|
183
|
-
gl_matrix_1.vec3.transformMat4(resultPointNextAngle, resultPointNextAngle, __classPrivateFieldGet(this, _AngularRestriction_planeRestriction, "f").transformationFromXYPlaneMatrix);
|
|
184
|
-
return resultPointNextAngle;
|
|
185
|
-
}
|
|
186
|
-
const intersection = gl_matrix_1.vec3.add(gl_matrix_1.vec3.create(), nextPointProjected, gl_matrix_1.vec3.scale(gl_matrix_1.vec3.create(), rayDirectionNext, tValue));
|
|
187
|
-
__classPrivateFieldSet(this, _AngularRestriction_labelNext, this.createGrid(__classPrivateFieldGet(this, _AngularRestriction_labelNext, "f"), nextPointFromData, closestAngleNext), "f");
|
|
188
|
-
__classPrivateFieldGet(this, _AngularRestriction_activePolarGrids, "f").next = true;
|
|
189
|
-
__classPrivateFieldSet(this, _AngularRestriction_labelPrevious, this.createGrid(__classPrivateFieldGet(this, _AngularRestriction_labelPrevious, "f"), previousPointFromData, closestAnglePrevious), "f");
|
|
190
|
-
__classPrivateFieldGet(this, _AngularRestriction_activePolarGrids, "f").previous = true;
|
|
191
|
-
// reverse the projection to the original coordinate system
|
|
192
|
-
gl_matrix_1.vec3.transformMat4(intersection, intersection, __classPrivateFieldGet(this, _AngularRestriction_planeRestriction, "f").transformationFromXYPlaneMatrix);
|
|
193
|
-
return intersection;
|
|
194
|
-
}
|
|
195
|
-
// check which distance to the projection is smaller
|
|
196
|
-
if (screenSpaceDistanceCheckNextAngle.distanceSquared < screenSpaceDistanceCheckPreviousAngle.distanceSquared) {
|
|
197
|
-
__classPrivateFieldSet(this, _AngularRestriction_labelNext, this.createGrid(__classPrivateFieldGet(this, _AngularRestriction_labelNext, "f"), nextPointFromData, closestAngleNext), "f");
|
|
198
|
-
__classPrivateFieldGet(this, _AngularRestriction_activePolarGrids, "f").next = true;
|
|
199
|
-
// reverse the projection to the original coordinate system
|
|
200
|
-
gl_matrix_1.vec3.transformMat4(resultPointNextAngle, resultPointNextAngle, __classPrivateFieldGet(this, _AngularRestriction_planeRestriction, "f").transformationFromXYPlaneMatrix);
|
|
201
|
-
return resultPointNextAngle;
|
|
202
|
-
}
|
|
203
|
-
else {
|
|
204
|
-
__classPrivateFieldSet(this, _AngularRestriction_labelPrevious, this.createGrid(__classPrivateFieldGet(this, _AngularRestriction_labelPrevious, "f"), previousPointFromData, closestAnglePrevious), "f");
|
|
205
|
-
__classPrivateFieldGet(this, _AngularRestriction_activePolarGrids, "f").previous = true;
|
|
206
|
-
// reverse the projection to the original coordinate system
|
|
207
|
-
gl_matrix_1.vec3.transformMat4(resultPointPreviousAngle, resultPointPreviousAngle, __classPrivateFieldGet(this, _AngularRestriction_planeRestriction, "f").transformationFromXYPlaneMatrix);
|
|
208
|
-
return resultPointPreviousAngle;
|
|
209
|
-
}
|
|
210
|
-
}
|
|
211
|
-
updatePlaneDefinition() { }
|
|
212
|
-
// #endregion Public Methods (2)
|
|
213
|
-
// #region Protected Methods (1)
|
|
214
|
-
visibilityChanged(visible) {
|
|
215
|
-
if (visible === false) {
|
|
216
|
-
if (__classPrivateFieldGet(this, _AngularRestriction_labelNext, "f"))
|
|
217
|
-
__classPrivateFieldGet(this, _AngularRestriction_labelNext, "f").visible = false;
|
|
218
|
-
if (__classPrivateFieldGet(this, _AngularRestriction_labelPrevious, "f"))
|
|
219
|
-
__classPrivateFieldGet(this, _AngularRestriction_labelPrevious, "f").visible = false;
|
|
220
|
-
}
|
|
221
|
-
}
|
|
222
|
-
// #endregion Protected Methods (1)
|
|
223
|
-
// #region Private Methods (5)
|
|
224
|
-
calculateAngles() {
|
|
225
|
-
__classPrivateFieldSet(this, _AngularRestriction_angles, [], "f");
|
|
226
|
-
for (let i = 0; i <= Math.PI + 0.0001; i += __classPrivateFieldGet(this, _AngularRestriction_angleStep, "f")) {
|
|
227
|
-
__classPrivateFieldGet(this, _AngularRestriction_angles, "f").push(i);
|
|
228
|
-
}
|
|
229
|
-
}
|
|
230
|
-
createGrid(label, position, angle) {
|
|
231
|
-
if (label)
|
|
232
|
-
this._object3D.remove(label);
|
|
233
|
-
let radius = viewer_1.sceneTree.root.boundingBox.boundingSphere.radius / 100;
|
|
234
|
-
if (radius === Infinity)
|
|
235
|
-
radius = 1;
|
|
236
|
-
const text = document.createElement('div');
|
|
237
|
-
text.className = 'label';
|
|
238
|
-
label = new CSS2DRenderer_1.CSS2DObject(text);
|
|
239
|
-
// remove the old style, if there is one
|
|
240
|
-
document.head.querySelectorAll('style').forEach(style => {
|
|
241
|
-
var _a;
|
|
242
|
-
if ((_a = style.textContent) === null || _a === void 0 ? void 0 : _a.includes(label.uuid))
|
|
243
|
-
document.head.removeChild(style);
|
|
244
|
-
});
|
|
245
|
-
const parent = document.createElement('div');
|
|
246
|
-
parent.className = `angular-label-parent-${label.uuid}`;
|
|
247
|
-
const child = document.createElement('div');
|
|
248
|
-
child.className = `angular-label-${label.uuid}`;
|
|
249
|
-
const style = document.createElement('style');
|
|
250
|
-
style.textContent = `
|
|
251
|
-
.angular-label-${label.uuid} {
|
|
252
|
-
display: flex;
|
|
253
|
-
justify-content: center;
|
|
254
|
-
align-items: center;
|
|
255
|
-
width: 32px;
|
|
256
|
-
height: 32px;
|
|
257
|
-
color: white;
|
|
258
|
-
background-color: ${__classPrivateFieldGet(this, _AngularRestriction_settings, "f").visualization.points.color_1};
|
|
259
|
-
border-radius: 50%;
|
|
260
|
-
font-size: 16px;
|
|
261
|
-
text-align: center;
|
|
262
|
-
}
|
|
263
|
-
|
|
264
|
-
.angular-label-parent-${label.uuid} {
|
|
265
|
-
display: flex;
|
|
266
|
-
justify-content: center;
|
|
267
|
-
align-items: center;
|
|
268
|
-
width: 40px; /* 32px + 2 * 4px border width */
|
|
269
|
-
height: 40px; /* 32px + 2 * 4px border width */
|
|
270
|
-
border-radius: 50%;
|
|
271
|
-
background: conic-gradient(
|
|
272
|
-
${__classPrivateFieldGet(this, _AngularRestriction_settings, "f").visualization.points.color_2} 0% ${(angle / Math.PI) * 100}%,
|
|
273
|
-
${__classPrivateFieldGet(this, _AngularRestriction_settings, "f").visualization.points.color_1} ${(angle / Math.PI) * 100}% 100%
|
|
274
|
-
);
|
|
275
|
-
}
|
|
276
|
-
`;
|
|
277
|
-
document.head.appendChild(style);
|
|
278
|
-
parent.appendChild(child);
|
|
279
|
-
child.textContent = `${(0, numberCleaner_1.numberCleaner)((angle / Math.PI) * 180)}°`;
|
|
280
|
-
text.appendChild(parent);
|
|
281
|
-
label.position.set(position[0], position[1], position[2]);
|
|
282
|
-
label.visible = false;
|
|
283
|
-
this._object3D.add(label);
|
|
284
|
-
return label;
|
|
285
|
-
}
|
|
286
|
-
getAngularDifference(line, referenceLine) {
|
|
287
|
-
const lineDirection = gl_matrix_1.vec3.normalize(gl_matrix_1.vec3.create(), gl_matrix_1.vec3.sub(gl_matrix_1.vec3.create(), line.end, line.start));
|
|
288
|
-
const referenceLineDirection = gl_matrix_1.vec3.normalize(gl_matrix_1.vec3.create(), gl_matrix_1.vec3.sub(gl_matrix_1.vec3.create(), referenceLine.end, referenceLine.start));
|
|
289
|
-
// calculate the angle between the lineDirection and the referenceLineDirection
|
|
290
|
-
const angleReference = gl_matrix_1.vec3.angle(lineDirection, referenceLineDirection);
|
|
291
|
-
const crossProduct = gl_matrix_1.vec3.cross(gl_matrix_1.vec3.create(), lineDirection, referenceLineDirection);
|
|
292
|
-
// find the angle that is closest to the angle of the previous point
|
|
293
|
-
let closestAngle = __classPrivateFieldGet(this, _AngularRestriction_angles, "f")[0];
|
|
294
|
-
for (let i = 0; i < __classPrivateFieldGet(this, _AngularRestriction_angles, "f").length; i++) {
|
|
295
|
-
const angle = __classPrivateFieldGet(this, _AngularRestriction_angles, "f")[i];
|
|
296
|
-
if (Math.abs(angleReference - angle) < Math.abs(angleReference - closestAngle))
|
|
297
|
-
closestAngle = angle;
|
|
298
|
-
}
|
|
299
|
-
// move the point to the closest angle
|
|
300
|
-
const angularDifference = closestAngle - angleReference;
|
|
301
|
-
return {
|
|
302
|
-
angularDifference,
|
|
303
|
-
crossProduct,
|
|
304
|
-
closestAngle
|
|
305
|
-
};
|
|
306
|
-
}
|
|
307
|
-
getNextIndex(index) {
|
|
308
|
-
return index + 1 > __classPrivateFieldGet(this, _AngularRestriction_drawingToolsManager, "f").positionArray.length / 3 - 1 ? 0 : index + 1;
|
|
309
|
-
}
|
|
310
|
-
getPreviousIndex(index) {
|
|
311
|
-
return index - 1 < 0 ? __classPrivateFieldGet(this, _AngularRestriction_drawingToolsManager, "f").positionArray.length / 3 - 1 : index - 1;
|
|
312
|
-
}
|
|
313
|
-
}
|
|
314
|
-
exports.AngularRestriction = AngularRestriction;
|
|
315
|
-
_AngularRestriction_activationKey = new WeakMap(), _AngularRestriction_drawingToolsManager = new WeakMap(), _AngularRestriction_geometryMathManager = new WeakMap(), _AngularRestriction_planeRestriction = new WeakMap(), _AngularRestriction_settings = new WeakMap(), _AngularRestriction_active = new WeakMap(), _AngularRestriction_activePolarGrids = new WeakMap(), _AngularRestriction_angleStep = new WeakMap(), _AngularRestriction_angleStepEditable = new WeakMap(), _AngularRestriction_angles = new WeakMap(), _AngularRestriction_labelNext = new WeakMap(), _AngularRestriction_labelPrevious = new WeakMap(), _AngularRestriction_priority = new WeakMap();
|
|
316
|
-
// #endregion Classes (1)
|
|
317
|
-
//# sourceMappingURL=AngularRestriction.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"AngularRestriction.js","sourceRoot":"","sources":["../../../../../../../../src/business/implementation/managers/interaction/restrictions/plane/snap/AngularRestriction.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,mEAAgE;AAChE,4EAAuE;AAKvE,sEAAmE;AAGnE,+CAA+C;AAE/C,yCAAiC;AAiBjC,8BAA8B;AAE9B,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IAC9F,CAAC;CAGJ;AAvWD,gDAuWC;;AAED,yBAAyB"}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { AbstractRestriction } from '../../AbstractRestriction';
|
|
2
|
-
import { DrawingToolsManager } from '../../../../../DrawingToolsManager';
|
|
3
|
-
import { IRay } from '@shapediver/viewer.features.interaction';
|
|
4
|
-
import { ISnapRestriction, SnapRestrictionProperties } from '../../../../../../interfaces/ISnapRestriction';
|
|
5
|
-
import { PlaneRestriction } from '../PlaneRestriction';
|
|
6
|
-
import { RestrictionMetaData } from '../../../../../../interfaces/IRestriction';
|
|
7
|
-
import { vec3 } from 'gl-matrix';
|
|
8
|
-
export declare type AxisRestrictionProperties = {
|
|
9
|
-
activationKeyX?: string;
|
|
10
|
-
activationKeyY?: string;
|
|
11
|
-
activationKeyZ?: string;
|
|
12
|
-
activationKeyPlane?: string;
|
|
13
|
-
} & SnapRestrictionProperties;
|
|
14
|
-
export declare class AxisRestriction extends AbstractRestriction implements ISnapRestriction {
|
|
15
|
-
#private;
|
|
16
|
-
constructor(drawingToolsManager: DrawingToolsManager, planeRestriction: PlaneRestriction, properties?: AxisRestrictionProperties);
|
|
17
|
-
get active(): boolean;
|
|
18
|
-
set active(value: boolean);
|
|
19
|
-
get enabledEditable(): boolean;
|
|
20
|
-
get priority(): number;
|
|
21
|
-
set priority(value: number);
|
|
22
|
-
snap(ray: IRay, point: vec3, metaData?: RestrictionMetaData): vec3 | undefined;
|
|
23
|
-
updatePlaneDefinition(): void;
|
|
24
|
-
protected visibilityChanged(visible: boolean): void;
|
|
25
|
-
private createAxesVisualization;
|
|
26
|
-
}
|
|
27
|
-
//# sourceMappingURL=AxisRestriction.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"AxisRestriction.d.ts","sourceRoot":"","sources":["../../../../../../../../src/business/implementation/managers/interaction/restrictions/plane/snap/AxisRestriction.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAE,M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@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
|
-
var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
|
26
|
-
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
27
|
-
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
28
|
-
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
29
|
-
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
30
|
-
};
|
|
31
|
-
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
32
|
-
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
33
|
-
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
34
|
-
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
35
|
-
};
|
|
36
|
-
var _AxisRestriction_activationKeyPlane, _AxisRestriction_activationKeyX, _AxisRestriction_activationKeyY, _AxisRestriction_activationKeyZ, _AxisRestriction_drawingToolsManager, _AxisRestriction_planeRestriction, _AxisRestriction_active, _AxisRestriction_axesHelper, _AxisRestriction_geometryMathManager, _AxisRestriction_priority;
|
|
37
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
38
|
-
exports.AxisRestriction = void 0;
|
|
39
|
-
const THREE = __importStar(require("three"));
|
|
40
|
-
const AbstractRestriction_1 = require("../../AbstractRestriction");
|
|
41
|
-
const viewer_1 = require("@shapediver/viewer");
|
|
42
|
-
// #endregion Type aliases (1)
|
|
43
|
-
// #region Classes (1)
|
|
44
|
-
class AxisRestriction extends AbstractRestriction_1.AbstractRestriction {
|
|
45
|
-
// #endregion Properties (10)
|
|
46
|
-
// #region Constructors (1)
|
|
47
|
-
constructor(drawingToolsManager, planeRestriction, properties) {
|
|
48
|
-
super(drawingToolsManager, 'axis');
|
|
49
|
-
// #region Properties (10)
|
|
50
|
-
_AxisRestriction_activationKeyPlane.set(this, void 0);
|
|
51
|
-
_AxisRestriction_activationKeyX.set(this, void 0);
|
|
52
|
-
_AxisRestriction_activationKeyY.set(this, void 0);
|
|
53
|
-
_AxisRestriction_activationKeyZ.set(this, void 0);
|
|
54
|
-
_AxisRestriction_drawingToolsManager.set(this, void 0);
|
|
55
|
-
_AxisRestriction_planeRestriction.set(this, void 0);
|
|
56
|
-
_AxisRestriction_active.set(this, false);
|
|
57
|
-
_AxisRestriction_axesHelper.set(this, void 0);
|
|
58
|
-
_AxisRestriction_geometryMathManager.set(this, void 0);
|
|
59
|
-
_AxisRestriction_priority.set(this, 0);
|
|
60
|
-
__classPrivateFieldSet(this, _AxisRestriction_drawingToolsManager, drawingToolsManager, "f");
|
|
61
|
-
__classPrivateFieldSet(this, _AxisRestriction_planeRestriction, planeRestriction, "f");
|
|
62
|
-
__classPrivateFieldSet(this, _AxisRestriction_geometryMathManager, drawingToolsManager.geometryMathManager, "f");
|
|
63
|
-
__classPrivateFieldSet(this, _AxisRestriction_activationKeyX, (properties === null || properties === void 0 ? void 0 : properties.activationKeyX) || 'x', "f");
|
|
64
|
-
__classPrivateFieldSet(this, _AxisRestriction_activationKeyY, (properties === null || properties === void 0 ? void 0 : properties.activationKeyY) || 'y', "f");
|
|
65
|
-
__classPrivateFieldSet(this, _AxisRestriction_activationKeyZ, (properties === null || properties === void 0 ? void 0 : properties.activationKeyZ) || 'z', "f");
|
|
66
|
-
__classPrivateFieldSet(this, _AxisRestriction_activationKeyPlane, (properties === null || properties === void 0 ? void 0 : properties.activationKeyPlane) || 'p', "f");
|
|
67
|
-
__classPrivateFieldSet(this, _AxisRestriction_priority, (properties === null || properties === void 0 ? void 0 : properties.priority) || 1, "f");
|
|
68
|
-
// create the axes visualization
|
|
69
|
-
this.createAxesVisualization();
|
|
70
|
-
}
|
|
71
|
-
// #endregion Constructors (1)
|
|
72
|
-
// #region Public Getters And Setters (5)
|
|
73
|
-
get active() {
|
|
74
|
-
return __classPrivateFieldGet(this, _AxisRestriction_active, "f");
|
|
75
|
-
}
|
|
76
|
-
set active(value) {
|
|
77
|
-
__classPrivateFieldSet(this, _AxisRestriction_active, value, "f");
|
|
78
|
-
if (__classPrivateFieldGet(this, _AxisRestriction_axesHelper, "f"))
|
|
79
|
-
__classPrivateFieldGet(this, _AxisRestriction_axesHelper, "f").visible = value;
|
|
80
|
-
}
|
|
81
|
-
get enabledEditable() {
|
|
82
|
-
return this._enabledEditable;
|
|
83
|
-
}
|
|
84
|
-
get priority() {
|
|
85
|
-
return __classPrivateFieldGet(this, _AxisRestriction_priority, "f");
|
|
86
|
-
}
|
|
87
|
-
set priority(value) {
|
|
88
|
-
__classPrivateFieldSet(this, _AxisRestriction_priority, value, "f");
|
|
89
|
-
}
|
|
90
|
-
// #endregion Public Getters And Setters (5)
|
|
91
|
-
// #region Public Methods (2)
|
|
92
|
-
snap(ray, point, metaData) {
|
|
93
|
-
if (this.enabled === false)
|
|
94
|
-
return;
|
|
95
|
-
if (!metaData || !metaData.referencePoint)
|
|
96
|
-
return;
|
|
97
|
-
const xPressed = __classPrivateFieldGet(this, _AxisRestriction_drawingToolsManager, "f").keyPressed(__classPrivateFieldGet(this, _AxisRestriction_activationKeyX, "f"));
|
|
98
|
-
const yPressed = __classPrivateFieldGet(this, _AxisRestriction_drawingToolsManager, "f").keyPressed(__classPrivateFieldGet(this, _AxisRestriction_activationKeyY, "f"));
|
|
99
|
-
const zPressed = __classPrivateFieldGet(this, _AxisRestriction_drawingToolsManager, "f").keyPressed(__classPrivateFieldGet(this, _AxisRestriction_activationKeyZ, "f"));
|
|
100
|
-
const pPressed = __classPrivateFieldGet(this, _AxisRestriction_drawingToolsManager, "f").keyPressed(__classPrivateFieldGet(this, _AxisRestriction_activationKeyPlane, "f"));
|
|
101
|
-
// we move the axes helper to the reference point
|
|
102
|
-
if (__classPrivateFieldGet(this, _AxisRestriction_axesHelper, "f") && (xPressed || yPressed || zPressed)) {
|
|
103
|
-
__classPrivateFieldGet(this, _AxisRestriction_axesHelper, "f").position.copy(new THREE.Vector3(metaData.referencePoint[0], metaData.referencePoint[1], metaData.referencePoint[2]));
|
|
104
|
-
__classPrivateFieldGet(this, _AxisRestriction_axesHelper, "f").visible = false;
|
|
105
|
-
}
|
|
106
|
-
if (xPressed) {
|
|
107
|
-
return __classPrivateFieldGet(this, _AxisRestriction_geometryMathManager, "f").closestPoint({ origin: metaData.referencePoint, direction: __classPrivateFieldGet(this, _AxisRestriction_planeRestriction, "f").vectorU }, point);
|
|
108
|
-
}
|
|
109
|
-
else if (yPressed) {
|
|
110
|
-
return __classPrivateFieldGet(this, _AxisRestriction_geometryMathManager, "f").closestPoint({ origin: metaData.referencePoint, direction: __classPrivateFieldGet(this, _AxisRestriction_planeRestriction, "f").vectorV }, point);
|
|
111
|
-
}
|
|
112
|
-
else if (zPressed) {
|
|
113
|
-
return __classPrivateFieldGet(this, _AxisRestriction_geometryMathManager, "f").closestPointsRayRay({ origin: metaData.referencePoint, direction: __classPrivateFieldGet(this, _AxisRestriction_planeRestriction, "f").normal }, ray).closestPointOnRay1;
|
|
114
|
-
}
|
|
115
|
-
else if (pPressed) {
|
|
116
|
-
return __classPrivateFieldGet(this, _AxisRestriction_geometryMathManager, "f").closestPointOnPlane(__classPrivateFieldGet(this, _AxisRestriction_planeRestriction, "f").origin, __classPrivateFieldGet(this, _AxisRestriction_planeRestriction, "f").normal, point);
|
|
117
|
-
}
|
|
118
|
-
}
|
|
119
|
-
updatePlaneDefinition() {
|
|
120
|
-
this.createAxesVisualization();
|
|
121
|
-
}
|
|
122
|
-
// #endregion Public Methods (2)
|
|
123
|
-
// #region Protected Methods (1)
|
|
124
|
-
visibilityChanged(visible) {
|
|
125
|
-
if (visible === false) {
|
|
126
|
-
if (__classPrivateFieldGet(this, _AxisRestriction_axesHelper, "f")) {
|
|
127
|
-
__classPrivateFieldGet(this, _AxisRestriction_axesHelper, "f").visible = false;
|
|
128
|
-
}
|
|
129
|
-
}
|
|
130
|
-
}
|
|
131
|
-
// #endregion Protected Methods (1)
|
|
132
|
-
// #region Private Methods (1)
|
|
133
|
-
createAxesVisualization() {
|
|
134
|
-
if (__classPrivateFieldGet(this, _AxisRestriction_axesHelper, "f")) {
|
|
135
|
-
this._object3D.remove(__classPrivateFieldGet(this, _AxisRestriction_axesHelper, "f"));
|
|
136
|
-
__classPrivateFieldGet(this, _AxisRestriction_axesHelper, "f").dispose();
|
|
137
|
-
}
|
|
138
|
-
const bb = new viewer_1.Box();
|
|
139
|
-
for (let i = 0; i < viewer_1.sceneTree.root.children.length; i++) {
|
|
140
|
-
if (viewer_1.sceneTree.root.children[i].sessionNode === true) {
|
|
141
|
-
bb.union(viewer_1.sceneTree.root.children[i].boundingBox);
|
|
142
|
-
}
|
|
143
|
-
}
|
|
144
|
-
const radius = bb.boundingSphere.radius;
|
|
145
|
-
__classPrivateFieldSet(this, _AxisRestriction_axesHelper, new THREE.AxesHelper(radius), "f");
|
|
146
|
-
__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]));
|
|
147
|
-
__classPrivateFieldGet(this, _AxisRestriction_axesHelper, "f").visible = false;
|
|
148
|
-
__classPrivateFieldGet(this, _AxisRestriction_axesHelper, "f").renderOrder = 100;
|
|
149
|
-
__classPrivateFieldGet(this, _AxisRestriction_axesHelper, "f").material.depthTest = false;
|
|
150
|
-
__classPrivateFieldGet(this, _AxisRestriction_axesHelper, "f").material.transparent = true;
|
|
151
|
-
// three.js uses a right-handed coordinate system, so we need to rotate the axes helper
|
|
152
|
-
const rotationMatrix = new THREE.Matrix4().fromArray([
|
|
153
|
-
__classPrivateFieldGet(this, _AxisRestriction_planeRestriction, "f").vectorU[0], __classPrivateFieldGet(this, _AxisRestriction_planeRestriction, "f").vectorU[1], __classPrivateFieldGet(this, _AxisRestriction_planeRestriction, "f").vectorU[2], 0,
|
|
154
|
-
__classPrivateFieldGet(this, _AxisRestriction_planeRestriction, "f").vectorV[0], __classPrivateFieldGet(this, _AxisRestriction_planeRestriction, "f").vectorV[1], __classPrivateFieldGet(this, _AxisRestriction_planeRestriction, "f").vectorV[2], 0,
|
|
155
|
-
__classPrivateFieldGet(this, _AxisRestriction_planeRestriction, "f").normal[0], __classPrivateFieldGet(this, _AxisRestriction_planeRestriction, "f").normal[1], __classPrivateFieldGet(this, _AxisRestriction_planeRestriction, "f").normal[2], 0,
|
|
156
|
-
0, 0, 0, 1
|
|
157
|
-
]);
|
|
158
|
-
__classPrivateFieldGet(this, _AxisRestriction_axesHelper, "f").rotation.setFromRotationMatrix(rotationMatrix);
|
|
159
|
-
this._object3D.add(__classPrivateFieldGet(this, _AxisRestriction_axesHelper, "f"));
|
|
160
|
-
}
|
|
161
|
-
}
|
|
162
|
-
exports.AxisRestriction = AxisRestriction;
|
|
163
|
-
_AxisRestriction_activationKeyPlane = new WeakMap(), _AxisRestriction_activationKeyX = new WeakMap(), _AxisRestriction_activationKeyY = new WeakMap(), _AxisRestriction_activationKeyZ = new WeakMap(), _AxisRestriction_drawingToolsManager = new WeakMap(), _AxisRestriction_planeRestriction = new WeakMap(), _AxisRestriction_active = new WeakMap(), _AxisRestriction_axesHelper = new WeakMap(), _AxisRestriction_geometryMathManager = new WeakMap(), _AxisRestriction_priority = new WeakMap();
|
|
164
|
-
// #endregion Classes (1)
|
|
165
|
-
//# sourceMappingURL=AxisRestriction.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"AxisRestriction.js","sourceRoot":"","sources":["../../../../../../../../src/business/implementation/managers/interaction/restrictions/plane/snap/AxisRestriction.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,6CAA+B;AAC/B,mEAAgE;AAChE,+CAAoD;AAkBpD,8BAA8B;AAE9B,sBAAsB;AAEtB,MAAa,eAAgB,SAAQ,yCAAmB;IAepD,6BAA6B;IAE7B,2BAA2B;IAE3B,YAAY,mBAAwC,EAAE,gBAAkC,EAAE,UAAsC;QAC5H,KAAK,CAAC,mBAAmB,EAAE,MAAM,CAAC,CAAC;QAnBvC,0BAA0B;QAE1B,sDAAqC;QACrC,kDAAiC;QACjC,kDAAiC;QACjC,kDAAiC;QACjC,uDAAmD;QACnD,oDAA6C;QAE7C,kCAAmB,KAAK,EAAC;QACzB,8CAA+B;QAC/B,uDAA0C;QAC1C,oCAAoB,CAAC,EAAC;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