Fawkes API  Fawkes Development Version
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
grid.h
1 
2 /***************************************************************************
3  * grid.h - Scanline model implementation: grid
4  *
5  * Created: Sun May 08 21:54:49 2005
6  * Copyright 2005 Tim Niemueller [www.niemueller.de]
7  *
8  ****************************************************************************/
9 
10 /* This program is free software; you can redistribute it and/or modify
11  * it under the terms of the GNU General Public License as published by
12  * the Free Software Foundation; either version 2 of the License, or
13  * (at your option) any later version. A runtime exception applies to
14  * this software (see LICENSE.GPL_WRE file mentioned below for details).
15  *
16  * This program is distributed in the hope that it will be useful,
17  * but WITHOUT ANY WARRANTY; without even the implied warranty of
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19  * GNU Library General Public License for more details.
20  *
21  * Read the full text in the LICENSE.GPL_WRE file in the doc directory.
22  */
23 
24 #ifndef __FIREVISION_SCANLINE_GRID_H_
25 #define __FIREVISION_SCANLINE_GRID_H_
26 
27 #include <fvmodels/scanlines/scanlinemodel.h>
28 #include <fvutils/base/roi.h>
29 #include <fvutils/base/types.h>
30 
31 namespace firevision {
32 #if 0 /* just to make Emacs auto-indent happy */
33 }
34 #endif
35 
37 {
38 
39  public:
40 
41  ScanlineGrid(unsigned int width, unsigned int height,
42  unsigned int offset_x, unsigned int offset_y,
43  ROI* roi = NULL, bool horizontal_grid = true);
44  virtual ~ScanlineGrid();
45 
46  fawkes::point_t operator*();
47  fawkes::point_t * operator->();
48  fawkes::point_t * operator++();
49  fawkes::point_t * operator++(int);
50 
51  bool finished();
52  void reset();
53  const char * get_name();
54  unsigned int get_margin();
55 
56  virtual void set_robot_pose(float x, float y, float ori);
57  virtual void set_pan_tilt(float pan, float tilt);
58  virtual void set_roi(ROI* roi = NULL);
59 
60  void setDimensions(unsigned int width, unsigned int height, ROI* roi = NULL);
61  void setOffset(unsigned int offset_x, unsigned int offset_y);
62  void setGridParams(unsigned int width, unsigned int height,
63  unsigned int offset_x, unsigned int offset_y,
64  ROI* roi = NULL, bool horizontal_grid = true);
65 
66  private:
67  unsigned int width;
68  unsigned int height;
69  unsigned int offset_x;
70  unsigned int offset_y;
71 
72  ROI* roi;
73 
74  bool horizontal_grid;
75  bool more_to_come;
76 
77  fawkes::point_t coord;
78  fawkes::point_t tmp_coord;
79 
80  void calc_next_coord();
81 };
82 
83 } // end namespace firevision
84 
85 #endif