@shapediver/viewer.shared.types 3.3.4 → 3.3.6
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/dist/implementation/data/GeometryData.d.ts.map +1 -1
- package/dist/implementation/data/GeometryData.js +1 -0
- package/dist/implementation/data/GeometryData.js.map +1 -1
- package/dist/index.d.ts +5 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -5
- package/dist/index.js.map +1 -1
- package/dist/interfaces/parameter/IDrawingParametersSettings.d.ts +121 -0
- package/dist/interfaces/parameter/IDrawingParametersSettings.d.ts.map +1 -0
- package/dist/interfaces/parameter/IDrawingParametersSettings.js +22 -0
- package/dist/interfaces/parameter/IDrawingParametersSettings.js.map +1 -0
- package/dist/interfaces/parameter/IDrawingToolsParametersSettings.d.ts +159 -0
- package/dist/interfaces/parameter/IDrawingToolsParametersSettings.d.ts.map +1 -0
- package/dist/interfaces/parameter/IDrawingToolsParametersSettings.js +29 -0
- package/dist/interfaces/parameter/IDrawingToolsParametersSettings.js.map +1 -0
- package/dist/interfaces/parameter/IGumballParameterSettings.d.ts +1 -5
- package/dist/interfaces/parameter/IGumballParameterSettings.d.ts.map +1 -1
- package/dist/interfaces/parameter/IGumballParameterSettings.js +0 -7
- package/dist/interfaces/parameter/IGumballParameterSettings.js.map +1 -1
- package/dist/interfaces/parameter/ISelectionParameterSettings.d.ts +1 -5
- package/dist/interfaces/parameter/ISelectionParameterSettings.d.ts.map +1 -1
- package/dist/interfaces/parameter/ISelectionParameterSettings.js +0 -7
- package/dist/interfaces/parameter/ISelectionParameterSettings.js.map +1 -1
- package/package.json +7 -8
- package/src/implementation/data/AnimationData.ts +0 -310
- package/src/implementation/data/BoneData.ts +0 -32
- package/src/implementation/data/CustomData.ts +0 -52
- package/src/implementation/data/GeometryData.ts +0 -426
- package/src/implementation/data/HTMLElementAnchorData.ts +0 -365
- package/src/implementation/material/AbstractMaterialData.ts +0 -268
- package/src/implementation/material/MapData.ts +0 -218
- package/src/implementation/material/MaterialBasicLineData.ts +0 -99
- package/src/implementation/material/MaterialGemData.ts +0 -310
- package/src/implementation/material/MaterialMultiPointData.ts +0 -659
- package/src/implementation/material/MaterialPointData.ts +0 -136
- package/src/implementation/material/MaterialShadowData.ts +0 -45
- package/src/implementation/material/MaterialSpecularGlossinessData.ts +0 -191
- package/src/implementation/material/MaterialStandardData.ts +0 -502
- package/src/implementation/material/MaterialUnlitData.ts +0 -122
- package/src/implementation/material/MaterialVariantsData.ts +0 -60
- package/src/implementation/sdtf/SDTFAttributesData.ts +0 -128
- package/src/implementation/sdtf/SDTFItemData.ts +0 -72
- package/src/implementation/sdtf/SDTFOverviewData.ts +0 -80
- package/src/index.ts +0 -141
- package/src/interfaces/data/IAnimationData.ts +0 -42
- package/src/interfaces/data/IBoneData.ts +0 -9
- package/src/interfaces/data/ICustomData.ts +0 -15
- package/src/interfaces/data/IGeometryData.ts +0 -87
- package/src/interfaces/data/IHTMLElementAnchorData.ts +0 -68
- package/src/interfaces/data/material/IMapData.ts +0 -64
- package/src/interfaces/data/material/IMaterialAbstractData.ts +0 -86
- package/src/interfaces/data/material/IMaterialBasicLineData.ts +0 -21
- package/src/interfaces/data/material/IMaterialGemDataProperties.ts +0 -46
- package/src/interfaces/data/material/IMaterialMultiPointData.ts +0 -72
- package/src/interfaces/data/material/IMaterialPointData.ts +0 -31
- package/src/interfaces/data/material/IMaterialShadowData.ts +0 -21
- package/src/interfaces/data/material/IMaterialSpecularGlossinessDataProperties.ts +0 -36
- package/src/interfaces/data/material/IMaterialStandardData.ts +0 -60
- package/src/interfaces/data/material/IMaterialUnlitData.ts +0 -30
- package/src/interfaces/data/material/IMaterialVariantsData.ts +0 -19
- package/src/interfaces/events/EventResponseMapping.ts +0 -53
- package/src/interfaces/events/ICameraEvent.ts +0 -16
- package/src/interfaces/events/IOutputEvent.ts +0 -29
- package/src/interfaces/events/IParameterEvent.ts +0 -21
- package/src/interfaces/events/IRenderingEvent.ts +0 -7
- package/src/interfaces/events/ISceneEvent.ts +0 -17
- package/src/interfaces/events/ISessionEvent.ts +0 -16
- package/src/interfaces/events/ITaskEvent.ts +0 -61
- package/src/interfaces/events/IViewportEvent.ts +0 -13
- package/src/interfaces/parameter/IGumballParameterSettings.ts +0 -44
- package/src/interfaces/parameter/IInteractionParameterSettings.ts +0 -85
- package/src/interfaces/parameter/ISelectionParameterSettings.ts +0 -37
- package/src/interfaces/sdtf/ISDTFAttributeVisualizationData.ts +0 -7
- package/src/interfaces/sdtf/ISDTFAttributesData.ts +0 -27
- package/src/interfaces/sdtf/ISDTFItemData.ts +0 -23
- package/src/interfaces/sdtf/ISDTFOverviewData.ts +0 -31
- package/src/types.ts +0 -68
- package/tsconfig.json +0 -17
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@shapediver/viewer.shared.types",
|
|
3
|
-
"version": "3.3.
|
|
3
|
+
"version": "3.3.6",
|
|
4
4
|
"description": "",
|
|
5
5
|
"keywords": [],
|
|
6
6
|
"author": "Michael Oppitz <michael@shapediver.com>",
|
|
@@ -10,11 +10,10 @@
|
|
|
10
10
|
"test": "__tests__"
|
|
11
11
|
},
|
|
12
12
|
"files": [
|
|
13
|
-
"dist",
|
|
14
|
-
"src",
|
|
15
13
|
"package.json",
|
|
14
|
+
"dist/",
|
|
16
15
|
"README.md",
|
|
17
|
-
"
|
|
16
|
+
"LICENSE"
|
|
18
17
|
],
|
|
19
18
|
"publishConfig": {
|
|
20
19
|
"access": "public"
|
|
@@ -41,11 +40,11 @@
|
|
|
41
40
|
"dependencies": {
|
|
42
41
|
"@shapediver/sdk.geometry-api-sdk-v2": "1.11.0",
|
|
43
42
|
"@shapediver/sdk.sdtf-v1": "1.5.3",
|
|
44
|
-
"@shapediver/viewer.shared.math": "3.3.
|
|
45
|
-
"@shapediver/viewer.shared.node-tree": "3.3.
|
|
46
|
-
"@shapediver/viewer.shared.services": "3.3.
|
|
43
|
+
"@shapediver/viewer.shared.math": "3.3.6",
|
|
44
|
+
"@shapediver/viewer.shared.node-tree": "3.3.6",
|
|
45
|
+
"@shapediver/viewer.shared.services": "3.3.6",
|
|
47
46
|
"gl-matrix": "3.3.0",
|
|
48
47
|
"zod": "^3.23.8"
|
|
49
48
|
},
|
|
50
|
-
"gitHead": "
|
|
49
|
+
"gitHead": "13aea937b128a001e6e93be300674c4a04624c29"
|
|
51
50
|
}
|
|
@@ -1,310 +0,0 @@
|
|
|
1
|
-
import { AbstractTreeNodeData, ITransformation, ITreeNode, ITreeNodeData } from '@shapediver/viewer.shared.node-tree'
|
|
2
|
-
import { mat4, quat, vec3, vec4 } from 'gl-matrix';
|
|
3
|
-
import { IAnimationData, IAnimationTrack } from '../../interfaces/data/IAnimationData';
|
|
4
|
-
import { GeometryData } from './GeometryData';
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
export class AnimationData extends AbstractTreeNodeData implements IAnimationData {
|
|
8
|
-
// #region Properties (8)
|
|
9
|
-
|
|
10
|
-
#animate: boolean = false;
|
|
11
|
-
#animationTime: number = 0;
|
|
12
|
-
#duration: number;
|
|
13
|
-
#name: string;
|
|
14
|
-
#repeat: boolean = false;
|
|
15
|
-
#start: number;
|
|
16
|
-
#started: boolean = false;
|
|
17
|
-
#tracks: IAnimationTrack[];
|
|
18
|
-
#reset: boolean = true;
|
|
19
|
-
#nodeIds: string[] = [];
|
|
20
|
-
|
|
21
|
-
// #endregion Properties (8)
|
|
22
|
-
|
|
23
|
-
// #region Constructors (1)
|
|
24
|
-
|
|
25
|
-
/**
|
|
26
|
-
* Creates a custom data node.
|
|
27
|
-
*
|
|
28
|
-
* @param _data the data as key- value pairs
|
|
29
|
-
* @param id the id
|
|
30
|
-
*/
|
|
31
|
-
constructor(
|
|
32
|
-
name: string,
|
|
33
|
-
tracks: IAnimationTrack[],
|
|
34
|
-
start: number,
|
|
35
|
-
duration: number,
|
|
36
|
-
id?: string,
|
|
37
|
-
version?: string
|
|
38
|
-
) {
|
|
39
|
-
super(id, version);
|
|
40
|
-
this.#name = name;
|
|
41
|
-
this.#tracks = tracks;
|
|
42
|
-
this.#start = start;
|
|
43
|
-
this.#duration = duration;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
// #endregion Constructors (1)
|
|
47
|
-
|
|
48
|
-
// #region Public Accessors (9)
|
|
49
|
-
|
|
50
|
-
public get animate(): boolean {
|
|
51
|
-
return this.#animate;
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
public get animationTime(): number {
|
|
55
|
-
return this.#animationTime;
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
public set animationTime(value: number) {
|
|
59
|
-
this.#animationTime = value;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
public get duration(): number {
|
|
63
|
-
return this.#duration;
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
public get name(): string {
|
|
67
|
-
return this.#name;
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
public get repeat(): boolean {
|
|
71
|
-
return this.#repeat;
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
public set repeat(value: boolean) {
|
|
75
|
-
this.#repeat = value;
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
public get reset(): boolean {
|
|
79
|
-
return this.#reset;
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
public set reset(value: boolean) {
|
|
83
|
-
this.#reset = value;
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
public get start(): number {
|
|
87
|
-
return this.#start;
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
public get tracks(): IAnimationTrack[] {
|
|
91
|
-
return this.#tracks;
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
public set tracks(value: IAnimationTrack[]) {
|
|
95
|
-
this.#tracks = value;
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
// #endregion Public Accessors (9)
|
|
99
|
-
|
|
100
|
-
// #region Public Methods (5)
|
|
101
|
-
|
|
102
|
-
/**
|
|
103
|
-
* Clones the scene graph data.
|
|
104
|
-
*/
|
|
105
|
-
public clone(): IAnimationData {
|
|
106
|
-
return new AnimationData(this.name, this.#tracks, this.start, this.duration, this.id, this.version);
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
public continueAnimation() {
|
|
110
|
-
if (this.#started) this.#animate = true;
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
public pauseAnimation() {
|
|
114
|
-
if (this.#started) this.#animate = false;
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
public startAnimation() {
|
|
118
|
-
this.#animationTime = 0;
|
|
119
|
-
this.#animate = true;
|
|
120
|
-
this.#started = true;
|
|
121
|
-
|
|
122
|
-
for (let i = 0; i < this.#tracks.length; i++) {
|
|
123
|
-
const track = this.#tracks[i];
|
|
124
|
-
const idleTransformation = track.node.transformations.find(t => t.id === 'gltf_matrix');
|
|
125
|
-
if (idleTransformation) {
|
|
126
|
-
track.previousMatrix = {
|
|
127
|
-
id: idleTransformation.id,
|
|
128
|
-
matrix: mat4.clone(idleTransformation.matrix)
|
|
129
|
-
}
|
|
130
|
-
idleTransformation.matrix = mat4.create();
|
|
131
|
-
continue;
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
switch (track.path) {
|
|
135
|
-
case 'scale':
|
|
136
|
-
const idleTransformationScale = track.node.transformations.find(t => t.id === 'gltf_matrix_scale');
|
|
137
|
-
if (idleTransformationScale) {
|
|
138
|
-
track.previousMatrix = {
|
|
139
|
-
id: idleTransformationScale.id,
|
|
140
|
-
matrix: mat4.clone(idleTransformationScale.matrix)
|
|
141
|
-
}
|
|
142
|
-
continue;
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
break;
|
|
146
|
-
|
|
147
|
-
case 'rotation':
|
|
148
|
-
const idleTransformationRotation = track.node.transformations.find(t => t.id === 'gltf_matrix_rotation');
|
|
149
|
-
if (idleTransformationRotation) {
|
|
150
|
-
track.previousMatrix = {
|
|
151
|
-
id: idleTransformationRotation.id,
|
|
152
|
-
matrix: mat4.clone(idleTransformationRotation.matrix)
|
|
153
|
-
}
|
|
154
|
-
continue;
|
|
155
|
-
}
|
|
156
|
-
|
|
157
|
-
break;
|
|
158
|
-
|
|
159
|
-
case 'translation':
|
|
160
|
-
const idleTransformationTranslation = track.node.transformations.find(t => t.id === 'gltf_matrix_translation');
|
|
161
|
-
if (idleTransformationTranslation) {
|
|
162
|
-
track.previousMatrix = {
|
|
163
|
-
id: idleTransformationTranslation.id,
|
|
164
|
-
matrix: mat4.clone(idleTransformationTranslation.matrix)
|
|
165
|
-
}
|
|
166
|
-
continue;
|
|
167
|
-
}
|
|
168
|
-
break;
|
|
169
|
-
}
|
|
170
|
-
}
|
|
171
|
-
}
|
|
172
|
-
|
|
173
|
-
public stopAnimation() {
|
|
174
|
-
if (this.reset) {
|
|
175
|
-
for (let i = 0; i < this.#tracks.length; i++) {
|
|
176
|
-
const track = this.#tracks[i];
|
|
177
|
-
const id = this.id + '_' + i;
|
|
178
|
-
const prevAnimation = track.node.transformations.filter(t => t.id === id);
|
|
179
|
-
track.node.transformations = track.node.transformations.filter((el) => {
|
|
180
|
-
return !prevAnimation.includes(el);
|
|
181
|
-
});
|
|
182
|
-
|
|
183
|
-
if (track.previousMatrix) {
|
|
184
|
-
if (track.previousMatrix.id === 'gltf_matrix') {
|
|
185
|
-
const transformation = track.node.transformations.find(t => t.id === 'gltf_matrix')!;
|
|
186
|
-
transformation.matrix = track.previousMatrix.matrix;
|
|
187
|
-
const translationTransformation = track.node.transformations.find(t => t.id === 'gltf_matrix_translation')!;
|
|
188
|
-
translationTransformation.matrix = mat4.create();
|
|
189
|
-
const rotationTransformation = track.node.transformations.find(t => t.id === 'gltf_matrix_rotation')!;
|
|
190
|
-
rotationTransformation.matrix = mat4.create();
|
|
191
|
-
const scaleTransformation = track.node.transformations.find(t => t.id === 'gltf_matrix_scale')!;
|
|
192
|
-
scaleTransformation.matrix = mat4.create();
|
|
193
|
-
continue;
|
|
194
|
-
} else {
|
|
195
|
-
switch (track.path) {
|
|
196
|
-
case 'scale':
|
|
197
|
-
const idleTransformationScale = track.node.transformations.find(t => t.id === 'gltf_matrix_scale')!;
|
|
198
|
-
idleTransformationScale.matrix = track.previousMatrix.matrix;
|
|
199
|
-
continue;
|
|
200
|
-
case 'rotation':
|
|
201
|
-
const idleTransformationRotation = track.node.transformations.find(t => t.id === 'gltf_matrix_rotation')!;
|
|
202
|
-
idleTransformationRotation.matrix = track.previousMatrix.matrix;
|
|
203
|
-
continue;
|
|
204
|
-
case 'translation':
|
|
205
|
-
const idleTransformationTranslation = track.node.transformations.find(t => t.id === 'gltf_matrix_translation')!;
|
|
206
|
-
idleTransformationTranslation.matrix = track.previousMatrix.matrix;
|
|
207
|
-
continue;
|
|
208
|
-
}
|
|
209
|
-
}
|
|
210
|
-
} else {
|
|
211
|
-
const idleTransformation = track.node.transformations.find(t => t.id === 'gltf_matrix');
|
|
212
|
-
if (idleTransformation) {
|
|
213
|
-
idleTransformation.matrix = mat4.create();
|
|
214
|
-
} else {
|
|
215
|
-
const idleTransformationScale = track.node.transformations.find(t => t.id === 'gltf_matrix_scale');
|
|
216
|
-
if (idleTransformationScale) idleTransformationScale.matrix = mat4.create();
|
|
217
|
-
|
|
218
|
-
const idleTransformationRotation = track.node.transformations.find(t => t.id === 'gltf_matrix_rotation');
|
|
219
|
-
if (idleTransformationRotation) idleTransformationRotation.matrix = mat4.create();
|
|
220
|
-
|
|
221
|
-
const idleTransformationTranslation = track.node.transformations.find(t => t.id === 'gltf_matrix_translation');
|
|
222
|
-
if (idleTransformationTranslation) idleTransformationTranslation.matrix = mat4.create();
|
|
223
|
-
}
|
|
224
|
-
}
|
|
225
|
-
}
|
|
226
|
-
} else {
|
|
227
|
-
for (let i = 0; i < this.#tracks.length; i++) {
|
|
228
|
-
const track = this.#tracks[i];
|
|
229
|
-
const id = this.id + '_' + i;
|
|
230
|
-
|
|
231
|
-
const prevAnimation = track.node.transformations.filter(t => t.id === id);
|
|
232
|
-
track.node.transformations = track.node.transformations.filter((el) => {
|
|
233
|
-
return !prevAnimation.includes(el);
|
|
234
|
-
});
|
|
235
|
-
|
|
236
|
-
const j = track.times.length - 1;
|
|
237
|
-
|
|
238
|
-
let translationTransformation = track.node.transformations.find(t => t.id === 'gltf_matrix_translation');
|
|
239
|
-
if(!translationTransformation) {
|
|
240
|
-
translationTransformation = {
|
|
241
|
-
id: 'gltf_matrix_translation',
|
|
242
|
-
matrix: mat4.create()
|
|
243
|
-
}
|
|
244
|
-
track.node.transformations.push(translationTransformation)
|
|
245
|
-
}
|
|
246
|
-
|
|
247
|
-
let rotationTransformation = track.node.transformations.find(t => t.id === 'gltf_matrix_rotation');
|
|
248
|
-
if(!rotationTransformation) {
|
|
249
|
-
rotationTransformation = {
|
|
250
|
-
id: 'gltf_matrix_rotation',
|
|
251
|
-
matrix: mat4.create()
|
|
252
|
-
}
|
|
253
|
-
track.node.transformations.push(rotationTransformation)
|
|
254
|
-
}
|
|
255
|
-
|
|
256
|
-
let scaleTransformation = track.node.transformations.find(t => t.id === 'gltf_matrix_scale');
|
|
257
|
-
if(!scaleTransformation) {
|
|
258
|
-
scaleTransformation = {
|
|
259
|
-
id: 'gltf_matrix_scale',
|
|
260
|
-
matrix: mat4.create()
|
|
261
|
-
}
|
|
262
|
-
track.node.transformations.push(scaleTransformation)
|
|
263
|
-
}
|
|
264
|
-
|
|
265
|
-
if (track.path === 'rotation') {
|
|
266
|
-
let pivotMatrix: mat4 | undefined, pivotMatrixInverse: mat4 | undefined;
|
|
267
|
-
if(track.pivot) {
|
|
268
|
-
pivotMatrix = mat4.fromTranslation(mat4.create(), vec3.fromValues(track.pivot[0], track.pivot[1], track.pivot[2]));
|
|
269
|
-
pivotMatrixInverse = mat4.fromTranslation(mat4.create(), vec3.fromValues(-track.pivot[0], -track.pivot[1], -track.pivot[2]));
|
|
270
|
-
}
|
|
271
|
-
|
|
272
|
-
let quaternion: quat = quat.fromValues(track.values[j * 4 + 0], track.values[j * 4 + 1], track.values[j * 4 + 2], track.values[j * 4 + 3]);
|
|
273
|
-
const rotationMatrix = mat4.fromQuat(mat4.create(), quaternion);
|
|
274
|
-
if(pivotMatrix && pivotMatrixInverse) {
|
|
275
|
-
rotationTransformation.matrix = mat4.multiply(mat4.create(), mat4.multiply(mat4.create(), pivotMatrix, rotationMatrix), pivotMatrixInverse);
|
|
276
|
-
} else {
|
|
277
|
-
rotationTransformation.matrix = rotationMatrix;
|
|
278
|
-
}
|
|
279
|
-
} else if (track.path === 'translation') {
|
|
280
|
-
let vector: vec3 = vec3.fromValues(track.values[j * 3 + 0], track.values[j * 3 + 1], track.values[j * 3 + 2]);
|
|
281
|
-
translationTransformation.matrix = mat4.fromTranslation(mat4.create(), vector);
|
|
282
|
-
} else if (track.path === 'scale') {
|
|
283
|
-
let vector: vec3 = vec3.fromValues(track.values[j * 3 + 0], track.values[j * 3 + 1], track.values[j * 3 + 2]);
|
|
284
|
-
scaleTransformation.matrix = mat4.fromScaling(mat4.create(), vector);
|
|
285
|
-
} else if (track.path === 'weights') {
|
|
286
|
-
let weights: number[] = [];
|
|
287
|
-
const weightCount = track.values.length / track.times.length;
|
|
288
|
-
|
|
289
|
-
for(let l = 0; l < weightCount; l++)
|
|
290
|
-
weights.push(track.values[j * weightCount + l])
|
|
291
|
-
|
|
292
|
-
const applyWeights = (node: ITreeNode) => {
|
|
293
|
-
for(let l = 0; l < node.data.length; l++)
|
|
294
|
-
if(node.data[l] instanceof GeometryData && (<GeometryData>node.data[l]).morphWeights.length === weightCount)
|
|
295
|
-
(<GeometryData>node.data[l]).morphWeights = weights;
|
|
296
|
-
|
|
297
|
-
for (let l = 0; l < node.children.length; l++)
|
|
298
|
-
applyWeights(node.children[l])
|
|
299
|
-
}
|
|
300
|
-
applyWeights(track.node);
|
|
301
|
-
}
|
|
302
|
-
}
|
|
303
|
-
}
|
|
304
|
-
this.#animationTime = -1;
|
|
305
|
-
this.#started = false;
|
|
306
|
-
this.#animate = false;
|
|
307
|
-
}
|
|
308
|
-
|
|
309
|
-
// #endregion Public Methods (5)
|
|
310
|
-
}
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { AbstractTreeNodeData, ITreeNodeData } from '@shapediver/viewer.shared.node-tree'
|
|
2
|
-
import { IBoneData } from '../../interfaces/data/IBoneData';
|
|
3
|
-
|
|
4
|
-
export class BoneData extends AbstractTreeNodeData implements IBoneData {
|
|
5
|
-
|
|
6
|
-
// #region Constructors (1)
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* Creates a Bone data node.
|
|
10
|
-
*
|
|
11
|
-
* @param id the id
|
|
12
|
-
*/
|
|
13
|
-
constructor(
|
|
14
|
-
id?: string,
|
|
15
|
-
version?: string
|
|
16
|
-
) {
|
|
17
|
-
super(id, version);
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
// #endregion Constructors (1)
|
|
21
|
-
|
|
22
|
-
// #region Public Methods (1)
|
|
23
|
-
|
|
24
|
-
/**
|
|
25
|
-
* Clones the scene graph data.
|
|
26
|
-
*/
|
|
27
|
-
public clone(): IBoneData {
|
|
28
|
-
return new BoneData(this.id, this.version);
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
// #endregion Public Methods (1)
|
|
32
|
-
}
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
import { AbstractTreeNodeData, ITreeNodeData } from '@shapediver/viewer.shared.node-tree'
|
|
2
|
-
import { ICustomData } from '../../interfaces/data/ICustomData';
|
|
3
|
-
|
|
4
|
-
export class CustomData extends AbstractTreeNodeData implements ICustomData {
|
|
5
|
-
// #region Properties (1)
|
|
6
|
-
|
|
7
|
-
#data: { [key: string]: any };
|
|
8
|
-
|
|
9
|
-
// #endregion Properties (1)
|
|
10
|
-
|
|
11
|
-
// #region Constructors (1)
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
* Creates a custom data node.
|
|
15
|
-
*
|
|
16
|
-
* @param _data the data as key- value pairs
|
|
17
|
-
* @param id the id
|
|
18
|
-
*/
|
|
19
|
-
constructor(
|
|
20
|
-
data: { [key: string]: any },
|
|
21
|
-
id?: string,
|
|
22
|
-
version?: string
|
|
23
|
-
) {
|
|
24
|
-
super(id, version);
|
|
25
|
-
this.#data = data;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
// #endregion Constructors (1)
|
|
29
|
-
|
|
30
|
-
// #region Public Accessors (2)
|
|
31
|
-
|
|
32
|
-
public get data(): { [key: string]: any } {
|
|
33
|
-
return this.#data;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
public set data(value: { [key: string]: any }) {
|
|
37
|
-
this.#data = value;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
// #endregion Public Accessors (2)
|
|
41
|
-
|
|
42
|
-
// #region Public Methods (1)
|
|
43
|
-
|
|
44
|
-
/**
|
|
45
|
-
* Clones the scene graph data.
|
|
46
|
-
*/
|
|
47
|
-
public clone(): ICustomData {
|
|
48
|
-
return new CustomData({ ...this.data }, this.id, this.version);
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
// #endregion Public Methods (1)
|
|
52
|
-
}
|