Main MRPT website > C++ reference for MRPT 1.4.0
List of all members | Public Member Functions | Static Public Member Functions | Static Public Attributes | Protected Member Functions | Protected Attributes | Private Member Functions | Private Attributes | Friends
mrpt::gui::CDisplayWindow3D Class Reference

Detailed Description

A graphical user interface (GUI) for efficiently rendering 3D scenes in real-time.

This class always contains internally an instance of opengl::COpenGLScene, which the objects, viewports, etc. to be rendered.

Images can be grabbed automatically to disk for easy creation of videos. See CDisplayWindow3D::grabImagesStart (and for creating videos, mrpt::vision::CVideoFileWriter).

A short-cut for displaying 2D images (using the OpenGL rendering hardware) is available through setImageView() and setImageView_fast(). Internally, these methods call methods in the "main" viewport of the window (see COpenGLViewport).

Since the 3D rendering is performed in a detached thread, especial care must be taken when updating the 3D scene to be rendered. The process involves an internal critical section and it must always consist of these steps:

CDisplayWindow3D win("My window");
// Adquire the scene:
opengl::COpenGLScenePtr &ptrScene = win.get3DSceneAndLock();
// Modify the scene:
ptrScene->...
// or replace by another scene:
ptrScene = otherScene;
// Unlock it, so the window can use it for redraw:
win.unlockAccess3DScene();
// Update window, if required
win.forceRepaint();
A graphical user interface (GUI) for efficiently rendering 3D scenes in real-time.
struct OPENGL_IMPEXP COpenGLScenePtr
Definition: COpenGLScene.h:23

An alternative way of updating the scene is by creating, before locking the 3D window, a new object of class COpenGLScene, then locking the window only for replacing the smart pointer. This may be advantageous is generating the 3D scene takes a long time, since while the window is locked it will not be responsive to the user input or window redraw.

The window can also display a set of 2D text messages overlapped to the 3D scene. See CDisplayWindow3D::addTextMessage

For a list of supported events with the observer/observable pattern, see the discussion in mrpt::gui::CBaseGUIWindow. In addition to those events, this class introduces mrpt::gui::mrptEvent3DWindowGrabImageFile

See also
The example /samples/display3D, the tutorial only.

Definition at line 78 of file CDisplayWindow3D.h.

#include <mrpt/gui/CDisplayWindow3D.h>

Inheritance diagram for mrpt::gui::CDisplayWindow3D:
Inheritance graph

Public Member Functions

 CDisplayWindow3D (const std::string &windowCaption=std::string(), unsigned int initialWindowWidth=400, unsigned int initialWindowHeight=300)
 Constructor.
 
virtual ~CDisplayWindow3D ()
 Destructor.
 
opengl::COpenGLScenePtrget3DSceneAndLock ()
 Gets a reference to the smart shared pointer that holds the internal scene (carefuly read introduction in gui::CDisplayWindow3D before use!) This also locks the critical section for accesing the scene, thus the window will not be repainted until it is unlocked.
 
void unlockAccess3DScene ()
 Unlocks the access to the internal 3D scene.
 
void forceRepaint ()
 Repaints the window. forceRepaint, repaint and updateWindow are all aliases of the same method.
 
void repaint ()
 
void updateWindow ()
 
float getFOV () const
 Return the camera field of view (in degrees) (used for gluPerspective)
 
void setMinRange (double new_min)
 Changes the camera min clip range (z) (used for gluPerspective). The window is not updated with this method, call "forceRepaint" to update the 3D view.
 
