@shapediver/viewer.data-engine.sdtf-engine 3.16.8 → 3.16.10

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.
@@ -1,53 +1,53 @@
1
- import { ResOutputContent } from "@shapediver/sdk.geometry-api-sdk-v2";
2
- import { ITreeNode } from "@shapediver/viewer.shared.node-tree";
3
- export declare class SDTFEngine {
4
- private readonly _logger;
5
- private static _instance;
6
- private _parsedFile;
7
- private _overview;
8
- static get instance(): SDTFEngine;
9
- /**
10
- * Load the sdtf content into a scene graph node.
11
- *
12
- * @param content the geometry content
13
- * @returns the scene graph node
14
- */
15
- loadContent(content: ResOutputContent, jwtToken?: string): Promise<ITreeNode>;
16
- /**
17
- * Update the overview with a single attribute entry.
18
- * Called during item loading so we avoid a separate pass over all items.
19
- */
20
- private updateOverview;
21
- /**
22
- * Load the attributes into a SDTFAttributesData data item.
23
- *
24
- * @param attributes
25
- * @returns
26
- */
27
- private loadAttributes;
28
- /**
29
- * Load the chunk into a scene graph node.
30
- *
31
- * @param chunk
32
- * @param chunkId
33
- * @returns
34
- */
35
- private loadChunk;
36
- /**
37
- * Load the item into a scene graph node.
38
- *
39
- * @param item
40
- * @param itemId
41
- * @returns
42
- */
43
- private loadItem;
44
- /**
45
- * Load the node into a scene graph node.
46
- *
47
- * @param node
48
- * @param nodeId
49
- * @returns
50
- */
51
- private loadNode;
52
- }
1
+ import { ResOutputContent } from "@shapediver/sdk.geometry-api-sdk-v2";
2
+ import { ITreeNode } from "@shapediver/viewer.shared.node-tree";
3
+ export declare class SDTFEngine {
4
+ private readonly _logger;
5
+ private static _instance;
6
+ private _parsedFile;
7
+ private _overview;
8
+ static get instance(): SDTFEngine;
9
+ /**
10
+ * Load the sdtf content into a scene graph node.
11
+ *
12
+ * @param content the geometry content
13
+ * @returns the scene graph node
14
+ */
15
+ loadContent(content: ResOutputContent, jwtToken?: string): Promise<ITreeNode>;
16
+ /**
17
+ * Update the overview with a single attribute entry.
18
+ * Called during item loading so we avoid a separate pass over all items.
19
+ */
20
+ private updateOverview;
21
+ /**
22
+ * Load the attributes into a SDTFAttributesData data item.
23
+ *
24
+ * @param attributes
25
+ * @returns
26
+ */
27
+ private loadAttributes;
28
+ /**
29
+ * Load the chunk into a scene graph node.
30
+ *
31
+ * @param chunk
32
+ * @param chunkId
33
+ * @returns
34
+ */
35
+ private loadChunk;
36
+ /**
37
+ * Load the item into a scene graph node.
38
+ *
39
+ * @param item
40
+ * @param itemId
41
+ * @returns
42
+ */
43
+ private loadItem;
44
+ /**
45
+ * Load the node into a scene graph node.
46
+ *
47
+ * @param node
48
+ * @param nodeId
49
+ * @returns
50
+ */
51
+ private loadNode;
52
+ }
53
53
  //# sourceMappingURL=SDTFEngine.d.ts.map
