MRPT  2.0.0
List of all members | Public Member Functions | Public Attributes | Protected Attributes
mrpt::gui::MRPT2NanoguiGLCanvas Class Reference

Detailed Description

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

Definition at line 32 of file MRPT2NanoguiGLCanvas.h.

#include <mrpt/gui/MRPT2NanoguiGLCanvas.h>

Inheritance diagram for mrpt::gui::MRPT2NanoguiGLCanvas:

Public Member Functions

 MRPT2NanoguiGLCanvas (nanogui::Widget *parent)
 
 ~MRPT2NanoguiGLCanvas ()
 
virtual void drawGL () override
 
CGlCanvasBasecamera ()
 
const CGlCanvasBasecamera () const
 

Public Attributes

mrpt::opengl::COpenGLScene::Ptr scene
 The scene to render in this control. More...
 
std::mutex scene_mtx
 

Protected Member Functions

Internal virtual functions to handle GUI events
virtual bool mouseMotionEvent (const nanogui::Vector2i &p, const nanogui::Vector2i &rel, int button, int modifiers) override
 
virtual bool mouseButtonEvent (const nanogui::Vector2i &p, int button, bool down, int modifiers) override
 
virtual bool scrollEvent (const nanogui::Vector2i &p, const nanogui::Vector2f &rel) override
 

Protected Attributes

internal::NanoGUICanvasHeadless m_headless_canvas
 Used to keep track of mouse events on the camera. More...
 

Constructor & Destructor Documentation

◆ MRPT2NanoguiGLCanvas()

MRPT2NanoguiGLCanvas::MRPT2NanoguiGLCanvas ( nanogui::Widget *  parent)

Definition at line 19 of file MRPT2NanoguiGLCanvas.cpp.

◆ ~MRPT2NanoguiGLCanvas()

MRPT2NanoguiGLCanvas::~MRPT2NanoguiGLCanvas ( )
default

Member Function Documentation

◆ camera() [1/2]

CGlCanvasBase& mrpt::gui::MRPT2NanoguiGLCanvas::camera ( )
inline

Definition at line 46 of file MRPT2NanoguiGLCanvas.h.

References m_headless_canvas.

◆ camera() [2/2]

const CGlCanvasBase& mrpt::gui::MRPT2NanoguiGLCanvas::camera ( ) const
inline

Definition at line 47 of file MRPT2NanoguiGLCanvas.h.

References m_headless_canvas.

◆ drawGL()

void MRPT2NanoguiGLCanvas::drawGL ( )
overridevirtual

Definition at line 26 of file MRPT2NanoguiGLCanvas.cpp.

References mrpt::img::TColorf::A, mrpt::img::TColorf::B, mrpt::exception_to_str(), mrpt::img::TColorf::G, m_headless_canvas, mrpt::img::TColorf::R, mrpt::opengl::CCamera::render(), scene, scene_mtx, THROW_EXCEPTION, and mrpt::gui::CGlCanvasBase::updateCameraParams().

Here is the call graph for this function:

◆ mouseButtonEvent()

bool MRPT2NanoguiGLCanvas::mouseButtonEvent ( const nanogui::Vector2i &  p,
int  button,
bool  down,
int  modifiers 
)
overrideprotectedvirtual

Definition at line 73 of file MRPT2NanoguiGLCanvas.cpp.

References m_headless_canvas, and mrpt::gui::internal::NanoGUICanvasHeadless::mouseButtonEvent().

Here is the call graph for this function:

◆ mouseMotionEvent()

bool MRPT2NanoguiGLCanvas::mouseMotionEvent ( const nanogui::Vector2i &  p,
const nanogui::Vector2i &  rel,
int  button,
int  modifiers 
)
overrideprotectedvirtual

Definition at line 65 of file MRPT2NanoguiGLCanvas.cpp.

References m_headless_canvas, and mrpt::gui::internal::NanoGUICanvasHeadless::mouseMotionEvent().

Here is the call graph for this function:

◆ scrollEvent()

bool MRPT2NanoguiGLCanvas::scrollEvent ( const nanogui::Vector2i &  p,
const nanogui::Vector2f &  rel 
)
overrideprotectedvirtual

Definition at line 79 of file MRPT2NanoguiGLCanvas.cpp.

References m_headless_canvas, and mrpt::gui::internal::NanoGUICanvasHeadless::scrollEvent().

Here is the call graph for this function:

Member Data Documentation

◆ m_headless_canvas

internal::NanoGUICanvasHeadless mrpt::gui::MRPT2NanoguiGLCanvas::m_headless_canvas
protected

Used to keep track of mouse events on the camera.

Definition at line 63 of file MRPT2NanoguiGLCanvas.h.

Referenced by camera(), drawGL(), mouseButtonEvent(), mouseMotionEvent(), and scrollEvent().

◆ scene

mrpt::opengl::COpenGLScene::Ptr mrpt::gui::MRPT2NanoguiGLCanvas::scene

The scene to render in this control.

Note
Users must lock the mutex scene_mtx while modifying this variable.

Definition at line 43 of file MRPT2NanoguiGLCanvas.h.

Referenced by drawGL().

◆ scene_mtx

std::mutex mrpt::gui::MRPT2NanoguiGLCanvas::scene_mtx

Definition at line 44 of file MRPT2NanoguiGLCanvas.h.

Referenced by drawGL().




Page generated by Doxygen 1.8.14 for MRPT 2.0.0 Git: b38439d21 Tue Mar 31 19:58:06 2020 +0200 at miƩ abr 1 00:50:30 CEST 2020