@vived/app 4.21.0 → 4.23.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.
Files changed (111) hide show
  1. package/lib/Components/App/Adapters/index.d.ts +4 -0
  2. package/lib/Components/{KeyboardInput/Mocks → App/Adapters}/index.js +4 -1
  3. package/lib/Components/App/Adapters/isAuthoringAdapter.d.ts +2 -0
  4. package/lib/Components/App/Adapters/isAuthoringAdapter.js +23 -0
  5. package/lib/Components/App/Adapters/isReviewingAdapter.d.ts +2 -0
  6. package/lib/Components/App/Adapters/isReviewingAdapter.js +23 -0
  7. package/lib/Components/App/Adapters/slideNavigationAdapter.d.ts +3 -0
  8. package/lib/Components/App/Adapters/slideNavigationAdapter.js +23 -0
  9. package/lib/Components/App/Adapters/slideTextAdapter.d.ts +2 -0
  10. package/lib/Components/App/Adapters/slideTextAdapter.js +23 -0
  11. package/lib/Components/App/Entity/BaseAppState.d.ts +2 -0
  12. package/lib/Components/App/Entity/BaseAppState.js +7 -0
  13. package/lib/Components/App/Mocks/IsAuthoringMock.d.ts +8 -0
  14. package/lib/Components/App/Mocks/IsAuthoringMock.js +15 -0
  15. package/lib/Components/App/Mocks/IsReviewingMock.d.ts +8 -0
  16. package/lib/Components/App/Mocks/IsReviewingMock.js +15 -0
  17. package/lib/Components/App/Mocks/SlideNavigationMock.d.ts +8 -0
  18. package/lib/Components/App/Mocks/SlideNavigationMock.js +15 -0
  19. package/lib/Components/App/Mocks/SlideTextMock.d.ts +8 -0
  20. package/lib/Components/App/Mocks/SlideTextMock.js +15 -0
  21. package/lib/Components/App/Mocks/index.d.ts +4 -0
  22. package/lib/Components/App/Mocks/index.js +4 -0
  23. package/lib/Components/App/PM/IsAuthoringPM.d.ts +2 -6
  24. package/lib/Components/App/PM/IsAuthoringPM.js +16 -10
  25. package/lib/Components/App/PM/IsReviewingPM.d.ts +2 -6
  26. package/lib/Components/App/PM/IsReviewingPM.js +16 -10
  27. package/lib/Components/App/PM/SlideNavigationPM.d.ts +12 -0
  28. package/lib/Components/App/PM/SlideNavigationPM.js +49 -0
  29. package/lib/Components/App/PM/SlideTextPM.d.ts +2 -5
  30. package/lib/Components/App/PM/SlideTextPM.js +17 -10
  31. package/lib/Components/App/PM/index.d.ts +1 -1
  32. package/lib/Components/App/PM/index.js +1 -1
  33. package/lib/Components/App/index.d.ts +1 -0
  34. package/lib/Components/App/index.js +1 -0
  35. package/lib/Components/ChannelModel/Adapters/activeModelAdapter.d.ts +2 -0
  36. package/lib/Components/ChannelModel/Adapters/activeModelAdapter.js +23 -0
  37. package/lib/Components/ChannelModel/Adapters/index.d.ts +1 -0
  38. package/lib/Components/ChannelModel/Adapters/index.js +1 -0
  39. package/lib/Components/ChannelModel/Entities/ChannelModelRepo.d.ts +2 -2
  40. package/lib/Components/ChannelModel/Entities/ChannelModelRepo.js +3 -3
  41. package/lib/Components/ChannelModel/Mocks/ActiveModelMock.d.ts +8 -0
  42. package/lib/Components/ChannelModel/Mocks/ActiveModelMock.js +15 -0
  43. package/lib/Components/ChannelModel/Mocks/index.d.ts +1 -0
  44. package/lib/Components/ChannelModel/Mocks/index.js +1 -0
  45. package/lib/Components/ChannelModel/PMs/ActiveModelPM.d.ts +13 -0
  46. package/lib/Components/ChannelModel/PMs/ActiveModelPM.js +36 -0
  47. package/lib/Components/ChannelModel/PMs/index.d.ts +1 -0
  48. package/lib/Components/ChannelModel/PMs/index.js +1 -0
  49. package/lib/Components/ChannelModel/UC/SelectChannelModelUC.js +7 -1
  50. package/lib/Components/ChannelModel/UC/SerializeActiveModel.d.ts +26 -0
  51. package/lib/Components/ChannelModel/UC/SerializeActiveModel.js +80 -0
  52. package/lib/Components/ChannelModel/UC/index.d.ts +1 -0
  53. package/lib/Components/ChannelModel/UC/index.js +1 -0
  54. package/lib/Components/RequestHandler/UC/SetAppStateUC.d.ts +9 -2
  55. package/lib/Components/RequestHandler/UC/SetAppStateUC.js +35 -27
  56. package/package.json +1 -1
  57. package/lib/Components/App/PM/HasNextPreviousStatePM.d.ts +0 -15
  58. package/lib/Components/App/PM/HasNextPreviousStatePM.js +0 -44
  59. package/lib/Components/ChannelModel/Mocks/ProcessChannelModelUCMock.d.ts +0 -8
  60. package/lib/Components/ChannelModel/Mocks/ProcessChannelModelUCMock.js +0 -15
  61. package/lib/Components/ChannelModel/UC/InitializeChannelModelFromGLB.d.ts +0 -0
  62. package/lib/Components/ChannelModel/UC/InitializeChannelModelFromGLB.js +0 -1
  63. package/lib/Components/ChannelModel/UC/ProcessChannelModelUC.d.ts +0 -6
  64. package/lib/Components/ChannelModel/UC/ProcessChannelModelUC.js +0 -9
  65. package/lib/Components/ChannelModel/UC/SetupChannelModelUC.d.ts +0 -9
  66. package/lib/Components/ChannelModel/UC/SetupChannelModelUC.js +0 -11
  67. package/lib/Components/HoverLabel/Mocks/index.d.ts +0 -1
  68. package/lib/Components/HoverLabel/Mocks/index.js +0 -13
  69. package/lib/Components/HoverLabel/PM/HoverLabelPM.d.ts +0 -19
  70. package/lib/Components/HoverLabel/PM/HoverLabelPM.js +0 -65
  71. package/lib/Components/KeyboardInput/Mocks/index.d.ts +0 -1
  72. package/lib/Components/Landmarks/Mocks/index.d.ts +0 -1
  73. package/lib/Components/Landmarks/Mocks/index.js +0 -13
  74. package/lib/Components/MouseInput/Mocks/index.d.ts +0 -1
  75. package/lib/Components/MouseInput/Mocks/index.js +0 -13
  76. package/lib/Components/Question/Mocks/index.d.ts +0 -2
  77. package/lib/Components/Question/Mocks/index.js +0 -14
  78. package/lib/Components/RequestHandler/Mocks/index.d.ts +0 -1
  79. package/lib/Components/RequestHandler/Mocks/index.js +0 -13
  80. package/lib/Components/SceneRoot/Controllers/StylusMove.d.ts +0 -14
  81. package/lib/Components/SceneRoot/Controllers/StylusMove.js +0 -56
  82. package/lib/Components/SceneRoot/Controllers/StylusScale.d.ts +0 -14
  83. package/lib/Components/SceneRoot/Controllers/StylusScale.js +0 -58
  84. package/lib/Components/Selection/Controller/StylusHoverOnAppObject.d.ts +0 -11
  85. package/lib/Components/Selection/Controller/StylusHoverOnAppObject.js +0 -42
  86. package/lib/Components/Selection/Controller/StylusPressOnAppObject.d.ts +0 -18
  87. package/lib/Components/Selection/Controller/StylusPressOnAppObject.js +0 -77
  88. package/lib/Components/Selection/Controller/StylusSelectAppObject.d.ts +0 -11
  89. package/lib/Components/Selection/Controller/StylusSelectAppObject.js +0 -44
  90. package/lib/Components/TouchController/Mock/index.d.ts +0 -2
  91. package/lib/Components/TouchController/Mock/index.js +0 -14
  92. package/lib/Components/UndoRedo/Mocks/index.d.ts +0 -1
  93. package/lib/Components/UndoRedo/Mocks/index.js +0 -13
  94. package/lib/Components/XR/Mocks/index.d.ts +0 -2
  95. package/lib/Components/XR/Mocks/index.js +0 -14
  96. package/lib/Components/zSpace/Controllers/EmulateStylus.d.ts +0 -10
  97. package/lib/Components/zSpace/Controllers/EmulateStylus.js +0 -113
  98. package/lib/Components/zSpace/Controllers/ZSpaceScaleRoot.d.ts +0 -14
  99. package/lib/Components/zSpace/Controllers/ZSpaceScaleRoot.js +0 -57
  100. package/lib/Components/zSpace/Controllers/index.d.ts +0 -1
  101. package/lib/Components/zSpace/Controllers/index.js +0 -13
  102. package/lib/Components/zSpace/Entities/ZSpaceStylusEntity.d.ts +0 -29
  103. package/lib/Components/zSpace/Entities/ZSpaceStylusEntity.js +0 -115
  104. package/lib/Components/zSpace/Mocks/index.d.ts +0 -1
  105. package/lib/Components/zSpace/Mocks/index.js +0 -13
  106. package/lib/Components/zSpace/PM/StylusColorLengthPM.d.ts +0 -13
  107. package/lib/Components/zSpace/PM/StylusColorLengthPM.js +0 -77
  108. package/lib/Components/zSpace/PM/StylusIsInUsePM.d.ts +0 -6
  109. package/lib/Components/zSpace/PM/StylusIsInUsePM.js +0 -42
  110. package/lib/Types/ChannelModelData.d.ts +0 -67
  111. package/lib/Types/ChannelModelData.js +0 -21