@@ -1,262 +1,262 @@
1
- "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.SDTFEngine = void 0;
13
- const sdk_sdtf_primitives_1 = require("@shapediver/sdk.sdtf-primitives");
14
- const sdk_sdtf_v1_1 = require("@shapediver/sdk.sdtf-v1");
15
- const viewer_shared_node_tree_1 = require("@shapediver/viewer.shared.node-tree");
16
- const viewer_shared_services_1 = require("@shapediver/viewer.shared.services");
17
- class SDTFEngine {
18
- constructor() {
19
- // #region Properties (4)
20
- this._logger = viewer_shared_services_1.Logger.instance;
21
- this._overview = {};
22
- // #endregion Private Methods (5)
23
- }
24
- // #endregion Properties (4)
25
- // #region Public Static Accessors (1)
26
- static get instance() {
27
- return this._instance || (this._instance = new this());
28
- }
29
- // #endregion Public Static Accessors (1)
30
- // #region Public Methods (1)
31
- /**
32
- * Load the sdtf content into a scene graph node.
33
- *
34
- * @param content the geometry content
35
- * @returns the scene graph node
36
- */
37
- loadContent(content, jwtToken) {
38
- return __awaiter(this, void 0, void 0, function* () {
39
- const node = new viewer_shared_node_tree_1.TreeNode("sdtf");
40
- // We have to be safe and check if the content is a valid SDTF file
41
- if (!content || (content && !content.href))
42
- throw new viewer_shared_services_1.ShapeDiverViewerDataProcessingError("SDTFEngine.loadContent: Invalid content was provided to geometry engine.");
43
- // create the sdtf sdk
44
- const sdk = jwtToken
45
- ? yield (0, sdk_sdtf_v1_1.create)({ authToken: jwtToken })
46
- : yield (0, sdk_sdtf_v1_1.create)();
47
- // crete the sdtf parser
48
- const parser = sdk.createParser();
49
- // parse the file
50
- this._parsedFile = yield parser.readFromUrl(content.href);
51
- // reset overview — it will be populated during item loading
52
- this._overview = {};
53
- // load all chunks in parallel
54
- const chunks = yield Promise.all(this._parsedFile.chunks.map((chunk, i) => this.loadChunk(chunk, i)));
55
- for (const chunk of chunks)
56
- node.children.push(chunk);
57
- // create the overview from data collected during item loading
58
- node.data.push(new viewer_shared_node_tree_1.SDTFOverviewData(this._overview));
59
- return node;
60
- });
61
- }
62
- // #endregion Public Methods (1)
63
- // #region Private Methods (5)
64
- /**
65
- * Update the overview with a single attribute entry.
66
- * Called during item loading so we avoid a separate pass over all items.
67
- */
68
- updateOverview(key, dataTypehint, value) {
69
- var _a, _b, _c, _d;
70
- const overview = this._overview;
71
- // check if the attribute is already in the overview
72
- const existingEntries = overview[key]
73
- ? overview[key].filter((o) => o.typeHint === dataTypehint)
74
- : [];
75
- if (overview[key] && existingEntries.length > 0) {
76
- // update the existing entry
77
- const entry = existingEntries[0];
78
- entry.count++;
79
- if (sdk_sdtf_primitives_1.SdtfPrimitiveTypeGuard.isStringType(dataTypehint)) {
80
- if (!((_a = entry.values) === null || _a === void 0 ? void 0 : _a.includes(value))) {
81
- (_b = entry.values) === null || _b === void 0 ? void 0 : _b.push(value);
82
- (_c = entry.countForValue) === null || _c === void 0 ? void 0 : _c.push(1);
83
- }
84
- else {
85
- const index = (_d = entry.values) === null || _d === void 0 ? void 0 : _d.indexOf(value);
86
- if (index !== undefined && index > -1)
87
- entry.countForValue[index] += 1;
88
- }
89
- }
90
- if (sdk_sdtf_primitives_1.SdtfPrimitiveTypeGuard.isNumberType(dataTypehint)) {
91
- entry.min = Math.min(value, entry.min);
92
- entry.max = Math.max(value, entry.max);
93
- }
94
- }
95
- else {
96
- if (overview[key]) {
97
- overview[key].push({
98
- typeHint: dataTypehint,
99
- count: 1,
100
- });
101
- }
102
- else {
103
- overview[key] = [
104
- {
105
- typeHint: dataTypehint,
106
- count: 1,
107
- },
108
- ];
109
- }
110
- const newEntry = overview[key][overview[key].length - 1];
111
- if (sdk_sdtf_primitives_1.SdtfPrimitiveTypeGuard.isStringType(dataTypehint)) {
112
- newEntry.values = [value];
113
- newEntry.countForValue = [1];
114
- }
115
- if (sdk_sdtf_primitives_1.SdtfPrimitiveTypeGuard.isNumberType(dataTypehint)) {
116
- newEntry.min = value;
117
- newEntry.max = value;
118
- }
119
- }
120
- }
121
- /**
122
- * Load the attributes into a SDTFAttributesData data item.
123
- *
124
- * @param attributes
125
- * @returns
126
- */
127
- loadAttributes(attributes) {
128
- var _a;
129
- return __awaiter(this, void 0, void 0, function* () {
130
- const data = new viewer_shared_node_tree_1.SDTFAttributesData();
131
- const keys = Object.keys(attributes.entries);
132
- // Separate keys into primitive (need content now) and non-primitive (lazy)
133
- const primitiveKeys = [];
134
- const lazyKeys = [];
135
- for (const key of keys) {
136
- const typeName = (_a = attributes.entries[key].typeHint) === null || _a === void 0 ? void 0 : _a.name;
137
- if (sdk_sdtf_primitives_1.SdtfPrimitiveTypeGuard.isBooleanType(typeName) ||
138
- sdk_sdtf_primitives_1.SdtfPrimitiveTypeGuard.isColorType(typeName) ||
139
- sdk_sdtf_primitives_1.SdtfPrimitiveTypeGuard.isNumberType(typeName) ||
140
- sdk_sdtf_primitives_1.SdtfPrimitiveTypeGuard.isStringType(typeName)) {
141
- primitiveKeys.push(key);
142
- }
143
- else {
144
- lazyKeys.push(key);
145
- }
146
- }
147
- // Fetch all primitive attribute contents in parallel
148
- const primitiveContents = yield Promise.all(primitiveKeys.map((key) => attributes.entries[key].getContent()));
149
- for (let i = 0; i < primitiveKeys.length; i++) {
150
- const key = primitiveKeys[i];
151
- const typeHint = attributes.entries[key].typeHint === undefined
152
- ? "undefined"
153
- : attributes.entries[key].typeHint.name;
154
- data.attributes[key] = new viewer_shared_node_tree_1.SDTFAttributeData(typeHint, primitiveContents[i]);
155
- // Update overview inline to avoid a second pass
156
- this.updateOverview(key, typeHint, primitiveContents[i]);
157
- }
158
- // Non-primitive attributes stay lazy
159
- for (const key of lazyKeys) {
160
- const typeHint = attributes.entries[key].typeHint === undefined
161
- ? "undefined"
162
- : attributes.entries[key].typeHint.name;
163
- data.attributes[key] = new viewer_shared_node_tree_1.SDTFAttributeData(typeHint, () => __awaiter(this, void 0, void 0, function* () {
164
- return yield attributes.entries[key].getContent();
165
- }));
166
- }
167
- return data;
168
- });
169
- }
170
- /**
171
- * Load the chunk into a scene graph node.
172
- *
173
- * @param chunk
174
- * @param chunkId
175
- * @returns
176
- */
177
- loadChunk(chunk, chunkId) {
178
- return __awaiter(this, void 0, void 0, function* () {
179
- const chunkDef = new viewer_shared_node_tree_1.TreeNode(chunk.name || "chunk_" + chunkId);
180
- // if there are attributes, add them to the chunk as data
181
- if (chunk.attributes !== undefined) {
182
- chunkDef.data.push(yield this.loadAttributes(chunk.attributes));
183
- }
184
- // load items and nodes in parallel
185
- const [items, nodes] = yield Promise.all([
186
- chunk.items !== undefined && chunk.items.length > 0
187
- ? Promise.all(chunk.items.map((item, i) => this.loadItem(item, i)))
188
- : [],
189
- chunk.nodes !== undefined && chunk.nodes.length > 0
190
- ? Promise.all(chunk.nodes.map((n, i) => this.loadNode(n, i)))
191
- : [],
192
- ]);
193
- if (items.length > 0)
194
- chunkDef.addChild(items);
195
- if (nodes.length > 0)
196
- chunkDef.addChild(nodes);
197
- return chunkDef;
198
- });
199
- }
200
- /**
201
- * Load the item into a scene graph node.
202
- *
203
- * @param item
204
- * @param itemId
205
- * @returns
206
- */
207
- loadItem(item, itemId) {
208
- return __awaiter(this, void 0, void 0, function* () {
209
- const itemDef = new viewer_shared_node_tree_1.TreeNode(itemId + "");
210
- // if there are attributes, add them to the item
211
- let attributes;
212
- if (item.attributes !== undefined)
213
- attributes = yield this.loadAttributes(item.attributes);
214
- // create the typehint
215
- const typeHint = item.typeHint === undefined ? "undefined" : item.typeHint.name;
216
- const isPrimitive = sdk_sdtf_primitives_1.SdtfPrimitiveTypeGuard.isBooleanType(typeHint) ||
217
- sdk_sdtf_primitives_1.SdtfPrimitiveTypeGuard.isColorType(typeHint) ||
218
- sdk_sdtf_primitives_1.SdtfPrimitiveTypeGuard.isNumberType(typeHint) ||
219
- sdk_sdtf_primitives_1.SdtfPrimitiveTypeGuard.isStringType(typeHint);
220
- // For primitive items, fetch content in parallel with attributes (already done above)
221
- const itemData = isPrimitive
222
- ? new viewer_shared_node_tree_1.SDTFItemData(typeHint, yield item.getContent(), attributes === null || attributes === void 0 ? void 0 : attributes.attributes)
223
- : new viewer_shared_node_tree_1.SDTFItemData(typeHint, () => __awaiter(this, void 0, void 0, function* () {
224
- return yield item.getContent();
225
- }), attributes === null || attributes === void 0 ? void 0 : attributes.attributes);
226
- itemDef.data.push(itemData);
227
- return itemDef;
228
- });
229
- }
230
- /**
231
- * Load the node into a scene graph node.
232
- *
233
- * @param node
234
- * @param nodeId
235
- * @returns
236
- */
237
- loadNode(node, nodeId) {
238
- return __awaiter(this, void 0, void 0, function* () {
239
- const nodeDef = new viewer_shared_node_tree_1.TreeNode(node.name || "node_" + nodeId);
240
- // if there are attributes, add them to the node as data
241
- if (node.attributes !== undefined) {
242
- nodeDef.data.push(yield this.loadAttributes(node.attributes));
243
- }
244
- // load items and nodes in parallel
245
- const [items, nodes] = yield Promise.all([
246
- node.items !== undefined && node.items.length > 0
247
- ? Promise.all(node.items.map((item, i) => this.loadItem(item, i)))
248
- : [],
249
- node.nodes !== undefined && node.nodes.length > 0
250
- ? Promise.all(node.nodes.map((n, i) => this.loadNode(n, i)))
251
- : [],
252
- ]);
253
- if (items.length > 0)
254
- nodeDef.addChild(items);
255
- if (nodes.length > 0)
256
- nodeDef.addChild(nodes);
257
- return nodeDef;
258
- });
259
- }
260
- }
261
- exports.SDTFEngine = SDTFEngine;
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.SDTFEngine = void 0;
13
+ const sdk_sdtf_primitives_1 = require("@shapediver/sdk.sdtf-primitives");
14
+ const sdk_sdtf_v1_1 = require("@shapediver/sdk.sdtf-v1");
15
+ const viewer_shared_node_tree_1 = require("@shapediver/viewer.shared.node-tree");
16
+ const viewer_shared_services_1 = require("@shapediver/viewer.shared.services");
17
+ class SDTFEngine {
18
+ constructor() {
19
+ // #region Properties (4)
20
+ this._logger = viewer_shared_services_1.Logger.instance;
21
+ this._overview = {};
22
+ // #endregion Private Methods (5)
23
+ }
24
+ // #endregion Properties (4)
25
+ // #region Public Static Accessors (1)
26
+ static get instance() {
27
+ return this._instance || (this._instance = new this());
28
+ }
29
+ // #endregion Public Static Accessors (1)
30
+ // #region Public Methods (1)
31
+ /**
32
+ * Load the sdtf content into a scene graph node.
33
+ *
34
+ * @param content the geometry content
35
+ * @returns the scene graph node
36
+ */
37
+ loadContent(content, jwtToken) {
38
+ return __awaiter(this, void 0, void 0, function* () {
39
+ const node = new viewer_shared_node_tree_1.TreeNode("sdtf");
40
+ // We have to be safe and check if the content is a valid SDTF file
41
+ if (!content || (content && !content.href))
42
+ throw new viewer_shared_services_1.ShapeDiverViewerDataProcessingError("SDTFEngine.loadContent: Invalid content was provided to geometry engine.");
43
+ // create the sdtf sdk
44
+ const sdk = jwtToken
45
+ ? yield (0, sdk_sdtf_v1_1.create)({ authToken: jwtToken })
46
+ : yield (0, sdk_sdtf_v1_1.create)();
47
+ // crete the sdtf parser
48
+ const parser = sdk.createParser();
49
+ // parse the file
50
+ this._parsedFile = yield parser.readFromUrl(content.href);
51
+ // reset overview — it will be populated during item loading
52
+ this._overview = {};
53
+ // load all chunks in parallel
54
+ const chunks = yield Promise.all(this._parsedFile.chunks.map((chunk, i) => this.loadChunk(chunk, i)));
55
+ for (const chunk of chunks)
56
+ node.children.push(chunk);
57
+ // create the overview from data collected during item loading
58
+ node.data.push(new viewer_shared_node_tree_1.SDTFOverviewData(this._overview));
59
+ return node;
60
+ });
61
+ }
62
+ // #endregion Public Methods (1)
63
+ // #region Private Methods (5)
64
+ /**
65
+ * Update the overview with a single attribute entry.
66
+ * Called during item loading so we avoid a separate pass over all items.
67
+ */
68
+ updateOverview(key, dataTypehint, value) {
69
+ var _a, _b, _c, _d;
70
+ const overview = this._overview;
71
+ // check if the attribute is already in the overview
72
+ const existingEntries = overview[key]
73
+ ? overview[key].filter((o) => o.typeHint === dataTypehint)
74
+ : [];
75
+ if (overview[key] && existingEntries.length > 0) {
76
+ // update the existing entry
77
+ const entry = existingEntries[0];
78
+ entry.count++;
79
+ if (sdk_sdtf_primitives_1.SdtfPrimitiveTypeGuard.isStringType(dataTypehint)) {
80
+ if (!((_a = entry.values) === null || _a === void 0 ? void 0 : _a.includes(value))) {
81
+ (_b = entry.values) === null || _b === void 0 ? void 0 : _b.push(value);
82
+ (_c = entry.countForValue) === null || _c === void 0 ? void 0 : _c.push(1);
83
+ }
84
+ else {
85
+ const index = (_d = entry.values) === null || _d === void 0 ? void 0 : _d.indexOf(value);
86
+ if (index !== undefined && index > -1)
87
+ entry.countForValue[index] += 1;
88
+ }
89
+ }
90
+ if (sdk_sdtf_primitives_1.SdtfPrimitiveTypeGuard.isNumberType(dataTypehint)) {
91
+ entry.min = Math.min(value, entry.min);
92
+ entry.max = Math.max(value, entry.max);
93
+ }
94
+ }
95
+ else {
96
+ if (overview[key]) {
97
+ overview[key].push({
98
+ typeHint: dataTypehint,
99
+ count: 1,
100
+ });
101
+ }
102
+ else {
103
+ overview[key] = [
104
+ {
105
+ typeHint: dataTypehint,
106
+ count: 1,
107
+ },
108
+ ];
109
+ }
110
+ const newEntry = overview[key][overview[key].length - 1];
111
+ if (sdk_sdtf_primitives_1.SdtfPrimitiveTypeGuard.isStringType(dataTypehint)) {
112
+ newEntry.values = [value];
113
+ newEntry.countForValue = [1];
114
+ }
115
+ if (sdk_sdtf_primitives_1.SdtfPrimitiveTypeGuard.isNumberType(dataTypehint)) {
116
+ newEntry.min = value;
117
+ newEntry.max = value;
118
+ }
119
+ }
120
+ }
121
+ /**
122
+ * Load the attributes into a SDTFAttributesData data item.
123
+ *
124
+ * @param attributes
125
+ * @returns
126
+ */
127
+ loadAttributes(attributes) {
128
+ return __awaiter(this, void 0, void 0, function* () {
129
+ var _a;
130
+ const data = new viewer_shared_node_tree_1.SDTFAttributesData();
131
+ const keys = Object.keys(attributes.entries);
132
+ // Separate keys into primitive (need content now) and non-primitive (lazy)
133
+ const primitiveKeys = [];
134
+ const lazyKeys = [];
135
+ for (const key of keys) {
136
+ const typeName = (_a = attributes.entries[key].typeHint) === null || _a === void 0 ? void 0 : _a.name;
137
+ if (sdk_sdtf_primitives_1.SdtfPrimitiveTypeGuard.isBooleanType(typeName) ||
138
+ sdk_sdtf_primitives_1.SdtfPrimitiveTypeGuard.isColorType(typeName) ||
139
+ sdk_sdtf_primitives_1.SdtfPrimitiveTypeGuard.isNumberType(typeName) ||
140
+ sdk_sdtf_primitives_1.SdtfPrimitiveTypeGuard.isStringType(typeName)) {
141
+ primitiveKeys.push(key);
142
+ }
143
+ else {
144
+ lazyKeys.push(key);
145
+ }
146
+ }
147
+ // Fetch all primitive attribute contents in parallel
148
+ const primitiveContents = yield Promise.all(primitiveKeys.map((key) => attributes.entries[key].getContent()));
149
+ for (let i = 0; i < primitiveKeys.length; i++) {
150
+ const key = primitiveKeys[i];
151
+ const typeHint = attributes.entries[key].typeHint === undefined
152
+ ? "undefined"
153
+ : attributes.entries[key].typeHint.name;
154
+ data.attributes[key] = new viewer_shared_node_tree_1.SDTFAttributeData(typeHint, primitiveContents[i]);
155
+ // Update overview inline to avoid a second pass
156
+ this.updateOverview(key, typeHint, primitiveContents[i]);
157
+ }
158
+ // Non-primitive attributes stay lazy
159
+ for (const key of lazyKeys) {
160
+ const typeHint = attributes.entries[key].typeHint === undefined
161
+ ? "undefined"
162
+ : attributes.entries[key].typeHint.name;
163
+ data.attributes[key] = new viewer_shared_node_tree_1.SDTFAttributeData(typeHint, () => __awaiter(this, void 0, void 0, function* () {
164
+ return yield attributes.entries[key].getContent();
165
+ }));
166
+ }
167
+ return data;
168
+ });
169
+ }
170
+ /**
171
+ * Load the chunk into a scene graph node.
172
+ *
173
+ * @param chunk
174
+ * @param chunkId
175
+ * @returns
176
+ */
177
+ loadChunk(chunk, chunkId) {
178
+ return __awaiter(this, void 0, void 0, function* () {
179
+ const chunkDef = new viewer_shared_node_tree_1.TreeNode(chunk.name || "chunk_" + chunkId);
180
+ // if there are attributes, add them to the chunk as data
181
+ if (chunk.attributes !== undefined) {
182
+ chunkDef.data.push(yield this.loadAttributes(chunk.attributes));
183
+ }
184
+ // load items and nodes in parallel
185
+ const [items, nodes] = yield Promise.all([
186
+ chunk.items !== undefined && chunk.items.length > 0
187
+ ? Promise.all(chunk.items.map((item, i) => this.loadItem(item, i)))
188
+ : [],
189
+ chunk.nodes !== undefined && chunk.nodes.length > 0
190
+ ? Promise.all(chunk.nodes.map((n, i) => this.loadNode(n, i)))
191
+ : [],
192
+ ]);
193
+ if (items.length > 0)
194
+ chunkDef.addChild(items);
195
+ if (nodes.length > 0)
196
+ chunkDef.addChild(nodes);
197
+ return chunkDef;
198
+ });
199
+ }
200
+ /**
201
+ * Load the item into a scene graph node.
202
+ *
203
+ * @param item
204
+ * @param itemId
205
+ * @returns
206
+ */
207
+ loadItem(item, itemId) {
208
+ return __awaiter(this, void 0, void 0, function* () {
209
+ const itemDef = new viewer_shared_node_tree_1.TreeNode(itemId + "");
210
+ // if there are attributes, add them to the item
211
+ let attributes;
212
+ if (item.attributes !== undefined)
213
+ attributes = yield this.loadAttributes(item.attributes);
214
+ // create the typehint
215
+ const typeHint = item.typeHint === undefined ? "undefined" : item.typeHint.name;
216
+ const isPrimitive = sdk_sdtf_primitives_1.SdtfPrimitiveTypeGuard.isBooleanType(typeHint) ||
217
+ sdk_sdtf_primitives_1.SdtfPrimitiveTypeGuard.isColorType(typeHint) ||
218
+ sdk_sdtf_primitives_1.SdtfPrimitiveTypeGuard.isNumberType(typeHint) ||
219
+ sdk_sdtf_primitives_1.SdtfPrimitiveTypeGuard.isStringType(typeHint);
220
+ // For primitive items, fetch content in parallel with attributes (already done above)
221
+ const itemData = isPrimitive
222
+ ? new viewer_shared_node_tree_1.SDTFItemData(typeHint, yield item.getContent(), attributes === null || attributes === void 0 ? void 0 : attributes.attributes)
223
+ : new viewer_shared_node_tree_1.SDTFItemData(typeHint, () => __awaiter(this, void 0, void 0, function* () {
224
+ return yield item.getContent();
225
+ }), attributes === null || attributes === void 0 ? void 0 : attributes.attributes);
226
+ itemDef.data.push(itemData);
227
+ return itemDef;
228
+ });
229
+ }
230
+ /**
231
+ * Load the node into a scene graph node.
232
+ *
233
+ * @param node
234
+ * @param nodeId
235
+ * @returns
236
+ */
237
+ loadNode(node, nodeId) {
238
+ return __awaiter(this, void 0, void 0, function* () {
239
+ const nodeDef = new viewer_shared_node_tree_1.TreeNode(node.name || "node_" + nodeId);
240
+ // if there are attributes, add them to the node as data
241
+ if (node.attributes !== undefined) {
242
+ nodeDef.data.push(yield this.loadAttributes(node.attributes));
243
+ }
244
+ // load items and nodes in parallel
245
+ const [items, nodes] = yield Promise.all([
246
+ node.items !== undefined && node.items.length > 0
247
+ ? Promise.all(node.items.map((item, i) => this.loadItem(item, i)))
248
+ : [],
249
+ node.nodes !== undefined && node.nodes.length > 0
250
+ ? Promise.all(node.nodes.map((n, i) => this.loadNode(n, i)))
251
+ : [],
252
+ ]);
253
+ if (items.length > 0)
254
+ nodeDef.addChild(items);
255
+ if (nodes.length > 0)
256
+ nodeDef.addChild(nodes);
257
+ return nodeDef;
258
+ });
259
+ }
260
+ }
261
+ exports.SDTFEngine = SDTFEngine;
262
262
  //# sourceMappingURL=SDTFEngine.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"SDTFEngine.js","sourceRoot":"","sources":["../src/SDTFEngine.ts"],"names":[],"mappings":";;;;;;;;;;;;AACA,yEAAuE;AACvE,yDAOiC;AACjC,iFAO6C;AAC7C,+EAG4C;AAG5C,MAAa,UAAU;IAAvB;QACC,yBAAyB;QAER,YAAO,GAAW,+BAAM,CAAC,QAAQ,CAAC;QAM3C,cAAS,GAAkB,EAAE,CAAC;QAoTtC,iCAAiC;IAClC,CAAC;IAnTA,4BAA4B;IAE5B,sCAAsC;IAE/B,MAAM,KAAK,QAAQ;QACzB,OAAO,IAAI,CAAC,SAAS,IAAI,CAAC,IAAI,CAAC,SAAS,GAAG,IAAI,IAAI,EAAE,CAAC,CAAC;IACxD,CAAC;IAED,yCAAyC;IAEzC,6BAA6B;IAE7B;;;;;OAKG;IACU,WAAW,CACvB,OAAyB,EACzB,QAAiB;;YAEjB,MAAM,IAAI,GAAG,IAAI,kCAAQ,CAAC,MAAM,CAAC,CAAC;YAElC,mEAAmE;YACnE,IAAI,C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.ts CHANGED
