beams.h

00001 
00002 /***************************************************************************
00003  *  beams.h - Scanline model implementation: beams
00004  *
00005  *  Created: Tue Apr 17 20:59:58 2007
00006  *  Copyright  2005-2007  Tim Niemueller [www.niemueller.de]
00007  *
00008  ****************************************************************************/
00009 
00010 /*  This program is free software; you can redistribute it and/or modify
00011  *  it under the terms of the GNU General Public License as published by
00012  *  the Free Software Foundation; either version 2 of the License, or
00013  *  (at your option) any later version. A runtime exception applies to
00014  *  this software (see LICENSE.GPL_WRE file mentioned below for details).
00015  *
00016  *  This program is distributed in the hope that it will be useful,
00017  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00018  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00019  *  GNU Library General Public License for more details.
00020  *
00021  *  Read the full text in the LICENSE.GPL_WRE file in the doc directory.
00022  */
00023 
00024 #ifndef __FIREVISION_SCANLINE_BEAMS_H_
00025 #define __FIREVISION_SCANLINE_BEAMS_H_
00026 
00027 #include <models/scanlines/scanlinemodel.h>
00028 #include <fvutils/base/types.h>
00029 
00030 #include <vector>
00031 
00032 namespace firevision {
00033 #if 0 /* just to make Emacs auto-indent happy */
00034 }
00035 #endif
00036 
00037 class ScanlineBeams : public ScanlineModel
00038 {
00039 
00040  public:
00041 
00042   ScanlineBeams(unsigned int image_width, unsigned int image_height,
00043                 unsigned int start_x, unsigned int start_y,
00044                 unsigned int stop_y, unsigned int offset_y,
00045                 bool distribute_start_x,
00046                 float angle_from, float angle_range, unsigned int num_beams);
00047 
00048   fawkes::point_t    operator*();
00049   fawkes::point_t *  operator->();
00050   fawkes::point_t *  operator++();
00051   fawkes::point_t *  operator++(int); 
00052 
00053   bool          finished();
00054   void          reset();
00055   const char *  get_name();
00056   unsigned int  get_margin();
00057 
00058   virtual void  set_robot_pose(float x, float y, float ori) {}
00059   virtual void  set_pan_tilt(float pan, float tilt) {}
00060 
00061  private:
00062   void advance();
00063 
00064 
00065   bool _finished;
00066 
00067   std::vector<fawkes::point_t> beam_current_pos;
00068   std::vector<fawkes::point_t> beam_end_pos;
00069 
00070   unsigned int start_x;
00071   unsigned int start_y;
00072   float angle_from;
00073   float angle_range;
00074   unsigned int num_beams;
00075   unsigned int stop_y;
00076   unsigned int offset_y;
00077   unsigned int image_width;
00078   unsigned int image_height;
00079   bool distribute_start_x;
00080 
00081   fawkes::point_t coord;
00082   fawkes::point_t tmp_coord;
00083 
00084   unsigned int next_beam;
00085   unsigned int first_beam;
00086   unsigned int last_beam;
00087 };
00088 
00089 } // end namespace firevision
00090 
00091 #endif

Generated on Tue Feb 22 13:31:17 2011 for Fawkes API by  doxygen 1.4.7