line.h

00001
00002 /***************************************************************************
00003  *  line.h - Header of circle shape model
00004  *
00005  *  Generated: Tue Sep 27 2005 11:25:35
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 class LineShape : public Shape
00036 {
00037   friend class HtLinesModel;
00038   friend class RhtLinesModel;
00039  public:
00040   LineShape(unsigned int roi_width, unsigned int roi_height);
00041   ~LineShape();
00042
00043   void printToStream(std::ostream &stream);
00044   void setMargin( unsigned int margin );
00045   bool isClose(unsigned int in_roi_x, unsigned int in_roi_y);
00046
00047   void calcPoints();
00048   void getPoints(int *x1, int *y1, int *x2, int *y2);
00049
00050  private:
00051   float r;
00052   float phi;
00053   int                   count;
00054   unsigned int          margin;
00055   int                   max_length;
00056
00057   unsigned int  roi_width;
00058   unsigned int  roi_height;
00059
00060   float last_calc_r;
00061   float last_calc_phi;
00062
00063   int x1;
00064   int y1;
00065   int x2;
00066   int y2;
00067
00068
00069 };
00070
00071 #endif // __FIREVISION_MODELS_SHAPE_LINE_H_
00072