@@ -1,57 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ZSpaceScaleRoot = void 0;
4
- const AppObjectController_1 = require("../../../AppObject/AppObjectController");
5
- const SceneRoot_1 = require("../../SceneRoot");
6
- const ScaleSceneRootWithRay_1 = require("../../SceneRoot/UC/ScaleSceneRootWithRay");
7
- const ZSpaceStylusEntity_1 = require("../Entities/ZSpaceStylusEntity");
8
- class ZSpaceScaleRoot extends AppObjectController_1.AppObjectController {
9
- constructor(appObject) {
10
- super(appObject, ZSpaceScaleRoot.type);
11
- this.isScaling = false;
12
- this.allow = (button) => {
13
- if (button === ZSpaceStylusEntity_1.ZSpaceStylusButton.BACK_RIGHT)
14
- return true;
15
- return false;
16
- };
17
- this.onButtonDown = (button) => {
18
- var _a;
19
- this.isScaling = false;
20
- if (!this.stylus)
21
- return;
22
- if (!this.allow(button))
23
- return;
24
- const pointerRay = this.stylus.pickRay;
25
- const rayStart = this.stylus.transform.localPosition;
26
- (_a = this.scaleSceneRootWithRay) === null || _a === void 0 ? void 0 : _a.initializeScale(pointerRay, rayStart);
27
- this.isScaling = true;
28
- };
29
- this.onStylusMove = () => {
30
- var _a;
31
- if (!this.stylus)
32
- return;
33
- if (!this.isScaling)
34
- return;
35
- const pointerRay = this.stylus.pickRay;
36
- const rayStart = this.stylus.transform.localPosition;
37
- (_a = this.scaleSceneRootWithRay) === null || _a === void 0 ? void 0 : _a.doScale(pointerRay, rayStart);
38
- };
39
- this.onButtonUp = () => {
40
- this.isScaling = false;
41
- };
42
- this.stylus = appObject.getComponent(ZSpaceStylusEntity_1.ZSpaceStylusEntity.type);
43
- const sceneRoot = SceneRoot_1.SceneRootEntity.get(appObject.appObjectRepo);
44
- this.scaleSceneRootWithRay = sceneRoot === null || sceneRoot === void 0 ? void 0 : sceneRoot.appObject.getComponent(ScaleSceneRootWithRay_1.ScaleSceneRootWithRay.type);
45
- if (!this.stylus) {
46
- this.warn("StylusInputPointer Controller has been added to an app object that does not have a ZSpaceStylusEntity");
47
- }
48
- else if (!this.scaleSceneRootWithRay) {
49
- this.warn("StylusRootScaleSceneRootWithRay was not found on the Scene Root App Object");
50
- }
51
- else {
52
- this.stylus.registerController(this);
53
- }
54
- }
55
- }
56
- exports.ZSpaceScaleRoot = ZSpaceScaleRoot;
57
- ZSpaceScaleRoot.type = "ZSpaceScaleRoot";
@@ -1 +0,0 @@
1
- export * from "./EmulateStylus";
@@ -1,13 +0,0 @@
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("./EmulateStylus"), exports);
@@ -1,29 +0,0 @@
1
- import { AppObjectRepo } from "../../../AppObject";
2
- import { AppObject } from "../../../AppObject/AppObject";
3
- import { AppObjectEntity } from "../../../AppObject/AppObjectEntity";
4
- import { ParametricLine } from "../../../ValueObjects";
5
- import { Transform3D } from "../../Transform3D";
6
- export declare enum ZSpaceStylusButton {
7
- PRIMARY = 0,
8
- BACK_RIGHT = 1,
9
- BACK_LEFT = 2
10
- }
11
- export interface ZSpaceStylusController {
12
- onButtonDown?: (button: ZSpaceStylusButton) => void;
13
- onButtonUp?: (button: ZSpaceStylusButton) => void;
14
- onButtonClick?: (button: ZSpaceStylusButton) => void;
15
- onStylusMove?: (transform: Transform3D) => void;
16
- }
17
- export declare abstract class ZSpaceStylusEntity extends AppObjectEntity {
18
- static readonly type = "ZSpaceStylusEntity";
19
- static clickMovementThreshold: number;
20
- static clickTimeThresholdMS: number;
21
- abstract registerController: (controller: ZSpaceStylusController) => void;
22
- abstract updateButtonState: (button: ZSpaceStylusButton, isPressed: boolean) => void;
23
- abstract readonly transform: Transform3D;
24
- abstract readonly helperTransform: Transform3D;
25
- abstract get pickRay(): ParametricLine;
26
- abstract get isInUse(): boolean;
27
- static get(appObjects: AppObjectRepo): ZSpaceStylusEntity | undefined;
28
- }
29
- export declare function makeZSpaceStylus(appObj: AppObject): ZSpaceStylusEntity;
@@ -1,115 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.makeZSpaceStylus = exports.ZSpaceStylusEntity = exports.ZSpaceStylusButton = void 0;
4
- const AppObject_1 = require("../../../AppObject");
5
- const AppObjectEntity_1 = require("../../../AppObject/AppObjectEntity");
6
- const Entities_1 = require("../../../Entities");
7
- const ValueObjects_1 = require("../../../ValueObjects");
8
- const Transform3D_1 = require("../../Transform3D");
9
- var ZSpaceStylusButton;
10
- (function (ZSpaceStylusButton) {
11
- ZSpaceStylusButton[ZSpaceStylusButton["PRIMARY"] = 0] = "PRIMARY";
12
- ZSpaceStylusButton[ZSpaceStylusButton["BACK_RIGHT"] = 1] = "BACK_RIGHT";
13
- ZSpaceStylusButton[ZSpaceStylusButton["BACK_LEFT"] = 2] = "BACK_LEFT";
14
- })(ZSpaceStylusButton = exports.ZSpaceStylusButton || (exports.ZSpaceStylusButton = {}));
15
- class ZSpaceStylusEntity extends AppObjectEntity_1.AppObjectEntity {
16
- static get(appObjects) {
17
- return AppObject_1.getSingletonComponent(ZSpaceStylusEntity.type, appObjects);
18
- }
19
- }
20
- exports.ZSpaceStylusEntity = ZSpaceStylusEntity;
21
- ZSpaceStylusEntity.type = "ZSpaceStylusEntity";
22
- ZSpaceStylusEntity.clickMovementThreshold = 0.32;
23
- ZSpaceStylusEntity.clickTimeThresholdMS = 350;
24
- function makeZSpaceStylus(appObj) {
25
- const transform = Transform3D_1.Transform3D.addIfMissing(appObj);
26
- return new StylusImp(appObj, transform);
27
- }
28
- exports.makeZSpaceStylus = makeZSpaceStylus;
29
- class StylusImp extends ZSpaceStylusEntity {
30
- constructor(appObject, transform) {
31
- super(appObject, ZSpaceStylusEntity.type);
32
- this.controllers = [];
33
- this.buttonStates = [false, false, false];
34
- this.pressPosition = ValueObjects_1.Vector3.Zero();
35
- this.pressTime = 0;
36
- this.registerController = (controller) => {
37
- this.controllers.push(controller);
38
- };
39
- this.updateButtonState = (button, isPressed) => {
40
- if (this.buttonStates[button] === isPressed)
41
- return;
42
- this.controllers.forEach((controller) => {
43
- if (isPressed) {
44
- if (controller.onButtonDown) {
45
- controller.onButtonDown(button);
46
- }
47
- this.lassPressedButton = button;
48
- this.pressPosition = this.transform.localPosition;
49
- this.pressTime = Date.now();
50
- }
51
- else {
52
- if (controller.onButtonUp) {
53
- controller.onButtonUp(button);
54
- }
55
- if (this.isClick(button) && controller.onButtonClick) {
56
- controller.onButtonClick(button);
57
- }
58
- }
59
- });
60
- this.buttonStates[button] = isPressed;
61
- this.notifyOnChange();
62
- };
63
- this.isClick = (button) => {
64
- const buttonIsCorrect = button === this.lassPressedButton;
65
- const movement = ValueObjects_1.Vector3.Subtract(this.transform.localPosition, this.pressPosition).magnitude;
66
- const movementIsSmallEnough = movement < ZSpaceStylusEntity.clickMovementThreshold;
67
- const passedTime = Date.now() - this.pressTime;
68
- const pressTimeIsShortEnough = passedTime < ZSpaceStylusEntity.clickTimeThresholdMS;
69
- if (buttonIsCorrect && movementIsSmallEnough && pressTimeIsShortEnough) {
70
- return true;
71
- }
72
- else {
73
- return false;
74
- }
75
- };
76
- this.onTransformUpdate = () => {
77
- this.checkIfStylusIsInUse(this.transform.worldMatrix);
78
- this.controllers.forEach((controller) => {
79
- if (controller.onStylusMove) {
80
- controller.onStylusMove(this.transform);
81
- }
82
- });
83
- this.notifyOnChange();
84
- };
85
- this.memoizedIsInUse = new Entities_1.MemoizedBoolean(false, this.notifyOnChange);
86
- this.transform = transform;
87
- this.transform.addChangeObserver(this.onTransformUpdate);
88
- const helperTransformAO = appObject.appObjectRepo.getOrCreate("StylusHelper");
89
- this.helperTransform = Transform3D_1.Transform3D.addIfMissing(helperTransformAO);
90
- this.helperTransform.parent = this.transform;
91
- }
92
- get pickRay() {
93
- return ValueObjects_1.ParametricLine.FromPointDirection(this.transform.worldPosition, this.transform.localDirectionToWorld(ValueObjects_1.Vector3.Forward()));
94
- }
95
- get isInUse() {
96
- return this.memoizedIsInUse.val;
97
- }
98
- checkIfStylusIsInUse(worldMatrix) {
99
- const m = worldMatrix.m;
100
- if (m[1] === 0 &&
101
- m[2] === 0 &&
102
- m[3] === 0 &&
103
- m[4] === 0 &&
104
- m[7] === 0 &&
105
- m[8] === 0 &&
106
- m[11] === 0 &&
107
- m[12] === 0 &&
108
- m[15] === 1) {
109
- this.memoizedIsInUse.val = false;
110
- }
111
- else {
112
- this.memoizedIsInUse.val = true;
113
- }
114
- }
115
- }
@@ -1 +0,0 @@
1
- export * from "./MockCheckZSpaceDisplaySizeUC";
@@ -1,13 +0,0 @@
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("./MockCheckZSpaceDisplaySizeUC"), exports);
@@ -1,13 +0,0 @@
1
- import { AppObject, AppObjectPM } from "../../../AppObject";
2
- import { Color } from "../../../ValueObjects";
3
- export interface StylusColorLengthVM {
4
- color: Color;
5
- length: number;
6
- }
7
- export declare abstract class StylusColorLengthPM extends AppObjectPM<StylusColorLengthVM> {
8
- static readonly type = "StylusColorLengthPM";
9
- abstract rayColorNoPick: Color;
10
- abstract rayColorPick: Color;
11
- abstract defaultLength: number;
12
- }
13
- export declare function makeStylusColorLengthPM(appObject: AppObject): StylusColorLengthPM;
@@ -1,77 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.makeStylusColorLengthPM = exports.StylusColorLengthPM = void 0;
4
- const AppObject_1 = require("../../../AppObject");
5
- const ValueObjects_1 = require("../../../ValueObjects");
6
- const Babylon_1 = require("../../Babylon");
7
- const ZSpaceStylusEntity_1 = require("../Entities/ZSpaceStylusEntity");
8
- class StylusColorLengthPM extends AppObject_1.AppObjectPM {
9
- }
10
- exports.StylusColorLengthPM = StylusColorLengthPM;
11
- StylusColorLengthPM.type = "StylusColorLengthPM";
12
- function makeStylusColorLengthPM(appObject) {
13
- return new StylusColorLengthPMImp(appObject);
14
- }
15
- exports.makeStylusColorLengthPM = makeStylusColorLengthPM;
16
- class StylusColorLengthPMImp extends StylusColorLengthPM {
17
- constructor(appObject) {
18
- super(appObject, StylusColorLengthPM.type);
19
- this.defaultLength = 1;
20
- this.rayColorNoPick = ValueObjects_1.Color.RGB(128, 128, 128);
21
- this.rayColorPick = ValueObjects_1.Color.RGB(0, 255, 0);
22
- this.onEntityChange = () => {
23
- if (!this.stylus || !this.stylus.isInUse) {
24
- this.setDefaultVM();
25
- return;
26
- }
27
- const pickRay = this.stylus.pickRay;
28
- const scenePickUC = Babylon_1.SceneRayPickUC.get(this.appObject.appObjectRepo);
29
- if (!scenePickUC) {
30
- this.setDefaultVM();
31
- return;
32
- }
33
- const scenePick = scenePickUC.sceneRayPick(pickRay);
34
- let color = this.rayColorNoPick;
35
- let length = this.defaultLength;
36
- if (scenePick && (scenePick === null || scenePick === void 0 ? void 0 : scenePick.hit) && scenePick.worldPickPoint) {
37
- color = this.rayColorPick;
38
- length = Math.abs(ValueObjects_1.Vector3.Subtract(this.stylus.transform.worldPosition, scenePick.worldPickPoint).magnitude);
39
- }
40
- const vm = {
41
- color,
42
- length,
43
- };
44
- this.doUpdateView(vm);
45
- };
46
- this.dispose = () => {
47
- var _a, _b;
48
- super.dispose();
49
- (_a = this.stylus) === null || _a === void 0 ? void 0 : _a.removeChangeObserver(this.onEntityChange);
50
- (_b = this.stylus) === null || _b === void 0 ? void 0 : _b.removeOnDisposeObserver(this.dispose);
51
- };
52
- this.stylus = appObject.getComponent(ZSpaceStylusEntity_1.ZSpaceStylusEntity.type);
53
- if (this.stylus) {
54
- this.stylus.addChangeObserver(this.onEntityChange);
55
- this.stylus.addOnDisposeObserver(() => {
56
- this.dispose();
57
- });
58
- this.onEntityChange();
59
- }
60
- else {
61
- this.warn("App Object does not have a Stylus Entity");
62
- }
63
- }
64
- vmsAreEqual(a, b) {
65
- if (ValueObjects_1.Color.Equal(a.color, b.color) && a.length === b.length) {
66
- return true;
67
- }
68
- return false;
69
- }
70
- setDefaultVM() {
71
- const vm = {
72
- color: this.rayColorNoPick,
73
- length: 0,
74
- };
75
- this.doUpdateView(vm);
76
- }
77
- }
@@ -1,6 +0,0 @@
1
- import { AppObject, AppObjectPM, AppObjectRepo } from "../../../AppObject";
2
- export declare abstract class StylusIsInUsePM extends AppObjectPM<boolean> {
3
- static readonly type = "StylusIsInUsePM";
4
- static get: (appObjects: AppObjectRepo) => StylusIsInUsePM | undefined;
5
- }
6
- export declare function makeStylusIsInUsePM(appObject: AppObject): StylusIsInUsePM;
@@ -1,42 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.makeStylusIsInUsePM = exports.StylusIsInUsePM = void 0;
4
- const AppObject_1 = require("../../../AppObject");
5
- const Entities_1 = require("../Entities");
6
- class StylusIsInUsePM extends AppObject_1.AppObjectPM {
7
- }
8
- exports.StylusIsInUsePM = StylusIsInUsePM;
9
- StylusIsInUsePM.type = "StylusIsInUsePM";
10
- StylusIsInUsePM.get = (appObjects) => AppObject_1.getSingletonComponent(StylusIsInUsePM.type, appObjects);
11
- function makeStylusIsInUsePM(appObject) {
12
- return new StylusIsInUsePMImp(appObject);
13
- }
14
- exports.makeStylusIsInUsePM = makeStylusIsInUsePM;
15
- class StylusIsInUsePMImp extends StylusIsInUsePM {
16
- constructor(appObject) {
17
- super(appObject, StylusIsInUsePM.type);
18
- this.onRepoChange = () => {
19
- if (!this.stylus)
20
- return;
21
- this.doUpdateView(this.stylus.isInUse);
22
- };
23
- this.dispose = () => {
24
- var _a, _b;
25
- super.dispose();
26
- (_a = this.stylus) === null || _a === void 0 ? void 0 : _a.removeChangeObserver(this.onRepoChange);
27
- (_b = this.stylus) === null || _b === void 0 ? void 0 : _b.removeOnDisposeObserver(this.dispose);
28
- };
29
- this.stylus = appObject.getComponent(Entities_1.ZSpaceStylusEntity.type);
30
- if (this.stylus) {
31
- this.stylus.addChangeObserver(this.onRepoChange);
32
- this.stylus.addOnDisposeObserver(() => this.dispose());
33
- this.onRepoChange();
34
- }
35
- else {
36
- this.warn("App Object does not have a ZSpace Stylus Entity");
37
- }
38
- }
39
- vmsAreEqual(a, b) {
40
- return a === b;
41
- }
42
- }
@@ -1,67 +0,0 @@
1
- export interface ChannelModelDataMeshDTOv1 {
2
- version: number;
3
- id: string;
4
- meshPaths: string[];
5
- label: string;
6
- }
7
- export interface ChannelModelDataMeshDTOv0 {
8
- id: string;
9
- meshPaths: string[];
10
- label: string;
11
- }
12
- export interface ChannelModelDTOv0 {
13
- version: number;
14
- objects: ChannelModelDataMeshDTOv0[];
15
- name: string;
16
- description: string;
17
- bounds_min: {
18
- x: number;
19
- y: number;
20
- z: number;
21
- };
22
- bounds_max: {
23
- x: number;
24
- y: number;
25
- z: number;
26
- };
27
- defaultPosition: {
28
- x: number;
29
- y: number;
30
- z: number;
31
- };
32
- defaultRotation: {
33
- x: number;
34
- y: number;
35
- z: number;
36
- w: number;
37
- };
38
- defaultScale: number;
39
- }
40
- export interface ChannelModelDTOv1 {
41
- version: number;
42
- objects: ChannelModelDataMeshDTOv1[];
43
- name: string;
44
- bounds_min: {
45
- x: number;
46
- y: number;
47
- z: number;
48
- };
49
- bounds_max: {
50
- x: number;
51
- y: number;
52
- z: number;
53
- };
54
- defaultPosition: {
55
- x: number;
56
- y: number;
57
- z: number;
58
- };
59
- defaultRotation: {
60
- x: number;
61
- y: number;
62
- z: number;
63
- w: number;
64
- };
65
- defaultScale: number;
66
- }
67
- export declare function convertChannelModelDataV0toV1(v0: ChannelModelDTOv0): ChannelModelDTOv1;
@@ -1,21 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.convertChannelModelDataV0toV1 = void 0;
4
- function convertChannelModelDataV0toV1(v0) {
5
- const { objects, name, bounds_max, bounds_min, defaultPosition, defaultRotation, defaultScale } = v0;
6
- const objectsV2 = objects.map(obj => {
7
- const { id, label, meshPaths } = obj;
8
- return {
9
- version: 1,
10
- id, label, meshPaths
11
- };
12
- });
13
- return {
14
- version: 1,
15
- objects: objectsV2,
16
- name,
17
- bounds_max,
18
- bounds_min, defaultPosition, defaultRotation, defaultScale
19
- };
20
- }
21
- exports.convertChannelModelDataV0toV1 = convertChannelModelDataV0toV1;