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