@shapediver/viewer.features.drawing-tools 3.4.3 → 3.5.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 (148) hide show
  1. package/dist/api/implementation/DrawingToolsApi.d.ts +1 -2
  2. package/dist/api/implementation/DrawingToolsApi.d.ts.map +1 -1
  3. package/dist/api/implementation/DrawingToolsApi.js +21 -12
  4. package/dist/api/implementation/DrawingToolsApi.js.map +1 -1
  5. package/dist/api/interfaces/IDrawingToolsApi.d.ts +2 -6
  6. package/dist/api/interfaces/IDrawingToolsApi.d.ts.map +1 -1
  7. package/dist/business/implementation/DrawingToolsManager.d.ts +6 -8
  8. package/dist/business/implementation/DrawingToolsManager.d.ts.map +1 -1
  9. package/dist/business/implementation/DrawingToolsManager.js +14 -14
  10. package/dist/business/implementation/DrawingToolsManager.js.map +1 -1
  11. package/dist/business/implementation/managers/HistoryManager.d.ts +1 -2
  12. package/dist/business/implementation/managers/HistoryManager.d.ts.map +1 -1
  13. package/dist/business/implementation/managers/HistoryManager.js.map +1 -1
  14. package/dist/business/implementation/managers/TextVisualizationManager.d.ts +1 -2
  15. package/dist/business/implementation/managers/TextVisualizationManager.d.ts.map +1 -1
  16. package/dist/business/implementation/managers/TextVisualizationManager.js +8 -8
  17. package/dist/business/implementation/managers/TextVisualizationManager.js.map +1 -1
  18. package/dist/business/implementation/managers/geometry/GeometryManager.d.ts +3 -4
  19. package/dist/business/implementation/managers/geometry/GeometryManager.d.ts.map +1 -1
  20. package/dist/business/implementation/managers/geometry/GeometryManager.js +2 -2
  21. package/dist/business/implementation/managers/geometry/GeometryManager.js.map +1 -1
  22. package/dist/business/implementation/managers/geometry/helpers/GeometryManagerHelper.d.ts +2 -2
  23. package/dist/business/implementation/managers/geometry/helpers/GeometryManagerHelper.d.ts.map +1 -1
  24. package/dist/business/implementation/managers/geometry/helpers/GeometryManagerHelper.js +4 -0
  25. package/dist/business/implementation/managers/geometry/helpers/GeometryManagerHelper.js.map +1 -1
  26. package/dist/business/implementation/managers/interaction/InteractionManager.d.ts +3 -4
  27. package/dist/business/implementation/managers/interaction/InteractionManager.d.ts.map +1 -1
  28. package/dist/business/implementation/managers/interaction/InteractionManager.js +23 -7
  29. package/dist/business/implementation/managers/interaction/InteractionManager.js.map +1 -1
  30. package/dist/business/implementation/managers/interaction/handlers/DeletionInteractionHandler.js +1 -1
  31. package/dist/business/implementation/managers/interaction/handlers/DeletionInteractionHandler.js.map +1 -1
  32. package/dist/business/implementation/managers/interaction/handlers/InsertionInteractionHandler.d.ts +2 -0
  33. package/dist/business/implementation/managers/interaction/handlers/InsertionInteractionHandler.d.ts.map +1 -1
  34. package/dist/business/implementation/managers/interaction/handlers/InsertionInteractionHandler.js +30 -7
  35. package/dist/business/implementation/managers/interaction/handlers/InsertionInteractionHandler.js.map +1 -1
  36. package/dist/business/implementation/managers/interaction/handlers/MidPointInteractionHandler.js +1 -1
  37. package/dist/business/implementation/managers/interaction/handlers/MidPointInteractionHandler.js.map +1 -1
  38. package/dist/business/implementation/managers/interaction/helpers/InteractionManagerHelper.d.ts.map +1 -1
  39. package/dist/business/implementation/managers/interaction/helpers/InteractionManagerHelper.js +6 -3
  40. package/dist/business/implementation/managers/interaction/helpers/InteractionManagerHelper.js.map +1 -1
  41. package/dist/business/interfaces/IDrawingToolsManager.d.ts +6 -38
  42. package/dist/business/interfaces/IDrawingToolsManager.d.ts.map +1 -1
  43. package/dist/business/interfaces/IDrawingToolsManager.js.map +1 -1
  44. package/dist/index.d.ts +6 -15
  45. package/dist/index.d.ts.map +1 -1
  46. package/dist/index.js +11 -13
  47. package/dist/index.js.map +1 -1
  48. package/package.json +11 -10
  49. package/dist/api/implementation/restrictions/AbstractRestrictionApi.d.ts +0 -10
  50. package/dist/api/implementation/restrictions/AbstractRestrictionApi.d.ts.map +0 -1
  51. package/dist/api/implementation/restrictions/AbstractRestrictionApi.js +0 -38
  52. package/dist/api/implementation/restrictions/AbstractRestrictionApi.js.map +0 -1
  53. package/dist/api/implementation/restrictions/AbstractSnapRestrictionApi.d.ts +0 -11
  54. package/dist/api/implementation/restrictions/AbstractSnapRestrictionApi.d.ts.map +0 -1
  55. package/dist/api/implementation/restrictions/AbstractSnapRestrictionApi.js +0 -40
  56. package/dist/api/implementation/restrictions/AbstractSnapRestrictionApi.js.map +0 -1
  57. package/dist/api/implementation/restrictions/geometry/GeometryRestrictionApi.d.ts +0 -15
  58. package/dist/api/implementation/restrictions/geometry/GeometryRestrictionApi.d.ts.map +0 -1
  59. package/dist/api/implementation/restrictions/geometry/GeometryRestrictionApi.js +0 -54
  60. package/dist/api/implementation/restrictions/geometry/GeometryRestrictionApi.js.map +0 -1
  61. package/dist/api/implementation/restrictions/plane/PlaneRestrictionApi.d.ts +0 -20
  62. package/dist/api/implementation/restrictions/plane/PlaneRestrictionApi.d.ts.map +0 -1
  63. package/dist/api/implementation/restrictions/plane/PlaneRestrictionApi.js +0 -67
  64. package/dist/api/implementation/restrictions/plane/PlaneRestrictionApi.js.map +0 -1
  65. package/dist/api/implementation/restrictions/plane/snap/AngularRestrictionApi.d.ts +0 -10
  66. package/dist/api/implementation/restrictions/plane/snap/AngularRestrictionApi.d.ts.map +0 -1
  67. package/dist/api/implementation/restrictions/plane/snap/AngularRestrictionApi.js +0 -40
  68. package/dist/api/implementation/restrictions/plane/snap/AngularRestrictionApi.js.map +0 -1
  69. package/dist/api/implementation/restrictions/plane/snap/AxisRestrictionApi.d.ts +0 -7
  70. package/dist/api/implementation/restrictions/plane/snap/AxisRestrictionApi.d.ts.map +0 -1
  71. package/dist/api/implementation/restrictions/plane/snap/AxisRestrictionApi.js +0 -24
  72. package/dist/api/implementation/restrictions/plane/snap/AxisRestrictionApi.js.map +0 -1
  73. package/dist/api/implementation/restrictions/plane/snap/GridRestrictionApi.d.ts +0 -10
  74. package/dist/api/implementation/restrictions/plane/snap/GridRestrictionApi.d.ts.map +0 -1
  75. package/dist/api/implementation/restrictions/plane/snap/GridRestrictionApi.js +0 -40
  76. package/dist/api/implementation/restrictions/plane/snap/GridRestrictionApi.js.map +0 -1
  77. package/dist/api/interfaces/IRestrictionApi.d.ts +0 -11
  78. package/dist/api/interfaces/IRestrictionApi.d.ts.map +0 -1
  79. package/dist/api/interfaces/IRestrictionApi.js +0 -3
  80. package/dist/api/interfaces/IRestrictionApi.js.map +0 -1
  81. package/dist/api/interfaces/ISnapRestrictionApi.d.ts +0 -13
  82. package/dist/api/interfaces/ISnapRestrictionApi.d.ts.map +0 -1
  83. package/dist/api/interfaces/ISnapRestrictionApi.js +0 -3
  84. package/dist/api/interfaces/ISnapRestrictionApi.js.map +0 -1
  85. package/dist/business/implementation/managers/geometry/GeometryMathManager.d.ts +0 -82
  86. package/dist/business/implementation/managers/geometry/GeometryMathManager.d.ts.map +0 -1
  87. package/dist/business/implementation/managers/geometry/GeometryMathManager.js +0 -245
  88. package/dist/business/implementation/managers/geometry/GeometryMathManager.js.map +0 -1
  89. package/dist/business/implementation/managers/interaction/EventManager.d.ts +0 -26
  90. package/dist/business/implementation/managers/interaction/EventManager.d.ts.map +0 -1
  91. package/dist/business/implementation/managers/interaction/EventManager.js +0 -63
  92. package/dist/business/implementation/managers/interaction/EventManager.js.map +0 -1
  93. package/dist/business/implementation/managers/interaction/RestrictionManager.d.ts +0 -19
  94. package/dist/business/implementation/managers/interaction/RestrictionManager.d.ts.map +0 -1
  95. package/dist/business/implementation/managers/interaction/RestrictionManager.js +0 -113
  96. package/dist/business/implementation/managers/interaction/RestrictionManager.js.map +0 -1
  97. package/dist/business/implementation/managers/interaction/restrictions/AbstractRestriction.d.ts +0 -19
  98. package/dist/business/implementation/managers/interaction/restrictions/AbstractRestriction.d.ts.map +0 -1
  99. package/dist/business/implementation/managers/interaction/restrictions/AbstractRestriction.js +0 -105
  100. package/dist/business/implementation/managers/interaction/restrictions/AbstractRestriction.js.map +0 -1
  101. package/dist/business/implementation/managers/interaction/restrictions/AbstractSnapRestriction.d.ts +0 -31
  102. package/dist/business/implementation/managers/interaction/restrictions/AbstractSnapRestriction.d.ts.map +0 -1
  103. package/dist/business/implementation/managers/interaction/restrictions/AbstractSnapRestriction.js +0 -125
  104. package/dist/business/implementation/managers/interaction/restrictions/AbstractSnapRestriction.js.map +0 -1
  105. package/dist/business/implementation/managers/interaction/restrictions/geometry/GeometryRestriction.d.ts +0 -40
  106. package/dist/business/implementation/managers/interaction/restrictions/geometry/GeometryRestriction.d.ts.map +0 -1
  107. package/dist/business/implementation/managers/interaction/restrictions/geometry/GeometryRestriction.js +0 -257
  108. package/dist/business/implementation/managers/interaction/restrictions/geometry/GeometryRestriction.js.map +0 -1
  109. package/dist/business/implementation/managers/interaction/restrictions/plane/PlaneRestriction.d.ts +0 -66
  110. package/dist/business/implementation/managers/interaction/restrictions/plane/PlaneRestriction.d.ts.map +0 -1
  111. package/dist/business/implementation/managers/interaction/restrictions/plane/PlaneRestriction.js +0 -244
  112. package/dist/business/implementation/managers/interaction/restrictions/plane/PlaneRestriction.js.map +0 -1
  113. package/dist/business/implementation/managers/interaction/restrictions/plane/snap/AngularRestriction.d.ts +0 -39
  114. package/dist/business/implementation/managers/interaction/restrictions/plane/snap/AngularRestriction.d.ts.map +0 -1
  115. package/dist/business/implementation/managers/interaction/restrictions/plane/snap/AngularRestriction.js +0 -317
  116. package/dist/business/implementation/managers/interaction/restrictions/plane/snap/AngularRestriction.js.map +0 -1
  117. package/dist/business/implementation/managers/interaction/restrictions/plane/snap/AxisRestriction.d.ts +0 -27
  118. package/dist/business/implementation/managers/interaction/restrictions/plane/snap/AxisRestriction.d.ts.map +0 -1
  119. package/dist/business/implementation/managers/interaction/restrictions/plane/snap/AxisRestriction.js +0 -165
  120. package/dist/business/implementation/managers/interaction/restrictions/plane/snap/AxisRestriction.js.map +0 -1
  121. package/dist/business/implementation/managers/interaction/restrictions/plane/snap/GridRestriction.d.ts +0 -39
  122. package/dist/business/implementation/managers/interaction/restrictions/plane/snap/GridRestriction.d.ts.map +0 -1
  123. package/dist/business/implementation/managers/interaction/restrictions/plane/snap/GridRestriction.js +0 -212
  124. package/dist/business/implementation/managers/interaction/restrictions/plane/snap/GridRestriction.js.map +0 -1
  125. package/dist/business/implementation/utils/numberCleaner.d.ts +0 -2
  126. package/dist/business/implementation/utils/numberCleaner.d.ts.map +0 -1
  127. package/dist/business/implementation/utils/numberCleaner.js +0 -9
  128. package/dist/business/implementation/utils/numberCleaner.js.map +0 -1
  129. package/dist/business/interfaces/IManager.d.ts +0 -4
  130. package/dist/business/interfaces/IManager.d.ts.map +0 -1
  131. package/dist/business/interfaces/IManager.js +0 -3
  132. package/dist/business/interfaces/IManager.js.map +0 -1
  133. package/dist/business/interfaces/IRestriction.d.ts +0 -40
  134. package/dist/business/interfaces/IRestriction.d.ts.map +0 -1
  135. package/dist/business/interfaces/IRestriction.js +0 -12
  136. package/dist/business/interfaces/IRestriction.js.map +0 -1
  137. package/dist/business/interfaces/IRestrictionBase.d.ts +0 -19
  138. package/dist/business/interfaces/IRestrictionBase.d.ts.map +0 -1
  139. package/dist/business/interfaces/IRestrictionBase.js +0 -5
  140. package/dist/business/interfaces/IRestrictionBase.js.map +0 -1
  141. package/dist/business/interfaces/ISnapRestriction.d.ts +0 -52
  142. package/dist/business/interfaces/ISnapRestriction.d.ts.map +0 -1
  143. package/dist/business/interfaces/ISnapRestriction.js +0 -4
  144. package/dist/business/interfaces/ISnapRestriction.js.map +0 -1
  145. package/dist/three/CSS2DRenderer.d.ts +0 -32
  146. package/dist/three/CSS2DRenderer.d.ts.map +0 -1
  147. package/dist/three/CSS2DRenderer.js +0 -137
  148. package/dist/three/CSS2DRenderer.js.map +0 -1
