@shapediver/viewer.features.drawing-tools 3.1.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/LICENSE +73 -0
- package/README.md +161 -0
- package/dist/api/implementation/DrawingToolsApi.d.ts +31 -0
- package/dist/api/implementation/DrawingToolsApi.d.ts.map +1 -0
- package/dist/api/implementation/DrawingToolsApi.js +111 -0
- package/dist/api/implementation/DrawingToolsApi.js.map +1 -0
- package/dist/api/implementation/restrictions/AbstractRestrictionApi.d.ts +10 -0
- package/dist/api/implementation/restrictions/AbstractRestrictionApi.d.ts.map +1 -0
- package/dist/api/implementation/restrictions/AbstractRestrictionApi.js +38 -0
- package/dist/api/implementation/restrictions/AbstractRestrictionApi.js.map +1 -0
- package/dist/api/implementation/restrictions/AbstractSnapRestrictionApi.d.ts +11 -0
- package/dist/api/implementation/restrictions/AbstractSnapRestrictionApi.d.ts.map +1 -0
- package/dist/api/implementation/restrictions/AbstractSnapRestrictionApi.js +40 -0
- package/dist/api/implementation/restrictions/AbstractSnapRestrictionApi.js.map +1 -0
- package/dist/api/implementation/restrictions/axis/AxisRestrictionApi.d.ts +7 -0
- package/dist/api/implementation/restrictions/axis/AxisRestrictionApi.d.ts.map +1 -0
- package/dist/api/implementation/restrictions/axis/AxisRestrictionApi.js +24 -0
- package/dist/api/implementation/restrictions/axis/AxisRestrictionApi.js.map +1 -0
- package/dist/api/implementation/restrictions/geometry/GeometryRestrictionApi.d.ts +15 -0
- package/dist/api/implementation/restrictions/geometry/GeometryRestrictionApi.d.ts.map +1 -0
- package/dist/api/implementation/restrictions/geometry/GeometryRestrictionApi.js +54 -0
- package/dist/api/implementation/restrictions/geometry/GeometryRestrictionApi.js.map +1 -0
- package/dist/api/implementation/restrictions/plane/PlaneRestrictionApi.d.ts +18 -0
- package/dist/api/implementation/restrictions/plane/PlaneRestrictionApi.d.ts.map +1 -0
- package/dist/api/implementation/restrictions/plane/PlaneRestrictionApi.js +61 -0
- package/dist/api/implementation/restrictions/plane/PlaneRestrictionApi.js.map +1 -0
- package/dist/api/implementation/restrictions/plane/snap/AngularRestrictionApi.d.ts +10 -0
- package/dist/api/implementation/restrictions/plane/snap/AngularRestrictionApi.d.ts.map +1 -0
- package/dist/api/implementation/restrictions/plane/snap/AngularRestrictionApi.js +40 -0
- package/dist/api/implementation/restrictions/plane/snap/AngularRestrictionApi.js.map +1 -0
- package/dist/api/implementation/restrictions/plane/snap/GridRestrictionApi.d.ts +10 -0
- package/dist/api/implementation/restrictions/plane/snap/GridRestrictionApi.d.ts.map +1 -0
- package/dist/api/implementation/restrictions/plane/snap/GridRestrictionApi.js +40 -0
- package/dist/api/implementation/restrictions/plane/snap/GridRestrictionApi.js.map +1 -0
- package/dist/api/interfaces/IDrawingToolsApi.d.ts +89 -0
- package/dist/api/interfaces/IDrawingToolsApi.d.ts.map +1 -0
- package/dist/api/interfaces/IDrawingToolsApi.js +3 -0
- package/dist/api/interfaces/IDrawingToolsApi.js.map +1 -0
- package/dist/api/interfaces/IRestrictionApi.d.ts +11 -0
- package/dist/api/interfaces/IRestrictionApi.d.ts.map +1 -0
- package/dist/api/interfaces/IRestrictionApi.js +3 -0
- package/dist/api/interfaces/IRestrictionApi.js.map +1 -0
- package/dist/api/interfaces/ISnapRestrictionApi.d.ts +13 -0
- package/dist/api/interfaces/ISnapRestrictionApi.d.ts.map +1 -0
- package/dist/api/interfaces/ISnapRestrictionApi.js +3 -0
- package/dist/api/interfaces/ISnapRestrictionApi.js.map +1 -0
- package/dist/business/implementation/DrawingToolsManager.d.ts +95 -0
- package/dist/business/implementation/DrawingToolsManager.d.ts.map +1 -0
- package/dist/business/implementation/DrawingToolsManager.js +544 -0
- package/dist/business/implementation/DrawingToolsManager.js.map +1 -0
- package/dist/business/implementation/managers/HistoryManager.d.ts +19 -0
- package/dist/business/implementation/managers/HistoryManager.d.ts.map +1 -0
- package/dist/business/implementation/managers/HistoryManager.js +89 -0
- package/dist/business/implementation/managers/HistoryManager.js.map +1 -0
- package/dist/business/implementation/managers/TextVisualizationManager.d.ts +14 -0
- package/dist/business/implementation/managers/TextVisualizationManager.d.ts.map +1 -0
- package/dist/business/implementation/managers/TextVisualizationManager.js +228 -0
- package/dist/business/implementation/managers/TextVisualizationManager.js.map +1 -0
- package/dist/business/implementation/managers/geometry/GeometryManager.d.ts +23 -0
- package/dist/business/implementation/managers/geometry/GeometryManager.d.ts.map +1 -0
- package/dist/business/implementation/managers/geometry/GeometryManager.js +82 -0
- package/dist/business/implementation/managers/geometry/GeometryManager.js.map +1 -0
- package/dist/business/implementation/managers/geometry/GeometryMathManager.d.ts +73 -0
- package/dist/business/implementation/managers/geometry/GeometryMathManager.d.ts.map +1 -0
- package/dist/business/implementation/managers/geometry/GeometryMathManager.js +230 -0
- package/dist/business/implementation/managers/geometry/GeometryMathManager.js.map +1 -0
- package/dist/business/implementation/managers/geometry/GeometryState.d.ts +46 -0
- package/dist/business/implementation/managers/geometry/GeometryState.d.ts.map +1 -0
- package/dist/business/implementation/managers/geometry/GeometryState.js +323 -0
- package/dist/business/implementation/managers/geometry/GeometryState.js.map +1 -0
- package/dist/business/implementation/managers/geometry/helpers/GeometryManagerHelper.d.ts +16 -0
- package/dist/business/implementation/managers/geometry/helpers/GeometryManagerHelper.d.ts.map +1 -0
- package/dist/business/implementation/managers/geometry/helpers/GeometryManagerHelper.js +157 -0
- package/dist/business/implementation/managers/geometry/helpers/GeometryManagerHelper.js.map +1 -0
- package/dist/business/implementation/managers/interaction/EventManager.d.ts +26 -0
- package/dist/business/implementation/managers/interaction/EventManager.d.ts.map +1 -0
- package/dist/business/implementation/managers/interaction/EventManager.js +63 -0
- package/dist/business/implementation/managers/interaction/EventManager.js.map +1 -0
- package/dist/business/implementation/managers/interaction/InteractionManager.d.ts +39 -0
- package/dist/business/implementation/managers/interaction/InteractionManager.d.ts.map +1 -0
- package/dist/business/implementation/managers/interaction/InteractionManager.js +237 -0
- package/dist/business/implementation/managers/interaction/InteractionManager.js.map +1 -0
- package/dist/business/implementation/managers/interaction/RestrictionManager.d.ts +19 -0
- package/dist/business/implementation/managers/interaction/RestrictionManager.d.ts.map +1 -0
- package/dist/business/implementation/managers/interaction/RestrictionManager.js +117 -0
- package/dist/business/implementation/managers/interaction/RestrictionManager.js.map +1 -0
- package/dist/business/implementation/managers/interaction/handlers/DeletionInteractionHandler.d.ts +10 -0
- package/dist/business/implementation/managers/interaction/handlers/DeletionInteractionHandler.d.ts.map +1 -0
- package/dist/business/implementation/managers/interaction/handlers/DeletionInteractionHandler.js +52 -0
- package/dist/business/implementation/managers/interaction/handlers/DeletionInteractionHandler.js.map +1 -0
- package/dist/business/implementation/managers/interaction/handlers/InsertionInteractionHandler.d.ts +14 -0
- package/dist/business/implementation/managers/interaction/handlers/InsertionInteractionHandler.d.ts.map +1 -0
- package/dist/business/implementation/managers/interaction/handlers/InsertionInteractionHandler.js +135 -0
- package/dist/business/implementation/managers/interaction/handlers/InsertionInteractionHandler.js.map +1 -0
- package/dist/business/implementation/managers/interaction/handlers/MidPointInteractionHandler.d.ts +16 -0
- package/dist/business/implementation/managers/interaction/handlers/MidPointInteractionHandler.d.ts.map +1 -0
- package/dist/business/implementation/managers/interaction/handlers/MidPointInteractionHandler.js +113 -0
- package/dist/business/implementation/managers/interaction/handlers/MidPointInteractionHandler.js.map +1 -0
- package/dist/business/implementation/managers/interaction/helpers/InteractionManagerHelper.d.ts +58 -0
- package/dist/business/implementation/managers/interaction/helpers/InteractionManagerHelper.d.ts.map +1 -0
- package/dist/business/implementation/managers/interaction/helpers/InteractionManagerHelper.js +377 -0
- package/dist/business/implementation/managers/interaction/helpers/InteractionManagerHelper.js.map +1 -0
- package/dist/business/implementation/managers/interaction/restrictions/AbstractRestriction.d.ts +19 -0
- package/dist/business/implementation/managers/interaction/restrictions/AbstractRestriction.d.ts.map +1 -0
- package/dist/business/implementation/managers/interaction/restrictions/AbstractRestriction.js +105 -0
- package/dist/business/implementation/managers/interaction/restrictions/AbstractRestriction.js.map +1 -0
- package/dist/business/implementation/managers/interaction/restrictions/axis/AxisRestriction.d.ts +22 -0
- package/dist/business/implementation/managers/interaction/restrictions/axis/AxisRestriction.d.ts.map +1 -0
- package/dist/business/implementation/managers/interaction/restrictions/axis/AxisRestriction.js +96 -0
- package/dist/business/implementation/managers/interaction/restrictions/axis/AxisRestriction.js.map +1 -0
- package/dist/business/implementation/managers/interaction/restrictions/geometry/GeometryRestriction.d.ts +39 -0
- package/dist/business/implementation/managers/interaction/restrictions/geometry/GeometryRestriction.d.ts.map +1 -0
- package/dist/business/implementation/managers/interaction/restrictions/geometry/GeometryRestriction.js +215 -0
- package/dist/business/implementation/managers/interaction/restrictions/geometry/GeometryRestriction.js.map +1 -0
- package/dist/business/implementation/managers/interaction/restrictions/plane/PlaneRestriction.d.ts +58 -0
- package/dist/business/implementation/managers/interaction/restrictions/plane/PlaneRestriction.d.ts.map +1 -0
- package/dist/business/implementation/managers/interaction/restrictions/plane/PlaneRestriction.js +180 -0
- package/dist/business/implementation/managers/interaction/restrictions/plane/PlaneRestriction.js.map +1 -0
- package/dist/business/implementation/managers/interaction/restrictions/plane/snap/AngularRestriction.d.ts +38 -0
- package/dist/business/implementation/managers/interaction/restrictions/plane/snap/AngularRestriction.d.ts.map +1 -0
- package/dist/business/implementation/managers/interaction/restrictions/plane/snap/AngularRestriction.js +308 -0
- package/dist/business/implementation/managers/interaction/restrictions/plane/snap/AngularRestriction.js.map +1 -0
- package/dist/business/implementation/managers/interaction/restrictions/plane/snap/GridRestriction.d.ts +37 -0
- package/dist/business/implementation/managers/interaction/restrictions/plane/snap/GridRestriction.d.ts.map +1 -0
- package/dist/business/implementation/managers/interaction/restrictions/plane/snap/GridRestriction.js +228 -0
- package/dist/business/implementation/managers/interaction/restrictions/plane/snap/GridRestriction.js.map +1 -0
- package/dist/business/implementation/utils/numberCleaner.d.ts +2 -0
- package/dist/business/implementation/utils/numberCleaner.d.ts.map +1 -0
- package/dist/business/implementation/utils/numberCleaner.js +9 -0
- package/dist/business/implementation/utils/numberCleaner.js.map +1 -0
- package/dist/business/interfaces/IDrawingToolsManager.d.ts +270 -0
- package/dist/business/interfaces/IDrawingToolsManager.d.ts.map +1 -0
- package/dist/business/interfaces/IDrawingToolsManager.js +16 -0
- package/dist/business/interfaces/IDrawingToolsManager.js.map +1 -0
- package/dist/business/interfaces/IManager.d.ts +4 -0
- package/dist/business/interfaces/IManager.d.ts.map +1 -0
- package/dist/business/interfaces/IManager.js +3 -0
- package/dist/business/interfaces/IManager.js.map +1 -0
- package/dist/business/interfaces/IRestriction.d.ts +41 -0
- package/dist/business/interfaces/IRestriction.d.ts.map +1 -0
- package/dist/business/interfaces/IRestriction.js +13 -0
- package/dist/business/interfaces/IRestriction.js.map +1 -0
- package/dist/business/interfaces/IRestrictionBase.d.ts +19 -0
- package/dist/business/interfaces/IRestrictionBase.d.ts.map +1 -0
- package/dist/business/interfaces/IRestrictionBase.js +5 -0
- package/dist/business/interfaces/IRestrictionBase.js.map +1 -0
- package/dist/business/interfaces/ISnapRestriction.d.ts +50 -0
- package/dist/business/interfaces/ISnapRestriction.d.ts.map +1 -0
- package/dist/business/interfaces/ISnapRestriction.js +4 -0
- package/dist/business/interfaces/ISnapRestriction.js.map +1 -0
- package/dist/business/interfaces/events/EventResponseMapping.d.ts +19 -0
- package/dist/business/interfaces/events/EventResponseMapping.d.ts.map +1 -0
- package/dist/business/interfaces/events/EventResponseMapping.js +4 -0
- package/dist/business/interfaces/events/EventResponseMapping.js.map +1 -0
- package/dist/business/interfaces/events/IDrawingToolsEvent.d.ts +12 -0
- package/dist/business/interfaces/events/IDrawingToolsEvent.d.ts.map +1 -0
- package/dist/business/interfaces/events/IDrawingToolsEvent.js +3 -0
- package/dist/business/interfaces/events/IDrawingToolsEvent.js.map +1 -0
- package/dist/index.d.ts +32 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +45 -0
- package/dist/index.js.map +1 -0
- package/dist/three/CSS2DRenderer.d.ts +32 -0
- package/dist/three/CSS2DRenderer.d.ts.map +1 -0
- package/dist/three/CSS2DRenderer.js +137 -0
- package/dist/three/CSS2DRenderer.js.map +1 -0
- package/package.json +55 -0
- package/src/api/implementation/DrawingToolsApi.ts +135 -0
- package/src/api/implementation/restrictions/AbstractRestrictionApi.ts +34 -0
- package/src/api/implementation/restrictions/AbstractSnapRestrictionApi.ts +36 -0
- package/src/api/implementation/restrictions/axis/AxisRestrictionApi.ts +19 -0
- package/src/api/implementation/restrictions/geometry/GeometryRestrictionApi.ts +56 -0
- package/src/api/implementation/restrictions/plane/PlaneRestrictionApi.ts +63 -0
- package/src/api/implementation/restrictions/plane/snap/AngularRestrictionApi.ts +35 -0
- package/src/api/implementation/restrictions/plane/snap/GridRestrictionApi.ts +35 -0
- package/src/api/interfaces/IDrawingToolsApi.ts +99 -0
- package/src/api/interfaces/IRestrictionApi.ts +15 -0
- package/src/api/interfaces/ISnapRestrictionApi.ts +18 -0
- package/src/business/implementation/DrawingToolsManager.ts +619 -0
- package/src/business/implementation/managers/HistoryManager.ts +101 -0
- package/src/business/implementation/managers/TextVisualizationManager.ts +245 -0
- package/src/business/implementation/managers/geometry/GeometryManager.ts +95 -0
- package/src/business/implementation/managers/geometry/GeometryMathManager.ts +273 -0
- package/src/business/implementation/managers/geometry/GeometryState.ts +436 -0
- package/src/business/implementation/managers/geometry/helpers/GeometryManagerHelper.ts +170 -0
- package/src/business/implementation/managers/interaction/EventManager.ts +80 -0
- package/src/business/implementation/managers/interaction/InteractionManager.ts +268 -0
- package/src/business/implementation/managers/interaction/RestrictionManager.ts +135 -0
- package/src/business/implementation/managers/interaction/handlers/DeletionInteractionHandler.ts +48 -0
- package/src/business/implementation/managers/interaction/handlers/InsertionInteractionHandler.ts +149 -0
- package/src/business/implementation/managers/interaction/handlers/MidPointInteractionHandler.ts +127 -0
- package/src/business/implementation/managers/interaction/helpers/InteractionManagerHelper.ts +411 -0
- package/src/business/implementation/managers/interaction/restrictions/AbstractRestriction.ts +99 -0
- package/src/business/implementation/managers/interaction/restrictions/axis/AxisRestriction.ts +107 -0
- package/src/business/implementation/managers/interaction/restrictions/geometry/GeometryRestriction.ts +237 -0
- package/src/business/implementation/managers/interaction/restrictions/plane/PlaneRestriction.ts +257 -0
- package/src/business/implementation/managers/interaction/restrictions/plane/snap/AngularRestriction.ts +384 -0
- package/src/business/implementation/managers/interaction/restrictions/plane/snap/GridRestriction.ts +262 -0
- package/src/business/implementation/utils/numberCleaner.ts +5 -0
- package/src/business/interfaces/IDrawingToolsManager.ts +313 -0
- package/src/business/interfaces/IManager.ts +7 -0
- package/src/business/interfaces/IRestriction.ts +64 -0
- package/src/business/interfaces/IRestrictionBase.ts +33 -0
- package/src/business/interfaces/ISnapRestriction.ts +70 -0
- package/src/business/interfaces/events/EventResponseMapping.ts +19 -0
- package/src/business/interfaces/events/IDrawingToolsEvent.ts +16 -0
- package/src/index.ts +72 -0
- package/src/three/CSS2DRenderer.ts +212 -0
- package/tsconfig.json +17 -0
package/dist/business/implementation/managers/interaction/restrictions/axis/AxisRestriction.d.ts
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { AbstractRestriction } from '../AbstractRestriction';
|
|
2
|
+
import { DrawingToolsManager } from '../../../../DrawingToolsManager';
|
|
3
|
+
import { IRay } from '@shapediver/viewer.features.interaction';
|
|
4
|
+
import { IRestriction, RestrictionMetaData, RestrictionProperties } from '../../../../../interfaces/IRestriction';
|
|
5
|
+
import { ISnapRestriction } from '../../../../../interfaces/ISnapRestriction';
|
|
6
|
+
import { vec3 } from 'gl-matrix';
|
|
7
|
+
export declare type AxisRestrictionProperties = {
|
|
8
|
+
activationKeyX?: string;
|
|
9
|
+
activationKeyY?: string;
|
|
10
|
+
activationKeyZ?: string;
|
|
11
|
+
} & RestrictionProperties;
|
|
12
|
+
export declare class AxisRestriction extends AbstractRestriction implements IRestriction {
|
|
13
|
+
#private;
|
|
14
|
+
constructor(drawingToolsManager: DrawingToolsManager, id: string, properties: AxisRestrictionProperties);
|
|
15
|
+
get priority(): number;
|
|
16
|
+
get snapRestrictions(): {
|
|
17
|
+
[key: string]: ISnapRestriction;
|
|
18
|
+
};
|
|
19
|
+
rayTrace(ray: IRay, metaData?: RestrictionMetaData): vec3 | undefined;
|
|
20
|
+
protected visibilityChanged(): void;
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=AxisRestriction.d.ts.map
|
package/dist/business/implementation/managers/interaction/restrictions/axis/AxisRestriction.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AxisRestriction.d.ts","sourceRoot":"","sources":["../../../../../../../src/business/implementation/managers/interaction/restrictions/axis/AxisRestriction.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAC7D,OAAO,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AAEtE,OAAO,EAAE,IAAI,EAAE,MAAM,yCAAyC,CAAC;AAC/D,OAAO,EAAE,YAAY,EAAE,mBAAmB,EAAE,qBAAqB,EAAE,MAAM,wCAAwC,CAAC;AAClH,OAAO,EAAE,gBAAgB,EAAE,MAAM,4CAA4C,CAAC;AAC9E,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAIjC,oBAAY,yBAAyB,GAAG;IACpC,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,cAAc,CAAC,EAAE,MAAM,CAAC;CAC3B,GAAG,qBAAqB,CAAC;AAM1B,qBAAa,eAAgB,SAAQ,mBAAoB,YAAW,YAAY;;gBAehE,mBAAmB,EAAE,mBAAmB,EAAE,EAAE,EAAE,MAAM,EAAE,UAAU,EAAE,yBAAyB;IAcvG,IAAW,QAAQ,IAAI,MAAM,CAE5B;IAED,IAAW,gBAAgB,IAAI;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,gBAAgB,CAAC;KAAE,CAElE;IAMM,QAAQ,CAAC,GAAG,EAAE,IAAI,EAAE,QAAQ,CAAC,EAAE,mBAAmB,GAAG,IAAI,GAAG,SAAS;IAwC5E,SAAS,CAAC,iBAAiB,IAAI,IAAI;CAGtC"}
|
package/dist/business/implementation/managers/interaction/restrictions/axis/AxisRestriction.js
ADDED
|
@@ -0,0 +1,96 @@
|
|
|
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 _AxisRestriction_activationKeyX, _AxisRestriction_activationKeyY, _AxisRestriction_activationKeyZ, _AxisRestriction_drawingToolsManager, _AxisRestriction_geometryMathManager, _AxisRestriction_snapRestrictions;
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
exports.AxisRestriction = void 0;
|
|
16
|
+
const AbstractRestriction_1 = require("../AbstractRestriction");
|
|
17
|
+
const gl_matrix_1 = require("gl-matrix");
|
|
18
|
+
// #endregion Type aliases (1)
|
|
19
|
+
// #region Classes (1)
|
|
20
|
+
class AxisRestriction extends AbstractRestriction_1.AbstractRestriction {
|
|
21
|
+
// #endregion Properties (7)
|
|
22
|
+
// #region Constructors (1)
|
|
23
|
+
constructor(drawingToolsManager, id, properties) {
|
|
24
|
+
super(drawingToolsManager, id);
|
|
25
|
+
// #region Properties (7)
|
|
26
|
+
_AxisRestriction_activationKeyX.set(this, void 0);
|
|
27
|
+
_AxisRestriction_activationKeyY.set(this, void 0);
|
|
28
|
+
_AxisRestriction_activationKeyZ.set(this, void 0);
|
|
29
|
+
_AxisRestriction_drawingToolsManager.set(this, void 0);
|
|
30
|
+
_AxisRestriction_geometryMathManager.set(this, void 0);
|
|
31
|
+
_AxisRestriction_snapRestrictions.set(this, {});
|
|
32
|
+
__classPrivateFieldSet(this, _AxisRestriction_drawingToolsManager, drawingToolsManager, "f");
|
|
33
|
+
__classPrivateFieldSet(this, _AxisRestriction_geometryMathManager, drawingToolsManager.geometryMathManager, "f");
|
|
34
|
+
__classPrivateFieldSet(this, _AxisRestriction_activationKeyX, properties.activationKeyX || 'x', "f");
|
|
35
|
+
__classPrivateFieldSet(this, _AxisRestriction_activationKeyY, properties.activationKeyY || 'y', "f");
|
|
36
|
+
__classPrivateFieldSet(this, _AxisRestriction_activationKeyZ, properties.activationKeyZ || 'z', "f");
|
|
37
|
+
}
|
|
38
|
+
// #endregion Constructors (1)
|
|
39
|
+
// #region Public Getters And Setters (2)
|
|
40
|
+
get priority() {
|
|
41
|
+
return 1;
|
|
42
|
+
}
|
|
43
|
+
get snapRestrictions() {
|
|
44
|
+
return __classPrivateFieldGet(this, _AxisRestriction_snapRestrictions, "f");
|
|
45
|
+
}
|
|
46
|
+
// #endregion Public Getters And Setters (2)
|
|
47
|
+
// #region Public Methods (1)
|
|
48
|
+
rayTrace(ray, metaData) {
|
|
49
|
+
if (this.enabled === false)
|
|
50
|
+
return;
|
|
51
|
+
if (!metaData || !metaData.referencePoint)
|
|
52
|
+
return;
|
|
53
|
+
const xPressed = __classPrivateFieldGet(this, _AxisRestriction_drawingToolsManager, "f").keyPressed(__classPrivateFieldGet(this, _AxisRestriction_activationKeyX, "f"));
|
|
54
|
+
const yPressed = __classPrivateFieldGet(this, _AxisRestriction_drawingToolsManager, "f").keyPressed(__classPrivateFieldGet(this, _AxisRestriction_activationKeyY, "f"));
|
|
55
|
+
const zPressed = __classPrivateFieldGet(this, _AxisRestriction_drawingToolsManager, "f").keyPressed(__classPrivateFieldGet(this, _AxisRestriction_activationKeyZ, "f"));
|
|
56
|
+
const xyPressed = __classPrivateFieldGet(this, _AxisRestriction_drawingToolsManager, "f").keyPressed(`${__classPrivateFieldGet(this, _AxisRestriction_activationKeyX, "f")}+${__classPrivateFieldGet(this, _AxisRestriction_activationKeyY, "f")}`);
|
|
57
|
+
const xzPressed = __classPrivateFieldGet(this, _AxisRestriction_drawingToolsManager, "f").keyPressed(`${__classPrivateFieldGet(this, _AxisRestriction_activationKeyX, "f")}+${__classPrivateFieldGet(this, _AxisRestriction_activationKeyZ, "f")}`);
|
|
58
|
+
const yzPressed = __classPrivateFieldGet(this, _AxisRestriction_drawingToolsManager, "f").keyPressed(`${__classPrivateFieldGet(this, _AxisRestriction_activationKeyY, "f")}+${__classPrivateFieldGet(this, _AxisRestriction_activationKeyZ, "f")}`);
|
|
59
|
+
const xyzPressed = __classPrivateFieldGet(this, _AxisRestriction_drawingToolsManager, "f").keyPressed(`${__classPrivateFieldGet(this, _AxisRestriction_activationKeyX, "f")}+${__classPrivateFieldGet(this, _AxisRestriction_activationKeyY, "f")}+${__classPrivateFieldGet(this, _AxisRestriction_activationKeyZ, "f")}`);
|
|
60
|
+
if (xPressed) {
|
|
61
|
+
const { closestPointOnRay2 } = __classPrivateFieldGet(this, _AxisRestriction_geometryMathManager, "f").closestPointsRayRay(ray, { origin: metaData.referencePoint, direction: gl_matrix_1.vec3.fromValues(1, 0, 0) });
|
|
62
|
+
return closestPointOnRay2;
|
|
63
|
+
}
|
|
64
|
+
else if (yPressed) {
|
|
65
|
+
const { closestPointOnRay2 } = __classPrivateFieldGet(this, _AxisRestriction_geometryMathManager, "f").closestPointsRayRay(ray, { origin: metaData.referencePoint, direction: gl_matrix_1.vec3.fromValues(0, 1, 0) });
|
|
66
|
+
return closestPointOnRay2;
|
|
67
|
+
}
|
|
68
|
+
else if (zPressed) {
|
|
69
|
+
const { closestPointOnRay2 } = __classPrivateFieldGet(this, _AxisRestriction_geometryMathManager, "f").closestPointsRayRay(ray, { origin: metaData.referencePoint, direction: gl_matrix_1.vec3.fromValues(0, 0, 1) });
|
|
70
|
+
return closestPointOnRay2;
|
|
71
|
+
}
|
|
72
|
+
else if (xyPressed) {
|
|
73
|
+
const { closestPointOnRay2 } = __classPrivateFieldGet(this, _AxisRestriction_geometryMathManager, "f").closestPointsRayRay(ray, { origin: metaData.referencePoint, direction: gl_matrix_1.vec3.fromValues(1, 1, 0) });
|
|
74
|
+
return closestPointOnRay2;
|
|
75
|
+
}
|
|
76
|
+
else if (xzPressed) {
|
|
77
|
+
const { closestPointOnRay2 } = __classPrivateFieldGet(this, _AxisRestriction_geometryMathManager, "f").closestPointsRayRay(ray, { origin: metaData.referencePoint, direction: gl_matrix_1.vec3.fromValues(1, 0, 1) });
|
|
78
|
+
return closestPointOnRay2;
|
|
79
|
+
}
|
|
80
|
+
else if (yzPressed) {
|
|
81
|
+
const { closestPointOnRay2 } = __classPrivateFieldGet(this, _AxisRestriction_geometryMathManager, "f").closestPointsRayRay(ray, { origin: metaData.referencePoint, direction: gl_matrix_1.vec3.fromValues(0, 1, 1) });
|
|
82
|
+
return closestPointOnRay2;
|
|
83
|
+
}
|
|
84
|
+
else if (xyzPressed) {
|
|
85
|
+
const { closestPointOnRay2 } = __classPrivateFieldGet(this, _AxisRestriction_geometryMathManager, "f").closestPointsRayRay(ray, { origin: metaData.referencePoint, direction: gl_matrix_1.vec3.fromValues(1, 1, 1) });
|
|
86
|
+
return closestPointOnRay2;
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
// #endregion Public Methods (1)
|
|
90
|
+
// #region Protected Methods (1)
|
|
91
|
+
visibilityChanged() { }
|
|
92
|
+
}
|
|
93
|
+
exports.AxisRestriction = AxisRestriction;
|
|
94
|
+
_AxisRestriction_activationKeyX = new WeakMap(), _AxisRestriction_activationKeyY = new WeakMap(), _AxisRestriction_activationKeyZ = new WeakMap(), _AxisRestriction_drawingToolsManager = new WeakMap(), _AxisRestriction_geometryMathManager = new WeakMap(), _AxisRestriction_snapRestrictions = new WeakMap();
|
|
95
|
+
// #endregion Classes (1)
|
|
96
|
+
//# sourceMappingURL=AxisRestriction.js.map
|
package/dist/business/implementation/managers/interaction/restrictions/axis/AxisRestriction.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AxisRestriction.js","sourceRoot":"","sources":["../../../../../../../src/business/implementation/managers/interaction/restrictions/axis/AxisRestriction.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,gEAA6D;AAM7D,yCAAiC;AAUjC,8BAA8B;AAE9B,sBAAsB;AAEtB,MAAa,eAAgB,SAAQ,yCAAmB;IAWpD,4BAA4B;IAE5B,2BAA2B;IAE3B,YAAY,mBAAwC,EAAE,EAAU,EAAE,UAAqC;QACnG,KAAK,CAAC,mBAAmB,EAAE,EAAE,CAAC,CAAC;QAfnC,yBAAyB;QAEzB,kDAAiC;QACjC,kDAAiC;QACjC,kDAAiC;QACjC,uDAAmD;QAEnD,uDAA0C;QAC1C,4CAA0D,EAAE,EAAC;QAQzD,uBAAA,IAAI,wCAAwB,mBAAmB,MAAA,CAAC;QAChD,uBAAA,IAAI,wCAAwB,mBAAmB,CAAC,mBAAmB,MAAA,CAAC;QAEpE,uBAAA,IAAI,mCAAmB,UAAU,CAAC,cAAc,IAAI,GAAG,MAAA,CAAC;QACxD,uBAAA,IAAI,mCAAmB,UAAU,CAAC,cAAc,IAAI,GAAG,MAAA,CAAC;QACxD,uBAAA,IAAI,mCAAmB,UAAU,CAAC,cAAc,IAAI,GAAG,MAAA,CAAC;IAC5D,CAAC;IAED,8BAA8B;IAE9B,yCAAyC;IAEzC,IAAW,QAAQ;QACf,O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C,cAAc,EAAE,SAAS,EAAE,gBAAI,CAAC,UAAU,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC;YAC5J,OAAO,kBAAkB,CAAC;SAC7B;aAAM,IAAI,SAAS,EAAE;YAClB,MAAM,EAAE,kBAAkB,EAAE,GAAG,uBAAA,IAAI,4CAAqB,CAAC,mBAAmB,CAAC,GAAG,EAAE,EAAE,MAAM,EAAE,QAAQ,CAAC,cAAc,EAAE,SAAS,EAAE,gBAAI,CAAC,UAAU,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC;YAC5J,OAAO,kBAAkB,CAAC;SAC7B;aAAM,IAAI,UAAU,EAAE;YACnB,MAAM,EAAE,kBAAkB,EAAE,GAAG,uBAAA,IAAI,4CAAqB,CAAC,mBAAmB,CAAC,GAAG,EAAE,EAAE,MAAM,EAAE,QAAQ,CAAC,cAAc,EAAE,SAAS,EAAE,gBAAI,CAAC,UAAU,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC;YAC5J,OAAO,kBAAkB,CAAC;SAC7B;IACL,CAAC;IAED,gCAAgC;IAEhC,gCAAgC;IAEtB,iBAAiB,KAAW,CAAC;CAG1C;AApFD,0CAoFC;;AAED,yBAAyB"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { AbstractRestriction } from '../AbstractRestriction';
|
|
2
|
+
import { DrawingToolsManager } from '../../../../DrawingToolsManager';
|
|
3
|
+
import { IRay } from '@shapediver/viewer.features.interaction';
|
|
4
|
+
import { IRestriction, RestrictionMetaData, RestrictionProperties } from '../../../../../interfaces/IRestriction';
|
|
5
|
+
import { ISnapRestriction } from '../../../../../interfaces/ISnapRestriction';
|
|
6
|
+
import { ITreeNode } from '@shapediver/viewer.shared.node-tree';
|
|
7
|
+
import { vec3 } from 'gl-matrix';
|
|
8
|
+
export declare type GeometryRestrictionProperties = {
|
|
9
|
+
/**
|
|
10
|
+
* The nodes to restrict the interaction to.
|
|
11
|
+
*/
|
|
12
|
+
nodes: ITreeNode[];
|
|
13
|
+
/**
|
|
14
|
+
* If the geometry should be displayed as wireframe.
|
|
15
|
+
*/
|
|
16
|
+
wireframe?: boolean;
|
|
17
|
+
/**
|
|
18
|
+
* The color of the wireframe.
|
|
19
|
+
*/
|
|
20
|
+
wireframeColor?: string;
|
|
21
|
+
} & RestrictionProperties;
|
|
22
|
+
export declare class GeometryRestriction extends AbstractRestriction implements IRestriction {
|
|
23
|
+
#private;
|
|
24
|
+
constructor(drawingToolsManager: DrawingToolsManager, id: string, properties: GeometryRestrictionProperties);
|
|
25
|
+
get priority(): number;
|
|
26
|
+
get snapRestrictions(): {
|
|
27
|
+
[key: string]: ISnapRestriction;
|
|
28
|
+
};
|
|
29
|
+
get snapToEdges(): boolean;
|
|
30
|
+
set snapToEdges(value: boolean);
|
|
31
|
+
get snapToFaces(): boolean;
|
|
32
|
+
set snapToFaces(value: boolean);
|
|
33
|
+
get snapToVertices(): boolean;
|
|
34
|
+
set snapToVertices(value: boolean);
|
|
35
|
+
rayTrace(ray: IRay, metaData?: RestrictionMetaData): vec3 | undefined;
|
|
36
|
+
updateNodes(nodes: ITreeNode[]): void;
|
|
37
|
+
protected visibilityChanged(): void;
|
|
38
|
+
}
|
|
39
|
+
//# sourceMappingURL=GeometryRestriction.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GeometryRestriction.d.ts","sourceRoot":"","sources":["../../../../../../../src/business/implementation/managers/interaction/restrictions/geometry/GeometryRestriction.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAC7D,OAAO,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AAEtE,OAAO,EAAE,IAAI,EAAgB,MAAM,yCAAyC,CAAC;AAC7E,OAAO,EAAE,YAAY,EAAE,mBAAmB,EAAE,qBAAqB,EAAE,MAAM,wCAAwC,CAAC;AAClH,OAAO,EAAE,gBAAgB,EAAE,MAAM,4CAA4C,CAAC;AAC9E,OAAO,EAAE,SAAS,EAAE,MAAM,qCAAqC,CAAC;AAEhE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAIjC,oBAAY,6BAA6B,GAAG;IACxC;;OAEG;IACH,KAAK,EAAE,SAAS,EAAE,CAAC;IACnB;;OAEG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;OAEG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;CAC3B,GAAG,qBAAqB,CAAC;AAM1B,qBAAa,mBAAoB,SAAQ,mBAAoB,YAAW,YAAY;;gBAqBpE,mBAAmB,EAAE,mBAAmB,EAAE,EAAE,EAAE,MAAM,EAAE,UAAU,EAAE,6BAA6B;IAe3G,IAAW,QAAQ,IAAI,MAAM,CAE5B;IAED,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,IAAI,GAAG,SAAS;IA8FrE,WAAW,CAAC,KAAK,EAAE,SAAS,EAAE;IAiCrC,SAAS,CAAC,iBAAiB,IAAI,IAAI;CAGtC"}
|
|
@@ -0,0 +1,215 @@
|
|
|
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 _GeometryRestriction_raycaster, _GeometryRestriction_viewport, _GeometryRestriction_geometryMathManager, _GeometryRestriction_nodes, _GeometryRestriction_settings, _GeometryRestriction_snapRestrictions, _GeometryRestriction_snapToEdges, _GeometryRestriction_snapToFaces, _GeometryRestriction_snapToVertices, _GeometryRestriction_visualizationObject, _GeometryRestriction_wireframe, _GeometryRestriction_wireframeColor;
|
|
37
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
38
|
+
exports.GeometryRestriction = void 0;
|
|
39
|
+
const THREE = __importStar(require("three"));
|
|
40
|
+
const AbstractRestriction_1 = require("../AbstractRestriction");
|
|
41
|
+
const gl_matrix_1 = require("gl-matrix");
|
|
42
|
+
// #endregion Type aliases (1)
|
|
43
|
+
// #region Classes (1)
|
|
44
|
+
class GeometryRestriction extends AbstractRestriction_1.AbstractRestriction {
|
|
45
|
+
// #endregion Properties (10)
|
|
46
|
+
// #region Constructors (1)
|
|
47
|
+
constructor(drawingToolsManager, id, properties) {
|
|
48
|
+
var _a, _b;
|
|
49
|
+
super(drawingToolsManager, id);
|
|
50
|
+
// #region Properties (10)
|
|
51
|
+
_GeometryRestriction_raycaster.set(this, new THREE.Raycaster());
|
|
52
|
+
_GeometryRestriction_viewport.set(this, void 0);
|
|
53
|
+
_GeometryRestriction_geometryMathManager.set(this, void 0);
|
|
54
|
+
_GeometryRestriction_nodes.set(this, []);
|
|
55
|
+
_GeometryRestriction_settings.set(this, void 0);
|
|
56
|
+
_GeometryRestriction_snapRestrictions.set(this, {});
|
|
57
|
+
_GeometryRestriction_snapToEdges.set(this, true);
|
|
58
|
+
_GeometryRestriction_snapToFaces.set(this, true);
|
|
59
|
+
_GeometryRestriction_snapToVertices.set(this, true);
|
|
60
|
+
_GeometryRestriction_visualizationObject.set(this, new THREE.Object3D());
|
|
61
|
+
_GeometryRestriction_wireframe.set(this, void 0);
|
|
62
|
+
_GeometryRestriction_wireframeColor.set(this, void 0);
|
|
63
|
+
__classPrivateFieldSet(this, _GeometryRestriction_viewport, drawingToolsManager.viewport, "f");
|
|
64
|
+
__classPrivateFieldSet(this, _GeometryRestriction_settings, drawingToolsManager.settings, "f");
|
|
65
|
+
__classPrivateFieldSet(this, _GeometryRestriction_geometryMathManager, drawingToolsManager.geometryMathManager, "f");
|
|
66
|
+
__classPrivateFieldSet(this, _GeometryRestriction_wireframe, (_a = properties.wireframe) !== null && _a !== void 0 ? _a : true, "f");
|
|
67
|
+
__classPrivateFieldSet(this, _GeometryRestriction_wireframeColor, (_b = properties.wireframeColor) !== null && _b !== void 0 ? _b : __classPrivateFieldGet(this, _GeometryRestriction_settings, "f").visualization.points.color_1, "f");
|
|
68
|
+
this.updateNodes(properties.nodes);
|
|
69
|
+
}
|
|
70
|
+
// #endregion Constructors (1)
|
|
71
|
+
// #region Public Getters And Setters (8)
|
|
72
|
+
get priority() {
|
|
73
|
+
return 0;
|
|
74
|
+
}
|
|
75
|
+
get snapRestrictions() {
|
|
76
|
+
return __classPrivateFieldGet(this, _GeometryRestriction_snapRestrictions, "f");
|
|
77
|
+
}
|
|
78
|
+
get snapToEdges() {
|
|
79
|
+
return __classPrivateFieldGet(this, _GeometryRestriction_snapToEdges, "f");
|
|
80
|
+
}
|
|
81
|
+
set snapToEdges(value) {
|
|
82
|
+
__classPrivateFieldSet(this, _GeometryRestriction_snapToEdges, value, "f");
|
|
83
|
+
}
|
|
84
|
+
get snapToFaces() {
|
|
85
|
+
return __classPrivateFieldGet(this, _GeometryRestriction_snapToFaces, "f");
|
|
86
|
+
}
|
|
87
|
+
set snapToFaces(value) {
|
|
88
|
+
__classPrivateFieldSet(this, _GeometryRestriction_snapToFaces, value, "f");
|
|
89
|
+
}
|
|
90
|
+
get snapToVertices() {
|
|
91
|
+
return __classPrivateFieldGet(this, _GeometryRestriction_snapToVertices, "f");
|
|
92
|
+
}
|
|
93
|
+
set snapToVertices(value) {
|
|
94
|
+
__classPrivateFieldSet(this, _GeometryRestriction_snapToVertices, value, "f");
|
|
95
|
+
}
|
|
96
|
+
// #endregion Public Getters And Setters (8)
|
|
97
|
+
// #region Public Methods (2)
|
|
98
|
+
rayTrace(ray, metaData) {
|
|
99
|
+
if (this.enabled === false)
|
|
100
|
+
return;
|
|
101
|
+
if (__classPrivateFieldGet(this, _GeometryRestriction_snapToVertices, "f") === false && __classPrivateFieldGet(this, _GeometryRestriction_snapToEdges, "f") === false && __classPrivateFieldGet(this, _GeometryRestriction_snapToFaces, "f") === false)
|
|
102
|
+
return;
|
|
103
|
+
__classPrivateFieldGet(this, _GeometryRestriction_raycaster, "f").ray.direction.set(ray.direction[0], ray.direction[1], ray.direction[2]);
|
|
104
|
+
__classPrivateFieldGet(this, _GeometryRestriction_raycaster, "f").ray.origin.set(ray.origin[0], ray.origin[1], ray.origin[2]);
|
|
105
|
+
// intersect all nodes
|
|
106
|
+
let intersections = [];
|
|
107
|
+
__classPrivateFieldGet(this, _GeometryRestriction_nodes, "f").forEach(node => {
|
|
108
|
+
const threeJsObject = node.convertedObject[__classPrivateFieldGet(this, _GeometryRestriction_viewport, "f").id];
|
|
109
|
+
if (threeJsObject) {
|
|
110
|
+
const currentIntersections = __classPrivateFieldGet(this, _GeometryRestriction_raycaster, "f").intersectObject(threeJsObject);
|
|
111
|
+
intersections = intersections.concat(currentIntersections);
|
|
112
|
+
}
|
|
113
|
+
});
|
|
114
|
+
// sort
|
|
115
|
+
intersections.sort((a, b) => a.distance - b.distance);
|
|
116
|
+
// return first intersection
|
|
117
|
+
if (intersections.length > 0) {
|
|
118
|
+
const object = intersections[0].object;
|
|
119
|
+
const geometry = object.geometry;
|
|
120
|
+
const positionAttribute = geometry.getAttribute('position');
|
|
121
|
+
const intersectionPoint = intersections[0].point;
|
|
122
|
+
const intersectionPointVec3 = gl_matrix_1.vec3.fromValues(intersectionPoint.x, intersectionPoint.y, intersectionPoint.z);
|
|
123
|
+
if (!intersections[0].face)
|
|
124
|
+
return gl_matrix_1.vec3.fromValues(intersectionPoint.x, intersectionPoint.y, intersectionPoint.z);
|
|
125
|
+
if (__classPrivateFieldGet(this, _GeometryRestriction_snapToVertices, "f") === true || __classPrivateFieldGet(this, _GeometryRestriction_snapToEdges, "f") === true) {
|
|
126
|
+
const vertexA = new THREE.Vector3();
|
|
127
|
+
vertexA.fromBufferAttribute(positionAttribute, intersections[0].face.a);
|
|
128
|
+
object.localToWorld(vertexA);
|
|
129
|
+
const vertexAVec3 = gl_matrix_1.vec3.fromValues(vertexA.x, vertexA.y, vertexA.z);
|
|
130
|
+
const vertexB = new THREE.Vector3();
|
|
131
|
+
vertexB.fromBufferAttribute(positionAttribute, intersections[0].face.b);
|
|
132
|
+
object.localToWorld(vertexB);
|
|
133
|
+
const vertexBVec3 = gl_matrix_1.vec3.fromValues(vertexB.x, vertexB.y, vertexB.z);
|
|
134
|
+
const vertexC = new THREE.Vector3();
|
|
135
|
+
vertexC.fromBufferAttribute(positionAttribute, intersections[0].face.c);
|
|
136
|
+
object.localToWorld(vertexC);
|
|
137
|
+
const vertexCVec3 = gl_matrix_1.vec3.fromValues(vertexC.x, vertexC.y, vertexC.z);
|
|
138
|
+
if (__classPrivateFieldGet(this, _GeometryRestriction_snapToVertices, "f") === true) {
|
|
139
|
+
const distanceA = __classPrivateFieldGet(this, _GeometryRestriction_geometryMathManager, "f").screenSpaceDistanceCheck(intersectionPointVec3, vertexAVec3, __classPrivateFieldGet(this, _GeometryRestriction_settings, "f").visualization.points.size_0 * __classPrivateFieldGet(this, _GeometryRestriction_settings, "f").visualization.distanceMultiplicationFactor);
|
|
140
|
+
const distanceB = __classPrivateFieldGet(this, _GeometryRestriction_geometryMathManager, "f").screenSpaceDistanceCheck(intersectionPointVec3, vertexBVec3, __classPrivateFieldGet(this, _GeometryRestriction_settings, "f").visualization.points.size_0 * __classPrivateFieldGet(this, _GeometryRestriction_settings, "f").visualization.distanceMultiplicationFactor);
|
|
141
|
+
const distanceC = __classPrivateFieldGet(this, _GeometryRestriction_geometryMathManager, "f").screenSpaceDistanceCheck(intersectionPointVec3, vertexCVec3, __classPrivateFieldGet(this, _GeometryRestriction_settings, "f").visualization.points.size_0 * __classPrivateFieldGet(this, _GeometryRestriction_settings, "f").visualization.distanceMultiplicationFactor);
|
|
142
|
+
// part 1 - check if the intersection point is close to a vertex
|
|
143
|
+
if (distanceA.check && distanceA.distanceSquared < distanceB.distanceSquared && distanceA.distanceSquared < distanceC.distanceSquared) {
|
|
144
|
+
return gl_matrix_1.vec3.fromValues(vertexA.x, vertexA.y, vertexA.z);
|
|
145
|
+
}
|
|
146
|
+
else if (distanceB.check && distanceB.distanceSquared < distanceA.distanceSquared && distanceB.distanceSquared < distanceC.distanceSquared) {
|
|
147
|
+
return gl_matrix_1.vec3.fromValues(vertexB.x, vertexB.y, vertexB.z);
|
|
148
|
+
}
|
|
149
|
+
else if (distanceC.check && distanceC.distanceSquared < distanceA.distanceSquared && distanceC.distanceSquared < distanceB.distanceSquared) {
|
|
150
|
+
return gl_matrix_1.vec3.fromValues(vertexC.x, vertexC.y, vertexC.z);
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
if (__classPrivateFieldGet(this, _GeometryRestriction_snapToEdges, "f") === true) {
|
|
154
|
+
// part 2 - check if the intersection point is close to an edge
|
|
155
|
+
// create the closest points on the edges
|
|
156
|
+
const closestPointOnEdgeAB = __classPrivateFieldGet(this, _GeometryRestriction_geometryMathManager, "f").closestPointOnLine(vertexAVec3, vertexBVec3, intersectionPointVec3);
|
|
157
|
+
const closestPointOnEdgeBC = __classPrivateFieldGet(this, _GeometryRestriction_geometryMathManager, "f").closestPointOnLine(vertexBVec3, vertexCVec3, intersectionPointVec3);
|
|
158
|
+
const closestPointOnEdgeCA = __classPrivateFieldGet(this, _GeometryRestriction_geometryMathManager, "f").closestPointOnLine(vertexCVec3, vertexAVec3, intersectionPointVec3);
|
|
159
|
+
// create the distances
|
|
160
|
+
const distanceAB = __classPrivateFieldGet(this, _GeometryRestriction_geometryMathManager, "f").screenSpaceDistanceCheck(intersectionPointVec3, closestPointOnEdgeAB, __classPrivateFieldGet(this, _GeometryRestriction_settings, "f").visualization.points.size_0 * __classPrivateFieldGet(this, _GeometryRestriction_settings, "f").visualization.distanceMultiplicationFactor);
|
|
161
|
+
const distanceBC = __classPrivateFieldGet(this, _GeometryRestriction_geometryMathManager, "f").screenSpaceDistanceCheck(intersectionPointVec3, closestPointOnEdgeBC, __classPrivateFieldGet(this, _GeometryRestriction_settings, "f").visualization.points.size_0 * __classPrivateFieldGet(this, _GeometryRestriction_settings, "f").visualization.distanceMultiplicationFactor);
|
|
162
|
+
const distanceCA = __classPrivateFieldGet(this, _GeometryRestriction_geometryMathManager, "f").screenSpaceDistanceCheck(intersectionPointVec3, closestPointOnEdgeCA, __classPrivateFieldGet(this, _GeometryRestriction_settings, "f").visualization.points.size_0 * __classPrivateFieldGet(this, _GeometryRestriction_settings, "f").visualization.distanceMultiplicationFactor);
|
|
163
|
+
// check if the intersection point is close to an edge
|
|
164
|
+
if (distanceAB.check && distanceAB.distanceSquared < distanceBC.distanceSquared && distanceAB.distanceSquared < distanceCA.distanceSquared) {
|
|
165
|
+
return closestPointOnEdgeAB;
|
|
166
|
+
}
|
|
167
|
+
else if (distanceBC.check && distanceBC.distanceSquared < distanceAB.distanceSquared && distanceBC.distanceSquared < distanceCA.distanceSquared) {
|
|
168
|
+
return closestPointOnEdgeBC;
|
|
169
|
+
}
|
|
170
|
+
else if (distanceCA.check && distanceCA.distanceSquared < distanceAB.distanceSquared && distanceCA.distanceSquared < distanceBC.distanceSquared) {
|
|
171
|
+
return closestPointOnEdgeCA;
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
if (__classPrivateFieldGet(this, _GeometryRestriction_snapToFaces, "f") === true) {
|
|
176
|
+
// part 3 - face intersection
|
|
177
|
+
return gl_matrix_1.vec3.fromValues(intersectionPoint.x, intersectionPoint.y, intersectionPoint.z);
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
return;
|
|
181
|
+
}
|
|
182
|
+
updateNodes(nodes) {
|
|
183
|
+
__classPrivateFieldSet(this, _GeometryRestriction_nodes, nodes, "f");
|
|
184
|
+
if (__classPrivateFieldGet(this, _GeometryRestriction_wireframe, "f")) {
|
|
185
|
+
__classPrivateFieldGet(this, _GeometryRestriction_visualizationObject, "f").traverse((object) => {
|
|
186
|
+
if (object instanceof THREE.LineSegments) {
|
|
187
|
+
object.geometry.dispose();
|
|
188
|
+
object.material.dispose();
|
|
189
|
+
}
|
|
190
|
+
});
|
|
191
|
+
this._object3D.remove(__classPrivateFieldGet(this, _GeometryRestriction_visualizationObject, "f"));
|
|
192
|
+
__classPrivateFieldSet(this, _GeometryRestriction_visualizationObject, new THREE.Object3D(), "f");
|
|
193
|
+
__classPrivateFieldGet(this, _GeometryRestriction_nodes, "f").forEach(node => {
|
|
194
|
+
const threeJsObject = node.convertedObject[__classPrivateFieldGet(this, _GeometryRestriction_viewport, "f").id];
|
|
195
|
+
if (threeJsObject) {
|
|
196
|
+
threeJsObject.traverse((object) => {
|
|
197
|
+
if (object instanceof THREE.Mesh) {
|
|
198
|
+
const wireframe = new THREE.WireframeGeometry(object.geometry);
|
|
199
|
+
const line = new THREE.LineSegments(wireframe, new THREE.LineBasicMaterial({ color: new THREE.Color(__classPrivateFieldGet(this, _GeometryRestriction_wireframeColor, "f")) }));
|
|
200
|
+
__classPrivateFieldGet(this, _GeometryRestriction_visualizationObject, "f").add(line);
|
|
201
|
+
}
|
|
202
|
+
});
|
|
203
|
+
}
|
|
204
|
+
});
|
|
205
|
+
this._object3D.add(__classPrivateFieldGet(this, _GeometryRestriction_visualizationObject, "f"));
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
// #endregion Public Methods (2)
|
|
209
|
+
// #region Protected Methods (1)
|
|
210
|
+
visibilityChanged() { }
|
|
211
|
+
}
|
|
212
|
+
exports.GeometryRestriction = GeometryRestriction;
|
|
213
|
+
_GeometryRestriction_raycaster = new WeakMap(), _GeometryRestriction_viewport = new WeakMap(), _GeometryRestriction_geometryMathManager = new WeakMap(), _GeometryRestriction_nodes = 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();
|
|
214
|
+
// #endregion Classes (1)
|
|
215
|
+
//# sourceMappingURL=GeometryRestriction.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GeometryRestriction.js","sourceRoot":"","sources":["../../../../../../../src/business/implementation/managers/interaction/restrictions/geometry/GeometryRestriction.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,6CAA+B;AAC/B,gEAA6D;AAQ7D,yCAAiC;AAmBjC,8BAA8B;AAE9B,sBAAsB;AAEtB,MAAa,mBAAoB,SAAQ,yCAAmB;IAiBxD,6BAA6B;IAE7B,2BAA2B;IAE3B,YAAY,mBAAwC,EAAE,EAAU,EAAE,UAAyC;;QACvG,KAAK,CAAC,mBAAmB,EAAE,EAAE,CAAC,CAAC;QArBnC,0BAA0B;QAE1B,yCAAsB,IAAI,KAAK,CAAC,SAAS,EAAE,EAAC;QAC5C,gDAAiC;QAEjC,2DAA0C;QAC1C,qCAAsB,EAAE,EAAC;QACzB,gDAAoB;QACpB,gDAA0D,EAAE,EAAC;QAC7D,2CAAwB,IAAI,EAAC;QAC7B,2CAAwB,IAAI,EAAC;QAC7B,8CAA2B,IAAI,EAAC;QAChC,mDAAuC,IAAI,KAAK,CAAC,QAAQ,EAAE,EAAC;QAC5D,iDAAoB;QACpB,sDAAwB;QAQpB,uBAAA,IAAI,iCAAa,mBAAmB,CAAC,QAAQ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IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,uBAAA,IAAI,gDAAqB,CAAC,CAAC;SACjD;IACL,CAAC;IAED,gCAAgC;IAEhC,gCAAgC;IAEtB,iBAAiB,KAAW,CAAC;CAG1C;AA1MD,kDA0MC;;AAED,yBAAyB"}
|
package/dist/business/implementation/managers/interaction/restrictions/plane/PlaneRestriction.d.ts
ADDED
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { AbstractRestriction } from '../AbstractRestriction';
|
|
2
|
+
import { AngularRestriction, AngularRestrictionProperties } from './snap/AngularRestriction';
|
|
3
|
+
import { DrawingToolsManager } from '../../../../DrawingToolsManager';
|
|
4
|
+
import { GridRestriction, GridRestrictionProperties } from './snap/GridRestriction';
|
|
5
|
+
import { IRay } from '@shapediver/viewer.features.interaction';
|
|
6
|
+
import { IRestriction, RestrictionMetaData, RestrictionProperties } from '../../../../../interfaces/IRestriction';
|
|
7
|
+
import { ISnapRestriction } from '../../../../../interfaces/ISnapRestriction';
|
|
8
|
+
import { mat4, vec3 } from 'gl-matrix';
|
|
9
|
+
export declare type PlaneRestrictionProperties = {
|
|
10
|
+
/**
|
|
11
|
+
* The origin of the plane.
|
|
12
|
+
*
|
|
13
|
+
* @default vec3.fromValues(0, 0, 0)
|
|
14
|
+
*/
|
|
15
|
+
origin?: vec3;
|
|
16
|
+
/**
|
|
17
|
+
* Vector U of the plane
|
|
18
|
+
* with the cross product of vector_u and vector_v the normal of the plane can be calculated
|
|
19
|
+
*/
|
|
20
|
+
vector_u?: vec3;
|
|
21
|
+
/**
|
|
22
|
+
* Vector V of the plane
|
|
23
|
+
* with the cross product of vector_u and vector_v the normal of the plane can be calculated
|
|
24
|
+
*/
|
|
25
|
+
vector_v?: vec3;
|
|
26
|
+
/**
|
|
27
|
+
* grid snap restriction
|
|
28
|
+
*/
|
|
29
|
+
gridSnapRestriction?: GridRestrictionProperties;
|
|
30
|
+
/**
|
|
31
|
+
* angular snap restriction
|
|
32
|
+
*/
|
|
33
|
+
angularSnapRestriction?: AngularRestrictionProperties;
|
|
34
|
+
} & RestrictionProperties;
|
|
35
|
+
export declare class PlaneRestriction extends AbstractRestriction implements IRestriction {
|
|
36
|
+
#private;
|
|
37
|
+
constructor(drawingToolsManager: DrawingToolsManager, id: string, properties: PlaneRestrictionProperties);
|
|
38
|
+
get angularRestriction(): AngularRestriction;
|
|
39
|
+
get gridRestriction(): GridRestriction;
|
|
40
|
+
get normal(): vec3;
|
|
41
|
+
get origin(): vec3;
|
|
42
|
+
set origin(value: vec3);
|
|
43
|
+
get priority(): number;
|
|
44
|
+
get snapRestrictions(): {
|
|
45
|
+
[key: string]: ISnapRestriction;
|
|
46
|
+
};
|
|
47
|
+
get transformationFromXYPlaneMatrix(): mat4;
|
|
48
|
+
get transformationToXYPlaneMatrix(): mat4;
|
|
49
|
+
get vectorU(): vec3;
|
|
50
|
+
set vectorU(value: vec3);
|
|
51
|
+
get vectorV(): vec3;
|
|
52
|
+
set vectorV(value: vec3);
|
|
53
|
+
rayTrace(ray: IRay, metaData?: RestrictionMetaData): vec3 | undefined;
|
|
54
|
+
protected visibilityChanged(): void;
|
|
55
|
+
private createTransformationMatrices;
|
|
56
|
+
private snap;
|
|
57
|
+
}
|
|
58
|
+
//# sourceMappingURL=PlaneRestriction.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PlaneRestriction.d.ts","sourceRoot":"","sources":["../../../../../../../src/business/implementation/managers/interaction/restrictions/plane/PlaneRestriction.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAC7D,OAAO,EAAE,kBAAkB,EAAE,4BAA4B,EAAE,MAAM,2BAA2B,CAAC;AAC7F,OAAO,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AACtE,OAAO,EAAE,eAAe,EAAE,yBAAyB,EAAE,MAAM,wBAAwB,CAAC;AACpF,OAAO,EAAE,IAAI,EAAE,MAAM,yCAAyC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