Refactor: Update useEffect dependencies to include activeLayer for ReferenceAisle, ReferenceFloor, ReferenceWall; enhance usePointSnapping with zone snapping functionality and add ReferenceZone component for zone management
This commit is contained in:
@@ -15,6 +15,7 @@ interface ZoneStore {
|
||||
setViewPort: (uuid: string, position: [number, number, number], target: [number, number, number]) => void;
|
||||
|
||||
getZoneById: (uuid: string) => Zone | undefined;
|
||||
getConnectedPoints: (uuid: string) => Point[];
|
||||
}
|
||||
|
||||
export const createZoneStore = () => {
|
||||
@@ -83,6 +84,17 @@ export const createZoneStore = () => {
|
||||
getZoneById: (uuid) => {
|
||||
return get().zones.find(z => z.zoneUuid === uuid);
|
||||
},
|
||||
|
||||
getConnectedPoints: (pointUuid) => {
|
||||
const connected: Point[] = [];
|
||||
for (const zone of get().zones) {
|
||||
if (zone.points.some(p => p.pointUuid === pointUuid)) {
|
||||
connected.push(...zone.points.filter(p => p.pointUuid !== pointUuid));
|
||||
}
|
||||
}
|
||||
return connected;
|
||||
}
|
||||
|
||||
}))
|
||||
);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user