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 AXISWINDOW_H
00030 #define AXISWINDOW_H
00031
00032 #include "SciFigsDLLExport.h"
00033 #include "GraphicObject.h"
00034 #include "GraphContent.h"
00035
00036 namespace SciFigs {
00037
00038 class GraphContentLayer;
00039
00040 class SCIFIGS_EXPORT AxisWindow : public GraphicObject
00041 {
00042 Q_OBJECT
00043
00044 Q_PROPERTY(QString gridLines READ dummyPropertyString WRITE setDummyProperty STORED false)
00045 Q_PROPERTY(QString printLineWeight READ dummyPropertyString WRITE setDummyProperty STORED false)
00046 Q_PROPERTY(QString printBitmap READ dummyPropertyString WRITE setDummyProperty STORED false)
00047 public:
00048 AxisWindow(QWidget *parent=0, Qt::WFlags f=0);
00049 ~AxisWindow();
00050
00051 virtual const QString& xml_tagName() const {return xmlAxisWindowTag;}
00052 static const QString xmlAxisWindowTag;
00053
00054 virtual void polish();
00055 GraphContent * graphContent() const {return _content;}
00056
00057
00058 void updateScrollBars();
00059 virtual int* scaleFonts(double factor);
00060 virtual void restoreScaleFonts(int* tmp);
00061 virtual void print(QPainter& p, double dotpercm, int x0Sheet, int y0Sheet, bool mask);
00062
00063 Axis * xAxis() const {return _xAxis;}
00064 Axis * yAxis() const {return _yAxis;}
00065
00066 void setHorizontalLine(int l);
00067 void setVerticalLine(int l);
00068
00069 void swapAxes();
00070 void alignHScales(AxisWindow * ref, double atReal);
00071 void alignVScales(AxisWindow * ref, double atReal);
00072
00073 virtual void addProperties(PropertyProxy * pp);
00074 virtual void removeProperties(PropertyProxy * pp);
00075
00076 bool isZoomed() const {return !_zoomRects.isEmpty();}
00077
00078 virtual void xml_polish(XML_POLISH_ARGS);
00079 public slots:
00080 virtual void update();
00081 virtual void deepUpdate();
00082 void zoomIn(double rx1, double ry1, double rx2, double ry2);
00083 void zoomOut();
00084 void browse(QRect& r);
00085 void setMapScale(double rx1, double ry1, double rx2, double ry2);
00086 void updateExternalGeometry();
00087 void updateInternalGeometry();
00088 virtual void updateGeometry();
00089 void checkZoomRects();
00090 private slots:
00091 void xScrollChanged(int val);
00092 void yScrollChanged(int val);
00093 protected:
00094 virtual void xml_writeChildren(XML_WRITECHILDREN_ARGS) const;
00095 virtual XMLMember xml_member(XML_MEMBER_ARGS);
00096 private:
00097 void calcFromTotalSize(double dotpercm, double totalWidth,
00098 double totalHeight, double& xWidth, double& yHeight,
00099 QPainter * p=0) const;
00100 void calcSize(double dotpercm, double& xWidth, double& xHeight,
00101 double& yWidth, double& yHeight,
00102 double xOffset, double yOffset, QPainter * p=0) const;
00103 void calcScreenSize(double dotpercm, int& xWidth, int& yHeight,
00104 int xOffset, int yOffset);
00105 void setAxisGeometry(double dotpercm);
00106 void setAxisGeometry(int xWidth, int yWidth, int xHeight, int yHeight);
00107
00108 void resizeEvent (QResizeEvent * e);
00109 void updateMask();
00110
00111 double commonScale(double startAt);
00112
00113
00114 QVector<Rect> _zoomRects;
00115
00116 Axis * _xAxis;
00117 Axis * _yAxis;
00118 QScrollBar * _xSBar;
00119 QScrollBar * _ySBar;
00120 GraphContent * _content;
00121 static uint _categoryXAxis, _categoryYAxis;
00122 };
00123
00124 }
00125
00126 #endif // AXISWINDOW_H