@vived/app 4.31.0 → 4.32.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/BaseApp/Factories/setupBaseApp.d.ts +2 -2
- package/lib/Components/BaseApp/Factories/setupBaseApp.js +1 -0
- package/lib/Components/ChannelModel/UC/SelectChannelModelUC.js +7 -0
- package/lib/Components/InspectorTab/Controllers/KeyboardToSetTab.d.ts +10 -0
- package/lib/Components/InspectorTab/Controllers/KeyboardToSetTab.js +45 -0
- package/lib/Components/InspectorTab/Controllers/index.d.ts +1 -0
- package/lib/Components/InspectorTab/Controllers/index.js +1 -0
- package/lib/Components/InspectorTab/Factories/setupInspectorTabs.js +5 -0
- package/lib/Components/MouseInput/index.d.ts +1 -0
- package/lib/Components/MouseInput/index.js +1 -0
- package/lib/Components/SceneRoot/Controllers/DoubleTapToFocus.d.ts +1 -1
- package/lib/Components/SceneRoot/Controllers/DoubleTapToFocus.js +3 -5
- package/lib/Components/SceneRoot/Controllers/MouseClickToFocus.d.ts +1 -1
- package/lib/Components/SceneRoot/Controllers/MouseClickToFocus.js +6 -5
- package/lib/Components/SceneRoot/Controllers/MouseDoubleClickToRecenter.d.ts +1 -1
- package/lib/Components/SceneRoot/Controllers/MouseDoubleClickToRecenter.js +3 -5
- package/lib/Components/SceneRoot/Controllers/MouseOrbit.d.ts +2 -1
- package/lib/Components/SceneRoot/Controllers/MouseOrbit.js +19 -6
- package/lib/Components/SceneRoot/Controllers/MousePan.d.ts +2 -1
- package/lib/Components/SceneRoot/Controllers/MousePan.js +19 -6
- package/lib/Components/SceneRoot/Controllers/MouseRoll.d.ts +1 -1
- package/lib/Components/SceneRoot/Controllers/MouseRoll.js +3 -5
- package/lib/Components/SceneRoot/Controllers/MouseScale.d.ts +2 -1
- package/lib/Components/SceneRoot/Controllers/MouseScale.js +16 -6
- package/lib/Components/SceneRoot/Controllers/ScaleSceneRootSC.d.ts +2 -2
- package/lib/Components/SceneRoot/Controllers/ScaleSceneRootSC.js +8 -11
- package/lib/Components/SceneRoot/Controllers/SceneRootMoveSC.d.ts +2 -2
- package/lib/Components/SceneRoot/Controllers/SceneRootMoveSC.js +9 -12
- package/lib/Components/SceneRoot/Controllers/TouchOrbit.d.ts +3 -1
- package/lib/Components/SceneRoot/Controllers/TouchOrbit.js +24 -6
- package/lib/Components/SceneRoot/Controllers/TouchPan.d.ts +3 -1
- package/lib/Components/SceneRoot/Controllers/TouchPan.js +24 -6
- package/lib/Components/SceneRoot/Controllers/TouchPinch.d.ts +2 -2
- package/lib/Components/SceneRoot/Controllers/TouchPinch.js +12 -6
- package/lib/Components/SceneRoot/Controllers/TouchScale.d.ts +2 -2
- package/lib/Components/SceneRoot/Controllers/TouchScale.js +16 -5
- package/lib/Components/SceneRoot/Factories/index.d.ts +1 -0
- package/lib/Components/SceneRoot/Factories/index.js +13 -0
- package/lib/Components/SceneRoot/Factories/setupSceneRoot.d.ts +3 -0
- package/lib/Components/SceneRoot/Factories/setupSceneRoot.js +45 -0
- package/lib/Components/SceneRoot/Mocks/MockDragScaleSceneRootUC.d.ts +9 -0
- package/lib/Components/SceneRoot/Mocks/MockDragScaleSceneRootUC.js +13 -0
- package/lib/Components/SceneRoot/Mocks/MockFocusOnPixelUC.d.ts +10 -0
- package/lib/Components/SceneRoot/Mocks/MockFocusOnPixelUC.js +15 -0
- package/lib/Components/SceneRoot/Mocks/MockOrbitSceneRootUC.d.ts +11 -0
- package/lib/Components/SceneRoot/Mocks/MockOrbitSceneRootUC.js +15 -0
- package/lib/Components/SceneRoot/Mocks/MockPanSceneRootUC.d.ts +10 -0
- package/lib/Components/SceneRoot/Mocks/MockPanSceneRootUC.js +14 -0
- package/lib/Components/SceneRoot/Mocks/MockPinchSceneRootUC.d.ts +10 -0
- package/lib/Components/SceneRoot/Mocks/MockPinchSceneRootUC.js +14 -0
- package/lib/Components/SceneRoot/Mocks/index.d.ts +5 -2
- package/lib/Components/SceneRoot/Mocks/index.js +5 -2
- package/lib/Components/SceneRoot/UC/CenterSceneRootOnPixelPick.js +1 -1
- package/lib/Components/SceneRoot/UC/FocusOnPixel.js +1 -1
- package/lib/Components/SceneRoot/index.d.ts +3 -1
- package/lib/Components/SceneRoot/index.js +3 -1
- package/lib/Components/Selection/Controller/index.d.ts +1 -0
- package/lib/Components/Selection/Controller/index.js +1 -0
- package/lib/Components/Selection/index.d.ts +1 -0
- package/lib/Components/Selection/index.js +1 -0
- package/lib/Components/Stick/UCs/TryStickAppObjectUC.js +10 -0
- package/lib/Components/StoredView/PM/HasStoredViewPM.js +7 -9
- package/lib/Components/StoredView/UC/ClearStoredViewUC.d.ts +0 -1
- package/lib/Components/StoredView/UC/ClearStoredViewUC.js +4 -15
- package/lib/Components/StoredView/UC/RestoreStoredViewUC.d.ts +0 -1
- package/lib/Components/StoredView/UC/RestoreStoredViewUC.js +8 -22
- package/lib/Components/StoredView/UC/SerializeStoredView.js +3 -6
- package/lib/Components/StoredView/UC/SetInXRUC.d.ts +0 -1
- package/lib/Components/StoredView/UC/SetInXRUC.js +4 -15
- package/lib/Components/StoredView/UC/StoreCurrentViewUC.d.ts +0 -1
- package/lib/Components/StoredView/UC/StoreCurrentViewUC.js +7 -19
- package/lib/Components/StoredView/index.d.ts +3 -0
- package/lib/Components/StoredView/index.js +3 -0
- package/lib/Components/Tools/Adapters/toolAdapter.d.ts +1 -1
- package/lib/Components/Tools/Adapters/toolAdapter.js +16 -23
- package/lib/Components/Tools/Controller/ToolHotkeys.d.ts +1 -1
- package/lib/Components/Tools/Controller/triggerTool.d.ts +1 -1
- package/lib/Components/Tools/Entities/ToolEntity.d.ts +7 -7
- package/lib/Components/Tools/Entities/ToolEntity.js +1 -2
- package/lib/Components/Tools/Entities/ToolRepository.d.ts +12 -11
- package/lib/Components/Tools/Entities/ToolRepository.js +30 -26
- package/lib/Components/Tools/Mocks/MockToolRepo.d.ts +17 -0
- package/lib/Components/Tools/Mocks/MockToolRepo.js +28 -0
- package/lib/Components/Tools/Mocks/ToolPMMock.d.ts +2 -2
- package/lib/Components/Tools/Mocks/index.d.ts +1 -0
- package/lib/Components/Tools/Mocks/index.js +1 -0
- package/lib/Components/Tools/PM/ToolPM.d.ts +6 -6
- package/lib/Components/Tools/index.d.ts +1 -0
- package/lib/Components/Tools/index.js +1 -0
- package/lib/Components/TouchController/index.d.ts +1 -0
- package/lib/Components/TouchController/index.js +1 -0
- package/lib/Components/UndoRedo/index.d.ts +3 -1
- package/lib/Components/UndoRedo/index.js +3 -1
- package/lib/Components/index.d.ts +1 -0
- package/lib/Components/index.js +1 -0
- package/package.json +1 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { AppObjectRepo } from "../../../AppObject";
|
|
2
|
-
export declare function setupBaseApp(appObjects: AppObjectRepo):
|
|
1
|
+
import { AppObject, AppObjectRepo } from "../../../AppObject";
|
|
2
|
+
export declare function setupBaseApp(appObjects: AppObjectRepo): AppObject;
|
|
@@ -39,6 +39,9 @@ class SelectChannelModelUCImp extends SelectChannelModelUC {
|
|
|
39
39
|
repo.getAll().forEach((model) => {
|
|
40
40
|
model.enabled = model.id === channelModel.id;
|
|
41
41
|
});
|
|
42
|
+
if (this.dispatchState) {
|
|
43
|
+
this.dispatchState();
|
|
44
|
+
}
|
|
42
45
|
return channelModel.id;
|
|
43
46
|
});
|
|
44
47
|
};
|
|
@@ -57,4 +60,8 @@ class SelectChannelModelUCImp extends SelectChannelModelUC {
|
|
|
57
60
|
get repo() {
|
|
58
61
|
return this.getCachedSingleton(Entities_1.ChannelModelRepo.type);
|
|
59
62
|
}
|
|
63
|
+
get dispatchState() {
|
|
64
|
+
var _a;
|
|
65
|
+
return (_a = this.getCachedSingleton(Dispatcher_1.DispatchStateChangeUC.type)) === null || _a === void 0 ? void 0 : _a.doDispatch;
|
|
66
|
+
}
|
|
60
67
|
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { AppObject, AppObjectController } from "../../../AppObject";
|
|
2
|
+
import { KeyboardController } from "../../KeyboardInput/Entities/KeyboardInput";
|
|
3
|
+
export declare class KeyboardToSetTab extends AppObjectController implements KeyboardController {
|
|
4
|
+
static type: string;
|
|
5
|
+
private get inspectorTabEntity();
|
|
6
|
+
private get baseApp();
|
|
7
|
+
private codeLookup;
|
|
8
|
+
onKeyDown: (e: KeyboardEvent) => void;
|
|
9
|
+
constructor(appObject: AppObject);
|
|
10
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.KeyboardToSetTab = void 0;
|
|
4
|
+
const AppObject_1 = require("../../../AppObject");
|
|
5
|
+
const BaseAppState_1 = require("../../BaseApp/Entity/BaseAppState");
|
|
6
|
+
const KeyboardInput_1 = require("../../KeyboardInput/Entities/KeyboardInput");
|
|
7
|
+
const Entities_1 = require("../Entities");
|
|
8
|
+
class KeyboardToSetTab extends AppObject_1.AppObjectController {
|
|
9
|
+
constructor(appObject) {
|
|
10
|
+
super(appObject, KeyboardToSetTab.type);
|
|
11
|
+
this.codeLookup = new Map([
|
|
12
|
+
["Digit1", 0],
|
|
13
|
+
["Digit2", 1],
|
|
14
|
+
["Digit3", 2],
|
|
15
|
+
["Digit4", 3],
|
|
16
|
+
["Digit5", 4],
|
|
17
|
+
]);
|
|
18
|
+
this.onKeyDown = (e) => {
|
|
19
|
+
var _a;
|
|
20
|
+
if (!this.inspectorTabEntity)
|
|
21
|
+
return;
|
|
22
|
+
if (((_a = this.baseApp) === null || _a === void 0 ? void 0 : _a.isAuthoring) !== true)
|
|
23
|
+
return;
|
|
24
|
+
if (!this.codeLookup.has(e.code))
|
|
25
|
+
return;
|
|
26
|
+
const desiredIndex = this.codeLookup.get(e.code);
|
|
27
|
+
if (desiredIndex === undefined ||
|
|
28
|
+
desiredIndex < 0 ||
|
|
29
|
+
desiredIndex >= this.inspectorTabEntity.inspectorTabs.length) {
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
32
|
+
this.inspectorTabEntity.activeTabIndex = desiredIndex;
|
|
33
|
+
};
|
|
34
|
+
const keyboardInput = KeyboardInput_1.KeyboardInputEntity.get(this.appObjects);
|
|
35
|
+
keyboardInput === null || keyboardInput === void 0 ? void 0 : keyboardInput.registerController(this);
|
|
36
|
+
}
|
|
37
|
+
get inspectorTabEntity() {
|
|
38
|
+
return this.getCachedSingleton(Entities_1.InspectorTabEntity.type);
|
|
39
|
+
}
|
|
40
|
+
get baseApp() {
|
|
41
|
+
return this.getCachedSingleton(BaseAppState_1.BaseAppState.type);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
exports.KeyboardToSetTab = KeyboardToSetTab;
|
|
45
|
+
KeyboardToSetTab.type = "KeyboardToSetTab";
|
|
@@ -12,3 +12,4 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
12
12
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
13
|
__exportStar(require("./clickSetInspectorTab"), exports);
|
|
14
14
|
__exportStar(require("./clickSetInspectorTabIndex"), exports);
|
|
15
|
+
__exportStar(require("./KeyboardToSetTab"), exports);
|
|
@@ -1,12 +1,17 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.setupInspectorTabs = void 0;
|
|
4
|
+
const Controllers_1 = require("../Controllers");
|
|
4
5
|
const Entities_1 = require("../Entities");
|
|
5
6
|
const PMs_1 = require("../PMs");
|
|
6
7
|
function setupInspectorTabs(appObjects, tabs) {
|
|
7
8
|
const ao = appObjects.getOrCreate("InspectorTabs");
|
|
9
|
+
// Entity
|
|
8
10
|
Entities_1.makeInspectorTabEntity(ao).setInspectorTabs(tabs);
|
|
11
|
+
// PM
|
|
9
12
|
PMs_1.makeInspectorTabPM(ao);
|
|
13
|
+
// Controller
|
|
14
|
+
new Controllers_1.KeyboardToSetTab(ao);
|
|
10
15
|
return ao;
|
|
11
16
|
}
|
|
12
17
|
exports.setupInspectorTabs = setupInspectorTabs;
|
|
@@ -9,7 +9,7 @@ export declare class DoubleTapToFocus extends AppObjectController implements Tou
|
|
|
9
9
|
private initialTouchPos;
|
|
10
10
|
private initialTouchTime;
|
|
11
11
|
private tapCount;
|
|
12
|
-
private focusOnPixelUC
|
|
12
|
+
private get focusOnPixelUC();
|
|
13
13
|
allow: (e: TouchInputEvent) => boolean;
|
|
14
14
|
onTouchStart: (e: TouchInputEvent) => void;
|
|
15
15
|
onTouchMove: (e: TouchInputEvent) => void;
|
|
@@ -62,11 +62,6 @@ class DoubleTapToFocus extends AppObjectController_1.AppObjectController {
|
|
|
62
62
|
this.tapCount = 0;
|
|
63
63
|
};
|
|
64
64
|
const appObjects = appObject.appObjectRepo;
|
|
65
|
-
this.focusOnPixelUC = appObject.getComponent(FocusOnPixel_1.FocusOnPixelUC.type);
|
|
66
|
-
if (!this.focusOnPixelUC) {
|
|
67
|
-
this.warn("Controller has been added to an App Object that does not have FocusOnPixelUC. Add one first.");
|
|
68
|
-
return;
|
|
69
|
-
}
|
|
70
65
|
const touchInput = TouchController_1.TouchInputEntity.get(appObjects);
|
|
71
66
|
if (touchInput) {
|
|
72
67
|
touchInput.registerController(this);
|
|
@@ -75,6 +70,9 @@ class DoubleTapToFocus extends AppObjectController_1.AppObjectController {
|
|
|
75
70
|
this.warn("Unable to find TouchInputEntity");
|
|
76
71
|
}
|
|
77
72
|
}
|
|
73
|
+
get focusOnPixelUC() {
|
|
74
|
+
return this.getCachedLocalComponent(FocusOnPixel_1.FocusOnPixelUC.type);
|
|
75
|
+
}
|
|
78
76
|
checkForMovement(currentPixelPos) {
|
|
79
77
|
const movement = ValueObjects_1.Vector2.Subtract(this.initialTouchPos, currentPixelPos)
|
|
80
78
|
.magnitued;
|
|
@@ -3,7 +3,7 @@ import { AppObjectController } from "../../../AppObject/AppObjectController";
|
|
|
3
3
|
import { MouseController, MouseInputEvent } from "../../MouseInput";
|
|
4
4
|
export declare class MouseClickToFocus extends AppObjectController implements MouseController {
|
|
5
5
|
static readonly type = "MouseClickToFocus";
|
|
6
|
-
private centerOnPixelUI
|
|
6
|
+
private get centerOnPixelUI();
|
|
7
7
|
allow: (e: MouseInputEvent) => boolean;
|
|
8
8
|
onClick: (e: MouseInputEvent) => void;
|
|
9
9
|
constructor(appObject: AppObject);
|
|
@@ -8,6 +8,9 @@ class MouseClickToFocus extends AppObjectController_1.AppObjectController {
|
|
|
8
8
|
constructor(appObject) {
|
|
9
9
|
super(appObject, MouseClickToFocus.type);
|
|
10
10
|
this.allow = (e) => {
|
|
11
|
+
if (e.button === 0) {
|
|
12
|
+
return false;
|
|
13
|
+
}
|
|
11
14
|
return true;
|
|
12
15
|
};
|
|
13
16
|
this.onClick = (e) => {
|
|
@@ -16,11 +19,6 @@ class MouseClickToFocus extends AppObjectController_1.AppObjectController {
|
|
|
16
19
|
(_a = this.centerOnPixelUI) === null || _a === void 0 ? void 0 : _a.centerOnPixel(e.position);
|
|
17
20
|
}
|
|
18
21
|
};
|
|
19
|
-
this.centerOnPixelUI = appObject.getComponent(CenterSceneRootOnPixelPick_1.CenterSceneRootOnPixelPickUC.type);
|
|
20
|
-
if (!this.centerOnPixelUI) {
|
|
21
|
-
this.warn("Controller has been added to an App Object that does not have CenterSceneRootOnPixelPickUC. Add one first.");
|
|
22
|
-
return;
|
|
23
|
-
}
|
|
24
22
|
const mouseInput = MouseInput_1.MouseInputEntity.get(this.appObjects);
|
|
25
23
|
if (mouseInput) {
|
|
26
24
|
mouseInput.registerController(this);
|
|
@@ -29,6 +27,9 @@ class MouseClickToFocus extends AppObjectController_1.AppObjectController {
|
|
|
29
27
|
this.warn("Unable to find MouseInputEntity");
|
|
30
28
|
}
|
|
31
29
|
}
|
|
30
|
+
get centerOnPixelUI() {
|
|
31
|
+
return this.getCachedLocalComponent(CenterSceneRootOnPixelPick_1.CenterSceneRootOnPixelPickUC.type);
|
|
32
|
+
}
|
|
32
33
|
}
|
|
33
34
|
exports.MouseClickToFocus = MouseClickToFocus;
|
|
34
35
|
MouseClickToFocus.type = "MouseClickToFocus";
|
|
@@ -4,7 +4,7 @@ import { MouseController, MouseInputEvent } from "../../MouseInput";
|
|
|
4
4
|
export declare class MouseDoubleClickToRecenter extends AppObjectController implements MouseController {
|
|
5
5
|
static readonly type = "MouseDoubleClickToRecenter";
|
|
6
6
|
protected focusDurationMS: number;
|
|
7
|
-
private focusUC
|
|
7
|
+
private get focusUC();
|
|
8
8
|
allow: (e: MouseInputEvent) => boolean;
|
|
9
9
|
onDoubleClick: (e: MouseInputEvent) => void;
|
|
10
10
|
constructor(appObject: AppObject);
|
|
@@ -17,11 +17,6 @@ class MouseDoubleClickToRecenter extends AppObjectController_1.AppObjectControll
|
|
|
17
17
|
(_a = this.focusUC) === null || _a === void 0 ? void 0 : _a.centerOnPixel(e.position);
|
|
18
18
|
}
|
|
19
19
|
};
|
|
20
|
-
this.focusUC = appObject.getComponent(FocusOnPixel_1.FocusOnPixelUC.type);
|
|
21
|
-
if (!this.focusUC) {
|
|
22
|
-
this.warn("Controller has been added to an App Object that does not have FocusOnPixelUC. Add one first.");
|
|
23
|
-
return;
|
|
24
|
-
}
|
|
25
20
|
const mouseInput = MouseInput_1.MouseInputEntity.get(this.appObjects);
|
|
26
21
|
if (mouseInput) {
|
|
27
22
|
mouseInput.registerController(this);
|
|
@@ -30,6 +25,9 @@ class MouseDoubleClickToRecenter extends AppObjectController_1.AppObjectControll
|
|
|
30
25
|
this.warn("Unable to find MouseInputEntity");
|
|
31
26
|
}
|
|
32
27
|
}
|
|
28
|
+
get focusUC() {
|
|
29
|
+
return this.getCachedLocalComponent(FocusOnPixel_1.FocusOnPixelUC.type);
|
|
30
|
+
}
|
|
33
31
|
}
|
|
34
32
|
exports.MouseDoubleClickToRecenter = MouseDoubleClickToRecenter;
|
|
35
33
|
MouseDoubleClickToRecenter.type = "MouseDoubleClickToRecenter";
|
|
@@ -4,7 +4,8 @@ import { MouseController, MouseInputEvent } from "../../MouseInput";
|
|
|
4
4
|
export declare class MouseOrbit extends AppObjectController implements MouseController {
|
|
5
5
|
static readonly type = "MouseOrbit";
|
|
6
6
|
private isOrbiting;
|
|
7
|
-
private orbitSceneRoot
|
|
7
|
+
private get orbitSceneRoot();
|
|
8
|
+
private get toolRepo();
|
|
8
9
|
allow: (e: MouseInputEvent) => boolean;
|
|
9
10
|
onDown: (e: MouseInputEvent) => void;
|
|
10
11
|
onMove: (e: MouseInputEvent) => void;
|
|
@@ -3,13 +3,25 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.MouseOrbit = void 0;
|
|
4
4
|
const AppObjectController_1 = require("../../../AppObject/AppObjectController");
|
|
5
5
|
const MouseInput_1 = require("../../MouseInput");
|
|
6
|
+
const Tools_1 = require("../../Tools");
|
|
6
7
|
const OrbitSceneRoot_1 = require("../UC/OrbitSceneRoot");
|
|
7
8
|
class MouseOrbit extends AppObjectController_1.AppObjectController {
|
|
8
9
|
constructor(appObject) {
|
|
9
10
|
super(appObject, MouseOrbit.type);
|
|
10
11
|
this.isOrbiting = false;
|
|
11
12
|
this.allow = (e) => {
|
|
12
|
-
|
|
13
|
+
var _a;
|
|
14
|
+
const orbitTool = (_a = this.toolRepo) === null || _a === void 0 ? void 0 : _a.getTool("ORBIT");
|
|
15
|
+
if (!orbitTool)
|
|
16
|
+
return false;
|
|
17
|
+
const orbitToolIsActive = orbitTool.state === Tools_1.ToolState.ACTIVE;
|
|
18
|
+
if (e.button === 0 && orbitToolIsActive) {
|
|
19
|
+
return true;
|
|
20
|
+
}
|
|
21
|
+
else if (e.button === 2) {
|
|
22
|
+
return true;
|
|
23
|
+
}
|
|
24
|
+
return false;
|
|
13
25
|
};
|
|
14
26
|
this.onDown = (e) => {
|
|
15
27
|
this.isOrbiting = false;
|
|
@@ -35,11 +47,6 @@ class MouseOrbit extends AppObjectController_1.AppObjectController {
|
|
|
35
47
|
this.orbitSceneRoot.finishOrbit();
|
|
36
48
|
this.isOrbiting = false;
|
|
37
49
|
};
|
|
38
|
-
this.orbitSceneRoot = appObject.getComponent(OrbitSceneRoot_1.OrbitSceneRootUC.type);
|
|
39
|
-
if (!this.orbitSceneRoot) {
|
|
40
|
-
this.warn("Controller has been added to an App Object that does not have OrbitSceneRootUC. Add one first.");
|
|
41
|
-
return;
|
|
42
|
-
}
|
|
43
50
|
const mouseInput = MouseInput_1.MouseInputEntity.get(this.appObjects);
|
|
44
51
|
if (mouseInput) {
|
|
45
52
|
mouseInput.registerController(this);
|
|
@@ -48,6 +55,12 @@ class MouseOrbit extends AppObjectController_1.AppObjectController {
|
|
|
48
55
|
this.warn("Unable to find MouseInputEntity");
|
|
49
56
|
}
|
|
50
57
|
}
|
|
58
|
+
get orbitSceneRoot() {
|
|
59
|
+
return this.getCachedLocalComponent(OrbitSceneRoot_1.OrbitSceneRootUC.type);
|
|
60
|
+
}
|
|
61
|
+
get toolRepo() {
|
|
62
|
+
return this.getCachedSingleton(Tools_1.ToolRepository.type);
|
|
63
|
+
}
|
|
51
64
|
}
|
|
52
65
|
exports.MouseOrbit = MouseOrbit;
|
|
53
66
|
MouseOrbit.type = "MouseOrbit";
|
|
@@ -4,8 +4,9 @@ import { MouseController, MouseInputEvent } from "../../MouseInput";
|
|
|
4
4
|
export declare class MousePan extends AppObjectController implements MouseController {
|
|
5
5
|
static readonly type = "MousePan";
|
|
6
6
|
private doPan;
|
|
7
|
+
private get panRootUC();
|
|
8
|
+
private get toolRepo();
|
|
7
9
|
allow: (e: MouseInputEvent) => boolean;
|
|
8
|
-
private panRootUC?;
|
|
9
10
|
onDown: (e: MouseInputEvent) => void;
|
|
10
11
|
onMove: (e: MouseInputEvent) => void;
|
|
11
12
|
onUp: () => void;
|
|
@@ -3,13 +3,25 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.MousePan = void 0;
|
|
4
4
|
const AppObjectController_1 = require("../../../AppObject/AppObjectController");
|
|
5
5
|
const MouseInput_1 = require("../../MouseInput");
|
|
6
|
+
const Tools_1 = require("../../Tools");
|
|
6
7
|
const PanSceneRoot_1 = require("../UC/PanSceneRoot");
|
|
7
8
|
class MousePan extends AppObjectController_1.AppObjectController {
|
|
8
9
|
constructor(appObject) {
|
|
9
10
|
super(appObject, MousePan.type);
|
|
10
11
|
this.doPan = false;
|
|
11
12
|
this.allow = (e) => {
|
|
12
|
-
|
|
13
|
+
var _a;
|
|
14
|
+
const panTool = (_a = this.toolRepo) === null || _a === void 0 ? void 0 : _a.getTool("PAN");
|
|
15
|
+
if (!panTool)
|
|
16
|
+
return false;
|
|
17
|
+
const panToolIsActive = panTool.state === Tools_1.ToolState.ACTIVE;
|
|
18
|
+
if (e.button === 0 && panToolIsActive) {
|
|
19
|
+
return true;
|
|
20
|
+
}
|
|
21
|
+
else if (e.button === 1) {
|
|
22
|
+
return true;
|
|
23
|
+
}
|
|
24
|
+
return false;
|
|
13
25
|
};
|
|
14
26
|
this.onDown = (e) => {
|
|
15
27
|
var _a;
|
|
@@ -30,11 +42,6 @@ class MousePan extends AppObjectController_1.AppObjectController {
|
|
|
30
42
|
this.doPan = false;
|
|
31
43
|
(_a = this.panRootUC) === null || _a === void 0 ? void 0 : _a.finishPan();
|
|
32
44
|
};
|
|
33
|
-
this.panRootUC = appObject.getComponent(PanSceneRoot_1.PanSceneRootUC.type);
|
|
34
|
-
if (!this.panRootUC) {
|
|
35
|
-
this.warn("Controller has been added to an App Object that does not have PanSceneRootUC. Add one first.");
|
|
36
|
-
return;
|
|
37
|
-
}
|
|
38
45
|
const mouseInput = MouseInput_1.MouseInputEntity.get(this.appObjects);
|
|
39
46
|
if (mouseInput) {
|
|
40
47
|
mouseInput.registerController(this);
|
|
@@ -43,6 +50,12 @@ class MousePan extends AppObjectController_1.AppObjectController {
|
|
|
43
50
|
this.warn("Unable to find MouseInputEntity");
|
|
44
51
|
}
|
|
45
52
|
}
|
|
53
|
+
get panRootUC() {
|
|
54
|
+
return this.getCachedLocalComponent(PanSceneRoot_1.PanSceneRootUC.type);
|
|
55
|
+
}
|
|
56
|
+
get toolRepo() {
|
|
57
|
+
return this.getCachedSingleton(Tools_1.ToolRepository.type);
|
|
58
|
+
}
|
|
46
59
|
}
|
|
47
60
|
exports.MousePan = MousePan;
|
|
48
61
|
MousePan.type = "MousePan";
|
|
@@ -3,7 +3,7 @@ import { AppObjectController } from "../../../AppObject/AppObjectController";
|
|
|
3
3
|
import { MouseController, MouseWheelEvent } from "../../MouseInput";
|
|
4
4
|
export declare class MouseRoll extends AppObjectController implements MouseController {
|
|
5
5
|
static readonly type = "MouseRoll";
|
|
6
|
-
private bumpRootScaleUC
|
|
6
|
+
private get bumpRootScaleUC();
|
|
7
7
|
allow: (e: MouseWheelEvent) => boolean;
|
|
8
8
|
onWheel: (e: MouseWheelEvent) => void;
|
|
9
9
|
constructor(appObject: AppObject);
|
|
@@ -18,11 +18,6 @@ class MouseRoll extends AppObjectController_1.AppObjectController {
|
|
|
18
18
|
}
|
|
19
19
|
this.bumpRootScaleUC.bump(e.event.deltaY > 0 ? "OUT" : "IN", e.position);
|
|
20
20
|
};
|
|
21
|
-
this.bumpRootScaleUC = appObject.getComponent(BumpSceneRootScaleAboutPixelPoint_1.BumpSceneRootScaleAboutPixelPointUC.type);
|
|
22
|
-
if (!this.bumpRootScaleUC) {
|
|
23
|
-
this.warn("Controller has been added to an App Object that does not have BumpSceneRootScaleAboutPixelPointUC. Add one first.");
|
|
24
|
-
return;
|
|
25
|
-
}
|
|
26
21
|
const mouseInput = MouseInput_1.MouseInputEntity.get(this.appObjects);
|
|
27
22
|
if (mouseInput) {
|
|
28
23
|
mouseInput.registerController(this);
|
|
@@ -31,6 +26,9 @@ class MouseRoll extends AppObjectController_1.AppObjectController {
|
|
|
31
26
|
this.warn("Unable to find MouseInputEntity");
|
|
32
27
|
}
|
|
33
28
|
}
|
|
29
|
+
get bumpRootScaleUC() {
|
|
30
|
+
return this.getCachedLocalComponent(BumpSceneRootScaleAboutPixelPoint_1.BumpSceneRootScaleAboutPixelPointUC.type);
|
|
31
|
+
}
|
|
34
32
|
}
|
|
35
33
|
exports.MouseRoll = MouseRoll;
|
|
36
34
|
MouseRoll.type = "MouseRoll";
|
|
@@ -4,7 +4,8 @@ import { MouseController, MouseInputEvent } from "../../MouseInput";
|
|
|
4
4
|
export declare class MouseScale extends AppObjectController implements MouseController {
|
|
5
5
|
static readonly type = "MouseScale";
|
|
6
6
|
private isDollying;
|
|
7
|
-
private dragScaleRootUC
|
|
7
|
+
private get dragScaleRootUC();
|
|
8
|
+
private get toolRepo();
|
|
8
9
|
allow: (e: MouseInputEvent) => boolean;
|
|
9
10
|
onDown: (e: MouseInputEvent) => void;
|
|
10
11
|
onMove: (e: MouseInputEvent) => void;
|
|
@@ -3,13 +3,22 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.MouseScale = void 0;
|
|
4
4
|
const AppObjectController_1 = require("../../../AppObject/AppObjectController");
|
|
5
5
|
const MouseInput_1 = require("../../MouseInput");
|
|
6
|
+
const Tools_1 = require("../../Tools");
|
|
6
7
|
const DragScaleSceneRoot_1 = require("../UC/DragScaleSceneRoot");
|
|
7
8
|
class MouseScale extends AppObjectController_1.AppObjectController {
|
|
8
9
|
constructor(appObject) {
|
|
9
10
|
super(appObject, MouseScale.type);
|
|
10
11
|
this.isDollying = false;
|
|
11
12
|
this.allow = (e) => {
|
|
12
|
-
|
|
13
|
+
var _a;
|
|
14
|
+
const zoomTool = (_a = this.toolRepo) === null || _a === void 0 ? void 0 : _a.getTool("ZOOM");
|
|
15
|
+
if (!zoomTool)
|
|
16
|
+
return false;
|
|
17
|
+
const zoomToolIsActive = zoomTool.state === Tools_1.ToolState.ACTIVE;
|
|
18
|
+
if (e.button === 0 && zoomToolIsActive) {
|
|
19
|
+
return true;
|
|
20
|
+
}
|
|
21
|
+
return false;
|
|
13
22
|
};
|
|
14
23
|
this.onDown = (e) => {
|
|
15
24
|
var _a;
|
|
@@ -31,11 +40,6 @@ class MouseScale extends AppObjectController_1.AppObjectController {
|
|
|
31
40
|
this.isDollying = false;
|
|
32
41
|
(_a = this.dragScaleRootUC) === null || _a === void 0 ? void 0 : _a.finishScaling();
|
|
33
42
|
};
|
|
34
|
-
this.dragScaleRootUC = appObject.getComponent(DragScaleSceneRoot_1.DragScaleSceneRootUC.type);
|
|
35
|
-
if (!this.dragScaleRootUC) {
|
|
36
|
-
this.warn("Controller has been added to an App Object that does not have DragScaleSceneRootUC. Add one first.");
|
|
37
|
-
return;
|
|
38
|
-
}
|
|
39
43
|
const mouseInput = MouseInput_1.MouseInputEntity.get(this.appObjects);
|
|
40
44
|
if (mouseInput) {
|
|
41
45
|
mouseInput.registerController(this);
|
|
@@ -44,6 +48,12 @@ class MouseScale extends AppObjectController_1.AppObjectController {
|
|
|
44
48
|
this.warn("Unable to find MouseInputEntity");
|
|
45
49
|
}
|
|
46
50
|
}
|
|
51
|
+
get dragScaleRootUC() {
|
|
52
|
+
return this.getCachedLocalComponent(DragScaleSceneRoot_1.DragScaleSceneRootUC.type);
|
|
53
|
+
}
|
|
54
|
+
get toolRepo() {
|
|
55
|
+
return this.getCachedSingleton(Tools_1.ToolRepository.type);
|
|
56
|
+
}
|
|
47
57
|
}
|
|
48
58
|
exports.MouseScale = MouseScale;
|
|
49
59
|
MouseScale.type = "MouseScale";
|
|
@@ -3,8 +3,8 @@ import { AppObjectController } from "../../../AppObject/AppObjectController";
|
|
|
3
3
|
import { StylusController } from "../../Stylus";
|
|
4
4
|
export declare class ScaleSceneRootSC extends AppObjectController implements StylusController {
|
|
5
5
|
static readonly type = "ScaleSceneRootSC";
|
|
6
|
-
private stylus
|
|
7
|
-
private scaleSceneRootWithRay
|
|
6
|
+
private get stylus();
|
|
7
|
+
private get scaleSceneRootWithRay();
|
|
8
8
|
private isScaling;
|
|
9
9
|
allow: (button: number) => boolean;
|
|
10
10
|
onButtonDown: (button: number) => void;
|
|
@@ -6,6 +6,7 @@ const ScaleSceneRootWithRay_1 = require("../UC/ScaleSceneRootWithRay");
|
|
|
6
6
|
const Stylus_1 = require("../../Stylus");
|
|
7
7
|
class ScaleSceneRootSC extends AppObjectController_1.AppObjectController {
|
|
8
8
|
constructor(appObject) {
|
|
9
|
+
var _a;
|
|
9
10
|
super(appObject, ScaleSceneRootSC.type);
|
|
10
11
|
this.isScaling = false;
|
|
11
12
|
this.allow = (button) => {
|
|
@@ -38,17 +39,13 @@ class ScaleSceneRootSC extends AppObjectController_1.AppObjectController {
|
|
|
38
39
|
this.onButtonUp = () => {
|
|
39
40
|
this.isScaling = false;
|
|
40
41
|
};
|
|
41
|
-
this.stylus
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
this.error("StylusMoveSceneRoot has been added to an App Object that does not have a scaleSceneRootWithRay");
|
|
49
|
-
return;
|
|
50
|
-
}
|
|
51
|
-
this.stylus.registerController(this);
|
|
42
|
+
(_a = this.stylus) === null || _a === void 0 ? void 0 : _a.registerController(this);
|
|
43
|
+
}
|
|
44
|
+
get stylus() {
|
|
45
|
+
return this.getCachedSingleton(Stylus_1.StylusEntity.type);
|
|
46
|
+
}
|
|
47
|
+
get scaleSceneRootWithRay() {
|
|
48
|
+
return this.getCachedLocalComponent(ScaleSceneRootWithRay_1.ScaleSceneRootWithRay.type);
|
|
52
49
|
}
|
|
53
50
|
}
|
|
54
51
|
exports.ScaleSceneRootSC = ScaleSceneRootSC;
|
|
@@ -3,8 +3,8 @@ import { AppObjectController } from "../../../AppObject/AppObjectController";
|
|
|
3
3
|
import { StylusController } from "../../Stylus";
|
|
4
4
|
export declare class SceneRootMoveSC extends AppObjectController implements StylusController {
|
|
5
5
|
static readonly type = "SceneRootMoveSC";
|
|
6
|
-
private stylus
|
|
7
|
-
private stylusRootMovementUC
|
|
6
|
+
private get stylus();
|
|
7
|
+
private get stylusRootMovementUC();
|
|
8
8
|
private isMoving;
|
|
9
9
|
allow: (button: number) => boolean;
|
|
10
10
|
onButtonDown: (button: number) => void;
|
|
@@ -6,10 +6,11 @@ const Stylus_1 = require("../../Stylus");
|
|
|
6
6
|
const StylusMoveTransformUC_1 = require("../../Transform3D/UC/StylusMoveTransformUC");
|
|
7
7
|
class SceneRootMoveSC extends AppObjectController_1.AppObjectController {
|
|
8
8
|
constructor(appObject) {
|
|
9
|
+
var _a;
|
|
9
10
|
super(appObject, SceneRootMoveSC.type);
|
|
10
11
|
this.isMoving = false;
|
|
11
12
|
this.allow = (button) => {
|
|
12
|
-
if (button ===
|
|
13
|
+
if (button === 2)
|
|
13
14
|
return true;
|
|
14
15
|
return false;
|
|
15
16
|
};
|
|
@@ -36,17 +37,13 @@ class SceneRootMoveSC extends AppObjectController_1.AppObjectController {
|
|
|
36
37
|
return;
|
|
37
38
|
(_a = this.stylusRootMovementUC) === null || _a === void 0 ? void 0 : _a.move();
|
|
38
39
|
};
|
|
39
|
-
this.stylus
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
this.error("StylusMoveSceneRoot has been added to an App Object that does not have a StylusMoveTransformUC");
|
|
47
|
-
return;
|
|
48
|
-
}
|
|
49
|
-
this.stylus.registerController(this);
|
|
40
|
+
(_a = this.stylus) === null || _a === void 0 ? void 0 : _a.registerController(this);
|
|
41
|
+
}
|
|
42
|
+
get stylus() {
|
|
43
|
+
return this.getCachedSingleton(Stylus_1.StylusEntity.type);
|
|
44
|
+
}
|
|
45
|
+
get stylusRootMovementUC() {
|
|
46
|
+
return this.getCachedLocalComponent(StylusMoveTransformUC_1.StylusMoveTransformUC.type);
|
|
50
47
|
}
|
|
51
48
|
}
|
|
52
49
|
exports.SceneRootMoveSC = SceneRootMoveSC;
|
|
@@ -4,7 +4,9 @@ import { TouchController, TouchInputEvent } from "../../TouchController";
|
|
|
4
4
|
export declare class TouchOrbit extends AppObjectController implements TouchController {
|
|
5
5
|
static readonly type = "TouchOrbit";
|
|
6
6
|
private isOrbiting;
|
|
7
|
-
|
|
7
|
+
ORBIT_FINGER_DISTANCE_PX: number;
|
|
8
|
+
private get orbitSceneRoot();
|
|
9
|
+
private get toolRepo();
|
|
8
10
|
allow: (e: TouchInputEvent) => boolean;
|
|
9
11
|
onTouchStart: (e: TouchInputEvent) => void;
|
|
10
12
|
onTouchMove: (e: TouchInputEvent) => void;
|
|
@@ -2,14 +2,31 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.TouchOrbit = void 0;
|
|
4
4
|
const AppObjectController_1 = require("../../../AppObject/AppObjectController");
|
|
5
|
+
const ValueObjects_1 = require("../../../ValueObjects");
|
|
6
|
+
const Tools_1 = require("../../Tools");
|
|
5
7
|
const TouchController_1 = require("../../TouchController");
|
|
6
8
|
const OrbitSceneRoot_1 = require("../UC/OrbitSceneRoot");
|
|
7
9
|
class TouchOrbit extends AppObjectController_1.AppObjectController {
|
|
8
10
|
constructor(appObject) {
|
|
9
11
|
super(appObject, TouchOrbit.type);
|
|
10
12
|
this.isOrbiting = false;
|
|
13
|
+
this.ORBIT_FINGER_DISTANCE_PX = 80;
|
|
11
14
|
this.allow = (e) => {
|
|
12
|
-
|
|
15
|
+
var _a;
|
|
16
|
+
const orbitTool = (_a = this.toolRepo) === null || _a === void 0 ? void 0 : _a.getTool("ORBIT");
|
|
17
|
+
if (!orbitTool)
|
|
18
|
+
return false;
|
|
19
|
+
const orbitToolIsActive = orbitTool.state === Tools_1.ToolState.ACTIVE;
|
|
20
|
+
if (e.touches.length === 1 && orbitToolIsActive) {
|
|
21
|
+
return true;
|
|
22
|
+
}
|
|
23
|
+
else if (e.touches.length === 2) {
|
|
24
|
+
const dist = ValueObjects_1.Vector2.Subtract(e.touches[0].position, e.touches[1].position).magnitued;
|
|
25
|
+
if (dist < this.ORBIT_FINGER_DISTANCE_PX) {
|
|
26
|
+
return true;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
return false;
|
|
13
30
|
};
|
|
14
31
|
this.onTouchStart = (e) => {
|
|
15
32
|
var _a, _b;
|
|
@@ -33,11 +50,6 @@ class TouchOrbit extends AppObjectController_1.AppObjectController {
|
|
|
33
50
|
(_a = this.orbitSceneRoot) === null || _a === void 0 ? void 0 : _a.finishOrbit();
|
|
34
51
|
};
|
|
35
52
|
const appObjects = appObject.appObjectRepo;
|
|
36
|
-
this.orbitSceneRoot = appObject.getComponent(OrbitSceneRoot_1.OrbitSceneRootUC.type);
|
|
37
|
-
if (!this.orbitSceneRoot) {
|
|
38
|
-
this.warn("Controller has been added to an App Object that does not have OrbitSceneRootUC. Add one first.");
|
|
39
|
-
return;
|
|
40
|
-
}
|
|
41
53
|
const touchInput = TouchController_1.TouchInputEntity.get(appObjects);
|
|
42
54
|
if (touchInput) {
|
|
43
55
|
touchInput.registerController(this);
|
|
@@ -46,6 +58,12 @@ class TouchOrbit extends AppObjectController_1.AppObjectController {
|
|
|
46
58
|
this.warn("Unable to find TouchInputEntity");
|
|
47
59
|
}
|
|
48
60
|
}
|
|
61
|
+
get orbitSceneRoot() {
|
|
62
|
+
return this.getCachedLocalComponent(OrbitSceneRoot_1.OrbitSceneRootUC.type);
|
|
63
|
+
}
|
|
64
|
+
get toolRepo() {
|
|
65
|
+
return this.getCachedSingleton(Tools_1.ToolRepository.type);
|
|
66
|
+
}
|
|
49
67
|
}
|
|
50
68
|
exports.TouchOrbit = TouchOrbit;
|
|
51
69
|
TouchOrbit.type = "TouchOrbit";
|
|
@@ -3,8 +3,10 @@ import { AppObjectController } from "../../../AppObject/AppObjectController";
|
|
|
3
3
|
import { TouchController, TouchInputEvent } from "../../TouchController";
|
|
4
4
|
export declare class TouchPan extends AppObjectController implements TouchController {
|
|
5
5
|
static readonly type = "TouchPan";
|
|
6
|
+
PAN_FINGER_DISTANCE_PX: number;
|
|
6
7
|
private isPanning;
|
|
7
|
-
private panRootUC
|
|
8
|
+
private get panRootUC();
|
|
9
|
+
private get toolRepo();
|
|
8
10
|
allow: (e: TouchInputEvent) => boolean;
|
|
9
11
|
onTouchStart: (e: TouchInputEvent) => void;
|
|
10
12
|
onTouchMove: (e: TouchInputEvent) => void;
|