@2112-lab/central-plant 0.1.39 → 0.1.41
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 +7991 -7054
- package/dist/cjs/src/core/centralPlant.js +48 -3
- package/dist/cjs/src/core/centralPlantInternals.js +75 -566
- package/dist/cjs/src/core/sceneViewer.js +38 -13
- package/dist/cjs/src/index.js +6 -4
- package/dist/cjs/src/managers/components/pathfindingManager.js +75 -60
- package/dist/cjs/src/managers/components/transformOperationsManager.js +929 -0
- package/dist/cjs/src/managers/controls/keyboardControlsManager.js +57 -1
- package/dist/cjs/src/managers/controls/transformControls.js +11 -3
- package/dist/cjs/src/managers/controls/transformControlsManager.js +563 -263
- package/dist/cjs/src/managers/pathfinding/ConnectorManager.js +385 -0
- package/dist/cjs/src/managers/pathfinding/PathIntersectionDetector.js +387 -0
- package/dist/cjs/src/managers/pathfinding/PathRenderingManager.js +401 -0
- package/dist/cjs/src/managers/pathfinding/pathfindingManager.js +378 -0
- package/dist/cjs/src/managers/pathfinding/sceneDataManager.js +256 -0
- package/dist/cjs/src/managers/scene/animationManager.js +145 -0
- package/dist/cjs/src/managers/scene/sceneExportManager.js +14 -13
- package/dist/cjs/src/managers/scene/sceneOperationsManager.js +516 -21
- package/dist/cjs/src/managers/scene/sceneTooltipsManager.js +1 -8
- package/dist/cjs/src/managers/system/operationHistoryManager.js +414 -0
- package/dist/cjs/src/managers/system/settingsManager.js +2 -1
- package/dist/cjs/src/utils/objectTypes.js +5 -7
- package/dist/esm/src/core/centralPlant.js +48 -3
- package/dist/esm/src/core/centralPlantInternals.js +76 -567
- package/dist/esm/src/core/sceneViewer.js +38 -13
- package/dist/esm/src/index.js +4 -3
- package/dist/esm/src/managers/components/pathfindingManager.js +75 -60
- package/dist/esm/src/managers/components/transformOperationsManager.js +904 -0
- package/dist/esm/src/managers/controls/keyboardControlsManager.js +57 -1
- package/dist/esm/src/managers/controls/transformControls.js +11 -3
- package/dist/esm/src/managers/controls/transformControlsManager.js +564 -264
- package/dist/esm/src/managers/pathfinding/ConnectorManager.js +361 -0
- package/dist/esm/src/managers/pathfinding/PathIntersectionDetector.js +363 -0
- package/dist/esm/src/managers/pathfinding/PathRenderingManager.js +377 -0
- package/dist/esm/src/managers/pathfinding/pathfindingManager.js +374 -0
- package/dist/esm/src/managers/pathfinding/sceneDataManager.js +232 -0
- package/dist/esm/src/managers/scene/animationManager.js +141 -0
- package/dist/esm/src/managers/scene/sceneExportManager.js +14 -13
- package/dist/esm/src/managers/scene/sceneOperationsManager.js +516 -21
- package/dist/esm/src/managers/scene/sceneTooltipsManager.js +1 -8
- package/dist/esm/src/managers/system/operationHistoryManager.js +409 -0
- package/dist/esm/src/managers/system/settingsManager.js +2 -1
- package/dist/esm/src/utils/objectTypes.js +5 -7
- package/dist/index.d.ts +2 -2
- package/package.json +1 -1
|
@@ -0,0 +1,361 @@
|
|
|
1
|
+
import { inherits as _inherits, createClass as _createClass, objectSpread2 as _objectSpread2, superPropGet as _superPropGet, classCallCheck as _classCallCheck, callSuper as _callSuper, createForOfIteratorHelper as _createForOfIteratorHelper } from '../../../_virtual/_rollupPluginBabelHelpers.js';
|
|
2
|
+
import * as THREE from 'three';
|
|
3
|
+
import { BaseDisposable } from '../../core/baseDisposable.js';
|
|
4
|
+
|
|
5
|
+
var ConnectorManager = /*#__PURE__*/function (_BaseDisposable) {
|
|
6
|
+
function ConnectorManager(sceneViewer) {
|
|
7
|
+
var _this;
|
|
8
|
+
_classCallCheck(this, ConnectorManager);
|
|
9
|
+
_this = _callSuper(this, ConnectorManager);
|
|
10
|
+
_this.sceneViewer = sceneViewer;
|
|
11
|
+
return _this;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Create connector objects at segment endpoints
|
|
16
|
+
* @param {THREE.Object3D} segment - The pipe segment
|
|
17
|
+
* @param {Object} endpoints - Object with start and end points
|
|
18
|
+
* @returns {Array} Array of connector objects [startConnector, endConnector]
|
|
19
|
+
*/
|
|
20
|
+
_inherits(ConnectorManager, _BaseDisposable);
|
|
21
|
+
return _createClass(ConnectorManager, [{
|
|
22
|
+
key: "createSegmentConnectors",
|
|
23
|
+
value: function createSegmentConnectors(segment, endpoints) {
|
|
24
|
+
var segmentData = segment.userData;
|
|
25
|
+
var segmentId = segmentData.segmentId;
|
|
26
|
+
var segmentIndex = segmentData.segmentIndex;
|
|
27
|
+
var connectors = [];
|
|
28
|
+
|
|
29
|
+
// Reuse the segment's material for both connectors
|
|
30
|
+
var segmentMaterial = segment.material;
|
|
31
|
+
var sphereRadius = 0.1;
|
|
32
|
+
var sphereSegments = 16;
|
|
33
|
+
|
|
34
|
+
// Create start connector
|
|
35
|
+
var startConnector = new THREE.Mesh(new THREE.SphereGeometry(sphereRadius, sphereSegments, sphereSegments), segmentMaterial // Reuse segment material
|
|
36
|
+
);
|
|
37
|
+
|
|
38
|
+
// Convert world position to local position relative to segment
|
|
39
|
+
var localStartPosition = segment.worldToLocal(endpoints.start.clone());
|
|
40
|
+
startConnector.position.copy(localStartPosition);
|
|
41
|
+
startConnector.uuid = "SEGMENT-".concat(segmentIndex, "-CONNECTOR-1");
|
|
42
|
+
startConnector.userData = {
|
|
43
|
+
objectType: 'segment-connector',
|
|
44
|
+
isManualSegmentConnector: true,
|
|
45
|
+
segmentId: segmentId,
|
|
46
|
+
connectorType: 'start',
|
|
47
|
+
manualSegmentUuid: segment.uuid,
|
|
48
|
+
isDeclared: true
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
// Add start connector as child of segment
|
|
52
|
+
segment.add(startConnector);
|
|
53
|
+
|
|
54
|
+
// Create end connector
|
|
55
|
+
var endConnector = new THREE.Mesh(new THREE.SphereGeometry(sphereRadius, sphereSegments, sphereSegments), segmentMaterial // Reuse segment material
|
|
56
|
+
);
|
|
57
|
+
|
|
58
|
+
// Convert world position to local position relative to segment
|
|
59
|
+
var localEndPosition = segment.worldToLocal(endpoints.end.clone());
|
|
60
|
+
endConnector.position.copy(localEndPosition);
|
|
61
|
+
endConnector.uuid = "SEGMENT-".concat(segmentIndex, "-CONNECTOR-2");
|
|
62
|
+
endConnector.userData = {
|
|
63
|
+
objectType: 'segment-connector',
|
|
64
|
+
isManualSegmentConnector: true,
|
|
65
|
+
segmentId: segmentId,
|
|
66
|
+
connectorType: 'end',
|
|
67
|
+
manualSegmentUuid: segment.uuid,
|
|
68
|
+
isDeclared: true
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
// Add end connector as child of segment
|
|
72
|
+
segment.add(endConnector);
|
|
73
|
+
connectors.push(startConnector, endConnector);
|
|
74
|
+
return connectors;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
/**
|
|
78
|
+
* Calculate the start and end points of a pipe segment in world coordinates
|
|
79
|
+
* @param {THREE.Object3D} segment - The pipe segment
|
|
80
|
+
* @returns {Object} Object with start and end points { start: Vector3, end: Vector3 }
|
|
81
|
+
*/
|
|
82
|
+
}, {
|
|
83
|
+
key: "calculateSegmentEndpoints",
|
|
84
|
+
value: function calculateSegmentEndpoints(segment) {
|
|
85
|
+
// Get the segment's geometry to determine its length and orientation
|
|
86
|
+
var geometry = segment.geometry;
|
|
87
|
+
var length = geometry.parameters.height || 1;
|
|
88
|
+
|
|
89
|
+
// Calculate start and end points based on segment position and orientation
|
|
90
|
+
var startPoint = new THREE.Vector3();
|
|
91
|
+
var endPoint = new THREE.Vector3();
|
|
92
|
+
|
|
93
|
+
// Get the segment's direction vector
|
|
94
|
+
var direction = new THREE.Vector3(0, 1, 0);
|
|
95
|
+
direction.applyQuaternion(segment.quaternion);
|
|
96
|
+
|
|
97
|
+
// Calculate start point (half length back from center)
|
|
98
|
+
startPoint.copy(segment.position).sub(direction.clone().multiplyScalar(length / 2));
|
|
99
|
+
|
|
100
|
+
// Calculate end point (half length forward from center)
|
|
101
|
+
endPoint.copy(segment.position).add(direction.clone().multiplyScalar(length / 2));
|
|
102
|
+
return {
|
|
103
|
+
start: startPoint,
|
|
104
|
+
end: endPoint
|
|
105
|
+
};
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
/**
|
|
109
|
+
* Add connectors to the scene and scene data
|
|
110
|
+
* Note: Connectors are already children of the segment in the Three.js scene.
|
|
111
|
+
* @param {Array} connectors - Array of connector objects
|
|
112
|
+
*/
|
|
113
|
+
}, {
|
|
114
|
+
key: "addConnectorsToScene",
|
|
115
|
+
value: function addConnectorsToScene(connectors) {
|
|
116
|
+
var sceneViewer = this.sceneViewer;
|
|
117
|
+
connectors.forEach(function (connector) {
|
|
118
|
+
// Connectors are already children of the segment in Three.js, no need to add to scene
|
|
119
|
+
console.log("\uD83D\uDD0C Connector already added as child of segment: ".concat(connector.uuid));
|
|
120
|
+
|
|
121
|
+
// Add to scene data structure as children of the segment (not at top level)
|
|
122
|
+
if (sceneViewer.currentSceneData && sceneViewer.currentSceneData.scene) {
|
|
123
|
+
// Helper function to clean up floating-point precision errors
|
|
124
|
+
var cleanPosition = function cleanPosition(value) {
|
|
125
|
+
// Round values very close to zero to exactly zero
|
|
126
|
+
return Math.abs(value) < 1e-10 ? 0 : value;
|
|
127
|
+
};
|
|
128
|
+
|
|
129
|
+
// Get world position for scene data (since connectors are now in local space)
|
|
130
|
+
var worldPosition = new THREE.Vector3();
|
|
131
|
+
connector.getWorldPosition(worldPosition);
|
|
132
|
+
|
|
133
|
+
// Get the segment UUID from connector's userData
|
|
134
|
+
var segmentUuid = connector.userData.manualSegmentUuid;
|
|
135
|
+
if (!segmentUuid) {
|
|
136
|
+
console.warn("\u26A0\uFE0F Connector ".concat(connector.uuid, " missing manualSegmentUuid, cannot add to scene data"));
|
|
137
|
+
return;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
// Find the segment in scene data
|
|
141
|
+
var _findSegment = function findSegment(children) {
|
|
142
|
+
var _iterator = _createForOfIteratorHelper(children),
|
|
143
|
+
_step;
|
|
144
|
+
try {
|
|
145
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
146
|
+
var child = _step.value;
|
|
147
|
+
if (child.uuid === segmentUuid) {
|
|
148
|
+
return child;
|
|
149
|
+
}
|
|
150
|
+
if (child.children) {
|
|
151
|
+
var found = _findSegment(child.children);
|
|
152
|
+
if (found) return found;
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
} catch (err) {
|
|
156
|
+
_iterator.e(err);
|
|
157
|
+
} finally {
|
|
158
|
+
_iterator.f();
|
|
159
|
+
}
|
|
160
|
+
return null;
|
|
161
|
+
};
|
|
162
|
+
var segmentInSceneData = _findSegment(sceneViewer.currentSceneData.scene.children);
|
|
163
|
+
if (!segmentInSceneData) {
|
|
164
|
+
console.warn("\u26A0\uFE0F Could not find segment ".concat(segmentUuid, " in scene data for connector ").concat(connector.uuid));
|
|
165
|
+
return;
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
// Ensure segment has a children array in scene data
|
|
169
|
+
if (!segmentInSceneData.children) {
|
|
170
|
+
segmentInSceneData.children = [];
|
|
171
|
+
}
|
|
172
|
+
var sceneDataConnector = {
|
|
173
|
+
uuid: connector.uuid,
|
|
174
|
+
userData: _objectSpread2(_objectSpread2({}, connector.userData), {}, {
|
|
175
|
+
isDeclared: true,
|
|
176
|
+
// Mark manual segment connectors as declared
|
|
177
|
+
// Position MUST be an array [x, y, z] for pathfinder compatibility
|
|
178
|
+
position: [cleanPosition(worldPosition.x), cleanPosition(worldPosition.y), cleanPosition(worldPosition.z)]
|
|
179
|
+
})
|
|
180
|
+
};
|
|
181
|
+
|
|
182
|
+
// Add connector as child of segment in scene data (not at top level)
|
|
183
|
+
segmentInSceneData.children.push(sceneDataConnector);
|
|
184
|
+
console.log("\uD83D\uDD0C Added connector to scene data as child of segment ".concat(segmentUuid, ": ").concat(connector.uuid));
|
|
185
|
+
} else {
|
|
186
|
+
console.warn('⚠️ Could not add connector to scene data - currentSceneData not available');
|
|
187
|
+
}
|
|
188
|
+
});
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
/**
|
|
192
|
+
* Restructure connections to use the new connectors
|
|
193
|
+
* @param {string} authoritativeConnectorUUID - The authoritative connector UUID
|
|
194
|
+
* @param {Array} connectors - Array of connector objects (0: start, 1: end)
|
|
195
|
+
* @param {Object} currentSceneData - Current scene data
|
|
196
|
+
* @param {Array<string>} convertedGatewayUUIDs - Array of gateway UUIDs that were converted to manual (optional)
|
|
197
|
+
*/
|
|
198
|
+
}, {
|
|
199
|
+
key: "restructureConnections",
|
|
200
|
+
value: function restructureConnections(authoritativeConnectorUUID, connectors, currentSceneData) {
|
|
201
|
+
var convertedGatewayUUIDs = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : [];
|
|
202
|
+
// Extract connector UUIDs from the passed connectors array
|
|
203
|
+
var startConnectorUUID = connectors[0].uuid; // SEGMENT-X-CONNECTOR-1
|
|
204
|
+
var endConnectorUUID = connectors[1].uuid; // SEGMENT-X-CONNECTOR-2
|
|
205
|
+
|
|
206
|
+
console.log("\uD83D\uDD27 [restructureConnections] connectors:", JSON.parse(JSON.stringify(connectors)));
|
|
207
|
+
console.log("\uD83D\uDD27 [restructureConnections] convertedGatewayUUIDs:", convertedGatewayUUIDs);
|
|
208
|
+
|
|
209
|
+
// Deep copy connections array to prevent unintended mutations during iteration
|
|
210
|
+
// Then map to update references, creating new connection objects
|
|
211
|
+
currentSceneData.connections = currentSceneData.connections.map(function (connection) {
|
|
212
|
+
console.log("[restructureConnections] connection:", connection);
|
|
213
|
+
|
|
214
|
+
// Create a shallow copy of the connection object
|
|
215
|
+
var updatedConnection = _objectSpread2({}, connection);
|
|
216
|
+
if (connection.from === authoritativeConnectorUUID) {
|
|
217
|
+
updatedConnection.from = endConnectorUUID;
|
|
218
|
+
console.log("\u2705 [restructureConnections] Updated connection.from to ".concat(endConnectorUUID));
|
|
219
|
+
}
|
|
220
|
+
if (connection.to === authoritativeConnectorUUID) {
|
|
221
|
+
updatedConnection.to = endConnectorUUID;
|
|
222
|
+
console.log("\u2705 [restructureConnections] Updated connection.to to ".concat(endConnectorUUID));
|
|
223
|
+
}
|
|
224
|
+
return updatedConnection;
|
|
225
|
+
});
|
|
226
|
+
|
|
227
|
+
// Check if the new connection already exists to prevent duplicates
|
|
228
|
+
var newConnectionExists = currentSceneData.connections.some(function (conn) {
|
|
229
|
+
return conn.from === authoritativeConnectorUUID && conn.to === startConnectorUUID || conn.from === startConnectorUUID && conn.to === authoritativeConnectorUUID;
|
|
230
|
+
});
|
|
231
|
+
if (!newConnectionExists) {
|
|
232
|
+
// Add new connection from authoritative connector to the segment start
|
|
233
|
+
currentSceneData.connections.push({
|
|
234
|
+
from: authoritativeConnectorUUID,
|
|
235
|
+
to: startConnectorUUID
|
|
236
|
+
});
|
|
237
|
+
console.log("\u2705 [restructureConnections] Added new connection: ".concat(authoritativeConnectorUUID, " \u2192 ").concat(startConnectorUUID));
|
|
238
|
+
} else {
|
|
239
|
+
console.log("\u26A0\uFE0F [restructureConnections] Connection already exists, skipping: ".concat(authoritativeConnectorUUID, " \u2192 ").concat(startConnectorUUID));
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
// Log converted gateways for tracking
|
|
243
|
+
if (convertedGatewayUUIDs.length > 0) {
|
|
244
|
+
console.log("\uD83D\uDD27 [restructureConnections] Converted gateways available: ".concat(convertedGatewayUUIDs.join(', ')));
|
|
245
|
+
}
|
|
246
|
+
console.log("\u2705 [restructureConnections] currentSceneData.connections:", JSON.parse(JSON.stringify(currentSceneData.connections)));
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
/**
|
|
250
|
+
* Find the original connection that a segment belongs to
|
|
251
|
+
* @param {THREE.Object3D} segment - The pipe segment
|
|
252
|
+
* @param {Array} connections - Array of connections
|
|
253
|
+
* @returns {Object|null} The original connection or null
|
|
254
|
+
*/
|
|
255
|
+
}, {
|
|
256
|
+
key: "findOriginalConnection",
|
|
257
|
+
value: function findOriginalConnection(segment, connections) {
|
|
258
|
+
var _fromObject$userData, _toObject$userData;
|
|
259
|
+
var segmentData = segment.userData;
|
|
260
|
+
var pathFrom = segmentData.pathFrom;
|
|
261
|
+
var pathTo = segmentData.pathTo;
|
|
262
|
+
console.log('🔍 Looking for connection:', {
|
|
263
|
+
pathFrom: pathFrom,
|
|
264
|
+
pathTo: pathTo
|
|
265
|
+
});
|
|
266
|
+
console.log('🔍 Available connections:', connections);
|
|
267
|
+
|
|
268
|
+
// First try: direct connection match
|
|
269
|
+
var foundConnection = connections.find(function (conn) {
|
|
270
|
+
return conn.from === pathFrom && conn.to === pathTo || conn.from === pathTo && conn.to === pathFrom;
|
|
271
|
+
});
|
|
272
|
+
if (foundConnection) {
|
|
273
|
+
console.log('🔍 Found direct connection match:', foundConnection);
|
|
274
|
+
return foundConnection;
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
// Second try: look for connections that might involve gateways
|
|
278
|
+
// This can happen when the original connection involves a gateway that was computed
|
|
279
|
+
console.log('🔍 No direct match found, checking for gateway-involved connections...');
|
|
280
|
+
var sceneViewer = this.sceneViewer;
|
|
281
|
+
|
|
282
|
+
// Look for objects in the scene that might be the pathFrom or pathTo
|
|
283
|
+
var fromObject = null;
|
|
284
|
+
var toObject = null;
|
|
285
|
+
sceneViewer.scene.traverse(function (obj) {
|
|
286
|
+
var _obj$userData, _obj$userData2;
|
|
287
|
+
if (obj.uuid === pathFrom || ((_obj$userData = obj.userData) === null || _obj$userData === void 0 ? void 0 : _obj$userData.originalUuid) === pathFrom) {
|
|
288
|
+
fromObject = obj;
|
|
289
|
+
}
|
|
290
|
+
if (obj.uuid === pathTo || ((_obj$userData2 = obj.userData) === null || _obj$userData2 === void 0 ? void 0 : _obj$userData2.originalUuid) === pathTo) {
|
|
291
|
+
toObject = obj;
|
|
292
|
+
}
|
|
293
|
+
});
|
|
294
|
+
console.log('🔍 Scene objects found:', {
|
|
295
|
+
fromObject: fromObject ? {
|
|
296
|
+
uuid: fromObject.uuid,
|
|
297
|
+
name: fromObject.uuid,
|
|
298
|
+
objectType: (_fromObject$userData = fromObject.userData) === null || _fromObject$userData === void 0 ? void 0 : _fromObject$userData.objectType
|
|
299
|
+
} : null,
|
|
300
|
+
toObject: toObject ? {
|
|
301
|
+
uuid: toObject.uuid,
|
|
302
|
+
name: toObject.uuid,
|
|
303
|
+
objectType: (_toObject$userData = toObject.userData) === null || _toObject$userData === void 0 ? void 0 : _toObject$userData.objectType
|
|
304
|
+
} : null
|
|
305
|
+
});
|
|
306
|
+
|
|
307
|
+
// If we found the objects, look for connections involving their UUIDs
|
|
308
|
+
if (fromObject && toObject) {
|
|
309
|
+
foundConnection = connections.find(function (conn) {
|
|
310
|
+
return conn.from === fromObject.uuid && conn.to === toObject.uuid || conn.from === toObject.uuid && conn.to === fromObject.uuid;
|
|
311
|
+
});
|
|
312
|
+
if (foundConnection) {
|
|
313
|
+
console.log('🔍 Found connection via object UUIDs:', foundConnection);
|
|
314
|
+
return foundConnection;
|
|
315
|
+
}
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
// Third try: look for any connection that might be related to this segment
|
|
319
|
+
// This is a fallback for cases where the connection structure is complex
|
|
320
|
+
console.log('🔍 Trying fallback: looking for any connection that might be related...');
|
|
321
|
+
|
|
322
|
+
// Look for connections that might involve the segment's path information
|
|
323
|
+
var possibleConnections = connections.filter(function (conn) {
|
|
324
|
+
var _sceneViewer$scene$ge, _sceneViewer$scene$ge2;
|
|
325
|
+
// Check if either end of the connection might be related to our segment
|
|
326
|
+
var fromMatches = conn.from === pathFrom || conn.from === pathTo;
|
|
327
|
+
var toMatches = conn.to === pathFrom || conn.to === pathTo;
|
|
328
|
+
|
|
329
|
+
// Also check if the connection involves any gateway or component that might be related
|
|
330
|
+
var fromIsGateway = ((_sceneViewer$scene$ge = sceneViewer.scene.getObjectByProperty('uuid', conn.from)) === null || _sceneViewer$scene$ge === void 0 || (_sceneViewer$scene$ge = _sceneViewer$scene$ge.userData) === null || _sceneViewer$scene$ge === void 0 ? void 0 : _sceneViewer$scene$ge.objectType) === 'gateway';
|
|
331
|
+
var toIsGateway = ((_sceneViewer$scene$ge2 = sceneViewer.scene.getObjectByProperty('uuid', conn.to)) === null || _sceneViewer$scene$ge2 === void 0 || (_sceneViewer$scene$ge2 = _sceneViewer$scene$ge2.userData) === null || _sceneViewer$scene$ge2 === void 0 ? void 0 : _sceneViewer$scene$ge2.objectType) === 'gateway';
|
|
332
|
+
return fromMatches || toMatches || fromIsGateway || toIsGateway;
|
|
333
|
+
});
|
|
334
|
+
if (possibleConnections.length > 0) {
|
|
335
|
+
console.log('🔍 Found possible related connections:', possibleConnections);
|
|
336
|
+
// Return the first one as a best guess
|
|
337
|
+
return possibleConnections[0];
|
|
338
|
+
}
|
|
339
|
+
console.log('❌ No connection found for segment');
|
|
340
|
+
return null;
|
|
341
|
+
}
|
|
342
|
+
|
|
343
|
+
/**
|
|
344
|
+
* Dispose of connector manager resources
|
|
345
|
+
*/
|
|
346
|
+
}, {
|
|
347
|
+
key: "dispose",
|
|
348
|
+
value: function dispose() {
|
|
349
|
+
console.log('🗑️ Disposing ConnectorManager...');
|
|
350
|
+
|
|
351
|
+
// Call parent dispose to clean up registered resources
|
|
352
|
+
_superPropGet(ConnectorManager, "dispose", this, 3)([]);
|
|
353
|
+
|
|
354
|
+
// Nullify properties
|
|
355
|
+
this.sceneViewer = null;
|
|
356
|
+
console.log('✅ ConnectorManager disposed');
|
|
357
|
+
}
|
|
358
|
+
}]);
|
|
359
|
+
}(BaseDisposable);
|
|
360
|
+
|
|
361
|
+
export { ConnectorManager };
|