Refactor floor management APIs: implement getFloorsApi, deleteFloorApi, and upsertFloorApi for enhanced floor data handling. Update FloorCreator for improved point snapping and floor creation logic. Modify ReferencePoint to include UUID and user data. Adjust usePointSnapping to handle temporary points more effectively.

This commit is contained in:
2025-06-26 18:23:01 +05:30
parent 1e88006780
commit 5003dc3504
9 changed files with 157 additions and 33 deletions

View File

@@ -201,10 +201,13 @@ export const usePointSnapping = (currentPoint: { uuid: string, pointType: string
);
}, [floors, currentPoint]);
const snapFloorPoint = useCallback((position: [number, number, number], tempPoints: Point[] | []) => {
const snapFloorPoint = useCallback((position: [number, number, number], tempPoints?: Point[] | []) => {
if (!currentPoint || !CAN_POINT_SNAP) return { position: position, isSnapped: false, snappedPoint: null };
const otherPoints = [...getAllOtherFloorPoints(), ...tempPoints];
const otherPoints = getAllOtherFloorPoints();
if (tempPoints) {
otherPoints.concat(tempPoints);
}
const currentVec = new THREE.Vector3(...position);
for (const point of otherPoints) {