Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029 #ifndef CIRCLEVIEWER_H
00030 #define CIRCLEVIEWER_H
00031
00032 #include "GraphContentLayer.h"
00033
00034 namespace SciFigs {
00035
00036 class SCIFIGS_EXPORT CircleViewer : public GraphContentLayer
00037 {
00038 Q_OBJECT
00039 Q_PROPERTY(double lineWeight READ lineWeight WRITE setLineWeight SCRIPTABLE true)
00040 public:
00041 CircleViewer(AxisWindow * parent=0);
00042
00043 virtual const QString& xml_tagName() const {return xmlCircleViewerTag;}
00044 static const QString xmlCircleViewerTag;
00045
00046 void resize(int n);
00047 int count() const {return _items.count();}
00048 void clear();
00049
00050 double lineWeight() const {return _lineWeight;}
00051 void setLineWeight (double lw);
00052
00053 virtual void paintData(const LayerPainterRequest& lp, QPainter& p, double dotpercm) const;
00054 virtual Rect boundingRect() const;
00055 public slots:
00056 void set(int index, double x, double y, double a, double b, double phi, QColor col);
00057 void add(double x, double y, double a, double b, double phi, QColor col);
00058 bool add(const QString& line);
00059 void insert(int index, double x, double y, double a, double b, double phi, QColor col);
00060 void remove(int index);
00061 protected:
00062 class SCIFIGS_EXPORT Item
00063 {
00064 public:
00065 Item() {}
00066 Item(const Item& o) {
00067 _ellipse=o._ellipse;
00068 _color=o._color;
00069 }
00070
00071 Ellipse _ellipse;
00072 QColor _color;
00073 };
00074 QVector<Item> _items;
00075 double _lineWeight;
00076
00077 class SCIFIGS_EXPORT Limits
00078 {
00079 public:
00080 Limits(const GraphContentOptions& gc);
00081
00082 bool polarLimits(const Ellipse& ell, double& startphi, double& stopphi) const;
00083 private:
00084
00085 Point2D _a,_b,_c,_d;
00086
00087 Segment2D _ab,_bc,_cd,_da;
00088
00089 Rect _visLimits;
00090 };
00091 protected:
00092 void xml_writeProperties(XML_WRITEPROPERTIES_ARGS) const;
00093 XMLMember xml_member(XML_MEMBER_ARGS);
00094 bool xml_setProperty(XML_SETPROPERTY_ARGS);
00095 };
00096
00097 }
00098
00099 #endif // CIRCLEVIEWER_H