@2112-lab/central-plant 0.3.14 → 0.3.16

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.
@@ -6911,6 +6911,7 @@ var DEFAULT_SETTINGS = {
6911
6911
  scene: {
6912
6912
  autoRotation: false,
6913
6913
  checkUnderground: true,
6914
+ showGatewaySpheres: false,
6914
6915
  splitSegmentsWithComponentConnectors: true
6915
6916
  },
6916
6917
  viewport: {
@@ -7141,9 +7142,37 @@ var SettingsManager = /*#__PURE__*/function (_BaseDisposable) {
7141
7142
  component.transformManager.checkUnderground = sceneSettings.checkUnderground;
7142
7143
  }
7143
7144
  }
7145
+
7146
+ // Handle gateway sphere visibility
7147
+ if (sceneSettings.hasOwnProperty('showGatewaySpheres')) {
7148
+ this.setGatewayVisibility(sceneSettings.showGatewaySpheres);
7149
+ }
7144
7150
  console.log('🎬 Scene settings applied:', sceneSettings);
7145
7151
  }
7146
7152
 
7153
+ /**
7154
+ * Set visibility of all gateway spheres in the scene
7155
+ * @param {boolean} visible - Whether gateways should be visible
7156
+ */
7157
+ }, {
7158
+ key: "setGatewayVisibility",
7159
+ value: function setGatewayVisibility(visible) {
7160
+ var _this$sceneViewer;
7161
+ if (!((_this$sceneViewer = this.sceneViewer) !== null && _this$sceneViewer !== void 0 && _this$sceneViewer.scene)) {
7162
+ console.warn('⚠️ Scene not available for gateway visibility toggle');
7163
+ return;
7164
+ }
7165
+ var gatewayCount = 0;
7166
+ this.sceneViewer.scene.traverse(function (object) {
7167
+ var _object$userData;
7168
+ if (((_object$userData = object.userData) === null || _object$userData === void 0 ? void 0 : _object$userData.objectType) === 'gateway') {
7169
+ object.visible = visible;
7170
+ gatewayCount++;
7171
+ }
7172
+ });
7173
+ console.log("\uD83D\uDD2E Gateway visibility set to ".concat(visible, " (").concat(gatewayCount, " gateways affected)"));
7174
+ }
7175
+
7147
7176
  /**
7148
7177
  * Apply viewport-specific settings
7149
7178
  * @param {Object} viewportSettings - Viewport settings
@@ -26196,7 +26225,11 @@ var PathRenderingManager = /*#__PURE__*/function (_BaseDisposable) {
26196
26225
  }, {
26197
26226
  key: "createGateways",
26198
26227
  value: function createGateways(pathfindingResult) {
26199
- var _this2 = this;
26228
+ var _this$sceneViewer$man,
26229
+ _this$sceneViewer,
26230
+ _this2 = this;
26231
+ // Check current gateway visibility setting
26232
+ var showGateways = (_this$sceneViewer$man = (_this$sceneViewer = this.sceneViewer) === null || _this$sceneViewer === void 0 || (_this$sceneViewer = _this$sceneViewer.managers) === null || _this$sceneViewer === void 0 || (_this$sceneViewer = _this$sceneViewer.settingsManager) === null || _this$sceneViewer === void 0 ? void 0 : _this$sceneViewer.getSetting('scene', 'showGatewaySpheres')) !== null && _this$sceneViewer$man !== void 0 ? _this$sceneViewer$man : true;
26200
26233
  pathfindingResult.gateways.forEach(function (gateway) {
26201
26234
  if (!gateway.position) {
26202
26235
  console.warn("\u26A0\uFE0F Gateway ".concat(gateway.id, " missing position, skipping creation"));
@@ -26241,6 +26274,9 @@ var PathRenderingManager = /*#__PURE__*/function (_BaseDisposable) {
26241
26274
  }
26242
26275
  };
26243
26276
 
26277
+ // Apply current visibility setting
26278
+ gatewayMesh.visible = showGateways;
26279
+
26244
26280
  // Add to scene
26245
26281
  _this2.sceneViewer.scene.add(gatewayMesh);
26246
26282
  console.log("\uD83D\uDD27 Created gateway: ".concat(gateway.id, " at [").concat(gatewayMesh.position.x.toFixed(2), ", ").concat(gatewayMesh.position.y.toFixed(2), ", ").concat(gatewayMesh.position.z.toFixed(2), "]"));
@@ -37700,7 +37736,7 @@ var CentralPlantInternals = /*#__PURE__*/function () {
37700
37736
  }));
37701
37737
  componentData.children.forEach(function (childData, index) {
37702
37738
  try {
37703
- var _childData$userData, _childData$userData2;
37739
+ var _childData$userData, _childData$userData2, _childData$userData3;
37704
37740
  // Create connector geometry (simple sphere for now)
37705
37741
  var connectorGeometry = new THREE__namespace.SphereGeometry(0.1, 8, 6);
37706
37742
  var connectorMaterial = new THREE__namespace.MeshPhysicalMaterial({
@@ -37736,7 +37772,8 @@ var CentralPlantInternals = /*#__PURE__*/function () {
37736
37772
  parentComponentId: componentId,
37737
37773
  connectorIndex: index,
37738
37774
  direction: ((_childData$userData = childData.userData) === null || _childData$userData === void 0 ? void 0 : _childData$userData.direction) || [0, 1, 0],
37739
- group: ((_childData$userData2 = childData.userData) === null || _childData$userData2 === void 0 ? void 0 : _childData$userData2.group) || null,
37775
+ flow: ((_childData$userData2 = childData.userData) === null || _childData$userData2 === void 0 ? void 0 : _childData$userData2.flow) || 'bi',
37776
+ group: ((_childData$userData3 = childData.userData) === null || _childData$userData3 === void 0 ? void 0 : _childData$userData3.group) || null,
37740
37777
  originalChildData: childData
37741
37778
  };
37742
37779
 
@@ -38052,7 +38089,7 @@ var CentralPlant = /*#__PURE__*/function (_BaseDisposable) {
38052
38089
  * Initialize the CentralPlant manager
38053
38090
  *
38054
38091
  * @constructor
38055
- * @version 0.3.14
38092
+ * @version 0.3.16
38056
38093
  * @updated 2025-10-22
38057
38094
  *
38058
38095
  * @description Creates a new CentralPlant instance and initializes internal managers and utilities.
@@ -35,7 +35,7 @@ var CentralPlant = /*#__PURE__*/function (_BaseDisposable) {
35
35
  * Initialize the CentralPlant manager
36
36
  *
37
37
  * @constructor
38
- * @version 0.3.14
38
+ * @version 0.3.16
39
39
  * @updated 2025-10-22
40
40
  *
41
41
  * @description Creates a new CentralPlant instance and initializes internal managers and utilities.
@@ -1089,7 +1089,7 @@ var CentralPlantInternals = /*#__PURE__*/function () {
1089
1089
  }));
1090
1090
  componentData.children.forEach(function (childData, index) {
1091
1091
  try {
1092
- var _childData$userData, _childData$userData2;
1092
+ var _childData$userData, _childData$userData2, _childData$userData3;
1093
1093
  // Create connector geometry (simple sphere for now)
1094
1094
  var connectorGeometry = new THREE__namespace.SphereGeometry(0.1, 8, 6);
1095
1095
  var connectorMaterial = new THREE__namespace.MeshPhysicalMaterial({
@@ -1125,7 +1125,8 @@ var CentralPlantInternals = /*#__PURE__*/function () {
1125
1125
  parentComponentId: componentId,
1126
1126
  connectorIndex: index,
1127
1127
  direction: ((_childData$userData = childData.userData) === null || _childData$userData === void 0 ? void 0 : _childData$userData.direction) || [0, 1, 0],
1128
- group: ((_childData$userData2 = childData.userData) === null || _childData$userData2 === void 0 ? void 0 : _childData$userData2.group) || null,
1128
+ flow: ((_childData$userData2 = childData.userData) === null || _childData$userData2 === void 0 ? void 0 : _childData$userData2.flow) || 'bi',
1129
+ group: ((_childData$userData3 = childData.userData) === null || _childData$userData3 === void 0 ? void 0 : _childData$userData3.group) || null,
1129
1130
  originalChildData: childData
1130
1131
  };
1131
1132
 
@@ -112,7 +112,11 @@ var PathRenderingManager = /*#__PURE__*/function (_BaseDisposable) {
112
112
  }, {
113
113
  key: "createGateways",
114
114
  value: function createGateways(pathfindingResult) {
115
- var _this2 = this;
115
+ var _this$sceneViewer$man,
116
+ _this$sceneViewer,
117
+ _this2 = this;
118
+ // Check current gateway visibility setting
119
+ var showGateways = (_this$sceneViewer$man = (_this$sceneViewer = this.sceneViewer) === null || _this$sceneViewer === void 0 || (_this$sceneViewer = _this$sceneViewer.managers) === null || _this$sceneViewer === void 0 || (_this$sceneViewer = _this$sceneViewer.settingsManager) === null || _this$sceneViewer === void 0 ? void 0 : _this$sceneViewer.getSetting('scene', 'showGatewaySpheres')) !== null && _this$sceneViewer$man !== void 0 ? _this$sceneViewer$man : true;
116
120
  pathfindingResult.gateways.forEach(function (gateway) {
117
121
  if (!gateway.position) {
118
122
  console.warn("\u26A0\uFE0F Gateway ".concat(gateway.id, " missing position, skipping creation"));
@@ -157,6 +161,9 @@ var PathRenderingManager = /*#__PURE__*/function (_BaseDisposable) {
157
161
  }
158
162
  };
159
163
 
164
+ // Apply current visibility setting
165
+ gatewayMesh.visible = showGateways;
166
+
160
167
  // Add to scene
161
168
  _this2.sceneViewer.scene.add(gatewayMesh);
162
169
  console.log("\uD83D\uDD27 Created gateway: ".concat(gateway.id, " at [").concat(gatewayMesh.position.x.toFixed(2), ", ").concat(gatewayMesh.position.y.toFixed(2), ", ").concat(gatewayMesh.position.z.toFixed(2), "]"));
@@ -12,6 +12,7 @@ var DEFAULT_SETTINGS = {
12
12
  scene: {
13
13
  autoRotation: false,
14
14
  checkUnderground: true,
15
+ showGatewaySpheres: false,
15
16
  splitSegmentsWithComponentConnectors: true
16
17
  },
17
18
  viewport: {
@@ -242,9 +243,37 @@ var SettingsManager = /*#__PURE__*/function (_BaseDisposable) {
242
243
  component.transformManager.checkUnderground = sceneSettings.checkUnderground;
243
244
  }
244
245
  }
246
+
247
+ // Handle gateway sphere visibility
248
+ if (sceneSettings.hasOwnProperty('showGatewaySpheres')) {
249
+ this.setGatewayVisibility(sceneSettings.showGatewaySpheres);
250
+ }
245
251
  console.log('🎬 Scene settings applied:', sceneSettings);
246
252
  }
247
253
 
254
+ /**
255
+ * Set visibility of all gateway spheres in the scene
256
+ * @param {boolean} visible - Whether gateways should be visible
257
+ */
258
+ }, {
259
+ key: "setGatewayVisibility",
260
+ value: function setGatewayVisibility(visible) {
261
+ var _this$sceneViewer;
262
+ if (!((_this$sceneViewer = this.sceneViewer) !== null && _this$sceneViewer !== void 0 && _this$sceneViewer.scene)) {
263
+ console.warn('⚠️ Scene not available for gateway visibility toggle');
264
+ return;
265
+ }
266
+ var gatewayCount = 0;
267
+ this.sceneViewer.scene.traverse(function (object) {
268
+ var _object$userData;
269
+ if (((_object$userData = object.userData) === null || _object$userData === void 0 ? void 0 : _object$userData.objectType) === 'gateway') {
270
+ object.visible = visible;
271
+ gatewayCount++;
272
+ }
273
+ });
274
+ console.log("\uD83D\uDD2E Gateway visibility set to ".concat(visible, " (").concat(gatewayCount, " gateways affected)"));
275
+ }
276
+
248
277
  /**
249
278
  * Apply viewport-specific settings
250
279
  * @param {Object} viewportSettings - Viewport settings
@@ -31,7 +31,7 @@ var CentralPlant = /*#__PURE__*/function (_BaseDisposable) {
31
31
  * Initialize the CentralPlant manager
32
32
  *
33
33
  * @constructor
34
- * @version 0.3.14
34
+ * @version 0.3.16
35
35
  * @updated 2025-10-22
36
36
  *
37
37
  * @description Creates a new CentralPlant instance and initializes internal managers and utilities.
@@ -1065,7 +1065,7 @@ var CentralPlantInternals = /*#__PURE__*/function () {
1065
1065
  }));
1066
1066
  componentData.children.forEach(function (childData, index) {
1067
1067
  try {
1068
- var _childData$userData, _childData$userData2;
1068
+ var _childData$userData, _childData$userData2, _childData$userData3;
1069
1069
  // Create connector geometry (simple sphere for now)
1070
1070
  var connectorGeometry = new THREE.SphereGeometry(0.1, 8, 6);
1071
1071
  var connectorMaterial = new THREE.MeshPhysicalMaterial({
@@ -1101,7 +1101,8 @@ var CentralPlantInternals = /*#__PURE__*/function () {
1101
1101
  parentComponentId: componentId,
1102
1102
  connectorIndex: index,
1103
1103
  direction: ((_childData$userData = childData.userData) === null || _childData$userData === void 0 ? void 0 : _childData$userData.direction) || [0, 1, 0],
1104
- group: ((_childData$userData2 = childData.userData) === null || _childData$userData2 === void 0 ? void 0 : _childData$userData2.group) || null,
1104
+ flow: ((_childData$userData2 = childData.userData) === null || _childData$userData2 === void 0 ? void 0 : _childData$userData2.flow) || 'bi',
1105
+ group: ((_childData$userData3 = childData.userData) === null || _childData$userData3 === void 0 ? void 0 : _childData$userData3.group) || null,
1105
1106
  originalChildData: childData
1106
1107
  };
1107
1108
 
@@ -88,7 +88,11 @@ var PathRenderingManager = /*#__PURE__*/function (_BaseDisposable) {
88
88
  }, {
89
89
  key: "createGateways",
90
90
  value: function createGateways(pathfindingResult) {
91
- var _this2 = this;
91
+ var _this$sceneViewer$man,
92
+ _this$sceneViewer,
93
+ _this2 = this;
94
+ // Check current gateway visibility setting
95
+ var showGateways = (_this$sceneViewer$man = (_this$sceneViewer = this.sceneViewer) === null || _this$sceneViewer === void 0 || (_this$sceneViewer = _this$sceneViewer.managers) === null || _this$sceneViewer === void 0 || (_this$sceneViewer = _this$sceneViewer.settingsManager) === null || _this$sceneViewer === void 0 ? void 0 : _this$sceneViewer.getSetting('scene', 'showGatewaySpheres')) !== null && _this$sceneViewer$man !== void 0 ? _this$sceneViewer$man : true;
92
96
  pathfindingResult.gateways.forEach(function (gateway) {
93
97
  if (!gateway.position) {
94
98
  console.warn("\u26A0\uFE0F Gateway ".concat(gateway.id, " missing position, skipping creation"));
@@ -133,6 +137,9 @@ var PathRenderingManager = /*#__PURE__*/function (_BaseDisposable) {
133
137
  }
134
138
  };
135
139
 
140
+ // Apply current visibility setting
141
+ gatewayMesh.visible = showGateways;
142
+
136
143
  // Add to scene
137
144
  _this2.sceneViewer.scene.add(gatewayMesh);
138
145
  console.log("\uD83D\uDD27 Created gateway: ".concat(gateway.id, " at [").concat(gatewayMesh.position.x.toFixed(2), ", ").concat(gatewayMesh.position.y.toFixed(2), ", ").concat(gatewayMesh.position.z.toFixed(2), "]"));
@@ -8,6 +8,7 @@ var DEFAULT_SETTINGS = {
8
8
  scene: {
9
9
  autoRotation: false,
10
10
  checkUnderground: true,
11
+ showGatewaySpheres: false,
11
12
  splitSegmentsWithComponentConnectors: true
12
13
  },
13
14
  viewport: {
@@ -238,9 +239,37 @@ var SettingsManager = /*#__PURE__*/function (_BaseDisposable) {
238
239
  component.transformManager.checkUnderground = sceneSettings.checkUnderground;
239
240
  }
240
241
  }
242
+
243
+ // Handle gateway sphere visibility
244
+ if (sceneSettings.hasOwnProperty('showGatewaySpheres')) {
245
+ this.setGatewayVisibility(sceneSettings.showGatewaySpheres);
246
+ }
241
247
  console.log('🎬 Scene settings applied:', sceneSettings);
242
248
  }
243
249
 
250
+ /**
251
+ * Set visibility of all gateway spheres in the scene
252
+ * @param {boolean} visible - Whether gateways should be visible
253
+ */
254
+ }, {
255
+ key: "setGatewayVisibility",
256
+ value: function setGatewayVisibility(visible) {
257
+ var _this$sceneViewer;
258
+ if (!((_this$sceneViewer = this.sceneViewer) !== null && _this$sceneViewer !== void 0 && _this$sceneViewer.scene)) {
259
+ console.warn('⚠️ Scene not available for gateway visibility toggle');
260
+ return;
261
+ }
262
+ var gatewayCount = 0;
263
+ this.sceneViewer.scene.traverse(function (object) {
264
+ var _object$userData;
265
+ if (((_object$userData = object.userData) === null || _object$userData === void 0 ? void 0 : _object$userData.objectType) === 'gateway') {
266
+ object.visible = visible;
267
+ gatewayCount++;
268
+ }
269
+ });
270
+ console.log("\uD83D\uDD2E Gateway visibility set to ".concat(visible, " (").concat(gatewayCount, " gateways affected)"));
271
+ }
272
+
244
273
  /**
245
274
  * Apply viewport-specific settings
246
275
  * @param {Object} viewportSettings - Viewport settings
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@2112-lab/central-plant",
3
- "version": "0.3.14",
3
+ "version": "0.3.16",
4
4
  "description": "Utility modules for the Central Plant Application",
5
5
  "main": "dist/bundle/index.js",
6
6
  "module": "dist/esm/src/index.js",