Fawkes API  Fawkes Development Version
radial.h
1 
2 /***************************************************************************
3  * radial.h - Scanline model implementation: radial
4  *
5  * Created: Tue Jul 19 12:05:31 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_RADIAL_H_
25 #define __FIREVISION_SCANLINE_RADIAL_H_
26 
27 #include <fvmodels/scanlines/scanlinemodel.h>
28 #include <fvutils/base/types.h>
29 
30 namespace firevision {
31 #if 0 /* just to make Emacs auto-indent happy */
32 }
33 #endif
34 
36 {
37 
38  public:
39 
40  ScanlineRadial(unsigned int width, unsigned int height,
41  unsigned int center_x, unsigned int center_y,
42  unsigned int radius_increment, unsigned int step,
43  unsigned int max_radius = 0, unsigned int dead_radius = 0
44  );
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 
59  void set_center(unsigned int center_x, unsigned int center_y);
60  void set_radius(unsigned int dead_radius, unsigned int max_radius);
61 
62 
63  private:
64 
65  void simpleBubbleSort(unsigned int array[], unsigned int num_elements);
66 
67  unsigned int width;
68  unsigned int height;
69  unsigned int center_x;
70  unsigned int center_y;
71  unsigned int radius_increment;
72  unsigned int step;
73  unsigned int current_radius;
74  unsigned int max_radius;
75  unsigned int dead_radius;
76  bool auto_max_radius;
77 
78  fawkes::upoint_t coord;
79  fawkes::upoint_t tmp_coord;
80 
81  unsigned int sector;
82 
83  bool done;
84 
85  int x;
86  int y;
87  int tmp_x;
88  int tmp_y;
89 
90 };
91 
92 } // end namespace firevision
93 
94 #endif
fawkes::upoint_t operator*()
Get the current coordinate.
Definition: radial.cpp:80
fawkes::upoint_t * operator++()
Postfix ++ operator.
Definition: radial.cpp:92
Scanline model interface.
Definition: scanlinemodel.h:55
unsigned int get_margin()
Get margin around points.
Definition: radial.cpp:294
Radial scanlines.
Definition: radial.h:35
void set_radius(unsigned int dead_radius, unsigned int max_radius)
Set new radius.
Definition: radial.cpp:322
const char * get_name()
Get name of scanline model.
Definition: radial.cpp:287
void set_center(unsigned int center_x, unsigned int center_y)
Set new center point.
Definition: radial.cpp:307
bool finished()
Check if all desired points have been processed.
Definition: radial.cpp:213
fawkes::upoint_t * operator->()
Get pointer to current point.
Definition: radial.cpp:86
void reset()
Reset model.
Definition: radial.cpp:245
Point with cartesian coordinates as unsigned integers.
Definition: types.h:34
ScanlineRadial(unsigned int width, unsigned int height, unsigned int center_x, unsigned int center_y, unsigned int radius_increment, unsigned int step, unsigned int max_radius=0, unsigned int dead_radius=0)
Constructor.
Definition: radial.cpp:59
virtual void set_robot_pose(float x, float y, float ori)
Set the robot&#39;s pose.
Definition: radial.h:56
virtual void set_pan_tilt(float pan, float tilt)
Set camera&#39;s pan/tilt values.
Definition: radial.h:57