@vived/app 4.30.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/Adapters/index.d.ts +1 -0
- package/lib/Components/InspectorTab/Adapters/index.js +13 -0
- package/lib/Components/InspectorTab/Adapters/inspectorTabAdapter.d.ts +3 -0
- package/lib/Components/InspectorTab/Adapters/inspectorTabAdapter.js +23 -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/clickSetInspectorTab.d.ts +2 -0
- package/lib/Components/InspectorTab/Controllers/clickSetInspectorTab.js +13 -0
- package/lib/Components/InspectorTab/Controllers/clickSetInspectorTabIndex.d.ts +2 -0
- package/lib/Components/InspectorTab/Controllers/clickSetInspectorTabIndex.js +13 -0
- package/lib/Components/InspectorTab/Controllers/index.d.ts +3 -0
- package/lib/Components/InspectorTab/Controllers/index.js +15 -0
- package/lib/Components/InspectorTab/Entities/InspectorTabEntity.d.ts +12 -0
- package/lib/Components/InspectorTab/Entities/InspectorTabEntity.js +54 -0
- package/lib/Components/InspectorTab/Entities/index.d.ts +1 -0
- package/lib/Components/InspectorTab/Entities/index.js +13 -0
- package/lib/Components/InspectorTab/Factories/index.d.ts +1 -0
- package/lib/Components/InspectorTab/Factories/index.js +13 -0
- package/lib/Components/InspectorTab/Factories/setupInspectorTabs.d.ts +2 -0
- package/lib/Components/InspectorTab/Factories/setupInspectorTabs.js +17 -0
- package/lib/Components/InspectorTab/Mocks/InspectorTabPmMock.d.ts +8 -0
- package/lib/Components/InspectorTab/Mocks/InspectorTabPmMock.js +15 -0
- package/lib/Components/InspectorTab/Mocks/index.d.ts +1 -0
- package/lib/Components/InspectorTab/Mocks/index.js +13 -0
- package/lib/Components/InspectorTab/PMs/InspectorTabPM.d.ts +12 -0
- package/lib/Components/InspectorTab/PMs/InspectorTabPM.js +55 -0
- package/lib/Components/InspectorTab/PMs/index.d.ts +1 -0
- package/lib/Components/InspectorTab/PMs/index.js +13 -0
- package/lib/Components/InspectorTab/index.d.ts +6 -0
- package/lib/Components/InspectorTab/index.js +18 -0
- package/lib/Components/MouseInput/Factories/index.d.ts +1 -0
- package/lib/Components/MouseInput/Factories/index.js +13 -0
- package/lib/Components/MouseInput/Factories/setupMouseInput.d.ts +2 -0
- package/lib/Components/MouseInput/Factories/setupMouseInput.js +9 -0
- package/lib/Components/MouseInput/index.d.ts +1 -0
- package/lib/Components/MouseInput/index.js +1 -0
- package/lib/Components/OverlayColor/UC/SerializeOverlayColoredObjects.d.ts +27 -0
- package/lib/Components/OverlayColor/UC/SerializeOverlayColoredObjects.js +87 -0
- package/lib/Components/OverlayColor/UC/index.d.ts +1 -0
- package/lib/Components/OverlayColor/UC/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/DragScaleSceneRootUcMock.d.ts +9 -0
- package/lib/Components/SceneRoot/Mocks/DragScaleSceneRootUcMock.js +13 -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/OrbitSceneRootUcMock.d.ts +11 -0
- package/lib/Components/SceneRoot/Mocks/OrbitSceneRootUcMock.js +15 -0
- package/lib/Components/SceneRoot/Mocks/PanSceneRootUcMock.d.ts +10 -0
- package/lib/Components/SceneRoot/Mocks/PanSceneRootUcMock.js +14 -0
- package/lib/Components/SceneRoot/Mocks/index.d.ts +5 -0
- package/lib/Components/SceneRoot/Mocks/index.js +17 -0
- 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/KeyboardToClearSelection.d.ts +8 -0
- package/lib/Components/Selection/Controller/KeyboardToClearSelection.js +23 -0
- package/lib/Components/Selection/Controller/index.d.ts +1 -0
- package/lib/Components/Selection/Controller/index.js +1 -0
- package/lib/Components/Selection/Factories/index.d.ts +1 -0
- package/lib/Components/Selection/Factories/index.js +13 -0
- package/lib/Components/Selection/Factories/setupSelection.d.ts +2 -0
- package/lib/Components/Selection/Factories/setupSelection.js +27 -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/Adapters/hasStoredViewAdapter.d.ts +2 -0
- package/lib/Components/StoredView/Adapters/hasStoredViewAdapter.js +19 -0
- package/lib/Components/StoredView/Adapters/index.d.ts +1 -0
- package/lib/Components/StoredView/Adapters/index.js +13 -0
- package/lib/Components/StoredView/Controllers/clearStoredView.d.ts +2 -0
- package/lib/Components/StoredView/Controllers/clearStoredView.js +13 -0
- package/lib/Components/StoredView/Controllers/index.d.ts +4 -0
- package/lib/Components/StoredView/Controllers/index.js +16 -0
- package/lib/Components/StoredView/Controllers/restoreStoredView.d.ts +2 -0
- package/lib/Components/StoredView/Controllers/restoreStoredView.js +13 -0
- package/lib/Components/StoredView/Controllers/setViewInXR.d.ts +2 -0
- package/lib/Components/StoredView/Controllers/setViewInXR.js +13 -0
- package/lib/Components/StoredView/Controllers/storeCurrentView.d.ts +2 -0
- package/lib/Components/StoredView/Controllers/storeCurrentView.js +13 -0
- package/lib/Components/StoredView/Factories/index.d.ts +1 -0
- package/lib/Components/StoredView/Factories/index.js +13 -0
- package/lib/Components/StoredView/Factories/setupStoredView.d.ts +2 -0
- package/lib/Components/StoredView/Factories/setupStoredView.js +21 -0
- package/lib/Components/StoredView/Mocks/ClearStoredViewUcMock.d.ts +8 -0
- package/lib/Components/StoredView/Mocks/ClearStoredViewUcMock.js +15 -0
- package/lib/Components/StoredView/Mocks/HasStoredViewPmMock.d.ts +8 -0
- package/lib/Components/StoredView/Mocks/HasStoredViewPmMock.js +15 -0
- package/lib/Components/StoredView/Mocks/RestoreStoredViewUcMock.d.ts +9 -0
- package/lib/Components/StoredView/Mocks/RestoreStoredViewUcMock.js +17 -0
- package/lib/Components/StoredView/Mocks/SetViewInXRUcMock.d.ts +8 -0
- package/lib/Components/StoredView/Mocks/SetViewInXRUcMock.js +15 -0
- package/lib/Components/StoredView/Mocks/StoreCurrentViewUcMock.d.ts +8 -0
- package/lib/Components/StoredView/Mocks/StoreCurrentViewUcMock.js +15 -0
- package/lib/Components/StoredView/Mocks/index.d.ts +1 -0
- package/lib/Components/StoredView/Mocks/index.js +13 -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/Factories/index.d.ts +1 -0
- package/lib/Components/Tools/Factories/index.js +13 -0
- package/lib/Components/Tools/Factories/setupTools.d.ts +3 -0
- package/lib/Components/Tools/Factories/setupTools.js +15 -0
- package/lib/Components/Tools/Factories/toolFactory.d.ts +3 -0
- package/lib/Components/Tools/Factories/toolFactory.js +14 -0
- 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/Factories/index.d.ts +1 -0
- package/lib/Components/TouchController/Factories/index.js +13 -0
- package/lib/Components/TouchController/Factories/setupTouchInput.d.ts +2 -0
- package/lib/Components/TouchController/Factories/setupTouchInput.js +9 -0
- package/lib/Components/TouchController/index.d.ts +1 -0
- package/lib/Components/TouchController/index.js +1 -0
- package/lib/Components/UndoRedo/Factories/index.d.ts +1 -0
- package/lib/Components/UndoRedo/Factories/index.js +13 -0
- package/lib/Components/UndoRedo/Factories/setupUndoRedo.d.ts +2 -0
- package/lib/Components/UndoRedo/Factories/setupUndoRedo.js +18 -0
- package/lib/Components/UndoRedo/UCs/UndoRedoButtonStatesHook.d.ts +11 -0
- package/lib/Components/UndoRedo/UCs/UndoRedoButtonStatesHook.js +55 -0
- package/lib/Components/UndoRedo/UCs/index.d.ts +1 -0
- package/lib/Components/UndoRedo/UCs/index.js +13 -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
|
@@ -11,3 +11,4 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
11
11
|
};
|
|
12
12
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
13
|
__exportStar(require("./SetOverlayColorUC"), exports);
|
|
14
|
+
__exportStar(require("./SerializeOverlayColoredObjects"), exports);
|
|
@@ -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;
|
|
@@ -2,14 +2,31 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.TouchPan = 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 PanSceneRoot_1 = require("../UC/PanSceneRoot");
|
|
7
9
|
class TouchPan extends AppObjectController_1.AppObjectController {
|
|
8
10
|
constructor(appObject) {
|
|
9
11
|
super(appObject, TouchPan.type);
|
|
12
|
+
this.PAN_FINGER_DISTANCE_PX = 80;
|
|
10
13
|
this.isPanning = false;
|
|
11
14
|
this.allow = (e) => {
|
|
12
|
-
|
|
15
|
+
var _a;
|
|
16
|
+
const panTool = (_a = this.toolRepo) === null || _a === void 0 ? void 0 : _a.getTool("PAN");
|
|
17
|
+
if (!panTool)
|
|
18
|
+
return false;
|
|
19
|
+
const panToolIsAcvtive = panTool.state === Tools_1.ToolState.ACTIVE;
|
|
20
|
+
if (e.touches.length === 1 && panToolIsAcvtive) {
|
|
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.PAN_FINGER_DISTANCE_PX) {
|
|
26
|
+
return true;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
return false;
|
|
13
30
|
};
|
|
14
31
|
this.onTouchStart = (e) => {
|
|
15
32
|
var _a, _b;
|
|
@@ -34,11 +51,6 @@ class TouchPan extends AppObjectController_1.AppObjectController {
|
|
|
34
51
|
(_a = this.panRootUC) === null || _a === void 0 ? void 0 : _a.finishPan();
|
|
35
52
|
};
|
|
36
53
|
const appObjects = appObject.appObjectRepo;
|
|
37
|
-
this.panRootUC = appObject.getComponent(PanSceneRoot_1.PanSceneRootUC.type);
|
|
38
|
-
if (!this.panRootUC) {
|
|
39
|
-
this.warn("Controller has been added to an App Object that does not have PanSceneRootUC. Add one first.");
|
|
40
|
-
return;
|
|
41
|
-
}
|
|
42
54
|
const touchInput = TouchController_1.TouchInputEntity.get(appObjects);
|
|
43
55
|
if (touchInput) {
|
|
44
56
|
touchInput.registerController(this);
|
|
@@ -47,6 +59,12 @@ class TouchPan extends AppObjectController_1.AppObjectController {
|
|
|
47
59
|
this.warn("Unable to find TouchInputEntity");
|
|
48
60
|
}
|
|
49
61
|
}
|
|
62
|
+
get panRootUC() {
|
|
63
|
+
return this.getCachedLocalComponent(PanSceneRoot_1.PanSceneRootUC.type);
|
|
64
|
+
}
|
|
65
|
+
get toolRepo() {
|
|
66
|
+
return this.getCachedSingleton(Tools_1.ToolRepository.type);
|
|
67
|
+
}
|
|
50
68
|
}
|
|
51
69
|
exports.TouchPan = TouchPan;
|
|
52
70
|
TouchPan.type = "TouchPan";
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { AppObject } from "../../../AppObject/AppObject";
|
|
2
2
|
import { AppObjectController } from "../../../AppObject/AppObjectController";
|
|
3
3
|
import { TouchController, TouchInputEvent } from "../../TouchController";
|
|
4
|
-
import { PinchSceneRootUC } from "../UC/PinchSceneRoot";
|
|
5
4
|
export declare class TouchPinch extends AppObjectController implements TouchController {
|
|
6
5
|
static readonly type = "TouchPinch";
|
|
7
6
|
private isPinching;
|
|
8
|
-
|
|
7
|
+
PAN_FINGER_DISTANCE_PX: number;
|
|
8
|
+
private get pinchRootUC();
|
|
9
9
|
allow: (e: TouchInputEvent) => boolean;
|
|
10
10
|
onTouchStart: (e: TouchInputEvent) => void;
|
|
11
11
|
onTouchMove: (e: TouchInputEvent) => void;
|
|
@@ -2,14 +2,22 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.TouchPinch = void 0;
|
|
4
4
|
const AppObjectController_1 = require("../../../AppObject/AppObjectController");
|
|
5
|
+
const ValueObjects_1 = require("../../../ValueObjects");
|
|
5
6
|
const TouchController_1 = require("../../TouchController");
|
|
6
7
|
const PinchSceneRoot_1 = require("../UC/PinchSceneRoot");
|
|
7
8
|
class TouchPinch extends AppObjectController_1.AppObjectController {
|
|
8
9
|
constructor(appObject) {
|
|
9
10
|
super(appObject, TouchPinch.type);
|
|
10
11
|
this.isPinching = false;
|
|
12
|
+
this.PAN_FINGER_DISTANCE_PX = 80;
|
|
11
13
|
this.allow = (e) => {
|
|
12
|
-
|
|
14
|
+
if (e.touches.length === 2) {
|
|
15
|
+
const dist = ValueObjects_1.Vector2.Subtract(e.touches[0].position, e.touches[1].position).magnitued;
|
|
16
|
+
if (dist > this.PAN_FINGER_DISTANCE_PX) {
|
|
17
|
+
return true;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
return false;
|
|
13
21
|
};
|
|
14
22
|
this.onTouchStart = (e) => {
|
|
15
23
|
var _a;
|
|
@@ -37,11 +45,6 @@ class TouchPinch extends AppObjectController_1.AppObjectController {
|
|
|
37
45
|
(_a = this.pinchRootUC) === null || _a === void 0 ? void 0 : _a.finishPinch();
|
|
38
46
|
};
|
|
39
47
|
const appObjects = appObject.appObjectRepo;
|
|
40
|
-
this.pinchRootUC = appObject.getComponent(PinchSceneRoot_1.PinchSceneRootUC.type);
|
|
41
|
-
if (!this.pinchRootUC) {
|
|
42
|
-
this.warn("Controller has been added to an App Object that does not have PinchSceneRootUC. Add one first.");
|
|
43
|
-
return;
|
|
44
|
-
}
|
|
45
48
|
const touchInput = TouchController_1.TouchInputEntity.get(appObjects);
|
|
46
49
|
if (touchInput) {
|
|
47
50
|
touchInput.registerController(this);
|
|
@@ -50,6 +53,9 @@ class TouchPinch extends AppObjectController_1.AppObjectController {
|
|
|
50
53
|
this.warn("Unable to find TouchInputEntity");
|
|
51
54
|
}
|
|
52
55
|
}
|
|
56
|
+
get pinchRootUC() {
|
|
57
|
+
return this.getCachedLocalComponent(PinchSceneRoot_1.PinchSceneRootUC.type);
|
|
58
|
+
}
|
|
53
59
|
}
|
|
54
60
|
exports.TouchPinch = TouchPinch;
|
|
55
61
|
TouchPinch.type = "TouchPinch";
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { AppObject } from "../../../AppObject/AppObject";
|
|
2
2
|
import { AppObjectController } from "../../../AppObject/AppObjectController";
|
|
3
3
|
import { TouchController, TouchInputEvent } from "../../TouchController";
|
|
4
|
-
import { DragScaleSceneRootUC } from "../UC/DragScaleSceneRoot";
|
|
5
4
|
export declare class TouchScale extends AppObjectController implements TouchController {
|
|
6
5
|
static readonly type = "TouchScale";
|
|
7
6
|
private isScaling;
|
|
8
|
-
dragScaleRootUC
|
|
7
|
+
private get dragScaleRootUC();
|
|
8
|
+
private get toolRepo();
|
|
9
9
|
allow: (e: TouchInputEvent) => boolean;
|
|
10
10
|
onTouchStart: (e: TouchInputEvent) => void;
|
|
11
11
|
onTouchMove: (e: TouchInputEvent) => void;
|