@shapediver/viewer.rendering-engine.intersection-restriction-engine 3.16.8 → 3.16.9

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 (95) hide show
  1. package/dist/api/implementation/AbstractRestrictionApi.d.ts +12 -12
  2. package/dist/api/implementation/AbstractRestrictionApi.js +46 -46
  3. package/dist/api/implementation/AbstractRestrictionApi.js.map +1 -1
  4. package/dist/api/implementation/AbstractSnapRestrictionApi.d.ts +12 -12
  5. package/dist/api/implementation/AbstractSnapRestrictionApi.js +46 -46
  6. package/dist/api/implementation/AbstractSnapRestrictionApi.js.map +1 -1
  7. package/dist/api/implementation/camera_plane/CameraPlaneRestrictionApi.d.ts +6 -6
  8. package/dist/api/implementation/camera_plane/CameraPlaneRestrictionApi.js +23 -23
  9. package/dist/api/implementation/camera_plane/CameraPlaneRestrictionApi.js.map +1 -1
  10. package/dist/api/implementation/geometry/GeometryRestrictionApi.d.ts +14 -14
  11. package/dist/api/implementation/geometry/GeometryRestrictionApi.js +53 -53
  12. package/dist/api/implementation/geometry/GeometryRestrictionApi.js.map +1 -1
  13. package/dist/api/implementation/line/LineRestrictionApi.d.ts +10 -10
  14. package/dist/api/implementation/line/LineRestrictionApi.js +39 -39
  15. package/dist/api/implementation/line/LineRestrictionApi.js.map +1 -1
  16. package/dist/api/implementation/plane/PlaneRestrictionApi.d.ts +19 -19
  17. package/dist/api/implementation/plane/PlaneRestrictionApi.js +66 -66
  18. package/dist/api/implementation/plane/PlaneRestrictionApi.js.map +1 -1
  19. package/dist/api/implementation/plane/snap/AngularRestrictionApi.d.ts +9 -9
  20. package/dist/api/implementation/plane/snap/AngularRestrictionApi.js +39 -39
  21. package/dist/api/implementation/plane/snap/AngularRestrictionApi.js.map +1 -1
  22. package/dist/api/implementation/plane/snap/AxisRestrictionApi.d.ts +6 -6
  23. package/dist/api/implementation/plane/snap/AxisRestrictionApi.js +23 -23
  24. package/dist/api/implementation/plane/snap/AxisRestrictionApi.js.map +1 -1
  25. package/dist/api/implementation/plane/snap/GridRestrictionApi.d.ts +9 -9
  26. package/dist/api/implementation/plane/snap/GridRestrictionApi.js +39 -39
  27. package/dist/api/implementation/plane/snap/GridRestrictionApi.js.map +1 -1
  28. package/dist/api/implementation/point/PointRestrictionApi.d.ts +9 -9
  29. package/dist/api/implementation/point/PointRestrictionApi.js +36 -36
  30. package/dist/api/implementation/point/PointRestrictionApi.js.map +1 -1
  31. package/dist/api/interfaces/IRestrictionApi.d.ts +10 -10
  32. package/dist/api/interfaces/IRestrictionApi.js +2 -2
  33. package/dist/api/interfaces/ISnapRestrictionApi.d.ts +12 -12
  34. package/dist/api/interfaces/ISnapRestrictionApi.js +2 -2
  35. package/dist/implementation/EventManager.d.ts +25 -25
  36. package/dist/implementation/EventManager.d.ts.map +1 -1
  37. package/dist/implementation/EventManager.js +62 -62
  38. package/dist/implementation/EventManager.js.map +1 -1
  39. package/dist/implementation/GeometryMathManager.d.ts +87 -87
  40. package/dist/implementation/GeometryMathManager.js +260 -260
  41. package/dist/implementation/GeometryMathManager.js.map +1 -1
  42. package/dist/implementation/RestrictionManager.d.ts +28 -28
  43. package/dist/implementation/RestrictionManager.js +323 -323
  44. package/dist/implementation/RestrictionManager.js.map +1 -1
  45. package/dist/implementation/restrictions/AbstractRestriction.d.ts +42 -42
  46. package/dist/implementation/restrictions/AbstractRestriction.js +164 -154
  47. package/dist/implementation/restrictions/AbstractRestriction.js.map +1 -1
  48. package/dist/implementation/restrictions/AbstractSnapRestriction.d.ts +35 -35
  49. package/dist/implementation/restrictions/AbstractSnapRestriction.js +150 -140
  50. package/dist/implementation/restrictions/AbstractSnapRestriction.js.map +1 -1
  51. package/dist/implementation/restrictions/RestrictionsHelper.d.ts +10 -10
  52. package/dist/implementation/restrictions/RestrictionsHelper.d.ts.map +1 -1
  53. package/dist/implementation/restrictions/RestrictionsHelper.js +50 -50
  54. package/dist/implementation/restrictions/RestrictionsHelper.js.map +1 -1
  55. package/dist/implementation/restrictions/camera_plane/CameraPlaneRestriction.d.ts +17 -17
  56. package/dist/implementation/restrictions/camera_plane/CameraPlaneRestriction.js +62 -62
  57. package/dist/implementation/restrictions/camera_plane/CameraPlaneRestriction.js.map +1 -1
  58. package/dist/implementation/restrictions/geometry/GeometryRestriction.d.ts +92 -92
  59. package/dist/implementation/restrictions/geometry/GeometryRestriction.js +410 -400
  60. package/dist/implementation/restrictions/geometry/GeometryRestriction.js.map +1 -1
  61. package/dist/implementation/restrictions/line/LineRestriction.d.ts +58 -58
  62. package/dist/implementation/restrictions/line/LineRestriction.js +291 -281
  63. package/dist/implementation/restrictions/line/LineRestriction.js.map +1 -1
  64. package/dist/implementation/restrictions/plane/PlaneRestriction.d.ts +65 -65
  65. package/dist/implementation/restrictions/plane/PlaneRestriction.js +306 -306
  66. package/dist/implementation/restrictions/plane/PlaneRestriction.js.map +1 -1
  67. package/dist/implementation/restrictions/plane/snap/AngularRestriction.d.ts +39 -39
  68. package/dist/implementation/restrictions/plane/snap/AngularRestriction.d.ts.map +1 -1
  69. package/dist/implementation/restrictions/plane/snap/AngularRestriction.js +346 -346
  70. package/dist/implementation/restrictions/plane/snap/AngularRestriction.js.map +1 -1
  71. package/dist/implementation/restrictions/plane/snap/AxisRestriction.d.ts +27 -27
  72. package/dist/implementation/restrictions/plane/snap/AxisRestriction.d.ts.map +1 -1
  73. package/dist/implementation/restrictions/plane/snap/AxisRestriction.js +239 -229
  74. package/dist/implementation/restrictions/plane/snap/AxisRestriction.js.map +1 -1
  75. package/dist/implementation/restrictions/plane/snap/GridRestriction.d.ts +39 -39
  76. package/dist/implementation/restrictions/plane/snap/GridRestriction.d.ts.map +1 -1
  77. package/dist/implementation/restrictions/plane/snap/GridRestriction.js +318 -308
  78. package/dist/implementation/restrictions/plane/snap/GridRestriction.js.map +1 -1
  79. package/dist/implementation/restrictions/point/PointRestriction.d.ts +45 -45
  80. package/dist/implementation/restrictions/point/PointRestriction.js +166 -156
  81. package/dist/implementation/restrictions/point/PointRestriction.js.map +1 -1
  82. package/dist/index.d.ts +29 -29
  83. package/dist/index.js +37 -37
  84. package/dist/interfaces/IDragAnchor.d.ts +8 -8
  85. package/dist/interfaces/IDragAnchor.js +2 -2
  86. package/dist/interfaces/IRestriction.d.ts +117 -117
  87. package/dist/interfaces/IRestriction.d.ts.map +1 -1
  88. package/dist/interfaces/IRestriction.js +23 -23
  89. package/dist/interfaces/IRestriction.js.map +1 -1
  90. package/dist/interfaces/IRestrictionManager.d.ts +13 -13
  91. package/dist/interfaces/IRestrictionManager.js +2 -2
  92. package/dist/interfaces/ISnapRestriction.d.ts +81 -81
  93. package/dist/interfaces/ISnapRestriction.d.ts.map +1 -1
  94. package/dist/interfaces/ISnapRestriction.js +3 -3
  95. package/package.json +10 -10
