@shapediver/viewer.shared.node-tree 3.15.12 → 3.16.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (116) hide show
  1. package/dist/implementation/AbstractTreeNodeData.d.ts +4 -1
  2. package/dist/implementation/AbstractTreeNodeData.d.ts.map +1 -1
  3. package/dist/implementation/AbstractTreeNodeData.js +9 -10
  4. package/dist/implementation/AbstractTreeNodeData.js.map +1 -1
  5. package/dist/implementation/Tree.d.ts +1 -2
  6. package/dist/implementation/Tree.d.ts.map +1 -1
  7. package/dist/implementation/Tree.js.map +1 -1
  8. package/dist/implementation/TreeNode.d.ts +8 -14
  9. package/dist/implementation/TreeNode.d.ts.map +1 -1
  10. package/dist/implementation/TreeNode.js +102 -77
  11. package/dist/implementation/TreeNode.js.map +1 -1
  12. package/dist/implementation/data/AnimationData.d.ts +33 -0
  13. package/dist/implementation/data/AnimationData.d.ts.map +1 -0
  14. package/dist/implementation/data/AnimationData.js +291 -0
  15. package/dist/implementation/data/AnimationData.js.map +1 -0
  16. package/dist/implementation/data/ChunkData.d.ts +15 -0
  17. package/dist/implementation/data/ChunkData.d.ts.map +1 -0
  18. package/dist/implementation/data/ChunkData.js +47 -0
  19. package/dist/implementation/data/ChunkData.js.map +1 -0
  20. package/dist/implementation/data/CustomData.d.ts +25 -0
  21. package/dist/implementation/data/CustomData.d.ts.map +1 -0
  22. package/dist/implementation/data/CustomData.js +51 -0
  23. package/dist/implementation/data/CustomData.js.map +1 -0
  24. package/dist/implementation/data/GeometryData.d.ts +101 -0
  25. package/dist/implementation/data/GeometryData.d.ts.map +1 -0
  26. package/dist/implementation/data/GeometryData.js +327 -0
  27. package/dist/implementation/data/GeometryData.js.map +1 -0
  28. package/dist/implementation/data/HTMLElementAnchorData.d.ts +103 -0
  29. package/dist/implementation/data/HTMLElementAnchorData.d.ts.map +1 -0
  30. package/dist/implementation/data/HTMLElementAnchorData.js +274 -0
  31. package/dist/implementation/data/HTMLElementAnchorData.js.map +1 -0
  32. package/dist/implementation/data/InstanceData.d.ts +22 -0
  33. package/dist/implementation/data/InstanceData.d.ts.map +1 -0
  34. package/dist/implementation/data/InstanceData.js +59 -0
  35. package/dist/implementation/data/InstanceData.js.map +1 -0
  36. package/dist/implementation/material/AbstractMaterialData.d.ts +69 -0
  37. package/dist/implementation/material/AbstractMaterialData.d.ts.map +1 -0
  38. package/dist/implementation/material/AbstractMaterialData.js +225 -0
  39. package/dist/implementation/material/AbstractMaterialData.js.map +1 -0
  40. package/dist/implementation/material/MapData.d.ts +54 -0
  41. package/dist/implementation/material/MapData.d.ts.map +1 -0
  42. package/dist/implementation/material/MapData.js +191 -0
  43. package/dist/implementation/material/MapData.js.map +1 -0
  44. package/dist/implementation/material/MaterialBasicLineData.d.ts +15 -0
  45. package/dist/implementation/material/MaterialBasicLineData.d.ts.map +1 -0
  46. package/dist/implementation/material/MaterialBasicLineData.js +91 -0
  47. package/dist/implementation/material/MaterialBasicLineData.js.map +1 -0
  48. package/dist/implementation/material/MaterialGemData.d.ts +47 -0
  49. package/dist/implementation/material/MaterialGemData.d.ts.map +1 -0
  50. package/dist/implementation/material/MaterialGemData.js +289 -0
  51. package/dist/implementation/material/MaterialGemData.js.map +1 -0
  52. package/dist/implementation/material/MaterialLambertData.d.ts +22 -0
  53. package/dist/implementation/material/MaterialLambertData.d.ts.map +1 -0
  54. package/dist/implementation/material/MaterialLambertData.js +147 -0
  55. package/dist/implementation/material/MaterialLambertData.js.map +1 -0
  56. package/dist/implementation/material/MaterialMultiPointData.d.ts +100 -0
  57. package/dist/implementation/material/MaterialMultiPointData.d.ts.map +1 -0
  58. package/dist/implementation/material/MaterialMultiPointData.js +651 -0
  59. package/dist/implementation/material/MaterialMultiPointData.js.map +1 -0
  60. package/dist/implementation/material/MaterialPhongData.d.ts +26 -0
  61. package/dist/implementation/material/MaterialPhongData.d.ts.map +1 -0
  62. package/dist/implementation/material/MaterialPhongData.js +171 -0
  63. package/dist/implementation/material/MaterialPhongData.js.map +1 -0
  64. package/dist/implementation/material/MaterialPointData.d.ts +20 -0
  65. package/dist/implementation/material/MaterialPointData.d.ts.map +1 -0
  66. package/dist/implementation/material/MaterialPointData.js +132 -0
  67. package/dist/implementation/material/MaterialPointData.js.map +1 -0
  68. package/dist/implementation/material/MaterialShadowData.d.ts +15 -0
  69. package/dist/implementation/material/MaterialShadowData.d.ts.map +1 -0
  70. package/dist/implementation/material/MaterialShadowData.js +36 -0
  71. package/dist/implementation/material/MaterialShadowData.js.map +1 -0
  72. package/dist/implementation/material/MaterialSpecularGlossinessData.d.ts +28 -0
  73. package/dist/implementation/material/MaterialSpecularGlossinessData.d.ts.map +1 -0
  74. package/dist/implementation/material/MaterialSpecularGlossinessData.js +180 -0
  75. package/dist/implementation/material/MaterialSpecularGlossinessData.js.map +1 -0
  76. package/dist/implementation/material/MaterialStandardData.d.ts +76 -0
  77. package/dist/implementation/material/MaterialStandardData.d.ts.map +1 -0
  78. package/dist/implementation/material/MaterialStandardData.js +468 -0
  79. package/dist/implementation/material/MaterialStandardData.js.map +1 -0
  80. package/dist/implementation/material/MaterialUnlitData.d.ts +18 -0
  81. package/dist/implementation/material/MaterialUnlitData.d.ts.map +1 -0
  82. package/dist/implementation/material/MaterialUnlitData.js +120 -0
  83. package/dist/implementation/material/MaterialUnlitData.js.map +1 -0
  84. package/dist/implementation/material/MaterialVariantsData.d.ts +16 -0
  85. package/dist/implementation/material/MaterialVariantsData.d.ts.map +1 -0
  86. package/dist/implementation/material/MaterialVariantsData.js +62 -0
  87. package/dist/implementation/material/MaterialVariantsData.js.map +1 -0
  88. package/dist/implementation/sdtf/SDTFAttributesData.d.ts +23 -0
  89. package/dist/implementation/sdtf/SDTFAttributesData.d.ts.map +1 -0
  90. package/dist/implementation/sdtf/SDTFAttributesData.js +100 -0
  91. package/dist/implementation/sdtf/SDTFAttributesData.js.map +1 -0
  92. package/dist/implementation/sdtf/SDTFItemData.d.ts +19 -0
  93. package/dist/implementation/sdtf/SDTFItemData.d.ts.map +1 -0
  94. package/dist/implementation/sdtf/SDTFItemData.js +60 -0
  95. package/dist/implementation/sdtf/SDTFItemData.js.map +1 -0
  96. package/dist/implementation/sdtf/SDTFOverviewData.d.ts +13 -0
  97. package/dist/implementation/sdtf/SDTFOverviewData.d.ts.map +1 -0
  98. package/dist/implementation/sdtf/SDTFOverviewData.js +107 -0
  99. package/dist/implementation/sdtf/SDTFOverviewData.js.map +1 -0
  100. package/dist/index.d.ts +31 -5
  101. package/dist/index.d.ts.map +1 -1
  102. package/dist/index.js +51 -1
  103. package/dist/index.js.map +1 -1
  104. package/package.json +5 -4
  105. package/dist/interfaces/ITree.d.ts +0 -46
  106. package/dist/interfaces/ITree.d.ts.map +0 -1
  107. package/dist/interfaces/ITree.js +0 -3
  108. package/dist/interfaces/ITree.js.map +0 -1
  109. package/dist/interfaces/ITreeNode.d.ts +0 -237
  110. package/dist/interfaces/ITreeNode.d.ts.map +0 -1
  111. package/dist/interfaces/ITreeNode.js +0 -4
  112. package/dist/interfaces/ITreeNode.js.map +0 -1
  113. package/dist/interfaces/ITreeNodeData.d.ts +0 -36
  114. package/dist/interfaces/ITreeNodeData.d.ts.map +0 -1
  115. package/dist/interfaces/ITreeNodeData.js +0 -3
  116. package/dist/interfaces/ITreeNodeData.js.map +0 -1
