@vived/app 4.2.0 → 4.4.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/lib/Components/Babylon/Mocks/MockSceneRayPickUC.d.ts +2 -0
- package/lib/Components/Babylon/Mocks/MockSceneRayPickUC.js +2 -2
- package/lib/Components/Dispatcher/UC/RestoreCurrentStateUC.d.ts +10 -0
- package/lib/Components/Dispatcher/UC/RestoreCurrentStateUC.js +35 -0
- package/lib/Components/Dispatcher/UC/index.d.ts +1 -0
- package/lib/Components/Dispatcher/UC/index.js +1 -0
- package/lib/Components/Landmarks/Controller/Mouse/MouseLandmark.d.ts +22 -0
- package/lib/Components/Landmarks/Controller/Mouse/MouseLandmark.js +91 -0
- package/lib/Components/Landmarks/Controller/MouseLandmark.d.ts +22 -0
- package/lib/Components/Landmarks/Controller/MouseLandmark.js +91 -0
- package/lib/Components/Landmarks/Controller/SetSelectedLandmarkColor.d.ts +3 -0
- package/lib/Components/Landmarks/Controller/SetSelectedLandmarkColor.js +24 -0
- package/lib/Components/Landmarks/Controller/SubmitLandmarkSize.d.ts +2 -0
- package/lib/Components/Landmarks/Controller/SubmitLandmarkSize.js +19 -0
- package/lib/Components/Landmarks/Controller/Touch/TouchLandmark.d.ts +20 -0
- package/lib/Components/Landmarks/Controller/Touch/TouchLandmark.js +84 -0
- package/lib/Components/Landmarks/Controller/TouchLandmark.d.ts +20 -0
- package/lib/Components/Landmarks/Controller/TouchLandmark.js +84 -0
- package/lib/Components/Landmarks/Controller/UpdateLandmarkSize.d.ts +2 -0
- package/lib/Components/Landmarks/Controller/UpdateLandmarkSize.js +19 -0
- package/lib/Components/Landmarks/Controller/index.d.ts +5 -0
- package/lib/Components/Landmarks/Controller/index.js +17 -0
- package/lib/Components/Landmarks/Entities/LandmarkEntity.d.ts +40 -0
- package/lib/Components/Landmarks/Entities/LandmarkEntity.js +111 -0
- package/lib/Components/Landmarks/Entities/LandmarkGlobals.d.ts +14 -0
- package/lib/Components/Landmarks/Entities/LandmarkGlobals.js +32 -0
- package/lib/Components/Landmarks/Entities/LandmarkRepo.d.ts +9 -0
- package/lib/Components/Landmarks/Entities/LandmarkRepo.js +33 -0
- package/lib/Components/Landmarks/Entities/index.d.ts +3 -0
- package/lib/Components/Landmarks/Entities/index.js +15 -0
- package/lib/Components/Landmarks/Mocks/MockLandmark.d.ts +27 -0
- package/lib/Components/Landmarks/Mocks/MockLandmark.js +50 -0
- package/lib/Components/Landmarks/PM/LandmarkListPM.d.ts +10 -0
- package/lib/Components/Landmarks/PM/LandmarkListPM.js +46 -0
- package/lib/Components/Landmarks/PM/LandmarkSizePM.d.ts +10 -0
- package/lib/Components/Landmarks/PM/LandmarkSizePM.js +44 -0
- package/lib/Components/Landmarks/PM/index.d.ts +2 -0
- package/lib/Components/Landmarks/PM/index.js +14 -0
- package/lib/Components/Landmarks/UseCases/AddLandmarkUC.d.ts +8 -0
- package/lib/Components/Landmarks/UseCases/AddLandmarkUC.js +67 -0
- package/lib/Components/Landmarks/UseCases/AddLandmarkUndoRedo.d.ts +13 -0
- package/lib/Components/Landmarks/UseCases/AddLandmarkUndoRedo.js +48 -0
- package/lib/Components/Landmarks/UseCases/DeleteLandmarkUC.d.ts +9 -0
- package/lib/Components/Landmarks/UseCases/DeleteLandmarkUC.js +48 -0
- package/lib/Components/Landmarks/UseCases/DeleteLandmarkUndoRedo.d.ts +13 -0
- package/lib/Components/Landmarks/UseCases/DeleteLandmarkUndoRedo.js +48 -0
- package/lib/Components/Landmarks/UseCases/SerializeLandmarks.d.ts +16 -0
- package/lib/Components/Landmarks/UseCases/SerializeLandmarks.js +108 -0
- package/lib/Components/Landmarks/UseCases/SetLandmarkSizeUC.d.ts +12 -0
- package/lib/Components/Landmarks/UseCases/SetLandmarkSizeUC.js +57 -0
- package/lib/Components/Landmarks/UseCases/SetLandmarkSizeUndoRedo.d.ts +11 -0
- package/lib/Components/Landmarks/UseCases/SetLandmarkSizeUndoRedo.js +37 -0
- package/lib/Components/Landmarks/UseCases/SetOverlayColorUC.d.ts +11 -0
- package/lib/Components/Landmarks/UseCases/SetOverlayColorUC.js +46 -0
- package/lib/Components/Landmarks/UseCases/SetOverlayColorUndoRedo.d.ts +12 -0
- package/lib/Components/Landmarks/UseCases/SetOverlayColorUndoRedo.js +37 -0
- package/lib/Components/Landmarks/UseCases/TryAddNewLandmarkUC.d.ts +9 -0
- package/lib/Components/Landmarks/UseCases/TryAddNewLandmarkUC.js +59 -0
- package/lib/Components/Landmarks/UseCases/TryPreviewLandmarkUC.d.ts +15 -0
- package/lib/Components/Landmarks/UseCases/TryPreviewLandmarkUC.js +63 -0
- package/lib/Components/Landmarks/UseCases/index.d.ts +11 -0
- package/lib/Components/Landmarks/UseCases/index.js +23 -0
- package/lib/Components/Landmarks/index.d.ts +4 -0
- package/lib/Components/Landmarks/index.js +16 -0
- package/lib/Components/OverlayColor/Entities/OverlayColor.d.ts +5 -5
- package/lib/Components/OverlayColor/Entities/OverlayColor.js +24 -24
- package/lib/Components/OverlayColor/PM/OverlayColorPM.d.ts +3 -3
- package/package.json +1 -1
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
/// <reference types="jest" />
|
|
2
|
+
import { AppObject } from "../../../AppObject";
|
|
2
3
|
import { SceneRayPickUC } from "../UC/SceneRayPickUC";
|
|
3
4
|
export declare class MockSceneRayPickUC extends SceneRayPickUC {
|
|
4
5
|
sceneRayPick: jest.Mock<any, any>;
|
|
6
|
+
constructor(appObject: AppObject);
|
|
5
7
|
}
|
|
@@ -3,8 +3,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.MockSceneRayPickUC = void 0;
|
|
4
4
|
const SceneRayPickUC_1 = require("../UC/SceneRayPickUC");
|
|
5
5
|
class MockSceneRayPickUC extends SceneRayPickUC_1.SceneRayPickUC {
|
|
6
|
-
constructor() {
|
|
7
|
-
super(
|
|
6
|
+
constructor(appObject) {
|
|
7
|
+
super(appObject, SceneRayPickUC_1.SceneRayPickUC.type);
|
|
8
8
|
this.sceneRayPick = jest.fn();
|
|
9
9
|
}
|
|
10
10
|
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { AppObject } from "../../../AppObject/AppObject";
|
|
2
|
+
import { AppObjectRepo } from "../../../AppObject/AppObjectRepo";
|
|
3
|
+
import { AppObjectUC } from "../../../AppObject/AppObjectUC";
|
|
4
|
+
export declare abstract class RestoreCurrentStateUC extends AppObjectUC {
|
|
5
|
+
static readonly type = "RestoreCurrentStateUC";
|
|
6
|
+
readonly requestType = "RESTORE_CURRENT_STATE";
|
|
7
|
+
abstract doDispatch(): void;
|
|
8
|
+
static get: (appObjects: AppObjectRepo) => RestoreCurrentStateUC | undefined;
|
|
9
|
+
}
|
|
10
|
+
export declare function makeRestoreCurrentStateUC(appObject: AppObject): RestoreCurrentStateUC;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.makeRestoreCurrentStateUC = exports.RestoreCurrentStateUC = void 0;
|
|
4
|
+
const AppObject_1 = require("../../../AppObject");
|
|
5
|
+
const AppObjectUC_1 = require("../../../AppObject/AppObjectUC");
|
|
6
|
+
const AppDispatcher_1 = require("../Entities/AppDispatcher");
|
|
7
|
+
class RestoreCurrentStateUC extends AppObjectUC_1.AppObjectUC {
|
|
8
|
+
constructor() {
|
|
9
|
+
super(...arguments);
|
|
10
|
+
this.requestType = "RESTORE_CURRENT_STATE";
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
exports.RestoreCurrentStateUC = RestoreCurrentStateUC;
|
|
14
|
+
RestoreCurrentStateUC.type = "RestoreCurrentStateUC";
|
|
15
|
+
RestoreCurrentStateUC.get = (appObjects) => AppObject_1.getSingletonComponent(RestoreCurrentStateUC.type, appObjects);
|
|
16
|
+
function makeRestoreCurrentStateUC(appObject) {
|
|
17
|
+
return new DispatchStateChangeUCImp(appObject);
|
|
18
|
+
}
|
|
19
|
+
exports.makeRestoreCurrentStateUC = makeRestoreCurrentStateUC;
|
|
20
|
+
class DispatchStateChangeUCImp extends RestoreCurrentStateUC {
|
|
21
|
+
constructor(appObject) {
|
|
22
|
+
super(appObject, RestoreCurrentStateUC.type);
|
|
23
|
+
this.requestVersion = 1;
|
|
24
|
+
this.appDispatcher = appObject.getComponent(AppDispatcher_1.AppDispatcher.type);
|
|
25
|
+
if (!this.appDispatcher) {
|
|
26
|
+
this.warn("RestoreCurrentStateUC has been added to an App Object that does not have a AppDispatcher. Add a dispatcher first");
|
|
27
|
+
this.dispose();
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
doDispatch() {
|
|
31
|
+
if (!this.appDispatcher)
|
|
32
|
+
return;
|
|
33
|
+
this.appDispatcher.formRequestAndDispatch(this.requestType, this.requestVersion);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
@@ -35,3 +35,4 @@ __exportStar(require("./ShowSpinnerUC"), exports);
|
|
|
35
35
|
__exportStar(require("./StateHasChangedUC"), exports);
|
|
36
36
|
__exportStar(require("./StateIsCompleteUC"), exports);
|
|
37
37
|
__exportStar(require("./SubmitResultResultUC"), exports);
|
|
38
|
+
__exportStar(require("./RestoreCurrentStateUC"), exports);
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { AppObject, AppObjectController } from "../../../../AppObject";
|
|
2
|
+
import { MouseController, MouseInputEvent } from "../../../MouseInput";
|
|
3
|
+
export declare abstract class MouseLandmark extends AppObjectController implements MouseController {
|
|
4
|
+
static type: string;
|
|
5
|
+
addingLandmark: boolean;
|
|
6
|
+
pressed: boolean;
|
|
7
|
+
abstract onMove: (e: MouseInputEvent) => void;
|
|
8
|
+
abstract onDown: (e: MouseInputEvent) => void;
|
|
9
|
+
}
|
|
10
|
+
export declare function makeMouseLandmark(appObject: AppObject): MouseLandmarkImp;
|
|
11
|
+
declare class MouseLandmarkImp extends MouseLandmark {
|
|
12
|
+
addingLandmark: boolean;
|
|
13
|
+
pressed: boolean;
|
|
14
|
+
private tryPreviewLandmarkUc?;
|
|
15
|
+
private tryAddLandmarkUc?;
|
|
16
|
+
allow: (e: MouseInputEvent) => boolean;
|
|
17
|
+
onMove: (e: MouseInputEvent) => void;
|
|
18
|
+
onDown: (e: MouseInputEvent) => void;
|
|
19
|
+
onUp: (e: MouseInputEvent) => void;
|
|
20
|
+
constructor(appObject: AppObject);
|
|
21
|
+
}
|
|
22
|
+
export {};
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.makeMouseLandmark = exports.MouseLandmark = void 0;
|
|
4
|
+
const AppObject_1 = require("../../../../AppObject");
|
|
5
|
+
const Babylon_1 = require("../../../Babylon");
|
|
6
|
+
const MouseInput_1 = require("../../../MouseInput");
|
|
7
|
+
const LandmarkGlobals_1 = require("../../Entities/LandmarkGlobals");
|
|
8
|
+
const TryAddNewLandmarkUC_1 = require("../../UseCases/TryAddNewLandmarkUC");
|
|
9
|
+
const TryPreviewLandmarkUC_1 = require("../../UseCases/TryPreviewLandmarkUC");
|
|
10
|
+
class MouseLandmark extends AppObject_1.AppObjectController {
|
|
11
|
+
constructor() {
|
|
12
|
+
super(...arguments);
|
|
13
|
+
this.addingLandmark = false;
|
|
14
|
+
this.pressed = false;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
exports.MouseLandmark = MouseLandmark;
|
|
18
|
+
MouseLandmark.type = "Mouse_Landmark_Controller";
|
|
19
|
+
function makeMouseLandmark(appObject) {
|
|
20
|
+
return new MouseLandmarkImp(appObject);
|
|
21
|
+
}
|
|
22
|
+
exports.makeMouseLandmark = makeMouseLandmark;
|
|
23
|
+
class MouseLandmarkImp extends MouseLandmark {
|
|
24
|
+
constructor(appObject) {
|
|
25
|
+
super(appObject, MouseLandmark.type);
|
|
26
|
+
this.addingLandmark = false;
|
|
27
|
+
this.pressed = false;
|
|
28
|
+
this.allow = (e) => {
|
|
29
|
+
return true;
|
|
30
|
+
};
|
|
31
|
+
this.onMove = (e) => {
|
|
32
|
+
if (!this.allow(e))
|
|
33
|
+
return;
|
|
34
|
+
if (!this.tryPreviewLandmarkUc) {
|
|
35
|
+
return;
|
|
36
|
+
}
|
|
37
|
+
const ray = Babylon_1.pixelToSceneRay(e.position, this.appObjects);
|
|
38
|
+
this.tryPreviewLandmarkUc.tryPreviewLandmark(ray, this.pressed);
|
|
39
|
+
};
|
|
40
|
+
this.onDown = (e) => {
|
|
41
|
+
this.addingLandmark = false;
|
|
42
|
+
if (e.button !== 0)
|
|
43
|
+
return;
|
|
44
|
+
if (!this.allow(e))
|
|
45
|
+
return;
|
|
46
|
+
if (!this.tryPreviewLandmarkUc) {
|
|
47
|
+
return;
|
|
48
|
+
}
|
|
49
|
+
const ray = Babylon_1.pixelToSceneRay(e.position, this.appObjects);
|
|
50
|
+
const pressed = true;
|
|
51
|
+
this.tryPreviewLandmarkUc.tryPreviewLandmark(ray, pressed);
|
|
52
|
+
this.addingLandmark = true;
|
|
53
|
+
this.pressed = true;
|
|
54
|
+
};
|
|
55
|
+
this.onUp = (e) => {
|
|
56
|
+
var _a;
|
|
57
|
+
if (!this.allow(e))
|
|
58
|
+
return;
|
|
59
|
+
if (!this.addingLandmark)
|
|
60
|
+
return;
|
|
61
|
+
if (!this.tryAddLandmarkUc)
|
|
62
|
+
return;
|
|
63
|
+
const landmarkPreview = (_a = this.appObject.getComponent(LandmarkGlobals_1.LandmarkGlobals.type)) === null || _a === void 0 ? void 0 : _a.previewLandmark;
|
|
64
|
+
if (!landmarkPreview) {
|
|
65
|
+
return;
|
|
66
|
+
}
|
|
67
|
+
const ray = Babylon_1.pixelToSceneRay(e.position, this.appObjects);
|
|
68
|
+
this.tryAddLandmarkUc.addFromRay(ray);
|
|
69
|
+
landmarkPreview.hideable.isHidden = true;
|
|
70
|
+
this.addingLandmark = false;
|
|
71
|
+
this.pressed = false;
|
|
72
|
+
};
|
|
73
|
+
this.tryPreviewLandmarkUc = TryPreviewLandmarkUC_1.TryPreviewLandmarkUC.get(appObject);
|
|
74
|
+
if (!this.tryPreviewLandmarkUc) {
|
|
75
|
+
this.warn("Unable to find TryPreviewLandmarkUC");
|
|
76
|
+
return;
|
|
77
|
+
}
|
|
78
|
+
this.tryAddLandmarkUc = TryAddNewLandmarkUC_1.TryAddNewLandmarkUC.get(appObject);
|
|
79
|
+
if (!this.tryAddLandmarkUc) {
|
|
80
|
+
this.warn("Unable to find TryAddNewLandmarkUC");
|
|
81
|
+
return;
|
|
82
|
+
}
|
|
83
|
+
const mouseInput = MouseInput_1.MouseInputEntity.get(this.appObjects);
|
|
84
|
+
if (mouseInput) {
|
|
85
|
+
mouseInput.registerController(this);
|
|
86
|
+
}
|
|
87
|
+
else {
|
|
88
|
+
this.warn("Unable to find MouseInputEntity");
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { AppObject, AppObjectController } from "../../../AppObject";
|
|
2
|
+
import { MouseController, MouseInputEvent } from "../../MouseInput";
|
|
3
|
+
export declare abstract class MouseLandmark extends AppObjectController implements MouseController {
|
|
4
|
+
static type: string;
|
|
5
|
+
addingLandmark: boolean;
|
|
6
|
+
pressed: boolean;
|
|
7
|
+
abstract onMove: (e: MouseInputEvent) => void;
|
|
8
|
+
abstract onDown: (e: MouseInputEvent) => void;
|
|
9
|
+
}
|
|
10
|
+
export declare function makeMouseLandmark(appObject: AppObject): MouseLandmarkImp;
|
|
11
|
+
declare class MouseLandmarkImp extends MouseLandmark {
|
|
12
|
+
addingLandmark: boolean;
|
|
13
|
+
pressed: boolean;
|
|
14
|
+
private tryPreviewLandmarkUc?;
|
|
15
|
+
private tryAddLandmarkUc?;
|
|
16
|
+
allow: (e: MouseInputEvent) => boolean;
|
|
17
|
+
onMove: (e: MouseInputEvent) => void;
|
|
18
|
+
onDown: (e: MouseInputEvent) => void;
|
|
19
|
+
onUp: (e: MouseInputEvent) => void;
|
|
20
|
+
constructor(appObject: AppObject);
|
|
21
|
+
}
|
|
22
|
+
export {};
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.makeMouseLandmark = exports.MouseLandmark = void 0;
|
|
4
|
+
const AppObject_1 = require("../../../AppObject");
|
|
5
|
+
const Babylon_1 = require("../../Babylon");
|
|
6
|
+
const MouseInput_1 = require("../../MouseInput");
|
|
7
|
+
const LandmarkGlobals_1 = require("../Entities/LandmarkGlobals");
|
|
8
|
+
const TryAddNewLandmarkUC_1 = require("../UseCases/TryAddNewLandmarkUC");
|
|
9
|
+
const TryPreviewLandmarkUC_1 = require("../UseCases/TryPreviewLandmarkUC");
|
|
10
|
+
class MouseLandmark extends AppObject_1.AppObjectController {
|
|
11
|
+
constructor() {
|
|
12
|
+
super(...arguments);
|
|
13
|
+
this.addingLandmark = false;
|
|
14
|
+
this.pressed = false;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
exports.MouseLandmark = MouseLandmark;
|
|
18
|
+
MouseLandmark.type = "Mouse_Landmark_Controller";
|
|
19
|
+
function makeMouseLandmark(appObject) {
|
|
20
|
+
return new MouseLandmarkImp(appObject);
|
|
21
|
+
}
|
|
22
|
+
exports.makeMouseLandmark = makeMouseLandmark;
|
|
23
|
+
class MouseLandmarkImp extends MouseLandmark {
|
|
24
|
+
constructor(appObject) {
|
|
25
|
+
super(appObject, MouseLandmark.type);
|
|
26
|
+
this.addingLandmark = false;
|
|
27
|
+
this.pressed = false;
|
|
28
|
+
this.allow = (e) => {
|
|
29
|
+
return true;
|
|
30
|
+
};
|
|
31
|
+
this.onMove = (e) => {
|
|
32
|
+
if (!this.allow(e))
|
|
33
|
+
return;
|
|
34
|
+
if (!this.tryPreviewLandmarkUc) {
|
|
35
|
+
return;
|
|
36
|
+
}
|
|
37
|
+
const ray = Babylon_1.pixelToSceneRay(e.position, this.appObjects);
|
|
38
|
+
this.tryPreviewLandmarkUc.tryPreviewLandmark(ray, this.pressed);
|
|
39
|
+
};
|
|
40
|
+
this.onDown = (e) => {
|
|
41
|
+
this.addingLandmark = false;
|
|
42
|
+
if (e.button !== 0)
|
|
43
|
+
return;
|
|
44
|
+
if (!this.allow(e))
|
|
45
|
+
return;
|
|
46
|
+
if (!this.tryPreviewLandmarkUc) {
|
|
47
|
+
return;
|
|
48
|
+
}
|
|
49
|
+
const ray = Babylon_1.pixelToSceneRay(e.position, this.appObjects);
|
|
50
|
+
const pressed = true;
|
|
51
|
+
this.tryPreviewLandmarkUc.tryPreviewLandmark(ray, pressed);
|
|
52
|
+
this.addingLandmark = true;
|
|
53
|
+
this.pressed = true;
|
|
54
|
+
};
|
|
55
|
+
this.onUp = (e) => {
|
|
56
|
+
var _a;
|
|
57
|
+
if (!this.allow(e))
|
|
58
|
+
return;
|
|
59
|
+
if (!this.addingLandmark)
|
|
60
|
+
return;
|
|
61
|
+
if (!this.tryAddLandmarkUc)
|
|
62
|
+
return;
|
|
63
|
+
const landmarkPreview = (_a = this.appObject.getComponent(LandmarkGlobals_1.LandmarkGlobals.type)) === null || _a === void 0 ? void 0 : _a.previewLandmark;
|
|
64
|
+
if (!landmarkPreview) {
|
|
65
|
+
return;
|
|
66
|
+
}
|
|
67
|
+
const ray = Babylon_1.pixelToSceneRay(e.position, this.appObjects);
|
|
68
|
+
this.tryAddLandmarkUc.addFromRay(ray);
|
|
69
|
+
landmarkPreview.hideable.isHidden = true;
|
|
70
|
+
this.addingLandmark = false;
|
|
71
|
+
this.pressed = false;
|
|
72
|
+
};
|
|
73
|
+
this.tryPreviewLandmarkUc = TryPreviewLandmarkUC_1.TryPreviewLandmarkUC.get(appObject);
|
|
74
|
+
if (!this.tryPreviewLandmarkUc) {
|
|
75
|
+
this.warn("Unable to find TryPreviewLandmarkUC");
|
|
76
|
+
return;
|
|
77
|
+
}
|
|
78
|
+
this.tryAddLandmarkUc = TryAddNewLandmarkUC_1.TryAddNewLandmarkUC.get(appObject);
|
|
79
|
+
if (!this.tryAddLandmarkUc) {
|
|
80
|
+
this.warn("Unable to find TryAddNewLandmarkUC");
|
|
81
|
+
return;
|
|
82
|
+
}
|
|
83
|
+
const mouseInput = MouseInput_1.MouseInputEntity.get(this.appObjects);
|
|
84
|
+
if (mouseInput) {
|
|
85
|
+
mouseInput.registerController(this);
|
|
86
|
+
}
|
|
87
|
+
else {
|
|
88
|
+
this.warn("Unable to find MouseInputEntity");
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.setSelectedLandmarkColor = void 0;
|
|
4
|
+
const Selection_1 = require("../../Selection");
|
|
5
|
+
const SetOverlayColorUC_1 = require("../UseCases/SetOverlayColorUC");
|
|
6
|
+
function setSelectedLandmarkColor(color, appObjects) {
|
|
7
|
+
const selection = appObjects.getSingleton(Selection_1.Selection.type);
|
|
8
|
+
if (!selection) {
|
|
9
|
+
appObjects.submitWarning("SetSelectedLandmarkColorController", "Selection App Object was not added.");
|
|
10
|
+
return;
|
|
11
|
+
}
|
|
12
|
+
const selectedObjectID = selection.selectedObjectId;
|
|
13
|
+
if (!selectedObjectID) {
|
|
14
|
+
appObjects.submitWarning("SetSelectedLandmarkColorController", "There is no selected object.");
|
|
15
|
+
return;
|
|
16
|
+
}
|
|
17
|
+
const setOverlayColorUC = appObjects.getAppObjectComponent(selectedObjectID, SetOverlayColorUC_1.SetOverlayColorUC.type);
|
|
18
|
+
if (!setOverlayColorUC) {
|
|
19
|
+
appObjects.submitWarning("SetSelectedLandmarkColorController", "SetOverlayColorUC App Object was not added.");
|
|
20
|
+
return;
|
|
21
|
+
}
|
|
22
|
+
setOverlayColorUC.setOverlayColor(color);
|
|
23
|
+
}
|
|
24
|
+
exports.setSelectedLandmarkColor = setSelectedLandmarkColor;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.submitLandmarkSize = void 0;
|
|
4
|
+
const LandmarkEntity_1 = require("../Entities/LandmarkEntity");
|
|
5
|
+
const SetLandmarkSizeUC_1 = require("../UseCases/SetLandmarkSizeUC");
|
|
6
|
+
function submitLandmarkSize(size, appObjectId, appObjects) {
|
|
7
|
+
const landmarkEntity = appObjects.getAppObjectComponent(appObjectId, LandmarkEntity_1.LandmarkEntity.type);
|
|
8
|
+
if (!landmarkEntity) {
|
|
9
|
+
appObjects.submitWarning("SubmitLandmarkSizeController", "LandmarkEntity App Object was not added.");
|
|
10
|
+
return;
|
|
11
|
+
}
|
|
12
|
+
const setLandmarkSizeUC = appObjects.getAppObjectComponent(appObjectId, SetLandmarkSizeUC_1.SetLandmarkSizeUC.type);
|
|
13
|
+
if (!setLandmarkSizeUC) {
|
|
14
|
+
appObjects.submitWarning("SubmitLandmarkSizeController", "SetLandmarkSizeUC App Object was not added.");
|
|
15
|
+
return;
|
|
16
|
+
}
|
|
17
|
+
setLandmarkSizeUC.submitSize(size);
|
|
18
|
+
}
|
|
19
|
+
exports.submitLandmarkSize = submitLandmarkSize;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { AppObject, AppObjectController } from "../../../../AppObject";
|
|
2
|
+
import { TouchController, TouchInputEvent } from "../../../TouchController";
|
|
3
|
+
export declare abstract class TouchLandmark extends AppObjectController implements TouchController {
|
|
4
|
+
static type: string;
|
|
5
|
+
abstract onTouchStart(e: TouchInputEvent): void;
|
|
6
|
+
abstract onTouchMove(e: TouchInputEvent): void;
|
|
7
|
+
abstract onTouchEnd(e: TouchInputEvent): void;
|
|
8
|
+
}
|
|
9
|
+
export declare function makeTouchLandmark(appObject: AppObject): TouchLandmarkImp;
|
|
10
|
+
declare class TouchLandmarkImp extends TouchLandmark {
|
|
11
|
+
private lastTouch;
|
|
12
|
+
private tryPreviewLandmarkUc?;
|
|
13
|
+
private tryAddLandmarkUc?;
|
|
14
|
+
allow: (e: TouchInputEvent) => boolean;
|
|
15
|
+
onTouchStart: (e: TouchInputEvent) => void;
|
|
16
|
+
onTouchMove: (e: TouchInputEvent) => void;
|
|
17
|
+
onTouchEnd: (e: TouchInputEvent) => void;
|
|
18
|
+
constructor(appObject: AppObject);
|
|
19
|
+
}
|
|
20
|
+
export {};
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.makeTouchLandmark = exports.TouchLandmark = void 0;
|
|
4
|
+
const AppObject_1 = require("../../../../AppObject");
|
|
5
|
+
const ValueObjects_1 = require("../../../../ValueObjects");
|
|
6
|
+
const Babylon_1 = require("../../../Babylon");
|
|
7
|
+
const TouchController_1 = require("../../../TouchController");
|
|
8
|
+
const LandmarkGlobals_1 = require("../../Entities/LandmarkGlobals");
|
|
9
|
+
const TryAddNewLandmarkUC_1 = require("../../UseCases/TryAddNewLandmarkUC");
|
|
10
|
+
const TryPreviewLandmarkUC_1 = require("../../UseCases/TryPreviewLandmarkUC");
|
|
11
|
+
class TouchLandmark extends AppObject_1.AppObjectController {
|
|
12
|
+
}
|
|
13
|
+
exports.TouchLandmark = TouchLandmark;
|
|
14
|
+
TouchLandmark.type = "TOUCH_LANDMARK_CONTROLLER";
|
|
15
|
+
function makeTouchLandmark(appObject) {
|
|
16
|
+
return new TouchLandmarkImp(appObject);
|
|
17
|
+
}
|
|
18
|
+
exports.makeTouchLandmark = makeTouchLandmark;
|
|
19
|
+
class TouchLandmarkImp extends TouchLandmark {
|
|
20
|
+
constructor(appObject) {
|
|
21
|
+
super(appObject, TouchLandmark.type);
|
|
22
|
+
this.lastTouch = ValueObjects_1.Vector2.Zero();
|
|
23
|
+
this.allow = (e) => {
|
|
24
|
+
return true;
|
|
25
|
+
};
|
|
26
|
+
this.onTouchStart = (e) => {
|
|
27
|
+
if (!this.allow(e))
|
|
28
|
+
return;
|
|
29
|
+
if (e.touchCount > 1)
|
|
30
|
+
return;
|
|
31
|
+
if (!this.tryPreviewLandmarkUc)
|
|
32
|
+
return;
|
|
33
|
+
const position = e.touches[0].position;
|
|
34
|
+
this.lastTouch = position;
|
|
35
|
+
const ray = Babylon_1.pixelToSceneRay(position, this.appObjects);
|
|
36
|
+
this.tryPreviewLandmarkUc.tryPreviewLandmark(ray, true);
|
|
37
|
+
};
|
|
38
|
+
this.onTouchMove = (e) => {
|
|
39
|
+
if (!this.allow(e))
|
|
40
|
+
return;
|
|
41
|
+
if (e.touchCount > 1)
|
|
42
|
+
return;
|
|
43
|
+
if (!this.tryPreviewLandmarkUc)
|
|
44
|
+
return;
|
|
45
|
+
const position = e.touches[0].position;
|
|
46
|
+
this.lastTouch = position;
|
|
47
|
+
const ray = Babylon_1.pixelToSceneRay(position, this.appObjects);
|
|
48
|
+
this.tryPreviewLandmarkUc.tryPreviewLandmark(ray, true);
|
|
49
|
+
};
|
|
50
|
+
this.onTouchEnd = (e) => {
|
|
51
|
+
var _a;
|
|
52
|
+
if (!this.allow(e))
|
|
53
|
+
return;
|
|
54
|
+
if (e.touchCount > 1)
|
|
55
|
+
return;
|
|
56
|
+
if (!this.tryAddLandmarkUc)
|
|
57
|
+
return;
|
|
58
|
+
const landmarkPreview = (_a = this.appObject.getComponent(LandmarkGlobals_1.LandmarkGlobals.type)) === null || _a === void 0 ? void 0 : _a.previewLandmark;
|
|
59
|
+
if (!landmarkPreview) {
|
|
60
|
+
return;
|
|
61
|
+
}
|
|
62
|
+
const ray = Babylon_1.pixelToSceneRay(this.lastTouch, this.appObjects);
|
|
63
|
+
this.tryAddLandmarkUc.addFromRay(ray);
|
|
64
|
+
landmarkPreview.hideable.isHidden = true;
|
|
65
|
+
};
|
|
66
|
+
this.tryPreviewLandmarkUc = TryPreviewLandmarkUC_1.TryPreviewLandmarkUC.get(appObject);
|
|
67
|
+
if (!this.tryPreviewLandmarkUc) {
|
|
68
|
+
this.warn("Unable to find TryPreviewLandmarkUC");
|
|
69
|
+
return;
|
|
70
|
+
}
|
|
71
|
+
this.tryAddLandmarkUc = TryAddNewLandmarkUC_1.TryAddNewLandmarkUC.get(appObject);
|
|
72
|
+
if (!this.tryAddLandmarkUc) {
|
|
73
|
+
this.warn("Unable to find TryAddNewLandmarkUC");
|
|
74
|
+
return;
|
|
75
|
+
}
|
|
76
|
+
const touchInput = TouchController_1.TouchInputEntity.get(this.appObjects);
|
|
77
|
+
if (touchInput) {
|
|
78
|
+
touchInput.registerController(this);
|
|
79
|
+
}
|
|
80
|
+
else {
|
|
81
|
+
this.warn("Unable to find TouchInputEntity");
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { AppObject, AppObjectController } from "../../../AppObject";
|
|
2
|
+
import { TouchController, TouchInputEvent } from "../../TouchController";
|
|
3
|
+
export declare abstract class TouchLandmark extends AppObjectController implements TouchController {
|
|
4
|
+
static type: string;
|
|
5
|
+
abstract onTouchStart(e: TouchInputEvent): void;
|
|
6
|
+
abstract onTouchMove(e: TouchInputEvent): void;
|
|
7
|
+
abstract onTouchEnd(e: TouchInputEvent): void;
|
|
8
|
+
}
|
|
9
|
+
export declare function makeTouchLandmark(appObject: AppObject): TouchLandmarkImp;
|
|
10
|
+
declare class TouchLandmarkImp extends TouchLandmark {
|
|
11
|
+
private lastTouch;
|
|
12
|
+
private tryPreviewLandmarkUc?;
|
|
13
|
+
private tryAddLandmarkUc?;
|
|
14
|
+
allow: (e: TouchInputEvent) => boolean;
|
|
15
|
+
onTouchStart: (e: TouchInputEvent) => void;
|
|
16
|
+
onTouchMove: (e: TouchInputEvent) => void;
|
|
17
|
+
onTouchEnd: (e: TouchInputEvent) => void;
|
|
18
|
+
constructor(appObject: AppObject);
|
|
19
|
+
}
|
|
20
|
+
export {};
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.makeTouchLandmark = exports.TouchLandmark = void 0;
|
|
4
|
+
const AppObject_1 = require("../../../AppObject");
|
|
5
|
+
const ValueObjects_1 = require("../../../ValueObjects");
|
|
6
|
+
const Babylon_1 = require("../../Babylon");
|
|
7
|
+
const TouchController_1 = require("../../TouchController");
|
|
8
|
+
const LandmarkGlobals_1 = require("../Entities/LandmarkGlobals");
|
|
9
|
+
const TryAddNewLandmarkUC_1 = require("../UseCases/TryAddNewLandmarkUC");
|
|
10
|
+
const TryPreviewLandmarkUC_1 = require("../UseCases/TryPreviewLandmarkUC");
|
|
11
|
+
class TouchLandmark extends AppObject_1.AppObjectController {
|
|
12
|
+
}
|
|
13
|
+
exports.TouchLandmark = TouchLandmark;
|
|
14
|
+
TouchLandmark.type = "TOUCH_LANDMARK_CONTROLLER";
|
|
15
|
+
function makeTouchLandmark(appObject) {
|
|
16
|
+
return new TouchLandmarkImp(appObject);
|
|
17
|
+
}
|
|
18
|
+
exports.makeTouchLandmark = makeTouchLandmark;
|
|
19
|
+
class TouchLandmarkImp extends TouchLandmark {
|
|
20
|
+
constructor(appObject) {
|
|
21
|
+
super(appObject, TouchLandmark.type);
|
|
22
|
+
this.lastTouch = ValueObjects_1.Vector2.Zero();
|
|
23
|
+
this.allow = (e) => {
|
|
24
|
+
return true;
|
|
25
|
+
};
|
|
26
|
+
this.onTouchStart = (e) => {
|
|
27
|
+
if (!this.allow(e))
|
|
28
|
+
return;
|
|
29
|
+
if (e.touchCount > 1)
|
|
30
|
+
return;
|
|
31
|
+
if (!this.tryPreviewLandmarkUc)
|
|
32
|
+
return;
|
|
33
|
+
const position = e.touches[0].position;
|
|
34
|
+
this.lastTouch = position;
|
|
35
|
+
const ray = Babylon_1.pixelToSceneRay(position, this.appObjects);
|
|
36
|
+
this.tryPreviewLandmarkUc.tryPreviewLandmark(ray, true);
|
|
37
|
+
};
|
|
38
|
+
this.onTouchMove = (e) => {
|
|
39
|
+
if (!this.allow(e))
|
|
40
|
+
return;
|
|
41
|
+
if (e.touchCount > 1)
|
|
42
|
+
return;
|
|
43
|
+
if (!this.tryPreviewLandmarkUc)
|
|
44
|
+
return;
|
|
45
|
+
const position = e.touches[0].position;
|
|
46
|
+
this.lastTouch = position;
|
|
47
|
+
const ray = Babylon_1.pixelToSceneRay(position, this.appObjects);
|
|
48
|
+
this.tryPreviewLandmarkUc.tryPreviewLandmark(ray, true);
|
|
49
|
+
};
|
|
50
|
+
this.onTouchEnd = (e) => {
|
|
51
|
+
var _a;
|
|
52
|
+
if (!this.allow(e))
|
|
53
|
+
return;
|
|
54
|
+
if (e.touchCount > 1)
|
|
55
|
+
return;
|
|
56
|
+
if (!this.tryAddLandmarkUc)
|
|
57
|
+
return;
|
|
58
|
+
const landmarkPreview = (_a = this.appObject.getComponent(LandmarkGlobals_1.LandmarkGlobals.type)) === null || _a === void 0 ? void 0 : _a.previewLandmark;
|
|
59
|
+
if (!landmarkPreview) {
|
|
60
|
+
return;
|
|
61
|
+
}
|
|
62
|
+
const ray = Babylon_1.pixelToSceneRay(this.lastTouch, this.appObjects);
|
|
63
|
+
this.tryAddLandmarkUc.addFromRay(ray);
|
|
64
|
+
landmarkPreview.hideable.isHidden = true;
|
|
65
|
+
};
|
|
66
|
+
this.tryPreviewLandmarkUc = TryPreviewLandmarkUC_1.TryPreviewLandmarkUC.get(appObject);
|
|
67
|
+
if (!this.tryPreviewLandmarkUc) {
|
|
68
|
+
this.warn("Unable to find TryPreviewLandmarkUC");
|
|
69
|
+
return;
|
|
70
|
+
}
|
|
71
|
+
this.tryAddLandmarkUc = TryAddNewLandmarkUC_1.TryAddNewLandmarkUC.get(appObject);
|
|
72
|
+
if (!this.tryAddLandmarkUc) {
|
|
73
|
+
this.warn("Unable to find TryAddNewLandmarkUC");
|
|
74
|
+
return;
|
|
75
|
+
}
|
|
76
|
+
const touchInput = TouchController_1.TouchInputEntity.get(this.appObjects);
|
|
77
|
+
if (touchInput) {
|
|
78
|
+
touchInput.registerController(this);
|
|
79
|
+
}
|
|
80
|
+
else {
|
|
81
|
+
this.warn("Unable to find TouchInputEntity");
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.updateLandmarkSize = void 0;
|
|
4
|
+
const LandmarkEntity_1 = require("../Entities/LandmarkEntity");
|
|
5
|
+
const SetLandmarkSizeUC_1 = require("../UseCases/SetLandmarkSizeUC");
|
|
6
|
+
function updateLandmarkSize(size, appObjectId, appObjects) {
|
|
7
|
+
const landmarkEntity = appObjects.getAppObjectComponent(appObjectId, LandmarkEntity_1.LandmarkEntity.type);
|
|
8
|
+
if (!landmarkEntity) {
|
|
9
|
+
appObjects.submitWarning("UpdateLandmarkSizeController", "LandmarkEntity App Object was not added.");
|
|
10
|
+
return;
|
|
11
|
+
}
|
|
12
|
+
const setLandmarkSizeUC = appObjects.getAppObjectComponent(appObjectId, SetLandmarkSizeUC_1.SetLandmarkSizeUC.type);
|
|
13
|
+
if (!setLandmarkSizeUC) {
|
|
14
|
+
appObjects.submitWarning("UpdateLandmarkSizeController", "SetLandmarkSizeUC App Object was not added.");
|
|
15
|
+
return;
|
|
16
|
+
}
|
|
17
|
+
setLandmarkSizeUC.updateSize(size);
|
|
18
|
+
}
|
|
19
|
+
exports.updateLandmarkSize = updateLandmarkSize;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
5
|
+
}) : (function(o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
o[k2] = m[k];
|
|
8
|
+
}));
|
|
9
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
10
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
11
|
+
};
|
|
12
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
+
__exportStar(require("./MouseLandmark"), exports);
|
|
14
|
+
__exportStar(require("./SetSelectedLandmarkColor"), exports);
|
|
15
|
+
__exportStar(require("./SubmitLandmarkSize"), exports);
|
|
16
|
+
__exportStar(require("./TouchLandmark"), exports);
|
|
17
|
+
__exportStar(require("./UpdateLandmarkSize"), exports);
|