@@ -1,3 +1,3 @@
1
- import { SDTFEngine } from "./SDTFEngine";
2
- export { SDTFEngine };
1
+ import { SDTFEngine } from "./SDTFEngine";
2
+ export { SDTFEngine };
3
3
  //# sourceMappingURL=index.d.ts.map
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.SDTFEngine = void 0;
4
- const SDTFEngine_1 = require("./SDTFEngine");
5
- Object.defineProperty(exports, "SDTFEngine", { enumerable: true, get: function () { return SDTFEngine_1.SDTFEngine; } });
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SDTFEngine = void 0;
4
+ const SDTFEngine_1 = require("./SDTFEngine");
5
+ Object.defineProperty(exports, "SDTFEngine", { enumerable: true, get: function () { return SDTFEngine_1.SDTFEngine; } });
6
6
  //# sourceMappingURL=index.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shapediver/viewer.data-engine.sdtf-engine",
3
- "version": "3.16.8",
3
+ "version": "3.16.10",
4
4
  "description": "",
5
5
  "keywords": [],
6
6
  "author": "Michael Oppitz <michael@shapediver.com>",
@@ -38,14 +38,14 @@
38
38
  "testEnvironment": "node"
39
39
  },
40
40
  "dependencies": {
41
- "@shapediver/sdk.geometry-api-sdk-v2": "3.4.0",
42
- "@shapediver/sdk.sdtf-v1": "1.7.1",
43
- "@shapediver/viewer.data-engine.shared-types": "3.16.8",
44
- "@shapediver/viewer.shared.build-data": "3.16.8",
45
- "@shapediver/viewer.shared.node-tree": "3.16.8",
46
- "@shapediver/viewer.shared.services": "3.16.8",
47
- "@shapediver/viewer.shared.types": "3.16.8",
48
- "gl-matrix": "3.3.0"
41
+ "@shapediver/sdk.geometry-api-sdk-v2": "3.4.1",
42
+ "@shapediver/sdk.sdtf-v1": "1.7.2",
43
+ "@shapediver/viewer.data-engine.shared-types": "3.16.10",
44
+ "@shapediver/viewer.shared.build-data": "3.16.10",
45
+ "@shapediver/viewer.shared.node-tree": "3.16.10",
46
+ "@shapediver/viewer.shared.services": "3.16.10",
47
+ "@shapediver/viewer.shared.types": "3.16.10",
48
+ "gl-matrix": "3.4.4"
49
49
  },
50
- "gitHead": "d0305585911852e700f9e3768e5edd4bac222ea0"
50
+ "gitHead": "4f56737c5446d23eeb2d55770b88896da115e430"
51
51
  }