Go to the documentation of this file.
21 class C3DWindowDialog;
22 class CMyGLCanvas_DisplayWindow3D;
120 using Ptr = std::shared_ptr<CDisplayWindow3D>;
121 using ConstPtr = std::shared_ptr<const CDisplayWindow3D>;
158 const std::string& windowCaption = std::string(),
159 unsigned int initialWindowWidth = 400,
160 unsigned int initialWindowHeight = 300);
164 const std::string& windowCaption,
unsigned int initialWindowWidth = 400,
165 unsigned int initialWindowHeight = 300);
209 void resize(
unsigned int width,
unsigned int height)
override;
211 void setPos(
int x,
int y)
override;
263 const std::string& grab_imgs_prefix = std::string(
"video_"));
313 const double x_frac,
const double y_frac,
const std::string& text,
314 const size_t unique_index = 0,
320 if (!gl_view)
return;
321 gl_view->addTextMessage(x_frac, y_frac, text, unique_index, fontParams);
333 if (!gl_view)
return;
334 gl_view->clearTextMessages();
347 if (!gl_view)
return false;
348 return gl_view->updateTextMessage(unique_index, text);
void setFOV(float v)
Changes the camera field of view (in degrees) (used for gluPerspective).
void internal_emitGrabImageEvent(const std::string &fil)
called by CMyGLCanvas_DisplayWindow3D::OnPostRenderSwapBuffers
void setCursorCross(bool cursorIsCross) override
Set cursor style to default (cursorIsCross=false) or to a cross (cursorIsCross=true)
The basic event type for the observer-observable pattern in MRPT.
bool isCameraProjective() const
Sets the camera as projective, or orthogonal.
A description of a bitmapped or vectorized text font.
void do_nothing() override
Just to allow this class to be polymorphic.
float getFOV() const
Return the camera field of view (in degrees) (used for gluPerspective)
float getCameraElevationDeg() const
Get camera parameters programmatically.
mrpt::void_ptr_noncopy m_GLRenderingContext
mrpt::opengl::COpenGLScene::Ptr m_3Dscene
Internal OpenGL object (see general discussion in about usage of this object)
void grabImagesStart(const std::string &grab_imgs_prefix=std::string("video_"))
Start to save rendered images to disk.
bool isCapturingImgs() const
static CDisplayWindow3D::Ptr Create(const std::string &windowCaption, unsigned int initialWindowWidth=400, unsigned int initialWindowHeight=300)
Class factory returning a smart pointer.
CDisplayWindow3D(const std::string &windowCaption=std::string(), unsigned int initialWindowWidth=400, unsigned int initialWindowHeight=300)
Constructor.
void createOpenGLContext()
Throws an exception on initialization error.
void setWindowTitle(const std::string &str) override
Changes the window title.
void setMinRange(float new_min)
Changes the camera min clip range (z) (used for gluPerspective).
mrpt::void_ptr_noncopy m_DisplayDeviceContext
void internalSetMinMaxRange()
CDisplayWindow3D * source_object
std::shared_ptr< mrpt::img ::CImage > Ptr
void getCameraPointingToPoint(float &x, float &y, float &z) const
Get camera parameters programmatically.
~CDisplayWindow3D() override
Destructor.
std::string m_grab_imgs_prefix
void setCameraZoom(float zoom)
Changes the camera parameters programmatically.
void captureImagesStart()
Enables the grabbing of CImage objects from screenshots of the window.
bool getLastMousePosition(int &x, int &y) const override
Gets the last x,y pixel coordinates of the mouse.
mrpt::opengl::COpenGLScene::Ptr & get3DSceneAndLock()
Gets a reference to the smart shared pointer that holds the internal scene (carefuly read introductio...
Auxiliary class for safely claiming the 3DScene of a mrpt::gui::CDisplayWindow3D.
void addTextMessage(const double x_frac, const double y_frac, const std::string &text, const size_t unique_index=0, const mrpt::opengl::TFontParams &fontParams=mrpt::opengl::TFontParams())
A shortcut for calling mrpt::opengl::COpenGLViewport::addTextMessage() in the "main" viewport of the ...
double getRenderingFPS() const
Get the average Frames Per Second (FPS) value from the last 250 rendering events.
mrpt::opengl::COpenGLViewport::Ptr getDefaultViewport()
A short cut for getting the "main" viewport of the scene object, it is equivalent to:
void resize(unsigned int width, unsigned int height) override
Resizes the window, stretching the image to fit into the display area.
An event sent by a CDisplayWindow3D window when an image is saved after enabling this feature with CD...
void clearTextMessages()
Clear all text messages created with addTextMessage().
void useCameraFromScene(bool useIt=true)
If set to true (default = false), the mouse-based scene navigation will be disabled and the camera po...
float getCameraAzimuthDeg() const
Get camera parameters programmatically.
bool updateTextMessage(const size_t unique_index, const std::string &text)
Just updates the text of a given text message, without touching the other parameters.
std::shared_ptr< const CDisplayWindow3D > ConstPtr
The base class for GUI window classes based on wxWidgets.
void setCameraProjective(bool isProjective)
Sets the camera as projective, or orthogonal.
std::shared_ptr< mrpt::opengl ::COpenGLViewport > Ptr
void setCameraPointingToPoint(float x, float y, float z)
Changes the camera parameters programmatically.
void unlockAccess3DScene()
Unlocks the access to the internal 3D scene.
bool getLastMousePositionRay(mrpt::math::TLine3D &ray) const
Gets the 3D ray for the direction line of the pixel where the mouse cursor is at.
float getCameraZoom() const
Get camera parameters programmatically.
mrpt::gui::CDisplayWindow3D::Ptr win
void captureImagesStop()
Stop image grabbing.
std::string grabImageGetNextFile()
Increments by one the image counter and return the next image file name (Users normally don't want to...
void setCameraElevationDeg(float deg)
Changes the camera parameters programmatically.
mrpt::system::TTimeStamp m_lastFullScreen
friend class CMyGLCanvas_DisplayWindow3D
std::shared_ptr< CDisplayWindow3D > Ptr
std::recursive_timed_mutex m_csAccess3DScene
Critical section for accesing m_3Dscene.
void setMaxRange(float new_max)
Changes the camera max clip range (z) (used for gluPerspective.
mrpt::Clock::time_point TTimeStamp
A system independent time type, it holds the the number of 100-nanosecond intervals since January 1,...
void forceRepaint()
Repaints the window.
Classes for creating GUI windows for 2D and 3D visualization.
std::mutex m_last_captured_img_cs
A class for storing images as grayscale or RGB bitmaps.
mrptEvent3DWindowGrabImageFile(CDisplayWindow3D *obj, const std::string &_img_file)
std::shared_ptr< mrpt::opengl ::COpenGLScene > Ptr
CDisplayWindow3DLocker(CDisplayWindow3D &win, mrpt::opengl::COpenGLScene::Ptr &out_scene_ptr)
Acquires the lock of the 3D scene of the referenced window, and returns a copy of the smart pointer t...
unsigned int m_grab_imgs_idx
void internal_setRenderingFPS(double FPS)
Set the rendering FPS (users don't call this, the method is for internal MRPT objects only)
void updateWindow()
Repaints the window.
bool getLastWindowImage(mrpt::img::CImage &out_img) const
Retrieve the last captured image from the window.
3D line, represented by a base point and a director vector.
void setPos(int x, int y) override
Changes the position of the window on the screen.
void setCameraAzimuthDeg(float deg)
Changes the camera parameters programmatically.
void repaint()
Repaints the window.
const std::string & img_file
The absolute path of the file that has been just saved.
void setImageView(const mrpt::img::CImage &img)
Set the "main" viewport into "image view"-mode, where an image is efficiently drawn (fitting the view...
mrpt::img::CImage::Ptr getLastWindowImagePtr() const
Retrieve the last captured image from the window, as a smart pointer.
A graphical user interface (GUI) for efficiently rendering 3D scenes in real-time.
mrpt::img::CImage::Ptr m_last_captured_img
void grabImagesStop()
Stops image grabbing started by grabImagesStart.
~CDisplayWindow3DLocker()
Page generated by Doxygen 1.8.18 for MRPT 2.0.4 at Thu Sep 24 07:14:18 UTC 2020 | |