Refactor: Remove deprecated API endpoints and implement new zone management features

- Deleted obsolete API files for wall items, layers, lines, and points.
- Introduced new zone management APIs including create, delete, and update functionalities.
- Enhanced zone state management in the store with new properties for height and color.
- Implemented 2D and 3D zone rendering components for better visualization.
- Added asset fetching functionalities for marketplace integration.
- Updated types to accommodate new zone properties and API responses.
This commit is contained in:
2025-06-27 17:51:57 +05:30
parent 812a4f6aef
commit fa6506c0be
46 changed files with 1301 additions and 1301 deletions

View File

@@ -24,7 +24,7 @@ import * as Types from "../../types/world/worldTypes";
import SocketResponses from "../collaboration/socket/socketResponses.dev";
import Ground from "../scene/environment/ground";
import { findEnvironment } from "../../services/factoryBuilder/environment/findEnvironment";
import ZoneGroup from "./groups/zoneGroup";
import MeasurementTool from "../scene/tools/measurementTool";
import NavMesh from "../simulation/vehicle/navMesh/navMesh";
import CalculateAreaGroup from "./groups/calculateAreaGroup";
@@ -34,21 +34,19 @@ import DxfFile from "./dfx/LoadBlueprint";
import AislesGroup from "./aisle/aislesGroup";
import WallGroup from "./wall/wallGroup";
import FloorGroup from "./floor/floorGroup";
import ZoneGroup from "./zone/zoneGroup";
import { useParams } from "react-router-dom";
import { useBuilderStore } from "../../store/builder/useBuilderStore";
import { getUserData } from "../../functions/getUserData";
export default function Builder() {
const state = useThree<Types.ThreeState>(); // Importing the state from the useThree hook, which contains the scene, camera, and other Three.js elements.
const dragPointControls = useRef() as Types.RefDragControl; // Reference for drag point controls, an array for drag control.
// Assigning the scene and camera from the Three.js state to the references.
const plane = useRef<THREE.Mesh>(null); // Reference for a plane object for raycaster reference.
const grid = useRef() as any; // Reference for a grid object for raycaster reference.
const floorPlanGroupLine = useRef() as Types.RefGroup; // Reference for a THREE.Group that has the lines that are drawn.
const floorPlanGroupPoint = useRef() as Types.RefGroup; // Reference for a THREE.Group that has the points that are created.
const currentLayerPoint = useRef([]) as Types.RefMeshArray; // Reference for points that re in the current layer used to update the points in drag controls.
const { toggleView } = useToggleView(); // State for toggling between 2D and 3D.
const { setToolMode } = useToolMode();
@@ -111,28 +109,25 @@ export default function Builder() {
hoveredDeletableWallItem={hoveredDeletableWallItem}
/> */}
<Bvh firstHitOnly>
<AssetsGroup plane={plane} />
<ZoneGroup />
<AssetsGroup plane={plane} />
<AislesGroup />
<MeasurementTool />
<CalculateAreaGroup />
<NavMesh />
<DxfFile />
<LayoutImage />
</Bvh>
<AislesGroup />
<WallGroup />
<FloorGroup />
<ZoneGroup />
<MeasurementTool />
<CalculateAreaGroup />
<NavMesh />
<DxfFile />
<LayoutImage />
</>
);
}