@@ -1,13 +1,13 @@
1
- import { IRestrictionApi } from "./IRestrictionApi";
2
- export interface ISnapRestrictionApi extends IRestrictionApi {
3
- /**
4
- * If the enabling or disabling of the restriction is allowed to the end user.
5
- * If it is not editable, the default value for enabling or disabling the restriction is used.
6
- */
7
- readonly enabledEditable: boolean;
8
- /**
9
- * The priority of the restriction.
10
- */
11
- priority: number;
12
- }
1
+ import { IRestrictionApi } from "./IRestrictionApi";
2
+ export interface ISnapRestrictionApi extends IRestrictionApi {
3
+ /**
4
+ * If the enabling or disabling of the restriction is allowed to the end user.
5
+ * If it is not editable, the default value for enabling or disabling the restriction is used.
6
+ */
7
+ readonly enabledEditable: boolean;
8
+ /**
9
+ * The priority of the restriction.
10
+ */
11
+ priority: number;
12
+ }
13
13
  //# sourceMappingURL=ISnapRestrictionApi.d.ts.map
@@ -1,3 +1,3 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  //# sourceMappingURL=ISnapRestrictionApi.js.map
@@ -1,26 +1,26 @@
1
- import { IViewportApi } from "@shapediver/viewer";
2
- import { IDomEventListener } from "@shapediver/viewer.shared.services";
3
- import { IRay } from "@shapediver/viewer.shared.types";
4
- declare type Callbacks = {
5
- onDown: (event: PointerEvent, ray: IRay) => void;
6
- onMove: (event: PointerEvent, ray: IRay) => void;
7
- onUp: (event: PointerEvent, ray: IRay) => void;
8
- onOut: (event: PointerEvent, ray: IRay) => void;
9
- onKeyDown: (event: KeyboardEvent, pointerInCanvas: boolean) => void;
10
- onKeyUp: (event: KeyboardEvent, pointerInCanvas: boolean) => void;
11
- };
12
- export declare class EventManager implements IDomEventListener {
13
- #private;
14
- constructor(viewport: IViewportApi, callbacks: Callbacks);
15
- close(): void;
16
- onKeyDown(event: KeyboardEvent, pointerInCanvas: boolean): void;
17
- onKeyUp(event: KeyboardEvent, pointerInCanvas: boolean): void;
18
- onMouseWheel(): void;
19
- onPointerDown(event: PointerEvent): void;
20
- onPointerEnd(): void;
21
- onPointerMove(event: PointerEvent): void;
22
- onPointerOut(event: PointerEvent): void;
23
- onPointerUp(event: PointerEvent): void;
24
- }
25
- export {};
1
+ import { IViewportApi } from "@shapediver/viewer";
2
+ import { IDomEventListener } from "@shapediver/viewer.shared.services";
3
+ import { IRay } from "@shapediver/viewer.shared.types";
4
+ type Callbacks = {
5
+ onDown: (event: PointerEvent, ray: IRay) => void;
6
+ onMove: (event: PointerEvent, ray: IRay) => void;
7
+ onUp: (event: PointerEvent, ray: IRay) => void;
8
+ onOut: (event: PointerEvent, ray: IRay) => void;
9
+ onKeyDown: (event: KeyboardEvent, pointerInCanvas: boolean) => void;
10
+ onKeyUp: (event: KeyboardEvent, pointerInCanvas: boolean) => void;
11
+ };
12
+ export declare class EventManager implements IDomEventListener {
13
+ #private;
14
+ constructor(viewport: IViewportApi, callbacks: Callbacks);
15
+ close(): void;
16
+ onKeyDown(event: KeyboardEvent, pointerInCanvas: boolean): void;
17
+ onKeyUp(event: KeyboardEvent, pointerInCanvas: boolean): void;
18
+ onMouseWheel(): void;
19
+ onPointerDown(event: PointerEvent): void;
20
+ onPointerEnd(): void;
21
+ onPointerMove(event: PointerEvent): void;
22
+ onPointerOut(event: PointerEvent): void;
23
+ onPointerUp(event: PointerEvent): void;
24
+ }
25
+ export {};
26
26
  //# sourceMappingURL=EventManager.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"EventManager.d.ts","sourceRoot":"","sources":["../../src/implementation/EventManager.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,YAAY,EAAC,MAAM,oBAAoB,CAAC;AAChD,OAAO,EAAC,iBAAiB,EAAC,MAAM,oCAAoC,CAAC;AACrE,OAAO,EAAC,IAAI,EAAC,MAAM,iCAAiC,CAAC;AAIrD,aAAK,SAAS,GAAG;IAChB,MAAM,EAAE,CAAC,KAAK,EAAE,YAAY,EAAE,GAAG,EAAE,IAAI,KAAK,IAAI,CAAC;IACjD,MAAM,EAAE,CAAC,KAAK,EAAE,YAAY,EAAE,GAAG,EAAE,IAAI,KAAK,IAAI,CAAC;IACjD,IAAI,EAAE,CAAC,KAAK,EAAE,YAAY,EAAE,GAAG,EAAE,IAAI,KAAK,IAAI,CAAC;IAC/C,KAAK,EAAE,CAAC,KAAK,EAAE,YAAY,EAAE,GAAG,EAAE,IAAI,KAAK,IAAI,CAAC;IAChD,SAAS,EAAE,CAAC,KAAK,EAAE,aAAa,EAAE,eAAe,EAAE,OAAO,KAAK,IAAI,CAAC;IACpE,OAAO,EAAE,CAAC,KAAK,EAAE,aAAa,EAAE,eAAe,EAAE,OAAO,KAAK,IAAI,CAAC;CAClE,CAAC;AAMF,qBAAa,YAAa,YAAW,iBAAiB;;gBAWzC,QAAQ,EAAE,YAAY,EAAE,SAAS,EAAE,SAAS;IAWjD,KAAK,IAAI,IAAI;IAMb,SAAS,CAAC,KAAK,EAAE,aAAa,EAAE,eAAe,EAAE,OAAO,GAAG,IAAI;IAI/D,OAAO,CAAC,KAAK,EAAE,aAAa,EAAE,eAAe,EAAE,OAAO,GAAG,IAAI;IAI7D,YAAY,IAAI,IAAI;IAEpB,aAAa,CAAC,KAAK,EAAE,YAAY,GAAG,IA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,IAAI,IAAI;IAEpB,aAAa,CAAC,KAAK,EAAE,YAAY,GAAG,IAAI;IAKxC,YAAY,IAAI,IAAI;IAEpB,aAAa,CAAC,KAAK,EAAE,YAAY,GAAG,IAAI;IAKxC,YAAY,CAAC,KAAK,EAAE,YAAY,GAAG,IAAI;IAKvC,WAAW,CAAC,KAAK,EAAE,YAAY,GAAG,IAAI;CAM7C"}
