9 #ifndef CDisplayWindow3D_H 10 #define CDisplayWindow3D_H 25 class C3DWindowDialog;
26 class CMyGLCanvas_DisplayWindow3D;
84 friend class C3DWindowDialog;
85 friend class CMyGLCanvas_DisplayWindow3D;
88 opengl::COpenGLScenePtr m_3Dscene;
92 synch::CCriticalSection m_csAccess3DScene;
96 void createOpenGLContext();
101 std::
string m_grab_imgs_prefix;
102 unsigned int m_grab_imgs_idx;
104 bool m_is_capturing_imgs;
105 mrpt::utils::CImagePtr m_last_captured_img;
106 synch::CCriticalSection m_last_captured_img_cs;
114 void internalSetMinMaxRange();
119 const
std::
string &windowCaption =
std::
string(),
120 unsigned int initialWindowWidth = 400,
121 unsigned int initialWindowHeight = 300 );
124 static CDisplayWindow3DPtr Create(
125 const
std::
string &windowCaption,
126 unsigned int initialWindowWidth = 400,
127 unsigned int initialWindowHeight = 300 );
134 opengl::COpenGLScenePtr & get3DSceneAndLock( );
138 void unlockAccess3DScene();
146 float getFOV()
const;
147 void setMinRange(
double new_min);
148 void setMaxRange(
double new_max);
149 void setFOV(
float v);
150 void resize(
unsigned int width,
unsigned int height)
MRPT_OVERRIDE;
153 void setCameraElevationDeg(
float deg );
154 void setCameraAzimuthDeg(
float deg );
155 void setCameraPointingToPoint(
float x,
float y,
float z );
156 void setCameraZoom(
float zoom );
157 void setCameraProjective(
bool isProjective );
158 float getCameraElevationDeg()
const;
159 float getCameraAzimuthDeg()
const;
160 void getCameraPointingToPoint(
float &x,
float &y,
float &z )
const;
161 float getCameraZoom()
const;
162 bool isCameraProjective()
const;
163 void useCameraFromScene(
bool useIt =
true);
165 virtual bool getLastMousePosition(
int &x,
int &y)
const MRPT_OVERRIDE;
166 virtual void setCursorCross(
bool cursorIsCross)
MRPT_OVERRIDE;
180 void grabImagesStart(
const std::string &grab_imgs_prefix = std::string(
"video_") );
185 void grabImagesStop();
190 void captureImagesStart();
195 void captureImagesStop();
212 mrpt::utils::CImagePtr getLastWindowImagePtr()
const;
217 std::string grabImageGetNextFile();
238 const std::string &text,
240 const size_t unique_index = 0,
249 const std::string &text,
251 const std::string &font_name,
252 const double font_size,
254 const size_t unique_index = 0,
255 const double font_spacing = 1.5,
256 const double font_kerning = 0.1,
257 const bool draw_shadow =
false,
265 void clearTextMessages();
277 mrpt::opengl::COpenGLViewportPtr getDefaultViewport();
294 void internal_setRenderingFPS(
double FPS);
295 void internal_emitGrabImageEvent(
const std::string &fil);
316 const std::string &_img_file
317 ) : 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...
virtual void do_nothing() MRPT_OVERRIDE
Just to allow this class to be polymorphic.
An event sent by a CDisplayWindow3D window when an image is saved after enabling this feature with CD...
bool isCapturingImgs() const
#define MRPT_OVERRIDE
C++11 "override" for virtuals:
A class for storing images as grayscale or RGB bitmaps.
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_)
non_copiable_ptr_basic< void > void_ptr_noncopy
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].
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.