Fawkes API  Fawkes Development Version
scanlinemodel.h
1 
2 /***************************************************************************
3  * scanlinemodel.h - Abstract class defining a scanline model
4  *
5  * Created: Tue May 03 19:50:02 2005
6  * Copyright 2005-2007 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_MODELS_SCANLINES_SCANLINEMODEL_H_
25 #define __FIREVISION_MODELS_SCANLINES_SCANLINEMODEL_H_
26 
27 
28 /* IMPORTANT IMPLEMENTATION NOTE:
29  * Do _not_ split this into a .h and .cpp file. This interface is used in fvutils.
30  * The only way to allows this circular dependency is to have this as a plain
31  * header that does not require any linking. Thus you may not split the file.
32  */
33 
34 #include <core/exceptions/software.h>
35 #include <fvutils/base/types.h>
36 #include <fvutils/base/roi.h>
37 #include <string>
38 
39 namespace firevision {
40 #if 0 /* just to make Emacs auto-indent happy */
41 }
42 #endif
43 
44 /** @class ScanlineModel <fvmodels/scanlines/scanlinemodel.h>
45  * Scanline model interface.
46  * This interface defines the API for the scanline model. A scanline model
47  * determines a specific set of points in the image that should be used for image
48  * evaluation if using all the pixels of an image would take too long.
49  * This is one of the major optimizations throughout FireVision to ensure high
50  * speed image processing.
51  *
52  * @author Tim Niemueller
53  */
54 
56 {
57 
58  public:
59  /** Virtual empty destructor. */
60  virtual ~ScanlineModel() {}
61 
62  /** Get the current coordinate.
63  * @return current point in image that is shall be processed.
64  */
65  virtual fawkes::upoint_t operator*() = 0;
66 
67  /** Get pointer to current point.
68  * @return pointer to current point
69  * @see operator*()
70  */
71  virtual fawkes::upoint_t * operator->() = 0;
72 
73  /** Postfix ++ operator.
74  * Advances to the next point and returns the new point.
75  * @return pointer to new point
76  */
77  virtual fawkes::upoint_t * operator++() = 0;
78 
79  /** Prefix ++ operator.
80  * Advances to the next point but returns the old point.
81  * @return pointer to next point
82  */
83  virtual fawkes::upoint_t * operator++(int) = 0;
84 
85  /** Check if all desired points have been processed.
86  * @return true if all pixels that the model defines have been iterated.
87  */
88  virtual bool finished() = 0;
89 
90  /** Reset model.
91  * Resets the set of processed points.
92  */
93  virtual void reset() = 0;
94 
95  /** Get name of scanline model.
96  * @return name of scanline model.
97  */
98  virtual const char * get_name() = 0;
99 
100 
101  /** Get margin around points.
102  * Models that do not use margins shall return zero.
103  * It shall be guaranteed that in this margin
104  * region around a point there is no other point that has been or will be
105  * returned in a full iteration.
106  * @return margin around a point.
107  */
108  virtual unsigned int get_margin() = 0;
109 
110  /** Set the robot's pose.
111  * @param x robot's x coordinate on field in meters
112  * @param y robot's y coordinate on field in meters
113  * @param ori robot's orientation. Looking towards the opponent goal is zero
114  * rad, with positive values pointing to the right, negative to the left.
115  */
116  virtual void set_robot_pose(float x, float y, float ori) = 0;
117 
118  /** Set camera's pan/tilt values.
119  * @param pan camera's current pan
120  * @param tilt camera's current tilt
121  */
122  virtual void set_pan_tilt(float pan, float tilt) = 0;
123 
124  /** Set the region-of-interest.
125  * If not NULL the scanlines gets only calculated within the ROI
126  * @param roi the region where scanlines should be calculated
127  */
128  virtual void set_roi(ROI* roi = NULL) { throw fawkes::NotImplementedException("Setting ROI is not implemented."); }
129 };
130 
131 } // end namespace firevision
132 
133 #endif
Scanline model interface.
Definition: scanlinemodel.h:55
Called method has not been implemented.
Definition: software.h:107
Region of interest.
Definition: roi.h:58
virtual ~ScanlineModel()
Virtual empty destructor.
Definition: scanlinemodel.h:60
virtual void reset()=0
Reset model.
virtual bool finished()=0
Check if all desired points have been processed.
virtual void set_robot_pose(float x, float y, float ori)=0
Set the robot&#39;s pose.
virtual unsigned int get_margin()=0
Get margin around points.
Point with cartesian coordinates as unsigned integers.
Definition: types.h:34
virtual fawkes::upoint_t * operator++()=0
Postfix ++ operator.
virtual void set_pan_tilt(float pan, float tilt)=0
Set camera&#39;s pan/tilt values.
virtual fawkes::upoint_t operator*()=0
Get the current coordinate.
virtual fawkes::upoint_t * operator->()=0
Get pointer to current point.
virtual void set_roi(ROI *roi=NULL)
Set the region-of-interest.
virtual const char * get_name()=0
Get name of scanline model.