@@ -1,63 +1,63 @@
1
- "use strict";
2
- var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
3
- if (kind === "m") throw new TypeError("Private method is not writable");
4
- if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
5
- 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");
6
- return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
7
- };
8
- var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
9
- if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
10
- 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");
11
- return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
12
- };
13
- var _EventManager_callbacks, _EventManager_canvasEventListenerToken, _EventManager_viewport;
14
- Object.defineProperty(exports, "__esModule", { value: true });
15
- exports.EventManager = void 0;
16
- // #endregion Type aliases (1)
17
- // #region Classes (1)
18
- class EventManager {
19
- // #endregion Properties (3)
20
- // #region Constructors (1)
21
- constructor(viewport, callbacks) {
22
- // #region Properties (3)
23
- _EventManager_callbacks.set(this, void 0);
24
- _EventManager_canvasEventListenerToken.set(this, void 0);
25
- _EventManager_viewport.set(this, void 0);
26
- __classPrivateFieldSet(this, _EventManager_viewport, viewport, "f");
27
- __classPrivateFieldSet(this, _EventManager_callbacks, callbacks, "f");
28
- __classPrivateFieldSet(this, _EventManager_canvasEventListenerToken, __classPrivateFieldGet(this, _EventManager_viewport, "f").addCanvasEventListener(this), "f");
29
- }
30
- // #endregion Constructors (1)
31
- // #region Public Methods (9)
32
- close() {
33
- __classPrivateFieldGet(this, _EventManager_viewport, "f").removeCanvasEventListener(__classPrivateFieldGet(this, _EventManager_canvasEventListenerToken, "f"));
34
- }
35
- onKeyDown(event, pointerInCanvas) {
36
- __classPrivateFieldGet(this, _EventManager_callbacks, "f").onKeyDown(event, pointerInCanvas);
37
- }
38
- onKeyUp(event, pointerInCanvas) {
39
- __classPrivateFieldGet(this, _EventManager_callbacks, "f").onKeyUp(event, pointerInCanvas);
40
- }
41
- onMouseWheel() { }
42
- onPointerDown(event) {
43
- const ray = __classPrivateFieldGet(this, _EventManager_viewport, "f").pointerEventToRay(event);
44
- __classPrivateFieldGet(this, _EventManager_callbacks, "f").onDown(event, ray);
45
- }
46
- onPointerEnd() { }
47
- onPointerMove(event) {
48
- const ray = __classPrivateFieldGet(this, _EventManager_viewport, "f").pointerEventToRay(event);
49
- __classPrivateFieldGet(this, _EventManager_callbacks, "f").onMove(event, ray);
50
- }
51
- onPointerOut(event) {
52
- const ray = __classPrivateFieldGet(this, _EventManager_viewport, "f").pointerEventToRay(event);
53
- __classPrivateFieldGet(this, _EventManager_callbacks, "f").onOut(event, ray);
54
- }
55
- onPointerUp(event) {
56
- const ray = __classPrivateFieldGet(this, _EventManager_viewport, "f").pointerEventToRay(event);
57
- __classPrivateFieldGet(this, _EventManager_callbacks, "f").onUp(event, ray);
58
- }
59
- }
60
- exports.EventManager = EventManager;
61
- _EventManager_callbacks = new WeakMap(), _EventManager_canvasEventListenerToken = new WeakMap(), _EventManager_viewport = new WeakMap();
62
- // #endregion Classes (1)
1
+ "use strict";
2
+ var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
3
+ if (kind === "m") throw new TypeError("Private method is not writable");
4
+ if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
5
+ 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");
6
+ return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
7
+ };
8
+ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
9
+ if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
10
+ 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");
11
+ return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
12
+ };
13
+ var _EventManager_callbacks, _EventManager_canvasEventListenerToken, _EventManager_viewport;
14
+ Object.defineProperty(exports, "__esModule", { value: true });
15
+ exports.EventManager = void 0;
16
+ // #endregion Type aliases (1)
17
+ // #region Classes (1)
18
+ class EventManager {
19
+ // #endregion Properties (3)
20
+ // #region Constructors (1)
21
+ constructor(viewport, callbacks) {
22
+ // #region Properties (3)
23
+ _EventManager_callbacks.set(this, void 0);
24
+ _EventManager_canvasEventListenerToken.set(this, void 0);
25
+ _EventManager_viewport.set(this, void 0);
26
+ __classPrivateFieldSet(this, _EventManager_viewport, viewport, "f");
27
+ __classPrivateFieldSet(this, _EventManager_callbacks, callbacks, "f");
28
+ __classPrivateFieldSet(this, _EventManager_canvasEventListenerToken, __classPrivateFieldGet(this, _EventManager_viewport, "f").addCanvasEventListener(this), "f");
29
+ }
30
+ // #endregion Constructors (1)
31
+ // #region Public Methods (9)
32
+ close() {
33
+ __classPrivateFieldGet(this, _EventManager_viewport, "f").removeCanvasEventListener(__classPrivateFieldGet(this, _EventManager_canvasEventListenerToken, "f"));
34
+ }
35
+ onKeyDown(event, pointerInCanvas) {
36
+ __classPrivateFieldGet(this, _EventManager_callbacks, "f").onKeyDown(event, pointerInCanvas);
37
+ }
38
+ onKeyUp(event, pointerInCanvas) {
39
+ __classPrivateFieldGet(this, _EventManager_callbacks, "f").onKeyUp(event, pointerInCanvas);
40
+ }
41
+ onMouseWheel() { }
42
+ onPointerDown(event) {
43
+ const ray = __classPrivateFieldGet(this, _EventManager_viewport, "f").pointerEventToRay(event);
44
+ __classPrivateFieldGet(this, _EventManager_callbacks, "f").onDown(event, ray);
45
+ }
46
+ onPointerEnd() { }
47
+ onPointerMove(event) {
48
+ const ray = __classPrivateFieldGet(this, _EventManager_viewport, "f").pointerEventToRay(event);
49
+ __classPrivateFieldGet(this, _EventManager_callbacks, "f").onMove(event, ray);
50
+ }
51
+ onPointerOut(event) {
52
+ const ray = __classPrivateFieldGet(this, _EventManager_viewport, "f").pointerEventToRay(event);
53
+ __classPrivateFieldGet(this, _EventManager_callbacks, "f").onOut(event, ray);
54
+ }
55
+ onPointerUp(event) {
56
+ const ray = __classPrivateFieldGet(this, _EventManager_viewport, "f").pointerEventToRay(event);
57
+ __classPrivateFieldGet(this, _EventManager_callbacks, "f").onUp(event, ray);
58
+ }
59
+ }
60
+ exports.EventManager = EventManager;
61
+ _EventManager_callbacks = new WeakMap(), _EventManager_canvasEventListenerToken = new WeakMap(), _EventManager_viewport = new WeakMap();
62
+ // #endregion Classes (1)
63
63
  //# sourceMappingURL=EventManager.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"EventManager.js","sourceRoot":"","sources":["../../src/implementation/EventManager.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAeA,8BAA8B;AAE9B,sBAAsB;AAEtB,MAAa,YAAY;IAOxB,4BAA4B;IAE5B,2BAA2B;IAE3B,YAAY,QAAsB,EAAE,SAAoB;QAVxD,yBAAyB;QAEzB,0CAA+B;QAC/B,yDAA2C;QAC3C,yCAAiC;QAOhC,uBAAA,IAAI,0BAAa,QAAQ,MAAA,CAAC;QAC1B,uBAAA,IAAI,2BAAc,SAAS,MAAA,CAAC;QAC5B,uBAAA,IAAI,0CACH,uBAAA,IAAI,8BAAU,CAAC,sBAAsB,CAAC,IAAI,CAAC,MAAA,CAAC;IAC9C,CAAC;IAED,8BAA8B;IAE9B,6BAA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,MAAM,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;IACpC,CAAC;IAEM,YAAY,CAAC,KAAmB;QACtC,MAAM,GAAG,GAAG,uBAAA,IAAI,8BAAU,CAAC,iBAAiB,CAAC,KAAK,CAAC,CAAC;QACpD,uBAAA,IAAI,+BAAW,CAAC,KAAK,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;IACnC,CAAC;IAEM,WAAW,CAAC,KAAmB;QACrC,MAAM,GAAG,GAAG,uBAAA,IAAI,8BAAU,CAAC,iBAAiB,CAAC,KAAK,CAAC,CAAC;QACpD,uBAAA,IAAI,+BAAW,CAAC,IAAI,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;IAClC,CAAC;CAGD;AA7DD,oCA6DC;;AAED,yBAAyB"}
