@vived/app 4.29.0 → 4.31.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/ChannelModel/Adapters/index.d.ts +1 -0
- package/lib/Components/ChannelModel/Adapters/index.js +1 -0
- package/lib/Components/ChannelModel/Adapters/modelObjectsAreStickableAdapter.d.ts +2 -0
- package/lib/Components/ChannelModel/Adapters/modelObjectsAreStickableAdapter.js +27 -0
- package/lib/Components/ChannelModel/Controllers/index.d.ts +1 -0
- package/lib/Components/ChannelModel/Controllers/index.js +1 -0
- package/lib/Components/ChannelModel/Controllers/stickAllActiveObjects.d.ts +2 -0
- package/lib/Components/ChannelModel/Controllers/stickAllActiveObjects.js +23 -0
- package/lib/Components/ChannelModel/Mocks/ModelObjectsAreStickableMock.d.ts +7 -0
- package/lib/Components/ChannelModel/Mocks/ModelObjectsAreStickableMock.js +11 -0
- package/lib/Components/ChannelModel/Mocks/StickAllChannelModelObjectsUCMock.d.ts +9 -0
- package/lib/Components/ChannelModel/Mocks/StickAllChannelModelObjectsUCMock.js +13 -0
- package/lib/Components/ChannelModel/Mocks/index.d.ts +2 -0
- package/lib/Components/ChannelModel/Mocks/index.js +2 -0
- package/lib/Components/ChannelModel/PMs/ModelObjectsAreStickablePM.d.ts +6 -0
- package/lib/Components/ChannelModel/PMs/ModelObjectsAreStickablePM.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/ChannelModel/UC/StickAllChannelModelObjectsUC.d.ts +7 -0
- package/lib/Components/ChannelModel/UC/StickAllChannelModelObjectsUC.js +87 -0
- package/lib/Components/ChannelModel/UC/index.d.ts +1 -0
- package/lib/Components/ChannelModel/UC/index.js +1 -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/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 +2 -0
- package/lib/Components/InspectorTab/Controllers/index.js +14 -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 +12 -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/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/Mocks/DragScaleSceneRootUcMock.d.ts +9 -0
- package/lib/Components/SceneRoot/Mocks/DragScaleSceneRootUcMock.js +13 -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 +2 -0
- package/lib/Components/SceneRoot/Mocks/index.js +14 -0
- package/lib/Components/Selection/Controller/KeyboardToClearSelection.d.ts +8 -0
- package/lib/Components/Selection/Controller/KeyboardToClearSelection.js +23 -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/Stick/Adapters/index.d.ts +1 -0
- package/lib/Components/Stick/Adapters/index.js +13 -0
- package/lib/Components/Stick/Adapters/stickTargetAdapter.d.ts +3 -0
- package/lib/Components/Stick/Adapters/stickTargetAdapter.js +23 -0
- package/lib/Components/Stick/Controllers/DoubleClickToStickMC.d.ts +15 -0
- package/lib/Components/Stick/Controllers/DoubleClickToStickMC.js +57 -0
- package/lib/Components/Stick/Controllers/DoubleTapToStickTC.d.ts +15 -0
- package/lib/Components/Stick/Controllers/DoubleTapToStickTC.js +52 -0
- package/lib/Components/Stick/Controllers/clickStick.d.ts +2 -0
- package/lib/Components/Stick/Controllers/clickStick.js +13 -0
- package/lib/Components/Stick/Controllers/index.d.ts +3 -0
- package/lib/Components/Stick/Controllers/index.js +15 -0
- package/lib/Components/Stick/Entities/Stickable.d.ts +22 -0
- package/lib/Components/Stick/Entities/Stickable.js +101 -0
- package/lib/Components/Stick/Entities/index.d.ts +1 -0
- package/lib/Components/Stick/Entities/index.js +13 -0
- package/lib/Components/Stick/Factories/index.d.ts +1 -0
- package/lib/Components/Stick/Factories/index.js +13 -0
- package/lib/Components/Stick/Factories/setupStick.d.ts +2 -0
- package/lib/Components/Stick/Factories/setupStick.js +15 -0
- package/lib/Components/Stick/Mocks/StickTargetPmMock.d.ts +7 -0
- package/lib/Components/Stick/Mocks/StickTargetPmMock.js +11 -0
- package/lib/Components/Stick/Mocks/StickUCMock.d.ts +7 -0
- package/lib/Components/Stick/Mocks/StickUCMock.js +11 -0
- package/lib/Components/Stick/Mocks/TryStickAppObjectUCMock.d.ts +10 -0
- package/lib/Components/Stick/Mocks/TryStickAppObjectUCMock.js +17 -0
- package/lib/Components/Stick/Mocks/index.d.ts +3 -0
- package/lib/Components/Stick/Mocks/index.js +15 -0
- package/lib/Components/Stick/PMs/StickTargetPM.d.ts +11 -0
- package/lib/Components/Stick/PMs/StickTargetPM.js +50 -0
- package/lib/Components/Stick/PMs/index.d.ts +1 -0
- package/lib/Components/Stick/PMs/index.js +13 -0
- package/lib/Components/Stick/UCs/PanTransformWithStickUC.d.ts +3 -0
- package/lib/Components/Stick/UCs/PanTransformWithStickUC.js +131 -0
- package/lib/Components/Stick/UCs/StickUC.d.ts +7 -0
- package/lib/Components/Stick/UCs/StickUC.js +71 -0
- package/lib/Components/Stick/UCs/TryPickStickTarget.d.ts +8 -0
- package/lib/Components/Stick/UCs/TryPickStickTarget.js +26 -0
- package/lib/Components/Stick/UCs/TryStickAppObjectUC.d.ts +10 -0
- package/lib/Components/Stick/UCs/TryStickAppObjectUC.js +74 -0
- package/lib/Components/Stick/UCs/index.d.ts +4 -0
- package/lib/Components/Stick/UCs/index.js +16 -0
- package/lib/Components/Stick/index.d.ts +7 -0
- package/lib/Components/Stick/index.js +19 -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/Stylus/Factories/index.d.ts +1 -0
- package/lib/Components/Stylus/Factories/index.js +13 -0
- package/lib/Components/Stylus/Factories/setupStylus.d.ts +2 -0
- package/lib/Components/Stylus/Factories/setupStylus.js +19 -0
- package/lib/Components/Stylus/index.d.ts +1 -0
- package/lib/Components/Stylus/index.js +1 -0
- 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/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/Transform3D/UC/PanTransformUC.d.ts +28 -1
- package/lib/Components/Transform3D/UC/PanTransformUC.js +52 -34
- package/lib/Components/Transform3D/UC/TryPanTransformUC.d.ts +3 -2
- package/lib/Components/Transform3D/UC/index.d.ts +0 -1
- package/lib/Components/Transform3D/UC/index.js +0 -1
- 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/index.d.ts +1 -0
- package/lib/Components/index.js +1 -0
- package/package.json +1 -1
|
@@ -12,6 +12,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
12
12
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
13
|
__exportStar(require("./Adapters"), exports);
|
|
14
14
|
__exportStar(require("./Entity"), exports);
|
|
15
|
+
__exportStar(require("./Factories"), exports);
|
|
15
16
|
__exportStar(require("./Mocks"), exports);
|
|
16
17
|
__exportStar(require("./PMs"), exports);
|
|
17
18
|
__exportStar(require("./UCs"), exports);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./setupTools";
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
5
|
+
}) : (function(o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
o[k2] = m[k];
|
|
8
|
+
}));
|
|
9
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
10
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
11
|
+
};
|
|
12
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
+
__exportStar(require("./setupTools"), exports);
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.setupTools = void 0;
|
|
4
|
+
const Controller_1 = require("../Controller");
|
|
5
|
+
const Entities_1 = require("../Entities");
|
|
6
|
+
const toolFactory_1 = require("./toolFactory");
|
|
7
|
+
function setupTools(appObjects, toolData) {
|
|
8
|
+
const ao = appObjects.getOrCreate("ToolRepo");
|
|
9
|
+
const toolRepo = Entities_1.makeToolRepo(ao);
|
|
10
|
+
toolRepo.toolFactory = toolFactory_1.makeToolFactory(appObjects);
|
|
11
|
+
toolRepo.setupToolsFromData(toolData);
|
|
12
|
+
new Controller_1.ToolHotkeys(ao);
|
|
13
|
+
return ao;
|
|
14
|
+
}
|
|
15
|
+
exports.setupTools = setupTools;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.makeToolFactory = void 0;
|
|
4
|
+
const Entities_1 = require("../Entities");
|
|
5
|
+
const PM_1 = require("../PM");
|
|
6
|
+
function makeToolFactory(appObjects) {
|
|
7
|
+
return function toolFactory(id) {
|
|
8
|
+
const ao = appObjects.getOrCreate(id);
|
|
9
|
+
const toolEntity = Entities_1.makeToolEntity(ao);
|
|
10
|
+
PM_1.makeToolPM(ao);
|
|
11
|
+
return toolEntity;
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
exports.makeToolFactory = makeToolFactory;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./setupTouchInput";
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
5
|
+
}) : (function(o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
o[k2] = m[k];
|
|
8
|
+
}));
|
|
9
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
10
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
11
|
+
};
|
|
12
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
+
__exportStar(require("./setupTouchInput"), exports);
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.setupTouchInput = void 0;
|
|
4
|
+
const Entities_1 = require("../Entities");
|
|
5
|
+
function setupTouchInput(appObject) {
|
|
6
|
+
const ao = appObject.getOrCreate("TouchInput");
|
|
7
|
+
Entities_1.makeTouchInput(ao);
|
|
8
|
+
}
|
|
9
|
+
exports.setupTouchInput = setupTouchInput;
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { AppObject, AppObjectRepo, AppObjectUC } from "../../../AppObject";
|
|
2
|
-
import { ParametricLine, Vector2 } from "../../../ValueObjects";
|
|
2
|
+
import { ParametricLine, ParametricPlane, Vector2, Vector3 } from "../../../ValueObjects";
|
|
3
|
+
import { UndoRedoEntity } from "../../UndoRedo";
|
|
4
|
+
import { Transform3D } from "../Entities";
|
|
3
5
|
export declare abstract class PanTransformUC extends AppObjectUC {
|
|
4
6
|
static readonly type = "PanTransformUC";
|
|
5
7
|
abstract minX?: number;
|
|
@@ -18,3 +20,28 @@ export declare abstract class PanTransformUC extends AppObjectUC {
|
|
|
18
20
|
static get(id: string, appObjects: AppObjectRepo): PanTransformUC | undefined;
|
|
19
21
|
}
|
|
20
22
|
export declare function makePanTransformUC(appObject: AppObject): PanTransformUC;
|
|
23
|
+
export declare class PanTransformUCImp extends PanTransformUC {
|
|
24
|
+
minX?: number | undefined;
|
|
25
|
+
maxX?: number | undefined;
|
|
26
|
+
minY?: number | undefined;
|
|
27
|
+
maxY?: number | undefined;
|
|
28
|
+
enabled: boolean;
|
|
29
|
+
protected panPlane: ParametricPlane;
|
|
30
|
+
dispatchStateChangeOnComplete: boolean;
|
|
31
|
+
submitUndoOnComplete: boolean;
|
|
32
|
+
protected pickOffset: Vector3;
|
|
33
|
+
protected initialPosition: Vector3;
|
|
34
|
+
protected hasBeenInitialized: boolean;
|
|
35
|
+
protected get transformNode(): Transform3D | undefined;
|
|
36
|
+
protected get undoRedo(): UndoRedoEntity | undefined;
|
|
37
|
+
protected get dispatchStateChange(): (() => void) | undefined;
|
|
38
|
+
initializePixel: (initialPixelPos: Vector2) => void;
|
|
39
|
+
updatePixel: (pixelPosition: Vector2) => void;
|
|
40
|
+
initializeRay: (ray: ParametricLine) => void;
|
|
41
|
+
updateRay: (ray: ParametricLine) => void;
|
|
42
|
+
protected enforceBoundaries(wPos: Vector3): Vector3;
|
|
43
|
+
finish: () => void;
|
|
44
|
+
protected submitDispatchAndUndo(): void;
|
|
45
|
+
cancelPan: () => void;
|
|
46
|
+
constructor(appObject: AppObject);
|
|
47
|
+
}
|
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.makePanTransformUC = exports.PanTransformUC = void 0;
|
|
3
|
+
exports.PanTransformUCImp = exports.makePanTransformUC = exports.PanTransformUC = void 0;
|
|
4
4
|
const AppObject_1 = require("../../../AppObject");
|
|
5
5
|
const ValueObjects_1 = require("../../../ValueObjects");
|
|
6
6
|
const Babylon_1 = require("../../Babylon");
|
|
7
7
|
const Dispatcher_1 = require("../../Dispatcher");
|
|
8
8
|
const UndoRedo_1 = require("../../UndoRedo");
|
|
9
9
|
const Entities_1 = require("../Entities");
|
|
10
|
-
const MoveTransformUndoRedo_1 = require("./MoveTransformUndoRedo");
|
|
11
10
|
class PanTransformUC extends AppObject_1.AppObjectUC {
|
|
12
11
|
static get(id, appObjects) {
|
|
13
12
|
var _a;
|
|
@@ -49,7 +48,7 @@ class PanTransformUCImp extends PanTransformUC {
|
|
|
49
48
|
const rootPos = this.transformNode.worldPosition;
|
|
50
49
|
this.pickOffset = ValueObjects_1.Vector3.Subtract(rootPos, pick);
|
|
51
50
|
this.hasBeenInitialized = true;
|
|
52
|
-
this.initialPosition = this.transformNode.
|
|
51
|
+
this.initialPosition = this.transformNode.localPosition;
|
|
53
52
|
};
|
|
54
53
|
this.updateRay = (ray) => {
|
|
55
54
|
var _a;
|
|
@@ -60,44 +59,17 @@ class PanTransformUCImp extends PanTransformUC {
|
|
|
60
59
|
if (!this.enabled)
|
|
61
60
|
return;
|
|
62
61
|
const pick = (_a = this.panPlane.intersectLine(ray)) !== null && _a !== void 0 ? _a : ValueObjects_1.Vector3.Zero();
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
}
|
|
67
|
-
if (this.maxX !== undefined && wPos.x > this.maxX) {
|
|
68
|
-
wPos = new ValueObjects_1.Vector3(this.maxX, wPos.y, wPos.z);
|
|
69
|
-
}
|
|
70
|
-
if (this.minY !== undefined && wPos.y < this.minY) {
|
|
71
|
-
wPos = new ValueObjects_1.Vector3(wPos.x, this.minY, wPos.z);
|
|
72
|
-
}
|
|
73
|
-
if (this.maxY !== undefined && wPos.y > this.maxY) {
|
|
74
|
-
wPos = new ValueObjects_1.Vector3(wPos.x, this.maxY, wPos.z);
|
|
75
|
-
}
|
|
76
|
-
this.transformNode.worldPosition = wPos;
|
|
62
|
+
const wPos = ValueObjects_1.Vector3.Add(pick, this.pickOffset);
|
|
63
|
+
const clampedPos = this.enforceBoundaries(wPos);
|
|
64
|
+
this.transformNode.worldPosition = clampedPos;
|
|
77
65
|
};
|
|
78
66
|
this.finish = () => {
|
|
79
|
-
var _a, _b;
|
|
80
|
-
if (!this.transformNode)
|
|
81
|
-
return;
|
|
82
67
|
if (!this.hasBeenInitialized)
|
|
83
68
|
return;
|
|
84
69
|
if (!this.enabled)
|
|
85
70
|
return;
|
|
86
71
|
this.hasBeenInitialized = false;
|
|
87
|
-
|
|
88
|
-
return;
|
|
89
|
-
if (this.dispatchStateChangeOnComplete) {
|
|
90
|
-
Dispatcher_1.dispatchStateChange(this.appObjects);
|
|
91
|
-
}
|
|
92
|
-
if (this.submitUndoOnComplete) {
|
|
93
|
-
const undoDTO = {
|
|
94
|
-
endPosition: this.transformNode.localPosition,
|
|
95
|
-
endRotation: this.transformNode.localRotation,
|
|
96
|
-
startPosition: this.initialPosition,
|
|
97
|
-
startRotation: this.transformNode.localRotation,
|
|
98
|
-
};
|
|
99
|
-
(_b = this.undoRedo) === null || _b === void 0 ? void 0 : _b.submitAction(new MoveTransformUndoRedo_1.MoveTransformUndoRedo(undoDTO, this.transformNode, this.appObjects));
|
|
100
|
-
}
|
|
72
|
+
this.submitDispatchAndUndo();
|
|
101
73
|
};
|
|
102
74
|
this.cancelPan = () => {
|
|
103
75
|
this.hasBeenInitialized = false;
|
|
@@ -109,4 +81,50 @@ class PanTransformUCImp extends PanTransformUC {
|
|
|
109
81
|
get undoRedo() {
|
|
110
82
|
return this.getCachedSingleton(UndoRedo_1.UndoRedoEntity.type);
|
|
111
83
|
}
|
|
84
|
+
get dispatchStateChange() {
|
|
85
|
+
var _a;
|
|
86
|
+
return (_a = this.getCachedSingleton(Dispatcher_1.DispatchStateChangeUC.type)) === null || _a === void 0 ? void 0 : _a.doDispatch;
|
|
87
|
+
}
|
|
88
|
+
enforceBoundaries(wPos) {
|
|
89
|
+
let pos = wPos;
|
|
90
|
+
if (this.minX !== undefined && pos.x < this.minX) {
|
|
91
|
+
pos = new ValueObjects_1.Vector3(this.minX, pos.y, pos.z);
|
|
92
|
+
}
|
|
93
|
+
if (this.maxX !== undefined && pos.x > this.maxX) {
|
|
94
|
+
pos = new ValueObjects_1.Vector3(this.maxX, pos.y, pos.z);
|
|
95
|
+
}
|
|
96
|
+
if (this.minY !== undefined && pos.y < this.minY) {
|
|
97
|
+
pos = new ValueObjects_1.Vector3(pos.x, this.minY, pos.z);
|
|
98
|
+
}
|
|
99
|
+
if (this.maxY !== undefined && pos.y > this.maxY) {
|
|
100
|
+
pos = new ValueObjects_1.Vector3(pos.x, this.maxY, pos.z);
|
|
101
|
+
}
|
|
102
|
+
return pos;
|
|
103
|
+
}
|
|
104
|
+
submitDispatchAndUndo() {
|
|
105
|
+
var _a;
|
|
106
|
+
const dispatch = this.dispatchStateChange;
|
|
107
|
+
const transform = this.transformNode;
|
|
108
|
+
if (!transform || !dispatch)
|
|
109
|
+
return;
|
|
110
|
+
if (ValueObjects_1.Vector3.Equal(this.initialPosition, transform.localPosition))
|
|
111
|
+
return;
|
|
112
|
+
if (this.dispatchStateChangeOnComplete) {
|
|
113
|
+
dispatch();
|
|
114
|
+
}
|
|
115
|
+
if (this.submitUndoOnComplete) {
|
|
116
|
+
const redoPos = transform.localPosition;
|
|
117
|
+
(_a = this.undoRedo) === null || _a === void 0 ? void 0 : _a.submitAction({
|
|
118
|
+
undoAction: () => {
|
|
119
|
+
transform.localPosition = this.initialPosition;
|
|
120
|
+
dispatch();
|
|
121
|
+
},
|
|
122
|
+
redoAction: () => {
|
|
123
|
+
transform.localPosition = redoPos;
|
|
124
|
+
dispatch();
|
|
125
|
+
},
|
|
126
|
+
});
|
|
127
|
+
}
|
|
128
|
+
}
|
|
112
129
|
}
|
|
130
|
+
exports.PanTransformUCImp = PanTransformUCImp;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { AppObject, AppObjectUC } from "../../../AppObject";
|
|
2
2
|
import { ParametricLine, Vector2 } from "../../../ValueObjects";
|
|
3
|
+
import { SceneRayPickUC } from "../../Babylon";
|
|
3
4
|
import { PanTransformUC } from "./PanTransformUC";
|
|
4
5
|
export declare abstract class TryPanTransformUC extends AppObjectUC {
|
|
5
6
|
static readonly type = "TryPanTransformUC";
|
|
@@ -14,8 +15,8 @@ export declare abstract class TryPanTransformUC extends AppObjectUC {
|
|
|
14
15
|
export declare function makeTryPanTransformUC(appObject: AppObject): TryPanTransformUC;
|
|
15
16
|
export declare class TryPanTransformUCImp extends TryPanTransformUC {
|
|
16
17
|
protected panUC?: PanTransformUC;
|
|
17
|
-
|
|
18
|
-
|
|
18
|
+
protected get pixelToRay(): ((pixelPos: Vector2) => ParametricLine) | undefined;
|
|
19
|
+
protected get rayPickUC(): SceneRayPickUC | undefined;
|
|
19
20
|
allow: () => boolean;
|
|
20
21
|
tryWithPixel: (pixel: Vector2) => boolean;
|
|
21
22
|
moveWithPixel: (pixel: Vector2) => void;
|
|
@@ -17,6 +17,5 @@ __exportStar(require("./PanTransformUC"), exports);
|
|
|
17
17
|
__exportStar(require("./PinchTransform"), exports);
|
|
18
18
|
__exportStar(require("./RayPanScaleTransform"), exports);
|
|
19
19
|
__exportStar(require("./ScaleTransform"), exports);
|
|
20
|
-
__exportStar(require("./StickTransformUC"), exports);
|
|
21
20
|
__exportStar(require("./StylusMoveTransformUC"), exports);
|
|
22
21
|
__exportStar(require("./TryPanTransformUC"), exports);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./setupUndoRedo";
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
5
|
+
}) : (function(o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
o[k2] = m[k];
|
|
8
|
+
}));
|
|
9
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
10
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
11
|
+
};
|
|
12
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
+
__exportStar(require("./setupUndoRedo"), exports);
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.setupUndoRedo = void 0;
|
|
4
|
+
const Entities_1 = require("../Entities");
|
|
5
|
+
const PM_1 = require("../PM");
|
|
6
|
+
const UCs_1 = require("../UCs");
|
|
7
|
+
function setupUndoRedo(appObjects) {
|
|
8
|
+
const ao = appObjects.getOrCreate("UndoRedo");
|
|
9
|
+
// Entity
|
|
10
|
+
const undoRedo = Entities_1.makeUndoRedoEntity(ao);
|
|
11
|
+
// UCs
|
|
12
|
+
new UCs_1.UndoRedoToolStatesHook(ao);
|
|
13
|
+
// PMs
|
|
14
|
+
PM_1.makeHasUndoPM(ao);
|
|
15
|
+
PM_1.makeHasRedoPM(ao);
|
|
16
|
+
return ao;
|
|
17
|
+
}
|
|
18
|
+
exports.setupUndoRedo = setupUndoRedo;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { AppObject, AppObjectUC } from "../../../AppObject";
|
|
2
|
+
export declare class UndoRedoToolStatesHook extends AppObjectUC {
|
|
3
|
+
static type: string;
|
|
4
|
+
private get baseApp();
|
|
5
|
+
private get undoRedo();
|
|
6
|
+
private get toolRepo();
|
|
7
|
+
private undoTool?;
|
|
8
|
+
private redoTool?;
|
|
9
|
+
onUndoRedoChange: () => void;
|
|
10
|
+
constructor(appObject: AppObject);
|
|
11
|
+
}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.UndoRedoToolStatesHook = void 0;
|
|
4
|
+
const AppObject_1 = require("../../../AppObject");
|
|
5
|
+
const BaseAppState_1 = require("../../BaseApp/Entity/BaseAppState");
|
|
6
|
+
const Entities_1 = require("../../Tools/Entities");
|
|
7
|
+
const Entities_2 = require("../Entities");
|
|
8
|
+
class UndoRedoToolStatesHook extends AppObject_1.AppObjectUC {
|
|
9
|
+
constructor(appObject) {
|
|
10
|
+
var _a, _b, _c, _d;
|
|
11
|
+
super(appObject, UndoRedoToolStatesHook.type);
|
|
12
|
+
this.onUndoRedoChange = () => {
|
|
13
|
+
if (!this.baseApp)
|
|
14
|
+
return;
|
|
15
|
+
if (!this.undoRedo)
|
|
16
|
+
return;
|
|
17
|
+
if (this.redoTool) {
|
|
18
|
+
if (this.baseApp.isAuthoring) {
|
|
19
|
+
this.redoTool.state = this.undoRedo.hasRedo
|
|
20
|
+
? Entities_1.ToolState.ENABLED
|
|
21
|
+
: Entities_1.ToolState.DISABLED;
|
|
22
|
+
}
|
|
23
|
+
else {
|
|
24
|
+
this.redoTool.state = Entities_1.ToolState.HIDDEN;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
if (this.undoTool) {
|
|
28
|
+
if (this.baseApp.isAuthoring) {
|
|
29
|
+
this.undoTool.state = this.undoRedo.hasUndo
|
|
30
|
+
? Entities_1.ToolState.ENABLED
|
|
31
|
+
: Entities_1.ToolState.DISABLED;
|
|
32
|
+
}
|
|
33
|
+
else {
|
|
34
|
+
this.undoTool.state = Entities_1.ToolState.HIDDEN;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
this.undoTool = (_a = this.toolRepo) === null || _a === void 0 ? void 0 : _a.getTool("UNDO");
|
|
39
|
+
this.redoTool = (_b = this.toolRepo) === null || _b === void 0 ? void 0 : _b.getTool("REDO");
|
|
40
|
+
(_c = this.undoRedo) === null || _c === void 0 ? void 0 : _c.addChangeObserver(this.onUndoRedoChange);
|
|
41
|
+
(_d = this.baseApp) === null || _d === void 0 ? void 0 : _d.addChangeObserver(this.onUndoRedoChange);
|
|
42
|
+
this.onUndoRedoChange();
|
|
43
|
+
}
|
|
44
|
+
get baseApp() {
|
|
45
|
+
return this.getCachedSingleton(BaseAppState_1.BaseAppState.type);
|
|
46
|
+
}
|
|
47
|
+
get undoRedo() {
|
|
48
|
+
return this.getCachedSingleton(Entities_2.UndoRedoEntity.type);
|
|
49
|
+
}
|
|
50
|
+
get toolRepo() {
|
|
51
|
+
return this.getCachedSingleton(Entities_1.ToolRepository.type);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
exports.UndoRedoToolStatesHook = UndoRedoToolStatesHook;
|
|
55
|
+
UndoRedoToolStatesHook.type = "UndoRedoToolStatesHook";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./UndoRedoButtonStatesHook";
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
5
|
+
}) : (function(o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
o[k2] = m[k];
|
|
8
|
+
}));
|
|
9
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
10
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
11
|
+
};
|
|
12
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
+
__exportStar(require("./UndoRedoButtonStatesHook"), exports);
|
package/lib/Components/index.js
CHANGED
|
@@ -37,6 +37,7 @@ __exportStar(require("./RequestHandler"), exports);
|
|
|
37
37
|
__exportStar(require("./SceneRoot"), exports);
|
|
38
38
|
__exportStar(require("./Selection"), exports);
|
|
39
39
|
__exportStar(require("./StateMachine"), exports);
|
|
40
|
+
__exportStar(require("./Stick"), exports);
|
|
40
41
|
__exportStar(require("./StoredView"), exports);
|
|
41
42
|
__exportStar(require("./Stylus"), exports);
|
|
42
43
|
__exportStar(require("./ThemeColors"), exports);
|