@shapediver/viewer.viewport 3.0.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 (134) hide show
  1. package/LICENSE +73 -0
  2. package/README.md +1 -0
  3. package/dist/implementation/PostProcessingApi.d.ts +49 -0
  4. package/dist/implementation/PostProcessingApi.d.ts.map +1 -0
  5. package/dist/implementation/PostProcessingApi.js +142 -0
  6. package/dist/implementation/PostProcessingApi.js.map +1 -0
  7. package/dist/implementation/ViewportApi.d.ts +200 -0
  8. package/dist/implementation/ViewportApi.d.ts.map +1 -0
  9. package/dist/implementation/ViewportApi.js +879 -0
  10. package/dist/implementation/ViewportApi.js.map +1 -0
  11. package/dist/implementation/camera/AbstractCameraApi.d.ts +138 -0
  12. package/dist/implementation/camera/AbstractCameraApi.d.ts.map +1 -0
  13. package/dist/implementation/camera/AbstractCameraApi.js +473 -0
  14. package/dist/implementation/camera/AbstractCameraApi.js.map +1 -0
  15. package/dist/implementation/camera/OrthographicCameraApi.d.ts +11 -0
  16. package/dist/implementation/camera/OrthographicCameraApi.d.ts.map +1 -0
  17. package/dist/implementation/camera/OrthographicCameraApi.js +48 -0
  18. package/dist/implementation/camera/OrthographicCameraApi.js.map +1 -0
  19. package/dist/implementation/camera/PerspectiveCameraApi.d.ts +11 -0
  20. package/dist/implementation/camera/PerspectiveCameraApi.d.ts.map +1 -0
  21. package/dist/implementation/camera/PerspectiveCameraApi.js +47 -0
  22. package/dist/implementation/camera/PerspectiveCameraApi.js.map +1 -0
  23. package/dist/implementation/lights/AbstractLightApi.d.ts +20 -0
  24. package/dist/implementation/lights/AbstractLightApi.d.ts.map +1 -0
  25. package/dist/implementation/lights/AbstractLightApi.js +81 -0
  26. package/dist/implementation/lights/AbstractLightApi.js.map +1 -0
  27. package/dist/implementation/lights/LightSceneApi.d.ts +69 -0
  28. package/dist/implementation/lights/LightSceneApi.d.ts.map +1 -0
  29. package/dist/implementation/lights/LightSceneApi.js +172 -0
  30. package/dist/implementation/lights/LightSceneApi.js.map +1 -0
  31. package/dist/implementation/lights/types/AmbientLightApi.d.ts +9 -0
  32. package/dist/implementation/lights/types/AmbientLightApi.d.ts.map +1 -0
  33. package/dist/implementation/lights/types/AmbientLightApi.js +27 -0
  34. package/dist/implementation/lights/types/AmbientLightApi.js.map +1 -0
  35. package/dist/implementation/lights/types/DirectionalLightApi.d.ts +18 -0
  36. package/dist/implementation/lights/types/DirectionalLightApi.d.ts.map +1 -0
  37. package/dist/implementation/lights/types/DirectionalLightApi.js +77 -0
  38. package/dist/implementation/lights/types/DirectionalLightApi.js.map +1 -0
  39. package/dist/implementation/lights/types/HemisphereLightApi.d.ts +12 -0
  40. package/dist/implementation/lights/types/HemisphereLightApi.d.ts.map +1 -0
  41. package/dist/implementation/lights/types/HemisphereLightApi.js +47 -0
  42. package/dist/implementation/lights/types/HemisphereLightApi.js.map +1 -0
  43. package/dist/implementation/lights/types/PointLightApi.d.ts +16 -0
  44. package/dist/implementation/lights/types/PointLightApi.d.ts.map +1 -0
  45. package/dist/implementation/lights/types/PointLightApi.js +67 -0
  46. package/dist/implementation/lights/types/PointLightApi.js.map +1 -0
  47. package/dist/implementation/lights/types/SpotLightApi.d.ts +22 -0
  48. package/dist/implementation/lights/types/SpotLightApi.d.ts.map +1 -0
  49. package/dist/implementation/lights/types/SpotLightApi.js +97 -0
  50. package/dist/implementation/lights/types/SpotLightApi.js.map +1 -0
  51. package/dist/index.d.ts +53 -0
  52. package/dist/index.d.ts.map +1 -0
  53. package/dist/index.js +160 -0
  54. package/dist/index.js.map +1 -0
  55. package/dist/interfaces/IPostProcessingApi.d.ts +229 -0
  56. package/dist/interfaces/IPostProcessingApi.d.ts.map +1 -0
  57. package/dist/interfaces/IPostProcessingApi.js +3 -0
  58. package/dist/interfaces/IPostProcessingApi.js.map +1 -0
  59. package/dist/interfaces/IViewportApi.d.ts +632 -0
  60. package/dist/interfaces/IViewportApi.d.ts.map +1 -0
  61. package/dist/interfaces/IViewportApi.js +3 -0
  62. package/dist/interfaces/IViewportApi.js.map +1 -0
  63. package/dist/interfaces/camera/ICameraApi.d.ts +249 -0
  64. package/dist/interfaces/camera/ICameraApi.d.ts.map +1 -0
  65. package/dist/interfaces/camera/ICameraApi.js +3 -0
  66. package/dist/interfaces/camera/ICameraApi.js.map +1 -0
  67. package/dist/interfaces/camera/IOrthographicCameraApi.d.ts +14 -0
  68. package/dist/interfaces/camera/IOrthographicCameraApi.d.ts.map +1 -0
  69. package/dist/interfaces/camera/IOrthographicCameraApi.js +3 -0
  70. package/dist/interfaces/camera/IOrthographicCameraApi.js.map +1 -0
  71. package/dist/interfaces/camera/IPerspectiveCameraApi.d.ts +13 -0
  72. package/dist/interfaces/camera/IPerspectiveCameraApi.d.ts.map +1 -0
  73. package/dist/interfaces/camera/IPerspectiveCameraApi.js +3 -0
  74. package/dist/interfaces/camera/IPerspectiveCameraApi.js.map +1 -0
  75. package/dist/interfaces/lights/ILightApi.d.ts +36 -0
  76. package/dist/interfaces/lights/ILightApi.d.ts.map +1 -0
  77. package/dist/interfaces/lights/ILightApi.js +3 -0
  78. package/dist/interfaces/lights/ILightApi.js.map +1 -0
  79. package/dist/interfaces/lights/ILightSceneApi.d.ts +139 -0
  80. package/dist/interfaces/lights/ILightSceneApi.d.ts.map +1 -0
  81. package/dist/interfaces/lights/ILightSceneApi.js +3 -0
  82. package/dist/interfaces/lights/ILightSceneApi.js.map +1 -0
  83. package/dist/interfaces/lights/types/IAmbientLightApi.d.ts +7 -0
  84. package/dist/interfaces/lights/types/IAmbientLightApi.d.ts.map +1 -0
  85. package/dist/interfaces/lights/types/IAmbientLightApi.js +3 -0
  86. package/dist/interfaces/lights/types/IAmbientLightApi.js.map +1 -0
  87. package/dist/interfaces/lights/types/IDirectionalLightApi.d.ts +25 -0
  88. package/dist/interfaces/lights/types/IDirectionalLightApi.d.ts.map +1 -0
  89. package/dist/interfaces/lights/types/IDirectionalLightApi.js +3 -0
  90. package/dist/interfaces/lights/types/IDirectionalLightApi.js.map +1 -0
  91. package/dist/interfaces/lights/types/IHemisphereLightApi.d.ts +13 -0
  92. package/dist/interfaces/lights/types/IHemisphereLightApi.d.ts.map +1 -0
  93. package/dist/interfaces/lights/types/IHemisphereLightApi.js +3 -0
  94. package/dist/interfaces/lights/types/IHemisphereLightApi.js.map +1 -0
  95. package/dist/interfaces/lights/types/IPointLightApi.d.ts +21 -0
  96. package/dist/interfaces/lights/types/IPointLightApi.d.ts.map +1 -0
  97. package/dist/interfaces/lights/types/IPointLightApi.js +3 -0
  98. package/dist/interfaces/lights/types/IPointLightApi.js.map +1 -0
  99. package/dist/interfaces/lights/types/ISpotLightApi.d.ts +33 -0
  100. package/dist/interfaces/lights/types/ISpotLightApi.d.ts.map +1 -0
  101. package/dist/interfaces/lights/types/ISpotLightApi.js +3 -0
  102. package/dist/interfaces/lights/types/ISpotLightApi.js.map +1 -0
  103. package/dist/main.d.ts +29 -0
  104. package/dist/main.d.ts.map +1 -0
  105. package/dist/main.js +80 -0
  106. package/dist/main.js.map +1 -0
  107. package/package.json +78 -0
  108. package/src/implementation/PostProcessingApi.ts +184 -0
  109. package/src/implementation/ViewportApi.ts +1060 -0
  110. package/src/implementation/camera/AbstractCameraApi.ts +556 -0
  111. package/src/implementation/camera/OrthographicCameraApi.ts +43 -0
  112. package/src/implementation/camera/PerspectiveCameraApi.ts +43 -0
  113. package/src/implementation/lights/AbstractLightApi.ts +87 -0
  114. package/src/implementation/lights/LightSceneApi.ts +198 -0
  115. package/src/implementation/lights/types/AmbientLightApi.ts +24 -0
  116. package/src/implementation/lights/types/DirectionalLightApi.ts +80 -0
  117. package/src/implementation/lights/types/HemisphereLightApi.ts +44 -0
  118. package/src/implementation/lights/types/PointLightApi.ts +68 -0
  119. package/src/implementation/lights/types/SpotLightApi.ts +104 -0
  120. package/src/index.ts +297 -0
  121. package/src/interfaces/IPostProcessingApi.ts +269 -0
  122. package/src/interfaces/IViewportApi.ts +629 -0
  123. package/src/interfaces/camera/ICameraApi.ts +233 -0
  124. package/src/interfaces/camera/IOrthographicCameraApi.ts +18 -0
  125. package/src/interfaces/camera/IPerspectiveCameraApi.ts +17 -0
  126. package/src/interfaces/lights/ILightApi.ts +41 -0
  127. package/src/interfaces/lights/ILightSceneApi.ts +147 -0
  128. package/src/interfaces/lights/types/IAmbientLightApi.ts +7 -0
  129. package/src/interfaces/lights/types/IDirectionalLightApi.ts +29 -0
  130. package/src/interfaces/lights/types/IHemisphereLightApi.ts +17 -0
  131. package/src/interfaces/lights/types/IPointLightApi.ts +25 -0
  132. package/src/interfaces/lights/types/ISpotLightApi.ts +37 -0
  133. package/src/main.ts +85 -0
  134. package/tsconfig.json +17 -0
@@ -0,0 +1,47 @@
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 _PerspectiveCameraApi_camera, _PerspectiveCameraApi_inputValidator, _PerspectiveCameraApi_logger, _PerspectiveCameraApi_viewportApi;
14
+ Object.defineProperty(exports, "__esModule", { value: true });
15
+ exports.PerspectiveCameraApi = void 0;
16
+ const AbstractCameraApi_1 = require("./AbstractCameraApi");
17
+ const viewer_shared_services_1 = require("@shapediver/viewer.shared.services");
18
+ class PerspectiveCameraApi extends AbstractCameraApi_1.AbstractCameraApi {
19
+ // #endregion Properties (4)
20
+ // #region Constructors (1)
21
+ constructor(viewportApi, camera) {
22
+ super(viewportApi, camera);
23
+ // #region Properties (4)
24
+ _PerspectiveCameraApi_camera.set(this, void 0);
25
+ _PerspectiveCameraApi_inputValidator.set(this, viewer_shared_services_1.InputValidator.instance);
26
+ _PerspectiveCameraApi_logger.set(this, viewer_shared_services_1.Logger.instance);
27
+ _PerspectiveCameraApi_viewportApi.set(this, void 0);
28
+ __classPrivateFieldSet(this, _PerspectiveCameraApi_viewportApi, viewportApi, "f");
29
+ __classPrivateFieldSet(this, _PerspectiveCameraApi_camera, camera, "f");
30
+ this.scope = 'PerspectiveCameraApi';
31
+ }
32
+ // #endregion Constructors (1)
33
+ // #region Public Getters And Setters (2)
34
+ get fov() {
35
+ return __classPrivateFieldGet(this, _PerspectiveCameraApi_camera, "f").fov;
36
+ }
37
+ set fov(value) {
38
+ const scope = 'fov';
39
+ __classPrivateFieldGet(this, _PerspectiveCameraApi_inputValidator, "f").validateAndError(`${this.scope}.${scope}`, value, 'number');
40
+ __classPrivateFieldGet(this, _PerspectiveCameraApi_camera, "f").fov = value;
41
+ __classPrivateFieldGet(this, _PerspectiveCameraApi_logger, "f").debug(`${this.scope}.${scope}: ${scope} was set to: ${value}`);
42
+ __classPrivateFieldGet(this, _PerspectiveCameraApi_viewportApi, "f").update();
43
+ }
44
+ }
45
+ exports.PerspectiveCameraApi = PerspectiveCameraApi;
46
+ _PerspectiveCameraApi_camera = new WeakMap(), _PerspectiveCameraApi_inputValidator = new WeakMap(), _PerspectiveCameraApi_logger = new WeakMap(), _PerspectiveCameraApi_viewportApi = new WeakMap();
47
+ //# sourceMappingURL=PerspectiveCameraApi.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PerspectiveCameraApi.js","sourceRoot":"","sources":["../../../src/implementation/camera/PerspectiveCameraApi.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2DAAwD;AACxD,+EAA4E;AAK5E,MAAa,oBAAqB,SAAQ,qCAAiB;IAQvD,4BAA4B;IAE5B,2BAA2B;IAE3B,YAAY,WAAyB,EAAE,MAA0B;QAC7D,KAAK,CAAC,WAAW,EAAE,MAAM,CAAC,CAAC;QAZ/B,yBAAyB;QAEzB,+CAAqC;QACrC,+CAA2C,uCAAc,CAAC,QAAQ,EAAC;QACnE,uCAA2B,+BAAM,CAAC,QAAQ,EAAC;QAC3C,oDAAoC;QAQhC,uBAAA,IAAI,qCAAgB,WAAW,MAAA,CAAC;QAChC,uBAAA,IAAI,gCAAW,MAAM,MAAA,CAAC;QACtB,IAAI,CAAC,KAAK,GAAG,sBAAsB,CAAC;IACxC,CAAC;IAED,8BAA8B;IAE9B,yCAAyC;IAEzC,IAAW,GAAG;QACV,OAAO,uBAAA,IAAI,oCAAQ,CAAC,GAAG,CAAC;IAC5B,CAAC;IAED,IAAW,GAAG,CAAC,KAAa;QACxB,MAAM,KAAK,GAAG,KAAK,CAAC;QACpB,uBAAA,IAAI,4CAAgB,CAAC,gBAAgB,CAAC,GAAG,IAAI,CAAC,KAAK,IAAI,KAAK,EAAE,EAAE,KAAK,EAAE,QAAQ,CAAC,CAAC;QACjF,uBAAA,IAAI,oCAAQ,CAAC,GAAG,GAAG,KAAK,CAAC;QACzB,uBAAA,IAAI,oCAAQ,CAAC,KAAK,CAAC,GAAG,IAAI,CAAC,KAAK,IAAI,KAAK,KAAK,KAAK,gBAAgB,KAAK,EAAE,CAAC,CAAC;QAC5E,uBAAA,IAAI,yCAAa,CAAC,MAAM,EAAE,CAAC;IAC/B,CAAC;CAGJ;AApCD,oDAoCC"}
@@ -0,0 +1,20 @@
1
+ import { Color } from '@shapediver/viewer.shared.types';
2
+ import { ILight, LIGHT_TYPE } from '@shapediver/viewer.rendering-engine.light-engine';
3
+ import { ILightApi } from '../../interfaces/lights/ILightApi';
4
+ import { IViewportApi } from '../../interfaces/IViewportApi';
5
+ export declare abstract class AbstractLightApi implements ILightApi {
6
+ #private;
7
+ protected scope: string;
8
+ constructor(viewportApi: IViewportApi, light: ILight);
9
+ get color(): Color;
10
+ set color(value: Color);
11
+ get id(): string;
12
+ get intensity(): number;
13
+ set intensity(value: number);
14
+ get name(): string | undefined;
15
+ set name(value: string | undefined);
16
+ get order(): number | undefined;
17
+ set order(value: number | undefined);
18
+ get type(): LIGHT_TYPE;
19
+ }
20
+ //# sourceMappingURL=AbstractLightApi.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AbstractLightApi.d.ts","sourceRoot":"","sources":["../../../src/implementation/lights/AbstractLightApi.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,iCAAiC,CAAC;AACxD,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,kDAAkD,CAAC;AACtF,OAAO,EAAE,SAAS,EAAE,MAAM,mCAAmC,CAAC;AAE9D,OAAO,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAE7D,8BAAsB,gBAAiB,YAAW,SAAS;;IAQvD,SAAS,CAAC,KAAK,EAAE,MAAM,CAAsB;gBAMjC,WAAW,EAAE,YAAY,EAAE,KAAK,EAAE,MAAM;IASpD,IAAW,KAAK,IAAI,KAAK,CAExB;IAED,IAAW,KAAK,CAAC,KAAK,EAAE,KAAK,EAM5B;IAED,IAAW,EAAE,IAAI,MAAM,CAEtB;IAED,IAAW,SAAS,IAAI,MAAM,CAE7B;IAED,IAAW,SAAS,CAAC,KAAK,EAAE,MAAM,EAMjC;IAED,IAAW,IAAI,IAAI,MAAM,GAAG,SAAS,CAEpC;IAED,IAAW,IAAI,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,EAMxC;IAED,IAAW,KAAK,IAAI,MAAM,GAAG,SAAS,CAErC;IAED,IAAW,KAAK,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,EAMzC;IAED,IAAW,IAAI,IAAI,UAAU,CAE5B;CAGJ"}
@@ -0,0 +1,81 @@
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 _AbstractLightApi_inputValidator, _AbstractLightApi_light, _AbstractLightApi_logger, _AbstractLightApi_viewportApi;
14
+ Object.defineProperty(exports, "__esModule", { value: true });
15
+ exports.AbstractLightApi = void 0;
16
+ const viewer_shared_services_1 = require("@shapediver/viewer.shared.services");
17
+ class AbstractLightApi {
18
+ // #endregion Properties (5)
19
+ // #region Constructors (1)
20
+ constructor(viewportApi, light) {
21
+ // #region Properties (5)
22
+ _AbstractLightApi_inputValidator.set(this, viewer_shared_services_1.InputValidator.instance);
23
+ _AbstractLightApi_light.set(this, void 0);
24
+ _AbstractLightApi_logger.set(this, viewer_shared_services_1.Logger.instance);
25
+ _AbstractLightApi_viewportApi.set(this, void 0);
26
+ this.scope = 'AbstractLightApi';
27
+ __classPrivateFieldSet(this, _AbstractLightApi_viewportApi, viewportApi, "f");
28
+ __classPrivateFieldSet(this, _AbstractLightApi_light, light, "f");
29
+ }
30
+ // #endregion Constructors (1)
31
+ // #region Public Getters And Setters (10)
32
+ get color() {
33
+ return __classPrivateFieldGet(this, _AbstractLightApi_light, "f").color;
34
+ }
35
+ set color(value) {
36
+ const scope = 'color';
37
+ __classPrivateFieldGet(this, _AbstractLightApi_inputValidator, "f").validateAndError(`${this.scope}.${scope}`, value, 'color');
38
+ __classPrivateFieldGet(this, _AbstractLightApi_light, "f").color = value;
39
+ __classPrivateFieldGet(this, _AbstractLightApi_logger, "f").debug(`${this.scope}.${scope}: ${scope} was set to: ${value}`);
40
+ __classPrivateFieldGet(this, _AbstractLightApi_viewportApi, "f").update();
41
+ }
42
+ get id() {
43
+ return __classPrivateFieldGet(this, _AbstractLightApi_light, "f").id;
44
+ }
45
+ get intensity() {
46
+ return __classPrivateFieldGet(this, _AbstractLightApi_light, "f").intensity;
47
+ }
48
+ set intensity(value) {
49
+ const scope = 'intensity';
50
+ __classPrivateFieldGet(this, _AbstractLightApi_inputValidator, "f").validateAndError(`${this.scope}.${scope}`, value, 'number');
51
+ __classPrivateFieldGet(this, _AbstractLightApi_light, "f").intensity = value;
52
+ __classPrivateFieldGet(this, _AbstractLightApi_logger, "f").debug(`${this.scope}.${scope}: ${scope} was set to: ${value}`);
53
+ __classPrivateFieldGet(this, _AbstractLightApi_viewportApi, "f").update();
54
+ }
55
+ get name() {
56
+ return __classPrivateFieldGet(this, _AbstractLightApi_light, "f").name;
57
+ }
58
+ set name(value) {
59
+ const scope = 'name';
60
+ __classPrivateFieldGet(this, _AbstractLightApi_inputValidator, "f").validateAndError(`${this.scope}.${scope}`, value, 'string', false);
61
+ __classPrivateFieldGet(this, _AbstractLightApi_light, "f").name = value;
62
+ __classPrivateFieldGet(this, _AbstractLightApi_logger, "f").debug(`${this.scope}.${scope}: ${scope} was set to: ${value}`);
63
+ __classPrivateFieldGet(this, _AbstractLightApi_viewportApi, "f").update();
64
+ }
65
+ get order() {
66
+ return __classPrivateFieldGet(this, _AbstractLightApi_light, "f").order;
67
+ }
68
+ set order(value) {
69
+ const scope = 'order';
70
+ __classPrivateFieldGet(this, _AbstractLightApi_inputValidator, "f").validateAndError(`${this.scope}.${scope}`, value, 'number', false);
71
+ __classPrivateFieldGet(this, _AbstractLightApi_light, "f").order = value;
72
+ __classPrivateFieldGet(this, _AbstractLightApi_logger, "f").debug(`${this.scope}.${scope}: ${scope} was set to: ${value}`);
73
+ __classPrivateFieldGet(this, _AbstractLightApi_viewportApi, "f").update();
74
+ }
75
+ get type() {
76
+ return __classPrivateFieldGet(this, _AbstractLightApi_light, "f").type;
77
+ }
78
+ }
79
+ exports.AbstractLightApi = AbstractLightApi;
80
+ _AbstractLightApi_inputValidator = new WeakMap(), _AbstractLightApi_light = new WeakMap(), _AbstractLightApi_logger = new WeakMap(), _AbstractLightApi_viewportApi = new WeakMap();
81
+ //# sourceMappingURL=AbstractLightApi.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AbstractLightApi.js","sourceRoot":"","sources":["../../../src/implementation/lights/AbstractLightApi.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAGA,+EAA4E;AAG5E,MAAsB,gBAAgB;IAUlC,4BAA4B;IAE5B,2BAA2B;IAE3B,YAAY,WAAyB,EAAE,KAAa;QAbpD,yBAAyB;QAEzB,2CAA2C,uCAAc,CAAC,QAAQ,EAAC;QACnE,0CAAwB;QACxB,mCAA2B,+BAAM,CAAC,QAAQ,EAAC;QAC3C,gDAAoC;QAE1B,UAAK,GAAW,kBAAkB,CAAC;QAOzC,uBAAA,IAAI,iCAAgB,WAAW,MAAA,CAAC;QAChC,uBAAA,IAAI,2BAAU,KAAK,MAAA,CAAC;IACxB,CAAC;IAED,8BAA8B;IAE9B,0CAA0C;IAE1C,IAAW,KAAK;QACZ,OAAO,uBAAA,IAAI,+BAAO,CAAC,KAAK,CAAC;IAC7B,CAAC;IAED,IAAW,KAAK,CAAC,KAAY;QACzB,MAAM,KAAK,GAAG,OAAO,CAAC;QACtB,uBAAA,IAAI,wCAAgB,CAAC,gBAAgB,CAAC,GAAG,IAAI,CAAC,KAAK,IAAI,KAAK,EAAE,EAAE,KAAK,EAAE,OAAO,CAAC,CAAC;QAChF,uBAAA,IAAI,+BAAO,CAAC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IAAI,KAAK,KAAK,KAAK,gBAAgB,KAAK,EAAE,CAAC,CAAC;QAC5E,uBAAA,IAAI,qCAAa,CAAC,MAAM,EAAE,CAAC;IAC/B,CAAC;IAED,IAAW,KAAK;QACZ,OAAO,uBAAA,IAAI,+BAAO,CAAC,KAAK,CAAC;IAC7B,CAAC;IAED,IAAW,KAAK,CAAC,KAAyB;QACtC,MAAM,KAAK,GAAG,OAAO,CAAC;QACtB,uBAAA,IAAI,wCAAgB,CAAC,gBAAgB,CAAC,GAAG,IAAI,CAAC,KAAK,IAAI,KAAK,EAAE,EAAE,KAAK,EAAE,QAAQ,EAAE,KAAK,CAAC,CAAC;QACxF,uBAAA,IAAI,+BAAO,CAAC,KAAK,GAAG,KAAK,CAAC;QAC1B,uBAAA,IAAI,gCAAQ,CAAC,KAAK,CAAC,GAAG,IAAI,CAAC,KAAK,IAAI,KAAK,KAAK,KAAK,gBAAgB,KAAK,EAAE,CAAC,CAAC;QAC5E,uBAAA,IAAI,qCAAa,CAAC,MAAM,EAAE,CAAC;IAC/B,CAAC;IAED,IAAW,IAAI;QACX,OAAO,uBAAA,IAAI,+BAAO,CAAC,IAAI,CAAC;IAC5B,CAAC;CAGJ;AAhFD,4CAgFC"}
@@ -0,0 +1,69 @@
1
+ import { Color } from '@shapediver/viewer.shared.types';
2
+ import { ILightScene } from '@shapediver/viewer.rendering-engine.light-engine';
3
+ import { IAmbientLightApi } from '../../interfaces/lights/types/IAmbientLightApi';
4
+ import { IDirectionalLightApi } from '../../interfaces/lights/types/IDirectionalLightApi';
5
+ import { IHemisphereLightApi } from '../../interfaces/lights/types/IHemisphereLightApi';
6
+ import { ILightApi } from '../../interfaces/lights/ILightApi';
7
+ import { ILightSceneApi } from '../../interfaces/lights/ILightSceneApi';
8
+ import { IPointLightApi } from '../../interfaces/lights/types/IPointLightApi';
9
+ import { ISpotLightApi } from '../../interfaces/lights/types/ISpotLightApi';
10
+ import { ITreeNode } from '@shapediver/viewer.shared.node-tree';
11
+ import { IViewportApi } from '../../interfaces/IViewportApi';
12
+ import { vec3 } from 'gl-matrix';
13
+ export declare class LightSceneApi implements ILightSceneApi {
14
+ #private;
15
+ constructor(viewportApi: IViewportApi, lightScene: ILightScene);
16
+ get id(): string;
17
+ get lights(): {
18
+ [key: string]: ILightApi;
19
+ };
20
+ get name(): string | undefined;
21
+ set name(value: string | undefined);
22
+ get node(): ITreeNode;
23
+ addAmbientLight(properties: {
24
+ color?: Color | undefined;
25
+ intensity?: number | undefined;
26
+ id?: string | undefined;
27
+ name?: string | undefined;
28
+ }): IAmbientLightApi;
29
+ addDirectionalLight(properties: {
30
+ color?: Color | undefined;
31
+ intensity?: number | undefined;
32
+ direction?: vec3 | undefined;
33
+ castShadow?: boolean | undefined;
34
+ shadowMapResolution?: number | undefined;
35
+ shadowMapBias?: number | undefined;
36
+ id?: string | undefined;
37
+ name?: string | undefined;
38
+ }): IDirectionalLightApi;
39
+ addHemisphereLight(properties: {
40
+ color?: Color | undefined;
41
+ intensity?: number | undefined;
42
+ groundColor?: Color | undefined;
43
+ id?: string | undefined;
44
+ name?: string | undefined;
45
+ }): IHemisphereLightApi;
46
+ addPointLight(properties: {
47
+ color?: Color | undefined;
48
+ intensity?: number | undefined;
49
+ position?: vec3 | undefined;
50
+ distance?: number | undefined;
51
+ decay?: number | undefined;
52
+ id?: string | undefined;
53
+ name?: string | undefined;
54
+ }): IPointLightApi;
55
+ addSpotLight(properties: {
56
+ color?: Color | undefined;
57
+ intensity?: number | undefined;
58
+ position?: vec3 | undefined;
59
+ target?: vec3 | undefined;
60
+ distance?: number | undefined;
61
+ decay?: number | undefined;
62
+ angle?: number | undefined;
63
+ penumbra?: number | undefined;
64
+ id?: string | undefined;
65
+ name?: string | undefined;
66
+ }): ISpotLightApi;
67
+ removeLight(id: string): boolean;
68
+ }
69
+ //# sourceMappingURL=LightSceneApi.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LightSceneApi.d.ts","sourceRoot":"","sources":["../../../src/implementation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AC,EAAE,MAAM,GAAG,SAAS,CAAC;QAAC,QAAQ,CAAC,EAAE,IAAI,GAAG,SAAS,CAAC;QAAC,MAAM,CAAC,EAAE,IAAI,GAAG,SAAS,CAAC;QAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;QAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;QAAC,EAAE,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;KAAE,GAAG,aAAa;IAmBzU,WAAW,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO;CAO1C"}
@@ -0,0 +1,172 @@
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 _LightSceneApi_inputValidator, _LightSceneApi_lightScene, _LightSceneApi_lights, _LightSceneApi_logger, _LightSceneApi_viewportApi;
14
+ Object.defineProperty(exports, "__esModule", { value: true });
15
+ exports.LightSceneApi = void 0;
16
+ const AmbientLightApi_1 = require("./types/AmbientLightApi");
17
+ const DirectionalLightApi_1 = require("./types/DirectionalLightApi");
18
+ const HemisphereLightApi_1 = require("./types/HemisphereLightApi");
19
+ const viewer_rendering_engine_light_engine_1 = require("@shapediver/viewer.rendering-engine.light-engine");
20
+ const viewer_shared_services_1 = require("@shapediver/viewer.shared.services");
21
+ const PointLightApi_1 = require("./types/PointLightApi");
22
+ const SpotLightApi_1 = require("./types/SpotLightApi");
23
+ class LightSceneApi {
24
+ // #endregion Properties (5)
25
+ // #region Constructors (1)
26
+ constructor(viewportApi, lightScene) {
27
+ // #region Properties (5)
28
+ _LightSceneApi_inputValidator.set(this, viewer_shared_services_1.InputValidator.instance);
29
+ _LightSceneApi_lightScene.set(this, void 0);
30
+ _LightSceneApi_lights.set(this, {});
31
+ _LightSceneApi_logger.set(this, viewer_shared_services_1.Logger.instance);
32
+ _LightSceneApi_viewportApi.set(this, void 0);
33
+ __classPrivateFieldSet(this, _LightSceneApi_viewportApi, viewportApi, "f");
34
+ __classPrivateFieldSet(this, _LightSceneApi_lightScene, lightScene, "f");
35
+ // Whenever a light is added or removed from the light scene, this update is called.
36
+ __classPrivateFieldGet(this, _LightSceneApi_lightScene, "f").update = () => {
37
+ for (const l in __classPrivateFieldGet(this, _LightSceneApi_lightScene, "f").lights) {
38
+ if (!__classPrivateFieldGet(this, _LightSceneApi_lights, "f")[l]) {
39
+ switch (__classPrivateFieldGet(this, _LightSceneApi_lightScene, "f").lights[l].type) {
40
+ case viewer_rendering_engine_light_engine_1.LIGHT_TYPE.AMBIENT:
41
+ __classPrivateFieldGet(this, _LightSceneApi_lights, "f")[l] = new AmbientLightApi_1.AmbientLightApi(__classPrivateFieldGet(this, _LightSceneApi_viewportApi, "f"), __classPrivateFieldGet(this, _LightSceneApi_lightScene, "f").lights[l]);
42
+ break;
43
+ case viewer_rendering_engine_light_engine_1.LIGHT_TYPE.DIRECTIONAL:
44
+ __classPrivateFieldGet(this, _LightSceneApi_lights, "f")[l] = new DirectionalLightApi_1.DirectionalLightApi(__classPrivateFieldGet(this, _LightSceneApi_viewportApi, "f"), __classPrivateFieldGet(this, _LightSceneApi_lightScene, "f").lights[l]);
45
+ break;
46
+ case viewer_rendering_engine_light_engine_1.LIGHT_TYPE.HEMISPHERE:
47
+ __classPrivateFieldGet(this, _LightSceneApi_lights, "f")[l] = new HemisphereLightApi_1.HemisphereLightApi(__classPrivateFieldGet(this, _LightSceneApi_viewportApi, "f"), __classPrivateFieldGet(this, _LightSceneApi_lightScene, "f").lights[l]);
48
+ break;
49
+ case viewer_rendering_engine_light_engine_1.LIGHT_TYPE.POINT:
50
+ __classPrivateFieldGet(this, _LightSceneApi_lights, "f")[l] = new PointLightApi_1.PointLightApi(__classPrivateFieldGet(this, _LightSceneApi_viewportApi, "f"), __classPrivateFieldGet(this, _LightSceneApi_lightScene, "f").lights[l]);
51
+ break;
52
+ case viewer_rendering_engine_light_engine_1.LIGHT_TYPE.SPOT:
53
+ __classPrivateFieldGet(this, _LightSceneApi_lights, "f")[l] = new SpotLightApi_1.SpotLightApi(__classPrivateFieldGet(this, _LightSceneApi_viewportApi, "f"), __classPrivateFieldGet(this, _LightSceneApi_lightScene, "f").lights[l]);
54
+ break;
55
+ default:
56
+ }
57
+ }
58
+ }
59
+ for (const l in __classPrivateFieldGet(this, _LightSceneApi_lights, "f")) {
60
+ if (!__classPrivateFieldGet(this, _LightSceneApi_lightScene, "f").lights[l]) {
61
+ delete __classPrivateFieldGet(this, _LightSceneApi_lights, "f")[l];
62
+ }
63
+ }
64
+ };
65
+ // We call it once in the beginning to get the current state.
66
+ __classPrivateFieldGet(this, _LightSceneApi_lightScene, "f").update();
67
+ }
68
+ // #endregion Constructors (1)
69
+ // #region Public Getters And Setters (5)
70
+ get id() {
71
+ return __classPrivateFieldGet(this, _LightSceneApi_lightScene, "f").id;
72
+ }
73
+ get lights() {
74
+ return __classPrivateFieldGet(this, _LightSceneApi_lights, "f");
75
+ }
76
+ get name() {
77
+ return __classPrivateFieldGet(this, _LightSceneApi_lightScene, "f").name;
78
+ }
79
+ set name(value) {
80
+ const scope = 'name';
81
+ __classPrivateFieldGet(this, _LightSceneApi_inputValidator, "f").validateAndError(`LightSceneApi.${scope}`, value, 'string', false);
82
+ __classPrivateFieldGet(this, _LightSceneApi_lightScene, "f").name = value;
83
+ __classPrivateFieldGet(this, _LightSceneApi_logger, "f").debug(`LightSceneApi.${scope}: ${scope} was set to: ${value}`);
84
+ }
85
+ get node() {
86
+ return __classPrivateFieldGet(this, _LightSceneApi_lightScene, "f").node;
87
+ }
88
+ // #endregion Public Getters And Setters (5)
89
+ // #region Public Methods (6)
90
+ addAmbientLight(properties) {
91
+ const scope = 'addAmbientLight';
92
+ __classPrivateFieldGet(this, _LightSceneApi_inputValidator, "f").validateAndError(`LightSceneApi.${scope}`, properties, 'object', false);
93
+ const prop = Object.assign({}, properties);
94
+ __classPrivateFieldGet(this, _LightSceneApi_inputValidator, "f").validateAndError(`LightSceneApi.${scope}`, prop.color, 'color', false);
95
+ __classPrivateFieldGet(this, _LightSceneApi_inputValidator, "f").validateAndError(`LightSceneApi.${scope}`, prop.intensity, 'number', false);
96
+ __classPrivateFieldGet(this, _LightSceneApi_inputValidator, "f").validateAndError(`LightSceneApi.${scope}`, prop.id, 'string', false);
97
+ __classPrivateFieldGet(this, _LightSceneApi_inputValidator, "f").validateAndError(`LightSceneApi.${scope}`, prop.name, 'string', false);
98
+ const light = __classPrivateFieldGet(this, _LightSceneApi_lightScene, "f").addAmbientLight(properties);
99
+ __classPrivateFieldGet(this, _LightSceneApi_viewportApi, "f").update();
100
+ return __classPrivateFieldGet(this, _LightSceneApi_lights, "f")[light.id];
101
+ }
102
+ addDirectionalLight(properties) {
103
+ const scope = 'addDirectionalLight';
104
+ __classPrivateFieldGet(this, _LightSceneApi_inputValidator, "f").validateAndError(`LightSceneApi.${scope}`, properties, 'object', false);
105
+ const prop = Object.assign({}, properties);
106
+ __classPrivateFieldGet(this, _LightSceneApi_inputValidator, "f").validateAndError(`LightSceneApi.${scope}`, prop.color, 'color', false);
107
+ __classPrivateFieldGet(this, _LightSceneApi_inputValidator, "f").validateAndError(`LightSceneApi.${scope}`, prop.intensity, 'number', false);
108
+ __classPrivateFieldGet(this, _LightSceneApi_inputValidator, "f").validateAndError(`LightSceneApi.${scope}`, prop.direction, 'vec3', false);
109
+ __classPrivateFieldGet(this, _LightSceneApi_inputValidator, "f").validateAndError(`LightSceneApi.${scope}`, prop.castShadow, 'boolean', false);
110
+ __classPrivateFieldGet(this, _LightSceneApi_inputValidator, "f").validateAndError(`LightSceneApi.${scope}`, prop.shadowMapResolution, 'number', false);
111
+ __classPrivateFieldGet(this, _LightSceneApi_inputValidator, "f").validateAndError(`LightSceneApi.${scope}`, prop.shadowMapBias, 'number', false);
112
+ __classPrivateFieldGet(this, _LightSceneApi_inputValidator, "f").validateAndError(`LightSceneApi.${scope}`, prop.id, 'string', false);
113
+ __classPrivateFieldGet(this, _LightSceneApi_inputValidator, "f").validateAndError(`LightSceneApi.${scope}`, prop.name, 'string', false);
114
+ const light = __classPrivateFieldGet(this, _LightSceneApi_lightScene, "f").addDirectionalLight(properties);
115
+ __classPrivateFieldGet(this, _LightSceneApi_viewportApi, "f").update();
116
+ return __classPrivateFieldGet(this, _LightSceneApi_lights, "f")[light.id];
117
+ }
118
+ addHemisphereLight(properties) {
119
+ const scope = 'addHemisphereLight';
120
+ __classPrivateFieldGet(this, _LightSceneApi_inputValidator, "f").validateAndError(`LightSceneApi.${scope}`, properties, 'object', false);
121
+ const prop = Object.assign({}, properties);
122
+ __classPrivateFieldGet(this, _LightSceneApi_inputValidator, "f").validateAndError(`LightSceneApi.${scope}`, prop.color, 'color', false);
123
+ __classPrivateFieldGet(this, _LightSceneApi_inputValidator, "f").validateAndError(`LightSceneApi.${scope}`, prop.intensity, 'number', false);
124
+ __classPrivateFieldGet(this, _LightSceneApi_inputValidator, "f").validateAndError(`LightSceneApi.${scope}`, prop.groundColor, 'color', false);
125
+ __classPrivateFieldGet(this, _LightSceneApi_inputValidator, "f").validateAndError(`LightSceneApi.${scope}`, prop.id, 'string', false);
126
+ __classPrivateFieldGet(this, _LightSceneApi_inputValidator, "f").validateAndError(`LightSceneApi.${scope}`, prop.name, 'string', false);
127
+ const light = __classPrivateFieldGet(this, _LightSceneApi_lightScene, "f").addHemisphereLight(properties);
128
+ __classPrivateFieldGet(this, _LightSceneApi_viewportApi, "f").update();
129
+ return __classPrivateFieldGet(this, _LightSceneApi_lights, "f")[light.id];
130
+ }
131
+ addPointLight(properties) {
132
+ const scope = 'addPointLight';
133
+ __classPrivateFieldGet(this, _LightSceneApi_inputValidator, "f").validateAndError(`LightSceneApi.${scope}`, properties, 'object', false);
134
+ const prop = Object.assign({}, properties);
135
+ __classPrivateFieldGet(this, _LightSceneApi_inputValidator, "f").validateAndError(`LightSceneApi.${scope}`, prop.color, 'color', false);
136
+ __classPrivateFieldGet(this, _LightSceneApi_inputValidator, "f").validateAndError(`LightSceneApi.${scope}`, prop.intensity, 'number', false);
137
+ __classPrivateFieldGet(this, _LightSceneApi_inputValidator, "f").validateAndError(`LightSceneApi.${scope}`, prop.position, 'vec3', false);
138
+ __classPrivateFieldGet(this, _LightSceneApi_inputValidator, "f").validateAndError(`LightSceneApi.${scope}`, prop.distance, 'number', false);
139
+ __classPrivateFieldGet(this, _LightSceneApi_inputValidator, "f").validateAndError(`LightSceneApi.${scope}`, prop.decay, 'number', false);
140
+ __classPrivateFieldGet(this, _LightSceneApi_inputValidator, "f").validateAndError(`LightSceneApi.${scope}`, prop.id, 'string', false);
141
+ __classPrivateFieldGet(this, _LightSceneApi_inputValidator, "f").validateAndError(`LightSceneApi.${scope}`, prop.name, 'string', false);
142
+ const light = __classPrivateFieldGet(this, _LightSceneApi_lightScene, "f").addPointLight(properties);
143
+ __classPrivateFieldGet(this, _LightSceneApi_viewportApi, "f").update();
144
+ return __classPrivateFieldGet(this, _LightSceneApi_lights, "f")[light.id];
145
+ }
146
+ addSpotLight(properties) {
147
+ const scope = 'addSpotLight';
148
+ __classPrivateFieldGet(this, _LightSceneApi_inputValidator, "f").validateAndError(`LightSceneApi.${scope}`, properties, 'object', false);
149
+ const prop = Object.assign({}, properties);
150
+ __classPrivateFieldGet(this, _LightSceneApi_inputValidator, "f").validateAndError(`LightSceneApi.${scope}`, prop.color, 'color', false);
151
+ __classPrivateFieldGet(this, _LightSceneApi_inputValidator, "f").validateAndError(`LightSceneApi.${scope}`, prop.intensity, 'number', false);
152
+ __classPrivateFieldGet(this, _LightSceneApi_inputValidator, "f").validateAndError(`LightSceneApi.${scope}`, prop.position, 'vec3', false);
153
+ __classPrivateFieldGet(this, _LightSceneApi_inputValidator, "f").validateAndError(`LightSceneApi.${scope}`, prop.target, 'vec3', false);
154
+ __classPrivateFieldGet(this, _LightSceneApi_inputValidator, "f").validateAndError(`LightSceneApi.${scope}`, prop.distance, 'number', false);
155
+ __classPrivateFieldGet(this, _LightSceneApi_inputValidator, "f").validateAndError(`LightSceneApi.${scope}`, prop.decay, 'number', false);
156
+ __classPrivateFieldGet(this, _LightSceneApi_inputValidator, "f").validateAndError(`LightSceneApi.${scope}`, prop.angle, 'number', false);
157
+ __classPrivateFieldGet(this, _LightSceneApi_inputValidator, "f").validateAndError(`LightSceneApi.${scope}`, prop.penumbra, 'number', false);
158
+ __classPrivateFieldGet(this, _LightSceneApi_inputValidator, "f").validateAndError(`LightSceneApi.${scope}`, prop.id, 'string', false);
159
+ __classPrivateFieldGet(this, _LightSceneApi_inputValidator, "f").validateAndError(`LightSceneApi.${scope}`, prop.name, 'string', false);
160
+ const light = __classPrivateFieldGet(this, _LightSceneApi_lightScene, "f").addSpotLight(properties);
161
+ __classPrivateFieldGet(this, _LightSceneApi_viewportApi, "f").update();
162
+ return __classPrivateFieldGet(this, _LightSceneApi_lights, "f")[light.id];
163
+ }
164
+ removeLight(id) {
165
+ const check = __classPrivateFieldGet(this, _LightSceneApi_lightScene, "f").removeLight(id);
166
+ __classPrivateFieldGet(this, _LightSceneApi_viewportApi, "f").update();
167
+ return check;
168
+ }
169
+ }
170
+ exports.LightSceneApi = LightSceneApi;
171
+ _LightSceneApi_inputValidator = new WeakMap(), _LightSceneApi_lightScene = new WeakMap(), _LightSceneApi_lights = new WeakMap(), _LightSceneApi_logger = new WeakMap(), _LightSceneApi_viewportApi = new WeakMap();
172
+ //# sourceMappingURL=LightSceneApi.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LightSceneApi.js","sourceRoot":"","sources":["../../../src/implementation/lights/LightSceneApi.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,6DAA0D;AAE1D,qEAAkE;AAClE,mEAAgE;AAChE,2GAQ0D;AAM1D,+EAA4E;AAK5E,yDAAsD;AACtD,uDAAoD;AAGpD,MAAa,aAAa;IAStB,4BAA4B;IAE5B,2BAA2B;IAE3B,YAAY,WAAyB,EAAE,UAAuB;QAZ9D,yBAAyB;QAEzB,wCAA2C,uCAAc,CAAC,QAAQ,EAAC;QACnE,4CAAkC;QAClC,gCAAkD,EAAE,EAAC;QACrD,gCAA2B,+BAAM,CAAC,QAAQ,EAAC;QAC3C,6CAAoC;QAOhC,uBAAA,IAAI,8BAAgB,WAAW,MAAA,CAAC;QAChC,uBAAA,IAAI,6BAAe,UAAU,MAAA,CAAC;QAE9B,oFAAoF;QACpF,uBAAA,IAAI,iCAAY,CAAC,MAAM,GAAG,GAAG,EAAE;YAC3B,KAAK,MAAM,CAAC,IAAI,uBAAA,IAAI,iCAAY,CAAC,MAAM,EAAE;gBACrC,IAAI,CAAC,uBAAA,IAAI,6BAAQ,CAAC,CAAC,CAAC,EAAE;oBAClB,QAAQ,uBAAA,IAAI,iCAAY,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE;wBACrC,KAAK,iDAAU,CAAC,OAAO;4BACnB,uBAAA,IAAI,6BAAQ,CAAC,CAAC,CAAC,GAAG,IAAI,iCAAe,CAAC,uBAAA,IAAI,kCAAa,EAAiB,uBAAA,IAAI,iCAAY,CAAC,MAAM,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,UAAU,CAAC,CAAC;QACxD,uBAAA,IAAI,kCAAa,CAAC,MAAM,EAAE,CAAC;QAC3B,OAAsB,uBAAA,IAAI,6BAAQ,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;IACjD,CAAC;IAEM,WAAW,CAAC,EAAU;QACzB,MAAM,KAAK,GAAG,uBAAA,IAAI,iCAAY,CAAC,WAAW,CAAC,EAAE,CAAC,CAAC;QAC/C,uBAAA,IAAI,kCAAa,CAAC,MAAM,EAAE,CAAC;QAC3B,OAAO,KAAK,CAAC;IACjB,CAAC;CAGJ;AA1KD,sCA0KC"}
@@ -0,0 +1,9 @@
1
+ import { AbstractLightApi } from '../AbstractLightApi';
2
+ import { IAmbientLight } from '@shapediver/viewer.rendering-engine.light-engine';
3
+ import { IAmbientLightApi } from '../../../interfaces/lights/types/IAmbientLightApi';
4
+ import { IViewportApi } from '../../../interfaces/IViewportApi';
5
+ export declare class AmbientLightApi extends AbstractLightApi implements IAmbientLightApi {
6
+ #private;
7
+ constructor(viewportApi: IViewportApi, light: IAmbientLight);
8
+ }
9
+ //# sourceMappingURL=AmbientLightApi.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AmbientLightApi.d.ts","sourceRoot":"","sources":["../../../../src/implementation/lights/types/AmbientLightApi.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,EAAE,aAAa,EAAE,MAAM,kDAAkD,CAAC;AACjF,OAAO,EAAE,gBAAgB,EAAE,MAAM,mDAAmD,CAAC;AACrF,OAAO,EAAE,YAAY,EAAE,MAAM,kCAAkC,CAAC;AAEhE,qBAAa,eAAgB,SAAQ,gBAAiB,YAAW,gBAAgB;;gBAUjE,WAAW,EAAE,YAAY,EAAE,KAAK,EAAE,aAAa;CAQ9D"}
@@ -0,0 +1,27 @@
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 _AmbientLightApi_light, _AmbientLightApi_viewportApi;
9
+ Object.defineProperty(exports, "__esModule", { value: true });
10
+ exports.AmbientLightApi = void 0;
11
+ const AbstractLightApi_1 = require("../AbstractLightApi");
12
+ class AmbientLightApi extends AbstractLightApi_1.AbstractLightApi {
13
+ // #endregion Properties (2)
14
+ // #region Constructors (1)
15
+ constructor(viewportApi, light) {
16
+ super(viewportApi, light);
17
+ // #region Properties (2)
18
+ _AmbientLightApi_light.set(this, void 0);
19
+ _AmbientLightApi_viewportApi.set(this, void 0);
20
+ __classPrivateFieldSet(this, _AmbientLightApi_viewportApi, viewportApi, "f");
21
+ __classPrivateFieldSet(this, _AmbientLightApi_light, light, "f");
22
+ this.scope = 'AmbientLightApi';
23
+ }
24
+ }
25
+ exports.AmbientLightApi = AmbientLightApi;
26
+ _AmbientLightApi_light = new WeakMap(), _AmbientLightApi_viewportApi = new WeakMap();
27
+ //# sourceMappingURL=AmbientLightApi.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AmbientLightApi.js","sourceRoot":"","sources":["../../../../src/implementation/lights/types/AmbientLightApi.ts"],"names":[],"mappings":";;;;;;;;;;AAAA,0DAAuD;AAKvD,MAAa,eAAgB,SAAQ,mCAAgB;IAMjD,4BAA4B;IAE5B,2BAA2B;IAE3B,YAAY,WAAyB,EAAE,KAAoB;QACvD,KAAK,CAAC,WAAW,EAAE,KAAK,CAAC,CAAC;QAV9B,yBAAyB;QAEzB,yCAA+B;QAC/B,+CAAoC;QAQhC,uBAAA,IAAI,gCAAgB,WAAW,MAAA,CAAC;QAChC,uBAAA,IAAI,0BAAU,KAAK,MAAA,CAAC;QACpB,IAAI,CAAC,KAAK,GAAG,iBAAiB,CAAC;IACnC,CAAC;CAGJ;AAlBD,0CAkBC"}
@@ -0,0 +1,18 @@
1
+ import { AbstractLightApi } from '../AbstractLightApi';
2
+ import { IDirectionalLight } from '@shapediver/viewer.rendering-engine.light-engine';
3
+ import { IDirectionalLightApi } from '../../../interfaces/lights/types/IDirectionalLightApi';
4
+ import { IViewportApi } from '../../../interfaces/IViewportApi';
5
+ import { vec3 } from 'gl-matrix';
6
+ export declare class DirectionalLightApi extends AbstractLightApi implements IDirectionalLightApi {
7
+ #private;
8
+ constructor(viewportApi: IViewportApi, light: IDirectionalLight);
9
+ get castShadow(): boolean;
10
+ set castShadow(value: boolean);
11
+ get direction(): vec3;
12
+ set direction(value: vec3);
13
+ get shadowMapBias(): number;
14
+ set shadowMapBias(value: number);
15
+ get shadowMapResolution(): number;
16
+ set shadowMapResolution(value: number);
17
+ }
18
+ //# sourceMappingURL=DirectionalLightApi.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DirectionalLightApi.d.ts","sourceRoot":"","sources":["../../../../src/implementation/lights/types/DirectionalLightApi.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,EAAE,iBAAiB,EAAE,MAAM,kDAAkD,CAAC;AACrF,OAAO,EAAE,oBAAoB,EAAE,MAAM,uDAAuD,CAAC;AAE7F,OAAO,EAAE,YAAY,EAAE,MAAM,kCAAkC,CAAC;AAChE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEjC,qBAAa,mBAAoB,SAAQ,gBAAiB,YAAW,oBAAoB;;gBAYzE,WAAW,EAAE,YAAY,EAAE,KAAK,EAAE,iBAAiB;IAW/D,IAAW,UAAU,IAAI,OAAO,CAE/B;IAED,IAAW,UAAU,CAAC,KAAK,EAAE,OAAO,EAMnC;IAED,IAAW,SAAS,IAAI,IAAI,CAE3B;IAED,IAAW,SAAS,CAAC,KAAK,EAAE,IAAI,EAM/B;IAED,IAAW,aAAa,IAAI,MAAM,CAEjC;IAED,IAAW,aAAa,CAAC,KAAK,EAAE,MAAM,EAMrC;IAED,IAAW,mBAAmB,IAAI,MAAM,CAEvC;IAED,IAAW,mBAAmB,CAAC,KAAK,EAAE,MAAM,EAM3C;CAGJ"}
@@ -0,0 +1,77 @@
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 _DirectionalLightApi_inputValidator, _DirectionalLightApi_light, _DirectionalLightApi_logger, _DirectionalLightApi_viewportApi;
14
+ Object.defineProperty(exports, "__esModule", { value: true });
15
+ exports.DirectionalLightApi = void 0;
16
+ const AbstractLightApi_1 = require("../AbstractLightApi");
17
+ const viewer_shared_services_1 = require("@shapediver/viewer.shared.services");
18
+ class DirectionalLightApi extends AbstractLightApi_1.AbstractLightApi {
19
+ // #endregion Properties (4)
20
+ // #region Constructors (1)
21
+ constructor(viewportApi, light) {
22
+ super(viewportApi, light);
23
+ // #region Properties (4)
24
+ _DirectionalLightApi_inputValidator.set(this, viewer_shared_services_1.InputValidator.instance);
25
+ _DirectionalLightApi_light.set(this, void 0);
26
+ _DirectionalLightApi_logger.set(this, viewer_shared_services_1.Logger.instance);
27
+ _DirectionalLightApi_viewportApi.set(this, void 0);
28
+ __classPrivateFieldSet(this, _DirectionalLightApi_viewportApi, viewportApi, "f");
29
+ __classPrivateFieldSet(this, _DirectionalLightApi_light, light, "f");
30
+ this.scope = 'DirectionalLightApi';
31
+ }
32
+ // #endregion Constructors (1)
33
+ // #region Public Getters And Setters (8)
34
+ get castShadow() {
35
+ return __classPrivateFieldGet(this, _DirectionalLightApi_light, "f").castShadow;
36
+ }
37
+ set castShadow(value) {
38
+ const scope = 'castShadow';
39
+ __classPrivateFieldGet(this, _DirectionalLightApi_inputValidator, "f").validateAndError(`${this.scope}.${scope}`, value, 'boolean');
40
+ __classPrivateFieldGet(this, _DirectionalLightApi_light, "f").castShadow = value;
41
+ __classPrivateFieldGet(this, _DirectionalLightApi_logger, "f").debug(`${this.scope}.${scope}: ${scope} was set to: ${value}`);
42
+ __classPrivateFieldGet(this, _DirectionalLightApi_viewportApi, "f").update();
43
+ }
44
+ get direction() {
45
+ return __classPrivateFieldGet(this, _DirectionalLightApi_light, "f").direction;
46
+ }
47
+ set direction(value) {
48
+ const scope = 'direction';
49
+ __classPrivateFieldGet(this, _DirectionalLightApi_inputValidator, "f").validateAndError(`${this.scope}.${scope}`, value, 'vec3');
50
+ __classPrivateFieldGet(this, _DirectionalLightApi_light, "f").direction = value;
51
+ __classPrivateFieldGet(this, _DirectionalLightApi_logger, "f").debug(`${this.scope}.${scope}: ${scope} was set to: ${value}`);
52
+ __classPrivateFieldGet(this, _DirectionalLightApi_viewportApi, "f").update();
53
+ }
54
+ get shadowMapBias() {
55
+ return __classPrivateFieldGet(this, _DirectionalLightApi_light, "f").shadowMapBias;
56
+ }
57
+ set shadowMapBias(value) {
58
+ const scope = 'shadowMapBias';
59
+ __classPrivateFieldGet(this, _DirectionalLightApi_inputValidator, "f").validateAndError(`${this.scope}.${scope}`, value, 'number');
60
+ __classPrivateFieldGet(this, _DirectionalLightApi_light, "f").shadowMapBias = value;
61
+ __classPrivateFieldGet(this, _DirectionalLightApi_logger, "f").debug(`${this.scope}.${scope}: ${scope} was set to: ${value}`);
62
+ __classPrivateFieldGet(this, _DirectionalLightApi_viewportApi, "f").update();
63
+ }
64
+ get shadowMapResolution() {
65
+ return __classPrivateFieldGet(this, _DirectionalLightApi_light, "f").shadowMapResolution;
66
+ }
67
+ set shadowMapResolution(value) {
68
+ const scope = 'shadowMapResolution';
69
+ __classPrivateFieldGet(this, _DirectionalLightApi_inputValidator, "f").validateAndError(`${this.scope}.${scope}`, value, 'number');
70
+ __classPrivateFieldGet(this, _DirectionalLightApi_light, "f").shadowMapResolution = value;
71
+ __classPrivateFieldGet(this, _DirectionalLightApi_logger, "f").debug(`${this.scope}.${scope}: ${scope} was set to: ${value}`);
72
+ __classPrivateFieldGet(this, _DirectionalLightApi_viewportApi, "f").update();
73
+ }
74
+ }
75
+ exports.DirectionalLightApi = DirectionalLightApi;
76
+ _DirectionalLightApi_inputValidator = new WeakMap(), _DirectionalLightApi_light = new WeakMap(), _DirectionalLightApi_logger = new WeakMap(), _DirectionalLightApi_viewportApi = new WeakMap();
77
+ //# sourceMappingURL=DirectionalLightApi.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DirectionalLightApi.js","sourceRoot":"","sources":["../../../../src/implementation/lights/types/DirectionalLightApi.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,0DAAuD;AAGvD,+EAA4E;AAI5E,MAAa,mBAAoB,SAAQ,mCAAgB;IAQrD,4BAA4B;IAE5B,2BAA2B;IAE3B,YAAY,WAAyB,EAAE,KAAwB;QAC3D,KAAK,CAAC,WAAW,EAAE,KAAK,CAAC,CAAC;QAZ9B,yBAAyB;QAEzB,8CAA2C,uCAAc,CAAC,QAAQ,EAAC;QACnE,6CAAmC;QACnC,sCAA2B,+BAAM,CAAC,QAAQ,EAAC;QAC3C,mDAAoC;QAQhC,uBAAA,IAAI,oCAAgB,WAAW,MAAA,CAAC;QAChC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,CAAC;IACrC,CAAC;IAED,IAAW,aAAa,CAAC,KAAa;QAClC,MAAM,KAAK,GAAG,eAAe,CAAC;QAC9B,uBAAA,IAAI,2CAAgB,CAAC,gBAAgB,CAAC,GAAG,IAAI,CAAC,KAAK,IAAI,KAAK,EAAE,EAAE,KAAK,EAAE,QAAQ,CAAC,CAAC;QACjF,uBAAA,IAAI,kCAAO,CAAC,aAAa,GAAG,KAAK,CAAC;QAClC,uBAAA,IAAI,mCAAQ,CAAC,KAAK,CAAC,GAAG,IAAI,CAAC,KAAK,IAAI,KAAK,KAAK,KAAK,gBAAgB,KAAK,EAAE,CAAC,CAAC;QAC5E,uBAAA,IAAI,wCAAa,CAAC,MAAM,EAAE,CAAC;IAC/B,CAAC;IAED,IAAW,mBAAmB;QAC1B,OAAO,uBAAA,IAAI,kCAAO,CAAC,mBAAmB,CAAC;IAC3C,CAAC;IAED,IAAW,mBAAmB,CAAC,KAAa;QACxC,MAAM,KAAK,GAAG,qBAAqB,CAAC;QACpC,uBAAA,IAAI,2CAAgB,CAAC,gBAAgB,CAAC,GAAG,IAAI,CAAC,KAAK,IAAI,KAAK,EAAE,EAAE,KAAK,EAAE,QAAQ,CAAC,CAAC;QACjF,uBAAA,IAAI,kCAAO,CAAC,mBAAmB,GAAG,KAAK,CAAC;QACxC,uBAAA,IAAI,mCAAQ,CAAC,KAAK,CAAC,GAAG,IAAI,CAAC,KAAK,IAAI,KAAK,KAAK,KAAK,gBAAgB,KAAK,EAAE,CAAC,CAAC;QAC5E,uBAAA,IAAI,wCAAa,CAAC,MAAM,EAAE,CAAC;IAC/B,CAAC;CAGJ;AAxED,kDAwEC"}
@@ -0,0 +1,12 @@
1
+ import { AbstractLightApi } from '../AbstractLightApi';
2
+ import { Color } from '@shapediver/viewer.shared.types';
3
+ import { IHemisphereLight } from '@shapediver/viewer.rendering-engine.light-engine';
4
+ import { IHemisphereLightApi } from '../../../interfaces/lights/types/IHemisphereLightApi';
5
+ import { IViewportApi } from '../../../interfaces/IViewportApi';
6
+ export declare class HemisphereLightApi extends AbstractLightApi implements IHemisphereLightApi {
7
+ #private;
8
+ constructor(viewportApi: IViewportApi, light: IHemisphereLight);
9
+ get groundColor(): Color;
10
+ set groundColor(value: Color);
11
+ }
12
+ //# sourceMappingURL=HemisphereLightApi.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"HemisphereLightApi.d.ts","sourceRoot":"","sources":["../../../../src/implementation/lights/types/HemisphereLightApi.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,EAAE,KAAK,EAAE,MAAM,iCAAiC,CAAC;AACxD,OAAO,EAAE,gBAAgB,EAAE,MAAM,kDAAkD,CAAC;AACpF,OAAO,EAAE,mBAAmB,EAAE,MAAM,sDAAsD,CAAC;AAE3F,OAAO,EAAE,YAAY,EAAE,MAAM,kCAAkC,CAAC;AAEhE,qBAAa,kBAAmB,SAAQ,gBAAiB,YAAW,mBAAmB;;gBAYvE,WAAW,EAAE,YAAY,EAAE,KAAK,EAAE,gBAAgB;IAW9D,IAAW,WAAW,IAAI,KAAK,CAE9B;IAED,IAAW,WAAW,CAAC,KAAK,EAAE,KAAK,EAMlC;CAGJ"}