@shapediver/viewer.shared.types 2.8.5 → 2.9.1
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 +21 -20
- package/dist/implementation/data/GeometryData.d.ts.map +1 -1
- package/dist/implementation/data/GeometryData.js +72 -67
- package/dist/implementation/data/GeometryData.js.map +1 -1
- package/dist/implementation/material/MaterialVariantsData.d.ts +2 -2
- package/dist/implementation/material/MaterialVariantsData.d.ts.map +1 -1
- package/dist/implementation/material/MaterialVariantsData.js +9 -9
- package/dist/implementation/material/MaterialVariantsData.js.map +1 -1
- package/dist/interfaces/data/IGeometryData.d.ts +9 -8
- package/dist/interfaces/data/IGeometryData.d.ts.map +1 -1
- package/dist/interfaces/data/material/IMaterialVariantsData.d.ts +2 -2
- package/dist/interfaces/data/material/IMaterialVariantsData.d.ts.map +1 -1
- package/dist/interfaces/events/ITaskEvent.d.ts +7 -1
- package/dist/interfaces/events/ITaskEvent.d.ts.map +1 -1
- package/dist/interfaces/events/ITaskEvent.js +7 -1
- package/dist/interfaces/events/ITaskEvent.js.map +1 -1
- package/package.json +6 -6
- package/src/implementation/data/GeometryData.ts +82 -75
- package/src/implementation/material/MaterialVariantsData.ts +8 -8
- package/src/interfaces/data/IGeometryData.ts +15 -14
- package/src/interfaces/data/material/IMaterialVariantsData.ts +2 -2
- package/src/interfaces/events/ITaskEvent.ts +7 -1
|
@@ -15,7 +15,7 @@ export declare class AttributeData extends AbstractTreeNodeData implements IAttr
|
|
|
15
15
|
* @param _stride the stride
|
|
16
16
|
* @param _normalized boolean if the data is normalized
|
|
17
17
|
*/
|
|
18
|
-
constructor(array: Int8Array | Uint8Array | Int16Array | Uint16Array | Uint32Array | Float32Array, itemSize: number, itemBytes: number, byteOffset: number, elementBytes: number, normalized: boolean, count: number, min?: number[], max?: number[], byteStride?: number, sparse?: boolean, sparseIndices?: Int8Array | Uint8Array | Int16Array | Uint16Array | Uint32Array | Float32Array, sparseValues?: Int8Array | Uint8Array | Int16Array | Uint16Array | Uint32Array | Float32Array, morphAttributeData?: IAttributeData[], id?: string, version?: string);
|
|
18
|
+
constructor(array: Int8Array | Uint8Array | Int16Array | Uint16Array | Uint32Array | Float32Array, itemSize: number, itemBytes: number, byteOffset: number, elementBytes: number, normalized: boolean, count: number, min?: number[], max?: number[], byteStride?: number, target?: number, sparse?: boolean, sparseIndices?: Int8Array | Uint8Array | Int16Array | Uint16Array | Uint32Array | Float32Array, sparseValues?: Int8Array | Uint8Array | Int16Array | Uint16Array | Uint32Array | Float32Array, morphAttributeData?: IAttributeData[], id?: string, version?: string);
|
|
19
19
|
get array(): Int8Array | Uint8Array | Int16Array | Uint16Array | Uint32Array | Float32Array;
|
|
20
20
|
get byteOffset(): number;
|
|
21
21
|
get byteStride(): number | undefined;
|
|
@@ -30,6 +30,7 @@ export declare class AttributeData extends AbstractTreeNodeData implements IAttr
|
|
|
30
30
|
get sparse(): boolean | undefined;
|
|
31
31
|
get sparseIndices(): Int8Array | Uint8Array | Int16Array | Uint16Array | Uint32Array | Float32Array | undefined;
|
|
32
32
|
get sparseValues(): Int8Array | Uint8Array | Int16Array | Uint16Array | Uint32Array | Float32Array | undefined;
|
|
33
|
+
get target(): number | undefined;
|
|
33
34
|
/**
|
|
34
35
|
* Clones the attribute data.
|
|
35
36
|
*/
|
|
@@ -45,28 +46,13 @@ export declare class PrimitiveData extends AbstractTreeNodeData implements IPrim
|
|
|
45
46
|
*/
|
|
46
47
|
constructor(attributes?: {
|
|
47
48
|
[key: string]: IAttributeData;
|
|
48
|
-
},
|
|
49
|
+
}, indices?: IAttributeData | null, id?: string, version?: string);
|
|
49
50
|
get attributes(): {
|
|
50
51
|
[key: string]: IAttributeData;
|
|
51
52
|
};
|
|
52
53
|
get boundingBox(): IBox;
|
|
53
54
|
get indices(): IAttributeData | null;
|
|
54
55
|
set indices(value: IAttributeData | null);
|
|
55
|
-
get standardMaterial(): IMaterialAbstractData | null;
|
|
56
|
-
set standardMaterial(value: IMaterialAbstractData | null);
|
|
57
|
-
get material(): IMaterialAbstractData | null;
|
|
58
|
-
set material(value: IMaterialAbstractData | null);
|
|
59
|
-
get effectMaterials(): {
|
|
60
|
-
material: IMaterialAbstractData;
|
|
61
|
-
token: string;
|
|
62
|
-
}[];
|
|
63
|
-
get materialVariants(): {
|
|
64
|
-
material: IMaterialAbstractData;
|
|
65
|
-
variant: number;
|
|
66
|
-
}[];
|
|
67
|
-
get attributeMaterial(): IMaterialAbstractData | null;
|
|
68
|
-
set attributeMaterial(value: IMaterialAbstractData | null);
|
|
69
|
-
get mode(): PRIMITIVE_MODE;
|
|
70
56
|
get threeJsObject(): {
|
|
71
57
|
[key: string]: THREE.BufferGeometry;
|
|
72
58
|
};
|
|
@@ -84,13 +70,28 @@ export declare class GeometryData extends AbstractTreeNodeData implements IGeome
|
|
|
84
70
|
* @param _primitive the primitive
|
|
85
71
|
* @param id the id
|
|
86
72
|
*/
|
|
87
|
-
constructor(primitive: IPrimitiveData, morphWeights?: number[], id?: string, version?: string);
|
|
73
|
+
constructor(primitive: IPrimitiveData, mode?: PRIMITIVE_MODE, material?: IMaterialAbstractData | null, morphWeights?: number[], attributeMaterial?: IMaterialAbstractData | null, id?: string, version?: string);
|
|
74
|
+
get attributeMaterial(): IMaterialAbstractData | null;
|
|
75
|
+
set attributeMaterial(value: IMaterialAbstractData | null);
|
|
88
76
|
get boundingBox(): IBox;
|
|
77
|
+
get effectMaterials(): {
|
|
78
|
+
material: IMaterialAbstractData;
|
|
79
|
+
token: string;
|
|
80
|
+
}[];
|
|
81
|
+
get material(): IMaterialAbstractData | null;
|
|
82
|
+
set material(value: IMaterialAbstractData | null);
|
|
83
|
+
get materialVariants(): {
|
|
84
|
+
material: IMaterialAbstractData;
|
|
85
|
+
variant: number;
|
|
86
|
+
}[];
|
|
87
|
+
get mode(): PRIMITIVE_MODE;
|
|
88
|
+
get morphWeights(): number[];
|
|
89
|
+
set morphWeights(value: number[]);
|
|
89
90
|
get primitive(): IPrimitiveData;
|
|
90
91
|
get renderOrder(): number;
|
|
91
92
|
set renderOrder(value: number);
|
|
92
|
-
get
|
|
93
|
-
set
|
|
93
|
+
get standardMaterial(): IMaterialAbstractData | null;
|
|
94
|
+
set standardMaterial(value: IMaterialAbstractData | null);
|
|
94
95
|
get threeJsObject(): {
|
|
95
96
|
[key: string]: THREE.Mesh | THREE.Points | THREE.LineSegments | THREE.LineLoop | THREE.Line;
|
|
96
97
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GeometryData.d.ts","sourceRoot":"","sources":["../../../src/implementation/data/GeometryData.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,IAAI,EAAQ,MAAM,WAAW,CAAA;AAC5C,OAAO,EAAE,oBAAoB,EAA4B,MAAM,qCAAqC,CAAA;AACpG,OAAO,EAAO,IAAI,EAAE,MAAM,gCAAgC,CAAA;AAC1D,OAAO,EAAE,cAAc,EAAE,aAAa,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,qCAAqC,CAAC;AACpH,OAAO,EAAE,qBAAqB,EAAE,MAAM,sDAAsD,CAAC;
|
|
1
|
+
{"version":3,"file":"GeometryData.d.ts","sourceRoot":"","sources":["../../../src/implementation/data/GeometryData.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,IAAI,EAAQ,MAAM,WAAW,CAAA;AAC5C,OAAO,EAAE,oBAAoB,EAA4B,MAAM,qCAAqC,CAAA;AACpG,OAAO,EAAO,IAAI,EAAE,MAAM,gCAAgC,CAAA;AAC1D,OAAO,EAAE,cAAc,EAAE,aAAa,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,qCAAqC,CAAC;AACpH,OAAO,EAAE,qBAAqB,EAAE,MAAM,sDAAsD,CAAC;AAE7F,qBAAa,aAAc,SAAQ,oBAAqB,YAAW,cAAc;;IAuB/E;;;;;;;;;OASG;gBAED,KAAK,EAAE,SAAS,GAAG,UAAU,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;IAED,IAAW,iBAAiB,CAAC,KAAK,EAAE,qBAAqB,GAAG,IAAI,EAE/D;IAED,IAAW,WAAW,IAAI,IAAI,CAE7B;IAED,IAAW,eAAe,IAAI;QAAE,QAAQ,EAAE,qBAAqB,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,EAAE,CAEjF;IAED,IAAW,QAAQ,IAAI,qBAAqB,GAAG,IAAI,CAElD;IAED,IAAW,QAAQ,CAAC,KAAK,EAAE,qBAAqB,GAAG,IAAI,EAEtD;IAED,IAAW,gBAAgB,IAAI;QAAE,QAAQ,EAAE,qBAAqB,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,EAAE,CAEpF;IAED,IAAW,IAAI,IAAI,cAAc,CAEhC;IAED,IAAW,YAAY,IAAI,MAAM,EAAE,CAElC;IAED,IAAW,YAAY,CAAC,KAAK,EAAE,MAAM,EAAE,EAEtC;IAED,IAAW,SAAS,IAAI,cAAc,CAErC;IAED,IAAW,WAAW,IAAI,MAAM,CAE/B;IAED,IAAW,WAAW,CAAC,KAAK,EAAE,MAAM,EAEnC;IAED,IAAW,gBAAgB,IAAI,qBAAqB,GAAG,IAAI,CAE1D;IAED,IAAW,gBAAgB,CAAC,KAAK,EAAE,qBAAqB,GAAG,IAAI,EAE9D;IAED,IAAW,aAAa,IAAI;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,KAAK,CAAC,IAAI,GAAG,KAAK,CAAC,MAAM,GAAG,KAAK,CAAC,YAAY,GAAG,KAAK,CAAC,QAAQ,GAAG,KAAK,CAAC,IAAI,CAAA;KAAE,CAE1H;IAMD;;OAEG;IACI,KAAK,IAAI,aAAa;IAItB,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,GAAG,MAAM,GAAG,IAAI;CAM/D"}
|
|
@@ -10,7 +10,7 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
|
|
|
10
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
11
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
12
12
|
};
|
|
13
|
-
var
|
|
13
|
+
var _AttributeData_array, _AttributeData_byteOffset, _AttributeData_byteStride, _AttributeData_count, _AttributeData_elementBytes, _AttributeData_itemBytes, _AttributeData_itemSize, _AttributeData_max, _AttributeData_min, _AttributeData_morphAttributeData, _AttributeData_normalized, _AttributeData_sparse, _AttributeData_sparseIndices, _AttributeData_sparseValues, _AttributeData_target, _PrimitiveData_attributes, _PrimitiveData_boundingBoxes, _PrimitiveData_indices, _PrimitiveData_threeJsObject, _GeometryData_mode, _GeometryData_primitive, _GeometryData_attributeMaterial, _GeometryData_boundingBox, _GeometryData_effectMaterials, _GeometryData_material, _GeometryData_materialVariants, _GeometryData_morphWeights, _GeometryData_renderOrder, _GeometryData_standardMaterial, _GeometryData_threeJsObject;
|
|
14
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
15
|
exports.GeometryData = exports.PrimitiveData = exports.AttributeData = void 0;
|
|
16
16
|
const gl_matrix_1 = require("gl-matrix");
|
|
@@ -18,7 +18,7 @@ const viewer_shared_node_tree_1 = require("@shapediver/viewer.shared.node-tree")
|
|
|
18
18
|
const viewer_shared_math_1 = require("@shapediver/viewer.shared.math");
|
|
19
19
|
const IGeometryData_1 = require("../../interfaces/data/IGeometryData");
|
|
20
20
|
class AttributeData extends viewer_shared_node_tree_1.AbstractTreeNodeData {
|
|
21
|
-
// #endregion Properties (
|
|
21
|
+
// #endregion Properties (15)
|
|
22
22
|
// #region Constructors (1)
|
|
23
23
|
/**
|
|
24
24
|
* Creates an attribute data object.
|
|
@@ -30,10 +30,9 @@ class AttributeData extends viewer_shared_node_tree_1.AbstractTreeNodeData {
|
|
|
30
30
|
* @param _stride the stride
|
|
31
31
|
* @param _normalized boolean if the data is normalized
|
|
32
32
|
*/
|
|
33
|
-
constructor(array, itemSize, itemBytes, byteOffset, elementBytes, normalized, count, min = [], max = [], byteStride, sparse, sparseIndices, sparseValues, morphAttributeData = [], id, version) {
|
|
33
|
+
constructor(array, itemSize, itemBytes, byteOffset, elementBytes, normalized, count, min = [], max = [], byteStride, target, sparse, sparseIndices, sparseValues, morphAttributeData = [], id, version) {
|
|
34
34
|
super(id, version);
|
|
35
|
-
// #region Properties (
|
|
36
|
-
_AttributeData_morphAttributeData.set(this, []);
|
|
35
|
+
// #region Properties (15)
|
|
37
36
|
_AttributeData_array.set(this, void 0);
|
|
38
37
|
_AttributeData_byteOffset.set(this, void 0);
|
|
39
38
|
_AttributeData_byteStride.set(this, void 0);
|
|
@@ -43,10 +42,12 @@ class AttributeData extends viewer_shared_node_tree_1.AbstractTreeNodeData {
|
|
|
43
42
|
_AttributeData_itemSize.set(this, void 0);
|
|
44
43
|
_AttributeData_max.set(this, []);
|
|
45
44
|
_AttributeData_min.set(this, []);
|
|
45
|
+
_AttributeData_morphAttributeData.set(this, []);
|
|
46
46
|
_AttributeData_normalized.set(this, void 0);
|
|
47
47
|
_AttributeData_sparse.set(this, void 0);
|
|
48
48
|
_AttributeData_sparseIndices.set(this, void 0);
|
|
49
49
|
_AttributeData_sparseValues.set(this, void 0);
|
|
50
|
+
_AttributeData_target.set(this, void 0);
|
|
50
51
|
__classPrivateFieldSet(this, _AttributeData_array, array, "f");
|
|
51
52
|
__classPrivateFieldSet(this, _AttributeData_itemSize, itemSize, "f");
|
|
52
53
|
__classPrivateFieldSet(this, _AttributeData_itemBytes, itemBytes, "f");
|
|
@@ -57,13 +58,14 @@ class AttributeData extends viewer_shared_node_tree_1.AbstractTreeNodeData {
|
|
|
57
58
|
__classPrivateFieldSet(this, _AttributeData_min, min, "f");
|
|
58
59
|
__classPrivateFieldSet(this, _AttributeData_max, max, "f");
|
|
59
60
|
__classPrivateFieldSet(this, _AttributeData_byteStride, byteStride, "f");
|
|
61
|
+
__classPrivateFieldSet(this, _AttributeData_target, target, "f");
|
|
60
62
|
__classPrivateFieldSet(this, _AttributeData_sparse, sparse, "f");
|
|
61
63
|
__classPrivateFieldSet(this, _AttributeData_sparseIndices, sparseIndices, "f");
|
|
62
64
|
__classPrivateFieldSet(this, _AttributeData_sparseValues, sparseValues, "f");
|
|
63
65
|
__classPrivateFieldSet(this, _AttributeData_morphAttributeData, morphAttributeData, "f");
|
|
64
66
|
}
|
|
65
67
|
// #endregion Constructors (1)
|
|
66
|
-
// #region Public Accessors (
|
|
68
|
+
// #region Public Accessors (15)
|
|
67
69
|
get array() {
|
|
68
70
|
return __classPrivateFieldGet(this, _AttributeData_array, "f");
|
|
69
71
|
}
|
|
@@ -106,19 +108,22 @@ class AttributeData extends viewer_shared_node_tree_1.AbstractTreeNodeData {
|
|
|
106
108
|
get sparseValues() {
|
|
107
109
|
return __classPrivateFieldGet(this, _AttributeData_sparseValues, "f");
|
|
108
110
|
}
|
|
109
|
-
|
|
111
|
+
get target() {
|
|
112
|
+
return __classPrivateFieldGet(this, _AttributeData_target, "f");
|
|
113
|
+
}
|
|
114
|
+
// #endregion Public Accessors (15)
|
|
110
115
|
// #region Public Methods (1)
|
|
111
116
|
/**
|
|
112
117
|
* Clones the attribute data.
|
|
113
118
|
*/
|
|
114
119
|
clone() {
|
|
115
|
-
return new AttributeData(__classPrivateFieldGet(this, _AttributeData_array, "f"), __classPrivateFieldGet(this, _AttributeData_itemSize, "f"), __classPrivateFieldGet(this, _AttributeData_itemBytes, "f"), __classPrivateFieldGet(this, _AttributeData_byteOffset, "f"), __classPrivateFieldGet(this, _AttributeData_elementBytes, "f"), __classPrivateFieldGet(this, _AttributeData_normalized, "f"), __classPrivateFieldGet(this, _AttributeData_count, "f"), __classPrivateFieldGet(this, _AttributeData_min, "f"), __classPrivateFieldGet(this, _AttributeData_max, "f"), __classPrivateFieldGet(this, _AttributeData_byteStride, "f"), __classPrivateFieldGet(this, _AttributeData_sparse, "f"), __classPrivateFieldGet(this, _AttributeData_sparseIndices, "f"), __classPrivateFieldGet(this, _AttributeData_sparseValues, "f"), __classPrivateFieldGet(this, _AttributeData_morphAttributeData, "f"), this.id, this.version);
|
|
120
|
+
return new AttributeData(__classPrivateFieldGet(this, _AttributeData_array, "f"), __classPrivateFieldGet(this, _AttributeData_itemSize, "f"), __classPrivateFieldGet(this, _AttributeData_itemBytes, "f"), __classPrivateFieldGet(this, _AttributeData_byteOffset, "f"), __classPrivateFieldGet(this, _AttributeData_elementBytes, "f"), __classPrivateFieldGet(this, _AttributeData_normalized, "f"), __classPrivateFieldGet(this, _AttributeData_count, "f"), __classPrivateFieldGet(this, _AttributeData_min, "f"), __classPrivateFieldGet(this, _AttributeData_max, "f"), __classPrivateFieldGet(this, _AttributeData_byteStride, "f"), __classPrivateFieldGet(this, _AttributeData_target, "f"), __classPrivateFieldGet(this, _AttributeData_sparse, "f"), __classPrivateFieldGet(this, _AttributeData_sparseIndices, "f"), __classPrivateFieldGet(this, _AttributeData_sparseValues, "f"), __classPrivateFieldGet(this, _AttributeData_morphAttributeData, "f"), this.id, this.version);
|
|
116
121
|
}
|
|
117
122
|
}
|
|
118
123
|
exports.AttributeData = AttributeData;
|
|
119
|
-
|
|
124
|
+
_AttributeData_array = new WeakMap(), _AttributeData_byteOffset = new WeakMap(), _AttributeData_byteStride = new WeakMap(), _AttributeData_count = new WeakMap(), _AttributeData_elementBytes = new WeakMap(), _AttributeData_itemBytes = new WeakMap(), _AttributeData_itemSize = new WeakMap(), _AttributeData_max = new WeakMap(), _AttributeData_min = new WeakMap(), _AttributeData_morphAttributeData = new WeakMap(), _AttributeData_normalized = new WeakMap(), _AttributeData_sparse = new WeakMap(), _AttributeData_sparseIndices = new WeakMap(), _AttributeData_sparseValues = new WeakMap(), _AttributeData_target = new WeakMap();
|
|
120
125
|
class PrimitiveData extends viewer_shared_node_tree_1.AbstractTreeNodeData {
|
|
121
|
-
// #endregion Properties (
|
|
126
|
+
// #endregion Properties (4)
|
|
122
127
|
// #region Constructors (1)
|
|
123
128
|
/**
|
|
124
129
|
* Creates a primitive data object.
|
|
@@ -126,28 +131,18 @@ class PrimitiveData extends viewer_shared_node_tree_1.AbstractTreeNodeData {
|
|
|
126
131
|
* @param _attributes the attributes as key-value pairs
|
|
127
132
|
* @param _indices the indices
|
|
128
133
|
*/
|
|
129
|
-
constructor(attributes = {},
|
|
134
|
+
constructor(attributes = {}, indices = null, id, version) {
|
|
130
135
|
super(id, version);
|
|
131
|
-
// #region Properties (
|
|
136
|
+
// #region Properties (4)
|
|
132
137
|
_PrimitiveData_attributes.set(this, {});
|
|
133
|
-
_PrimitiveData_mode.set(this, IGeometryData_1.PRIMITIVE_MODE.TRIANGLES);
|
|
134
138
|
_PrimitiveData_boundingBoxes.set(this, []);
|
|
135
139
|
_PrimitiveData_indices.set(this, null);
|
|
136
|
-
_PrimitiveData_material.set(this, null);
|
|
137
|
-
_PrimitiveData_standardMaterial.set(this, null);
|
|
138
|
-
_PrimitiveData_effectMaterials.set(this, []);
|
|
139
|
-
_PrimitiveData_materialVariants.set(this, []);
|
|
140
|
-
_PrimitiveData_attributeMaterial.set(this, null);
|
|
141
140
|
_PrimitiveData_threeJsObject.set(this, {});
|
|
142
141
|
__classPrivateFieldSet(this, _PrimitiveData_attributes, attributes, "f");
|
|
143
|
-
__classPrivateFieldSet(this, _PrimitiveData_mode, mode, "f");
|
|
144
142
|
__classPrivateFieldSet(this, _PrimitiveData_indices, indices, "f");
|
|
145
|
-
__classPrivateFieldSet(this, _PrimitiveData_material, material, "f");
|
|
146
|
-
__classPrivateFieldSet(this, _PrimitiveData_standardMaterial, material, "f");
|
|
147
|
-
__classPrivateFieldSet(this, _PrimitiveData_attributeMaterial, attributeMaterial, "f");
|
|
148
143
|
}
|
|
149
144
|
// #endregion Constructors (1)
|
|
150
|
-
// #region Public Accessors (
|
|
145
|
+
// #region Public Accessors (5)
|
|
151
146
|
get attributes() {
|
|
152
147
|
return __classPrivateFieldGet(this, _PrimitiveData_attributes, "f");
|
|
153
148
|
}
|
|
@@ -160,38 +155,11 @@ class PrimitiveData extends viewer_shared_node_tree_1.AbstractTreeNodeData {
|
|
|
160
155
|
set indices(value) {
|
|
161
156
|
__classPrivateFieldSet(this, _PrimitiveData_indices, value, "f");
|
|
162
157
|
}
|
|
163
|
-
get standardMaterial() {
|
|
164
|
-
return __classPrivateFieldGet(this, _PrimitiveData_standardMaterial, "f");
|
|
165
|
-
}
|
|
166
|
-
set standardMaterial(value) {
|
|
167
|
-
__classPrivateFieldSet(this, _PrimitiveData_standardMaterial, value, "f");
|
|
168
|
-
}
|
|
169
|
-
get material() {
|
|
170
|
-
return __classPrivateFieldGet(this, _PrimitiveData_material, "f");
|
|
171
|
-
}
|
|
172
|
-
set material(value) {
|
|
173
|
-
__classPrivateFieldSet(this, _PrimitiveData_material, value, "f");
|
|
174
|
-
}
|
|
175
|
-
get effectMaterials() {
|
|
176
|
-
return __classPrivateFieldGet(this, _PrimitiveData_effectMaterials, "f");
|
|
177
|
-
}
|
|
178
|
-
get materialVariants() {
|
|
179
|
-
return __classPrivateFieldGet(this, _PrimitiveData_materialVariants, "f");
|
|
180
|
-
}
|
|
181
|
-
get attributeMaterial() {
|
|
182
|
-
return __classPrivateFieldGet(this, _PrimitiveData_attributeMaterial, "f");
|
|
183
|
-
}
|
|
184
|
-
set attributeMaterial(value) {
|
|
185
|
-
__classPrivateFieldSet(this, _PrimitiveData_attributeMaterial, value, "f");
|
|
186
|
-
}
|
|
187
|
-
get mode() {
|
|
188
|
-
return __classPrivateFieldGet(this, _PrimitiveData_mode, "f");
|
|
189
|
-
}
|
|
190
158
|
get threeJsObject() {
|
|
191
159
|
return __classPrivateFieldGet(this, _PrimitiveData_threeJsObject, "f");
|
|
192
160
|
}
|
|
193
|
-
// #endregion Public Accessors (
|
|
194
|
-
// #region Public Methods (
|
|
161
|
+
// #endregion Public Accessors (5)
|
|
162
|
+
// #region Public Methods (2)
|
|
195
163
|
/**
|
|
196
164
|
* Clones the primitive data.
|
|
197
165
|
*/
|
|
@@ -199,7 +167,7 @@ class PrimitiveData extends viewer_shared_node_tree_1.AbstractTreeNodeData {
|
|
|
199
167
|
let attributes = {};
|
|
200
168
|
for (let attribute in __classPrivateFieldGet(this, _PrimitiveData_attributes, "f"))
|
|
201
169
|
attributes[attribute] = __classPrivateFieldGet(this, _PrimitiveData_attributes, "f")[attribute].clone();
|
|
202
|
-
return new PrimitiveData(attributes, __classPrivateFieldGet(this,
|
|
170
|
+
return new PrimitiveData(attributes, __classPrivateFieldGet(this, _PrimitiveData_indices, "f"), this.id, this.version);
|
|
203
171
|
}
|
|
204
172
|
computeBoundingBox(matrix) {
|
|
205
173
|
const res = __classPrivateFieldGet(this, _PrimitiveData_boundingBoxes, "f").find(b => gl_matrix_1.mat4.equals(matrix, b.matrix));
|
|
@@ -245,9 +213,9 @@ class PrimitiveData extends viewer_shared_node_tree_1.AbstractTreeNodeData {
|
|
|
245
213
|
}
|
|
246
214
|
}
|
|
247
215
|
exports.PrimitiveData = PrimitiveData;
|
|
248
|
-
_PrimitiveData_attributes = new WeakMap(),
|
|
216
|
+
_PrimitiveData_attributes = new WeakMap(), _PrimitiveData_boundingBoxes = new WeakMap(), _PrimitiveData_indices = new WeakMap(), _PrimitiveData_threeJsObject = new WeakMap();
|
|
249
217
|
class GeometryData extends viewer_shared_node_tree_1.AbstractTreeNodeData {
|
|
250
|
-
// #endregion Properties (
|
|
218
|
+
// #endregion Properties (11)
|
|
251
219
|
// #region Constructors (1)
|
|
252
220
|
/**
|
|
253
221
|
* Creates a geometry data object.
|
|
@@ -255,23 +223,60 @@ class GeometryData extends viewer_shared_node_tree_1.AbstractTreeNodeData {
|
|
|
255
223
|
* @param _primitive the primitive
|
|
256
224
|
* @param id the id
|
|
257
225
|
*/
|
|
258
|
-
constructor(primitive, morphWeights = [], id, version) {
|
|
226
|
+
constructor(primitive, mode = IGeometryData_1.PRIMITIVE_MODE.TRIANGLES, material = null, morphWeights = [], attributeMaterial = null, id, version) {
|
|
259
227
|
super(id, version);
|
|
260
|
-
// #region Properties (
|
|
228
|
+
// #region Properties (11)
|
|
229
|
+
_GeometryData_mode.set(this, IGeometryData_1.PRIMITIVE_MODE.TRIANGLES);
|
|
261
230
|
_GeometryData_primitive.set(this, void 0);
|
|
231
|
+
_GeometryData_attributeMaterial.set(this, null);
|
|
262
232
|
_GeometryData_boundingBox.set(this, new viewer_shared_math_1.Box());
|
|
263
|
-
|
|
233
|
+
_GeometryData_effectMaterials.set(this, []);
|
|
234
|
+
_GeometryData_material.set(this, null);
|
|
235
|
+
_GeometryData_materialVariants.set(this, []);
|
|
264
236
|
_GeometryData_morphWeights.set(this, []);
|
|
237
|
+
_GeometryData_renderOrder.set(this, 0);
|
|
238
|
+
_GeometryData_standardMaterial.set(this, null);
|
|
265
239
|
_GeometryData_threeJsObject.set(this, {});
|
|
266
240
|
__classPrivateFieldSet(this, _GeometryData_primitive, primitive, "f");
|
|
267
241
|
__classPrivateFieldSet(this, _GeometryData_boundingBox, this.primitive.boundingBox.clone(), "f");
|
|
268
242
|
__classPrivateFieldSet(this, _GeometryData_morphWeights, morphWeights, "f");
|
|
243
|
+
__classPrivateFieldSet(this, _GeometryData_mode, mode, "f");
|
|
244
|
+
__classPrivateFieldSet(this, _GeometryData_material, material, "f");
|
|
245
|
+
__classPrivateFieldSet(this, _GeometryData_standardMaterial, material, "f");
|
|
246
|
+
__classPrivateFieldSet(this, _GeometryData_attributeMaterial, attributeMaterial, "f");
|
|
269
247
|
}
|
|
270
248
|
// #endregion Constructors (1)
|
|
271
|
-
// #region Public Accessors (
|
|
249
|
+
// #region Public Accessors (16)
|
|
250
|
+
get attributeMaterial() {
|
|
251
|
+
return __classPrivateFieldGet(this, _GeometryData_attributeMaterial, "f");
|
|
252
|
+
}
|
|
253
|
+
set attributeMaterial(value) {
|
|
254
|
+
__classPrivateFieldSet(this, _GeometryData_attributeMaterial, value, "f");
|
|
255
|
+
}
|
|
272
256
|
get boundingBox() {
|
|
273
257
|
return __classPrivateFieldGet(this, _GeometryData_boundingBox, "f");
|
|
274
258
|
}
|
|
259
|
+
get effectMaterials() {
|
|
260
|
+
return __classPrivateFieldGet(this, _GeometryData_effectMaterials, "f");
|
|
261
|
+
}
|
|
262
|
+
get material() {
|
|
263
|
+
return __classPrivateFieldGet(this, _GeometryData_material, "f");
|
|
264
|
+
}
|
|
265
|
+
set material(value) {
|
|
266
|
+
__classPrivateFieldSet(this, _GeometryData_material, value, "f");
|
|
267
|
+
}
|
|
268
|
+
get materialVariants() {
|
|
269
|
+
return __classPrivateFieldGet(this, _GeometryData_materialVariants, "f");
|
|
270
|
+
}
|
|
271
|
+
get mode() {
|
|
272
|
+
return __classPrivateFieldGet(this, _GeometryData_mode, "f");
|
|
273
|
+
}
|
|
274
|
+
get morphWeights() {
|
|
275
|
+
return __classPrivateFieldGet(this, _GeometryData_morphWeights, "f");
|
|
276
|
+
}
|
|
277
|
+
set morphWeights(value) {
|
|
278
|
+
__classPrivateFieldSet(this, _GeometryData_morphWeights, value, "f");
|
|
279
|
+
}
|
|
275
280
|
get primitive() {
|
|
276
281
|
return __classPrivateFieldGet(this, _GeometryData_primitive, "f");
|
|
277
282
|
}
|
|
@@ -281,29 +286,29 @@ class GeometryData extends viewer_shared_node_tree_1.AbstractTreeNodeData {
|
|
|
281
286
|
set renderOrder(value) {
|
|
282
287
|
__classPrivateFieldSet(this, _GeometryData_renderOrder, value, "f");
|
|
283
288
|
}
|
|
284
|
-
get
|
|
285
|
-
return __classPrivateFieldGet(this,
|
|
289
|
+
get standardMaterial() {
|
|
290
|
+
return __classPrivateFieldGet(this, _GeometryData_standardMaterial, "f");
|
|
286
291
|
}
|
|
287
|
-
set
|
|
288
|
-
__classPrivateFieldSet(this,
|
|
292
|
+
set standardMaterial(value) {
|
|
293
|
+
__classPrivateFieldSet(this, _GeometryData_standardMaterial, value, "f");
|
|
289
294
|
}
|
|
290
295
|
get threeJsObject() {
|
|
291
296
|
return __classPrivateFieldGet(this, _GeometryData_threeJsObject, "f");
|
|
292
297
|
}
|
|
293
|
-
// #endregion Public Accessors (
|
|
298
|
+
// #endregion Public Accessors (16)
|
|
294
299
|
// #region Public Methods (2)
|
|
295
300
|
/**
|
|
296
301
|
* Clones the scene graph data.
|
|
297
302
|
*/
|
|
298
303
|
clone() {
|
|
299
|
-
return new GeometryData(__classPrivateFieldGet(this, _GeometryData_primitive, "f"), __classPrivateFieldGet(this,
|
|
304
|
+
return new GeometryData(__classPrivateFieldGet(this, _GeometryData_primitive, "f"), __classPrivateFieldGet(this, _GeometryData_mode, "f"), __classPrivateFieldGet(this, _GeometryData_material, "f"), __classPrivateFieldGet(this, _GeometryData_morphWeights, "f"), __classPrivateFieldGet(this, _GeometryData_attributeMaterial, "f"));
|
|
300
305
|
}
|
|
301
306
|
intersect(origin, direction) {
|
|
302
|
-
if (this.
|
|
307
|
+
if (this.mode !== IGeometryData_1.PRIMITIVE_MODE.TRIANGLES)
|
|
303
308
|
return null;
|
|
304
309
|
return this.boundingBox.intersect(origin, direction);
|
|
305
310
|
}
|
|
306
311
|
}
|
|
307
312
|
exports.GeometryData = GeometryData;
|
|
308
|
-
_GeometryData_primitive = new WeakMap(), _GeometryData_boundingBox = new WeakMap(),
|
|
313
|
+
_GeometryData_mode = new WeakMap(), _GeometryData_primitive = new WeakMap(), _GeometryData_attributeMaterial = new WeakMap(), _GeometryData_boundingBox = new WeakMap(), _GeometryData_effectMaterials = new WeakMap(), _GeometryData_material = new WeakMap(), _GeometryData_materialVariants = new WeakMap(), _GeometryData_morphWeights = new WeakMap(), _GeometryData_renderOrder = new WeakMap(), _GeometryData_standardMaterial = new WeakMap(), _GeometryData_threeJsObject = new WeakMap();
|
|
309
314
|
//# sourceMappingURL=GeometryData.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GeometryData.js","sourceRoot":"","sources":["../../../src/implementation/data/GeometryData.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,yCAA4C;AAC5C,iFAAoG;AACpG,uEAA0D;AAC1D,uEAAoH;
|
|
1
|
+
{"version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
1
1
|
import { AbstractTreeNodeData } from '@shapediver/viewer.shared.node-tree';
|
|
2
2
|
import { IMaterialVariantsData } from '../../interfaces/data/material/IMaterialVariantsData';
|
|
3
|
-
import {
|
|
3
|
+
import { GeometryData } from '../data/GeometryData';
|
|
4
4
|
export declare class MaterialVariantsData extends AbstractTreeNodeData implements IMaterialVariantsData {
|
|
5
5
|
#private;
|
|
6
6
|
constructor(id?: string, version?: string);
|
|
7
|
-
get
|
|
7
|
+
get geometryData(): GeometryData[];
|
|
8
8
|
get variants(): string[];
|
|
9
9
|
get variantIndex(): number | undefined;
|
|
10
10
|
set variantIndex(value: number | undefined);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MaterialVariantsData.d.ts","sourceRoot":"","sources":["../../../src/implementation/material/MaterialVariantsData.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAiB,MAAM,qCAAqC,CAAA;AACzF,OAAO,EAAE,qBAAqB,EAAE,MAAM,sDAAsD,CAAC;AAC7F,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"MaterialVariantsData.d.ts","sourceRoot":"","sources":["../../../src/implementation/material/MaterialVariantsData.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAiB,MAAM,qCAAqC,CAAA;AACzF,OAAO,EAAE,qBAAqB,EAAE,MAAM,sDAAsD,CAAC;AAC7F,OAAO,EAAE,YAAY,EAAiB,MAAM,sBAAsB,CAAC;AAEnE,qBAAa,oBAAqB,SAAQ,oBAAqB,YAAW,qBAAqB;;gBAW/E,EAAE,CAAC,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM;IAQzC,IAAW,YAAY,IAAI,YAAY,EAAE,CAExC;IAED,IAAW,QAAQ,IAAI,MAAM,EAAE,CAE9B;IAED,IAAW,YAAY,IAAI,MAAM,GAAG,SAAS,CAE5C;IAED,IAAW,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,EAUhD;IAMD;;OAEG;IACI,KAAK,IAAI,qBAAqB;CAKxC"}
|
|
@@ -10,7 +10,7 @@ var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (
|
|
|
10
10
|
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");
|
|
11
11
|
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
12
12
|
};
|
|
13
|
-
var _MaterialVariantsData_variants,
|
|
13
|
+
var _MaterialVariantsData_variants, _MaterialVariantsData_geometryData, _MaterialVariantsData_variantIndex;
|
|
14
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
15
|
exports.MaterialVariantsData = void 0;
|
|
16
16
|
const viewer_shared_node_tree_1 = require("@shapediver/viewer.shared.node-tree");
|
|
@@ -21,13 +21,13 @@ class MaterialVariantsData extends viewer_shared_node_tree_1.AbstractTreeNodeDat
|
|
|
21
21
|
super(id, version);
|
|
22
22
|
// #region Properties (1)
|
|
23
23
|
_MaterialVariantsData_variants.set(this, []);
|
|
24
|
-
|
|
24
|
+
_MaterialVariantsData_geometryData.set(this, []);
|
|
25
25
|
_MaterialVariantsData_variantIndex.set(this, void 0);
|
|
26
26
|
}
|
|
27
27
|
// #endregion Constructors (1)
|
|
28
28
|
// #region Public Accessors (2)
|
|
29
|
-
get
|
|
30
|
-
return __classPrivateFieldGet(this,
|
|
29
|
+
get geometryData() {
|
|
30
|
+
return __classPrivateFieldGet(this, _MaterialVariantsData_geometryData, "f");
|
|
31
31
|
}
|
|
32
32
|
get variants() {
|
|
33
33
|
return __classPrivateFieldGet(this, _MaterialVariantsData_variants, "f");
|
|
@@ -37,13 +37,13 @@ class MaterialVariantsData extends viewer_shared_node_tree_1.AbstractTreeNodeDat
|
|
|
37
37
|
}
|
|
38
38
|
set variantIndex(value) {
|
|
39
39
|
__classPrivateFieldSet(this, _MaterialVariantsData_variantIndex, value, "f");
|
|
40
|
-
for (let i = 0; i < this.
|
|
41
|
-
const variant = this.
|
|
40
|
+
for (let i = 0; i < this.geometryData.length; i++) {
|
|
41
|
+
const variant = this.geometryData[i].materialVariants.find(v => v.variant === __classPrivateFieldGet(this, _MaterialVariantsData_variantIndex, "f"));
|
|
42
42
|
if (variant) {
|
|
43
|
-
this.
|
|
43
|
+
this.geometryData[i].material = variant.material;
|
|
44
44
|
}
|
|
45
45
|
else {
|
|
46
|
-
this.
|
|
46
|
+
this.geometryData[i].material = this.geometryData[i].standardMaterial;
|
|
47
47
|
}
|
|
48
48
|
}
|
|
49
49
|
}
|
|
@@ -57,5 +57,5 @@ class MaterialVariantsData extends viewer_shared_node_tree_1.AbstractTreeNodeDat
|
|
|
57
57
|
}
|
|
58
58
|
}
|
|
59
59
|
exports.MaterialVariantsData = MaterialVariantsData;
|
|
60
|
-
_MaterialVariantsData_variants = new WeakMap(),
|
|
60
|
+
_MaterialVariantsData_variants = new WeakMap(), _MaterialVariantsData_geometryData = new WeakMap(), _MaterialVariantsData_variantIndex = new WeakMap();
|
|
61
61
|
//# sourceMappingURL=MaterialVariantsData.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MaterialVariantsData.js","sourceRoot":"","sources":["../../../src/implementation/material/MaterialVariantsData.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,iFAAyF;AAIzF,MAAa,oBAAqB,SAAQ,8CAAoB;IAO1D,4BAA4B;IAE5B,2BAA2B;IAE3B,YAAY,EAAW,EAAE,OAAgB;QACrC,KAAK,CAAC,EAAE,EAAE,OAAO,CAAC,CAAC;QAXvB,yBAAyB;QAEzB,yCAA+B,EAAE,EAAC;QAClC,
|
|
1
|
+
{"version":3,"file":"MaterialVariantsData.js","sourceRoot":"","sources":["../../../src/implementation/material/MaterialVariantsData.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,iFAAyF;AAIzF,MAAa,oBAAqB,SAAQ,8CAAoB;IAO1D,4BAA4B;IAE5B,2BAA2B;IAE3B,YAAY,EAA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ttributeData extends ITreeNodeData {
|
|
|
26
26
|
readonly sparse?: boolean;
|
|
27
27
|
readonly sparseIndices?: Int8Array | Uint8Array | Int16Array | Uint16Array | Uint32Array | Float32Array;
|
|
28
28
|
readonly sparseValues?: Int8Array | Uint8Array | Int16Array | Uint16Array | Uint32Array | Float32Array;
|
|
29
|
+
readonly target: number | undefined;
|
|
29
30
|
clone(): IAttributeData;
|
|
30
31
|
}
|
|
31
32
|
export interface IPrimitiveData extends ITreeNodeData {
|
|
32
33
|
readonly attributes: {
|
|
33
34
|
[key: string]: IAttributeData;
|
|
34
35
|
};
|
|
36
|
+
boundingBox: IBox;
|
|
37
|
+
indices: IAttributeData | null;
|
|
38
|
+
clone(): IPrimitiveData;
|
|
39
|
+
computeBoundingBox(matrix: mat4): IBox;
|
|
40
|
+
}
|
|
41
|
+
export interface IGeometryData extends ITreeNodeData {
|
|
35
42
|
readonly mode: PRIMITIVE_MODE;
|
|
43
|
+
readonly primitive: IPrimitiveData;
|
|
36
44
|
attributeMaterial: IMaterialAbstractData | null;
|
|
37
45
|
boundingBox: IBox;
|
|
38
46
|
effectMaterials: {
|
|
39
47
|
material: IMaterialAbstractData;
|
|
40
48
|
token: string;
|
|
41
49
|
}[];
|
|
42
|
-
indices: IAttributeData | null;
|
|
43
50
|
material: IMaterialAbstractData | null;
|
|
44
51
|
materialVariants: {
|
|
45
52
|
material: IMaterialAbstractData;
|
|
46
53
|
variant: number;
|
|
47
54
|
}[];
|
|
48
|
-
standardMaterial: IMaterialAbstractData | null;
|
|
49
|
-
clone(): IPrimitiveData;
|
|
50
|
-
computeBoundingBox(matrix: mat4): IBox;
|
|
51
|
-
}
|
|
52
|
-
export interface IGeometryData extends ITreeNodeData {
|
|
53
|
-
readonly primitive: IPrimitiveData;
|
|
54
|
-
boundingBox: IBox;
|
|
55
55
|
morphWeights: number[];
|
|
56
56
|
renderOrder: number;
|
|
57
57
|
skinNode?: ITreeNode;
|
|
58
|
+
standardMaterial: IMaterialAbstractData | null;
|
|
58
59
|
clone(): IGeometryData;
|
|
59
60
|
}
|
|
60
61
|
//# sourceMappingURL=IGeometryData.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IGeometryData.d.ts","sourceRoot":"","sources":["../../../src/interfaces/data/IGeometryData.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,qCAAqC,CAAC;AAC/E,OAAO,EAAE,IAAI,EAAE,MAAM,gCAAgC,CAAC;AACtD,OAAO,EAAE,qBAAqB,EAAE,MAAM,kCAAkC,CAAC;AACzE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEjC,oBAAY,cAAc;IACtB,MAAM,IAAI;IACV,KAAK,IAAI;IACT,SAAS,IAAI;IACb,UAAU,IAAI;IACd,SAAS,IAAI;IACb,cAAc,IAAI;IAClB,YAAY,IAAI;CACnB;AAED,MAAM,WAAW,cAAe,SAAQ,aAAa;IAGjD,QAAQ,CAAC,KAAK,EAAE,SAAS,GAAG,UAAU,GAAG,UAAU,GAAG,WAAW,GAAG,WAAW,GAAG,YAAY,CAAC;IAC/F,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,GAAG,EAAE,MAAM,EAAE,CAAC;IACvB,QAAQ,CAAC,GAAG,EAAE,MAAM,EAAE,CAAC;IACvB,QAAQ,CAAC,kBAAkB,EAAE,cAAc,EAAE,CAAC;IAC9C,QAAQ,CAAC,UAAU,EAAE,OAAO,CAAC;IAC7B,QAAQ,CAAC,MAAM,CAAC,EAAE,OAAO,CAAC;IAC1B,QA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AAQ,CAAC,EAAE,SAAS,CAAC;IACrB,gBAAgB,EAAE,qBAAqB,GAAG,IAAI,CAAC;IAM/C,KAAK,IAAI,aAAa,CAAC;CAG1B"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ITreeNodeData } from "@shapediver/viewer.shared.node-tree";
|
|
2
|
-
import {
|
|
2
|
+
import { IGeometryData } from "../IGeometryData";
|
|
3
3
|
export interface IMaterialVariantsData extends ITreeNodeData {
|
|
4
|
-
readonly
|
|
4
|
+
readonly geometryData: IGeometryData[];
|
|
5
5
|
readonly variants: string[];
|
|
6
6
|
variantIndex?: number;
|
|
7
7
|
clone(): IMaterialVariantsData;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IMaterialVariantsData.d.ts","sourceRoot":"","sources":["../../../../src/interfaces/data/material/IMaterialVariantsData.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,qCAAqC,CAAC;AACpE,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"IMaterialVariantsData.d.ts","sourceRoot":"","sources":["../../../../src/interfaces/data/material/IMaterialVariantsData.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,qCAAqC,CAAC;AACpE,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEjD,MAAM,WAAW,qBAAsB,SAAQ,aAAa;IAGxD,QAAQ,CAAC,YAAY,EAAE,aAAa,EAAE,CAAC;IACvC,QAAQ,CAAC,QAAQ,EAAE,MAAM,EAAE,CAAC;IAE5B,YAAY,CAAC,EAAE,MAAM,CAAC;IAMtB,KAAK,IAAI,qBAAqB,CAAC;CAGlC"}
|
|
@@ -2,10 +2,16 @@ import { IEvent } from "@shapediver/viewer.shared.services";
|
|
|
2
2
|
export declare enum TASK_TYPE {
|
|
3
3
|
AR_LOADING = "ar_loading",
|
|
4
4
|
ENVIRONMENT_MAP_LOADING = "environment_map_loading",
|
|
5
|
+
CUSTOM_CONTENT_LOADING = "custom_content_loading",
|
|
6
|
+
GLTF_CREATION = "gltf_creation",
|
|
7
|
+
GLTF_CONTENT_LOADING = "gltf_content_loading",
|
|
8
|
+
MATERIAL_CONTENT_LOADING = "material_content_loading",
|
|
9
|
+
TAG_CONTENT_LOADING = "tag_content_loading",
|
|
10
|
+
SDTF_CONTENT_LOADING = "sdtf_content_loading",
|
|
5
11
|
SESSION_CUSTOMIZATION = "session_customization",
|
|
6
12
|
SESSION_CREATION = "session_creation",
|
|
7
|
-
SESSION_INITIAL_OUTPUTS_LOADED = "session_initial_outputs_loaded",
|
|
8
13
|
SESSION_OUTPUTS_UPDATE = "session_outputs_update",
|
|
14
|
+
SESSION_OUTPUTS_LOADING = "session_outputs_loading",
|
|
9
15
|
VIEWPORT_CREATION = "viewer_creation",
|
|
10
16
|
EXPORT_REQUEST = "export_request"
|
|
11
17
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ITaskEvent.d.ts","sourceRoot":"","sources":["../../../src/interfaces/events/ITaskEvent.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,oCAAoC,CAAC;AAE5D,oBAAY,SAAS;IACjB,UAAU,eAAe;IACzB,uBAAuB,4BAA4B;IACnD,qBAAqB,0BAA0B;IAC/C,gBAAgB,qBAAqB;IACrC,
|
|
1
|
+
{"version":3,"file":"ITaskEvent.d.ts","sourceRoot":"","sources":["../../../src/interfaces/events/ITaskEvent.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,oCAAoC,CAAC;AAE5D,oBAAY,SAAS;IACjB,UAAU,eAAe;IACzB,uBAAuB,4BAA4B;IACnD,sBAAsB,2BAA2B;IACjD,aAAa,kBAAkB;IAC/B,oBAAoB,yBAAyB;IAC7C,wBAAwB,6BAA6B;IACrD,mBAAmB,wBAAwB;IAC3C,oBAAoB,yBAAyB;IAC7C,qBAAqB,0BAA0B;IAC/C,gBAAgB,qBAAqB;IACrC,sBAAsB,2BAA2B;IACjD,uBAAuB,4BAA4B;IACnD,iBAAiB,oBAAoB;IACrC,cAAc,mBAAmB;CACpC;AAED,MAAM,WAAW,UAAW,SAAQ,MAAM;IACtC,IAAI,EAAE,SAAS,CAAC;IAChB,EAAE,EAAE,MAAM,CAAC;IACX,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,CAAC,EAAE,GAAG,CAAC;IACX,MAAM,CAAC,EAAE,MAAM,CAAA;CAClB"}
|
|
@@ -5,10 +5,16 @@ var TASK_TYPE;
|
|
|
5
5
|
(function (TASK_TYPE) {
|
|
6
6
|
TASK_TYPE["AR_LOADING"] = "ar_loading";
|
|
7
7
|
TASK_TYPE["ENVIRONMENT_MAP_LOADING"] = "environment_map_loading";
|
|
8
|
+
TASK_TYPE["CUSTOM_CONTENT_LOADING"] = "custom_content_loading";
|
|
9
|
+
TASK_TYPE["GLTF_CREATION"] = "gltf_creation";
|
|
10
|
+
TASK_TYPE["GLTF_CONTENT_LOADING"] = "gltf_content_loading";
|
|
11
|
+
TASK_TYPE["MATERIAL_CONTENT_LOADING"] = "material_content_loading";
|
|
12
|
+
TASK_TYPE["TAG_CONTENT_LOADING"] = "tag_content_loading";
|
|
13
|
+
TASK_TYPE["SDTF_CONTENT_LOADING"] = "sdtf_content_loading";
|
|
8
14
|
TASK_TYPE["SESSION_CUSTOMIZATION"] = "session_customization";
|
|
9
15
|
TASK_TYPE["SESSION_CREATION"] = "session_creation";
|
|
10
|
-
TASK_TYPE["SESSION_INITIAL_OUTPUTS_LOADED"] = "session_initial_outputs_loaded";
|
|
11
16
|
TASK_TYPE["SESSION_OUTPUTS_UPDATE"] = "session_outputs_update";
|
|
17
|
+
TASK_TYPE["SESSION_OUTPUTS_LOADING"] = "session_outputs_loading";
|
|
12
18
|
TASK_TYPE["VIEWPORT_CREATION"] = "viewer_creation";
|
|
13
19
|
TASK_TYPE["EXPORT_REQUEST"] = "export_request";
|
|
14
20
|
})(TASK_TYPE = exports.TASK_TYPE || (exports.TASK_TYPE = {}));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ITaskEvent.js","sourceRoot":"","sources":["../../../src/interfaces/events/ITaskEvent.ts"],"names":[],"mappings":";;;AAEA,IAAY,
|
|
1
|
+
{"version":3,"file":"ITaskEvent.js","sourceRoot":"","sources":["../../../src/interfaces/events/ITaskEvent.ts"],"names":[],"mappings":";;;AAEA,IAAY,SAeX;AAfD,WAAY,SAAS;IACjB,sCAAyB,CAAA;IACzB,gEAAmD,CAAA;IACnD,8DAAiD,CAAA;IACjD,4CAA+B,CAAA;IAC/B,0DAA6C,CAAA;IAC7C,kEAAqD,CAAA;IACrD,wDAA2C,CAAA;IAC3C,0DAA6C,CAAA;IAC7C,4DAA+C,CAAA;IAC/C,kDAAqC,CAAA;IACrC,8DAAiD,CAAA;IACjD,gEAAmD,CAAA;IACnD,kDAAqC,CAAA;IACrC,8CAAiC,CAAA;AACrC,CAAC,EAfW,SAAS,GAAT,iBAAS,KAAT,iBAAS,QAepB"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@shapediver/viewer.shared.types",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.9.1",
|
|
4
4
|
"description": "",
|
|
5
5
|
"keywords": [],
|
|
6
6
|
"author": "Michael Oppitz <michael@shapediver.com>",
|
|
@@ -39,11 +39,11 @@
|
|
|
39
39
|
"testEnvironment": "node"
|
|
40
40
|
},
|
|
41
41
|
"dependencies": {
|
|
42
|
-
"@shapediver/sdk.sdtf-v1": "1.
|
|
43
|
-
"@shapediver/viewer.shared.math": "2.
|
|
44
|
-
"@shapediver/viewer.shared.node-tree": "2.
|
|
45
|
-
"@shapediver/viewer.shared.services": "2.
|
|
42
|
+
"@shapediver/sdk.sdtf-v1": "1.3.1",
|
|
43
|
+
"@shapediver/viewer.shared.math": "2.9.1",
|
|
44
|
+
"@shapediver/viewer.shared.node-tree": "2.9.1",
|
|
45
|
+
"@shapediver/viewer.shared.services": "2.9.1",
|
|
46
46
|
"gl-matrix": "3.3.0"
|
|
47
47
|
},
|
|
48
|
-
"gitHead": "
|
|
48
|
+
"gitHead": "c7b6d22d492066831588ca0e9ce66844b921dc6f"
|
|
49
49
|
}
|
|
@@ -4,11 +4,9 @@ import { Box, IBox } from '@shapediver/viewer.shared.math'
|
|
|
4
4
|
import { IAttributeData, IGeometryData, IPrimitiveData, PRIMITIVE_MODE } from '../../interfaces/data/IGeometryData';
|
|
5
5
|
import { IMaterialAbstractData } from '../../interfaces/data/material/IMaterialAbstractData';
|
|
6
6
|
|
|
7
|
-
|
|
8
7
|
export class AttributeData extends AbstractTreeNodeData implements IAttributeData {
|
|
9
|
-
// #region Properties (
|
|
8
|
+
// #region Properties (15)
|
|
10
9
|
|
|
11
|
-
readonly #morphAttributeData: IAttributeData[] = [];
|
|
12
10
|
readonly #array: Int8Array | Uint8Array | Int16Array | Uint16Array | Uint32Array | Float32Array;
|
|
13
11
|
readonly #byteOffset: number;
|
|
14
12
|
readonly #byteStride?: number;
|
|
@@ -18,12 +16,14 @@ export class AttributeData extends AbstractTreeNodeData implements IAttributeDat
|
|
|
18
16
|
readonly #itemSize: number;
|
|
19
17
|
readonly #max: number[] = [];
|
|
20
18
|
readonly #min: number[] = [];
|
|
19
|
+
readonly #morphAttributeData: IAttributeData[] = [];
|
|
21
20
|
readonly #normalized: boolean;
|
|
22
21
|
readonly #sparse?: boolean;
|
|
23
22
|
readonly #sparseIndices?: Int8Array | Uint8Array | Int16Array | Uint16Array | Uint32Array | Float32Array;
|
|
24
23
|
readonly #sparseValues?: Int8Array | Uint8Array | Int16Array | Uint16Array | Uint32Array | Float32Array;
|
|
24
|
+
readonly #target?: number;
|
|
25
25
|
|
|
26
|
-
// #endregion Properties (
|
|
26
|
+
// #endregion Properties (15)
|
|
27
27
|
|
|
28
28
|
// #region Constructors (1)
|
|
29
29
|
|
|
@@ -48,6 +48,7 @@ export class AttributeData extends AbstractTreeNodeData implements IAttributeDat
|
|
|
48
48
|
min: number[] = [],
|
|
49
49
|
max: number[] = [],
|
|
50
50
|
byteStride?: number,
|
|
51
|
+
target?: number,
|
|
51
52
|
sparse?: boolean,
|
|
52
53
|
sparseIndices?: Int8Array | Uint8Array | Int16Array | Uint16Array | Uint32Array | Float32Array,
|
|
53
54
|
sparseValues?: Int8Array | Uint8Array | Int16Array | Uint16Array | Uint32Array | Float32Array,
|
|
@@ -66,6 +67,7 @@ export class AttributeData extends AbstractTreeNodeData implements IAttributeDat
|
|
|
66
67
|
this.#min = min;
|
|
67
68
|
this.#max = max;
|
|
68
69
|
this.#byteStride = byteStride;
|
|
70
|
+
this.#target = target;
|
|
69
71
|
this.#sparse = sparse;
|
|
70
72
|
this.#sparseIndices = sparseIndices;
|
|
71
73
|
this.#sparseValues = sparseValues;
|
|
@@ -74,7 +76,7 @@ export class AttributeData extends AbstractTreeNodeData implements IAttributeDat
|
|
|
74
76
|
|
|
75
77
|
// #endregion Constructors (1)
|
|
76
78
|
|
|
77
|
-
// #region Public Accessors (
|
|
79
|
+
// #region Public Accessors (15)
|
|
78
80
|
|
|
79
81
|
public get array(): Int8Array | Uint8Array | Int16Array | Uint16Array | Uint32Array | Float32Array {
|
|
80
82
|
return this.#array;
|
|
@@ -132,7 +134,11 @@ export class AttributeData extends AbstractTreeNodeData implements IAttributeDat
|
|
|
132
134
|
return this.#sparseValues;
|
|
133
135
|
}
|
|
134
136
|
|
|
135
|
-
|
|
137
|
+
public get target(): number | undefined {
|
|
138
|
+
return this.#target;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
// #endregion Public Accessors (15)
|
|
136
142
|
|
|
137
143
|
// #region Public Methods (1)
|
|
138
144
|
|
|
@@ -151,6 +157,7 @@ export class AttributeData extends AbstractTreeNodeData implements IAttributeDat
|
|
|
151
157
|
this.#min,
|
|
152
158
|
this.#max,
|
|
153
159
|
this.#byteStride,
|
|
160
|
+
this.#target,
|
|
154
161
|
this.#sparse,
|
|
155
162
|
this.#sparseIndices,
|
|
156
163
|
this.#sparseValues,
|
|
@@ -164,26 +171,20 @@ export class AttributeData extends AbstractTreeNodeData implements IAttributeDat
|
|
|
164
171
|
}
|
|
165
172
|
|
|
166
173
|
export class PrimitiveData extends AbstractTreeNodeData implements IPrimitiveData {
|
|
167
|
-
// #region Properties (
|
|
174
|
+
// #region Properties (4)
|
|
168
175
|
|
|
169
176
|
readonly #attributes: {
|
|
170
177
|
[key: string]: IAttributeData
|
|
171
178
|
} = {};
|
|
172
|
-
readonly #mode: PRIMITIVE_MODE = PRIMITIVE_MODE.TRIANGLES;
|
|
173
179
|
|
|
174
180
|
#boundingBoxes: {
|
|
175
181
|
matrix: mat4,
|
|
176
182
|
boundingBox: IBox
|
|
177
183
|
}[] = [];
|
|
178
184
|
#indices: IAttributeData | null = null;
|
|
179
|
-
#material: IMaterialAbstractData | null = null;
|
|
180
|
-
#standardMaterial: IMaterialAbstractData | null = null;
|
|
181
|
-
#effectMaterials: { material: IMaterialAbstractData, token: string }[] = [];
|
|
182
|
-
#materialVariants: { material: IMaterialAbstractData, variant: number }[] = [];
|
|
183
|
-
#attributeMaterial: IMaterialAbstractData | null = null;
|
|
184
185
|
#threeJsObject: { [key: string]: THREE.BufferGeometry } = {};
|
|
185
186
|
|
|
186
|
-
// #endregion Properties (
|
|
187
|
+
// #endregion Properties (4)
|
|
187
188
|
|
|
188
189
|
// #region Constructors (1)
|
|
189
190
|
|
|
@@ -197,26 +198,18 @@ export class PrimitiveData extends AbstractTreeNodeData implements IPrimitiveDat
|
|
|
197
198
|
attributes: {
|
|
198
199
|
[key: string]: IAttributeData
|
|
199
200
|
} = {},
|
|
200
|
-
mode: PRIMITIVE_MODE = PRIMITIVE_MODE.TRIANGLES,
|
|
201
201
|
indices: IAttributeData | null = null,
|
|
202
|
-
material: IMaterialAbstractData | null = null,
|
|
203
|
-
attributeMaterial: IMaterialAbstractData | null = null,
|
|
204
202
|
id?: string,
|
|
205
203
|
version?: string
|
|
206
204
|
) {
|
|
207
205
|
super(id, version);
|
|
208
206
|
this.#attributes = attributes;
|
|
209
|
-
this.#mode = mode;
|
|
210
|
-
|
|
211
207
|
this.#indices = indices;
|
|
212
|
-
this.#material = material;
|
|
213
|
-
this.#standardMaterial = material;
|
|
214
|
-
this.#attributeMaterial = attributeMaterial;
|
|
215
208
|
}
|
|
216
209
|
|
|
217
210
|
// #endregion Constructors (1)
|
|
218
211
|
|
|
219
|
-
// #region Public Accessors (
|
|
212
|
+
// #region Public Accessors (5)
|
|
220
213
|
|
|
221
214
|
public get attributes(): {
|
|
222
215
|
[key: string]: IAttributeData
|
|
@@ -236,49 +229,13 @@ export class PrimitiveData extends AbstractTreeNodeData implements IPrimitiveDat
|
|
|
236
229
|
this.#indices = value
|
|
237
230
|
}
|
|
238
231
|
|
|
239
|
-
public get standardMaterial(): IMaterialAbstractData | null {
|
|
240
|
-
return this.#standardMaterial;
|
|
241
|
-
}
|
|
242
|
-
|
|
243
|
-
public set standardMaterial(value: IMaterialAbstractData | null) {
|
|
244
|
-
this.#standardMaterial = value;
|
|
245
|
-
}
|
|
246
|
-
|
|
247
|
-
public get material(): IMaterialAbstractData | null {
|
|
248
|
-
return this.#material;
|
|
249
|
-
}
|
|
250
|
-
|
|
251
|
-
public set material(value: IMaterialAbstractData | null) {
|
|
252
|
-
this.#material = value;
|
|
253
|
-
}
|
|
254
|
-
|
|
255
|
-
public get effectMaterials(): { material: IMaterialAbstractData, token: string }[] {
|
|
256
|
-
return this.#effectMaterials;
|
|
257
|
-
}
|
|
258
|
-
|
|
259
|
-
public get materialVariants(): { material: IMaterialAbstractData, variant: number }[] {
|
|
260
|
-
return this.#materialVariants;
|
|
261
|
-
}
|
|
262
|
-
|
|
263
|
-
public get attributeMaterial(): IMaterialAbstractData | null {
|
|
264
|
-
return this.#attributeMaterial;
|
|
265
|
-
}
|
|
266
|
-
|
|
267
|
-
public set attributeMaterial(value: IMaterialAbstractData | null) {
|
|
268
|
-
this.#attributeMaterial = value;
|
|
269
|
-
}
|
|
270
|
-
|
|
271
|
-
public get mode(): PRIMITIVE_MODE {
|
|
272
|
-
return this.#mode;
|
|
273
|
-
}
|
|
274
|
-
|
|
275
232
|
public get threeJsObject(): { [key: string]: THREE.BufferGeometry } {
|
|
276
233
|
return this.#threeJsObject;
|
|
277
234
|
}
|
|
278
235
|
|
|
279
|
-
// #endregion Public Accessors (
|
|
236
|
+
// #endregion Public Accessors (5)
|
|
280
237
|
|
|
281
|
-
// #region Public Methods (
|
|
238
|
+
// #region Public Methods (2)
|
|
282
239
|
|
|
283
240
|
/**
|
|
284
241
|
* Clones the primitive data.
|
|
@@ -290,7 +247,7 @@ export class PrimitiveData extends AbstractTreeNodeData implements IPrimitiveDat
|
|
|
290
247
|
for (let attribute in this.#attributes)
|
|
291
248
|
attributes[attribute] = <IAttributeData>this.#attributes[attribute].clone();
|
|
292
249
|
|
|
293
|
-
return new PrimitiveData(attributes,
|
|
250
|
+
return new PrimitiveData(attributes, <AttributeData>this.#indices, this.id, this.version);
|
|
294
251
|
}
|
|
295
252
|
|
|
296
253
|
public computeBoundingBox(matrix: mat4): IBox {
|
|
@@ -333,20 +290,26 @@ export class PrimitiveData extends AbstractTreeNodeData implements IPrimitiveDat
|
|
|
333
290
|
return new Box();
|
|
334
291
|
}
|
|
335
292
|
|
|
336
|
-
// #endregion Public Methods (
|
|
293
|
+
// #endregion Public Methods (2)
|
|
337
294
|
}
|
|
338
295
|
|
|
339
296
|
export class GeometryData extends AbstractTreeNodeData implements IGeometryData {
|
|
340
|
-
// #region Properties (
|
|
297
|
+
// #region Properties (11)
|
|
341
298
|
|
|
299
|
+
readonly #mode: PRIMITIVE_MODE = PRIMITIVE_MODE.TRIANGLES;
|
|
342
300
|
readonly #primitive: IPrimitiveData;
|
|
343
301
|
|
|
302
|
+
#attributeMaterial: IMaterialAbstractData | null = null;
|
|
344
303
|
#boundingBox: IBox = new Box();
|
|
345
|
-
#
|
|
304
|
+
#effectMaterials: { material: IMaterialAbstractData, token: string }[] = [];
|
|
305
|
+
#material: IMaterialAbstractData | null = null;
|
|
306
|
+
#materialVariants: { material: IMaterialAbstractData, variant: number }[] = [];
|
|
346
307
|
#morphWeights: number[] = [];
|
|
308
|
+
#renderOrder: number = 0;
|
|
309
|
+
#standardMaterial: IMaterialAbstractData | null = null;
|
|
347
310
|
#threeJsObject: { [key: string]: THREE.Mesh | THREE.Points | THREE.LineSegments | THREE.LineLoop | THREE.Line } = {};
|
|
348
311
|
|
|
349
|
-
// #endregion Properties (
|
|
312
|
+
// #endregion Properties (11)
|
|
350
313
|
|
|
351
314
|
// #region Constructors (1)
|
|
352
315
|
|
|
@@ -358,7 +321,10 @@ export class GeometryData extends AbstractTreeNodeData implements IGeometryData
|
|
|
358
321
|
*/
|
|
359
322
|
constructor(
|
|
360
323
|
primitive: IPrimitiveData,
|
|
324
|
+
mode: PRIMITIVE_MODE = PRIMITIVE_MODE.TRIANGLES,
|
|
325
|
+
material: IMaterialAbstractData | null = null,
|
|
361
326
|
morphWeights: number[] = [],
|
|
327
|
+
attributeMaterial: IMaterialAbstractData | null = null,
|
|
362
328
|
id?: string,
|
|
363
329
|
version?: string
|
|
364
330
|
) {
|
|
@@ -366,16 +332,57 @@ export class GeometryData extends AbstractTreeNodeData implements IGeometryData
|
|
|
366
332
|
this.#primitive = primitive;
|
|
367
333
|
this.#boundingBox = this.primitive.boundingBox.clone();
|
|
368
334
|
this.#morphWeights = morphWeights;
|
|
335
|
+
|
|
336
|
+
this.#mode = mode;
|
|
337
|
+
this.#material = material;
|
|
338
|
+
this.#standardMaterial = material;
|
|
339
|
+
this.#attributeMaterial = attributeMaterial;
|
|
369
340
|
}
|
|
370
341
|
|
|
371
342
|
// #endregion Constructors (1)
|
|
372
343
|
|
|
373
|
-
// #region Public Accessors (
|
|
344
|
+
// #region Public Accessors (16)
|
|
345
|
+
|
|
346
|
+
public get attributeMaterial(): IMaterialAbstractData | null {
|
|
347
|
+
return this.#attributeMaterial;
|
|
348
|
+
}
|
|
349
|
+
|
|
350
|
+
public set attributeMaterial(value: IMaterialAbstractData | null) {
|
|
351
|
+
this.#attributeMaterial = value;
|
|
352
|
+
}
|
|
374
353
|
|
|
375
354
|
public get boundingBox(): IBox {
|
|
376
355
|
return this.#boundingBox;
|
|
377
356
|
}
|
|
378
357
|
|
|
358
|
+
public get effectMaterials(): { material: IMaterialAbstractData, token: string }[] {
|
|
359
|
+
return this.#effectMaterials;
|
|
360
|
+
}
|
|
361
|
+
|
|
362
|
+
public get material(): IMaterialAbstractData | null {
|
|
363
|
+
return this.#material;
|
|
364
|
+
}
|
|
365
|
+
|
|
366
|
+
public set material(value: IMaterialAbstractData | null) {
|
|
367
|
+
this.#material = value;
|
|
368
|
+
}
|
|
369
|
+
|
|
370
|
+
public get materialVariants(): { material: IMaterialAbstractData, variant: number }[] {
|
|
371
|
+
return this.#materialVariants;
|
|
372
|
+
}
|
|
373
|
+
|
|
374
|
+
public get mode(): PRIMITIVE_MODE {
|
|
375
|
+
return this.#mode;
|
|
376
|
+
}
|
|
377
|
+
|
|
378
|
+
public get morphWeights(): number[] {
|
|
379
|
+
return this.#morphWeights;
|
|
380
|
+
}
|
|
381
|
+
|
|
382
|
+
public set morphWeights(value: number[]) {
|
|
383
|
+
this.#morphWeights = value
|
|
384
|
+
}
|
|
385
|
+
|
|
379
386
|
public get primitive(): IPrimitiveData {
|
|
380
387
|
return this.#primitive;
|
|
381
388
|
}
|
|
@@ -388,19 +395,19 @@ export class GeometryData extends AbstractTreeNodeData implements IGeometryData
|
|
|
388
395
|
this.#renderOrder = value;
|
|
389
396
|
}
|
|
390
397
|
|
|
391
|
-
public get
|
|
392
|
-
return this.#
|
|
398
|
+
public get standardMaterial(): IMaterialAbstractData | null {
|
|
399
|
+
return this.#standardMaterial;
|
|
393
400
|
}
|
|
394
401
|
|
|
395
|
-
public set
|
|
396
|
-
this.#
|
|
402
|
+
public set standardMaterial(value: IMaterialAbstractData | null) {
|
|
403
|
+
this.#standardMaterial = value;
|
|
397
404
|
}
|
|
398
|
-
|
|
405
|
+
|
|
399
406
|
public get threeJsObject(): { [key: string]: THREE.Mesh | THREE.Points | THREE.LineSegments | THREE.LineLoop | THREE.Line } {
|
|
400
407
|
return this.#threeJsObject;
|
|
401
408
|
}
|
|
402
409
|
|
|
403
|
-
// #endregion Public Accessors (
|
|
410
|
+
// #endregion Public Accessors (16)
|
|
404
411
|
|
|
405
412
|
// #region Public Methods (2)
|
|
406
413
|
|
|
@@ -408,11 +415,11 @@ export class GeometryData extends AbstractTreeNodeData implements IGeometryData
|
|
|
408
415
|
* Clones the scene graph data.
|
|
409
416
|
*/
|
|
410
417
|
public clone(): IGeometryData {
|
|
411
|
-
return new GeometryData(this.#primitive, this.#
|
|
418
|
+
return new GeometryData(this.#primitive, this.#mode, this.#material, this.#morphWeights, this.#attributeMaterial);
|
|
412
419
|
}
|
|
413
420
|
|
|
414
421
|
public intersect(origin: vec3, direction: vec3): number | null {
|
|
415
|
-
if (this.
|
|
422
|
+
if (this.mode !== PRIMITIVE_MODE.TRIANGLES) return null;
|
|
416
423
|
return this.boundingBox.intersect(origin, direction);
|
|
417
424
|
}
|
|
418
425
|
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { AbstractTreeNodeData, ITreeNodeData } from '@shapediver/viewer.shared.node-tree'
|
|
2
2
|
import { IMaterialVariantsData } from '../../interfaces/data/material/IMaterialVariantsData';
|
|
3
|
-
import { PrimitiveData } from '../data/GeometryData';
|
|
3
|
+
import { GeometryData, PrimitiveData } from '../data/GeometryData';
|
|
4
4
|
|
|
5
5
|
export class MaterialVariantsData extends AbstractTreeNodeData implements IMaterialVariantsData {
|
|
6
6
|
// #region Properties (1)
|
|
7
7
|
|
|
8
8
|
readonly #variants: string[] = [];
|
|
9
|
-
readonly #
|
|
9
|
+
readonly #geometryData: GeometryData[] = [];
|
|
10
10
|
#variantIndex?: number;
|
|
11
11
|
|
|
12
12
|
// #endregion Properties (1)
|
|
@@ -21,8 +21,8 @@ export class MaterialVariantsData extends AbstractTreeNodeData implements IMater
|
|
|
21
21
|
|
|
22
22
|
// #region Public Accessors (2)
|
|
23
23
|
|
|
24
|
-
public get
|
|
25
|
-
return this.#
|
|
24
|
+
public get geometryData(): GeometryData[] {
|
|
25
|
+
return this.#geometryData;
|
|
26
26
|
}
|
|
27
27
|
|
|
28
28
|
public get variants(): string[] {
|
|
@@ -35,12 +35,12 @@ export class MaterialVariantsData extends AbstractTreeNodeData implements IMater
|
|
|
35
35
|
|
|
36
36
|
public set variantIndex(value: number | undefined) {
|
|
37
37
|
this.#variantIndex = value;
|
|
38
|
-
for(let i = 0; i < this.
|
|
39
|
-
const variant = this.
|
|
38
|
+
for(let i = 0; i < this.geometryData.length; i++) {
|
|
39
|
+
const variant = this.geometryData[i].materialVariants.find(v => v.variant === this.#variantIndex);
|
|
40
40
|
if(variant) {
|
|
41
|
-
this.
|
|
41
|
+
this.geometryData[i].material = variant.material;
|
|
42
42
|
} else {
|
|
43
|
-
this.
|
|
43
|
+
this.geometryData[i].material = this.geometryData[i].standardMaterial;
|
|
44
44
|
}
|
|
45
45
|
}
|
|
46
46
|
}
|
|
@@ -14,7 +14,7 @@ export enum PRIMITIVE_MODE {
|
|
|
14
14
|
}
|
|
15
15
|
|
|
16
16
|
export interface IAttributeData extends ITreeNodeData {
|
|
17
|
-
// #region Properties (
|
|
17
|
+
// #region Properties (15)
|
|
18
18
|
|
|
19
19
|
readonly array: Int8Array | Uint8Array | Int16Array | Uint16Array | Uint32Array | Float32Array;
|
|
20
20
|
readonly byteOffset: number;
|
|
@@ -30,8 +30,9 @@ export interface IAttributeData extends ITreeNodeData {
|
|
|
30
30
|
readonly sparse?: boolean;
|
|
31
31
|
readonly sparseIndices?: Int8Array | Uint8Array | Int16Array | Uint16Array | Uint32Array | Float32Array;
|
|
32
32
|
readonly sparseValues?: Int8Array | Uint8Array | Int16Array | Uint16Array | Uint32Array | Float32Array;
|
|
33
|
+
readonly target: number | undefined;
|
|
33
34
|
|
|
34
|
-
// #endregion Properties (
|
|
35
|
+
// #endregion Properties (15)
|
|
35
36
|
|
|
36
37
|
// #region Public Methods (1)
|
|
37
38
|
|
|
@@ -41,42 +42,42 @@ export interface IAttributeData extends ITreeNodeData {
|
|
|
41
42
|
}
|
|
42
43
|
|
|
43
44
|
export interface IPrimitiveData extends ITreeNodeData {
|
|
44
|
-
// #region Properties (
|
|
45
|
+
// #region Properties (3)
|
|
45
46
|
|
|
46
47
|
readonly attributes: {
|
|
47
48
|
[key: string]: IAttributeData
|
|
48
49
|
};
|
|
49
|
-
readonly mode: PRIMITIVE_MODE;
|
|
50
50
|
|
|
51
|
-
attributeMaterial: IMaterialAbstractData | null;
|
|
52
51
|
boundingBox: IBox;
|
|
53
|
-
effectMaterials: { material: IMaterialAbstractData, token: string }[];
|
|
54
52
|
indices: IAttributeData | null;
|
|
55
|
-
material: IMaterialAbstractData | null;
|
|
56
|
-
materialVariants: { material: IMaterialAbstractData, variant: number }[];
|
|
57
|
-
standardMaterial: IMaterialAbstractData | null;
|
|
58
53
|
|
|
59
|
-
// #endregion Properties (
|
|
54
|
+
// #endregion Properties (3)
|
|
60
55
|
|
|
61
|
-
// #region Public Methods (
|
|
56
|
+
// #region Public Methods (2)
|
|
62
57
|
|
|
63
58
|
clone(): IPrimitiveData;
|
|
64
59
|
computeBoundingBox(matrix: mat4): IBox;
|
|
65
60
|
|
|
66
|
-
// #endregion Public Methods (
|
|
61
|
+
// #endregion Public Methods (2)
|
|
67
62
|
}
|
|
68
63
|
|
|
69
64
|
export interface IGeometryData extends ITreeNodeData {
|
|
70
|
-
// #region Properties (
|
|
65
|
+
// #region Properties (11)
|
|
71
66
|
|
|
67
|
+
readonly mode: PRIMITIVE_MODE;
|
|
72
68
|
readonly primitive: IPrimitiveData;
|
|
73
69
|
|
|
70
|
+
attributeMaterial: IMaterialAbstractData | null;
|
|
74
71
|
boundingBox: IBox;
|
|
72
|
+
effectMaterials: { material: IMaterialAbstractData, token: string }[];
|
|
73
|
+
material: IMaterialAbstractData | null;
|
|
74
|
+
materialVariants: { material: IMaterialAbstractData, variant: number }[];
|
|
75
75
|
morphWeights: number[];
|
|
76
76
|
renderOrder: number;
|
|
77
77
|
skinNode?: ITreeNode;
|
|
78
|
+
standardMaterial: IMaterialAbstractData | null;
|
|
78
79
|
|
|
79
|
-
// #endregion Properties (
|
|
80
|
+
// #endregion Properties (11)
|
|
80
81
|
|
|
81
82
|
// #region Public Methods (1)
|
|
82
83
|
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { ITreeNodeData } from "@shapediver/viewer.shared.node-tree";
|
|
2
|
-
import {
|
|
2
|
+
import { IGeometryData } from "../IGeometryData";
|
|
3
3
|
|
|
4
4
|
export interface IMaterialVariantsData extends ITreeNodeData {
|
|
5
5
|
// #region Properties (3)
|
|
6
6
|
|
|
7
|
-
readonly
|
|
7
|
+
readonly geometryData: IGeometryData[];
|
|
8
8
|
readonly variants: string[];
|
|
9
9
|
|
|
10
10
|
variantIndex?: number;
|
|
@@ -3,10 +3,16 @@ import { IEvent } from "@shapediver/viewer.shared.services";
|
|
|
3
3
|
export enum TASK_TYPE {
|
|
4
4
|
AR_LOADING = 'ar_loading',
|
|
5
5
|
ENVIRONMENT_MAP_LOADING = 'environment_map_loading',
|
|
6
|
+
CUSTOM_CONTENT_LOADING = 'custom_content_loading',
|
|
7
|
+
GLTF_CREATION = 'gltf_creation',
|
|
8
|
+
GLTF_CONTENT_LOADING = 'gltf_content_loading',
|
|
9
|
+
MATERIAL_CONTENT_LOADING = 'material_content_loading',
|
|
10
|
+
TAG_CONTENT_LOADING = 'tag_content_loading',
|
|
11
|
+
SDTF_CONTENT_LOADING = 'sdtf_content_loading',
|
|
6
12
|
SESSION_CUSTOMIZATION = 'session_customization',
|
|
7
13
|
SESSION_CREATION = 'session_creation',
|
|
8
|
-
SESSION_INITIAL_OUTPUTS_LOADED = 'session_initial_outputs_loaded',
|
|
9
14
|
SESSION_OUTPUTS_UPDATE = 'session_outputs_update',
|
|
15
|
+
SESSION_OUTPUTS_LOADING = 'session_outputs_loading',
|
|
10
16
|
VIEWPORT_CREATION = 'viewer_creation',
|
|
11
17
|
EXPORT_REQUEST = 'export_request',
|
|
12
18
|
}
|