00001 /* +---------------------------------------------------------------------------+ 00002 | The Mobile Robot Programming Toolkit (MRPT) C++ library | 00003 | | 00004 | http://mrpt.sourceforge.net/ | 00005 | | 00006 | Copyright (C) 2005-2009 University of Malaga | 00007 | | 00008 | This software was written by the Machine Perception and Intelligent | 00009 | Robotics Lab, University of Malaga (Spain). | 00010 | Contact: Jose-Luis Blanco <jlblanco@ctima.uma.es> | 00011 | | 00012 | This file is part of the MRPT project. | 00013 | | 00014 | MRPT is free software: you can redistribute it and/or modify | 00015 | it under the terms of the GNU General Public License as published by | 00016 | the Free Software Foundation, either version 3 of the License, or | 00017 | (at your option) any later version. | 00018 | | 00019 | MRPT is distributed in the hope that it will be useful, | 00020 | but WITHOUT ANY WARRANTY; without even the implied warranty of | 00021 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 00022 | GNU General Public License for more details. | 00023 | | 00024 | You should have received a copy of the GNU General Public License | 00025 | along with MRPT. If not, see <http://www.gnu.org/licenses/>. | 00026 | | 00027 +---------------------------------------------------------------------------+ */ 00028 #ifndef CDisplayWindow_H 00029 #define CDisplayWindow_H 00030 00031 #include <mrpt/gui/CBaseGUIWindow.h> 00032 #include <mrpt/vision/CFeature.h> 00033 00034 namespace mrpt 00035 { 00036 namespace utils 00037 { 00038 class CImage; 00039 class CImageFloat; 00040 } 00041 00042 /** Classes for creating GUI windows for 2D and 3D visualization. */ 00043 namespace gui 00044 { 00045 using namespace mrpt::utils; 00046 00047 DEFINE_SERIALIZABLE_PRE(CDisplayWindow) 00048 00049 /** This class creates a window as a graphical user interface (GUI) for displaying images to the user. 00050 */ 00051 class MRPTDLLIMPEXP CDisplayWindow : public mrpt::utils::CSerializable, public mrpt::gui::CBaseGUIWindow 00052 { 00053 // This must be added to any CSerializable derived class: 00054 DEFINE_SERIALIZABLE( CDisplayWindow ) 00055 00056 protected: 00057 00058 /** Enables or disables the visualization of cursor coordinates on the window caption. 00059 */ 00060 bool m_enableCursorCoordinates; 00061 00062 public: 00063 /** Constructor 00064 */ 00065 CDisplayWindow( const std::string &windowCaption = std::string() ); 00066 00067 /** Destructor 00068 */ 00069 virtual ~CDisplayWindow(); 00070 00071 /** Show a given color or grayscale image on the window and print a set of points on it. 00072 * It adapts the size of the window to that of the image. 00073 */ 00074 void showImageAndPoints( const CImage &img, const vector_float &x, const vector_float &y, const TColor &color = TColor::red ); 00075 00076 /** Show a given color or grayscale image on the window and print a set of points on it. 00077 * It adapts the size of the window to that of the image. 00078 */ 00079 void showImageAndPoints( const CImageFloat &img, const vector_float &x, const vector_float &y, const TColor &color = TColor::red ); 00080 00081 /** Show a given color or grayscale image on the window and print a set of points on it. 00082 * It adapts the size of the window to that of the image. 00083 */ 00084 void showImageAndPoints( const CImage &img, const mrpt::vision::CFeatureList &list, const TColor &color = TColor::red ); 00085 00086 /** Show a given color or grayscale image on the window. 00087 * It adapts the size of the window to that of the image. 00088 */ 00089 void showImage( const CImage &img ); 00090 00091 /** Show a given grayscale image on the window. 00092 * It adapts the size of the window to that of the image. 00093 */ 00094 void showImage( const CImageFloat &img ); 00095 00096 /** Plots a graph in MATLAB-like style. 00097 */ 00098 void plot( const vector_float &x, const vector_float &y ); 00099 00100 /** Plots a graph in MATLAB-like style. 00101 */ 00102 void plot( const vector_float &y ); 00103 00104 /** Resizes the window, stretching the image to fit into the display area. 00105 */ 00106 void resize( unsigned int width, unsigned int height ); 00107 00108 /** Changes the position of the window on the screen. 00109 */ 00110 void setPos( int x, int y ); 00111 00112 /** Enables or disables the visualization of cursor coordinates on the window caption (default = enabled). 00113 */ 00114 void enableCursorCoordinatesVisualization(bool enable) 00115 { 00116 m_enableCursorCoordinates = enable; 00117 } 00118 00119 /** Changes the window title text. 00120 */ 00121 void setWindowTitle( const std::string &str ); 00122 00123 }; // End of class def. 00124 00125 } // End of namespace 00126 00127 } // End of namespace 00128 00129 #endif
Page generated by Doxygen 1.5.7.1 for MRPT 0.7.1 SVN: at Mon Aug 17 23:02:22 EDT 2009 |