Class MolaViz

Nested Relationships

Nested Types

Inheritance Relationships

Base Types

  • public mola::ExecutableBase

  • public mola::VizInterface

Class Documentation

class MolaViz : public mola::ExecutableBase, public mola::VizInterface

MOLA GUI and visualization API

mola-viz main API

using window_name_t = std::string
using subwindow_name_t = std::string
static const window_name_t DEFAULT_WINDOW_NAME
std::future<nanogui::Window*> create_subwindow(const std::string &subWindowTitle, const std::string &parentWindow = DEFAULT_WINDOW_NAME) override

Returned object is owned by the VizInterface, do NOT delete it. Updates to it must be done via enqueue_custom_nanogui_code()

std::future<bool> subwindow_update_visualization(const mrpt::rtti::CObject::Ptr &obj, const std::string &subWindowTitle, const std::string &parentWindow = DEFAULT_WINDOW_NAME) override

Updates the contents of a subwindow from a given object, typically a mrpt::obs::CObservation, but custom handlers can be installed for arbitrary classes.

Depending on the object class RTTI, the corresponding handler is called.

See also

Returns:

false if no handler is found for the given object.

std::future<bool> update_3d_object(const std::string &objName, const std::shared_ptr<mrpt::opengl::CSetOfObjects> &obj, const std::string &viewportName = "main", const std::string &parentWindow = DEFAULT_WINDOW_NAME) override

Update (or adds if not found) a 3D object in the main 3D view area.

std::future<bool> update_viewport_look_at(const mrpt::math::TPoint3Df &lookAt, const std::string &viewportName = "main", const std::string &parentWindow = DEFAULT_WINDOW_NAME) override
std::future<bool> output_console_message(const std::string &msg, const std::string &parentWindow = "main") override
std::future<void> enqueue_custom_nanogui_code(const std::function<void(void)> &userCode) override

Updates to nanogui window controls must happen via this method to ensure it is run by the correct thread, in the next available time slot.

static bool IsRunning()
static MolaViz *Instance()

mola-viz GUI update handlers registry

using update_handler_t = std::function<void(const mrpt::rtti::CObject::Ptr&, nanogui::Window *subWin, window_name_t parentWin, MolaViz *instance)>
using class_name_t = std::string
static void register_gui_handler(class_name_t name, update_handler_t handler)

mola-viz module parameters

double console_text_font_size_ = 9.0
unsigned int max_console_lines_ = 5
bool show_rgbd_as_point_cloud_ = false

Public Functions

MolaViz()
~MolaViz() override
virtual void initialize(const Yaml &cfg) override
virtual void spinOnce() override
inline void markWindowForReLayout(const window_name_t &name)