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
31namespace firevision {
32
34{
35public:
36 ScanlineGrid(unsigned int width,
37 unsigned int height,
38 unsigned int offset_x,
39 unsigned int offset_y,
40 ROI * roi = NULL,
41 bool horizontal_grid = true);
42 virtual ~ScanlineGrid();
43
48
49 bool finished();
50 void reset();
51 const char * get_name();
52 unsigned int get_margin();
53
54 virtual void set_robot_pose(float x, float y, float ori);
55 virtual void set_pan_tilt(float pan, float tilt);
56 virtual void set_roi(ROI *roi = NULL);
57
58 void setDimensions(unsigned int width, unsigned int height, ROI *roi = NULL);
59 void setOffset(unsigned int offset_x, unsigned int offset_y);
60 void setGridParams(unsigned int width,
61 unsigned int height,
62 unsigned int offset_x,
63 unsigned int offset_y,
64 ROI * roi = NULL,
65 bool horizontal_grid = true);
66
67private:
68 unsigned int width;
69 unsigned int height;
70 unsigned int offset_x;
71 unsigned int offset_y;
72
73 ROI *roi;
74
75 bool horizontal_grid;
76 bool more_to_come;
77
78 fawkes::upoint_t coord;
79 fawkes::upoint_t tmp_coord;
80
81 void calc_next_coord();
82};
83
84} // end namespace firevision
85
86#endif
Region of interest.
Definition: roi.h:55
Scanline Grid.
Definition: grid.h:34
virtual ~ScanlineGrid()
Destructor.
Definition: grid.cpp:62
void reset()
Reset model.
Definition: grid.cpp:133
virtual void set_roi(ROI *roi=NULL)
Set the region-of-interest.
Definition: grid.cpp:166
virtual void set_robot_pose(float x, float y, float ori)
Set the robot's pose.
Definition: grid.cpp:154
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:48
virtual void set_pan_tilt(float pan, float tilt)
Set camera's pan/tilt values.
Definition: grid.cpp:160
unsigned int get_margin()
Get margin around points.
Definition: grid.cpp:148
void setDimensions(unsigned int width, unsigned int height, ROI *roi=NULL)
Set dimensions.
Definition: grid.cpp:204
const char * get_name()
Get name of scanline model.
Definition: grid.cpp:142
fawkes::upoint_t * operator->()
Get pointer to current point.
Definition: grid.cpp:74
bool finished()
Check if all desired points have been processed.
Definition: grid.cpp:127
fawkes::upoint_t operator*()
Get the current coordinate.
Definition: grid.cpp:68
void setOffset(unsigned int offset_x, unsigned int offset_y)
Set offset.
Definition: grid.cpp:218
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:239
fawkes::upoint_t * operator++()
Postfix ++ operator.
Definition: grid.cpp:112
Scanline model interface.
Definition: scanlinemodel.h:53
Point with cartesian coordinates as unsigned integers.
Definition: types.h:35