class mrpt::gui::MRPT2NanoguiGLCanvas

Overview

An extension of nanogui::GLCanvas to render MRPT OpenGL scenes.

Directly access scene (locking its mutex scene_mtx first) to update the scene to be rendered.

See also:

CDisplayWindowGUI

#include <mrpt/gui/MRPT2NanoguiGLCanvas.h>

class MRPT2NanoguiGLCanvas: public nanogui::GLCanvas
{
public:
    // fields

    mrpt::opengl::Scene::Ptr scene;
    std::mutex scene_mtx;

    // construction

    MRPT2NanoguiGLCanvas(nanogui::Widget* parent);

    // methods

    virtual void drawGL();
    CGlCanvasBase& camera();
    const CGlCanvasBase& camera() const;
};

Fields

mrpt::opengl::Scene::Ptr scene

The scene to render in this control.

Users must lock the mutex scene_mtx while modifying this variable.