@vived/app 4.25.0 → 4.26.1
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/ChannelModel/Adapters/index.d.ts +1 -0
- package/lib/Components/ChannelModel/Adapters/index.js +1 -0
- package/lib/Components/ChannelModel/Adapters/modelHasLandmarksAdapter.d.ts +2 -0
- package/lib/Components/ChannelModel/Adapters/modelHasLandmarksAdapter.js +27 -0
- package/lib/Components/ChannelModel/Mocks/ModelHasLandmarksPmMock.d.ts +7 -0
- package/lib/Components/ChannelModel/Mocks/ModelHasLandmarksPmMock.js +11 -0
- package/lib/Components/ChannelModel/Mocks/index.d.ts +1 -0
- package/lib/Components/ChannelModel/Mocks/index.js +1 -0
- package/lib/Components/ChannelModel/PMs/ModelHasLandmarksPM.d.ts +6 -0
- package/lib/Components/ChannelModel/PMs/ModelHasLandmarksPM.js +56 -0
- package/lib/Components/ChannelModel/PMs/index.d.ts +1 -0
- package/lib/Components/ChannelModel/PMs/index.js +1 -0
- package/lib/Components/Hideable/Adapters/isHiddenAdapter.js +2 -4
- package/lib/Components/Label/Adapters/labelAdapter.js +2 -4
- package/lib/Components/Landmarks/Adapters/index.d.ts +2 -0
- package/lib/Components/Landmarks/Adapters/index.js +14 -0
- package/lib/Components/Landmarks/Adapters/landmarkListAdapter.d.ts +2 -0
- package/lib/Components/Landmarks/Adapters/landmarkListAdapter.js +25 -0
- package/lib/Components/Landmarks/Adapters/landmarkSizeAdapter.d.ts +2 -0
- package/lib/Components/Landmarks/Adapters/landmarkSizeAdapter.js +23 -0
- package/lib/Components/Landmarks/Controller/MouseLandmark.d.ts +3 -13
- package/lib/Components/Landmarks/Controller/MouseLandmark.js +8 -16
- package/lib/Components/Landmarks/Controller/SubmitLandmarkSize.d.ts +1 -1
- package/lib/Components/Landmarks/Controller/SubmitLandmarkSize.js +2 -8
- package/lib/Components/Landmarks/Controller/TouchLandmark.d.ts +2 -12
- package/lib/Components/Landmarks/Controller/TouchLandmark.js +12 -19
- package/lib/Components/Landmarks/Controller/UpdateLandmarkSize.d.ts +1 -1
- package/lib/Components/Landmarks/Controller/UpdateLandmarkSize.js +3 -9
- package/lib/Components/Landmarks/Controller/deleteAllLandmarks.d.ts +2 -0
- package/lib/Components/Landmarks/Controller/deleteAllLandmarks.js +13 -0
- package/lib/Components/Landmarks/Controller/deleteLandmark.d.ts +2 -0
- package/lib/Components/Landmarks/Controller/deleteLandmark.js +14 -0
- package/lib/Components/Landmarks/Controller/index.d.ts +2 -1
- package/lib/Components/Landmarks/Controller/index.js +2 -1
- package/lib/Components/Landmarks/Controller/submitLandmarkSizeX.d.ts +2 -0
- package/lib/Components/Landmarks/Controller/submitLandmarkSizeX.js +19 -0
- package/lib/Components/Landmarks/Controller/updateLandmarkSizeX.d.ts +2 -0
- package/lib/Components/Landmarks/Controller/updateLandmarkSizeX.js +19 -0
- package/lib/Components/Landmarks/Entities/LandmarkEntity.d.ts +5 -3
- package/lib/Components/Landmarks/Entities/LandmarkEntity.js +18 -6
- package/lib/Components/Landmarks/Entities/LandmarkGlobals.d.ts +2 -3
- package/lib/Components/Landmarks/Entities/LandmarkGlobals.js +5 -10
- package/lib/Components/Landmarks/Entities/LandmarkRepo.d.ts +7 -1
- package/lib/Components/Landmarks/Entities/LandmarkRepo.js +26 -4
- package/lib/Components/Landmarks/Mocks/DeleteAllLandmarksUcMock.d.ts +8 -0
- package/lib/Components/Landmarks/Mocks/DeleteAllLandmarksUcMock.js +15 -0
- package/lib/Components/Landmarks/Mocks/DeleteLandmarkUcMock.d.ts +7 -0
- package/lib/Components/Landmarks/Mocks/DeleteLandmarkUcMock.js +11 -0
- package/lib/Components/Landmarks/Mocks/LandmarkListPmMock.d.ts +7 -0
- package/lib/Components/Landmarks/Mocks/LandmarkListPmMock.js +11 -0
- package/lib/Components/Landmarks/Mocks/LandmarkSizePmMock.d.ts +7 -0
- package/lib/Components/Landmarks/Mocks/LandmarkSizePmMock.js +11 -0
- package/lib/Components/Landmarks/Mocks/MockLandmark.d.ts +3 -1
- package/lib/Components/Landmarks/Mocks/MockLandmark.js +9 -0
- package/lib/Components/Landmarks/Mocks/MockTryAddNewLandmarkUC.d.ts +10 -0
- package/lib/Components/Landmarks/Mocks/MockTryAddNewLandmarkUC.js +17 -0
- package/lib/Components/Landmarks/Mocks/MockTryPreviewLandmarkUC.d.ts +10 -0
- package/lib/Components/Landmarks/Mocks/MockTryPreviewLandmarkUC.js +17 -0
- package/lib/Components/Landmarks/Mocks/SetLandmarkSizeUcMark.d.ts +8 -0
- package/lib/Components/Landmarks/Mocks/SetLandmarkSizeUcMark.js +12 -0
- package/lib/Components/Landmarks/Mocks/index.d.ts +6 -0
- package/lib/Components/Landmarks/Mocks/index.js +18 -0
- package/lib/Components/Landmarks/Mocks/makeLandmarkDTO.d.ts +2 -0
- package/lib/Components/Landmarks/Mocks/makeLandmarkDTO.js +20 -0
- package/lib/Components/Landmarks/PM/LandmarkListPM.d.ts +4 -8
- package/lib/Components/Landmarks/PM/LandmarkListPM.js +19 -26
- package/lib/Components/Landmarks/PM/LandmarkSizePM.d.ts +4 -8
- package/lib/Components/Landmarks/PM/LandmarkSizePM.js +19 -20
- package/lib/Components/Landmarks/UseCases/AddLandmarkUndoRedo.d.ts +4 -6
- package/lib/Components/Landmarks/UseCases/AddLandmarkUndoRedo.js +14 -27
- package/lib/Components/Landmarks/UseCases/DeleteAllLandmarksUC.d.ts +7 -0
- package/lib/Components/Landmarks/UseCases/DeleteAllLandmarksUC.js +35 -0
- package/lib/Components/Landmarks/UseCases/DeleteAllLandmarksUndoRedo.d.ts +10 -0
- package/lib/Components/Landmarks/UseCases/DeleteAllLandmarksUndoRedo.js +37 -0
- package/lib/Components/Landmarks/UseCases/DeleteLandmarkUC.d.ts +5 -6
- package/lib/Components/Landmarks/UseCases/DeleteLandmarkUC.js +24 -34
- package/lib/Components/Landmarks/UseCases/DeleteLandmarkUndoRedo.d.ts +4 -6
- package/lib/Components/Landmarks/UseCases/DeleteLandmarkUndoRedo.js +14 -27
- package/lib/Components/Landmarks/UseCases/SerializeLandmarks.d.ts +2 -0
- package/lib/Components/Landmarks/UseCases/SerializeLandmarks.js +27 -40
- package/lib/Components/Landmarks/UseCases/SetLandmarkSizeUC.d.ts +6 -9
- package/lib/Components/Landmarks/UseCases/SetLandmarkSizeUC.js +33 -27
- package/lib/Components/Landmarks/UseCases/SetLandmarkSizeUndoRedo.d.ts +10 -6
- package/lib/Components/Landmarks/UseCases/SetLandmarkSizeUndoRedo.js +11 -20
- package/lib/Components/Landmarks/UseCases/TryAddNewLandmarkUC.d.ts +1 -0
- package/lib/Components/Landmarks/UseCases/TryAddNewLandmarkUC.js +22 -18
- package/lib/Components/Landmarks/UseCases/TryPreviewLandmarkUC.d.ts +3 -8
- package/lib/Components/Landmarks/UseCases/TryPreviewLandmarkUC.js +17 -18
- package/lib/Components/Landmarks/UseCases/index.d.ts +1 -1
- package/lib/Components/Landmarks/UseCases/index.js +1 -1
- package/lib/Components/Landmarks/index.d.ts +2 -0
- package/lib/Components/Landmarks/index.js +2 -0
- package/lib/Components/OverlayColor/Adapters/overlayColorAdapter.js +2 -4
- package/lib/Components/Selection/Adapters/selectableStateAdapter.js +2 -4
- package/lib/Components/Transform3D/Adapters/transform3dAdapter.js +2 -4
- package/package.json +1 -1
|
@@ -6,8 +6,8 @@ const ValueObjects_1 = require("../../../ValueObjects");
|
|
|
6
6
|
const Babylon_1 = require("../../Babylon");
|
|
7
7
|
const Dispatcher_1 = require("../../Dispatcher");
|
|
8
8
|
const Label_1 = require("../../Label");
|
|
9
|
+
const Entities_1 = require("../Entities");
|
|
9
10
|
const LandmarkGlobals_1 = require("../Entities/LandmarkGlobals");
|
|
10
|
-
const AddLandmarkUC_1 = require("./AddLandmarkUC");
|
|
11
11
|
const AddLandmarkUndoRedo_1 = require("./AddLandmarkUndoRedo");
|
|
12
12
|
class TryAddNewLandmarkUC extends AppObject_1.AppObjectUC {
|
|
13
13
|
static get(appObj) {
|
|
@@ -21,35 +21,39 @@ function makeTryAddLandmarkUC(appObject) {
|
|
|
21
21
|
}
|
|
22
22
|
exports.makeTryAddLandmarkUC = makeTryAddLandmarkUC;
|
|
23
23
|
class TryAddNewLandmarkUCImp extends TryAddNewLandmarkUC {
|
|
24
|
+
get globals() {
|
|
25
|
+
return this.getCachedSingleton(LandmarkGlobals_1.LandmarkGlobals.type);
|
|
26
|
+
}
|
|
27
|
+
allow() {
|
|
28
|
+
return true;
|
|
29
|
+
}
|
|
24
30
|
addFromRay(ray) {
|
|
25
|
-
|
|
26
|
-
if (!scenePick ||
|
|
27
|
-
!scenePick.worldPickPoint ||
|
|
28
|
-
!scenePick.normal ||
|
|
29
|
-
!scenePick.appObjectID) {
|
|
31
|
+
if (!this.allow()) {
|
|
30
32
|
return;
|
|
31
33
|
}
|
|
32
|
-
const
|
|
33
|
-
const
|
|
34
|
-
if (!
|
|
34
|
+
const scenePick = Babylon_1.sceneRayPick(ray, this.appObjects);
|
|
35
|
+
const appObjectID = scenePick === null || scenePick === void 0 ? void 0 : scenePick.appObjectID;
|
|
36
|
+
if (!appObjectID ||
|
|
37
|
+
!scenePick ||
|
|
38
|
+
!(scenePick === null || scenePick === void 0 ? void 0 : scenePick.worldPickPoint) ||
|
|
39
|
+
!(scenePick === null || scenePick === void 0 ? void 0 : scenePick.normal)) {
|
|
35
40
|
return;
|
|
36
41
|
}
|
|
37
|
-
const
|
|
38
|
-
if (!
|
|
39
|
-
this.warn("Failed to add landmark");
|
|
42
|
+
const landmarkRepo = Entities_1.LandmarkRepo.getByID(appObjectID, this.appObjects);
|
|
43
|
+
if (!landmarkRepo) {
|
|
40
44
|
return;
|
|
41
45
|
}
|
|
46
|
+
const newLandmark = landmarkRepo.createLandmark();
|
|
42
47
|
newLandmark.transform.worldPosition = scenePick.worldPickPoint;
|
|
43
48
|
newLandmark.transform.worldRotation = ValueObjects_1.Quaternion.FromDirectionVector(scenePick.normal);
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
newLandmark.
|
|
47
|
-
newLandmark.overlayColor.overlayColor = globals.lastColor;
|
|
49
|
+
if (this.globals) {
|
|
50
|
+
newLandmark.size = this.globals.lastSize;
|
|
51
|
+
newLandmark.overlayColor.overlayColor = this.globals.lastColor;
|
|
48
52
|
}
|
|
49
|
-
const label =
|
|
53
|
+
const label = Label_1.LabelEntity.getByID(appObjectID, this.appObjects);
|
|
50
54
|
newLandmark.label.default = label ? label.default : "";
|
|
51
55
|
newLandmark.selectable.selected = true;
|
|
52
|
-
new AddLandmarkUndoRedo_1.AddLandmarkUndoRedo(newLandmark.data, this.
|
|
56
|
+
new AddLandmarkUndoRedo_1.AddLandmarkUndoRedo(newLandmark.data, this.appObjects);
|
|
53
57
|
Dispatcher_1.dispatchStateChange(this.appObjects);
|
|
54
58
|
return newLandmark;
|
|
55
59
|
}
|
|
@@ -2,14 +2,9 @@ import { AppObject, AppObjectUC } from "../../../AppObject";
|
|
|
2
2
|
import { ParametricLine } from "../../../ValueObjects";
|
|
3
3
|
export declare abstract class TryPreviewLandmarkUC extends AppObjectUC {
|
|
4
4
|
static readonly type = "TryPreviewLandmarkUC";
|
|
5
|
+
abstract allow(): boolean;
|
|
5
6
|
abstract tryPreviewLandmark: (ray: ParametricLine, pressed: boolean) => boolean | undefined;
|
|
7
|
+
abstract hidePreview: () => void;
|
|
6
8
|
static get(appObj: AppObject): TryPreviewLandmarkUC | undefined;
|
|
7
9
|
}
|
|
8
|
-
export declare function makeTryPreviewLandmark(appObject: AppObject):
|
|
9
|
-
declare class TryPreviewLandmarkUCImp extends TryPreviewLandmarkUC {
|
|
10
|
-
private previewLandmark?;
|
|
11
|
-
private hidePreview;
|
|
12
|
-
tryPreviewLandmark: (ray: ParametricLine, pressed: boolean) => false | undefined;
|
|
13
|
-
constructor(appObject: AppObject);
|
|
14
|
-
}
|
|
15
|
-
export {};
|
|
10
|
+
export declare function makeTryPreviewLandmark(appObject: AppObject): TryPreviewLandmarkUC;
|
|
@@ -3,9 +3,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.makeTryPreviewLandmark = exports.TryPreviewLandmarkUC = void 0;
|
|
4
4
|
const AppObject_1 = require("../../../AppObject");
|
|
5
5
|
const ValueObjects_1 = require("../../../ValueObjects");
|
|
6
|
-
const App_1 = require("../../App");
|
|
7
6
|
const Babylon_1 = require("../../Babylon");
|
|
8
|
-
const
|
|
7
|
+
const LandmarkEntity_1 = require("../Entities/LandmarkEntity");
|
|
9
8
|
const LandmarkRepo_1 = require("../Entities/LandmarkRepo");
|
|
10
9
|
class TryPreviewLandmarkUC extends AppObject_1.AppObjectUC {
|
|
11
10
|
static get(appObj) {
|
|
@@ -21,14 +20,17 @@ function makeTryPreviewLandmark(appObject) {
|
|
|
21
20
|
exports.makeTryPreviewLandmark = makeTryPreviewLandmark;
|
|
22
21
|
class TryPreviewLandmarkUCImp extends TryPreviewLandmarkUC {
|
|
23
22
|
constructor(appObject) {
|
|
24
|
-
var _a;
|
|
25
23
|
super(appObject, TryPreviewLandmarkUC.type);
|
|
24
|
+
this.hidePreview = () => {
|
|
25
|
+
if (!this.landmark)
|
|
26
|
+
return;
|
|
27
|
+
this.landmark.hideable.isHidden = true;
|
|
28
|
+
};
|
|
26
29
|
this.tryPreviewLandmark = (ray, pressed) => {
|
|
27
|
-
if (!this.
|
|
30
|
+
if (!this.landmark) {
|
|
28
31
|
return false;
|
|
29
32
|
}
|
|
30
|
-
|
|
31
|
-
if (!baseApp || !baseApp.isAuthoring) {
|
|
33
|
+
if (!this.allow()) {
|
|
32
34
|
this.hidePreview();
|
|
33
35
|
return false;
|
|
34
36
|
}
|
|
@@ -45,19 +47,16 @@ class TryPreviewLandmarkUCImp extends TryPreviewLandmarkUC {
|
|
|
45
47
|
this.hidePreview();
|
|
46
48
|
return;
|
|
47
49
|
}
|
|
48
|
-
this.
|
|
49
|
-
this.
|
|
50
|
-
this.
|
|
51
|
-
this.
|
|
50
|
+
this.landmark.hideable.isHidden = false;
|
|
51
|
+
this.landmark.position = scenePick.worldPickPoint;
|
|
52
|
+
this.landmark.rotation = ValueObjects_1.Quaternion.FromDirectionVector(scenePick.normal);
|
|
53
|
+
this.landmark.selectable.pressed = pressed;
|
|
52
54
|
};
|
|
53
|
-
this.previewLandmark = (_a = this.appObject.getComponent(LandmarkGlobals_1.LandmarkGlobals.type)) === null || _a === void 0 ? void 0 : _a.previewLandmark;
|
|
54
|
-
if (!this.previewLandmark) {
|
|
55
|
-
console.warn("No preview landmark");
|
|
56
|
-
}
|
|
57
55
|
}
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
56
|
+
get landmark() {
|
|
57
|
+
return this.getCachedLocalComponent(LandmarkEntity_1.LandmarkEntity.type);
|
|
58
|
+
}
|
|
59
|
+
allow() {
|
|
60
|
+
return true;
|
|
62
61
|
}
|
|
63
62
|
}
|
|
@@ -10,8 +10,8 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
10
10
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
11
11
|
};
|
|
12
12
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
-
__exportStar(require("./AddLandmarkUC"), exports);
|
|
14
13
|
__exportStar(require("./AddLandmarkUndoRedo"), exports);
|
|
14
|
+
__exportStar(require("./DeleteAllLandmarksUC"), exports);
|
|
15
15
|
__exportStar(require("./DeleteLandmarkUC"), exports);
|
|
16
16
|
__exportStar(require("./DeleteLandmarkUndoRedo"), exports);
|
|
17
17
|
__exportStar(require("./SerializeLandmarks"), exports);
|
|
@@ -10,7 +10,9 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
10
10
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
11
11
|
};
|
|
12
12
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
+
__exportStar(require("./Adapters"), exports);
|
|
13
14
|
__exportStar(require("./Controller"), exports);
|
|
14
15
|
__exportStar(require("./Entities"), exports);
|
|
16
|
+
__exportStar(require("./Mocks"), exports);
|
|
15
17
|
__exportStar(require("./PM"), exports);
|
|
16
18
|
__exportStar(require("./UseCases"), exports);
|
|
@@ -15,10 +15,8 @@ exports.overlayColorAdapter = {
|
|
|
15
15
|
},
|
|
16
16
|
unsubscribe: (id, appObjects, setVM) => {
|
|
17
17
|
const pm = OverlayColorPM_1.OverlayColorPM.getForID(id, appObjects);
|
|
18
|
-
if (
|
|
19
|
-
|
|
20
|
-
return;
|
|
18
|
+
if (pm) {
|
|
19
|
+
pm.removeView(setVM);
|
|
21
20
|
}
|
|
22
|
-
pm.removeView(setVM);
|
|
23
21
|
},
|
|
24
22
|
};
|
|
@@ -14,10 +14,8 @@ exports.selectableStateAdapter = {
|
|
|
14
14
|
},
|
|
15
15
|
unsubscribe: (id, appObjects, setVM) => {
|
|
16
16
|
const pm = SelectableStatePM_1.SelectableStatePM.get(id, appObjects);
|
|
17
|
-
if (
|
|
18
|
-
|
|
19
|
-
return;
|
|
17
|
+
if (pm) {
|
|
18
|
+
pm.removeView(setVM);
|
|
20
19
|
}
|
|
21
|
-
pm.removeView(setVM);
|
|
22
20
|
},
|
|
23
21
|
};
|
|
@@ -14,10 +14,8 @@ exports.transform3dAdapter = {
|
|
|
14
14
|
},
|
|
15
15
|
unsubscribe: (id, appObjects, setVM) => {
|
|
16
16
|
const pm = Transform3DPM_1.Transform3DPM.getForID(id, appObjects);
|
|
17
|
-
if (
|
|
18
|
-
|
|
19
|
-
return;
|
|
17
|
+
if (pm) {
|
|
18
|
+
pm.removeView(setVM);
|
|
20
19
|
}
|
|
21
|
-
pm.removeView(setVM);
|
|
22
20
|
},
|
|
23
21
|
};
|