@@ -1,39 +0,0 @@
1
- import { AbstractRestriction } from '../../AbstractRestriction';
2
- import { DrawingToolsManager } from '../../../../../DrawingToolsManager';
3
- import { IRay } from '@shapediver/viewer.features.interaction';
4
- import { ISnapRestriction, SnapRestrictionProperties } from '../../../../../../interfaces/ISnapRestriction';
5
- import { PlaneRestriction } from '../PlaneRestriction';
6
- import { RestrictionMetaData } from '../../../../../../interfaces/IRestriction';
7
- import { vec3 } from 'gl-matrix';
8
- /**
9
- * Properties for the grid restriction
10
- */
11
- export declare type GridRestrictionProperties = {
12
- /**
13
- * Size of the grid unit
14
- */
15
- gridUnit?: number;
16
- /**
17
- * If the grid unit is editable for change to the end user.
18
- * If it is not editable, the grid unit cannot be changed from the default value.
19
- */
20
- gridUnitEditable?: boolean;
21
- } & SnapRestrictionProperties;
22
- export declare class GridRestriction extends AbstractRestriction implements ISnapRestriction {
23
- #private;
24
- constructor(drawingToolsManager: DrawingToolsManager, planeRestriction: PlaneRestriction, properties?: GridRestrictionProperties);
25
- get active(): boolean;
26
- set active(value: boolean);
27
- get enabledEditable(): boolean;
28
- get gridUnit(): number;
29
- set gridUnit(value: number);
30
- get gridUnitEditable(): boolean;
31
- get priority(): number;
32
- set priority(value: number);
33
- snap(ray: IRay, point: vec3, metaData: RestrictionMetaData): vec3 | undefined;
34
- updatePlaneDefinition(): void;
35
- protected visibilityChanged(visible: boolean): void;
36
- private createGridVisualization;
37
- private createOffsetFromUnit;
38
- }
39
- //# sourceMappingURL=GridRestriction.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"GridRestriction.d.ts","sourceRoot":"","sources":["../../../../../../../../src/business/implementation/managers/interaction/restrictions/plane/snap/GridRestriction.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAEhE,OAAO,EAAE,mBAAmB,EAAE,MAAM,oCAAoC,CAAC;AACzE,OAAO,EAAE,IAAI,EAAE,MAAM,yCAAyC,CAAC;AAC/D,OAAO,EAAE,gBAAgB,EAAE,yBAAyB,EAAE,MAAM,+CAA+C,CAAC;AAC5G,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,EAAE,mBAAmB,EAAE,MAAM,2CAA2C,CAAC;AAChF,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAIjC;;GAEG;AACH,oBAAY,yBAAyB,GAAG;IACpC;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB;;;OAGG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAC;CAC9B,GAAG,yBAAyB,CAAC;AAM9B,qBAAa,eAAgB,SAAQ,mBAAoB,YAAW,gBAAgB;;gBAmBpE,mBAAmB,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,UAAU,CAAC,EAAE,yBAAyB;IAwBhI,IAAW,MAAM,IAAI,OAAO,CAE3B;IAED,IAAW,MAAM,CAAC,KAAK,EAAE,OAAO,EAI/B;IAED,IAAW,eAAe,IAAI,OAAO,CAEpC;IAED,IAAW,QAAQ,IAAI,MAAM,CAE5B;IAED,IAAW,QAAQ,CAAC,KAAK,EAAE,MAAM,EAMhC;IAED,IAAW,gBAAgB,IAAI,OAAO,CAErC;IAED,IAAW,QAAQ,IAAI,MAAM,CAE5B;IAED,IAAW,QAAQ,CAAC,KAAK,EAAE,MAAM,EAEhC;IAOM,IAAI,CAAC,GAAG,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,mBAAmB,GAAG,IAAI,GAAG,SAAS;IA+C7E,qBAAqB,IAAI,IAAI;IASpC,SAAS,CAAC,iBAAiB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI;IAYnD,OAAO,CAAC,uBAAuB;IAiD/B,OAAO,CAAC,oBAAoB;CAQ/B"}
@@ -1,212 +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
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
25
- var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
26
- if (kind === "m") throw new TypeError("Private method is not writable");
27
- if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
28
- if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
29
- return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
30
- };
31
- var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
32
- if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
33
- if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
34
- return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
35
- };
36
- var _GridRestriction_activationKey, _GridRestriction_drawingToolsManager, _GridRestriction_planeRestriction, _GridRestriction_active, _GridRestriction_gridHelper, _GridRestriction_gridSize, _GridRestriction_gridUnit, _GridRestriction_gridUnitEditable, _GridRestriction_offsetFromUnit, _GridRestriction_priority;
37
- Object.defineProperty(exports, "__esModule", { value: true });
38
- exports.GridRestriction = void 0;
39
- const THREE = __importStar(require("three"));
40
- const AbstractRestriction_1 = require("../../AbstractRestriction");
41
- const viewer_1 = require("@shapediver/viewer");
42
- const gl_matrix_1 = require("gl-matrix");
43
- // #endregion Type aliases (1)
44
- // #region Classes (1)
45
- class GridRestriction extends AbstractRestriction_1.AbstractRestriction {
46
- // #endregion Properties (10)
47
- // #region Constructors (1)
48
- constructor(drawingToolsManager, planeRestriction, properties) {
49
- var _a, _b, _c;
50
- super(drawingToolsManager, 'grid');
51
- // #region Properties (10)
52
- _GridRestriction_activationKey.set(this, void 0);
53
- _GridRestriction_drawingToolsManager.set(this, void 0);
54
- _GridRestriction_planeRestriction.set(this, void 0);
55
- _GridRestriction_active.set(this, false);
56
- _GridRestriction_gridHelper.set(this, void 0);
57
- _GridRestriction_gridSize.set(this, 100);
58
- _GridRestriction_gridUnit.set(this, void 0);
59
- _GridRestriction_gridUnitEditable.set(this, true);
60
- _GridRestriction_offsetFromUnit.set(this, gl_matrix_1.vec3.create());
61
- _GridRestriction_priority.set(this, 0);
62
- __classPrivateFieldSet(this, _GridRestriction_drawingToolsManager, drawingToolsManager, "f");
63
- __classPrivateFieldSet(this, _GridRestriction_planeRestriction, planeRestriction, "f");
64
- __classPrivateFieldSet(this, _GridRestriction_activationKey, (properties === null || properties === void 0 ? void 0 : properties.activationKey) || 'g', "f");
65
- this.enabled = (_a = properties === null || properties === void 0 ? void 0 : properties.enabled) !== null && _a !== void 0 ? _a : false;
66
- this._enabledEditable = (_b = properties === null || properties === void 0 ? void 0 : properties.enabledEditable) !== null && _b !== void 0 ? _b : true;
67
- __classPrivateFieldSet(this, _GridRestriction_gridUnit, (properties === null || properties === void 0 ? void 0 : properties.gridUnit) || 1, "f");
68
- __classPrivateFieldSet(this, _GridRestriction_gridUnitEditable, (_c = properties === null || properties === void 0 ? void 0 : properties.gridUnitEditable) !== null && _c !== void 0 ? _c : true, "f");
69
- __classPrivateFieldSet(this, _GridRestriction_priority, (properties === null || properties === void 0 ? void 0 : properties.priority) || 0, "f");
70
- // create the offset of the grid size to origin
71
- this.createOffsetFromUnit();
72
- // calculate offset of grid size to origin
73
- this.createGridVisualization();
74
- }
75
- // #endregion Constructors (1)
76
- // #region Public Getters And Setters (8)
77
- get active() {
78
- return __classPrivateFieldGet(this, _GridRestriction_active, "f");
79
- }
80
- set active(value) {
81
- __classPrivateFieldSet(this, _GridRestriction_active, value, "f");
82
- if (__classPrivateFieldGet(this, _GridRestriction_gridHelper, "f"))
83
- __classPrivateFieldGet(this, _GridRestriction_gridHelper, "f").visible = value;
84
- }
85
- get enabledEditable() {
86
- return this._enabledEditable;
87
- }
88
- get gridUnit() {
89
- return __classPrivateFieldGet(this, _GridRestriction_gridUnit, "f");
90
- }
91
- set gridUnit(value) {
92
- if (__classPrivateFieldGet(this, _GridRestriction_gridUnitEditable, "f") === false)
93
- return;
94
- __classPrivateFieldSet(this, _GridRestriction_gridUnit, value, "f");
95
- this.createOffsetFromUnit();
96
- this.createGridVisualization();
97
- }
98
- get gridUnitEditable() {
99
- return __classPrivateFieldGet(this, _GridRestriction_gridUnitEditable, "f");
100
- }
101
- get priority() {
102
- return __classPrivateFieldGet(this, _GridRestriction_priority, "f");
103
- }
104
- set priority(value) {
105
- __classPrivateFieldSet(this, _GridRestriction_priority, value, "f");
106
- }
107
- // #endregion Public Getters And Setters (8)
108
- // #region Public Methods (2)
109
- // public get
110
- snap(ray, point, metaData) {
111
- // if the restriction is not enabled OR the activation key is set and the key is not pressed, return
112
- if (this.enabled === false && __classPrivateFieldGet(this, _GridRestriction_drawingToolsManager, "f").keyPressed(__classPrivateFieldGet(this, _GridRestriction_activationKey, "f")) === false)
113
- return;
114
- /**
115
- * Explanation of the following code:
116
- * 1. Calculate the projection of the origin onto the plane that is created by the point and the normal
117
- * 2. Move the grid helper to the projected origin
118
- */
119
- // vector from the point to the origin
120
- const v = gl_matrix_1.vec3.sub(gl_matrix_1.vec3.create(), __classPrivateFieldGet(this, _GridRestriction_planeRestriction, "f").origin, point);
121
- // dot product of the vector and the normal
122
- const dot = gl_matrix_1.vec3.dot(v, __classPrivateFieldGet(this, _GridRestriction_planeRestriction, "f").normal);
123
- // projection of the origin onto the plane that is created by the point and the normal
124
- const projectedOrigin = gl_matrix_1.vec3.sub(gl_matrix_1.vec3.create(), __classPrivateFieldGet(this, _GridRestriction_planeRestriction, "f").origin, gl_matrix_1.vec3.scale(gl_matrix_1.vec3.create(), __classPrivateFieldGet(this, _GridRestriction_planeRestriction, "f").normal, dot));
125
- // we move the grid helper to the projected origin
126
- if (__classPrivateFieldGet(this, _GridRestriction_gridHelper, "f")) {
127
- __classPrivateFieldGet(this, _GridRestriction_gridHelper, "f").position.copy(new THREE.Vector3(projectedOrigin[0], projectedOrigin[1], projectedOrigin[2]));
128
- __classPrivateFieldGet(this, _GridRestriction_gridHelper, "f").visible = false;
129
- }
130
- /**
131
- * Explanation of the following code:
132
- * 1. Rotate the point so that the normal of the plane is aligned with the Z axis (with previously calculated transformation matrix)
133
- * 2. Snap the point to the grid
134
- * 3. Rotate the point back to the original coordinate system (with previously calculated transformation matrix)
135
- */
136
- // Apply the transformation to the point
137
- const rotatedPoint = gl_matrix_1.vec3.transformMat4(gl_matrix_1.vec3.create(), point, __classPrivateFieldGet(this, _GridRestriction_planeRestriction, "f").transformationToXYPlaneMatrix);
138
- // Snap the offset to the grid
139
- const snappedOffset = gl_matrix_1.vec3.create();
140
- snappedOffset[0] = Math.round(rotatedPoint[0] / __classPrivateFieldGet(this, _GridRestriction_gridUnit, "f")) * __classPrivateFieldGet(this, _GridRestriction_gridUnit, "f") - __classPrivateFieldGet(this, _GridRestriction_offsetFromUnit, "f")[0];
141
- snappedOffset[1] = Math.round(rotatedPoint[1] / __classPrivateFieldGet(this, _GridRestriction_gridUnit, "f")) * __classPrivateFieldGet(this, _GridRestriction_gridUnit, "f") - __classPrivateFieldGet(this, _GridRestriction_offsetFromUnit, "f")[1];
142
- snappedOffset[2] = rotatedPoint[2];
143
- // Move the snapped point back to the original coordinate system
144
- const snappedPoint = gl_matrix_1.vec3.transformMat4(gl_matrix_1.vec3.create(), snappedOffset, __classPrivateFieldGet(this, _GridRestriction_planeRestriction, "f").transformationFromXYPlaneMatrix);
145
- return snappedPoint;
146
- }
147
- updatePlaneDefinition() {
148
- this.createOffsetFromUnit();
149
- this.createGridVisualization();
150
- }
151
- // #endregion Public Methods (2)
152
- // #region Protected Methods (1)
153
- visibilityChanged(visible) {
154
- if (visible === false) {
155
- if (__classPrivateFieldGet(this, _GridRestriction_gridHelper, "f")) {
156
- __classPrivateFieldGet(this, _GridRestriction_gridHelper, "f").visible = false;
157
- }
158
- }
159
- }
160
- // #endregion Protected Methods (1)
161
- // #region Private Methods (2)
162
- createGridVisualization() {
163
- if (__classPrivateFieldGet(this, _GridRestriction_gridHelper, "f")) {
164
- this._object3D.remove(__classPrivateFieldGet(this, _GridRestriction_gridHelper, "f"));
165
- __classPrivateFieldGet(this, _GridRestriction_gridHelper, "f").dispose();
166
- }
167
- const bb = new viewer_1.Box();
168
- for (let i = 0; i < viewer_1.sceneTree.root.children.length; i++) {
169
- if (viewer_1.sceneTree.root.children[i].sessionNode === true) {
170
- bb.union(viewer_1.sceneTree.root.children[i].boundingBox);
171
- }
172
- }
173
- const radius = bb.boundingSphere.radius;
174
- __classPrivateFieldSet(this, _GridRestriction_gridSize, radius * 2, "f");
175
- if (__classPrivateFieldGet(this, _GridRestriction_gridSize, "f") === Infinity || __classPrivateFieldGet(this, _GridRestriction_gridSize, "f") === -Infinity || isNaN(__classPrivateFieldGet(this, _GridRestriction_gridSize, "f")) || __classPrivateFieldGet(this, _GridRestriction_gridSize, "f") === 0)
176
- __classPrivateFieldSet(this, _GridRestriction_gridSize, 100, "f");
177
- // if the grid size is not divisible by the grid unit, we need to adjust the grid size
178
- let gridSize = __classPrivateFieldGet(this, _GridRestriction_gridUnit, "f") * Math.ceil(__classPrivateFieldGet(this, _GridRestriction_gridSize, "f") / __classPrivateFieldGet(this, _GridRestriction_gridUnit, "f"));
179
- // if the number of divisions is odd, we need to add one more division
180
- if (gridSize / __classPrivateFieldGet(this, _GridRestriction_gridUnit, "f") % 2 === 1)
181
- gridSize += __classPrivateFieldGet(this, _GridRestriction_gridUnit, "f");
182
- // todo adjust grid size so that is divisible by grid unit
183
- __classPrivateFieldSet(this, _GridRestriction_gridHelper, new THREE.GridHelper(gridSize, gridSize / __classPrivateFieldGet(this, _GridRestriction_gridUnit, "f"), 0x666666, 0x222222), "f");
184
- const adjustedOrigin = gl_matrix_1.vec3.add(gl_matrix_1.vec3.create(), __classPrivateFieldGet(this, _GridRestriction_planeRestriction, "f").origin, __classPrivateFieldGet(this, _GridRestriction_offsetFromUnit, "f"));
185
- __classPrivateFieldGet(this, _GridRestriction_gridHelper, "f").position.copy(new THREE.Vector3(adjustedOrigin[0], adjustedOrigin[1], adjustedOrigin[2]));
186
- __classPrivateFieldGet(this, _GridRestriction_gridHelper, "f").visible = false;
187
- __classPrivateFieldGet(this, _GridRestriction_gridHelper, "f").renderOrder = 100;
188
- __classPrivateFieldGet(this, _GridRestriction_gridHelper, "f").material.depthTest = false;
189
- __classPrivateFieldGet(this, _GridRestriction_gridHelper, "f").material.transparent = true;
190
- // three.js uses a right-handed coordinate system, so we need to rotate the grid helper
191
- const rotationMatrix = new THREE.Matrix4().fromArray([
192
- __classPrivateFieldGet(this, _GridRestriction_planeRestriction, "f").vectorU[0], __classPrivateFieldGet(this, _GridRestriction_planeRestriction, "f").vectorU[1], __classPrivateFieldGet(this, _GridRestriction_planeRestriction, "f").vectorU[2], 0,
193
- __classPrivateFieldGet(this, _GridRestriction_planeRestriction, "f").vectorV[0], __classPrivateFieldGet(this, _GridRestriction_planeRestriction, "f").vectorV[1], __classPrivateFieldGet(this, _GridRestriction_planeRestriction, "f").vectorV[2], 0,
194
- __classPrivateFieldGet(this, _GridRestriction_planeRestriction, "f").normal[0], __classPrivateFieldGet(this, _GridRestriction_planeRestriction, "f").normal[1], __classPrivateFieldGet(this, _GridRestriction_planeRestriction, "f").normal[2], 0,
195
- 0, 0, 0, 1
196
- ]);
197
- __classPrivateFieldGet(this, _GridRestriction_gridHelper, "f").rotation.setFromRotationMatrix(rotationMatrix);
198
- // three.js grid helper is created in the XY plane, so we need to rotate it by 90 degrees around the X axis
199
- __classPrivateFieldGet(this, _GridRestriction_gridHelper, "f").rotateX(Math.PI / 2);
200
- this._object3D.add(__classPrivateFieldGet(this, _GridRestriction_gridHelper, "f"));
201
- }
202
- createOffsetFromUnit() {
203
- // Calculate the offset of the rotated point from the rotated origin
204
- __classPrivateFieldGet(this, _GridRestriction_offsetFromUnit, "f")[0] = __classPrivateFieldGet(this, _GridRestriction_gridUnit, "f") * Math.round(__classPrivateFieldGet(this, _GridRestriction_planeRestriction, "f").origin[0] / __classPrivateFieldGet(this, _GridRestriction_gridUnit, "f")) - __classPrivateFieldGet(this, _GridRestriction_planeRestriction, "f").origin[0];
205
- __classPrivateFieldGet(this, _GridRestriction_offsetFromUnit, "f")[1] = __classPrivateFieldGet(this, _GridRestriction_gridUnit, "f") * Math.round(__classPrivateFieldGet(this, _GridRestriction_planeRestriction, "f").origin[1] / __classPrivateFieldGet(this, _GridRestriction_gridUnit, "f")) - __classPrivateFieldGet(this, _GridRestriction_planeRestriction, "f").origin[1];
206
- __classPrivateFieldGet(this, _GridRestriction_offsetFromUnit, "f")[2] = __classPrivateFieldGet(this, _GridRestriction_gridUnit, "f") * Math.round(__classPrivateFieldGet(this, _GridRestriction_planeRestriction, "f").origin[2] / __classPrivateFieldGet(this, _GridRestriction_gridUnit, "f")) - __classPrivateFieldGet(this, _GridRestriction_planeRestriction, "f").origin[2];
207
- }
208
- }
209
- exports.GridRestriction = GridRestriction;
210
- _GridRestriction_activationKey = new WeakMap(), _GridRestriction_drawingToolsManager = new WeakMap(), _GridRestriction_planeRestriction = new WeakMap(), _GridRestriction_active = new WeakMap(), _GridRestriction_gridHelper = new WeakMap(), _GridRestriction_gridSize = new WeakMap(), _GridRestriction_gridUnit = new WeakMap(), _GridRestriction_gridUnitEditable = new WeakMap(), _GridRestriction_offsetFromUnit = new WeakMap(), _GridRestriction_priority = new WeakMap();
211
- // #endregion Classes (1)
212
- //# sourceMappingURL=GridRestriction.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"GridRestriction.js","sourceRoot":"","sources":["../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CAAC;QAChE,2GAA2G;QAC3G,uBAAA,IAAI,mCAAY,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC;QAEtC,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,uBAAA,IAAI,mCAAY,CAAC,CAAC;IACzC,CAAC;IAEO,oBAAoB;QACxB,oEAAoE;QACpE,uBAAA,IAAI,uCAAgB,CAAC,CAAC,CAAC,GAAG,uBAAA,IAAI,iCAAU,GAAG,IAAI,CAAC,KAAK,CAAC,uBAAA,IAAI,yCAAkB,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,uBAAA,IAAI,iCAAU,CAAC,GAAG,uBAAA,IAAI,yCAAkB,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;QAC5I,uBAAA,IAAI,uCAAgB,CAAC,CAAC,CAAC,GAAG,uBAAA,IAAI,iCAAU,GAAG,IAAI,CAAC,KAAK,CAAC,uBAAA,IAAI,yCAAkB,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,uBAAA,IAAI,iCAAU,CAAC,GAAG,uBAAA,IAAI,yCAAkB,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;QAC5I,uBAAA,IAAI,uCAAgB,CAAC,CAAC,CAAC,GAAG,uBAAA,IAAI,iCAAU,GAAG,IAAI,CAAC,KAAK,CAAC,uBAAA,IAAI,yCAAkB,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,uBAAA,IAAI,iCAAU,CAAC,GAAG,uBAAA,IAAI,yCAAkB,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;IAChJ,CAAC;CAGJ;AAnND,0CAmNC;;AAED,yBAAyB"}
@@ -1,2 +0,0 @@
1
- export declare const numberCleaner: (value: number) => number;
2
- //# sourceMappingURL=numberCleaner.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"numberCleaner.d.ts","sourceRoot":"","sources":["../../../../src/business/implementation/utils/numberCleaner.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,aAAa,UAAW,MAAM,KAAG,MAG7C,CAAC"}
@@ -1,9 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.numberCleaner = void 0;
4
- const numberCleaner = (value) => {
5
- const roundedThreshold = 100;
6
- return Math.round(value * roundedThreshold) / roundedThreshold;
7
- };
8
- exports.numberCleaner = numberCleaner;
9
- //# sourceMappingURL=numberCleaner.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"numberCleaner.js","sourceRoot":"","sources":["../../../../src/business/implementation/utils/numberCleaner.ts"],"names":[],"mappings":";;;AACO,MAAM,aAAa,GAAG,CAAC,KAAa,EAAU,EAAE;IACnD,MAAM,gBAAgB,GAAG,GAAG,CAAC;IAC7B,OAAO,IAAI,CAAC,KAAK,CAAC,KAAK,GAAG,gBAAgB,CAAC,GAAG,gBAAgB,CAAC;AACnE,CAAC,CAAC;AAHW,QAAA,aAAa,iBAGxB"}
@@ -1,4 +0,0 @@
1
- export interface IManager {
2
- close(): void;
3
- }
4
- //# sourceMappingURL=IManager.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"IManager.d.ts","sourceRoot":"","sources":["../../../src/business/interfaces/IManager.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,QAAQ;IAGrB,KAAK,IAAI,IAAI,CAAC;CAGjB"}
@@ -1,3 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=IManager.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"IManager.js","sourceRoot":"","sources":["../../../src/business/interfaces/IManager.ts"],"names":[],"mappings":""}
@@ -1,40 +0,0 @@
1
- import { IRay } from '@shapediver/viewer.features.interaction';
2
- import { IRestrictionBase } from './IRestrictionBase';
3
- import { ISnapRestriction } from './ISnapRestriction';
4
- import { vec3 } from 'gl-matrix';
5
- export declare type RestrictionMetaData = {
6
- index?: number;
7
- referencePoint?: vec3;
8
- };
9
- export declare type RestrictionProperties = {
10
- /**
11
- * Type of the restriction
12
- */
13
- type: RESTRICTION_TYPE;
14
- };
15
- export interface IRestriction extends IRestrictionBase {
16
- /**
17
- * Priority of the restriction
18
- */
19
- readonly priority: number;
20
- /**
21
- * The snap restrictions of the restriction.
22
- */
23
- snapRestrictions: {
24
- [key: string]: ISnapRestriction;
25
- };
26
- /**
27
- * Ray trace the restriction.
28
- * If the ray does not intersect the restriction, the method returns undefined.
29
- *
30
- * @param ray The ray to trace.
31
- * @param metaData The meta data of the ray.
32
- * @returns The intersection point of the ray with the restriction.
33
- */
34
- rayTrace(ray: IRay, metaData?: RestrictionMetaData): vec3 | undefined;
35
- }
36
- export declare enum RESTRICTION_TYPE {
37
- PLANE = "plane",
38
- GEOMETRY = "geometry"
39
- }
40
- //# sourceMappingURL=IRestriction.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"IRestriction.d.ts","sourceRoot":"","sources":["../../../src/business/interfaces/IRestriction.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,yCAAyC,CAAC;AAC/D,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAIjC,oBAAY,mBAAmB,GAAG;IAC9B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,cAAc,CAAC,EAAE,IAAI,CAAC;CACzB,CAAA;AAED,oBAAY,qBAAqB,GAAG;IAChC;;OAEG;IACH,IAAI,EAAE,gBAAgB,CAAC;CAC1B,CAAC;AAMF,MAAM,WAAW,YAAa,SAAQ,gBAAgB;IAGlD;;OAEG;IACH,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAE1B;;OAEG;IACH,gBAAgB,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,gBAAgB,CAAC;KAAE,CAAA;IAMtD;;;;;;;OAOG;IACH,QAAQ,CAAC,GAAG,EAAE,IAAI,EAAE,QAAQ,CAAC,EAAE,mBAAmB,GAAG,IAAI,GAAG,SAAS,CAAC;CAGzE;AAMD,oBAAY,gBAAgB;IACxB,KAAK,UAAU;IACf,QAAQ,aAAa;CACxB"}
@@ -1,12 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.RESTRICTION_TYPE = void 0;
4
- // #endregion Interfaces (1)
5
- // #region Enums (1)
6
- var RESTRICTION_TYPE;
7
- (function (RESTRICTION_TYPE) {
8
- RESTRICTION_TYPE["PLANE"] = "plane";
9
- RESTRICTION_TYPE["GEOMETRY"] = "geometry";
10
- })(RESTRICTION_TYPE = exports.RESTRICTION_TYPE || (exports.RESTRICTION_TYPE = {}));
11
- // #endregion Enums (1)
12
- //# sourceMappingURL=IRestriction.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"IRestriction.js","sourceRoot":"","sources":["../../../src/business/interfaces/IRestriction.ts"],"names":[],"mappings":";;;AAqDA,4BAA4B;AAE5B,oBAAoB;AAEpB,IAAY,gBAGX;AAHD,WAAY,gBAAgB;IACxB,mCAAe,CAAA;IACf,yCAAqB,CAAA;AACzB,CAAC,EAHW,gBAAgB,GAAhB,wBAAgB,KAAhB,wBAAgB,QAG3B;AAED,uBAAuB"}
@@ -1,19 +0,0 @@
1
- export interface IRestrictionBase {
2
- /**
3
- * The unique identifier of the restriction.
4
- */
5
- readonly id: string;
6
- /**
7
- * Whether the restriction is enabled or not.
8
- */
9
- enabled: boolean;
10
- /**
11
- * Whether the visualization of the restriction is shown or not (if there is one).
12
- */
13
- showVisualization: boolean;
14
- /**
15
- * Remove the visualization of the restriction.
16
- */
17
- removeVisualization(): void;
18
- }
19
- //# sourceMappingURL=IRestrictionBase.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"IRestrictionBase.d.ts","sourceRoot":"","sources":["../../../src/business/interfaces/IRestrictionBase.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,gBAAgB;IAG7B;;OAEG;IACH,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IAEpB;;OAEG;IACH,OAAO,EAAE,OAAO,CAAC;IAEjB;;OAEG;IACH,iBAAiB,EAAE,OAAO,CAAC;IAM3B;;OAEG;IACH,mBAAmB,IAAI,IAAI,CAAC;CAG/B"}
@@ -1,5 +0,0 @@
1
- "use strict";
2
- // #region Interfaces (1)
3
- Object.defineProperty(exports, "__esModule", { value: true });
4
- // #endregion Interfaces (1)
5
- //# sourceMappingURL=IRestrictionBase.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"IRestrictionBase.js","sourceRoot":"","sources":["../../../src/business/interfaces/IRestrictionBase.ts"],"names":[],"mappings":";AAAA,yBAAyB;;AAgCzB,4BAA4B"}
@@ -1,52 +0,0 @@
1
- import { IRay } from '@shapediver/viewer.features.interaction';
2
- import { IRestrictionBase } from './IRestrictionBase';
3
- import { RestrictionMetaData } from './IRestriction';
4
- import { vec3 } from 'gl-matrix';
5
- export declare type SnapRestrictionProperties = {
6
- /**
7
- * If the restriction should be enabled by default.
8
- */
9
- enabled?: boolean;
10
- /**
11
- * If the enabling or disabling of the restriction is allowed to the end user.
12
- * If it is not editable, the default value for enabling or disabling the restriction is used.
13
- */
14
- enabledEditable?: boolean;
15
- /**
16
- * Priority of the restriction.
17
- * The higher the priority, the sooner the restriction is applied.
18
- * If the priority is the same, the result that is closer to the original point is chosen.
19
- */
20
- priority?: number;
21
- /**
22
- * The activation key of the restriction.
23
- * If the key is not provided, no key is assigned.
24
- * If the key is provided, the restriction is only active when the key is pressed.
25
- */
26
- activationKey?: string;
27
- };
28
- export interface ISnapRestriction extends IRestrictionBase {
29
- /**
30
- * If the restriction is actively being used at the moment.
31
- */
32
- active: boolean;
33
- /**
34
- * If the enabling or disabling of the restriction is allowed to the end user.
35
- * If it is not editable, the default value for enabling or disabling the restriction is used.
36
- */
37
- enabledEditable: boolean;
38
- /**
39
- * The priority of the restriction.
40
- */
41
- priority: number;
42
- /**
43
- * Restrict the position of a point.
44
- *
45
- * @param ray The ray that is used for the restriction.
46
- * @param point The position of the point.
47
- * @param metaData The meta data of the point.
48
- * @returns The restricted position of the point.
49
- */
50
- snap(ray: IRay, point: vec3, metaData?: RestrictionMetaData): vec3 | undefined;
51
- }
52
- //# sourceMappingURL=ISnapRestriction.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ISnapRestriction.d.ts","sourceRoot":"","sources":["../../../src/business/interfaces/ISnapRestriction.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,yCAAyC,CAAC;AAC/D,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AACrD,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAIjC,oBAAY,yBAAyB,GAAG;IACpC;;OAEG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;;OAGG;IACH,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B;;;;OAIG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;;;OAIG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;CAC1B,CAAC;AAMF,MAAM,WAAW,gBAAiB,SAAQ,gBAAgB;IAGtD;;OAEG;IACH,MAAM,EAAE,OAAO,CAAC;IAChB;;;OAGG;IACH,eAAe,EAAE,OAAO,CAAC;IACzB;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;IAMjB;;;;;;;OAOG;IACH,IAAI,CAAC,GAAG,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,QAAQ,CAAC,EAAE,mBAAmB,GAAG,IAAI,GAAG,SAAS,CAAC;CAGlF"}
@@ -1,4 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- // #endregion Interfaces (1)
4
- //# sourceMappingURL=ISnapRestriction.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ISnapRestriction.js","sourceRoot":"","sources":["../../../src/business/interfaces/ISnapRestriction.ts"],"names":[],"mappings":";;AAqEA,4BAA4B"}
@@ -1,32 +0,0 @@
1
- import { Object3D, Vector2, Scene, Camera } from 'three';
2
- declare class CSS2DObject extends Object3D {
3
- center: Vector2;
4
- element: HTMLElement;
5
- isCSS2DObject: boolean;
6
- constructor(element?: HTMLDivElement);
7
- copy(source: this, recursive?: boolean): this;
8
- }
9
- declare type CSS2DParameters = {
10
- element?: HTMLElement;
11
- };
12
- declare class CSS2DRenderer {
13
- private readonly _cache;
14
- private _height;
15
- private _heightHalf;
16
- private _width;
17
- private _widthHalf;
18
- domElement: HTMLElement;
19
- constructor(parameters?: CSS2DParameters);
20
- filterAndFlatten(scene: Scene): CSS2DObject[];
21
- getDistanceToSquared(object1: Object3D, object2: Object3D): number;
22
- getSize(): {
23
- width: number;
24
- height: number;
25
- };
26
- render(scene: Scene, camera: Camera): void;
27
- renderObject(o: Object3D, scene: Scene, camera: Camera): void;
28
- setSize(width: number, height: number): void;
29
- zOrder(scene: Scene): void;
30
- }
31
- export { CSS2DObject, CSS2DRenderer };
32
- //# sourceMappingURL=CSS2DRenderer.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"CSS2DRenderer.d.ts","sourceRoot":"","sources":["../../src/three/CSS2DRenderer.ts"],"names":[],"mappings":"AAAA,OAAO,EAEH,QAAQ,EACR,OAAO,EAEP,KAAK,EACL,MAAM,EACT,MAAM,OAAO,CAAC;AAEf,cAAM,WAAY,SAAQ,QAAQ;IAGvB,MAAM,EAAE,OAAO,CAAC;IAChB,OAAO,EAAE,WAAW,CAAC;IACrB,aAAa,EAAE,OAAO,CAAC;gBAMlB,OAAO,iBAAgC;IA+B5C,IAAI,CAAC,MAAM,EAAE,IAAI,EAAE,SAAS,CAAC,EAAE,OAAO,GAAG,IAAI;CAWvD;AAUD,aAAK,eAAe,GAAG;IACnB,OAAO,CAAC,EAAE,WAAW,CA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