ark::gui::RendererWidget
Defined in header “ark/gui/renderer_widget.hh”.
This widget is used to allow plugins to render 3D geometry. For example, this viewport allows you to visualize pointclouds, detected objects, etc. It works by taking in rendering layers, which provide arrays of data to be visualized.
It also catches mouse actions so that it can manipulate the camera in a consistent fashion.
Methods
-
RendererWidget(Magnum::Platform::GLContext & context, std::shared_ptr< AbstractTransformProvider > transform_provider, std::string default_render_frame_id, QWidget * parent, Qt::WindowFlags window_flags)
Constructor. Initializes the parent. -
~RendererWidget()
Destructor. Releases resources in a current context. -
void add_listener(RendererMousePositionListener listener)
Adds a new listener for mouse position events. -
void add_listener(RendererMouseButtonListener listener)
Adds a new listener for mouse button events. -
void add_listener(RendererMouseWheelListener listener)
Adds a new listener for mouse wheel events. -
void add_layer(std::shared_ptr< const RendererLayer > layer)
Adds a new layer for rendering. -
void reset_transform_network()
Clear the internal transform network cache. -
void reset_layers()
Clears all of the set layers, preparing for a new connection. -
void reset_camera()
Resets the 3D camera back to the defaults. -
void set_orthographic(bool enabled)
Sets if we are in orthographic or projection mode. -
bool is_orthographic()
Returns true if we are in orthographic. -
void set_follow_heading(bool follow_heading)
Sets if we should be following the heading or not. -
bool is_following_heading()
Returns true if we are following the heading. -
void set_render_frame(std::string render_frame)
Set the render frame. -
void set_follow_frame(std::string follow_frame)
Set the follow frame. -
void set_ignore_middle_mouse_button(bool enabled)
Sets if we should ignore the middle mouse button action or not. -
bool is_middle_mouse_button_ignored()
Returns true if the middle mouse button is ignored. -
void set_auto_reset_transform_network(bool enabled)
Sets if we should auto reset the transform network. -
bool is_auto_reset_transform_network_enabled()
Returns true if the transform network is automatically reset. -
std::string selected_render_frame()
Returns the selected renderer frame, or an empty string if no renderer frame is selected. -
std::string selected_follow_frame()
Returns the selected renderer frame, or an empty string if no renderer frame is selected. -
std::set< std::string > get_all_frames()
Get the list of all known frames. -
std::set< std::string > get_layer_names()
Returns a list of all the named renderer layers. -
void enable_layer(const std::string & name, bool enabled)
Enables or disables the given layer, by name. -
bool layer_enabled(const std::string & name)
Returns true if the given layer is enabled, false otherwise. -
void look_at(const CameraLookAt & camera_target)
Set the pose of the camera. -
void set_time(std::chrono::steady_clock::time_point current_time)
Set the current time (used to reset transform network on time jumps).