grid.h
00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #ifndef __FIREVISION_SCANLINE_GRID_H_
00025 #define __FIREVISION_SCANLINE_GRID_H_
00026
00027 #include "models/scanlines/scanlinemodel.h"
00028 #include <fvutils/base/roi.h>
00029 #include <fvutils/base/types.h>
00030
00031 class ScanlineGrid : public ScanlineModel
00032 {
00033
00034 public:
00035
00036 ScanlineGrid(unsigned int width, unsigned int height,
00037 unsigned int offset_x, unsigned int offset_y,
00038 ROI* roi = NULL, bool horizontal_grid = true);
00039 virtual ~ScanlineGrid();
00040
00041 fawkes::point_t operator*();
00042 fawkes::point_t * operator->();
00043 fawkes::point_t * operator++();
00044 fawkes::point_t * operator++(int);
00045
00046 bool finished();
00047 void reset();
00048 const char * get_name();
00049 unsigned int get_margin();
00050
00051 virtual void set_robot_pose(float x, float y, float ori);
00052 virtual void set_pan_tilt(float pan, float tilt);
00053 virtual void set_roi(ROI* roi = NULL);
00054
00055 void setDimensions(unsigned int width, unsigned int height, ROI* roi = NULL);
00056 void setOffset(unsigned int offset_x, unsigned int offset_y);
00057 void setGridParams(unsigned int width, unsigned int height,
00058 unsigned int offset_x, unsigned int offset_y,
00059 ROI* roi = NULL, bool horizontal_grid = true);
00060
00061 private:
00062 unsigned int width;
00063 unsigned int height;
00064 unsigned int offset_x;
00065 unsigned int offset_y;
00066
00067 ROI* roi;
00068
00069 bool horizontal_grid;
00070 bool more_to_come;
00071
00072 fawkes::point_t coord;
00073 fawkes::point_t tmp_coord;
00074
00075 void calc_next_coord();
00076 };
00077
00078 #endif