00001 #ifndef LINE_CLUSTER_H_
00002 #define LINE_CLUSTER_H_
00003
00004 #include <vector>
00005 #include "Color.h"
00006 #include "Line.h"
00007 #include "Region_info.h"
00008 using namespace std;
00009
00010 class Line_cluster {
00011 public:
00012
00013 Line_cluster();
00014 Line_cluster(double len, double width, double height);
00015 ~Line_cluster();
00016
00018 bool hasColor();
00019
00021 void setColors(Color *c1IN, Color *c2IN);
00022
00027 void setBaseLine(Line *bline);
00028
00033 void setConvergePoint(Point *conv);
00034
00036 void setRegionInfo(Region_info *infoIN);
00037
00039 void addLine(Line *l);
00040
00042 int getNumLines();
00043
00045 double getTotalLength();
00046
00048 double getArea();
00049
00051 int getNumLinesContained(double start_angle, double stop_angle);
00052 vector<Line *> *getLinesContained(double start_angle, double stop_angle);
00053
00055 double getWidth();
00056
00058 double getHeight();
00059
00061 Line * getMaxLengthLine();
00062
00064 Line * getMinLengthLine();
00065
00067 void printClusterLines();
00068
00070 void setLabel(int labelIN);
00071
00073 int getLabel();
00074
00076 Line *getFirst();
00077
00079 Line *getNext();
00080
00082 void recenterLines(int x, int y);
00083
00084 private:
00085 const static unsigned int INF = 2147483647;
00086 double total_len, img_width, img_height;
00087 int color1, color2;
00088 Color *c1, *c2;
00089 Line *base_line;
00090 Point *conv;
00091 bool base, converged, colored;
00092 Region_info *info;
00093
00094 int label;
00095
00096 double max_len, min_len;
00097 Line *max_line, *min_line;
00098 vector<Line *>::iterator iter;
00099 vector<Line *> v;
00100
00101 };
00102
00103
00104 #endif