Fawkes API  Fawkes Development Version
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 
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::upoint_t coord;
78  fawkes::upoint_t tmp_coord;
79 
80  void calc_next_coord();
81 };
82 
83 } // end namespace firevision
84 
85 #endif
virtual void set_pan_tilt(float pan, float tilt)
Set camera&#39;s pan/tilt values.
Definition: grid.cpp:179
Scanline Grid.
Definition: grid.h:36
virtual ~ScanlineGrid()
Destructor.
Definition: grid.cpp:64
fawkes::upoint_t * operator++()
Postfix ++ operator.
Definition: grid.cpp:128
Scanline model interface.
Definition: scanlinemodel.h:55
Region of interest.
Definition: roi.h:58
virtual void set_roi(ROI *roi=NULL)
Set the region-of-interest.
Definition: grid.cpp:185
void reset()
Reset model.
Definition: grid.cpp:149
virtual void set_robot_pose(float x, float y, float ori)
Set the robot&#39;s pose.
Definition: grid.cpp:172
const char * get_name()
Get name of scanline model.
Definition: grid.cpp:158
unsigned int get_margin()
Get margin around points.
Definition: grid.cpp:165
void setOffset(unsigned int offset_x, unsigned int offset_y)
Set offset.
Definition: grid.cpp:232
Point with cartesian coordinates as unsigned integers.
Definition: types.h:34
bool finished()
Check if all desired points have been processed.
Definition: grid.cpp:143
fawkes::upoint_t operator*()
Get the current coordinate.
Definition: grid.cpp:70
ScanlineGrid(unsigned int width, unsigned int height, unsigned int offset_x, unsigned int offset_y, ROI *roi=NULL, bool horizontal_grid=true)
Constructor.
Definition: grid.cpp:51
void setDimensions(unsigned int width, unsigned int height, ROI *roi=NULL)
Set dimensions.
Definition: grid.cpp:217
fawkes::upoint_t * operator->()
Get pointer to current point.
Definition: grid.cpp:76
void setGridParams(unsigned int width, unsigned int height, unsigned int offset_x, unsigned int offset_y, ROI *roi=NULL, bool horizontal_grid=true)
Set all grid parameters.
Definition: grid.cpp:254