@2112-lab/central-plant 0.1.71 → 0.1.72
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/bundle/index.js +1332 -168
- package/dist/cjs/src/core/centralPlant.js +206 -154
- package/dist/cjs/src/index.js +5 -0
- package/dist/cjs/src/managers/CacheManager.js +1083 -0
- package/dist/cjs/src/managers/scene/modelManager.js +48 -12
- package/dist/cjs/src/managers/scene/sceneOperationsManager.js +2 -2
- package/dist/esm/src/core/centralPlant.js +206 -154
- package/dist/esm/src/index.js +1 -0
- package/dist/esm/src/managers/CacheManager.js +1075 -0
- package/dist/esm/src/managers/scene/modelManager.js +48 -12
- package/dist/esm/src/managers/scene/sceneOperationsManager.js +2 -2
- package/package.json +1 -1
|
@@ -15,7 +15,7 @@ var CentralPlant = /*#__PURE__*/function (_BaseDisposable) {
|
|
|
15
15
|
* Initialize the CentralPlant manager
|
|
16
16
|
*
|
|
17
17
|
* @constructor
|
|
18
|
-
* @version 0.1.
|
|
18
|
+
* @version 0.1.72
|
|
19
19
|
* @updated 2025-10-22
|
|
20
20
|
*
|
|
21
21
|
* @description Creates a new CentralPlant instance and initializes internal managers and utilities.
|
|
@@ -54,6 +54,9 @@ var CentralPlant = /*#__PURE__*/function (_BaseDisposable) {
|
|
|
54
54
|
// Initialize internals handler
|
|
55
55
|
_this.internals = new CentralPlantInternals(_this);
|
|
56
56
|
|
|
57
|
+
// Optional cache primer function (dependency injection)
|
|
58
|
+
_this.cachePrimer = null;
|
|
59
|
+
|
|
57
60
|
// Initialize utilities immediately (they don't need scene viewer)
|
|
58
61
|
_this.internals.initializeUtilities();
|
|
59
62
|
|
|
@@ -81,6 +84,54 @@ var CentralPlant = /*#__PURE__*/function (_BaseDisposable) {
|
|
|
81
84
|
return this.internals.setSceneViewer(sceneViewer);
|
|
82
85
|
}
|
|
83
86
|
|
|
87
|
+
/**
|
|
88
|
+
* Set the cache primer function (dependency injection)
|
|
89
|
+
* @param {Function} primerFn - Function that takes array of URLs and primes the cache
|
|
90
|
+
*/
|
|
91
|
+
}, {
|
|
92
|
+
key: "setCachePrimer",
|
|
93
|
+
value: function setCachePrimer(primerFn) {
|
|
94
|
+
if (typeof primerFn !== 'function') {
|
|
95
|
+
console.warn('⚠️ Cache primer must be a function');
|
|
96
|
+
return;
|
|
97
|
+
}
|
|
98
|
+
this.cachePrimer = primerFn;
|
|
99
|
+
console.log('✅ Cache primer function set');
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
/**
|
|
103
|
+
* Prime the cache with the given URLs using the injected primer
|
|
104
|
+
* @param {Array<string>} urls - Array of URLs to cache
|
|
105
|
+
* @returns {Promise<Object>} Result of priming operation
|
|
106
|
+
*/
|
|
107
|
+
}, {
|
|
108
|
+
key: "primeCache",
|
|
109
|
+
value: (function () {
|
|
110
|
+
var _primeCache = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(urls) {
|
|
111
|
+
return _regenerator().w(function (_context) {
|
|
112
|
+
while (1) switch (_context.n) {
|
|
113
|
+
case 0:
|
|
114
|
+
if (this.cachePrimer) {
|
|
115
|
+
_context.n = 1;
|
|
116
|
+
break;
|
|
117
|
+
}
|
|
118
|
+
console.log('ℹ️ No cache primer set, skipping explicit cache priming');
|
|
119
|
+
return _context.a(2, {
|
|
120
|
+
success: 0,
|
|
121
|
+
failed: 0,
|
|
122
|
+
skipped: true
|
|
123
|
+
});
|
|
124
|
+
case 1:
|
|
125
|
+
console.log('🔄 Delegating to injected cache primer...', urls.length, 'urls');
|
|
126
|
+
return _context.a(2, this.cachePrimer(urls));
|
|
127
|
+
}
|
|
128
|
+
}, _callee, this);
|
|
129
|
+
}));
|
|
130
|
+
function primeCache(_x) {
|
|
131
|
+
return _primeCache.apply(this, arguments);
|
|
132
|
+
}
|
|
133
|
+
return primeCache;
|
|
134
|
+
}()
|
|
84
135
|
/**
|
|
85
136
|
* Set all managers and utilities on the scene viewer instance
|
|
86
137
|
* @returns {boolean} True if attachment was successful, false otherwise
|
|
@@ -92,6 +143,7 @@ var CentralPlant = /*#__PURE__*/function (_BaseDisposable) {
|
|
|
92
143
|
* console.log('Managers and utilities attached to component');
|
|
93
144
|
* }
|
|
94
145
|
*/
|
|
146
|
+
)
|
|
95
147
|
}, {
|
|
96
148
|
key: "attachToComponent",
|
|
97
149
|
value: function attachToComponent() {
|
|
@@ -133,12 +185,12 @@ var CentralPlant = /*#__PURE__*/function (_BaseDisposable) {
|
|
|
133
185
|
}, {
|
|
134
186
|
key: "setImportedSceneData",
|
|
135
187
|
value: (function () {
|
|
136
|
-
var _setImportedSceneData = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function
|
|
188
|
+
var _setImportedSceneData = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2(sceneData) {
|
|
137
189
|
var _this$importedSceneDa, _this$importedSceneDa2;
|
|
138
|
-
return _regenerator().w(function (
|
|
139
|
-
while (1) switch (
|
|
190
|
+
return _regenerator().w(function (_context2) {
|
|
191
|
+
while (1) switch (_context2.n) {
|
|
140
192
|
case 0:
|
|
141
|
-
|
|
193
|
+
_context2.n = 1;
|
|
142
194
|
return this.internals.clearSceneComponents();
|
|
143
195
|
case 1:
|
|
144
196
|
this.importedSceneData = _objectSpread2({}, sceneData);
|
|
@@ -151,11 +203,11 @@ var CentralPlant = /*#__PURE__*/function (_BaseDisposable) {
|
|
|
151
203
|
// Reset component counter based on imported components to avoid ID conflicts
|
|
152
204
|
this.internals.resetComponentCounter();
|
|
153
205
|
case 2:
|
|
154
|
-
return
|
|
206
|
+
return _context2.a(2);
|
|
155
207
|
}
|
|
156
|
-
},
|
|
208
|
+
}, _callee2, this);
|
|
157
209
|
}));
|
|
158
|
-
function setImportedSceneData(
|
|
210
|
+
function setImportedSceneData(_x2) {
|
|
159
211
|
return _setImportedSceneData.apply(this, arguments);
|
|
160
212
|
}
|
|
161
213
|
return setImportedSceneData;
|
|
@@ -1061,41 +1113,41 @@ var CentralPlant = /*#__PURE__*/function (_BaseDisposable) {
|
|
|
1061
1113
|
}, {
|
|
1062
1114
|
key: "getComponents",
|
|
1063
1115
|
value: (function () {
|
|
1064
|
-
var _getComponents = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function
|
|
1116
|
+
var _getComponents = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee3() {
|
|
1065
1117
|
var options,
|
|
1066
1118
|
validation,
|
|
1067
1119
|
enhancedOptions,
|
|
1068
|
-
|
|
1120
|
+
_args3 = arguments,
|
|
1069
1121
|
_t;
|
|
1070
|
-
return _regenerator().w(function (
|
|
1071
|
-
while (1) switch (
|
|
1122
|
+
return _regenerator().w(function (_context3) {
|
|
1123
|
+
while (1) switch (_context3.n) {
|
|
1072
1124
|
case 0:
|
|
1073
|
-
options =
|
|
1125
|
+
options = _args3.length > 0 && _args3[0] !== undefined ? _args3[0] : {};
|
|
1074
1126
|
// Validate filter options using centralized validator
|
|
1075
1127
|
validation = this.internals.validator.validateComponentFilter(options);
|
|
1076
1128
|
if (validation.isValid) {
|
|
1077
|
-
|
|
1129
|
+
_context3.n = 1;
|
|
1078
1130
|
break;
|
|
1079
1131
|
}
|
|
1080
1132
|
console.warn('⚠️ getComponents(): Invalid filter options provided:', validation.message);
|
|
1081
|
-
return
|
|
1133
|
+
return _context3.a(2, []);
|
|
1082
1134
|
case 1:
|
|
1083
|
-
|
|
1135
|
+
_context3.p = 1;
|
|
1084
1136
|
// Always include metadata
|
|
1085
1137
|
enhancedOptions = _objectSpread2(_objectSpread2({}, options), {}, {
|
|
1086
1138
|
includeMetadata: true
|
|
1087
1139
|
});
|
|
1088
|
-
|
|
1140
|
+
_context3.n = 2;
|
|
1089
1141
|
return this.managers.componentDataManager.getDictionaryComponents(enhancedOptions);
|
|
1090
1142
|
case 2:
|
|
1091
|
-
return
|
|
1143
|
+
return _context3.a(2, _context3.v);
|
|
1092
1144
|
case 3:
|
|
1093
|
-
|
|
1094
|
-
_t =
|
|
1145
|
+
_context3.p = 3;
|
|
1146
|
+
_t = _context3.v;
|
|
1095
1147
|
console.error('❌ getDictionaryComponents(): Error retrieving available components:', _t);
|
|
1096
|
-
return
|
|
1148
|
+
return _context3.a(2, []);
|
|
1097
1149
|
}
|
|
1098
|
-
},
|
|
1150
|
+
}, _callee3, this, [[1, 3]]);
|
|
1099
1151
|
}));
|
|
1100
1152
|
function getComponents() {
|
|
1101
1153
|
return _getComponents.apply(this, arguments);
|
|
@@ -1198,25 +1250,25 @@ var CentralPlant = /*#__PURE__*/function (_BaseDisposable) {
|
|
|
1198
1250
|
}, {
|
|
1199
1251
|
key: "extendComponentDictionary",
|
|
1200
1252
|
value: (function () {
|
|
1201
|
-
var _extendComponentDictionary = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function
|
|
1202
|
-
return _regenerator().w(function (
|
|
1203
|
-
while (1) switch (
|
|
1253
|
+
var _extendComponentDictionary = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee4(additionalComponents) {
|
|
1254
|
+
return _regenerator().w(function (_context4) {
|
|
1255
|
+
while (1) switch (_context4.n) {
|
|
1204
1256
|
case 0:
|
|
1205
1257
|
if (this.managers.componentDataManager) {
|
|
1206
|
-
|
|
1258
|
+
_context4.n = 1;
|
|
1207
1259
|
break;
|
|
1208
1260
|
}
|
|
1209
1261
|
console.warn('⚠️ extendComponentDictionary(): Component data manager not available');
|
|
1210
|
-
return
|
|
1262
|
+
return _context4.a(2, false);
|
|
1211
1263
|
case 1:
|
|
1212
|
-
|
|
1264
|
+
_context4.n = 2;
|
|
1213
1265
|
return this.managers.componentDataManager.extendComponentDictionary(additionalComponents);
|
|
1214
1266
|
case 2:
|
|
1215
|
-
return
|
|
1267
|
+
return _context4.a(2, _context4.v);
|
|
1216
1268
|
}
|
|
1217
|
-
},
|
|
1269
|
+
}, _callee4, this);
|
|
1218
1270
|
}));
|
|
1219
|
-
function extendComponentDictionary(
|
|
1271
|
+
function extendComponentDictionary(_x3) {
|
|
1220
1272
|
return _extendComponentDictionary.apply(this, arguments);
|
|
1221
1273
|
}
|
|
1222
1274
|
return extendComponentDictionary;
|
|
@@ -1237,23 +1289,23 @@ var CentralPlant = /*#__PURE__*/function (_BaseDisposable) {
|
|
|
1237
1289
|
}, {
|
|
1238
1290
|
key: "removeS3Components",
|
|
1239
1291
|
value: (function () {
|
|
1240
|
-
var _removeS3Components = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function
|
|
1241
|
-
return _regenerator().w(function (
|
|
1242
|
-
while (1) switch (
|
|
1292
|
+
var _removeS3Components = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee5() {
|
|
1293
|
+
return _regenerator().w(function (_context5) {
|
|
1294
|
+
while (1) switch (_context5.n) {
|
|
1243
1295
|
case 0:
|
|
1244
1296
|
if (this.managers.componentDataManager) {
|
|
1245
|
-
|
|
1297
|
+
_context5.n = 1;
|
|
1246
1298
|
break;
|
|
1247
1299
|
}
|
|
1248
1300
|
console.warn('⚠️ removeS3Components(): Component data manager not available');
|
|
1249
|
-
return
|
|
1301
|
+
return _context5.a(2, false);
|
|
1250
1302
|
case 1:
|
|
1251
|
-
|
|
1303
|
+
_context5.n = 2;
|
|
1252
1304
|
return this.managers.componentDataManager.removeS3Components();
|
|
1253
1305
|
case 2:
|
|
1254
|
-
return
|
|
1306
|
+
return _context5.a(2, _context5.v);
|
|
1255
1307
|
}
|
|
1256
|
-
},
|
|
1308
|
+
}, _callee5, this);
|
|
1257
1309
|
}));
|
|
1258
1310
|
function removeS3Components() {
|
|
1259
1311
|
return _removeS3Components.apply(this, arguments);
|
|
@@ -1277,25 +1329,25 @@ var CentralPlant = /*#__PURE__*/function (_BaseDisposable) {
|
|
|
1277
1329
|
}, {
|
|
1278
1330
|
key: "removeComponentFromDictionary",
|
|
1279
1331
|
value: (function () {
|
|
1280
|
-
var _removeComponentFromDictionary = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function
|
|
1281
|
-
return _regenerator().w(function (
|
|
1282
|
-
while (1) switch (
|
|
1332
|
+
var _removeComponentFromDictionary = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee6(componentKey) {
|
|
1333
|
+
return _regenerator().w(function (_context6) {
|
|
1334
|
+
while (1) switch (_context6.n) {
|
|
1283
1335
|
case 0:
|
|
1284
1336
|
if (this.managers.componentDataManager) {
|
|
1285
|
-
|
|
1337
|
+
_context6.n = 1;
|
|
1286
1338
|
break;
|
|
1287
1339
|
}
|
|
1288
1340
|
console.warn('⚠️ removeComponentFromDictionary(): Component data manager not available');
|
|
1289
|
-
return
|
|
1341
|
+
return _context6.a(2, false);
|
|
1290
1342
|
case 1:
|
|
1291
|
-
|
|
1343
|
+
_context6.n = 2;
|
|
1292
1344
|
return this.managers.componentDataManager.removeComponentFromDictionary(componentKey);
|
|
1293
1345
|
case 2:
|
|
1294
|
-
return
|
|
1346
|
+
return _context6.a(2, _context6.v);
|
|
1295
1347
|
}
|
|
1296
|
-
},
|
|
1348
|
+
}, _callee6, this);
|
|
1297
1349
|
}));
|
|
1298
|
-
function removeComponentFromDictionary(
|
|
1350
|
+
function removeComponentFromDictionary(_x4) {
|
|
1299
1351
|
return _removeComponentFromDictionary.apply(this, arguments);
|
|
1300
1352
|
}
|
|
1301
1353
|
return removeComponentFromDictionary;
|
|
@@ -1497,51 +1549,51 @@ var CentralPlant = /*#__PURE__*/function (_BaseDisposable) {
|
|
|
1497
1549
|
}, {
|
|
1498
1550
|
key: "initialize2DViewport",
|
|
1499
1551
|
value: function () {
|
|
1500
|
-
var _initialize2DViewport = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function
|
|
1552
|
+
var _initialize2DViewport = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee7(container) {
|
|
1501
1553
|
var viewType,
|
|
1502
1554
|
instanceKey,
|
|
1503
1555
|
success,
|
|
1504
|
-
|
|
1556
|
+
_args7 = arguments,
|
|
1505
1557
|
_t2;
|
|
1506
|
-
return _regenerator().w(function (
|
|
1507
|
-
while (1) switch (
|
|
1558
|
+
return _regenerator().w(function (_context7) {
|
|
1559
|
+
while (1) switch (_context7.n) {
|
|
1508
1560
|
case 0:
|
|
1509
|
-
viewType =
|
|
1510
|
-
instanceKey =
|
|
1561
|
+
viewType = _args7.length > 1 && _args7[1] !== undefined ? _args7[1] : 'top';
|
|
1562
|
+
instanceKey = _args7.length > 2 && _args7[2] !== undefined ? _args7[2] : null;
|
|
1511
1563
|
if (container) {
|
|
1512
|
-
|
|
1564
|
+
_context7.n = 1;
|
|
1513
1565
|
break;
|
|
1514
1566
|
}
|
|
1515
1567
|
console.warn('⚠️ initialize2DViewport(): No container provided');
|
|
1516
|
-
return
|
|
1568
|
+
return _context7.a(2, false);
|
|
1517
1569
|
case 1:
|
|
1518
1570
|
if (this.managers.viewport2DManager) {
|
|
1519
|
-
|
|
1571
|
+
_context7.n = 2;
|
|
1520
1572
|
break;
|
|
1521
1573
|
}
|
|
1522
1574
|
console.warn('⚠️ initialize2DViewport(): Viewport2D manager not available');
|
|
1523
|
-
return
|
|
1575
|
+
return _context7.a(2, false);
|
|
1524
1576
|
case 2:
|
|
1525
|
-
|
|
1526
|
-
|
|
1577
|
+
_context7.p = 2;
|
|
1578
|
+
_context7.n = 3;
|
|
1527
1579
|
return this.managers.viewport2DManager.initialize(container, viewType, instanceKey);
|
|
1528
1580
|
case 3:
|
|
1529
|
-
success =
|
|
1581
|
+
success = _context7.v;
|
|
1530
1582
|
if (success) {
|
|
1531
1583
|
console.log("\u2705 2D viewport initialized successfully (".concat(viewType, " view, key: ").concat(instanceKey || viewType, ")"));
|
|
1532
1584
|
} else {
|
|
1533
1585
|
console.warn("\u26A0\uFE0F Failed to initialize 2D viewport (".concat(viewType, " view)"));
|
|
1534
1586
|
}
|
|
1535
|
-
return
|
|
1587
|
+
return _context7.a(2, success);
|
|
1536
1588
|
case 4:
|
|
1537
|
-
|
|
1538
|
-
_t2 =
|
|
1589
|
+
_context7.p = 4;
|
|
1590
|
+
_t2 = _context7.v;
|
|
1539
1591
|
console.error('❌ initialize2DViewport(): Error initializing 2D viewport:', _t2);
|
|
1540
|
-
return
|
|
1592
|
+
return _context7.a(2, false);
|
|
1541
1593
|
}
|
|
1542
|
-
},
|
|
1594
|
+
}, _callee7, this, [[2, 4]]);
|
|
1543
1595
|
}));
|
|
1544
|
-
function initialize2DViewport(
|
|
1596
|
+
function initialize2DViewport(_x5) {
|
|
1545
1597
|
return _initialize2DViewport.apply(this, arguments);
|
|
1546
1598
|
}
|
|
1547
1599
|
return initialize2DViewport;
|
|
@@ -1687,7 +1739,7 @@ var CentralPlant = /*#__PURE__*/function (_BaseDisposable) {
|
|
|
1687
1739
|
}, {
|
|
1688
1740
|
key: "initializeModelPreloading",
|
|
1689
1741
|
value: (function () {
|
|
1690
|
-
var _initializeModelPreloading = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function
|
|
1742
|
+
var _initializeModelPreloading = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee8() {
|
|
1691
1743
|
var basePath,
|
|
1692
1744
|
normalizedBasePath,
|
|
1693
1745
|
dictionaryPath,
|
|
@@ -1696,13 +1748,13 @@ var CentralPlant = /*#__PURE__*/function (_BaseDisposable) {
|
|
|
1696
1748
|
componentDictionary,
|
|
1697
1749
|
_modelPreloader2,
|
|
1698
1750
|
progress,
|
|
1699
|
-
|
|
1751
|
+
_args8 = arguments,
|
|
1700
1752
|
_t3;
|
|
1701
|
-
return _regenerator().w(function (
|
|
1702
|
-
while (1) switch (
|
|
1753
|
+
return _regenerator().w(function (_context8) {
|
|
1754
|
+
while (1) switch (_context8.n) {
|
|
1703
1755
|
case 0:
|
|
1704
|
-
basePath =
|
|
1705
|
-
|
|
1756
|
+
basePath = _args8.length > 0 && _args8[0] !== undefined ? _args8[0] : '/library/';
|
|
1757
|
+
_context8.p = 1;
|
|
1706
1758
|
// Ensure basePath ends with a slash
|
|
1707
1759
|
normalizedBasePath = basePath.endsWith('/') ? basePath : "".concat(basePath, "/");
|
|
1708
1760
|
dictionaryPath = "".concat(normalizedBasePath, "component-dictionary.json");
|
|
@@ -1713,39 +1765,39 @@ var CentralPlant = /*#__PURE__*/function (_BaseDisposable) {
|
|
|
1713
1765
|
console.log("\uFFFD Models path: ".concat(modelsBasePath));
|
|
1714
1766
|
|
|
1715
1767
|
// Load the component dictionary
|
|
1716
|
-
|
|
1768
|
+
_context8.n = 2;
|
|
1717
1769
|
return fetch(dictionaryPath);
|
|
1718
1770
|
case 2:
|
|
1719
|
-
response =
|
|
1771
|
+
response = _context8.v;
|
|
1720
1772
|
if (response.ok) {
|
|
1721
|
-
|
|
1773
|
+
_context8.n = 3;
|
|
1722
1774
|
break;
|
|
1723
1775
|
}
|
|
1724
1776
|
throw new Error("Failed to load component dictionary: ".concat(response.status));
|
|
1725
1777
|
case 3:
|
|
1726
|
-
|
|
1778
|
+
_context8.n = 4;
|
|
1727
1779
|
return response.json();
|
|
1728
1780
|
case 4:
|
|
1729
|
-
componentDictionary =
|
|
1781
|
+
componentDictionary = _context8.v;
|
|
1730
1782
|
console.log('📚 Component dictionary loaded:', Object.keys(componentDictionary));
|
|
1731
1783
|
|
|
1732
1784
|
// Start preloading all models with the specified base path
|
|
1733
1785
|
_modelPreloader2 = this.getUtility('modelPreloader');
|
|
1734
|
-
|
|
1786
|
+
_context8.n = 5;
|
|
1735
1787
|
return _modelPreloader2.preloadAllModels(componentDictionary, modelsBasePath);
|
|
1736
1788
|
case 5:
|
|
1737
|
-
progress =
|
|
1789
|
+
progress = _context8.v;
|
|
1738
1790
|
console.log('🎉 Model preloading completed:', progress);
|
|
1739
|
-
return
|
|
1791
|
+
return _context8.a(2, progress);
|
|
1740
1792
|
case 6:
|
|
1741
|
-
|
|
1742
|
-
_t3 =
|
|
1793
|
+
_context8.p = 6;
|
|
1794
|
+
_t3 = _context8.v;
|
|
1743
1795
|
console.error('❌ Failed to initialize model preloading:', _t3);
|
|
1744
1796
|
throw _t3;
|
|
1745
1797
|
case 7:
|
|
1746
|
-
return
|
|
1798
|
+
return _context8.a(2);
|
|
1747
1799
|
}
|
|
1748
|
-
},
|
|
1800
|
+
}, _callee8, this, [[1, 6]]);
|
|
1749
1801
|
}));
|
|
1750
1802
|
function initializeModelPreloading() {
|
|
1751
1803
|
return _initializeModelPreloading.apply(this, arguments);
|
|
@@ -1762,57 +1814,57 @@ var CentralPlant = /*#__PURE__*/function (_BaseDisposable) {
|
|
|
1762
1814
|
}, {
|
|
1763
1815
|
key: "importScene",
|
|
1764
1816
|
value: (function () {
|
|
1765
|
-
var _importScene = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function
|
|
1817
|
+
var _importScene = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee9(jsonData) {
|
|
1766
1818
|
var validation, _t4;
|
|
1767
|
-
return _regenerator().w(function (
|
|
1768
|
-
while (1) switch (
|
|
1819
|
+
return _regenerator().w(function (_context9) {
|
|
1820
|
+
while (1) switch (_context9.n) {
|
|
1769
1821
|
case 0:
|
|
1770
1822
|
if (jsonData) {
|
|
1771
|
-
|
|
1823
|
+
_context9.n = 1;
|
|
1772
1824
|
break;
|
|
1773
1825
|
}
|
|
1774
1826
|
console.error('❌ No JSON data provided for import');
|
|
1775
|
-
return
|
|
1827
|
+
return _context9.a(2, false);
|
|
1776
1828
|
case 1:
|
|
1777
|
-
|
|
1829
|
+
_context9.p = 1;
|
|
1778
1830
|
// Validate scene data structure
|
|
1779
1831
|
validation = this.internals.validateAndAnalyzeSceneData(jsonData);
|
|
1780
1832
|
if (validation.isValid) {
|
|
1781
|
-
|
|
1833
|
+
_context9.n = 2;
|
|
1782
1834
|
break;
|
|
1783
1835
|
}
|
|
1784
1836
|
console.error('❌ Invalid scene data format:', validation.message);
|
|
1785
|
-
return
|
|
1837
|
+
return _context9.a(2, false);
|
|
1786
1838
|
case 2:
|
|
1787
|
-
|
|
1839
|
+
_context9.n = 3;
|
|
1788
1840
|
return this.setImportedSceneData(jsonData);
|
|
1789
1841
|
case 3:
|
|
1790
1842
|
if (!(this.sceneViewer && this.sceneViewer.sceneOperationsManager)) {
|
|
1791
|
-
|
|
1843
|
+
_context9.n = 5;
|
|
1792
1844
|
break;
|
|
1793
1845
|
}
|
|
1794
|
-
|
|
1846
|
+
_context9.n = 4;
|
|
1795
1847
|
return this.sceneViewer.sceneOperationsManager.loadSceneFromData(jsonData);
|
|
1796
1848
|
case 4:
|
|
1797
1849
|
console.log('✅ Scene imported successfully');
|
|
1798
|
-
return
|
|
1850
|
+
return _context9.a(2, true);
|
|
1799
1851
|
case 5:
|
|
1800
1852
|
console.error('❌ SceneViewer not available for scene loading');
|
|
1801
|
-
return
|
|
1853
|
+
return _context9.a(2, false);
|
|
1802
1854
|
case 6:
|
|
1803
|
-
|
|
1855
|
+
_context9.n = 8;
|
|
1804
1856
|
break;
|
|
1805
1857
|
case 7:
|
|
1806
|
-
|
|
1807
|
-
_t4 =
|
|
1858
|
+
_context9.p = 7;
|
|
1859
|
+
_t4 = _context9.v;
|
|
1808
1860
|
console.error('❌ Error importing scene:', _t4);
|
|
1809
|
-
return
|
|
1861
|
+
return _context9.a(2, false);
|
|
1810
1862
|
case 8:
|
|
1811
|
-
return
|
|
1863
|
+
return _context9.a(2);
|
|
1812
1864
|
}
|
|
1813
|
-
},
|
|
1865
|
+
}, _callee9, this, [[1, 7]]);
|
|
1814
1866
|
}));
|
|
1815
|
-
function importScene(
|
|
1867
|
+
function importScene(_x6) {
|
|
1816
1868
|
return _importScene.apply(this, arguments);
|
|
1817
1869
|
}
|
|
1818
1870
|
return importScene;
|
|
@@ -1834,33 +1886,33 @@ var CentralPlant = /*#__PURE__*/function (_BaseDisposable) {
|
|
|
1834
1886
|
}, {
|
|
1835
1887
|
key: "exportSceneJSON",
|
|
1836
1888
|
value: (function () {
|
|
1837
|
-
var _exportSceneJSON = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function
|
|
1889
|
+
var _exportSceneJSON = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee0() {
|
|
1838
1890
|
var filename,
|
|
1839
|
-
|
|
1891
|
+
_args0 = arguments,
|
|
1840
1892
|
_t5;
|
|
1841
|
-
return _regenerator().w(function (
|
|
1842
|
-
while (1) switch (
|
|
1893
|
+
return _regenerator().w(function (_context0) {
|
|
1894
|
+
while (1) switch (_context0.n) {
|
|
1843
1895
|
case 0:
|
|
1844
|
-
filename =
|
|
1896
|
+
filename = _args0.length > 0 && _args0[0] !== undefined ? _args0[0] : null;
|
|
1845
1897
|
if (this.managers.sceneExportManager) {
|
|
1846
|
-
|
|
1898
|
+
_context0.n = 1;
|
|
1847
1899
|
break;
|
|
1848
1900
|
}
|
|
1849
1901
|
console.error('❌ Scene export manager not available');
|
|
1850
|
-
return
|
|
1902
|
+
return _context0.a(2, false);
|
|
1851
1903
|
case 1:
|
|
1852
|
-
|
|
1853
|
-
|
|
1904
|
+
_context0.p = 1;
|
|
1905
|
+
_context0.n = 2;
|
|
1854
1906
|
return this.managers.sceneExportManager.downloadSceneJSON(filename);
|
|
1855
1907
|
case 2:
|
|
1856
|
-
return
|
|
1908
|
+
return _context0.a(2, _context0.v);
|
|
1857
1909
|
case 3:
|
|
1858
|
-
|
|
1859
|
-
_t5 =
|
|
1910
|
+
_context0.p = 3;
|
|
1911
|
+
_t5 = _context0.v;
|
|
1860
1912
|
console.error('❌ Error exporting scene as JSON:', _t5);
|
|
1861
|
-
return
|
|
1913
|
+
return _context0.a(2, false);
|
|
1862
1914
|
}
|
|
1863
|
-
},
|
|
1915
|
+
}, _callee0, this, [[1, 3]]);
|
|
1864
1916
|
}));
|
|
1865
1917
|
function exportSceneJSON() {
|
|
1866
1918
|
return _exportSceneJSON.apply(this, arguments);
|
|
@@ -1885,33 +1937,33 @@ var CentralPlant = /*#__PURE__*/function (_BaseDisposable) {
|
|
|
1885
1937
|
}, {
|
|
1886
1938
|
key: "exportSceneGLTF",
|
|
1887
1939
|
value: (function () {
|
|
1888
|
-
var _exportSceneGLTF = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function
|
|
1940
|
+
var _exportSceneGLTF = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee1() {
|
|
1889
1941
|
var filename,
|
|
1890
|
-
|
|
1942
|
+
_args1 = arguments,
|
|
1891
1943
|
_t6;
|
|
1892
|
-
return _regenerator().w(function (
|
|
1893
|
-
while (1) switch (
|
|
1944
|
+
return _regenerator().w(function (_context1) {
|
|
1945
|
+
while (1) switch (_context1.n) {
|
|
1894
1946
|
case 0:
|
|
1895
|
-
filename =
|
|
1947
|
+
filename = _args1.length > 0 && _args1[0] !== undefined ? _args1[0] : null;
|
|
1896
1948
|
if (this.managers.sceneExportManager) {
|
|
1897
|
-
|
|
1949
|
+
_context1.n = 1;
|
|
1898
1950
|
break;
|
|
1899
1951
|
}
|
|
1900
1952
|
console.error('❌ Scene export manager not available');
|
|
1901
|
-
return
|
|
1953
|
+
return _context1.a(2, false);
|
|
1902
1954
|
case 1:
|
|
1903
|
-
|
|
1904
|
-
|
|
1955
|
+
_context1.p = 1;
|
|
1956
|
+
_context1.n = 2;
|
|
1905
1957
|
return this.managers.sceneExportManager.exportSceneAsGLTF(filename, false);
|
|
1906
1958
|
case 2:
|
|
1907
|
-
return
|
|
1959
|
+
return _context1.a(2, _context1.v);
|
|
1908
1960
|
case 3:
|
|
1909
|
-
|
|
1910
|
-
_t6 =
|
|
1961
|
+
_context1.p = 3;
|
|
1962
|
+
_t6 = _context1.v;
|
|
1911
1963
|
console.error('❌ Error exporting scene as GLTF:', _t6);
|
|
1912
|
-
return
|
|
1964
|
+
return _context1.a(2, false);
|
|
1913
1965
|
}
|
|
1914
|
-
},
|
|
1966
|
+
}, _callee1, this, [[1, 3]]);
|
|
1915
1967
|
}));
|
|
1916
1968
|
function exportSceneGLTF() {
|
|
1917
1969
|
return _exportSceneGLTF.apply(this, arguments);
|
|
@@ -1937,33 +1989,33 @@ var CentralPlant = /*#__PURE__*/function (_BaseDisposable) {
|
|
|
1937
1989
|
}, {
|
|
1938
1990
|
key: "exportSceneGLB",
|
|
1939
1991
|
value: (function () {
|
|
1940
|
-
var _exportSceneGLB = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function
|
|
1992
|
+
var _exportSceneGLB = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee10() {
|
|
1941
1993
|
var filename,
|
|
1942
|
-
|
|
1994
|
+
_args10 = arguments,
|
|
1943
1995
|
_t7;
|
|
1944
|
-
return _regenerator().w(function (
|
|
1945
|
-
while (1) switch (
|
|
1996
|
+
return _regenerator().w(function (_context10) {
|
|
1997
|
+
while (1) switch (_context10.n) {
|
|
1946
1998
|
case 0:
|
|
1947
|
-
filename =
|
|
1999
|
+
filename = _args10.length > 0 && _args10[0] !== undefined ? _args10[0] : null;
|
|
1948
2000
|
if (this.managers.sceneExportManager) {
|
|
1949
|
-
|
|
2001
|
+
_context10.n = 1;
|
|
1950
2002
|
break;
|
|
1951
2003
|
}
|
|
1952
2004
|
console.error('❌ Scene export manager not available');
|
|
1953
|
-
return
|
|
2005
|
+
return _context10.a(2, false);
|
|
1954
2006
|
case 1:
|
|
1955
|
-
|
|
1956
|
-
|
|
2007
|
+
_context10.p = 1;
|
|
2008
|
+
_context10.n = 2;
|
|
1957
2009
|
return this.managers.sceneExportManager.exportSceneAsGLB(filename);
|
|
1958
2010
|
case 2:
|
|
1959
|
-
return
|
|
2011
|
+
return _context10.a(2, _context10.v);
|
|
1960
2012
|
case 3:
|
|
1961
|
-
|
|
1962
|
-
_t7 =
|
|
2013
|
+
_context10.p = 3;
|
|
2014
|
+
_t7 = _context10.v;
|
|
1963
2015
|
console.error('❌ Error exporting scene as GLB:', _t7);
|
|
1964
|
-
return
|
|
2016
|
+
return _context10.a(2, false);
|
|
1965
2017
|
}
|
|
1966
|
-
},
|
|
2018
|
+
}, _callee10, this, [[1, 3]]);
|
|
1967
2019
|
}));
|
|
1968
2020
|
function exportSceneGLB() {
|
|
1969
2021
|
return _exportSceneGLB.apply(this, arguments);
|
|
@@ -2002,18 +2054,18 @@ var CentralPlant = /*#__PURE__*/function (_BaseDisposable) {
|
|
|
2002
2054
|
}, {
|
|
2003
2055
|
key: "loadSceneFromData",
|
|
2004
2056
|
value: (function () {
|
|
2005
|
-
var _loadSceneFromData = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function
|
|
2006
|
-
return _regenerator().w(function (
|
|
2007
|
-
while (1) switch (
|
|
2057
|
+
var _loadSceneFromData = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee11(sceneData) {
|
|
2058
|
+
return _regenerator().w(function (_context11) {
|
|
2059
|
+
while (1) switch (_context11.n) {
|
|
2008
2060
|
case 0:
|
|
2009
|
-
|
|
2061
|
+
_context11.n = 1;
|
|
2010
2062
|
return this.setImportedSceneData(sceneData);
|
|
2011
2063
|
case 1:
|
|
2012
|
-
return
|
|
2064
|
+
return _context11.a(2, true);
|
|
2013
2065
|
}
|
|
2014
|
-
},
|
|
2066
|
+
}, _callee11, this);
|
|
2015
2067
|
}));
|
|
2016
|
-
function loadSceneFromData(
|
|
2068
|
+
function loadSceneFromData(_x7) {
|
|
2017
2069
|
return _loadSceneFromData.apply(this, arguments);
|
|
2018
2070
|
}
|
|
2019
2071
|
return loadSceneFromData;
|