@shapediver/viewer.features.drawing-tools 3.3.3 → 3.3.6
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/package.json +12 -13
- package/src/api/implementation/DrawingToolsApi.ts +0 -130
- package/src/api/implementation/restrictions/AbstractRestrictionApi.ts +0 -34
- package/src/api/implementation/restrictions/AbstractSnapRestrictionApi.ts +0 -36
- package/src/api/implementation/restrictions/geometry/GeometryRestrictionApi.ts +0 -56
- package/src/api/implementation/restrictions/plane/PlaneRestrictionApi.ts +0 -70
- package/src/api/implementation/restrictions/plane/snap/AngularRestrictionApi.ts +0 -35
- package/src/api/implementation/restrictions/plane/snap/AxisRestrictionApi.ts +0 -19
- package/src/api/implementation/restrictions/plane/snap/GridRestrictionApi.ts +0 -35
- package/src/api/interfaces/IDrawingToolsApi.ts +0 -98
- package/src/api/interfaces/IRestrictionApi.ts +0 -15
- package/src/api/interfaces/ISnapRestrictionApi.ts +0 -18
- package/src/business/implementation/DrawingToolsManager.ts +0 -618
- package/src/business/implementation/managers/HistoryManager.ts +0 -101
- package/src/business/implementation/managers/TextVisualizationManager.ts +0 -269
- package/src/business/implementation/managers/geometry/GeometryManager.ts +0 -95
- package/src/business/implementation/managers/geometry/GeometryMathManager.ts +0 -289
- package/src/business/implementation/managers/geometry/GeometryState.ts +0 -436
- package/src/business/implementation/managers/geometry/helpers/GeometryManagerHelper.ts +0 -170
- package/src/business/implementation/managers/interaction/EventManager.ts +0 -80
- package/src/business/implementation/managers/interaction/InteractionManager.ts +0 -268
- package/src/business/implementation/managers/interaction/RestrictionManager.ts +0 -132
- package/src/business/implementation/managers/interaction/handlers/DeletionInteractionHandler.ts +0 -48
- package/src/business/implementation/managers/interaction/handlers/InsertionInteractionHandler.ts +0 -149
- package/src/business/implementation/managers/interaction/handlers/MidPointInteractionHandler.ts +0 -127
- package/src/business/implementation/managers/interaction/helpers/InteractionManagerHelper.ts +0 -411
- package/src/business/implementation/managers/interaction/restrictions/AbstractRestriction.ts +0 -99
- package/src/business/implementation/managers/interaction/restrictions/geometry/GeometryRestriction.ts +0 -237
- package/src/business/implementation/managers/interaction/restrictions/plane/PlaneRestriction.ts +0 -337
- package/src/business/implementation/managers/interaction/restrictions/plane/snap/AngularRestriction.ts +0 -394
- package/src/business/implementation/managers/interaction/restrictions/plane/snap/AxisRestriction.ts +0 -116
- package/src/business/implementation/managers/interaction/restrictions/plane/snap/GridRestriction.ts +0 -246
- package/src/business/implementation/utils/numberCleaner.ts +0 -5
- package/src/business/interfaces/IDrawingToolsManager.ts +0 -312
- package/src/business/interfaces/IManager.ts +0 -7
- package/src/business/interfaces/IRestriction.ts +0 -63
- package/src/business/interfaces/IRestrictionBase.ts +0 -33
- package/src/business/interfaces/ISnapRestriction.ts +0 -70
- package/src/business/interfaces/events/EventResponseMapping.ts +0 -19
- package/src/business/interfaces/events/IDrawingToolsEvent.ts +0 -16
- package/src/index.ts +0 -72
- package/src/three/CSS2DRenderer.ts +0 -212
- package/tsconfig.json +0 -17
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@shapediver/viewer.features.drawing-tools",
|
|
3
|
-
"version": "3.3.
|
|
3
|
+
"version": "3.3.6",
|
|
4
4
|
"description": "",
|
|
5
5
|
"keywords": [],
|
|
6
6
|
"author": "Michael Oppitz <michael@shapediver.com>",
|
|
@@ -10,11 +10,10 @@
|
|
|
10
10
|
"test": "__tests__"
|
|
11
11
|
},
|
|
12
12
|
"files": [
|
|
13
|
-
"dist",
|
|
14
|
-
"src",
|
|
15
13
|
"package.json",
|
|
14
|
+
"dist/",
|
|
16
15
|
"README.md",
|
|
17
|
-
"
|
|
16
|
+
"LICENSE"
|
|
18
17
|
],
|
|
19
18
|
"publishConfig": {
|
|
20
19
|
"access": "public"
|
|
@@ -28,7 +27,7 @@
|
|
|
28
27
|
"build": "bash ../../scripts/building/build.sh",
|
|
29
28
|
"build-watch": "bash ../../scripts/building/build-watch.sh",
|
|
30
29
|
"build-dep": "bash ../../scripts/building/build-dep.sh",
|
|
31
|
-
"build-
|
|
30
|
+
"build-all": "npm run build",
|
|
32
31
|
"doc": "typedoc"
|
|
33
32
|
},
|
|
34
33
|
"bugs": {
|
|
@@ -41,15 +40,15 @@
|
|
|
41
40
|
"testEnvironment": "node"
|
|
42
41
|
},
|
|
43
42
|
"devDependencies": {
|
|
44
|
-
"@shapediver/viewer": "3.3.
|
|
45
|
-
"@shapediver/viewer.features.interaction": "3.3.
|
|
46
|
-
"@shapediver/viewer.rendering-engine.rendering-engine-threejs": "3.3.
|
|
47
|
-
"@shapediver/viewer.shared.math": "3.3.
|
|
48
|
-
"@shapediver/viewer.shared.node-tree": "3.3.
|
|
49
|
-
"@shapediver/viewer.shared.services": "3.3.
|
|
50
|
-
"@shapediver/viewer.shared.types": "3.3.
|
|
43
|
+
"@shapediver/viewer": "3.3.6",
|
|
44
|
+
"@shapediver/viewer.features.interaction": "3.3.6",
|
|
45
|
+
"@shapediver/viewer.rendering-engine.rendering-engine-threejs": "3.3.6",
|
|
46
|
+
"@shapediver/viewer.shared.math": "3.3.6",
|
|
47
|
+
"@shapediver/viewer.shared.node-tree": "3.3.6",
|
|
48
|
+
"@shapediver/viewer.shared.services": "3.3.6",
|
|
49
|
+
"@shapediver/viewer.shared.types": "3.3.6",
|
|
51
50
|
"@types/three": "0.162.0",
|
|
52
51
|
"three": "0.162.0"
|
|
53
52
|
},
|
|
54
|
-
"gitHead": "
|
|
53
|
+
"gitHead": "13aea937b128a001e6e93be300674c4a04624c29"
|
|
55
54
|
}
|
|
@@ -1,130 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
Callbacks,
|
|
3
|
-
DefaultTextures,
|
|
4
|
-
IDrawingToolsManager,
|
|
5
|
-
PointsData,
|
|
6
|
-
SettingsOptional
|
|
7
|
-
} from '../../business/interfaces/IDrawingToolsManager';
|
|
8
|
-
import { DrawingToolsManager } from '../../business/implementation/DrawingToolsManager';
|
|
9
|
-
import { GeometryRestriction } from '../../business/implementation/managers/interaction/restrictions/geometry/GeometryRestriction';
|
|
10
|
-
import { GeometryRestrictionApi } from './restrictions/geometry/GeometryRestrictionApi';
|
|
11
|
-
import { IDrawingToolsApi } from '../interfaces/IDrawingToolsApi';
|
|
12
|
-
import { IRestrictionApi } from '../interfaces/IRestrictionApi';
|
|
13
|
-
import { IViewportApi } from '@shapediver/viewer';
|
|
14
|
-
import { PlaneRestriction } from '../../business/implementation/managers/interaction/restrictions/plane/PlaneRestriction';
|
|
15
|
-
import { PlaneRestrictionApi } from './restrictions/plane/PlaneRestrictionApi';
|
|
16
|
-
import { RestrictionProperties } from '../../business/interfaces/IRestriction';
|
|
17
|
-
import { vec3 } from 'gl-matrix';
|
|
18
|
-
|
|
19
|
-
export class DrawingToolsApi implements IDrawingToolsApi {
|
|
20
|
-
// #region Properties (2)
|
|
21
|
-
|
|
22
|
-
readonly #drawingToolsManager: IDrawingToolsManager;
|
|
23
|
-
readonly #restrictions: { [key: string]: IRestrictionApi; } = {};
|
|
24
|
-
|
|
25
|
-
// #endregion Properties (2)
|
|
26
|
-
|
|
27
|
-
// #region Constructors (1)
|
|
28
|
-
|
|
29
|
-
constructor(viewport: IViewportApi, callbacks: Callbacks, settings: SettingsOptional, defaultTextures?: DefaultTextures) {
|
|
30
|
-
this.#drawingToolsManager = new DrawingToolsManager(viewport, callbacks, settings, defaultTextures);
|
|
31
|
-
|
|
32
|
-
for (const token in this.#drawingToolsManager.restrictions) {
|
|
33
|
-
if (this.#drawingToolsManager.restrictions[token] instanceof PlaneRestriction)
|
|
34
|
-
this.#restrictions[token] = new PlaneRestrictionApi(this.#drawingToolsManager.restrictions[token] as PlaneRestriction);
|
|
35
|
-
if (this.#drawingToolsManager.restrictions[token] instanceof GeometryRestriction)
|
|
36
|
-
this.#restrictions[token] = new GeometryRestrictionApi(this.#drawingToolsManager.restrictions[token] as GeometryRestriction);
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
// #endregion Constructors (1)
|
|
41
|
-
|
|
42
|
-
// #region Public Getters And Setters (7)
|
|
43
|
-
|
|
44
|
-
public get closed(): boolean {
|
|
45
|
-
return this.#drawingToolsManager.closed;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
public get pointsData(): PointsData {
|
|
49
|
-
return this.#drawingToolsManager.getPointsData();
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
public get restrictions(): { [key: string]: IRestrictionApi; } {
|
|
53
|
-
return this.#restrictions;
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
public get showDistanceLabels(): boolean {
|
|
57
|
-
return this.#drawingToolsManager.showDistanceLabels;
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
public set showDistanceLabels(value: boolean) {
|
|
61
|
-
this.#drawingToolsManager.showDistanceLabels = value;
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
public get showPointLabels(): boolean {
|
|
65
|
-
return this.#drawingToolsManager.showPointLabels;
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
public set showPointLabels(value: boolean) {
|
|
69
|
-
this.#drawingToolsManager.showPointLabels = value;
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
// #endregion Public Getters And Setters (7)
|
|
73
|
-
|
|
74
|
-
// #region Public Methods (11)
|
|
75
|
-
|
|
76
|
-
public addPoint(index: number, position?: vec3 | undefined): void {
|
|
77
|
-
this.#drawingToolsManager.addPoint(index, position);
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
public addRestriction(properties: RestrictionProperties, incomingToken?: string): IRestrictionApi | undefined {
|
|
81
|
-
const token = this.#drawingToolsManager.addRestriction(properties, incomingToken);
|
|
82
|
-
if (!token) return;
|
|
83
|
-
|
|
84
|
-
if (this.#drawingToolsManager.restrictions[token] instanceof PlaneRestriction)
|
|
85
|
-
this.#restrictions[token] = new PlaneRestrictionApi(this.#drawingToolsManager.restrictions[token] as PlaneRestriction);
|
|
86
|
-
if (this.#drawingToolsManager.restrictions[token] instanceof GeometryRestriction)
|
|
87
|
-
this.#restrictions[token] = new GeometryRestrictionApi(this.#drawingToolsManager.restrictions[token] as GeometryRestriction);
|
|
88
|
-
|
|
89
|
-
return this.#restrictions[token];
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
public canRedo(): boolean {
|
|
93
|
-
return this.#drawingToolsManager.canRedo();
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
public canUndo(): boolean {
|
|
97
|
-
return this.#drawingToolsManager.canUndo();
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
public cancel(): void {
|
|
101
|
-
this.#drawingToolsManager.cancel();
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
public close(): void {
|
|
105
|
-
this.#drawingToolsManager.close();
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
public redo(): void {
|
|
109
|
-
this.#drawingToolsManager.redo();
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
public removePoint(index: number): void {
|
|
113
|
-
this.#drawingToolsManager.removePoint(index);
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
public removeRestriction(token: string): void {
|
|
117
|
-
this.#drawingToolsManager.removeRestriction(token);
|
|
118
|
-
delete this.#restrictions[token];
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
public undo(): void {
|
|
122
|
-
this.#drawingToolsManager.undo();
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
public update(): PointsData | undefined {
|
|
126
|
-
return this.#drawingToolsManager.update();
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
// #endregion Public Methods (11)
|
|
130
|
-
}
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import { IRestrictionApi } from '../../interfaces/IRestrictionApi';
|
|
2
|
-
import { IRestrictionBase } from '../../../business/interfaces/IRestrictionBase';
|
|
3
|
-
|
|
4
|
-
export abstract class AbstractRestrictionApi implements IRestrictionApi {
|
|
5
|
-
// #region Properties (1)
|
|
6
|
-
|
|
7
|
-
readonly #restriction: IRestrictionBase;
|
|
8
|
-
|
|
9
|
-
// #endregion Properties (1)
|
|
10
|
-
|
|
11
|
-
// #region Constructors (1)
|
|
12
|
-
|
|
13
|
-
constructor(restriction: IRestrictionBase) {
|
|
14
|
-
this.#restriction = restriction;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
// #endregion Constructors (1)
|
|
18
|
-
|
|
19
|
-
// #region Public Getters And Setters (5)
|
|
20
|
-
|
|
21
|
-
public get enabled(): boolean {
|
|
22
|
-
return this.#restriction.enabled;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
public set enabled(value: boolean) {
|
|
26
|
-
this.#restriction.enabled = value;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
public get id(): string {
|
|
30
|
-
return this.#restriction.id;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
// #endregion Public Getters And Setters (5)
|
|
34
|
-
}
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import { ISnapRestriction } from '../../../business/interfaces/ISnapRestriction';
|
|
2
|
-
import { ISnapRestrictionApi } from '../../interfaces/ISnapRestrictionApi';
|
|
3
|
-
import { AbstractRestrictionApi } from './AbstractRestrictionApi';
|
|
4
|
-
|
|
5
|
-
export abstract class AbstractSnapRestrictionApi extends AbstractRestrictionApi implements ISnapRestrictionApi {
|
|
6
|
-
// #region Properties (1)
|
|
7
|
-
|
|
8
|
-
readonly #restriction: ISnapRestriction;
|
|
9
|
-
|
|
10
|
-
// #endregion Properties (1)
|
|
11
|
-
|
|
12
|
-
// #region Constructors (1)
|
|
13
|
-
|
|
14
|
-
constructor(restriction: ISnapRestriction) {
|
|
15
|
-
super(restriction);
|
|
16
|
-
this.#restriction = restriction;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
// #endregion Constructors (1)
|
|
20
|
-
|
|
21
|
-
// #region Public Getters And Setters (3)
|
|
22
|
-
|
|
23
|
-
public get enabledEditable(): boolean {
|
|
24
|
-
return this.#restriction.enabledEditable;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
public get priority(): number {
|
|
28
|
-
return this.#restriction.priority;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
public set priority(value: number) {
|
|
32
|
-
this.#restriction.priority = value;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
// #endregion Public Getters And Setters (3)
|
|
36
|
-
}
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
import { AbstractRestrictionApi } from '../AbstractRestrictionApi';
|
|
2
|
-
import { GeometryRestriction } from '../../../../business/implementation/managers/interaction/restrictions/geometry/GeometryRestriction';
|
|
3
|
-
import { ITreeNode } from '@shapediver/viewer.shared.node-tree';
|
|
4
|
-
|
|
5
|
-
export class GeometryRestrictionApi extends AbstractRestrictionApi {
|
|
6
|
-
// #region Properties (1)
|
|
7
|
-
|
|
8
|
-
readonly #geometryRestriction: GeometryRestriction;
|
|
9
|
-
|
|
10
|
-
// #endregion Properties (1)
|
|
11
|
-
|
|
12
|
-
// #region Constructors (1)
|
|
13
|
-
|
|
14
|
-
constructor(restriction: GeometryRestriction) {
|
|
15
|
-
super(restriction);
|
|
16
|
-
this.#geometryRestriction = restriction;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
// #endregion Constructors (1)
|
|
20
|
-
|
|
21
|
-
// #region Public Getters And Setters (6)
|
|
22
|
-
|
|
23
|
-
public get snapToEdges(): boolean {
|
|
24
|
-
return this.#geometryRestriction.snapToEdges;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
public set snapToEdges(value: boolean) {
|
|
28
|
-
this.#geometryRestriction.snapToEdges = value;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
public get snapToFaces(): boolean {
|
|
32
|
-
return this.#geometryRestriction.snapToFaces;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
public set snapToFaces(value: boolean) {
|
|
36
|
-
this.#geometryRestriction.snapToFaces = value;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
public get snapToVertices(): boolean {
|
|
40
|
-
return this.#geometryRestriction.snapToVertices;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
public set snapToVertices(value: boolean) {
|
|
44
|
-
this.#geometryRestriction.snapToVertices = value;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
// #endregion Public Getters And Setters (6)
|
|
48
|
-
|
|
49
|
-
// #region Public Methods (1)
|
|
50
|
-
|
|
51
|
-
public updateNodes(nodes: ITreeNode[]): void {
|
|
52
|
-
this.#geometryRestriction.updateNodes(nodes);
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
// #endregion Public Methods (1)
|
|
56
|
-
}
|
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
import { AbstractRestrictionApi } from '../AbstractRestrictionApi';
|
|
2
|
-
import { AngularRestrictionApi } from './snap/AngularRestrictionApi';
|
|
3
|
-
import { AxisRestrictionApi } from './snap/AxisRestrictionApi';
|
|
4
|
-
import { GridRestrictionApi } from './snap/GridRestrictionApi';
|
|
5
|
-
import { PlaneRestriction } from '../../../../business/implementation/managers/interaction/restrictions/plane/PlaneRestriction';
|
|
6
|
-
import { vec3 } from 'gl-matrix';
|
|
7
|
-
|
|
8
|
-
export class PlaneRestrictionApi extends AbstractRestrictionApi {
|
|
9
|
-
// #region Properties (4)
|
|
10
|
-
|
|
11
|
-
readonly #angularRestrictionApi: AngularRestrictionApi;
|
|
12
|
-
readonly #axisRestrictionApi: AxisRestrictionApi;
|
|
13
|
-
readonly #gridRestrictionApi: GridRestrictionApi;
|
|
14
|
-
readonly #planeRestriction: PlaneRestriction;
|
|
15
|
-
|
|
16
|
-
// #endregion Properties (4)
|
|
17
|
-
|
|
18
|
-
// #region Constructors (1)
|
|
19
|
-
|
|
20
|
-
constructor(restriction: PlaneRestriction) {
|
|
21
|
-
super(restriction);
|
|
22
|
-
this.#planeRestriction = restriction;
|
|
23
|
-
|
|
24
|
-
this.#gridRestrictionApi = new GridRestrictionApi(restriction.gridRestriction);
|
|
25
|
-
this.#angularRestrictionApi = new AngularRestrictionApi(restriction.angularRestriction);
|
|
26
|
-
this.#axisRestrictionApi = new AxisRestrictionApi(restriction.axisRestriction);
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
// #endregion Constructors (1)
|
|
30
|
-
|
|
31
|
-
// #region Public Getters And Setters (9)
|
|
32
|
-
|
|
33
|
-
public get angularRestrictionApi(): AngularRestrictionApi {
|
|
34
|
-
return this.#angularRestrictionApi;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
public get axisRestrictionApi(): AxisRestrictionApi {
|
|
38
|
-
return this.#axisRestrictionApi;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
public get gridRestrictionApi(): GridRestrictionApi {
|
|
42
|
-
return this.#gridRestrictionApi;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
public get origin(): vec3 {
|
|
46
|
-
return this.#planeRestriction.origin;
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
public set origin(value: vec3) {
|
|
50
|
-
this.#planeRestriction.origin = value;
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
public get vectorU(): vec3 {
|
|
54
|
-
return this.#planeRestriction.vectorU;
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
public set vectorU(value: vec3) {
|
|
58
|
-
this.#planeRestriction.vectorU = value;
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
public get vectorV(): vec3 {
|
|
62
|
-
return this.#planeRestriction.vectorV;
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
public set vectorV(value: vec3) {
|
|
66
|
-
this.#planeRestriction.vectorV = value;
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
// #endregion Public Getters And Setters (9)
|
|
70
|
-
}
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import { AbstractSnapRestrictionApi } from '../../AbstractSnapRestrictionApi';
|
|
2
|
-
import { AngularRestriction } from '../../../../../business/implementation/managers/interaction/restrictions/plane/snap/AngularRestriction';
|
|
3
|
-
|
|
4
|
-
export class AngularRestrictionApi extends AbstractSnapRestrictionApi {
|
|
5
|
-
// #region Properties (1)
|
|
6
|
-
|
|
7
|
-
readonly #angularRestriction: AngularRestriction;
|
|
8
|
-
|
|
9
|
-
// #endregion Properties (1)
|
|
10
|
-
|
|
11
|
-
// #region Constructors (1)
|
|
12
|
-
|
|
13
|
-
constructor(restriction: AngularRestriction) {
|
|
14
|
-
super(restriction);
|
|
15
|
-
this.#angularRestriction = restriction;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
// #endregion Constructors (1)
|
|
19
|
-
|
|
20
|
-
// #region Public Getters And Setters (2)
|
|
21
|
-
|
|
22
|
-
public get angleStep(): number {
|
|
23
|
-
return this.#angularRestriction.angleStep;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
public set angleStep(value: number) {
|
|
27
|
-
this.#angularRestriction.angleStep = value;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
public get angleStepEditable(): boolean {
|
|
31
|
-
return this.#angularRestriction.angleStepEditable;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
// #endregion Public Getters And Setters (2)
|
|
35
|
-
}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { AbstractSnapRestrictionApi } from '../../AbstractSnapRestrictionApi';
|
|
2
|
-
import { AxisRestriction } from '../../../../../business/implementation/managers/interaction/restrictions/plane/snap/AxisRestriction';
|
|
3
|
-
|
|
4
|
-
export class AxisRestrictionApi extends AbstractSnapRestrictionApi {
|
|
5
|
-
// #region Properties (1)
|
|
6
|
-
|
|
7
|
-
readonly #axisRestriction: AxisRestriction;
|
|
8
|
-
|
|
9
|
-
// #endregion Properties (1)
|
|
10
|
-
|
|
11
|
-
// #region Constructors (1)
|
|
12
|
-
|
|
13
|
-
constructor(restriction: AxisRestriction) {
|
|
14
|
-
super(restriction);
|
|
15
|
-
this.#axisRestriction = restriction;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
// #endregion Constructors (1)
|
|
19
|
-
}
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import { AbstractSnapRestrictionApi } from '../../AbstractSnapRestrictionApi';
|
|
2
|
-
import { GridRestriction } from '../../../../../business/implementation/managers/interaction/restrictions/plane/snap/GridRestriction';
|
|
3
|
-
|
|
4
|
-
export class GridRestrictionApi extends AbstractSnapRestrictionApi {
|
|
5
|
-
// #region Properties (1)
|
|
6
|
-
|
|
7
|
-
readonly #gridRestriction: GridRestriction;
|
|
8
|
-
|
|
9
|
-
// #endregion Properties (1)
|
|
10
|
-
|
|
11
|
-
// #region Constructors (1)
|
|
12
|
-
|
|
13
|
-
constructor(restriction: GridRestriction) {
|
|
14
|
-
super(restriction);
|
|
15
|
-
this.#gridRestriction = restriction;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
// #endregion Constructors (1)
|
|
19
|
-
|
|
20
|
-
// #region Public Getters And Setters (2)
|
|
21
|
-
|
|
22
|
-
public get gridUnit(): number {
|
|
23
|
-
return this.#gridRestriction.gridUnit;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
public set gridUnit(value: number) {
|
|
27
|
-
this.#gridRestriction.gridUnit = value;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
public get gridUnitEditable(): boolean {
|
|
31
|
-
return this.#gridRestriction.gridUnitEditable;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
// #endregion Public Getters And Setters (2)
|
|
35
|
-
}
|
|
@@ -1,98 +0,0 @@
|
|
|
1
|
-
import { GeometryRestrictionProperties } from '../../business/implementation/managers/interaction/restrictions/geometry/GeometryRestriction';
|
|
2
|
-
import { IRestrictionApi } from './IRestrictionApi';
|
|
3
|
-
import { PlaneRestrictionProperties } from '../../business/implementation/managers/interaction/restrictions/plane/PlaneRestriction';
|
|
4
|
-
import { PointsData } from '../../business/interfaces/IDrawingToolsManager';
|
|
5
|
-
import { RestrictionProperties } from '../../business/interfaces/IRestriction';
|
|
6
|
-
import { vec3 } from 'gl-matrix';
|
|
7
|
-
|
|
8
|
-
export interface IDrawingToolsApi {
|
|
9
|
-
// #region Properties (5)
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* Check if the drawing tool is closed.
|
|
13
|
-
*/
|
|
14
|
-
readonly closed: boolean;
|
|
15
|
-
/**
|
|
16
|
-
* The points data of the drawing tool.
|
|
17
|
-
*/
|
|
18
|
-
readonly pointsData: PointsData;
|
|
19
|
-
/**
|
|
20
|
-
* The restrictions of the drawing tool.
|
|
21
|
-
*/
|
|
22
|
-
readonly restrictions: {
|
|
23
|
-
[key: string]: IRestrictionApi
|
|
24
|
-
};
|
|
25
|
-
|
|
26
|
-
/**
|
|
27
|
-
* Show the distance labels of the drawing tool.
|
|
28
|
-
*/
|
|
29
|
-
showDistanceLabels: boolean;
|
|
30
|
-
/**
|
|
31
|
-
* Show the point labels of the drawing tool.
|
|
32
|
-
*/
|
|
33
|
-
showPointLabels: boolean;
|
|
34
|
-
|
|
35
|
-
// #endregion Properties (5)
|
|
36
|
-
|
|
37
|
-
// #region Public Methods (11)
|
|
38
|
-
|
|
39
|
-
/**
|
|
40
|
-
* Add a point to the drawing tool.
|
|
41
|
-
*
|
|
42
|
-
* @param index The index of the point in the position array.
|
|
43
|
-
* @param position The position of the point.
|
|
44
|
-
*/
|
|
45
|
-
addPoint(index: number, position?: vec3 | undefined): void;
|
|
46
|
-
/**
|
|
47
|
-
* Add a ray tracing intersection restriction to the drawing tool.
|
|
48
|
-
*
|
|
49
|
-
* @param properties The properties of the restriction.
|
|
50
|
-
* @param token The token of the restriction.
|
|
51
|
-
* @returns The api of the restriction.
|
|
52
|
-
*/
|
|
53
|
-
addRestriction(properties: RestrictionProperties | PlaneRestrictionProperties | GeometryRestrictionProperties, token?: string): IRestrictionApi | undefined;
|
|
54
|
-
/**
|
|
55
|
-
* Check if the drawing tool can redo the last action.
|
|
56
|
-
*/
|
|
57
|
-
canRedo(): boolean;
|
|
58
|
-
/**
|
|
59
|
-
* Check if the drawing tool can undo the last action.
|
|
60
|
-
*/
|
|
61
|
-
canUndo(): boolean;
|
|
62
|
-
/**
|
|
63
|
-
* Cancel the drawing tool.
|
|
64
|
-
*/
|
|
65
|
-
cancel(): void;
|
|
66
|
-
/**
|
|
67
|
-
* Close the drawing tool.
|
|
68
|
-
*/
|
|
69
|
-
close(): void;
|
|
70
|
-
/**
|
|
71
|
-
* Redo the last action of the drawing tool.
|
|
72
|
-
*/
|
|
73
|
-
redo(): void;
|
|
74
|
-
/**
|
|
75
|
-
* Remove a point from the drawing tool.
|
|
76
|
-
*
|
|
77
|
-
* @param index The index of the point in the position array.
|
|
78
|
-
*/
|
|
79
|
-
removePoint(index: number): void;
|
|
80
|
-
/**
|
|
81
|
-
* Remove a restriction from the drawing tool.
|
|
82
|
-
*
|
|
83
|
-
* @param id
|
|
84
|
-
*/
|
|
85
|
-
removeRestriction(id: string): void;
|
|
86
|
-
/**
|
|
87
|
-
* Undo the last action of the drawing tool.
|
|
88
|
-
*/
|
|
89
|
-
undo(): void;
|
|
90
|
-
/**
|
|
91
|
-
* Receive an update of the drawing tool.
|
|
92
|
-
*
|
|
93
|
-
* @returns The points data of the drawing tool.
|
|
94
|
-
*/
|
|
95
|
-
update(): PointsData | undefined;
|
|
96
|
-
|
|
97
|
-
// #endregion Public Methods (11)
|
|
98
|
-
}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
export interface IRestrictionApi {
|
|
2
|
-
// #region Properties (2)
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* The unique identifier of the restriction.
|
|
6
|
-
*/
|
|
7
|
-
readonly id: string;
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* Whether the restriction is enabled or not.
|
|
11
|
-
*/
|
|
12
|
-
enabled: boolean;
|
|
13
|
-
|
|
14
|
-
// #endregion Properties (2)
|
|
15
|
-
}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { IRestrictionApi } from './IRestrictionApi';
|
|
2
|
-
|
|
3
|
-
export interface ISnapRestrictionApi extends IRestrictionApi {
|
|
4
|
-
// #region Properties (2)
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* If the enabling or disabling of the restriction is allowed to the end user.
|
|
8
|
-
* If it is not editable, the default value for enabling or disabling the restriction is used.
|
|
9
|
-
*/
|
|
10
|
-
readonly enabledEditable: boolean;
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* The priority of the restriction.
|
|
14
|
-
*/
|
|
15
|
-
priority: number;
|
|
16
|
-
|
|
17
|
-
// #endregion Properties (2)
|
|
18
|
-
}
|