radial.h

00001
00002 /***************************************************************************
00003  *  radial.h - Scanline model implementation: radial
00004  *
00005  *  Generated: Tue Jul 19 12:05:31 2005
00006  *  Copyright  2005  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_RADIAL_H_
00025 #define __FIREVISION_SCANLINE_RADIAL_H_
00026 
00027 #include <models/scanlines/scanlinemodel.h>
00028 #include <fvutils/base/types.h>
00029
00030 class ScanlineRadial : public ScanlineModel
00031 {
00032
00033  public:
00034
00035   ScanlineRadial(unsigned int width, unsigned int height,
00036                  unsigned int center_x, unsigned int center_y,
00037                  unsigned int radius_increment, unsigned int step,
00038                  unsigned int max_radius = 0, unsigned int dead_radius = 0
00039                  );
00040
00041   fawkes::point_t    operator*();
00042   fawkes::point_t *  operator->();
00043   fawkes::point_t *  operator++();
00044   fawkes::point_t *  operator++(int);
00045
00046   bool          finished();
00047   void          reset();
00048   const char *  get_name();
00049   unsigned int  get_margin();
00050
00051   virtual void  set_robot_pose(float x, float y, float ori) {}
00052   virtual void  set_pan_tilt(float pan, float tilt) {}
00053
00054   void set_center(unsigned int center_x, unsigned int center_y);
00055   void set_radius(unsigned int dead_radius, unsigned int max_radius);
00056
00057
00058  private:
00059
00060   void simpleBubbleSort(unsigned int array[], unsigned int num_elements);
00061
00062   unsigned int width;
00063   unsigned int height;
00064   unsigned int center_x;
00065   unsigned int center_y;
00066   unsigned int radius_increment;
00067   unsigned int step;
00068   unsigned int current_radius;
00069   unsigned int max_radius;
00070   unsigned int dead_radius;
00071   bool         auto_max_radius;
00072
00073   fawkes::point_t coord;
00074   fawkes::point_t tmp_coord;
00075
00076   unsigned int sector;
00077
00078   bool done;
00079
00080   int x;
00081   int y;
00082   int tmp_x;
00083   int tmp_y;
00084
00085 };
00086
00087 #endif