@@ -1,88 +1,88 @@
1
- import { IViewportApi } from "@shapediver/viewer";
2
- import { IRay, IVisualizationSettings } from "@shapediver/viewer.shared.types";
3
- import { mat4, vec3 } from "gl-matrix";
4
- export declare class GeometryMathManager {
5
- #private;
6
- constructor(viewport: IViewportApi, settings: IVisualizationSettings);
7
- /**
8
- * Set the matrix that transforms local-space points to world space.
9
- * When set, screenSpaceDistanceCheck will transform points before projecting
10
- * via camera.project(), which expects world-space input.
11
- * Defaults to identity (local space = world space).
12
- */
13
- set localToWorldMatrix(m: mat4);
14
- /**
15
- * Check which distances of lines to ray
16
- *
17
- * @param ray
18
- * @returns
19
- */
20
- checkLineDistances(ray: IRay, positionArray: Float32Array, indicesArrayLines?: Uint8Array | null): {
21
- index: number[];
22
- distance: number;
23
- }[] | undefined;
24
- /**
25
- * Check which distances of points to ray
26
- *
27
- * @param ray
28
- * @returns
29
- */
30
- checkPointDistances(ray: IRay, positionArray: Float32Array): {
31
- index: number;
32
- distance: number;
33
- }[] | undefined;
34
- close(): void;
35
- /**
36
- * Calculate the closest point on a ray to a point
37
- *
38
- * @param ray
39
- * @param point
40
- * @returns
41
- */
42
- closestPoint(ray: IRay, point: vec3): vec3;
43
- /**
44
- * Calculate the closest point on a line to a point
45
- *
46
- * @param start
47
- * @param end
48
- * @param point
49
- */
50
- closestPointOnLine(start: vec3, end: vec3, point: vec3): vec3;
51
- /**
52
- * Calculate the closest point on a plane to a point
53
- *
54
- * @param point
55
- * @param planeNormal
56
- * @param planeOrigin
57
- * @returns
58
- */
59
- closestPointOnPlane(planeOrigin: vec3, planeNormal: vec3, point: vec3): vec3;
60
- /**
61
- * Calculate the distance between a ray and a line segment
62
- *
63
- * @param ray
64
- * @param lineStart
65
- * @param lineEnd
66
- * @returns
67
- */
68
- closestPointsRayLine(ray: IRay, lineStart: vec3, lineEnd: vec3): {
69
- closestPointOnRay: vec3;
70
- closestPointOnLine: vec3;
71
- };
72
- /**
73
- * Calculate the distance between two rays
74
- *
75
- * @param ray1
76
- * @param ray2
77
- * @returns
78
- */
79
- closestPointsRayRay(ray1: IRay, ray2: IRay): {
80
- closestPointOnRay1: vec3;
81
- closestPointOnRay2: vec3;
82
- };
83
- screenSpaceDistanceCheck(point1: vec3, point2: vec3, threshold: number): {
84
- distanceSquared: number;
85
- check: boolean;
86
- };
87
- }
1
+ import { IViewportApi } from "@shapediver/viewer";
2
+ import { IRay, IVisualizationSettings } from "@shapediver/viewer.shared.types";
3
+ import { mat4, vec3 } from "gl-matrix";
4
+ export declare class GeometryMathManager {
5
+ #private;
6
+ constructor(viewport: IViewportApi, settings: IVisualizationSettings);
7
+ /**
8
+ * Set the matrix that transforms local-space points to world space.
9
+ * When set, screenSpaceDistanceCheck will transform points before projecting
10
+ * via camera.project(), which expects world-space input.
11
+ * Defaults to identity (local space = world space).
12
+ */
13
+ set localToWorldMatrix(m: mat4);
14
+ /**
15
+ * Check which distances of lines to ray
16
+ *
17
+ * @param ray
18
+ * @returns
19
+ */
20
+ checkLineDistances(ray: IRay, positionArray: Float32Array, indicesArrayLines?: Uint8Array | null): {
21
+ index: number[];
22
+ distance: number;
23
+ }[] | undefined;
24
+ /**
25
+ * Check which distances of points to ray
26
+ *
27
+ * @param ray
28
+ * @returns
29
+ */
30
+ checkPointDistances(ray: IRay, positionArray: Float32Array): {
31
+ index: number;
32
+ distance: number;
33
+ }[] | undefined;
34
+ close(): void;
35
+ /**
36
+ * Calculate the closest point on a ray to a point
37
+ *
38
+ * @param ray
39
+ * @param point
40
+ * @returns
41
+ */
42
+ closestPoint(ray: IRay, point: vec3): vec3;
43
+ /**
44
+ * Calculate the closest point on a line to a point
45
+ *
46
+ * @param start
47
+ * @param end
48
+ * @param point
49
+ */
50
+ closestPointOnLine(start: vec3, end: vec3, point: vec3): vec3;
51
+ /**
52
+ * Calculate the closest point on a plane to a point
53
+ *
54
+ * @param point
55
+ * @param planeNormal
56
+ * @param planeOrigin
57
+ * @returns
58
+ */
59
+ closestPointOnPlane(planeOrigin: vec3, planeNormal: vec3, point: vec3): vec3;
60
+ /**
61
+ * Calculate the distance between a ray and a line segment
62
+ *
63
+ * @param ray
64
+ * @param lineStart
65
+ * @param lineEnd
66
+ * @returns
67
+ */
68
+ closestPointsRayLine(ray: IRay, lineStart: vec3, lineEnd: vec3): {
69
+ closestPointOnRay: vec3;
70
+ closestPointOnLine: vec3;
71
+ };
72
+ /**
73
+ * Calculate the distance between two rays
74
+ *
75
+ * @param ray1
76
+ * @param ray2
77
+ * @returns
78
+ */
79
+ closestPointsRayRay(ray1: IRay, ray2: IRay): {
80
+ closestPointOnRay1: vec3;
81
+ closestPointOnRay2: vec3;
82
+ };
83
+ screenSpaceDistanceCheck(point1: vec3, point2: vec3, threshold: number): {
84
+ distanceSquared: number;
85
+ check: boolean;
86
+ };
87
+ }
88
88
  //# sourceMappingURL=GeometryMathManager.d.ts.map