@@ -0,0 +1,327 @@
1
+ "use strict";
2
+ var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
3
+ if (kind === "m") throw new TypeError("Private method is not writable");
4
+ if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
5
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
6
+ return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
7
+ };
8
+ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
9
+ if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
10
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
11
+ return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
12
+ };
13
+ var _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, _GeometryData_mode, _GeometryData_primitive, _GeometryData_attributeMaterial, _GeometryData_boundingBox, _GeometryData_castShadow, _GeometryData_effectMaterials, _GeometryData_material, _GeometryData_materialVariants, _GeometryData_morphWeights, _GeometryData_receiveShadow, _GeometryData_renderOrder, _GeometryData_standardMaterial, _PrimitiveData_attributes, _PrimitiveData_boundingBoxes, _PrimitiveData_indices;
14
+ Object.defineProperty(exports, "__esModule", { value: true });
15
+ exports.PrimitiveData = exports.GeometryData = exports.AttributeData = void 0;
16
+ const viewer_shared_math_1 = require("@shapediver/viewer.shared.math");
17
+ const viewer_shared_types_1 = require("@shapediver/viewer.shared.types");
18
+ const gl_matrix_1 = require("gl-matrix");
19
+ const AbstractTreeNodeData_1 = require("../AbstractTreeNodeData");
20
+ // #region Classes (3)
21
+ class AttributeData extends AbstractTreeNodeData_1.AbstractTreeNodeData {
22
+ // #endregion Properties (15)
23
+ // #region Constructors (1)
24
+ /**
25
+ * Creates an attribute data object.
26
+ *
27
+ * @param _array the array of the data
28
+ * @param _itemSize the size
29
+ * @param _hasOffset notifier if there is an offset
30
+ * @param _offset the offset
31
+ * @param _stride the stride
32
+ * @param _normalized boolean if the data is normalized
33
+ */
34
+ constructor(array, itemSize, itemBytes, byteOffset, elementBytes, normalized, count, min = [], max = [], byteStride, target, sparse, sparseIndices, sparseValues, morphAttributeData = [], id, version) {
35
+ super(id, version);
36
+ // #region Properties (15)
37
+ _AttributeData_array.set(this, void 0);
38
+ _AttributeData_byteOffset.set(this, void 0);
39
+ _AttributeData_byteStride.set(this, void 0);
40
+ _AttributeData_count.set(this, void 0);
41
+ _AttributeData_elementBytes.set(this, void 0);
42
+ _AttributeData_itemBytes.set(this, void 0);
43
+ _AttributeData_itemSize.set(this, void 0);
44
+ _AttributeData_max.set(this, []);
45
+ _AttributeData_min.set(this, []);
46
+ _AttributeData_morphAttributeData.set(this, []);
47
+ _AttributeData_normalized.set(this, void 0);
48
+ _AttributeData_sparse.set(this, void 0);
49
+ _AttributeData_sparseIndices.set(this, void 0);
50
+ _AttributeData_sparseValues.set(this, void 0);
51
+ _AttributeData_target.set(this, void 0);
52
+ __classPrivateFieldSet(this, _AttributeData_array, array, "f");
53
+ __classPrivateFieldSet(this, _AttributeData_itemSize, itemSize, "f");
54
+ __classPrivateFieldSet(this, _AttributeData_itemBytes, itemBytes, "f");
55
+ __classPrivateFieldSet(this, _AttributeData_byteOffset, byteOffset, "f");
56
+ __classPrivateFieldSet(this, _AttributeData_elementBytes, elementBytes, "f");
57
+ __classPrivateFieldSet(this, _AttributeData_normalized, normalized, "f");
58
+ __classPrivateFieldSet(this, _AttributeData_count, count, "f");
59
+ __classPrivateFieldSet(this, _AttributeData_min, min, "f");
60
+ __classPrivateFieldSet(this, _AttributeData_max, max, "f");
61
+ __classPrivateFieldSet(this, _AttributeData_byteStride, byteStride, "f");
62
+ __classPrivateFieldSet(this, _AttributeData_target, target, "f");
63
+ __classPrivateFieldSet(this, _AttributeData_sparse, sparse, "f");
64
+ __classPrivateFieldSet(this, _AttributeData_sparseIndices, sparseIndices, "f");
65
+ __classPrivateFieldSet(this, _AttributeData_sparseValues, sparseValues, "f");
66
+ __classPrivateFieldSet(this, _AttributeData_morphAttributeData, morphAttributeData, "f");
67
+ }
68
+ // #endregion Constructors (1)
69
+ // #region Public Getters And Setters (15)
70
+ get array() {
71
+ return __classPrivateFieldGet(this, _AttributeData_array, "f");
72
+ }
73
+ get byteOffset() {
74
+ return __classPrivateFieldGet(this, _AttributeData_byteOffset, "f");
75
+ }
76
+ get byteStride() {
77
+ return __classPrivateFieldGet(this, _AttributeData_byteStride, "f");
78
+ }
79
+ get count() {
80
+ return __classPrivateFieldGet(this, _AttributeData_count, "f");
81
+ }
82
+ get elementBytes() {
83
+ return __classPrivateFieldGet(this, _AttributeData_elementBytes, "f");
84
+ }
85
+ get itemBytes() {
86
+ return __classPrivateFieldGet(this, _AttributeData_itemBytes, "f");
87
+ }
88
+ get itemSize() {
89
+ return __classPrivateFieldGet(this, _AttributeData_itemSize, "f");
90
+ }
91
+ get max() {
92
+ return __classPrivateFieldGet(this, _AttributeData_max, "f");
93
+ }
94
+ get min() {
95
+ return __classPrivateFieldGet(this, _AttributeData_min, "f");
96
+ }
97
+ get morphAttributeData() {
98
+ return __classPrivateFieldGet(this, _AttributeData_morphAttributeData, "f");
99
+ }
100
+ get normalized() {
101
+ return __classPrivateFieldGet(this, _AttributeData_normalized, "f");
102
+ }
103
+ get sparse() {
104
+ return __classPrivateFieldGet(this, _AttributeData_sparse, "f");
105
+ }
106
+ get sparseIndices() {
107
+ return __classPrivateFieldGet(this, _AttributeData_sparseIndices, "f");
108
+ }
109
+ get sparseValues() {
110
+ return __classPrivateFieldGet(this, _AttributeData_sparseValues, "f");
111
+ }
112
+ get target() {
113
+ return __classPrivateFieldGet(this, _AttributeData_target, "f");
114
+ }
115
+ // #endregion Public Getters And Setters (15)
116
+ // #region Public Methods (1)
117
+ /**
118
+ * Clones the attribute data.
119
+ */
120
+ clone() {
121
+ 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);
122
+ }
123
+ }
124
+ exports.AttributeData = AttributeData;
125
+ _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();
126
+ class GeometryData extends AbstractTreeNodeData_1.AbstractTreeNodeData {
127
+ // #endregion Properties (10)
128
+ // #region Constructors (1)
129
+ /**
130
+ * Creates a geometry data object.
131
+ *
132
+ * @param _primitive the primitive
133
+ * @param id the id
134
+ */
135
+ constructor(primitive, mode = viewer_shared_types_1.PRIMITIVE_MODE.TRIANGLES, material = null, morphWeights = [], attributeMaterial = null, castShadow = true, receiveShadow = true, id, version) {
136
+ super(id, version);
137
+ // #region Properties (10)
138
+ _GeometryData_mode.set(this, viewer_shared_types_1.PRIMITIVE_MODE.TRIANGLES);
139
+ _GeometryData_primitive.set(this, void 0);
140
+ _GeometryData_attributeMaterial.set(this, null);
141
+ _GeometryData_boundingBox.set(this, new viewer_shared_math_1.Box());
142
+ _GeometryData_castShadow.set(this, true);
143
+ _GeometryData_effectMaterials.set(this, []);
144
+ _GeometryData_material.set(this, null);
145
+ _GeometryData_materialVariants.set(this, []);
146
+ _GeometryData_morphWeights.set(this, []);
147
+ _GeometryData_receiveShadow.set(this, true);
148
+ _GeometryData_renderOrder.set(this, 0);
149
+ _GeometryData_standardMaterial.set(this, null);
150
+ __classPrivateFieldSet(this, _GeometryData_primitive, primitive, "f");
151
+ __classPrivateFieldSet(this, _GeometryData_castShadow, castShadow, "f");
152
+ __classPrivateFieldSet(this, _GeometryData_boundingBox, this.primitive.boundingBox.clone(), "f");
153
+ __classPrivateFieldSet(this, _GeometryData_morphWeights, morphWeights, "f");
154
+ __classPrivateFieldSet(this, _GeometryData_receiveShadow, receiveShadow, "f");
155
+ __classPrivateFieldSet(this, _GeometryData_mode, mode, "f");
156
+ __classPrivateFieldSet(this, _GeometryData_material, material, "f");
157
+ __classPrivateFieldSet(this, _GeometryData_standardMaterial, material, "f");
158
+ __classPrivateFieldSet(this, _GeometryData_attributeMaterial, attributeMaterial, "f");
159
+ }
160
+ // #endregion Constructors (1)
161
+ // #region Public Getters And Setters (15)
162
+ get attributeMaterial() {
163
+ return __classPrivateFieldGet(this, _GeometryData_attributeMaterial, "f");
164
+ }
165
+ set attributeMaterial(value) {
166
+ __classPrivateFieldSet(this, _GeometryData_attributeMaterial, value, "f");
167
+ }
168
+ get boundingBox() {
169
+ return __classPrivateFieldGet(this, _GeometryData_boundingBox, "f");
170
+ }
171
+ get castShadow() {
172
+ return __classPrivateFieldGet(this, _GeometryData_castShadow, "f");
173
+ }
174
+ set castShadow(value) {
175
+ __classPrivateFieldSet(this, _GeometryData_castShadow, value, "f");
176
+ }
177
+ get effectMaterials() {
178
+ return __classPrivateFieldGet(this, _GeometryData_effectMaterials, "f");
179
+ }
180
+ get material() {
181
+ return __classPrivateFieldGet(this, _GeometryData_material, "f");
182
+ }
183
+ set material(value) {
184
+ __classPrivateFieldSet(this, _GeometryData_material, value, "f");
185
+ }
186
+ get materialVariants() {
187
+ return __classPrivateFieldGet(this, _GeometryData_materialVariants, "f");
188
+ }
189
+ get mode() {
190
+ return __classPrivateFieldGet(this, _GeometryData_mode, "f");
191
+ }
192
+ get morphWeights() {
193
+ return __classPrivateFieldGet(this, _GeometryData_morphWeights, "f");
194
+ }
195
+ set morphWeights(value) {
196
+ __classPrivateFieldSet(this, _GeometryData_morphWeights, value, "f");
197
+ }
198
+ get primitive() {
199
+ return __classPrivateFieldGet(this, _GeometryData_primitive, "f");
200
+ }
201
+ get receiveShadow() {
202
+ return __classPrivateFieldGet(this, _GeometryData_receiveShadow, "f");
203
+ }
204
+ set receiveShadow(value) {
205
+ __classPrivateFieldSet(this, _GeometryData_receiveShadow, value, "f");
206
+ }
207
+ get renderOrder() {
208
+ return __classPrivateFieldGet(this, _GeometryData_renderOrder, "f");
209
+ }
210
+ set renderOrder(value) {
211
+ __classPrivateFieldSet(this, _GeometryData_renderOrder, value, "f");
212
+ }
213
+ get standardMaterial() {
214
+ return __classPrivateFieldGet(this, _GeometryData_standardMaterial, "f");
215
+ }
216
+ set standardMaterial(value) {
217
+ __classPrivateFieldSet(this, _GeometryData_standardMaterial, value, "f");
218
+ }
219
+ // #endregion Public Getters And Setters (15)
220
+ // #region Public Methods (2)
221
+ /**
222
+ * Clones the scene graph data.
223
+ */
224
+ clone() {
225
+ 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"), __classPrivateFieldGet(this, _GeometryData_castShadow, "f"), __classPrivateFieldGet(this, _GeometryData_receiveShadow, "f"));
226
+ }
227
+ intersect(origin, direction) {
228
+ if (this.mode !== viewer_shared_types_1.PRIMITIVE_MODE.TRIANGLES)
229
+ return null;
230
+ return this.boundingBox.intersect(origin, direction);
231
+ }
232
+ }
233
+ exports.GeometryData = GeometryData;
234
+ _GeometryData_mode = new WeakMap(), _GeometryData_primitive = new WeakMap(), _GeometryData_attributeMaterial = new WeakMap(), _GeometryData_boundingBox = new WeakMap(), _GeometryData_castShadow = new WeakMap(), _GeometryData_effectMaterials = new WeakMap(), _GeometryData_material = new WeakMap(), _GeometryData_materialVariants = new WeakMap(), _GeometryData_morphWeights = new WeakMap(), _GeometryData_receiveShadow = new WeakMap(), _GeometryData_renderOrder = new WeakMap(), _GeometryData_standardMaterial = new WeakMap();
235
+ class PrimitiveData extends AbstractTreeNodeData_1.AbstractTreeNodeData {
236
+ // #endregion Properties (3)
237
+ // #region Constructors (1)
238
+ /**
239
+ * Creates a primitive data object.
240
+ *
241
+ * @param _attributes the attributes as key-value pairs
242
+ * @param _indices the indices
243
+ */
244
+ constructor(attributes = {}, indices = null, id, version) {
245
+ super(id, version);
246
+ // #region Properties (3)
247
+ _PrimitiveData_attributes.set(this, {});
248
+ _PrimitiveData_boundingBoxes.set(this, []);
249
+ _PrimitiveData_indices.set(this, null);
250
+ __classPrivateFieldSet(this, _PrimitiveData_attributes, attributes, "f");
251
+ __classPrivateFieldSet(this, _PrimitiveData_indices, indices, "f");
252
+ }
253
+ // #endregion Constructors (1)
254
+ // #region Public Getters And Setters (4)
255
+ get attributes() {
256
+ return __classPrivateFieldGet(this, _PrimitiveData_attributes, "f");
257
+ }
258
+ get boundingBox() {
259
+ return this.computeBoundingBox(gl_matrix_1.mat4.create());
260
+ }
261
+ get indices() {
262
+ return __classPrivateFieldGet(this, _PrimitiveData_indices, "f");
263
+ }
264
+ set indices(value) {
265
+ __classPrivateFieldSet(this, _PrimitiveData_indices, value, "f");
266
+ }
267
+ // #endregion Public Getters And Setters (4)
268
+ // #region Public Methods (2)
269
+ /**
270
+ * Clones the primitive data.
271
+ */
272
+ clone() {
273
+ const attributes = {};
274
+ for (const attribute in __classPrivateFieldGet(this, _PrimitiveData_attributes, "f"))
275
+ attributes[attribute] = (__classPrivateFieldGet(this, _PrimitiveData_attributes, "f")[attribute].clone());
276
+ return new PrimitiveData(attributes, __classPrivateFieldGet(this, _PrimitiveData_indices, "f"), this.id, this.version);
277
+ }
278
+ computeBoundingBox(matrix) {
279
+ const res = __classPrivateFieldGet(this, _PrimitiveData_boundingBoxes, "f").find((b) => gl_matrix_1.mat4.equals(matrix, b.matrix));
280
+ if (res)
281
+ return res.boundingBox;
282
+ if (__classPrivateFieldGet(this, _PrimitiveData_attributes, "f")["POSITION"]) {
283
+ if (__classPrivateFieldGet(this, _PrimitiveData_attributes, "f")["POSITION"].min.length === 3 &&
284
+ __classPrivateFieldGet(this, _PrimitiveData_attributes, "f")["POSITION"].max.length === 3 &&
285
+ gl_matrix_1.mat4.equals(matrix, gl_matrix_1.mat4.create())) {
286
+ const boundingBox = new viewer_shared_math_1.Box(gl_matrix_1.vec3.fromValues(__classPrivateFieldGet(this, _PrimitiveData_attributes, "f")["POSITION"].min[0], __classPrivateFieldGet(this, _PrimitiveData_attributes, "f")["POSITION"].min[1], __classPrivateFieldGet(this, _PrimitiveData_attributes, "f")["POSITION"].min[2]), gl_matrix_1.vec3.fromValues(__classPrivateFieldGet(this, _PrimitiveData_attributes, "f")["POSITION"].max[0], __classPrivateFieldGet(this, _PrimitiveData_attributes, "f")["POSITION"].max[1], __classPrivateFieldGet(this, _PrimitiveData_attributes, "f")["POSITION"].max[2]));
287
+ __classPrivateFieldGet(this, _PrimitiveData_boundingBoxes, "f").push({
288
+ boundingBox,
289
+ matrix: gl_matrix_1.mat4.clone(matrix),
290
+ });
291
+ return boundingBox;
292
+ }
293
+ else if (gl_matrix_1.mat4.equals(matrix, gl_matrix_1.mat4.create())) {
294
+ const boundingBox = new viewer_shared_math_1.Box();
295
+ boundingBox.setFromAttributeArray(__classPrivateFieldGet(this, _PrimitiveData_attributes, "f")["POSITION"].array, __classPrivateFieldGet(this, _PrimitiveData_attributes, "f")["POSITION"].byteStride, __classPrivateFieldGet(this, _PrimitiveData_attributes, "f")["POSITION"].itemBytes);
296
+ __classPrivateFieldGet(this, _PrimitiveData_boundingBoxes, "f").push({
297
+ boundingBox,
298
+ matrix: gl_matrix_1.mat4.clone(matrix),
299
+ });
300
+ return boundingBox;
301
+ }
302
+ else if (gl_matrix_1.quat.equals(gl_matrix_1.mat4.getRotation(gl_matrix_1.quat.create(), matrix), gl_matrix_1.quat.create())) {
303
+ const identityBB = this.computeBoundingBox(gl_matrix_1.mat4.create());
304
+ const boundingBox = identityBB.clone().applyMatrix(matrix);
305
+ __classPrivateFieldGet(this, _PrimitiveData_boundingBoxes, "f").push({
306
+ boundingBox,
307
+ matrix: gl_matrix_1.mat4.clone(matrix),
308
+ });
309
+ return boundingBox;
310
+ }
311
+ else {
312
+ const boundingBox = new viewer_shared_math_1.Box();
313
+ boundingBox.setFromAttributeArray(__classPrivateFieldGet(this, _PrimitiveData_attributes, "f")["POSITION"].array, __classPrivateFieldGet(this, _PrimitiveData_attributes, "f")["POSITION"].byteStride, __classPrivateFieldGet(this, _PrimitiveData_attributes, "f")["POSITION"].itemBytes, matrix);
314
+ __classPrivateFieldGet(this, _PrimitiveData_boundingBoxes, "f").push({
315
+ boundingBox,
316
+ matrix: gl_matrix_1.mat4.clone(matrix),
317
+ });
318
+ return boundingBox;
319
+ }
320
+ }
321
+ return new viewer_shared_math_1.Box();
322
+ }
323
+ }
324
+ exports.PrimitiveData = PrimitiveData;
325
+ _PrimitiveData_attributes = new WeakMap(), _PrimitiveData_boundingBoxes = new WeakMap(), _PrimitiveData_indices = new WeakMap();
326
+ // #endregion Classes (3)
327
+ //# sourceMappingURL=GeometryData.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GeometryData.js","sourceRoot":"","sources":["../../../src/implementation/data/GeometryData.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,uEAAyD;AACzD,yEAMyC;AACzC,yCAA2C;AAC3C,kEAA6D;AAE7D,sBAAsB;AAEtB,MAAa,aACZ,SAAQ,2CAAoB;IAuC5B,6BAA6B;IAE7B,2BAA2B;IAE3B;;;;;;;;;OASG;IACH,YACC,KAMe,EACf,QAAgB,EACh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AAO,IAAI,wBAAG,EAAE,CAAC;IAClB,CAAC;CAGD;AA9JD,sCA8JC;;AAED,yBAAyB"}
@@ -0,0 +1,103 @@
1
+ import { Box } from "@shapediver/viewer.shared.math";
2
+ import { IAnchorDataImage, IAnchorDataText, IHTMLElementAnchorData, IHTMLElementAnchorUpdateProperties } from "@shapediver/viewer.shared.types";
3
+ import { vec3 } from "gl-matrix";
4
+ import { AbstractTreeNodeData } from "../AbstractTreeNodeData";
5
+ export declare abstract class HTMLElementAnchorData extends AbstractTreeNodeData implements IHTMLElementAnchorData {
6
+ #private;
7
+ protected internalHtmlElement: HTMLDivElement;
8
+ /**
9
+ * Creates a custom data node.
10
+ *
11
+ * @param _data the data as key- value pairs
12
+ * @param id the id
13
+ */
14
+ constructor(properties: {
15
+ location: vec3;
16
+ data: IAnchorDataImage | IAnchorDataText | any;
17
+ format: "text" | "image" | "custom";
18
+ hideable?: boolean;
19
+ viewports?: string[];
20
+ intersectionTarget?: Box | string | string[];
21
+ id?: string;
22
+ version?: string;
23
+ });
24
+ get data(): IAnchorDataImage | IAnchorDataText | any;
25
+ set data(value: IAnchorDataImage | IAnchorDataText | any);
26
+ get format(): "text" | "image" | "custom";
27
+ set format(value: "text" | "image" | "custom");
28
+ get hideable(): boolean;
29
+ set hideable(value: boolean);
30
+ get intersectionTarget(): Box | string | string[] | undefined;
31
+ set intersectionTarget(value: Box | string | string[] | undefined);
32
+ get location(): vec3;
33
+ set location(value: vec3);
34
+ get viewports(): string[];
35
+ set viewports(value: string[]);
36
+ createViewerHtmlElement(viewer: string): HTMLDivElement | null;
37
+ getViewerHtmlElement(viewer: string): HTMLDivElement | null;
38
+ abstract create(properties: {
39
+ anchor: IHTMLElementAnchorData;
40
+ parent: HTMLDivElement;
41
+ }): void;
42
+ update(properties: IHTMLElementAnchorUpdateProperties): void;
43
+ /**
44
+ * Clones the scene graph data.
45
+ */
46
+ abstract clone(): IHTMLElementAnchorData;
47
+ }
48
+ export declare class HTMLElementAnchorTextData extends HTMLElementAnchorData {
49
+ constructor(properties: {
50
+ location: vec3;
51
+ data: IAnchorDataText;
52
+ hideable?: boolean;
53
+ viewports?: string[];
54
+ intersectionTarget?: Box | string | string[];
55
+ id?: string;
56
+ version?: string;
57
+ });
58
+ clone(): HTMLElementAnchorTextData;
59
+ create(properties: {
60
+ anchor: HTMLElementAnchorData;
61
+ parent: HTMLDivElement;
62
+ }): void;
63
+ }
64
+ export declare class HTMLElementAnchorImageData extends HTMLElementAnchorData {
65
+ constructor(properties: {
66
+ location: vec3;
67
+ data: IAnchorDataImage;
68
+ hideable?: boolean;
69
+ viewports?: string[];
70
+ intersectionTarget?: Box | string | string[];
71
+ id?: string;
72
+ version?: string;
73
+ });
74
+ clone(): HTMLElementAnchorImageData;
75
+ create(properties: {
76
+ anchor: HTMLElementAnchorData;
77
+ parent: HTMLDivElement;
78
+ }): void;
79
+ }
80
+ export declare class HTMLElementAnchorCustomData extends HTMLElementAnchorData {
81
+ #private;
82
+ constructor(properties: {
83
+ location: vec3;
84
+ data: any;
85
+ hideable?: boolean;
86
+ viewports?: string[];
87
+ intersectionTarget?: Box | string | string[];
88
+ id?: string;
89
+ version?: string;
90
+ create: (properties: {
91
+ anchor: HTMLElementAnchorData;
92
+ parent: HTMLDivElement;
93
+ }) => void;
94
+ update: (properties: IHTMLElementAnchorUpdateProperties) => void;
95
+ });
96
+ create(properties: {
97
+ anchor: HTMLElementAnchorData;
98
+ parent: HTMLDivElement;
99
+ }): void;
100
+ update(properties: IHTMLElementAnchorUpdateProperties): void;
101
+ clone(): HTMLElementAnchorCustomData;
102
+ }
103
+ //# sourceMappingURL=HTMLElementAnchorData.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"HTMLElementAnchorData.d.ts","sourceRoot":"","sources":["../../../src/implementation/data/HTMLElementAnchorData.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,GAAG,EAAC,MAAM,gCAAgC,CAAC;AACnD,OAAO,EACN,gBAAgB,EAChB,eAAe,E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