Before you start
- You have a project. See Create a plan view.
- You have a scene, a camera and camera controls, such as
OrbitControls.
Open the project
Open the project in aProjectManager and add manager.root to your scene one time.
Mount the editor
GUIEditor needs the element that holds your canvas, your camera and your controls. It stops the controls while the user drags a handle. bindSceneEditor connects it to the project.
Update it in each frame
Callupdate() before you render. The handles then follow the camera.
Edit a wall
When the user selects a wall, the editor shows a line along the wall and these handles:
An end that leaves a corner is free. An end released near the end of another wall joins that end, and the two walls make a corner. An end released near the body of another wall joins that wall. When an end leaves a corner inside one saved wall, Floorkit cuts the saved wall there and gives the new part its own id.
The walls, their doors and their windows move while the user drags. When the user releases the pointer, Floorkit saves one edit command. Thus one drag is one step for undo.
Edit a door or a window
When the user selects a door or a window, the editor shows one dot on it.
The door moves while the user drags, and the cut in the wall moves when the user releases the pointer. One drag is one edit command.
Edit a slab, a roof, a room or a stair
When the user selects one of these, the editor shows its handles.
The 3D editor also has a handle for the height: the thickness of a slab, the eave of a roof, the height of a room and the base of a stair.
The element changes while the user drags. One drag is one
reshape command.
Add undo and redo
The manager has one history for the building, the views and the sheets. The undo key in the editor uses the same history.undo() and redo() return the new revision, or null when there is no step.
Remove the editor
You made the editor, so you dispose it. Then remove the project.Rules
- The container must be the element that the canvas fills. The editor uses its size to place the handles.
- An object with an
enabledproperty is sufficient forcontrols.OrbitControlshas one. - The plan editors and the 3D editor of one manager use the same
hostedOpeningDetachTolerance. Set it in the options of the manager. - The manager does not dispose the
GUIEditor. Dispose the editor before you dispose the manager.
Without the manager
If your app makes theBuildingSession itself, connect the editor with bindManagedSceneEditor. See the bindManagedSceneEditor API.
Next
GUIEditor API
See each member of the 3D editor.
ProjectManager API
See each member of the manager and the project commands.