104 const std::vector<EditableRoom>&
rooms()
const;
135 Type type = Type::Vertex;
136 std::size_t roomIndex = 0;
137 std::size_t pointIndex = 0;
141 struct PendingTransform
147 Eigen::Vector2f position = Eigen::Vector2f::Zero();
150 float rotation = 0.F;
153 Eigen::Vector2f translation = Eigen::Vector2f::Zero();
156 enum class ContextMenuEntry
158 InsertPointAfter = 0,
159 InsertPointBefore = 1,
166 void handleContextMenu(
const Handle& handle,
int entry,
viz::StagedCommit& stage);
175 std::vector<Eigen::Vector2f> previewPolygon(std::size_t roomIndex)
const;
178 Eigen::Vector2f handlePosition(
const Handle& handle)
const;
180 std::string elementName(
const Handle& handle)
const;
182 void notifyRoomChanged(std::size_t roomIndex)
const;
185 Parameters parameters;
189 std::vector<EditableRoom> rooms_;
195 std::map<std::string, Handle> handleByElement;
197 std::optional<PendingTransform> pendingTransform;
bool isInteracting() const
True while the user is dragging a handle. Reloading should be paused meanwhile.
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-)d...
const std::vector< EditableRoom > & rooms() const
void setRooms(const std::vector< EditableRoom > &rooms)
Replaces the edited rooms, e.g.
void setRoomChangedCallback(RoomChangedCallback callback)
std::function< void(const EditableRoom &)> RoomChangedCallback
Called whenever a room was modified by the user.
RoomEditor(viz::Client arviz, const Parameters ¶meters)
void redrawAll(viz::StagedCommit &stage)
Stages a full redraw of all layers (rooms and handles).
A room together with the provider segment (i.e. the navigation graph) it belongs to.
std::string providerSegmentName
float moveHandleRadius
Radius of the (cylindrical) whole-room move handle [mm].
float edgeHandleSize
Edge length of the (cubic) edge handles [mm].
float moveHandleHeight
Height of the (cylindrical) whole-room move handle [mm].
float lineWidth
Width of the polygon outline [mm].
float labelScale
Scale of the room name labels.
float vertexHandleRadius
Radius of the (spherical) vertex handles [mm].
std::string layerPrefix
Prefix of the ArViz layers created by the editor.
float handleZOffset
Handles are drawn slightly above the polygon to avoid z-fighting [mm].
A staged commit prepares multiple layers to be committed.