line.h

00001 
00002 /***************************************************************************
00003  *  line.h - Header of circle shape model
00004  *
00005  *  Created: Tue Sep 27 11:25:35 2005
00006  *  Copyright  2005  Tim Niemueller [www.niemueller.de]
00007  *                   Hu Yuxiao      <Yuxiao.Hu@rwth-aachen.de>
00008  *
00009  ****************************************************************************/
00010 
00011 /*  This program is free software; you can redistribute it and/or modify
00012  *  it under the terms of the GNU General Public License as published by
00013  *  the Free Software Foundation; either version 2 of the License, or
00014  *  (at your option) any later version. A runtime exception applies to
00015  *  this software (see LICENSE.GPL_WRE file mentioned below for details).
00016  *
00017  *  This program is distributed in the hope that it will be useful,
00018  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00019  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00020  *  GNU Library General Public License for more details.
00021  *
00022  *  Read the full text in the LICENSE.GPL_WRE file in the doc directory.
00023  */
00024 
00025 #ifndef __FIREVISION_MODELS_SHAPE_LINE_H_
00026 #define __FIREVISION_MODELS_SHAPE_LINE_H_
00027 
00028 #include <vector>
00029 #include <iostream>
00030 
00031 #include <fvutils/base/types.h>
00032 #include <fvutils/base/roi.h>
00033 #include <models/shape/shapemodel.h>
00034 
00035 namespace firevision {
00036 #if 0 /* just to make Emacs auto-indent happy */
00037 }
00038 #endif
00039 
00040 class LineShape : public Shape
00041 {
00042   friend class HtLinesModel;
00043   friend class RhtLinesModel;
00044  public:
00045   LineShape(unsigned int roi_width, unsigned int roi_height);
00046   ~LineShape();
00047 
00048   void printToStream(std::ostream &stream);
00049   void setMargin( unsigned int margin );
00050   bool isClose(unsigned int in_roi_x, unsigned int in_roi_y);
00051 
00052   void calcPoints();
00053   void getPoints(int *x1, int *y1, int *x2, int *y2);
00054 
00055  private:
00056   float r;
00057   float phi;
00058   int                   count;
00059   unsigned int          margin;
00060   int                   max_length;
00061 
00062   unsigned int  roi_width;
00063   unsigned int  roi_height;
00064 
00065   float last_calc_r;
00066   float last_calc_phi;
00067 
00068   int x1;
00069   int y1;
00070   int x2;
00071   int y2;
00072 
00073 
00074 };
00075 
00076 } // end namespace firevision
00077 
00078 #endif // __FIREVISION_MODELS_SHAPE_LINE_H_

Generated on Tue Feb 22 13:31:17 2011 for Fawkes API by  doxygen 1.4.7