grid.h

00001
00002 /***************************************************************************
00003  *  grid.h - Scanline model implementation: grid
00004  *
00005  *  Generated: Sun May 08 21:54:49 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_GRID_H_
00025 #define __FIREVISION_SCANLINE_GRID_H_
00026 
00027 #include "models/scanlines/scanlinemodel.h"
00028 #include <fvutils/base/roi.h>
00029 #include <fvutils/base/types.h>
00030
00031 class ScanlineGrid : public ScanlineModel
00032 {
00033
00034  public:
00035
00036         ScanlineGrid(unsigned int width, unsigned int height,
00037                unsigned int offset_x, unsigned int offset_y,
00038                ROI* roi = NULL, bool horizontal_grid = true);
00039         virtual ~ScanlineGrid();
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   virtual void  set_roi(ROI* roi = NULL);
00054
00055   void setDimensions(unsigned int width, unsigned int height, ROI* roi = NULL);
00056   void setOffset(unsigned int offset_x, unsigned int offset_y);
00057   void setGridParams(unsigned int width, unsigned int height,
00058                      unsigned int offset_x, unsigned int offset_y,
00059                      ROI* roi = NULL, bool horizontal_grid = true);
00060
00061  private:
00062   unsigned int width;
00063   unsigned int height;
00064   unsigned int offset_x;
00065   unsigned int offset_y;
00066
00067   ROI* roi;
00068
00069   bool horizontal_grid;
00070   bool more_to_come;
00071
00072   fawkes::point_t coord;
00073   fawkes::point_t tmp_coord;
00074
00075   void calc_next_coord();
00076 };
00077
00078 #endif