@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
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { AbstractRestriction } from '../../AbstractRestriction';
|
|
2
|
+
import { DrawingToolsManager } from '../../../../../DrawingToolsManager';
|
|
3
|
+
import { ISnapRestriction, SnapRestrictionProperties } from '../../../../../../interfaces/ISnapRestriction';
|
|
4
|
+
import { PlaneRestriction } from '../PlaneRestriction';
|
|
5
|
+
import { vec3 } from 'gl-matrix';
|
|
6
|
+
/**
|
|
7
|
+
* Properties for the grid restriction
|
|
8
|
+
*/
|
|
9
|
+
export declare type GridRestrictionProperties = {
|
|
10
|
+
/**
|
|
11
|
+
* Size of the grid unit
|
|
12
|
+
*/
|
|
13
|
+
gridUnit?: number;
|
|
14
|
+
/**
|
|
15
|
+
* If the grid unit is editable for change to the end user.
|
|
16
|
+
* If it is not editable, the grid unit cannot be changed from the default value.
|
|
17
|
+
*/
|
|
18
|
+
gridUnitEditable?: boolean;
|
|
19
|
+
} & SnapRestrictionProperties;
|
|
20
|
+
export declare class GridRestriction extends AbstractRestriction implements ISnapRestriction {
|
|
21
|
+
#private;
|
|
22
|
+
constructor(drawingToolsManager: DrawingToolsManager, planeRestriction: PlaneRestriction, properties?: GridRestrictionProperties);
|
|
23
|
+
get active(): boolean;
|
|
24
|
+
set active(value: boolean);
|
|
25
|
+
get enabledEditable(): boolean;
|
|
26
|
+
get gridUnit(): number;
|
|
27
|
+
set gridUnit(value: number);
|
|
28
|
+
get gridUnitEditable(): boolean;
|
|
29
|
+
get priority(): number;
|
|
30
|
+
set priority(value: number);
|
|
31
|
+
snap(point: vec3): vec3 | undefined;
|
|
32
|
+
updatePlaneDefinition(origin: vec3, vectorU: vec3, vectorV: vec3, normal: vec3): void;
|
|
33
|
+
protected visibilityChanged(visible: boolean): void;
|
|
34
|
+
private createGridVisualization;
|
|
35
|
+
private createOffsetFromUnit;
|
|
36
|
+
}
|
|
37
|
+
//# sourceMappingURL=GridRestriction.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GridRestriction.d.ts","sourceRoot":"","sources":["../../../../../../../../src/business/implementation/managers/interaction/restrictions/plane/snap/GridRestriction.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAChE,OAAO,EAAE,mBAAmB,EAAE,MAAM,oCAAoC,CAAC;AAEzE,OAAO,EAAE,gBAAgB,EAAE,yBAAyB,EAAE,MAAM,+CAA+C,CAAC;AAC5G,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAIjC;;GAEG;AACH,oBAAY,yBAAyB,GAAG;IACpC;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB;;;OAGG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAC;CAC9B,GAAG,yBAAyB,CAAC;AAM9B,qBAAa,eAAgB,SAAQ,mBAAoB,YAAW,gBAAgB;;gBAuBpE,mBAAmB,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,UAAU,CAAC,EAAE,yBAAyB;IAgChI,IAAW,MAAM,IAAI,OAAO,CAE3B;IAED,IAAW,MAAM,CAAC,KAAK,EAAE,OAAO,EAI/B;IAED,IAAW,eAAe,IAAI,OAAO,CAEpC;IAED,IAAW,QAAQ,IAAI,MAAM,CAE5B;IAED,IAAW,QAAQ,CAAC,KAAK,EAAE,MAAM,EAMhC;IAED,IAAW,gBAAgB,IAAI,OAAO,CAErC;IAED,IAAW,QAAQ,IAAI,MAAM,CAE5B;IAED,IAAW,QAAQ,CAAC,KAAK,EAAE,MAAM,EAEhC;IAOM,IAAI,CAAC,KAAK,EAAE,IAAI,GAAG,IAAI,GAAG,SAAS;IAgDnC,qBAAqB,CAAC,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,GAAG,IAAI;IAc5F,SAAS,CAAC,iBAAiB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI;IAYnD,OAAO,CAAC,uBAAuB;IAiD/B,OAAO,CAAC,oBAAoB;CAQ/B"}
|
package/dist/business/implementation/managers/interaction/restrictions/plane/snap/GridRestriction.js
ADDED
|
@@ -0,0 +1,228 @@
|
|
|
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 _GridRestriction_activationKey, _GridRestriction_drawingToolsManager, _GridRestriction_planeRestriction, _GridRestriction_active, _GridRestriction_gridHelper, _GridRestriction_gridSize, _GridRestriction_gridUnit, _GridRestriction_gridUnitEditable, _GridRestriction_normal, _GridRestriction_offsetFromUnit, _GridRestriction_origin, _GridRestriction_priority, _GridRestriction_vectorU, _GridRestriction_vectorV;
|
|
37
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
38
|
+
exports.GridRestriction = void 0;
|
|
39
|
+
const THREE = __importStar(require("three"));
|
|
40
|
+
const AbstractRestriction_1 = require("../../AbstractRestriction");
|
|
41
|
+
const viewer_1 = require("@shapediver/viewer");
|
|
42
|
+
const gl_matrix_1 = require("gl-matrix");
|
|
43
|
+
// #endregion Type aliases (1)
|
|
44
|
+
// #region Classes (1)
|
|
45
|
+
class GridRestriction extends AbstractRestriction_1.AbstractRestriction {
|
|
46
|
+
// #endregion Properties (15)
|
|
47
|
+
// #region Constructors (1)
|
|
48
|
+
constructor(drawingToolsManager, planeRestriction, properties) {
|
|
49
|
+
var _a, _b, _c;
|
|
50
|
+
super(drawingToolsManager, 'grid');
|
|
51
|
+
// #region Properties (15)
|
|
52
|
+
_GridRestriction_activationKey.set(this, void 0);
|
|
53
|
+
_GridRestriction_drawingToolsManager.set(this, void 0);
|
|
54
|
+
_GridRestriction_planeRestriction.set(this, void 0);
|
|
55
|
+
_GridRestriction_active.set(this, false);
|
|
56
|
+
_GridRestriction_gridHelper.set(this, void 0);
|
|
57
|
+
_GridRestriction_gridSize.set(this, 100);
|
|
58
|
+
_GridRestriction_gridUnit.set(this, void 0);
|
|
59
|
+
_GridRestriction_gridUnitEditable.set(this, true);
|
|
60
|
+
_GridRestriction_normal.set(this, void 0);
|
|
61
|
+
_GridRestriction_offsetFromUnit.set(this, gl_matrix_1.vec3.create());
|
|
62
|
+
_GridRestriction_origin.set(this, void 0);
|
|
63
|
+
_GridRestriction_priority.set(this, 0);
|
|
64
|
+
_GridRestriction_vectorU.set(this, void 0);
|
|
65
|
+
_GridRestriction_vectorV.set(this, void 0);
|
|
66
|
+
__classPrivateFieldSet(this, _GridRestriction_drawingToolsManager, drawingToolsManager, "f");
|
|
67
|
+
__classPrivateFieldSet(this, _GridRestriction_planeRestriction, planeRestriction, "f");
|
|
68
|
+
// we store the properties of the plane restriction
|
|
69
|
+
// as we need them to calculate the transformation matrices
|
|
70
|
+
// and the offset of the grid size to the origin
|
|
71
|
+
__classPrivateFieldSet(this, _GridRestriction_vectorU, planeRestriction.vectorU, "f");
|
|
72
|
+
__classPrivateFieldSet(this, _GridRestriction_vectorV, planeRestriction.vectorV, "f");
|
|
73
|
+
__classPrivateFieldSet(this, _GridRestriction_normal, planeRestriction.normal, "f");
|
|
74
|
+
__classPrivateFieldSet(this, _GridRestriction_origin, planeRestriction.origin, "f");
|
|
75
|
+
__classPrivateFieldSet(this, _GridRestriction_activationKey, (properties === null || properties === void 0 ? void 0 : properties.activationKey) || 'g', "f");
|
|
76
|
+
this.enabled = (_a = properties === null || properties === void 0 ? void 0 : properties.enabled) !== null && _a !== void 0 ? _a : false;
|
|
77
|
+
this._enabledEditable = (_b = properties === null || properties === void 0 ? void 0 : properties.enabledEditable) !== null && _b !== void 0 ? _b : true;
|
|
78
|
+
__classPrivateFieldSet(this, _GridRestriction_gridUnit, (properties === null || properties === void 0 ? void 0 : properties.gridUnit) || 1, "f");
|
|
79
|
+
__classPrivateFieldSet(this, _GridRestriction_gridUnitEditable, (_c = properties === null || properties === void 0 ? void 0 : properties.gridUnitEditable) !== null && _c !== void 0 ? _c : true, "f");
|
|
80
|
+
__classPrivateFieldSet(this, _GridRestriction_priority, (properties === null || properties === void 0 ? void 0 : properties.priority) || 0, "f");
|
|
81
|
+
// create the offset of the grid size to origin
|
|
82
|
+
this.createOffsetFromUnit();
|
|
83
|
+
// calculate offset of grid size to origin
|
|
84
|
+
this.createGridVisualization();
|
|
85
|
+
}
|
|
86
|
+
// #endregion Constructors (1)
|
|
87
|
+
// #region Public Getters And Setters (8)
|
|
88
|
+
get active() {
|
|
89
|
+
return __classPrivateFieldGet(this, _GridRestriction_active, "f");
|
|
90
|
+
}
|
|
91
|
+
set active(value) {
|
|
92
|
+
__classPrivateFieldSet(this, _GridRestriction_active, value, "f");
|
|
93
|
+
if (__classPrivateFieldGet(this, _GridRestriction_gridHelper, "f"))
|
|
94
|
+
__classPrivateFieldGet(this, _GridRestriction_gridHelper, "f").visible = value;
|
|
95
|
+
}
|
|
96
|
+
get enabledEditable() {
|
|
97
|
+
return this._enabledEditable;
|
|
98
|
+
}
|
|
99
|
+
get gridUnit() {
|
|
100
|
+
return __classPrivateFieldGet(this, _GridRestriction_gridUnit, "f");
|
|
101
|
+
}
|
|
102
|
+
set gridUnit(value) {
|
|
103
|
+
if (__classPrivateFieldGet(this, _GridRestriction_gridUnitEditable, "f") === false)
|
|
104
|
+
return;
|
|
105
|
+
__classPrivateFieldSet(this, _GridRestriction_gridUnit, value, "f");
|
|
106
|
+
this.createOffsetFromUnit();
|
|
107
|
+
this.createGridVisualization();
|
|
108
|
+
}
|
|
109
|
+
get gridUnitEditable() {
|
|
110
|
+
return __classPrivateFieldGet(this, _GridRestriction_gridUnitEditable, "f");
|
|
111
|
+
}
|
|
112
|
+
get priority() {
|
|
113
|
+
return __classPrivateFieldGet(this, _GridRestriction_priority, "f");
|
|
114
|
+
}
|
|
115
|
+
set priority(value) {
|
|
116
|
+
__classPrivateFieldSet(this, _GridRestriction_priority, value, "f");
|
|
117
|
+
}
|
|
118
|
+
// #endregion Public Getters And Setters (8)
|
|
119
|
+
// #region Public Methods (2)
|
|
120
|
+
// public get
|
|
121
|
+
snap(point) {
|
|
122
|
+
// if the restriction is not enabled OR the activation key is set and the key is not pressed, return
|
|
123
|
+
if (this.enabled === false && __classPrivateFieldGet(this, _GridRestriction_drawingToolsManager, "f").keyPressed(__classPrivateFieldGet(this, _GridRestriction_activationKey, "f")) === false)
|
|
124
|
+
return;
|
|
125
|
+
/**
|
|
126
|
+
* Explanation of the following code:
|
|
127
|
+
* 1. Calculate the projection of the origin onto the plane that is created by the point and the normal
|
|
128
|
+
* 2. Move the grid helper to the projected origin
|
|
129
|
+
*/
|
|
130
|
+
// vector from the point to the origin
|
|
131
|
+
const v = gl_matrix_1.vec3.sub(gl_matrix_1.vec3.create(), __classPrivateFieldGet(this, _GridRestriction_origin, "f"), point);
|
|
132
|
+
// dot product of the vector and the normal
|
|
133
|
+
const dot = gl_matrix_1.vec3.dot(v, __classPrivateFieldGet(this, _GridRestriction_normal, "f"));
|
|
134
|
+
// projection of the origin onto the plane that is created by the point and the normal
|
|
135
|
+
const adjustedOrigin = gl_matrix_1.vec3.add(gl_matrix_1.vec3.create(), __classPrivateFieldGet(this, _GridRestriction_origin, "f"), __classPrivateFieldGet(this, _GridRestriction_offsetFromUnit, "f"));
|
|
136
|
+
const projectedOrigin = gl_matrix_1.vec3.sub(gl_matrix_1.vec3.create(), adjustedOrigin, gl_matrix_1.vec3.scale(gl_matrix_1.vec3.create(), __classPrivateFieldGet(this, _GridRestriction_normal, "f"), dot));
|
|
137
|
+
// we move the grid helper to the projected origin
|
|
138
|
+
if (__classPrivateFieldGet(this, _GridRestriction_gridHelper, "f")) {
|
|
139
|
+
__classPrivateFieldGet(this, _GridRestriction_gridHelper, "f").position.copy(new THREE.Vector3(projectedOrigin[0], projectedOrigin[1], projectedOrigin[2]));
|
|
140
|
+
__classPrivateFieldGet(this, _GridRestriction_gridHelper, "f").visible = false;
|
|
141
|
+
}
|
|
142
|
+
/**
|
|
143
|
+
* Explanation of the following code:
|
|
144
|
+
* 1. Rotate the point so that the normal of the plane is aligned with the Z axis (with previously calculated transformation matrix)
|
|
145
|
+
* 2. Snap the point to the grid
|
|
146
|
+
* 3. Rotate the point back to the original coordinate system (with previously calculated transformation matrix)
|
|
147
|
+
*/
|
|
148
|
+
// Apply the transformation to the point
|
|
149
|
+
const rotatedPoint = gl_matrix_1.vec3.transformMat4(gl_matrix_1.vec3.create(), point, __classPrivateFieldGet(this, _GridRestriction_planeRestriction, "f").transformationToXYPlaneMatrix);
|
|
150
|
+
// Snap the offset to the grid
|
|
151
|
+
const snappedOffset = gl_matrix_1.vec3.create();
|
|
152
|
+
snappedOffset[0] = Math.round(rotatedPoint[0] / __classPrivateFieldGet(this, _GridRestriction_gridUnit, "f")) * __classPrivateFieldGet(this, _GridRestriction_gridUnit, "f");
|
|
153
|
+
snappedOffset[1] = Math.round(rotatedPoint[1] / __classPrivateFieldGet(this, _GridRestriction_gridUnit, "f")) * __classPrivateFieldGet(this, _GridRestriction_gridUnit, "f");
|
|
154
|
+
snappedOffset[2] = rotatedPoint[2];
|
|
155
|
+
// Move the snapped point back to the original coordinate system
|
|
156
|
+
const snappedPoint = gl_matrix_1.vec3.transformMat4(gl_matrix_1.vec3.create(), snappedOffset, __classPrivateFieldGet(this, _GridRestriction_planeRestriction, "f").transformationFromXYPlaneMatrix);
|
|
157
|
+
return snappedPoint;
|
|
158
|
+
}
|
|
159
|
+
updatePlaneDefinition(origin, vectorU, vectorV, normal) {
|
|
160
|
+
__classPrivateFieldSet(this, _GridRestriction_origin, origin, "f");
|
|
161
|
+
__classPrivateFieldSet(this, _GridRestriction_vectorU, vectorU, "f");
|
|
162
|
+
__classPrivateFieldSet(this, _GridRestriction_vectorV, vectorV, "f");
|
|
163
|
+
__classPrivateFieldSet(this, _GridRestriction_normal, normal, "f");
|
|
164
|
+
this.createOffsetFromUnit();
|
|
165
|
+
this.createGridVisualization();
|
|
166
|
+
}
|
|
167
|
+
// #endregion Public Methods (2)
|
|
168
|
+
// #region Protected Methods (1)
|
|
169
|
+
visibilityChanged(visible) {
|
|
170
|
+
if (visible === false) {
|
|
171
|
+
if (__classPrivateFieldGet(this, _GridRestriction_gridHelper, "f")) {
|
|
172
|
+
__classPrivateFieldGet(this, _GridRestriction_gridHelper, "f").visible = false;
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
// #endregion Protected Methods (1)
|
|
177
|
+
// #region Private Methods (2)
|
|
178
|
+
createGridVisualization() {
|
|
179
|
+
if (__classPrivateFieldGet(this, _GridRestriction_gridHelper, "f")) {
|
|
180
|
+
this._object3D.remove(__classPrivateFieldGet(this, _GridRestriction_gridHelper, "f"));
|
|
181
|
+
__classPrivateFieldGet(this, _GridRestriction_gridHelper, "f").dispose();
|
|
182
|
+
}
|
|
183
|
+
const bb = new viewer_1.Box();
|
|
184
|
+
for (let i = 0; i < viewer_1.sceneTree.root.children.length; i++) {
|
|
185
|
+
if (viewer_1.sceneTree.root.children[i].sessionNode === true) {
|
|
186
|
+
bb.union(viewer_1.sceneTree.root.children[i].boundingBox);
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
const radius = bb.boundingSphere.radius;
|
|
190
|
+
__classPrivateFieldSet(this, _GridRestriction_gridSize, radius * 2, "f");
|
|
191
|
+
if (__classPrivateFieldGet(this, _GridRestriction_gridSize, "f") === Infinity || __classPrivateFieldGet(this, _GridRestriction_gridSize, "f") === -Infinity || isNaN(__classPrivateFieldGet(this, _GridRestriction_gridSize, "f")) || __classPrivateFieldGet(this, _GridRestriction_gridSize, "f") === 0)
|
|
192
|
+
__classPrivateFieldSet(this, _GridRestriction_gridSize, 100, "f");
|
|
193
|
+
// if the grid size is not divisible by the grid unit, we need to adjust the grid size
|
|
194
|
+
let gridSize = __classPrivateFieldGet(this, _GridRestriction_gridUnit, "f") * Math.ceil(__classPrivateFieldGet(this, _GridRestriction_gridSize, "f") / __classPrivateFieldGet(this, _GridRestriction_gridUnit, "f"));
|
|
195
|
+
// if the number of divisions is odd, we need to add one more division
|
|
196
|
+
if (gridSize / __classPrivateFieldGet(this, _GridRestriction_gridUnit, "f") % 2 === 1)
|
|
197
|
+
gridSize += __classPrivateFieldGet(this, _GridRestriction_gridUnit, "f");
|
|
198
|
+
// todo adjust grid size so that is divisible by grid unit
|
|
199
|
+
__classPrivateFieldSet(this, _GridRestriction_gridHelper, new THREE.GridHelper(gridSize, gridSize / __classPrivateFieldGet(this, _GridRestriction_gridUnit, "f"), 0x666666, 0x222222), "f");
|
|
200
|
+
const adjustedOrigin = gl_matrix_1.vec3.add(gl_matrix_1.vec3.create(), __classPrivateFieldGet(this, _GridRestriction_origin, "f"), __classPrivateFieldGet(this, _GridRestriction_offsetFromUnit, "f"));
|
|
201
|
+
__classPrivateFieldGet(this, _GridRestriction_gridHelper, "f").position.copy(new THREE.Vector3(adjustedOrigin[0], adjustedOrigin[1], adjustedOrigin[2]));
|
|
202
|
+
__classPrivateFieldGet(this, _GridRestriction_gridHelper, "f").visible = false;
|
|
203
|
+
__classPrivateFieldGet(this, _GridRestriction_gridHelper, "f").renderOrder = 100;
|
|
204
|
+
__classPrivateFieldGet(this, _GridRestriction_gridHelper, "f").material.depthTest = false;
|
|
205
|
+
__classPrivateFieldGet(this, _GridRestriction_gridHelper, "f").material.transparent = true;
|
|
206
|
+
// three.js uses a right-handed coordinate system, so we need to rotate the grid helper
|
|
207
|
+
const rotationMatrix = new THREE.Matrix4().fromArray([
|
|
208
|
+
__classPrivateFieldGet(this, _GridRestriction_vectorU, "f")[0], __classPrivateFieldGet(this, _GridRestriction_vectorU, "f")[1], __classPrivateFieldGet(this, _GridRestriction_vectorU, "f")[2], 0,
|
|
209
|
+
__classPrivateFieldGet(this, _GridRestriction_vectorV, "f")[0], __classPrivateFieldGet(this, _GridRestriction_vectorV, "f")[1], __classPrivateFieldGet(this, _GridRestriction_vectorV, "f")[2], 0,
|
|
210
|
+
__classPrivateFieldGet(this, _GridRestriction_normal, "f")[0], __classPrivateFieldGet(this, _GridRestriction_normal, "f")[1], __classPrivateFieldGet(this, _GridRestriction_normal, "f")[2], 0,
|
|
211
|
+
0, 0, 0, 1
|
|
212
|
+
]);
|
|
213
|
+
__classPrivateFieldGet(this, _GridRestriction_gridHelper, "f").rotation.setFromRotationMatrix(rotationMatrix);
|
|
214
|
+
// three.js grid helper is created in the XY plane, so we need to rotate it by 90 degrees around the X axis
|
|
215
|
+
__classPrivateFieldGet(this, _GridRestriction_gridHelper, "f").rotateX(Math.PI / 2);
|
|
216
|
+
this._object3D.add(__classPrivateFieldGet(this, _GridRestriction_gridHelper, "f"));
|
|
217
|
+
}
|
|
218
|
+
createOffsetFromUnit() {
|
|
219
|
+
// Calculate the offset of the rotated point from the rotated origin
|
|
220
|
+
__classPrivateFieldGet(this, _GridRestriction_offsetFromUnit, "f")[0] = __classPrivateFieldGet(this, _GridRestriction_gridUnit, "f") * Math.round(__classPrivateFieldGet(this, _GridRestriction_origin, "f")[0] / __classPrivateFieldGet(this, _GridRestriction_gridUnit, "f")) - __classPrivateFieldGet(this, _GridRestriction_origin, "f")[0];
|
|
221
|
+
__classPrivateFieldGet(this, _GridRestriction_offsetFromUnit, "f")[1] = __classPrivateFieldGet(this, _GridRestriction_gridUnit, "f") * Math.round(__classPrivateFieldGet(this, _GridRestriction_origin, "f")[1] / __classPrivateFieldGet(this, _GridRestriction_gridUnit, "f")) - __classPrivateFieldGet(this, _GridRestriction_origin, "f")[1];
|
|
222
|
+
__classPrivateFieldGet(this, _GridRestriction_offsetFromUnit, "f")[2] = __classPrivateFieldGet(this, _GridRestriction_gridUnit, "f") * Math.round(__classPrivateFieldGet(this, _GridRestriction_origin, "f")[2] / __classPrivateFieldGet(this, _GridRestriction_gridUnit, "f")) - __classPrivateFieldGet(this, _GridRestriction_origin, "f")[2];
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
exports.GridRestriction = GridRestriction;
|
|
226
|
+
_GridRestriction_activationKey = new WeakMap(), _GridRestriction_drawingToolsManager = new WeakMap(), _GridRestriction_planeRestriction = new WeakMap(), _GridRestriction_active = new WeakMap(), _GridRestriction_gridHelper = new WeakMap(), _GridRestriction_gridSize = new WeakMap(), _GridRestriction_gridUnit = new WeakMap(), _GridRestriction_gridUnitEditable = new WeakMap(), _GridRestriction_normal = new WeakMap(), _GridRestriction_offsetFromUnit = new WeakMap(), _GridRestriction_origin = new WeakMap(), _GridRestriction_priority = new WeakMap(), _GridRestriction_vectorU = new WeakMap(), _GridRestriction_vectorV = new WeakMap();
|
|
227
|
+
// #endregion Classes (1)
|
|
228
|
+
//# sourceMappingURL=GridRestriction.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GridRestriction.js","sourceRoot":"","sources":["../../../../../../../../src/business/implementation/managers/interaction/restrictions/plane/snap/GridRestriction.ts"],"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C,CAAC,CAAC;IAC9G,CAAC;CAGJ;AArOD,0CAqOC;;AAED,yBAAyB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"numberCleaner.d.ts","sourceRoot":"","sources":["../../../../src/business/implementation/utils/numberCleaner.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,aAAa,UAAW,MAAM,KAAG,MAG7C,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.numberCleaner = void 0;
|
|
4
|
+
const numberCleaner = (value) => {
|
|
5
|
+
const roundedThreshold = 100;
|
|
6
|
+
return Math.round(value * roundedThreshold) / roundedThreshold;
|
|
7
|
+
};
|
|
8
|
+
exports.numberCleaner = numberCleaner;
|
|
9
|
+
//# sourceMappingURL=numberCleaner.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"numberCleaner.js","sourceRoot":"","sources":["../../../../src/business/implementation/utils/numberCleaner.ts"],"names":[],"mappings":";;;AACO,MAAM,aAAa,GAAG,CAAC,KAAa,EAAU,EAAE;IACnD,MAAM,gBAAgB,GAAG,GAAG,CAAC;IAC7B,OAAO,IAAI,CAAC,KAAK,CAAC,KAAK,GAAG,gBAAgB,CAAC,GAAG,gBAAgB,CAAC;AACnE,CAAC,CAAC;AAHW,QAAA,aAAa,iBAGxB"}
|
|
@@ -0,0 +1,270 @@
|
|
|
1
|
+
import { AxisRestrictionProperties } from '../implementation/managers/interaction/restrictions/axis/AxisRestriction';
|
|
2
|
+
import { GeometryRestrictionProperties } from '../implementation/managers/interaction/restrictions/geometry/GeometryRestriction';
|
|
3
|
+
import { IManager } from './IManager';
|
|
4
|
+
import { IMapData, IMaterialBasicLineDataProperties, IMaterialMultiPointDataProperties } from '@shapediver/viewer.shared.types';
|
|
5
|
+
import { IRestriction, RestrictionProperties } from './IRestriction';
|
|
6
|
+
import { PlaneRestrictionProperties } from '../implementation/managers/interaction/restrictions/plane/PlaneRestriction';
|
|
7
|
+
import { vec3 } from 'gl-matrix';
|
|
8
|
+
/**
|
|
9
|
+
* The callbacks of the drawing tool.
|
|
10
|
+
*
|
|
11
|
+
* Here you can define the callbacks that are used when interacting with the drawing tool.
|
|
12
|
+
*
|
|
13
|
+
* @typedef Callbacks
|
|
14
|
+
*/
|
|
15
|
+
export declare type Callbacks = {
|
|
16
|
+
/**
|
|
17
|
+
* The callback that is called when the drawing tool is cancelled.
|
|
18
|
+
*/
|
|
19
|
+
onCancel(): void;
|
|
20
|
+
/**
|
|
21
|
+
* The callback that is called when the drawing tool is updated.
|
|
22
|
+
*
|
|
23
|
+
* @param pointsData The points data of the drawing tool.
|
|
24
|
+
*/
|
|
25
|
+
onUpdate(pointsData: PointsData): void;
|
|
26
|
+
};
|
|
27
|
+
export declare type DefaultTextures = {
|
|
28
|
+
[key: string]: Promise<IMapData> | IMapData;
|
|
29
|
+
};
|
|
30
|
+
/**
|
|
31
|
+
* The data of the points.
|
|
32
|
+
* The points are defined as an array of arrays, where each array contains the x, y and z coordinates of the point.
|
|
33
|
+
*
|
|
34
|
+
* @example [[0, 0, 0], [1, 0, 0], [1, 1, 0], [0, 1, 0], [0, 0, 0]]
|
|
35
|
+
* @typedef PointsData
|
|
36
|
+
*/
|
|
37
|
+
export declare type PointsData = number[][];
|
|
38
|
+
/**
|
|
39
|
+
* The initial settings of the drawing tool.
|
|
40
|
+
* Here you can define the initial settings of the drawing tool.
|
|
41
|
+
*
|
|
42
|
+
* @typedef Settings
|
|
43
|
+
*
|
|
44
|
+
*/
|
|
45
|
+
export declare type Settings = {
|
|
46
|
+
/**
|
|
47
|
+
* The geometry settings of the drawing tool.
|
|
48
|
+
*
|
|
49
|
+
* Here you can define the points, the mode and specific details of the geometry.
|
|
50
|
+
*/
|
|
51
|
+
geometry: {
|
|
52
|
+
/**
|
|
53
|
+
* The points that are used when starting the drawing tool.
|
|
54
|
+
* The points are defined as an array of arrays, where each array contains the x, y and z coordinates of the point.
|
|
55
|
+
*
|
|
56
|
+
* If the mode is set to 'lines', the points are connected in the order they are defined.
|
|
57
|
+
* If the mode is set to 'points', the points are not connected.
|
|
58
|
+
*
|
|
59
|
+
* @default []
|
|
60
|
+
* @example [[0, 0, 0], [1, 0, 0], [1, 1, 0], [0, 1, 0], [0, 0, 0]]
|
|
61
|
+
*/
|
|
62
|
+
points: PointsData;
|
|
63
|
+
/**
|
|
64
|
+
* The mode of the geometry.
|
|
65
|
+
*
|
|
66
|
+
* If the mode is set to 'lines', the points are connected in the order they are defined.
|
|
67
|
+
* If the mode is set to 'points', the points are not connected.
|
|
68
|
+
*
|
|
69
|
+
* @default 'lines'
|
|
70
|
+
*/
|
|
71
|
+
mode: 'points' | 'lines';
|
|
72
|
+
/**
|
|
73
|
+
* The minimum amount of points, if undefined, the geometry is not restricted.
|
|
74
|
+
* This value is checked whenever the user tries to update or finish the drawing tool.
|
|
75
|
+
*
|
|
76
|
+
* @default undefined
|
|
77
|
+
*/
|
|
78
|
+
minPoints?: number;
|
|
79
|
+
/**
|
|
80
|
+
* The maximum amount of points, if undefined, the geometry is not restricted.
|
|
81
|
+
* This value is checked whenever the user tries to update or finish the drawing tool.
|
|
82
|
+
*
|
|
83
|
+
* @default undefined
|
|
84
|
+
*/
|
|
85
|
+
maxPoints?: number;
|
|
86
|
+
/**
|
|
87
|
+
* If the number of points is strictly checked during the drawing process.
|
|
88
|
+
* If this setting is set to true, once the minimum or maximum amount of points is reached, the user cannot add or remove points that would violate the restriction.
|
|
89
|
+
* If this setting is set to false, the user can add or remove points even if the minimum or maximum amount of points is exceeded temporarily.
|
|
90
|
+
* Once the user tries to update or finish the drawing tool, the amount of points is checked in either case.
|
|
91
|
+
*
|
|
92
|
+
* @default true
|
|
93
|
+
*/
|
|
94
|
+
strictMinMaxPoints?: boolean;
|
|
95
|
+
/**
|
|
96
|
+
* If the mode is set to 'lines', if it is a closed line or not.
|
|
97
|
+
* If the mode is set to 'points', this setting is ignored.
|
|
98
|
+
*
|
|
99
|
+
* A line can be closed by connecting the last point with the first point.
|
|
100
|
+
*
|
|
101
|
+
* @default true
|
|
102
|
+
*/
|
|
103
|
+
close: boolean;
|
|
104
|
+
/**
|
|
105
|
+
* If the mode is set to 'lines', if the line is automatically closed.
|
|
106
|
+
* If the mode is set to 'points', this setting is ignored.
|
|
107
|
+
*
|
|
108
|
+
* The first and last point are always connected if the line is automatically closed.
|
|
109
|
+
*
|
|
110
|
+
* @default true
|
|
111
|
+
*/
|
|
112
|
+
autoClose: boolean;
|
|
113
|
+
};
|
|
114
|
+
/**
|
|
115
|
+
* The restrictions of the drawing tool.
|
|
116
|
+
*
|
|
117
|
+
* Here you can define the restrictions that are used when interacting with the drawing tool.
|
|
118
|
+
* At least one restriction is required, the plane and axis restrictions are added by default if no restrictions are defined.
|
|
119
|
+
*/
|
|
120
|
+
restrictions: {
|
|
121
|
+
[key: string]: RestrictionProperties | PlaneRestrictionProperties | GeometryRestrictionProperties | AxisRestrictionProperties;
|
|
122
|
+
};
|
|
123
|
+
/**
|
|
124
|
+
* The visualization settings of the drawing tool.
|
|
125
|
+
*
|
|
126
|
+
* Here you can define the visualization of the drawing tool.
|
|
127
|
+
*/
|
|
128
|
+
visualization: {
|
|
129
|
+
/**
|
|
130
|
+
* The multiplication factor of the point size when interactions are performed.
|
|
131
|
+
* If the factor is set to 2, the point size is doubled when interacting.
|
|
132
|
+
*
|
|
133
|
+
* @default 2
|
|
134
|
+
*/
|
|
135
|
+
distanceMultiplicationFactor: number;
|
|
136
|
+
/**
|
|
137
|
+
* If the point labels are shown.
|
|
138
|
+
* The point labels display the position of the points.
|
|
139
|
+
*
|
|
140
|
+
* @default false
|
|
141
|
+
*/
|
|
142
|
+
pointLabels: boolean;
|
|
143
|
+
/**
|
|
144
|
+
* If the distance labels are shown.
|
|
145
|
+
* The distance labels display the distance between the points.
|
|
146
|
+
*
|
|
147
|
+
* @default true
|
|
148
|
+
*/
|
|
149
|
+
distanceLabels: boolean;
|
|
150
|
+
/**
|
|
151
|
+
* The material properties of the points.
|
|
152
|
+
*/
|
|
153
|
+
points: IMaterialMultiPointDataProperties;
|
|
154
|
+
/**
|
|
155
|
+
* The material properties of the lines.
|
|
156
|
+
*/
|
|
157
|
+
lines: IMaterialBasicLineDataProperties;
|
|
158
|
+
};
|
|
159
|
+
/**
|
|
160
|
+
* The control settings of the drawing tool.
|
|
161
|
+
*
|
|
162
|
+
* Here you can define which keys are used for the different actions of the drawing tool.
|
|
163
|
+
*/
|
|
164
|
+
controls: {
|
|
165
|
+
/**
|
|
166
|
+
* The key that is used to insert a point.
|
|
167
|
+
*
|
|
168
|
+
* @default ['Insert','+']
|
|
169
|
+
*/
|
|
170
|
+
insert: string | string[];
|
|
171
|
+
/**
|
|
172
|
+
* The key that is used to delete a point.
|
|
173
|
+
*
|
|
174
|
+
* @default ['Delete','-']
|
|
175
|
+
*/
|
|
176
|
+
delete: string | string[];
|
|
177
|
+
/**
|
|
178
|
+
* The key that is used to confirm actions.
|
|
179
|
+
*
|
|
180
|
+
* @default 'Enter'
|
|
181
|
+
*/
|
|
182
|
+
confirm: string | string[];
|
|
183
|
+
/**
|
|
184
|
+
* The key that is used to cancel drawing.
|
|
185
|
+
*
|
|
186
|
+
* @default 'Escape'
|
|
187
|
+
*/
|
|
188
|
+
cancel: string | string[];
|
|
189
|
+
/**
|
|
190
|
+
* The keys that are used to undo the last action.
|
|
191
|
+
*
|
|
192
|
+
* @default 'Control+Z'
|
|
193
|
+
*/
|
|
194
|
+
undo: string | string[];
|
|
195
|
+
/**
|
|
196
|
+
* The keys that are used to redo the last action.
|
|
197
|
+
*
|
|
198
|
+
* @default 'Control+Y'
|
|
199
|
+
*/
|
|
200
|
+
redo: string | string[];
|
|
201
|
+
};
|
|
202
|
+
/**
|
|
203
|
+
* The general settings of the drawing tool.
|
|
204
|
+
*
|
|
205
|
+
* Here you can define general settings of the drawing tool.
|
|
206
|
+
*/
|
|
207
|
+
general: {
|
|
208
|
+
/**
|
|
209
|
+
* If the drawing tool is started automatically when no points are defined.
|
|
210
|
+
*
|
|
211
|
+
* @default true
|
|
212
|
+
*/
|
|
213
|
+
autoStart: boolean;
|
|
214
|
+
/**
|
|
215
|
+
* If the drawing tool is updated automatically when the drawing is changed.
|
|
216
|
+
*
|
|
217
|
+
* @default false
|
|
218
|
+
*/
|
|
219
|
+
autoUpdate: boolean;
|
|
220
|
+
/**
|
|
221
|
+
* If the drawing tool is closed when the drawing is updated.
|
|
222
|
+
*
|
|
223
|
+
* @default false
|
|
224
|
+
*/
|
|
225
|
+
closeOnUpdate: boolean;
|
|
226
|
+
/**
|
|
227
|
+
* The unit that will be displayed in the distance and point labels.
|
|
228
|
+
*
|
|
229
|
+
* @default ''
|
|
230
|
+
*/
|
|
231
|
+
displayUnit: string;
|
|
232
|
+
};
|
|
233
|
+
};
|
|
234
|
+
export declare type SettingsOptional = {
|
|
235
|
+
geometry?: Partial<Settings['geometry']>;
|
|
236
|
+
restrictions?: Partial<Settings['restrictions']>;
|
|
237
|
+
visualization?: Partial<Settings['visualization']>;
|
|
238
|
+
controls?: Partial<Settings['controls']>;
|
|
239
|
+
general?: Partial<Settings['general']>;
|
|
240
|
+
};
|
|
241
|
+
export interface IDrawingToolsManager extends IManager {
|
|
242
|
+
readonly closed: boolean;
|
|
243
|
+
readonly restrictions: {
|
|
244
|
+
[key: string]: IRestriction;
|
|
245
|
+
};
|
|
246
|
+
showDistanceLabels: boolean;
|
|
247
|
+
showPointLabels: boolean;
|
|
248
|
+
addPoint(index: number, position?: vec3, temporary?: boolean): void;
|
|
249
|
+
addRestriction(properties: RestrictionProperties, token?: string): string | undefined;
|
|
250
|
+
canRedo(): boolean;
|
|
251
|
+
canUndo(): boolean;
|
|
252
|
+
cancel(): void;
|
|
253
|
+
getPointsData(): PointsData;
|
|
254
|
+
movePoint(index: number, position: vec3, temporary?: boolean): void;
|
|
255
|
+
redo(): void;
|
|
256
|
+
removePoint(index: number, temporary?: boolean): void;
|
|
257
|
+
removePoints(indices: number[]): void;
|
|
258
|
+
removeRestriction(token: string): void;
|
|
259
|
+
undo(): void;
|
|
260
|
+
update(): PointsData | undefined;
|
|
261
|
+
}
|
|
262
|
+
export declare enum MATERIAL_INDEX {
|
|
263
|
+
DEFAULT = 0,
|
|
264
|
+
HOVERED = 1,
|
|
265
|
+
SELECTED = 2,
|
|
266
|
+
SELECTED_HOVERED = 3,
|
|
267
|
+
INSERTION = 4,
|
|
268
|
+
INSERTION_HOVERED = 5
|
|
269
|
+
}
|
|
270
|
+
//# sourceMappingURL=IDrawingToolsManager.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IDrawingToolsManager.d.ts","sourceRoot":"","sources":["../../../src/business/interfaces/IDrawingToolsManager.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,yBAAyB,EAAE,MAAM,0EAA0E,CAAC;AACrH,OAAO,EAAE,6BAA6B,EAAE,MAAM,kFAAkF,CAAC;AACjI,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,QAAQ,EAAE,gCAAgC,EAAE,iCAAiC,EAAE,MAAM,iCAAiC,CAAC;AAChI,OAAO,EAAE,YAAY,EAAE,qBAAqB,EAAE,MAAM,gBAAgB,CAAC;AACrE,OAAO,EAAE,0BAA0B,EAAE,MAAM,4EAA4E,CAAC;AACxH,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAIjC;;;;;;GAMG;AACH,oBAAY,SAAS,GAAG;IACpB;;OAEG;IACH,QAAQ,IAAI,IAAI,CAAC;IACjB;;;;OAIG;IACH,QAAQ,CAAC,UAAU,EAAE,UAAU,GAAG,IAAI,CAAC;CAC1C,CAAC;AACF,oBAAY,eAAe,GAAG;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,QAAQ,CAAC,GAAG,QAAQ,CAAA;CAAE,CAAA;AAE7E;;;;;;GAMG;AACH,oBAAY,UAAU,GAAG,MAA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B,OAAO,IAAI,OAAO,CAAC;IACnB,MAAM,IAAI,IAAI,CAAC;IACf,aAAa,IAAI,UAAU,CAAC;IAC5B,SAAS,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,SAAS,CAAC,EAAE,OAAO,GAAG,IAAI,CAAC;IACpE,IAAI,IAAI,IAAI,CAAC;IACb,WAAW,CAAC,KAAK,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,OAAO,GAAG,IAAI,CAAC;IACtD,YAAY,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC;IACtC,iBAAiB,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACvC,IAAI,IAAI,IAAI,CAAC;IACb,MAAM,IAAI,UAAU,GAAG,SAAS,CAAC;CAGpC;AAMD,oBAAY,cAAc;IACtB,OAAO,IAAI;IACX,OAAO,IAAI;IACX,QAAQ,IAAI;IACZ,gBAAgB,IAAI;IACpB,SAAS,IAAI;IACb,iBAAiB,IAAI;CACxB"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MATERIAL_INDEX = void 0;
|
|
4
|
+
// #endregion Interfaces (1)
|
|
5
|
+
// #region Enums (1)
|
|
6
|
+
var MATERIAL_INDEX;
|
|
7
|
+
(function (MATERIAL_INDEX) {
|
|
8
|
+
MATERIAL_INDEX[MATERIAL_INDEX["DEFAULT"] = 0] = "DEFAULT";
|
|
9
|
+
MATERIAL_INDEX[MATERIAL_INDEX["HOVERED"] = 1] = "HOVERED";
|
|
10
|
+
MATERIAL_INDEX[MATERIAL_INDEX["SELECTED"] = 2] = "SELECTED";
|
|
11
|
+
MATERIAL_INDEX[MATERIAL_INDEX["SELECTED_HOVERED"] = 3] = "SELECTED_HOVERED";
|
|
12
|
+
MATERIAL_INDEX[MATERIAL_INDEX["INSERTION"] = 4] = "INSERTION";
|
|
13
|
+
MATERIAL_INDEX[MATERIAL_INDEX["INSERTION_HOVERED"] = 5] = "INSERTION_HOVERED";
|
|
14
|
+
})(MATERIAL_INDEX = exports.MATERIAL_INDEX || (exports.MATERIAL_INDEX = {}));
|
|
15
|
+
// #endregion Enums (1)
|
|
16
|
+
//# sourceMappingURL=IDrawingToolsManager.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IDrawingToolsManager.js","sourceRoot":"","sources":["../../../src/business/interfaces/IDrawingToolsManager.ts"],"names":[],"mappings":";;;AA2SA,4BAA4B;AAE5B,oBAAoB;AAEpB,IAAY,cAOX;AAPD,WAAY,cAAc;IACtB,yDAAW,CAAA;IACX,yDAAW,CAAA;IACX,2DAAY,CAAA;IACZ,2EAAoB,CAAA;IACpB,6DAAa,CAAA;IACb,6EAAqB,CAAA;AACzB,CAAC,EAPW,cAAc,GAAd,sBAAc,KAAd,sBAAc,QAOzB;AAED,uBAAuB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IManager.d.ts","sourceRoot":"","sources":["../../../src/business/interfaces/IManager.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,QAAQ;IAGrB,KAAK,IAAI,IAAI,CAAC;CAGjB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IManager.js","sourceRoot":"","sources":["../../../src/business/interfaces/IManager.ts"],"names":[],"mappings":""}
|