void setMaxRange (double new_max)
 Changes the camera max clip range (z) (used for gluPerspective. The window is not updated with this method, call "forceRepaint" to update the 3D view.
 
void setFOV (float v)
 Changes the camera field of view (in degrees) (used for gluPerspective). The window is not updated with this method, call "forceRepaint" to update the 3D view.
 
void resize (unsigned int width, unsigned int height) MRPT_OVERRIDE
 Resizes the window, stretching the image to fit into the display area.
 
void setPos (int x, int y) MRPT_OVERRIDE
 Changes the position of the window on the screen.
 
void setWindowTitle (const std::string &str) MRPT_OVERRIDE
 Changes the window title.
 
void setCameraElevationDeg (float deg)
 Changes the camera parameters programatically.
 
void setCameraAzimuthDeg (float deg)
 Changes the camera parameters programatically.
 
void setCameraPointingToPoint (float x, float y, float z)
 Changes the camera parameters programatically.
 
void setCameraZoom (float zoom)
 Changes the camera parameters programatically.
 
void setCameraProjective (bool isProjective)
 Sets the camera as projective, or orthogonal.
 
float getCameraElevationDeg () const
 Get camera parameters programatically.
 
float getCameraAzimuthDeg () const
 Get camera parameters programatically.
 
void getCameraPointingToPoint (float &x, float &y, float &z) const
 Get camera parameters programatically.
 
float getCameraZoom () const
 Get camera parameters programatically.
 
bool isCameraProjective () const
 Sets the camera as projective, or orthogonal.
 
void useCameraFromScene (bool useIt=true)
 If set to true (default = false), the mouse-based scene navigation will be disabled and the camera position will be determined by the opengl viewports in the 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.
 
virtual bool getLastMousePosition (int &x, int &y) const MRPT_OVERRIDE
 Gets the last x,y pixel coordinates of the mouse.
 
virtual void setCursorCross (bool cursorIsCross) MRPT_OVERRIDE
 Set cursor style to default (cursorIsCross=false) or to a cross (cursorIsCross=true)
 
void grabImagesStart (const std::string &grab_imgs_prefix=std::string("video_"))
 Start to save rendered images to disk.
 
void grabImagesStop ()
 Stops image grabbing started by grabImagesStart.
 
void captureImagesStart ()
 Enables the grabbing of CImage objects from screenshots of the window.
 
void captureImagesStop ()
 Stop image grabbing.
 
bool getLastWindowImage (mrpt::utils::CImage &out_img) const
 Retrieve the last captured image from the window.
 
mrpt::utils::CImagePtr getLastWindowImagePtr () const
 Retrieve the last captured image from the window, as a smart pointer.
 
std::string grabImageGetNextFile ()
 Increments by one the image counter and return the next image file name (Users normally don't want to call this method).
 
bool isCapturingImgs () const
 
void addTextMessage (const double x, const double y, const std::string &text, const mrpt::utils::TColorf &color=mrpt::utils::TColorf(1.0, 1.0, 1.0), const size_t unique_index=0, const mrpt::opengl::TOpenGLFont font=mrpt::opengl::MRPT_GLUT_BITMAP_TIMES_ROMAN_24)
 Add 2D text messages overlapped to the 3D rendered scene.
 
void addTextMessage (const double x_frac, const double y_frac, const std::string &text, const mrpt::utils::TColorf &color, const std::string &font_name, const double font_size, const mrpt::opengl::TOpenGLFontStyle font_style=mrpt::opengl::NICE, const size_t unique_index=0, const double font_spacing=1.5, const double font_kerning=0.1, const bool draw_shadow=false, const mrpt::utils::TColorf &shadow_color=mrpt::utils::TColorf(0, 0, 0))
 
void clearTextMessages ()
 Clear all text messages created with addTextMessage().
 
double getRenderingFPS () const
 Get the average Frames Per Second (FPS) value from the last 250 rendering events.
 
mrpt::opengl::COpenGLViewportPtr getDefaultViewport ()
 A short cut for getting the "main" viewport of the scene object, it is equivalent to:
 
void setImageView (const mrpt::utils::CImage &img)
 Set the "main" viewport into "image view"-mode, where an image is efficiently drawn (fitting the viewport area) using an OpenGL textured quad.
 
void setImageView_fast (mrpt::utils::CImage &img)
 Just like setImageView but moves the internal image memory instead of making a copy, so it's faster but empties the input image.
 
void * getWxObject ()
 Read-only access to the wxDialog object.
 
void notifyChildWindowDestruction ()
 Called by wx main thread to set m_hwnd to NULL.
 
void notifySemThreadReady ()
 Called by wx main thread to signal the semaphore that the wx window is built and ready.
 
bool isOpen ()
 Returns false if the user has already closed the window.
 
int waitForKey (bool ignoreControlKeys=true, mrptKeyModifier *out_pushModifier=NULL)
 Waits for any key to be pushed on the image or the console, and returns the key code.
 
bool keyHit () const
 Returns true if a key has been pushed, without blocking waiting for a new key being pushed.
 
void clearKeyHitFlag ()
 Assure that "keyHit" will return false until the next pushed key.
 
int getPushedKey (mrptKeyModifier *out_pushModifier=NULL)
 Returns the latest pushed key, or 0 if there is no new key stroke.
 
mrpt::utils::CObjectPtr duplicateGetSmartPtr () const
 Returns a copy of the object, indepently of its class, as a smart pointer (the newly created object will exist as long as any copy of this smart pointer).
 
CObject * clone () const
 Cloning interface for smart pointers.
 

Static Public Member Functions

static CDisplayWindow3DPtr Create (const std::string &windowCaption, unsigned int initialWindowWidth=400, unsigned int initialWindowHeight=300)
 Class factory returning a smart pointer.
 

Static Public Attributes

static const mrpt::utils::TRuntimeClassId classCObject
 
RTTI stuff <br>
static const mrpt::utils::TRuntimeClassId classCBaseGUIWindow
 

Protected Member Functions

void createOpenGLContext ()
 Throws an exception on initialization error.
 
void doRender ()
 
void internalSetMinMaxRange ()
 
void internal_setRenderingFPS (double FPS)
 Set the rendering FPS (users don't call this, the method is for internal MRPT objects only)
 
void internal_emitGrabImageEvent (const std::string &fil)
 called by CMyGLCanvas_DisplayWindow3D::OnPostRenderSwapBuffers
 
void createWxWindow (unsigned int initialWidth, unsigned int initialHeight)
 Must be called by child classes just within the constructor.
 
void destroyWxWindow ()
 Must be called by child classes in their destructors. The code cannot be put into this class' destructor.
 
void publishEvent (const mrptEvent &e) const
 Called when you want this object to emit an event to all the observers currently subscribed to this object.
 
bool hasSubscribers () const
 Can be called by a derived class before preparing an event for publishing with publishEvent to determine if there is no one subscribed, so it can save the wasted time preparing an event that will be not read.
 

Protected Attributes

opengl::COpenGLScenePtr m_3Dscene
 Internal OpenGL object (see general discussion in about usage of this object)
 
synch::CCriticalSection m_csAccess3DScene
 Critical section for accesing m_3Dscene.
 
mrpt::utils::void_ptr_noncopy m_DisplayDeviceContext
 
mrpt::utils::void_ptr_noncopy m_GLRenderingContext
 
std::string m_grab_imgs_prefix
 
unsigned int m_grab_imgs_idx
 
bool m_is_capturing_imgs
 
mrpt::utils::CImagePtr m_last_captured_img
 
synch::CCriticalSection m_last_captured_img_cs
 
mrpt::system::TTimeStamp m_lastFullScreen
 
double m_last_FPS
 
synch::CSemaphore m_semThreadReady
 This semaphore will be signaled when the wx window is built and ready.
 
synch::CSemaphore m_semWindowDestroyed
 This semaphore will be signaled when the wx window is destroyed.
 
std::string m_caption
 The caption of the window.
 
mrpt::utils::void_ptr_noncopy m_hwnd
 The window handle.
 
volatile bool m_keyPushed
 
volatile int m_keyPushedCode
 
volatile mrptKeyModifier m_keyPushedModifier
 

Private Member Functions

void internal_observer_begin (CObserver *)
 
void internal_observer_end (CObserver *)
 

Private Attributes

const int m_CMD_CREATE_WIN
 can be 200,300,400... See WxSubsystem
 
const int m_CMD_DESTROY_WIN
 can be 299,399,499... See WxSubsystem
 
void * m_winobj_voidptr
 
std::set< CObserver * > m_subscribers
 

Friends

class C3DWindowDialog
 
class CMyGLCanvas_DisplayWindow3D
 

RTTI stuff <br>

typedef CDisplayWindow3DPtr SmartPtr
 
static mrpt::utils::CLASSINIT _init_CDisplayWindow3D
 
static mrpt::utils::TRuntimeClassId classCDisplayWindow3D
 
static const mrpt::utils::TRuntimeClassIdclassinfo
 
static const mrpt::utils::TRuntimeClassId_GetBaseClass ()
 
virtual const mrpt::utils::TRuntimeClassIdGetRuntimeClass () const MRPT_OVERRIDE
 Returns information about the class of an object in runtime.
 
virtual mrpt::utils::CObjectduplicate () const MRPT_OVERRIDE
 Returns a copy of the object, indepently of its class.
 
static mrpt::utils::CObjectCreateObject ()
 
static CDisplayWindow3DPtr Create ()
 

Member Typedef Documentation

◆ SmartPtr

A typedef for the associated smart pointer

Definition at line 81 of file CDisplayWindow3D.h.

Constructor & Destructor Documentation

◆ CDisplayWindow3D()

mrpt::gui::CDisplayWindow3D::CDisplayWindow3D ( const std::string &  windowCaption = std::string(),
unsigned int  initialWindowWidth = 400,
unsigned int  initialWindowHeight = 300 
)

Constructor.

◆ ~CDisplayWindow3D()

virtual mrpt::gui::CDisplayWindow3D::~CDisplayWindow3D ( )
virtual

Destructor.

Member Function Documentation

◆ _GetBaseClass()

static const mrpt::utils::TRuntimeClassId * mrpt::gui::CDisplayWindow3D::_GetBaseClass ( )
staticprotected

◆ addTextMessage() [1/2]

void mrpt::gui::CDisplayWindow3D::addTextMessage ( const double  x,
const double  y,
const std::string &  text,
const mrpt::utils::TColorf color = mrpt::utils::TColorf(1.0, 1.0, 1.0),
const size_t  unique_index = 0,
const mrpt::opengl::TOpenGLFont  font = mrpt::opengl::MRPT_GLUT_BITMAP_TIMES_ROMAN_24 
)

Add 2D text messages overlapped to the 3D rendered scene.

The string will remain displayed in the 3D window until it's changed with subsequent calls to this same method, or all the texts are cleared with clearTextMessages().

Parameters
xThe X position, interpreted as absolute pixels from the left if X>=1, absolute pixels from the left if X<0 or as a width factor if in the range [0,1[.
yThe Y position, interpreted as absolute pixels from the bottom if Y>=1, absolute pixels from the top if Y<0 or as a height factor if in the range [0,1[.
textThe text string to display.
colorThe text color. For example: TColorf(1.0,1.0,1.0)
unique_indexAn "index" for this text message, so that subsequent calls with the same index will overwrite this text message instead of creating new ones.

You'll need to refresh the display manually with forceRepaint().

See also
clearTextMessages

◆ addTextMessage() [2/2]

void mrpt::gui::CDisplayWindow3D::addTextMessage ( const double  x_frac,
const double  y_frac,
const std::string &  text,
const mrpt::utils::TColorf color,
const std::string &  font_name,
const double  font_size,
const mrpt::opengl::TOpenGLFontStyle  font_style = mrpt::opengl::NICE,
const size_t  unique_index = 0,
const double  font_spacing = 1.5,
const double  font_kerning = 0.1,
const bool  draw_shadow = false,
const mrpt::utils::TColorf shadow_color = mrpt::utils::TColorf(0, 0, 0) 
)

◆ captureImagesStart()

void mrpt::gui::CDisplayWindow3D::captureImagesStart ( )

Enables the grabbing of CImage objects from screenshots of the window.

See also
getLastWindowImage

◆ captureImagesStop()

void mrpt::gui::CDisplayWindow3D::captureImagesStop ( )

Stop image grabbing.

See also
captureImagesStart

◆ clearKeyHitFlag()

void mrpt::gui::CBaseGUIWindow::clearKeyHitFlag ( )
inlineinherited

Assure that "keyHit" will return false until the next pushed key.

See also
keyHit, waitForKey

Definition at line 127 of file CBaseGUIWindow.h.

◆ clearTextMessages()

void mrpt::gui::CDisplayWindow3D::clearTextMessages ( )

Clear all text messages created with addTextMessage().

You'll need to refresh the display manually with forceRepaint().

See also
addTextMessage

◆ clone()

CObject * mrpt::utils::CObject::clone ( ) const
inlineinherited

Cloning interface for smart pointers.

Definition at line 139 of file CObject.h.

◆ Create() [1/2]

static CDisplayWindow3DPtr mrpt::gui::CDisplayWindow3D::Create ( )
static

◆ Create() [2/2]

static CDisplayWindow3DPtr mrpt::gui::CDisplayWindow3D::Create ( const std::string &  windowCaption,
unsigned int  initialWindowWidth = 400,
unsigned int  initialWindowHeight = 300 
)
static

Class factory returning a smart pointer.

◆ CreateObject()

static mrpt::utils::CObject * mrpt::gui::CDisplayWindow3D::CreateObject ( )
static

◆ createOpenGLContext()

void mrpt::gui::CDisplayWindow3D::createOpenGLContext ( )
protected

Throws an exception on initialization error.

◆ createWxWindow()

void mrpt::gui::CBaseGUIWindow::createWxWindow ( unsigned int  initialWidth,
unsigned int  initialHeight 
)
protectedinherited

Must be called by child classes just within the constructor.

◆ destroyWxWindow()

void mrpt::gui::CBaseGUIWindow::destroyWxWindow ( )
protectedinherited

Must be called by child classes in their destructors. The code cannot be put into this class' destructor.

◆ doRender()

void mrpt::gui::CDisplayWindow3D::doRender ( )
protected

◆ duplicate()

virtual mrpt::utils::CObject * mrpt::gui::CDisplayWindow3D::duplicate ( ) const
virtual

Returns a copy of the object, indepently of its class.

Implements mrpt::utils::CObject.

◆ duplicateGetSmartPtr()

mrpt::utils::CObjectPtr mrpt::utils::CObject::duplicateGetSmartPtr ( ) const
inlineinherited

Returns a copy of the object, indepently of its class, as a smart pointer (the newly created object will exist as long as any copy of this smart pointer).

Definition at line 136 of file CObject.h.

◆ forceRepaint()

void mrpt::gui::CDisplayWindow3D::forceRepaint ( )

Repaints the window. forceRepaint, repaint and updateWindow are all aliases of the same method.

◆ get3DSceneAndLock()

opengl::COpenGLScenePtr & mrpt::gui::CDisplayWindow3D::get3DSceneAndLock ( )

Gets a reference to the smart shared pointer that holds the internal scene (carefuly read introduction in gui::CDisplayWindow3D before use!) This also locks the critical section for accesing the scene, thus the window will not be repainted until it is unlocked.

◆ getCameraAzimuthDeg()

float mrpt::gui::CDisplayWindow3D::getCameraAzimuthDeg ( ) const

Get camera parameters programatically.

◆ getCameraElevationDeg()

float mrpt::gui::CDisplayWindow3D::getCameraElevationDeg ( ) const

Get camera parameters programatically.

◆ getCameraPointingToPoint()

void mrpt::gui::CDisplayWindow3D::getCameraPointingToPoint ( float &  x,
float &  y,
float &  z 
) const

Get camera parameters programatically.

◆ getCameraZoom()

float mrpt::gui::CDisplayWindow3D::getCameraZoom ( ) const

Get camera parameters programatically.

◆ getDefaultViewport()

mrpt::opengl::COpenGLViewportPtr mrpt::gui::CDisplayWindow3D::getDefaultViewport ( )

A short cut for getting the "main" viewport of the scene object, it is equivalent to:

mrpt::opengl::COpenGLScenePtr &scene = win3D.get3DSceneAndLock();
viewport = scene->getViewport("main");
win3D.unlockAccess3DScene();

◆ getFOV()

float mrpt::gui::CDisplayWindow3D::getFOV ( ) const

Return the camera field of view (in degrees) (used for gluPerspective)

◆ getLastMousePosition()

virtual bool mrpt::gui::CDisplayWindow3D::getLastMousePosition ( int &  x,
int &  y 
) const
virtual

Gets the last x,y pixel coordinates of the mouse.

Returns
False if the window is closed.
See also
getLastMousePositionRay

Implements mrpt::gui::CBaseGUIWindow.

◆ getLastMousePositionRay()

bool mrpt::gui::CDisplayWindow3D::getLastMousePositionRay ( mrpt::math::TLine3D ray) const

Gets the 3D ray for the direction line of the pixel where the mouse cursor is at.

Returns
False if the window is closed.
See also
getLastMousePosition

◆ getLastWindowImage()

bool mrpt::gui::CDisplayWindow3D::getLastWindowImage ( mrpt::utils::CImage out_img) const

Retrieve the last captured image from the window.

You MUST CALL FIRST captureImagesStart to enable image grabbing.

Returns
false if there was no time yet for grabbing any image (then, the output image is undefined).
See also
captureImagesStart, getLastWindowImagePtr

◆ getLastWindowImagePtr()

mrpt::utils::CImagePtr mrpt::gui::CDisplayWindow3D::getLastWindowImagePtr ( ) const

Retrieve the last captured image from the window, as a smart pointer.

This method is more efficient than getLastWindowImage since only a copy of the pointer is performed, while getLastWindowImage would copy the entire image.

You MUST CALL FIRST captureImagesStart to enable image grabbing. \Note If there was no time yet for grabbing any image, an empty smart pointer will be returned.

See also
captureImagesStart, getLastWindowImage

◆ getPushedKey()

int mrpt::gui::CBaseGUIWindow::getPushedKey ( mrptKeyModifier out_pushModifier = NULL)
inherited

Returns the latest pushed key, or 0 if there is no new key stroke.

Parameters
out_pushModifierIf set to !=NULL, the modifiers of the key stroke will be saved here.
Returns
The virtual key code, as defined in <mrpt/gui/keycodes.h> (a replication of wxWidgets key codes).
See also
keyHit, waitForKey

◆ getRenderingFPS()

double mrpt::gui::CDisplayWindow3D::getRenderingFPS ( ) const
inline

Get the average Frames Per Second (FPS) value from the last 250 rendering events.

Definition at line 268 of file CDisplayWindow3D.h.

◆ GetRuntimeClass()

virtual const mrpt::utils::TRuntimeClassId * mrpt::gui::CDisplayWindow3D::GetRuntimeClass ( ) const
virtual

Returns information about the class of an object in runtime.

Reimplemented from mrpt::gui::CBaseGUIWindow.

◆ getWxObject()

void * mrpt::gui::CBaseGUIWindow::getWxObject ( )
inlineinherited

Read-only access to the wxDialog object.

Definition at line 75 of file CBaseGUIWindow.h.

◆ grabImageGetNextFile()

std::string mrpt::gui::CDisplayWindow3D::grabImageGetNextFile ( )

Increments by one the image counter and return the next image file name (Users normally don't want to call this method).

See also
grabImagesStart

◆ grabImagesStart()

void mrpt::gui::CDisplayWindow3D::grabImagesStart ( const std::string &  grab_imgs_prefix = std::string("video_"))

Start to save rendered images to disk.

Images will be saved independently as png files, depending on the template path passed to this method. For example:

path_prefix: "./video_"

Will generate "./video_000001.png", etc.

If this feature is enabled, the window will emit events of the type mrpt::gui::mrptEvent3DWindowGrabImageFile() which you can subscribe to.

See also
grabImagesStop

◆ grabImagesStop()

void mrpt::gui::CDisplayWindow3D::grabImagesStop ( )

Stops image grabbing started by grabImagesStart.

See also
grabImagesStart

◆ hasSubscribers()

bool mrpt::utils::CObservable::hasSubscribers ( ) const
inlineprotectedinherited

Can be called by a derived class before preparing an event for publishing with publishEvent to determine if there is no one subscribed, so it can save the wasted time preparing an event that will be not read.

Definition at line 52 of file CObservable.h.

◆ internal_emitGrabImageEvent()

void mrpt::gui::CDisplayWindow3D::internal_emitGrabImageEvent ( const std::string &  fil)
protected

called by CMyGLCanvas_DisplayWindow3D::OnPostRenderSwapBuffers

◆ internal_observer_begin()

void mrpt::utils::CObservable::internal_observer_begin ( CObserver )
privateinherited

◆ internal_observer_end()

void mrpt::utils::CObservable::internal_observer_end ( CObserver )
privateinherited

◆ internal_setRenderingFPS()

void mrpt::gui::CDisplayWindow3D::internal_setRenderingFPS ( double  FPS)
protected

Set the rendering FPS (users don't call this, the method is for internal MRPT objects only)

See also
getRenderingFPS

◆ internalSetMinMaxRange()

void mrpt::gui::CDisplayWindow3D::internalSetMinMaxRange ( )
protected

◆ isCameraProjective()

bool mrpt::gui::CDisplayWindow3D::isCameraProjective ( ) const

Sets the camera as projective, or orthogonal.

◆ isCapturingImgs()

bool mrpt::gui::CDisplayWindow3D::isCapturingImgs ( ) const
inline

Definition at line 219 of file CDisplayWindow3D.h.

◆ isOpen()

bool mrpt::gui::CBaseGUIWindow::isOpen ( )
inherited

Returns false if the user has already closed the window.

◆ keyHit()

bool mrpt::gui::CBaseGUIWindow::keyHit ( ) const
inlineinherited

Returns true if a key has been pushed, without blocking waiting for a new key being pushed.

See also
waitForKey, clearKeyHitFlag

Definition at line 122 of file CBaseGUIWindow.h.

◆ notifyChildWindowDestruction()

void mrpt::gui::CBaseGUIWindow::notifyChildWindowDestruction ( )
inherited

Called by wx main thread to set m_hwnd to NULL.

◆ notifySemThreadReady()

void mrpt::gui::CBaseGUIWindow::notifySemThreadReady ( )
inherited

Called by wx main thread to signal the semaphore that the wx window is built and ready.

◆ publishEvent()

void mrpt::utils::CObservable::publishEvent ( const mrptEvent e) const
protectedinherited

Called when you want this object to emit an event to all the observers currently subscribed to this object.

◆ repaint()

void mrpt::gui::CDisplayWindow3D::repaint ( )
inline

Definition at line 141 of file CDisplayWindow3D.h.

◆ resize()

void mrpt::gui::CDisplayWindow3D::resize ( unsigned int  width,
unsigned int  height 
)
virtual

Resizes the window, stretching the image to fit into the display area.

Implements mrpt::gui::CBaseGUIWindow.

◆ setCameraAzimuthDeg()

void mrpt::gui::CDisplayWindow3D::setCameraAzimuthDeg ( float  deg)

Changes the camera parameters programatically.

◆ setCameraElevationDeg()

void mrpt::gui::CDisplayWindow3D::setCameraElevationDeg ( float  deg)

Changes the camera parameters programatically.

◆ setCameraPointingToPoint()

void mrpt::gui::CDisplayWindow3D::setCameraPointingToPoint ( float  x,
float  y,
float  z 
)

Changes the camera parameters programatically.

◆ setCameraProjective()

void mrpt::gui::CDisplayWindow3D::setCameraProjective ( bool  isProjective)

Sets the camera as projective, or orthogonal.

◆ setCameraZoom()

void mrpt::gui::CDisplayWindow3D::setCameraZoom ( float  zoom)

Changes the camera parameters programatically.

◆ setCursorCross()

virtual void mrpt::gui::CDisplayWindow3D::setCursorCross ( bool  cursorIsCross)
virtual

Set cursor style to default (cursorIsCross=false) or to a cross (cursorIsCross=true)

See also
getLastMousePositionRay

Implements mrpt::gui::CBaseGUIWindow.

◆ setFOV()

void mrpt::gui::CDisplayWindow3D::setFOV ( float  v)

Changes the camera field of view (in degrees) (used for gluPerspective). The window is not updated with this method, call "forceRepaint" to update the 3D view.

◆ setImageView()

void mrpt::gui::CDisplayWindow3D::setImageView ( const mrpt::utils::CImage img)

Set the "main" viewport into "image view"-mode, where an image is efficiently drawn (fitting the viewport area) using an OpenGL textured quad.

Call this method with the new image to update the displayed image (but recall to first lock the parent openglscene's critical section, then do the update, then release the lock, and then issue a window repaint). Internally, the texture is drawn using a mrpt::opengl::CTexturedPlane The viewport can be reverted to behave like a normal viewport by calling setNormalMode()

See also
setImageView_fast, COpenGLViewport

◆ setImageView_fast()

void mrpt::gui::CDisplayWindow3D::setImageView_fast ( mrpt::utils::CImage img)

Just like setImageView but moves the internal image memory instead of making a copy, so it's faster but empties the input image.

See also
setImageView, COpenGLViewport

◆ setMaxRange()

void mrpt::gui::CDisplayWindow3D::setMaxRange ( double  new_max)

Changes the camera max clip range (z) (used for gluPerspective. The window is not updated with this method, call "forceRepaint" to update the 3D view.

◆ setMinRange()

void mrpt::gui::CDisplayWindow3D::setMinRange ( double  new_min)

Changes the camera min clip range (z) (used for gluPerspective). The window is not updated with this method, call "forceRepaint" to update the 3D view.

◆ setPos()

void mrpt::gui::CDisplayWindow3D::setPos ( int  x,
int  y 
)
virtual

Changes the position of the window on the screen.

Implements mrpt::gui::CBaseGUIWindow.

◆ setWindowTitle()

void mrpt::gui::CDisplayWindow3D::setWindowTitle ( const std::string &  str)
virtual

Changes the window title.

Implements mrpt::gui::CBaseGUIWindow.

◆ unlockAccess3DScene()

void mrpt::gui::CDisplayWindow3D::unlockAccess3DScene ( )

Unlocks the access to the internal 3D scene.

Typically user will want to call forceRepaint after updating the scene.

◆ updateWindow()

void mrpt::gui::CDisplayWindow3D::updateWindow ( )
inline

Definition at line 143 of file CDisplayWindow3D.h.

◆ useCameraFromScene()

void mrpt::gui::CDisplayWindow3D::useCameraFromScene ( bool  useIt = true)

If set to true (default = false), the mouse-based scene navigation will be disabled and the camera position will be determined by the opengl viewports in the 3D scene.

◆ waitForKey()

int mrpt::gui::CBaseGUIWindow::waitForKey ( bool  ignoreControlKeys = true,
mrptKeyModifier out_pushModifier = NULL 
)
inherited

Waits for any key to be pushed on the image or the console, and returns the key code.

This method remove key strokes previous to its call, so it will always wait. To get the latest pushed key, see

Parameters
ignoreControlKeysIf set to false, any push of shift, cmd, control, etc... will make this method to return.
out_pushModifierIf set to !=NULL, the modifiers of the key stroke will be saved here.
Returns
The virtual key code, as defined in mrptKeyCode (a replication of wxWidgets key codes).
See also
getPushedKey, Key codes in the enum mrptKeyCode

Friends And Related Function Documentation

◆ C3DWindowDialog

friend class C3DWindowDialog
friend

Definition at line 84 of file CDisplayWindow3D.h.

◆ CMyGLCanvas_DisplayWindow3D

friend class CMyGLCanvas_DisplayWindow3D
friend

Definition at line 85 of file CDisplayWindow3D.h.

Member Data Documentation

◆ _init_CDisplayWindow3D

mrpt::utils::CLASSINIT mrpt::gui::CDisplayWindow3D::_init_CDisplayWindow3D
staticprotected

Definition at line 81 of file CDisplayWindow3D.h.

◆ classCBaseGUIWindow

const mrpt::utils::TRuntimeClassId mrpt::gui::CBaseGUIWindow::classCBaseGUIWindow
staticinherited

Definition at line 49 of file CBaseGUIWindow.h.

◆ classCDisplayWindow3D

mrpt::utils::TRuntimeClassId mrpt::gui::CDisplayWindow3D::classCDisplayWindow3D
static

Definition at line 81 of file CDisplayWindow3D.h.

◆ classCObject

const mrpt::utils::TRuntimeClassId mrpt::utils::CObject::classCObject
staticinherited

Definition at line 124 of file CObject.h.

◆ classinfo

const mrpt::utils::TRuntimeClassId* mrpt::gui::CDisplayWindow3D::classinfo
static

Definition at line 81 of file CDisplayWindow3D.h.

◆ m_3Dscene

opengl::COpenGLScenePtr mrpt::gui::CDisplayWindow3D::m_3Dscene
protected

Internal OpenGL object (see general discussion in about usage of this object)

Definition at line 88 of file CDisplayWindow3D.h.

◆ m_caption

std::string mrpt::gui::CBaseGUIWindow::m_caption
protectedinherited

The caption of the window.

Definition at line 63 of file CBaseGUIWindow.h.

◆ m_CMD_CREATE_WIN

const int mrpt::gui::CBaseGUIWindow::m_CMD_CREATE_WIN
privateinherited

can be 200,300,400... See WxSubsystem

Definition at line 56 of file CBaseGUIWindow.h.

◆ m_CMD_DESTROY_WIN

const int mrpt::gui::CBaseGUIWindow::m_CMD_DESTROY_WIN
privateinherited

can be 299,399,499... See WxSubsystem

Definition at line 57 of file CBaseGUIWindow.h.

◆ m_csAccess3DScene

synch::CCriticalSection mrpt::gui::CDisplayWindow3D::m_csAccess3DScene
protected

Critical section for accesing m_3Dscene.

Definition at line 92 of file CDisplayWindow3D.h.

◆ m_DisplayDeviceContext

mrpt::utils::void_ptr_noncopy mrpt::gui::CDisplayWindow3D::m_DisplayDeviceContext
protected

Definition at line 98 of file CDisplayWindow3D.h.

◆ m_GLRenderingContext

mrpt::utils::void_ptr_noncopy mrpt::gui::CDisplayWindow3D::m_GLRenderingContext
protected

Definition at line 99 of file CDisplayWindow3D.h.

◆ m_grab_imgs_idx

unsigned int mrpt::gui::CDisplayWindow3D::m_grab_imgs_idx
protected

Definition at line 102 of file CDisplayWindow3D.h.

◆ m_grab_imgs_prefix

std::string mrpt::gui::CDisplayWindow3D::m_grab_imgs_prefix
protected

Definition at line 101 of file CDisplayWindow3D.h.

◆ m_hwnd

mrpt::utils::void_ptr_noncopy mrpt::gui::CBaseGUIWindow::m_hwnd
protectedinherited

The window handle.

Definition at line 64 of file CBaseGUIWindow.h.

◆ m_is_capturing_imgs

bool mrpt::gui::CDisplayWindow3D::m_is_capturing_imgs
protected

Definition at line 104 of file CDisplayWindow3D.h.

◆ m_keyPushed

volatile bool mrpt::gui::CBaseGUIWindow::m_keyPushed
protectedinherited

Definition at line 67 of file CBaseGUIWindow.h.

◆ m_keyPushedCode

volatile int mrpt::gui::CBaseGUIWindow::m_keyPushedCode
protectedinherited

Definition at line 68 of file CBaseGUIWindow.h.

◆ m_keyPushedModifier

volatile mrptKeyModifier mrpt::gui::CBaseGUIWindow::m_keyPushedModifier
protectedinherited

Definition at line 69 of file CBaseGUIWindow.h.

◆ m_last_captured_img

mrpt::utils::CImagePtr mrpt::gui::CDisplayWindow3D::m_last_captured_img
protected

Definition at line 105 of file CDisplayWindow3D.h.

◆ m_last_captured_img_cs

synch::CCriticalSection mrpt::gui::CDisplayWindow3D::m_last_captured_img_cs
protected

Definition at line 106 of file CDisplayWindow3D.h.

◆ m_last_FPS

double mrpt::gui::CDisplayWindow3D::m_last_FPS
protected
See also
getRenderingFPS

Definition at line 112 of file CDisplayWindow3D.h.

◆ m_lastFullScreen

mrpt::system::TTimeStamp mrpt::gui::CDisplayWindow3D::m_lastFullScreen
protected

Definition at line 110 of file CDisplayWindow3D.h.

◆ m_semThreadReady

synch::CSemaphore mrpt::gui::CBaseGUIWindow::m_semThreadReady
protectedinherited

This semaphore will be signaled when the wx window is built and ready.

Definition at line 61 of file CBaseGUIWindow.h.

◆ m_semWindowDestroyed

synch::CSemaphore mrpt::gui::CBaseGUIWindow::m_semWindowDestroyed
protectedinherited

This semaphore will be signaled when the wx window is destroyed.

Definition at line 62 of file CBaseGUIWindow.h.

◆ m_subscribers

std::set<CObserver*> mrpt::utils::CObservable::m_subscribers
privateinherited

Definition at line 42 of file CObservable.h.

◆ m_winobj_voidptr

void* mrpt::gui::CBaseGUIWindow::m_winobj_voidptr
privateinherited

Definition at line 58 of file CBaseGUIWindow.h.




Page generated by Doxygen 1.9.6 for MRPT 1.4.0 SVN: at Wed Mar 22 08:20:48 UTC 2023