00001 /** 00002 \file Robots/LoBot/ui/LoLaserWindowRings.H 00003 00004 \brief A helper class for drawing concentric circles to mark distance 00005 measurements on the LRF tester's main window. 00006 00007 This file defines a helper class for drawing concentric circles 00008 centered at the position of the laser range finder within the LRF test 00009 program's window. These circles mark distances at regular intervals. 00010 00011 For example, we can have markings every 100, 500, 1000 and 5000 mm. 00012 Each of these markings can be drawn in a different color. Thus, the 00013 100 mm markings can be one color, the 500 mm markings another color, 00014 the 1000 mm markings yet another color, and, finally the 5000 mm 00015 markings in a fourth color. Furthermore, we can also specify the zoom 00016 ranges at which the 100, 500, 1000 and 5000 mm markings should be 00017 visible. 00018 00019 This helps make the laser range finder's distance measurements more 00020 readable and easier to interpret. It is usually much easier to read 00021 distances off such a "contour" map rather than trying to figure them 00022 out on a square grid. 00023 */ 00024 00025 // //////////////////////////////////////////////////////////////////// // 00026 // The iLab Neuromorphic Vision C++ Toolkit - Copyright (C) 2000-2005 // 00027 // by the University of Southern California (USC) and the iLab at USC. // 00028 // See http://iLab.usc.edu for information about this project. // 00029 // //////////////////////////////////////////////////////////////////// // 00030 // Major portions of the iLab Neuromorphic Vision Toolkit are protected // 00031 // under the U.S. patent ``Computation of Intrinsic Perceptual Saliency // 00032 // in Visual Environments, and Applications'' by Christof Koch and // 00033 // Laurent Itti, California Institute of Technology, 2001 (patent // 00034 // pending; application number 09/912,225 filed July 23, 2001; see // 00035 // http://pair.uspto.gov/cgi-bin/final/home.pl for current status). // 00036 // //////////////////////////////////////////////////////////////////// // 00037 // This file is part of the iLab Neuromorphic Vision C++ Toolkit. // 00038 // // 00039 // The iLab Neuromorphic Vision C++ Toolkit is free software; you can // 00040 // redistribute it and/or modify it under the terms of the GNU General // 00041 // Public License as published by the Free Software Foundation; either // 00042 // version 2 of the License, or (at your option) any later version. // 00043 // // 00044 // The iLab Neuromorphic Vision C++ Toolkit is distributed in the hope // 00045 // that it will be useful, but WITHOUT ANY WARRANTY; without even the // 00046 // implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR // 00047 // PURPOSE. See the GNU General Public License for more details. // 00048 // // 00049 // You should have received a copy of the GNU General Public License // 00050 // along with the iLab Neuromorphic Vision C++ Toolkit; if not, write // 00051 // to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, // 00052 // Boston, MA 02111-1307 USA. // 00053 // //////////////////////////////////////////////////////////////////// // 00054 // 00055 // Primary maintainer for this file: mviswana usc edu 00056 // $HeadURL: svn://isvn.usc.edu/software/invt/trunk/saliency/src/Robots/LoBot/ui/LoLaserWindowRings.H $ 00057 // $Id: LoLaserWindowRings.H 12861 2010-02-18 19:46:03Z mviswana $ 00058 // 00059 00060 #ifndef LOBOT_LASER_WINDOW_RINGS_DOT_H 00061 #define LOBOT_LASER_WINDOW_RINGS_DOT_H 00062 00063 //------------------------------ HEADERS -------------------------------- 00064 00065 // lobot headers 00066 #include "Robots/LoBot/ui/LoLaserWindowMarkings.H" 00067 #include "Robots/LoBot/misc/factory.hh" 00068 00069 //----------------------------- NAMESPACE ------------------------------- 00070 00071 namespace lobot { 00072 00073 //------------------------- CLASS DEFINITION ---------------------------- 00074 00075 /** 00076 \class lobot::LaserWindowRings 00077 \brief A helper class for drawing the laser range finder's 00078 measurements rings. 00079 00080 The laser range finder's test program depicts the distance 00081 measurements as rays emanating from the origin of a world coordinate 00082 system that is setup to match the units and range of the LRF device. 00083 To help make sense of the lengths of these rays, we draw a concentric 00084 circles spanning the entire range of the device. Each circle marks a 00085 particular distance from the laser range finder. 00086 00087 We can have rings corresponding to different intervals. Each 00088 interval's rings can have a different color and can be active at 00089 different zoom levels. For example, users can choose to have markings 00090 at 100, 500, 1000 and 5000 mm. The markings at each of these intervals 00091 can be drawn in different colors. Furthermore, users can specify the 00092 zoom levels at which these markings should be visible. Thus, when 00093 zoomed out a lot, we can show only the 5000 mm markings to make the 00094 overall scene more legible; and at high zoom levels (zoomed in a lot), 00095 we can show the more fine-grained 100 mm markings. 00096 00097 This class takes care of the details of drawing the contours described 00098 above. 00099 */ 00100 class LaserWindowRings : public LaserWindowMarkings { 00101 // Prevent copy and assignment 00102 LaserWindowRings(const LaserWindowRings&) ; 00103 LaserWindowRings& operator=(const LaserWindowRings&) ; 00104 00105 // Boilerplate code to make the factory work 00106 friend class subfactory<LaserWindowRings, LaserWindowMarkings> ; 00107 typedef register_factory<LaserWindowRings, LaserWindowMarkings> my_factory ; 00108 static my_factory register_me ; 00109 00110 // Handy type to have around in a derived class 00111 typedef LaserWindowMarkings base ; 00112 00113 /// This class uses an OpenGL display list to speed up drawing the 00114 /// concentric circles. 00115 mutable int m_display_list ; 00116 00117 /// Private constructor because laser window markings are created with 00118 /// an object factory. 00119 LaserWindowRings() ; 00120 00121 /// Draw the measurements contours. 00122 void render() const ; 00123 00124 /// Clean-up. 00125 ~LaserWindowRings() ; 00126 } ; 00127 00128 //----------------------------------------------------------------------- 00129 00130 } // end of namespace encapsulating this file's definitions 00131 00132 #endif 00133 00134 /* So things look consistent in everyone's emacs... */ 00135 /* Local Variables: */ 00136 /* indent-tabs-mode: nil */ 00137 /* End: */