00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028 #ifndef CDisplayWindow_H
00029 #define CDisplayWindow_H
00030
00031 #include <mrpt/utils/CSerializable.h>
00032 #include <mrpt/config.h>
00033 #include <mrpt/synch.h>
00034 #include <mrpt/vision/CFeature.h>
00035
00036 #include <mrpt/utils/safe_pointers.h>
00037
00038 namespace mrpt
00039 {
00040 namespace utils
00041 {
00042 class CMRPTImage;
00043 class CMRPTImageFloat;
00044 }
00045
00047 namespace gui
00048 {
00049 using namespace mrpt::utils;
00050
00051 DEFINE_SERIALIZABLE_PRE(CDisplayWindow)
00052
00053 using namespace mrpt::utils;
00054
00058 class MRPTDLLIMPEXP CDisplayWindow : public mrpt::utils::CSerializable
00059 {
00060
00061 DEFINE_SERIALIZABLE( CDisplayWindow )
00062
00063 public:
00066 synch::CSemaphore m_semThreadReady;
00067
00070 synch::CSemaphore m_semWindowDestroyed;
00071
00072
00075 void * getWxObject() { return m_hwnd.get(); }
00076
00079 void notifyChildWindowDestruction();
00080
00081 protected:
00084 std::string m_caption;
00085
00088 void_ptr_noncopy m_hwnd;
00089
00092 volatile bool m_keyPushed;
00093
00096 bool m_enableCursorCoordinates;
00097
00098 public:
00101 CDisplayWindow( const std::string &windowCaption = std::string() );
00102
00105 ~CDisplayWindow();
00106
00110 void showImageAndPoints( const CMRPTImage &img, const vector_float &x, const vector_float &y, unsigned int color = 0xFF0000 );
00111
00115 void showImageAndPoints( const CMRPTImageFloat &img, const vector_float &x, const vector_float &y, unsigned int color = 0xFF0000 );
00116
00120 void showImageAndPoints( const CMRPTImage &img, const mrpt::vision::CFeatureList &list, unsigned int color = 0xFF0000 );
00121
00125 void showImage( const CMRPTImage &img );
00126
00130 void showImage( const CMRPTImageFloat &img );
00131
00134 bool isOpen();
00135
00138 void resize( unsigned int width, unsigned int height );
00139
00142 void setPos( int x, int y );
00143
00146 void waitForKey( );
00147
00150 void enableCursorCoordinatesVisualization(bool enable)
00151 {
00152 m_enableCursorCoordinates = enable;
00153 }
00154
00157 void setWindowTitle( const std::string &str );
00158
00159
00160 };
00161
00162 }
00163
00164 }
00165
00166 #endif