@shapediver/viewer.viewport 3.3.4 → 3.3.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +21 -22
- package/src/implementation/PostProcessingApi.ts +0 -184
- package/src/implementation/ViewportApi.ts +0 -1071
- package/src/implementation/camera/AbstractCameraApi.ts +0 -560
- package/src/implementation/camera/OrthographicCameraApi.ts +0 -43
- package/src/implementation/camera/PerspectiveCameraApi.ts +0 -43
- package/src/implementation/lights/AbstractLightApi.ts +0 -87
- package/src/implementation/lights/LightSceneApi.ts +0 -198
- package/src/implementation/lights/types/AmbientLightApi.ts +0 -24
- package/src/implementation/lights/types/DirectionalLightApi.ts +0 -80
- package/src/implementation/lights/types/HemisphereLightApi.ts +0 -44
- package/src/implementation/lights/types/PointLightApi.ts +0 -68
- package/src/implementation/lights/types/SpotLightApi.ts +0 -104
- package/src/index.ts +0 -312
- package/src/interfaces/IPostProcessingApi.ts +0 -269
- package/src/interfaces/IViewportApi.ts +0 -640
- package/src/interfaces/camera/ICameraApi.ts +0 -237
- package/src/interfaces/camera/IOrthographicCameraApi.ts +0 -18
- package/src/interfaces/camera/IPerspectiveCameraApi.ts +0 -17
- package/src/interfaces/lights/ILightApi.ts +0 -41
- package/src/interfaces/lights/ILightSceneApi.ts +0 -147
- package/src/interfaces/lights/types/IAmbientLightApi.ts +0 -7
- package/src/interfaces/lights/types/IDirectionalLightApi.ts +0 -29
- package/src/interfaces/lights/types/IHemisphereLightApi.ts +0 -17
- package/src/interfaces/lights/types/IPointLightApi.ts +0 -25
- package/src/interfaces/lights/types/ISpotLightApi.ts +0 -37
- package/src/main.ts +0 -89
- package/tsconfig.json +0 -17
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@shapediver/viewer.viewport",
|
|
3
|
-
"version": "3.3.
|
|
3
|
+
"version": "3.3.7",
|
|
4
4
|
"description": "",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"webgl",
|
|
@@ -19,11 +19,10 @@
|
|
|
19
19
|
"test": "__tests__"
|
|
20
20
|
},
|
|
21
21
|
"files": [
|
|
22
|
-
"dist",
|
|
23
|
-
"src",
|
|
24
22
|
"package.json",
|
|
23
|
+
"dist/",
|
|
25
24
|
"README.md",
|
|
26
|
-
"
|
|
25
|
+
"LICENSE"
|
|
27
26
|
],
|
|
28
27
|
"publishConfig": {
|
|
29
28
|
"access": "public"
|
|
@@ -50,29 +49,29 @@
|
|
|
50
49
|
},
|
|
51
50
|
"dependencies": {
|
|
52
51
|
"@shapediver/sdk.geometry-api-sdk-v2": "1.11.0",
|
|
53
|
-
"@shapediver/viewer.api.general": "3.3.
|
|
54
|
-
"@shapediver/viewer.creation-control-center.viewport": "3.3.
|
|
55
|
-
"@shapediver/viewer.data-engine.data-engine": "3.3.
|
|
56
|
-
"@shapediver/viewer.data-engine.geometry-engine": "3.3.
|
|
57
|
-
"@shapediver/viewer.data-engine.gltf-converter": "3.3.
|
|
58
|
-
"@shapediver/viewer.data-engine.material-engine": "3.3.
|
|
59
|
-
"@shapediver/viewer.data-engine.shared-types": "3.3.
|
|
60
|
-
"@shapediver/viewer.rendering-engine.animation-engine": "3.3.
|
|
61
|
-
"@shapediver/viewer.rendering-engine.camera-engine": "3.3.
|
|
62
|
-
"@shapediver/viewer.rendering-engine.light-engine": "3.3.
|
|
63
|
-
"@shapediver/viewer.rendering-engine.rendering-engine": "3.3.
|
|
64
|
-
"@shapediver/viewer.rendering-engine.rendering-engine-threejs": "3.3.
|
|
52
|
+
"@shapediver/viewer.api.general": "3.3.7",
|
|
53
|
+
"@shapediver/viewer.creation-control-center.viewport": "3.3.7",
|
|
54
|
+
"@shapediver/viewer.data-engine.data-engine": "3.3.7",
|
|
55
|
+
"@shapediver/viewer.data-engine.geometry-engine": "3.3.7",
|
|
56
|
+
"@shapediver/viewer.data-engine.gltf-converter": "3.3.7",
|
|
57
|
+
"@shapediver/viewer.data-engine.material-engine": "3.3.7",
|
|
58
|
+
"@shapediver/viewer.data-engine.shared-types": "3.3.7",
|
|
59
|
+
"@shapediver/viewer.rendering-engine.animation-engine": "3.3.7",
|
|
60
|
+
"@shapediver/viewer.rendering-engine.camera-engine": "3.3.7",
|
|
61
|
+
"@shapediver/viewer.rendering-engine.light-engine": "3.3.7",
|
|
62
|
+
"@shapediver/viewer.rendering-engine.rendering-engine": "3.3.7",
|
|
63
|
+
"@shapediver/viewer.rendering-engine.rendering-engine-threejs": "3.3.7",
|
|
65
64
|
"@shapediver/viewer.settings": "1.0.2",
|
|
66
|
-
"@shapediver/viewer.shared.build-data": "3.3.
|
|
67
|
-
"@shapediver/viewer.shared.math": "3.3.
|
|
68
|
-
"@shapediver/viewer.shared.node-tree": "3.3.
|
|
69
|
-
"@shapediver/viewer.shared.services": "3.3.
|
|
70
|
-
"@shapediver/viewer.shared.types": "3.3.
|
|
65
|
+
"@shapediver/viewer.shared.build-data": "3.3.7",
|
|
66
|
+
"@shapediver/viewer.shared.math": "3.3.7",
|
|
67
|
+
"@shapediver/viewer.shared.node-tree": "3.3.7",
|
|
68
|
+
"@shapediver/viewer.shared.services": "3.3.7",
|
|
69
|
+
"@shapediver/viewer.shared.types": "3.3.7",
|
|
71
70
|
"@types/qrcode": "^1.5.0",
|
|
72
71
|
"@types/three": "0.162.0",
|
|
73
72
|
"gl-matrix": "3.3.0",
|
|
74
73
|
"qrcode": "^1.5.0",
|
|
75
74
|
"three": "0.162.0"
|
|
76
75
|
},
|
|
77
|
-
"gitHead": "
|
|
76
|
+
"gitHead": "112787d5c5226cca5e89d08102d0b1a3dd4a1d71"
|
|
78
77
|
}
|
|
@@ -1,184 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
ANTI_ALIASING_TECHNIQUE,
|
|
3
|
-
Effect,
|
|
4
|
-
EffectComposer,
|
|
5
|
-
IPostProcessingEffectDefinition,
|
|
6
|
-
IPostProcessingEffectsArray,
|
|
7
|
-
POST_PROCESSING_EFFECT_TYPE,
|
|
8
|
-
RenderingEngine as RenderingEngineThreeJs
|
|
9
|
-
} from '@shapediver/viewer.rendering-engine.rendering-engine-threejs';
|
|
10
|
-
import { InputValidator, Logger } from '@shapediver/viewer.shared.services';
|
|
11
|
-
import { IPostProcessingApi } from '../interfaces/IPostProcessingApi';
|
|
12
|
-
import { ITreeNode } from '@shapediver/viewer.shared.node-tree';
|
|
13
|
-
import { IViewportApi } from '../interfaces/IViewportApi';
|
|
14
|
-
|
|
15
|
-
export class PostProcessingApi implements IPostProcessingApi {
|
|
16
|
-
// #region Properties (4)
|
|
17
|
-
|
|
18
|
-
readonly #inputValidator: InputValidator = InputValidator.instance;
|
|
19
|
-
readonly #logger: Logger = Logger.instance;
|
|
20
|
-
readonly #renderingEngine: RenderingEngineThreeJs;
|
|
21
|
-
readonly #viewportApi: IViewportApi;
|
|
22
|
-
|
|
23
|
-
// #endregion Properties (4)
|
|
24
|
-
|
|
25
|
-
// #region Constructors (1)
|
|
26
|
-
|
|
27
|
-
constructor(viewportApi: IViewportApi, renderingEngine: RenderingEngineThreeJs) {
|
|
28
|
-
this.#viewportApi = viewportApi;
|
|
29
|
-
this.#renderingEngine = renderingEngine;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
// #endregion Constructors (1)
|
|
33
|
-
|
|
34
|
-
// #region Public Getters And Setters (14)
|
|
35
|
-
|
|
36
|
-
public get antiAliasingTechnique(): ANTI_ALIASING_TECHNIQUE {
|
|
37
|
-
return this.#renderingEngine.postProcessingManager.antiAliasingTechnique;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
public set antiAliasingTechnique(value: ANTI_ALIASING_TECHNIQUE) {
|
|
41
|
-
const scope = 'antiAliasingTechnique';
|
|
42
|
-
this.#inputValidator.validateAndError(`PostProcessingApi.${scope}`, value, 'enum', true, Object.values(ANTI_ALIASING_TECHNIQUE));
|
|
43
|
-
this.#renderingEngine.postProcessingManager.antiAliasingTechnique = value;
|
|
44
|
-
this.#logger.debug(`PostProcessingApi.${scope}: ${scope} was set to: ${value}`);
|
|
45
|
-
this.#viewportApi.update();
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
public get antiAliasingTechniqueMobile(): ANTI_ALIASING_TECHNIQUE {
|
|
49
|
-
return this.#renderingEngine.postProcessingManager.antiAliasingTechniqueMobile;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
public set antiAliasingTechniqueMobile(value: ANTI_ALIASING_TECHNIQUE) {
|
|
53
|
-
const scope = 'antiAliasingTechniqueMobile';
|
|
54
|
-
this.#inputValidator.validateAndError(`PostProcessingApi.${scope}`, value, 'enum', true, Object.values(ANTI_ALIASING_TECHNIQUE));
|
|
55
|
-
this.#renderingEngine.postProcessingManager.antiAliasingTechniqueMobile = value;
|
|
56
|
-
this.#logger.debug(`PostProcessingApi.${scope}: ${scope} was set to: ${value}`);
|
|
57
|
-
this.#viewportApi.update();
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
public get effectComposer(): EffectComposer | undefined {
|
|
61
|
-
return this.#renderingEngine.postProcessingManager.effectComposer;
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
public get enablePostProcessingOnMobile(): boolean {
|
|
65
|
-
return this.#renderingEngine.postProcessingManager.enablePostProcessingOnMobile;
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
public set enablePostProcessingOnMobile(value: boolean) {
|
|
69
|
-
const scope = 'enablePostProcessingOnMobile';
|
|
70
|
-
this.#inputValidator.validateAndError(`PostProcessingApi.${scope}`, value, 'boolean');
|
|
71
|
-
this.#renderingEngine.postProcessingManager.enablePostProcessingOnMobile = value;
|
|
72
|
-
this.#logger.debug(`PostProcessingApi.${scope}: ${scope} was set to: ${value}`);
|
|
73
|
-
this.#viewportApi.update();
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
public get godRaysEffects(): {
|
|
77
|
-
[key: string]: {
|
|
78
|
-
setLightSource(node: ITreeNode): void;
|
|
79
|
-
removeLightSource(): void;
|
|
80
|
-
}
|
|
81
|
-
} {
|
|
82
|
-
return this.#renderingEngine.postProcessingManager.godRaysManagers;
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
public get manualPostProcessing(): boolean {
|
|
86
|
-
return this.#renderingEngine.postProcessingManager.manualPostProcessing;
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
public set manualPostProcessing(value: boolean) {
|
|
90
|
-
const scope = 'manualPostProcessing';
|
|
91
|
-
this.#inputValidator.validateAndError(`PostProcessingApi.${scope}`, value, 'boolean');
|
|
92
|
-
this.#renderingEngine.postProcessingManager.manualPostProcessing = value;
|
|
93
|
-
this.#logger.debug(`PostProcessingApi.${scope}: ${scope} was set to: ${value}`);
|
|
94
|
-
this.#viewportApi.update();
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
public get outlineEffects(): {
|
|
98
|
-
[key: string]: {
|
|
99
|
-
addSelection(node: ITreeNode): void;
|
|
100
|
-
removeSelection(node: ITreeNode): boolean;
|
|
101
|
-
clearSelection(): void;
|
|
102
|
-
}
|
|
103
|
-
} {
|
|
104
|
-
return this.#renderingEngine.postProcessingManager.outlineManagers;
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
public get selectiveBloomEffects(): {
|
|
108
|
-
[key: string]: {
|
|
109
|
-
addSelection(node: ITreeNode): void;
|
|
110
|
-
removeSelection(node: ITreeNode): boolean;
|
|
111
|
-
clearSelection(): void;
|
|
112
|
-
}
|
|
113
|
-
} {
|
|
114
|
-
return this.#renderingEngine.postProcessingManager.selectiveBloomManagers;
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
public get ssaaSampleLevel(): number {
|
|
118
|
-
return this.#renderingEngine.postProcessingManager.ssaaSampleLevel;
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
public set ssaaSampleLevel(value: number) {
|
|
122
|
-
const scope = 'ssaaSampleLevel';
|
|
123
|
-
this.#inputValidator.validateAndError(`PostProcessingApi.${scope}`, value, 'number');
|
|
124
|
-
this.#renderingEngine.postProcessingManager.ssaaSampleLevel = value;
|
|
125
|
-
this.#logger.debug(`PostProcessingApi.${scope}: ${scope} was set to: ${value}`);
|
|
126
|
-
this.#viewportApi.update();
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
// #endregion Public Getters And Setters (14)
|
|
130
|
-
|
|
131
|
-
// #region Public Methods (7)
|
|
132
|
-
|
|
133
|
-
public addEffect(definition: IPostProcessingEffectDefinition): string {
|
|
134
|
-
const scope = 'addEffect';
|
|
135
|
-
this.#inputValidator.validateAndError(`PostProcessingApi.${scope}`, definition, 'object', false);
|
|
136
|
-
const res = this.#renderingEngine.postProcessingManager.addEffect(definition);
|
|
137
|
-
this.#logger.debug(`PostProcessingApi.${scope}: ${scope} was called with definition ${definition}.`);
|
|
138
|
-
this.#viewportApi.update();
|
|
139
|
-
return res;
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
public getDefaultEffectProperties(type: POST_PROCESSING_EFFECT_TYPE): unknown {
|
|
143
|
-
const scope = 'getDefaultEffectProperties';
|
|
144
|
-
this.#inputValidator.validateAndError(`PostProcessingApi.${scope}`, type, 'enum', true, Object.values(POST_PROCESSING_EFFECT_TYPE));
|
|
145
|
-
this.#logger.debug(`PostProcessingApi.${scope}: ${scope} was called with type ${type}.`);
|
|
146
|
-
return this.#renderingEngine.postProcessingManager.getDefaultEffectProperties(type);
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
public getEffect(token: string): Effect {
|
|
150
|
-
const scope = 'getEffect';
|
|
151
|
-
this.#inputValidator.validateAndError(`PostProcessingApi.${scope}`, token, 'string');
|
|
152
|
-
this.#logger.debug(`PostProcessingApi.${scope}: ${scope} was called with token ${token}.`);
|
|
153
|
-
return this.#renderingEngine.postProcessingManager.getEffect(token);
|
|
154
|
-
}
|
|
155
|
-
|
|
156
|
-
public getEffectTokens(): { [key: string]: POST_PROCESSING_EFFECT_TYPE } {
|
|
157
|
-
return this.#renderingEngine.postProcessingManager.getEffectTokens();
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
public getPostProcessingEffectsArray(): IPostProcessingEffectsArray {
|
|
161
|
-
const scope = 'getPostProcessingEffectsArray';
|
|
162
|
-
this.#logger.debug(`PostProcessingApi.${scope}: ${scope} was called.`);
|
|
163
|
-
return this.#renderingEngine.postProcessingManager.getPostProcessingEffectsArray();
|
|
164
|
-
}
|
|
165
|
-
|
|
166
|
-
public removeEffect(token: string): boolean {
|
|
167
|
-
const scope = 'removeEffect';
|
|
168
|
-
this.#inputValidator.validateAndError(`PostProcessingApi.${scope}`, token, 'string');
|
|
169
|
-
const res = this.#renderingEngine.postProcessingManager.removeEffect(token);
|
|
170
|
-
this.#logger.debug(`PostProcessingApi.${scope}: ${scope} was called with token ${token}.`);
|
|
171
|
-
this.#viewportApi.update();
|
|
172
|
-
return res;
|
|
173
|
-
}
|
|
174
|
-
|
|
175
|
-
public updateEffect(token: string, definition: IPostProcessingEffectDefinition): void {
|
|
176
|
-
const scope = 'updateEffect';
|
|
177
|
-
this.#inputValidator.validateAndError(`PostProcessingApi.${scope}`, token, 'string');
|
|
178
|
-
this.#renderingEngine.postProcessingManager.updateEffect(token, definition);
|
|
179
|
-
this.#logger.debug(`PostProcessingApi.${scope}: ${scope} was called with token ${token} and definition ${definition}.`);
|
|
180
|
-
this.#viewportApi.update();
|
|
181
|
-
}
|
|
182
|
-
|
|
183
|
-
// #endregion Public Methods (7)
|
|
184
|
-
}
|