Go to the documentation of this file.
21 const std::string& caption,
unsigned int width,
unsigned int height,
24 Eigen::Vector2i(width, height), caption, p.resizable, p.fullscreen,
25 p.colorBits, p.alphaBits, p.depthBits, p.stencilBits, p.nSamples,
26 p.glMajor, p.glMinor, p.maximized)
35 #if GLFW_VERSION_MAJOR > 3 || \
36 (GLFW_VERSION_MAJOR == 3 && GLFW_VERSION_MINOR >= 2)
37 glfwSetWindowIcon(screen()->glfwWindow(), 1, &
images);
44 nanogui::Screen::setVisible(
false);
60 glGetIntegerv(GL_VIEWPORT, win_dims);
67 "Fatal error: there is no 'main' viewport in the 3D scene!");
73 win_dims[2], win_dims[3], win_dims[0], win_dims[1]);
75 catch (
const std::exception& e)
77 std::cerr <<
"[CDisplayWindowGUI::drawContents] Exception:\n"
84 Screen::setSize({width, height});
91 Screen::setCaption(str);
95 const nanogui::Vector2i& p,
int button,
bool down,
int modifiers)
97 if (!Screen::mouseButtonEvent(p, button, down, modifiers))
104 const nanogui::Vector2i& p,
const nanogui::Vector2i& rel,
int button,
107 if (!Screen::mouseMotionEvent(p, rel, button, modifiers))
114 const nanogui::Vector2i& p,
const nanogui::Vector2f& rel)
130 int key,
int scancode,
int action,
int modifiers)
135 if (Screen::keyboardEvent(key, scancode, action, modifiers))
return true;
141 #endif // MRPT_HAS_NANOGUI
mrpt::opengl::CCamera & updateCameraParams(mrpt::opengl::CCamera &cam) const
This function gets a reference to mrpt::opengl::CCamera and updates the camera parameters(pointing,...
void scrollEvent(const nanogui::Vector2i &p, const nanogui::Vector2f &rel)
virtual bool scrollEvent(const nanogui::Vector2i &p, const nanogui::Vector2f &rel) override
mrpt::vision::TCalibrationStereoImageList images
void mouseMotionEvent(const nanogui::Vector2i &p, const nanogui::Vector2i &rel, int button, int modifiers)
std::mutex background_scene_mtx
#define THROW_EXCEPTION(msg)
void render(const RenderContext &rc) const override
Render does nothing here.
std::function< bool(const std::vector< std::string > &)> m_dropFilesCallback
std::shared_ptr< mrpt::opengl ::COpenGLViewport > Ptr
virtual bool keyboardEvent(int key, int scancode, int action, int modifiers) override
A camera: if added to a scene, the viewpoint defined by this camera will be used instead of the camer...
virtual ~CDisplayWindowGUI() override
unsigned char * default_mrpt_glfw_icon()
Returns the default MRPT icon data, as a 64x64 RGBA (32 bit/pixel) image, compatible with GLFW.
Classes for creating GUI windows for 2D and 3D visualization.
void setWindowTitle(const std::string &str)
Changes the window title.
internal::NanoGUICanvasHeadless m_background_canvas
Used to keep track of mouse events on the camera.
std::function< void(void)> m_loopCallback
virtual void drawContents() override
mrpt::opengl::COpenGLScene::Ptr background_scene
void setPos(int x, int y)
Changes the position of the window on the screen.
void resize(unsigned int width, unsigned int height)
Resizes the window.
CDisplayWindowGUI(const std::string &caption=std::string(), unsigned int width=400, unsigned int height=300, const CDisplayWindowGUI_Params &p=CDisplayWindowGUI_Params())
void mouseButtonEvent(const nanogui::Vector2i &p, int button, bool down, int modifiers)
Additional parameters to change the window behavior and OpenGL context.
virtual bool mouseButtonEvent(const nanogui::Vector2i &p, int button, bool down, int modifiers) override
std::function< bool(int, int, int, int)> m_keyboardCallback
std::string exception_to_str(const std::exception &e)
Builds a nice textual representation of a nested exception, which if generated using MRPT macros (THR...
virtual bool mouseMotionEvent(const nanogui::Vector2i &p, const nanogui::Vector2i &rel, int button, int modifiers) override
virtual bool dropEvent(const std::vector< std::string > &filenames) override
Page generated by Doxygen 1.8.17 for MRPT 2.0.3 at Fri May 29 13:06:46 UTC 2020 | |