00001
00002
00003 #ifndef ARROW_H
00004 #define ARROW_H
00005
00006 #include <qcolor.h>
00007 #include <qpainter.h>
00008 #include <qstringlist.h>
00009 #include <qdom.h>
00010 #include "Point.h"
00011
00012 class Arrow
00013 {
00014 public:
00015 Arrow(bool l=0,bool e=false,double le=0.3,double a=30,bool f=true,
00016 QColor fc=QColor("blue"));
00017 QStringList Info();
00018 void save(QTextStream *t);
00019 void open(QTextStream *t,int version);
00020 QDomElement saveXML(QDomDocument doc,QString id="Arrow");
00021 void openXML(QDomNode node);
00022 bool Location() { return location; }
00023 void setLocation(bool l) { location=l; }
00024 bool Enabled() { return enabled; }
00025 void Enable(bool b=true) { enabled=b; }
00026 void setEnabled(bool b=true) { Enable(b); }
00027 double Length() { return length; }
00028 void setLength(double l) { length=l; }
00029 double Angle() { return angle; }
00030 void setAngle(double a) { angle=a; }
00031 bool Filled() { return filled; }
00032 void setFilled(bool f=true) { filled=f; }
00033 QColor fillColor() { return fillcolor; }
00034 void setFillColor(QColor c) { fillcolor=c;}
00035 void setFillColor(QString c) { fillcolor=QColor(c);}
00036 void draw(QPainter *p, Point start, Point end, int X, int Y);
00037
00038 protected:
00039 bool location;
00040 bool enabled;
00041 double length;
00042 double angle;
00043 bool filled;
00044 QColor fillcolor;
00045 };
00046
00047 #endif //ARROW_H