00001
00002
00003 #ifndef LINE_H
00004 #define LINE_H
00005
00006 #include <qcolor.h>
00007 #include <qpainter.h>
00008 #include <qstringlist.h>
00009 #include "Point.h"
00010 #include "Arrow.h"
00011
00012 class Line
00013 {
00014 public:
00015 Line(Point s=0,Point e=0,QColor c=QColor("black"),int w=1,Arrow sa=0, Arrow ea=0);
00016 QStringList Info();
00017 void save(QTextStream *t);
00018 void open(QTextStream *t,int version);
00019 Point startPoint() { return start; }
00020 Point endPoint() { return end; }
00021 void setStartPoint(double x, double y) { start=Point(x,y);}
00022 void setEndPoint(double x, double y) { end=Point(x,y);}
00023 int Width() { return width; }
00024 QColor Color() { return color; }
00025 Arrow startArrow() { return sarrow; }
00026 Arrow endArrow() { return earrow; }
00027 void draw(QPainter *p, double w, double h);
00028 bool inside(int x, int y, int w, int h);
00029 protected:
00030 Point start, end;
00031 QColor color;
00032 int width;
00033 Arrow sarrow, earrow;
00034 };
00035
00036 #endif //LINE_H