00001 //LabPlot: Axis.h 00002 00003 #ifndef AXIS_H 00004 #define AXIS_H 00005 00006 #include <qstring.h> 00007 #include <qfont.h> 00008 #include <qcolor.h> 00009 #include "Label.h" 00010 #include "defs.h" 00011 00012 class Axis { 00013 public: 00014 Axis(); 00015 void enable(bool b) { e = b; } 00016 bool enabled() { return e; } 00017 void setScale(TScale s) { scale=s; } 00018 TScale Scale() { return scale; } 00019 void setLabel(Label *label) { l = label; } 00020 void setScaling(double s) { scaling=s; } 00021 double getScaling() { return scaling; } 00022 void setShift(double s) { shift=s; } 00023 double getShift() { return shift; } 00024 Label *label() { return l; } 00025 void setTicsLabelRotation(double r) { tlrotation = r; } 00026 double getTicsLabelRotation() { return tlrotation; } 00027 void setTicLabelPrefix(QString p) { tlprefix=p; } 00028 QString getTicLabelPrefix() { return tlprefix; } 00029 void setTicLabelSuffix(QString s) { tlsuffix=s; } 00030 QString getTicLabelSuffix() { return tlsuffix; } 00031 void setTicsFont(QFont a) { tf = a; } 00032 QFont ticsFont() { return tf; } 00033 void setTicsColor(QColor col) { tc = col; } 00034 QColor ticsColor() { return tc; } 00035 void setTicsLabelColor(QColor col) { tlc = col; } 00036 QColor ticsLabelColor() { return tlc; } 00037 void setTicsLabelFormat(TFormat tmp) { atlf = tmp; } 00038 TFormat ticsLabelFormat() { return atlf; } 00039 void setDateTimeFormat(QString f) { datetimeformat = f; } 00040 QString getDateTimeFormat() { return datetimeformat; } 00041 void setTicsLabelPrecision(int tmp) { tlp = tmp; } 00042 int ticsLabelPrecision() { return tlp; } 00043 00044 void setMajorTics(int t) { majortics = t; } 00045 int majorTics() { return majortics; } 00046 void setMinorTics(int t) { minortics = t; } 00047 int minorTics() { return minortics; } 00048 void enableMajorTics(bool b) { majorticse = b; } 00049 void enableMinorTics(bool b) { minorticse = b; } 00050 bool majorTicsEnabled() { return majorticse; } 00051 bool minorTicsEnabled() { return minorticse; } 00052 void setTicsPos(int tp) { ticspos = tp; } 00053 int getTicsPos() { return ticspos; } 00054 void setBorderColor(QColor col) { bc = col; } 00055 QColor borderColor() { return bc; } 00056 void setGridColor(QColor col) { gc = col; } 00057 QColor gridColor() { return gc; } 00058 private: 00059 bool e; 00060 TScale scale; 00061 double scaling, shift; 00062 Label *l; 00063 double tlrotation; 00064 QString tlprefix, tlsuffix; 00065 QFont tf; 00066 QColor tc, tlc, bc, gc; 00067 TFormat atlf; 00068 QString datetimeformat; 00069 int tlp; 00070 int ticspos; 00071 int majortics; 00072 int minortics; 00073 bool majorticse; 00074 bool minorticse; 00075 }; 00076 00077 #endif //AXIS_H