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();
120 const
std::
string &windowCaption =
std::
string(),
121 unsigned int initialWindowWidth = 400,
122 unsigned int initialWindowHeight = 300 );
125 static CDisplayWindow3DPtr Create(
126 const
std::
string &windowCaption,
127 unsigned int initialWindowWidth = 400,
128 unsigned int initialWindowHeight = 300 );
137 opengl::COpenGLScenePtr & get3DSceneAndLock( );
142 void unlockAccess3DScene();
152 void repaint() { forceRepaint(); }
160 float getFOV()
const;
165 void setMinRange(
double new_min);
170 void setMaxRange(
double new_max);
175 void setFOV(
float v);
179 void resize(
unsigned int width,
unsigned int height );
183 void setPos(
int x,
int y );
187 void setWindowTitle(
const std::string &str );
191 void setCameraElevationDeg(
float deg );
195 void setCameraAzimuthDeg(
float deg );
199 void setCameraPointingToPoint(
float x,
float y,
float z );
203 void setCameraZoom(
float zoom );
206 void setCameraProjective(
bool isProjective );
210 float getCameraElevationDeg()
const;
213 float getCameraAzimuthDeg()
const;
216 void getCameraPointingToPoint(
float &x,
float &y,
float &z )
const;
219 float getCameraZoom()
const;
222 bool isCameraProjective()
const;
226 void useCameraFromScene(
bool useIt =
true);
232 virtual bool getLastMousePosition(
int &x,
int &y)
const;
235 virtual void setCursorCross(
bool cursorIsCross);
249 void grabImagesStart(
const std::string &grab_imgs_prefix = std::string(
"video_") );
254 void grabImagesStop();
259 void captureImagesStart();
264 void captureImagesStop();
281 mrpt::utils::CImagePtr getLastWindowImagePtr()
const;
286 std::string grabImageGetNextFile();
307 const std::string &text,
309 const size_t unique_index = 0,
318 const std::string &text,
320 const std::string &font_name,
321 const double font_size,
323 const size_t unique_index = 0,
324 const double font_spacing = 1.5,
325 const double font_kerning = 0.1,
326 const bool draw_shadow =
false,
334 void clearTextMessages();
346 mrpt::opengl::COpenGLViewportPtr getDefaultViewport();
363 void internal_setRenderingFPS(
double FPS);
364 void internal_emitGrabImageEvent(
const std::string &fil);
385 const std::string &_img_file
386 ) : 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...
bool isCapturingImgs() const
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].
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.