Fawkes API  Fawkes Development Version
line.h
1 
2 /***************************************************************************
3  * line.h - Header of circle shape model
4  *
5  * Created: Tue Sep 27 11:25:35 2005
6  * Copyright 2005 Tim Niemueller [www.niemueller.de]
7  * Hu Yuxiao <Yuxiao.Hu@rwth-aachen.de>
8  *
9  ****************************************************************************/
10 
11 /* This program is free software; you can redistribute it and/or modify
12  * it under the terms of the GNU General Public License as published by
13  * the Free Software Foundation; either version 2 of the License, or
14  * (at your option) any later version. A runtime exception applies to
15  * this software (see LICENSE.GPL_WRE file mentioned below for details).
16  *
17  * This program is distributed in the hope that it will be useful,
18  * but WITHOUT ANY WARRANTY; without even the implied warranty of
19  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20  * GNU Library General Public License for more details.
21  *
22  * Read the full text in the LICENSE.GPL_WRE file in the doc directory.
23  */
24 
25 #ifndef _FIREVISION_MODELS_SHAPE_LINE_H_
26 #define _FIREVISION_MODELS_SHAPE_LINE_H_
27 
28 #include <fvmodels/shape/shapemodel.h>
29 #include <fvutils/base/roi.h>
30 #include <fvutils/base/types.h>
31 
32 #include <iostream>
33 #include <vector>
34 
35 namespace firevision {
36 
37 class HtLinesModel;
38 class RhtLinesModel;
39 
40 class LineShape : public Shape
41 {
42  friend HtLinesModel;
43  friend RhtLinesModel;
44 
45 public:
46  LineShape(unsigned int roi_width, unsigned int roi_height);
47  ~LineShape();
48 
49  void printToStream(std::ostream &stream);
50  void setMargin(unsigned int margin);
51  bool isClose(unsigned int in_roi_x, unsigned int in_roi_y);
52 
53  void calcPoints();
54  void getPoints(int *x1, int *y1, int *x2, int *y2);
55 
56 private:
57  float r;
58  float phi;
59  int count;
60  unsigned int margin;
61  int max_length;
62 
63  unsigned int roi_width;
64  unsigned int roi_height;
65 
66  float last_calc_r;
67  float last_calc_phi;
68 
69  int x1;
70  int y1;
71  int x2;
72  int y2;
73 };
74 
75 } // end namespace firevision
76 
77 #endif // FIREVISION_MODELS_SHAPE_LINE_H__
firevision::LineShape::calcPoints
void calcPoints()
Calc points for line.
Definition: line.cpp:95
firevision::LineShape::printToStream
void printToStream(std::ostream &stream)
Print line.
Definition: line.cpp:62
firevision::LineShape::getPoints
void getPoints(int *x1, int *y1, int *x2, int *y2)
Get two points that define the line.
Definition: line.cpp:191
firevision::LineShape::LineShape
LineShape(unsigned int roi_width, unsigned int roi_height)
Constructor.
Definition: line.cpp:40
firevision::LineShape::setMargin
void setMargin(unsigned int margin)
Definition: line.cpp:68
firevision::LineShape::~LineShape
~LineShape()
Destructor.
Definition: line.cpp:54
firevision::LineShape::isClose
bool isClose(unsigned int in_roi_x, unsigned int in_roi_y)
Definition: line.cpp:74