RoomEditor Class Reference

Interactive ArViz front-end for the room polygons stored in the navigation memory. More...

#include <armarx/navigation/components/room_editor/RoomEditor.h>

Classes

struct  Parameters
 

Public Types

using RoomChangedCallback = std::function<void(const EditableRoom&)>
 Called whenever a room was modified by the user.
 

Public Member Functions

bool isInteracting () const
 True while the user is dragging a handle. Reloading should be paused meanwhile.
 
void redrawAll (viz::StagedCommit &stage)
 Stages a full redraw of all layers (rooms and handles).
 
 RoomEditor (viz::Client arviz, const Parameters &parameters)
 
const std::vector< EditableRoom > & rooms () const
 
void setRoomChangedCallback (RoomChangedCallback callback)
 
void setRooms (const std::vector< EditableRoom > &rooms)
 Replaces the edited rooms, e.g.
 
void update (const viz::CommitResult &result, viz::StagedCommit &stage)
 Processes the interaction feedback of the previous commit and stages everything that has to be (re-)drawn.
 

Detailed Description

Interactive ArViz front-end for the room polygons stored in the navigation memory.

Each polygon vertex is visualized as a draggable handle which is restricted to the XY plane. Additionally, a handle is placed on the midpoint of every edge. Dragging such an edge handle (or using its context menu) cuts the edge, i.e. inserts a new vertex in between the two adjacent ones.

The editor is purely concerned with visualization and interaction. Whenever a room has been modified, the callback registered via setRoomChangedCallback() is invoked, which is where the change is persisted (e.g. written back to the memory).

Definition at line 62 of file RoomEditor.h.

Member Typedef Documentation

◆ RoomChangedCallback

using RoomChangedCallback = std::function<void(const EditableRoom&)>

Called whenever a room was modified by the user.

Definition at line 93 of file RoomEditor.h.

Constructor & Destructor Documentation

◆ RoomEditor()

RoomEditor ( viz::Client arviz,
const Parameters & parameters )

Definition at line 110 of file RoomEditor.cpp.

Member Function Documentation

◆ isInteracting()

bool isInteracting ( ) const

True while the user is dragging a handle. Reloading should be paused meanwhile.

Definition at line 135 of file RoomEditor.cpp.

◆ redrawAll()

void redrawAll ( viz::StagedCommit & stage)

Stages a full redraw of all layers (rooms and handles).

Definition at line 396 of file RoomEditor.cpp.

+ Here is the call graph for this function:

◆ rooms()

const std::vector< EditableRoom > & rooms ( ) const

Definition at line 123 of file RoomEditor.cpp.

+ Here is the caller graph for this function:

◆ setRoomChangedCallback()

void setRoomChangedCallback ( RoomChangedCallback callback)

Definition at line 129 of file RoomEditor.cpp.

◆ setRooms()

void setRooms ( const std::vector< EditableRoom > & rooms)

Replaces the edited rooms, e.g.

after (re-)reading them from the memory.

Any interaction that is currently in progress is discarded.

Definition at line 116 of file RoomEditor.cpp.

+ Here is the call graph for this function:

◆ update()

void update ( const viz::CommitResult & result,
viz::StagedCommit & stage )

Processes the interaction feedback of the previous commit and stages everything that has to be (re-)drawn.

Must be called once per cycle, right after stage has been reset.

Definition at line 141 of file RoomEditor.cpp.

+ Here is the call graph for this function:

The documentation for this class was generated from the following files: