9 #ifndef CDisplayWindow3D_H
10 #define CDisplayWindow3D_H
27 class C3DWindowDialog;
28 class CMyGLCanvas_DisplayWindow3D;
86 friend class C3DWindowDialog;
87 friend class CMyGLCanvas_DisplayWindow3D;
90 opengl::COpenGLScenePtr m_3Dscene;
94 synch::CCriticalSection m_csAccess3DScene;
98 void createOpenGLContext();
103 std::
string m_grab_imgs_prefix;
104 unsigned int m_grab_imgs_idx;
106 bool m_is_capturing_imgs;
107 CImagePtr m_last_captured_img;
108 synch::CCriticalSection m_last_captured_img_cs;
116 void internalSetMinMaxRange();
122 const
std::
string &windowCaption =
std::
string(),
123 unsigned int initialWindowWidth = 400,
124 unsigned int initialWindowHeight = 300 );
127 static CDisplayWindow3DPtr Create(
128 const
std::
string &windowCaption,
129 unsigned int initialWindowWidth = 400,
130 unsigned int initialWindowHeight = 300 );
139 opengl::COpenGLScenePtr & get3DSceneAndLock( );
144 void unlockAccess3DScene();
154 void repaint() { forceRepaint(); }
162 float getFOV()
const;
167 void setMinRange(
double new_min);
172 void setMaxRange(
double new_max);
177 void setFOV(
float v);
181 void resize(
unsigned int width,
unsigned int height );
185 void setPos(
int x,
int y );
189 void setWindowTitle(
const std::string &str );
193 void setCameraElevationDeg(
float deg );
197 void setCameraAzimuthDeg(
float deg );
201 void setCameraPointingToPoint(
float x,
float y,
float z );
205 void setCameraZoom(
float zoom );
208 void setCameraProjective(
bool isProjective );
212 float getCameraElevationDeg()
const;
215 float getCameraAzimuthDeg()
const;
218 void getCameraPointingToPoint(
float &x,
float &y,
float &z )
const;
221 float getCameraZoom()
const;
224 bool isCameraProjective()
const;
228 void useCameraFromScene(
bool useIt =
true);
234 virtual bool getLastMousePosition(
int &x,
int &y)
const;
237 virtual void setCursorCross(
bool cursorIsCross);
251 void grabImagesStart(
const std::string &grab_imgs_prefix = std::string(
"video_") );
256 void grabImagesStop();
261 void captureImagesStart();
266 void captureImagesStop();
283 mrpt::utils::CImagePtr getLastWindowImagePtr()
const;
288 std::string grabImageGetNextFile();
309 const std::string &text,
311 const size_t unique_index = 0,
320 const std::string &text,
322 const std::string &font_name,
323 const double font_size,
325 const size_t unique_index = 0,
326 const double font_spacing = 1.5,
327 const double font_kerning = 0.1,
328 const bool draw_shadow =
false,
336 void clearTextMessages();
348 mrpt::opengl::COpenGLViewportPtr getDefaultViewport();
365 void internal_setRenderingFPS(
double FPS);
366 void internal_emitGrabImageEvent(
const std::string &fil);
387 const std::string &_img_file
388 ) : source_object(obj), img_file(_img_file) { }
uint64_t TTimeStamp
A system independent time type, it holds the the number of 100-nanosecond intervals since January 1...
An event sent by a CDisplayWindow3D window when an image is saved after enabling this feature with CD...
Classes for serialization, sockets, ini-file manipulation, streams, list of properties-values, timewatch, extensions to STL.
bool isCapturingImgs() const
A class for storing images as grayscale or RGB bitmaps.
The basic event type for the observer-observable pattern in MRPT.
CDisplayWindow3D * source_object
const std::string & img_file
The absolute path of the file that has been just saved.
TOpenGLFont
Existing fonts for 2D texts in mrpt::opengl methods.
TOpenGLFontStyle
Different style for vectorized font rendering.
#define DEFINE_MRPT_OBJECT(class_name)
This declaration must be inserted in all CObject classes definition, within the class declaration...
#define DEFINE_MRPT_OBJECT_POST_CUSTOM_BASE_LINKAGE(class_name, base_name, _LINKAGE_)
double getRenderingFPS() const
Get the average Frames Per Second (FPS) value from the last 250 rendering events. ...
#define DEFINE_MRPT_OBJECT_PRE_CUSTOM_BASE_LINKAGE(class_name, base_name, _LINKAGE_)
mrptEvent3DWindowGrabImageFile(CDisplayWindow3D *obj, const std::string &_img_file)
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
renders glyphs filled with antialiased outlines
A RGB color - floats in the range [0,1].
void updateWindow()
Repaints the window.
virtual void do_nothing()
Just to allow this class to be polymorphic.
The base class for GUI window classes.
A graphical user interface (GUI) for efficiently rendering 3D scenes in real-time.
3D line, represented by a base point and a director vector.