4
#include "qwt3d_axis.h"
5
#include "qwt3d_colorlegend.h"
10
//! A coordinate system with different styles (BOX, FRAME)
11
class QWT3D_EXPORT CoordinateSystem : public Drawable
15
explicit CoordinateSystem(Qwt3D::Triple blb = Qwt3D::Triple(0,0,0), Qwt3D::Triple ftr = Qwt3D::Triple(0,0,0), Qwt3D::COORDSTYLE = Qwt3D::BOX);
18
void init(Qwt3D::Triple beg = Qwt3D::Triple(0,0,0), Qwt3D::Triple end = Qwt3D::Triple(0,0,0));
19
//! Set style for the coordinate system (NOCOORD, FRAME or BOX)
20
void setStyle(Qwt3D::COORDSTYLE s, Qwt3D::AXIS frame_1 = Qwt3D::X1,
21
Qwt3D::AXIS frame_2 = Qwt3D::Y1,
22
Qwt3D::AXIS frame_3 = Qwt3D::Z1);
23
Qwt3D::COORDSTYLE style() const { return style_;} //!< Return style oft the coordinate system
24
void setPosition(Qwt3D::Triple first, Qwt3D::Triple second); //!< first == front_left_bottom, second == back_right_top
26
void setAxesColor(Qwt3D::RGBA val); //!< Set common color for all axes
27
//! Set common font for all axis numberings
28
void setNumberFont(QString const& family, int pointSize, int weight = QFont::Normal, bool italic = false);
29
//! Set common font for all axis numberings
30
void setNumberFont(QFont const& font);
31
//! Set common color for all axis numberings
32
void setNumberColor(Qwt3D::RGBA val);
33
void setStandardScale(); //!< Sets an linear axis with real number items
35
void adjustNumbers(int val); //!< Fine tunes distance between axis numbering and axis body
36
void adjustLabels(int val); //!< Fine tunes distance between axis label and axis body
38
//! Sets color for the grid lines
39
void setGridLinesColor(Qwt3D::RGBA val) {gridlinecolor_ = val;}
41
//! Set common font for all axis labels
42
void setLabelFont(QString const& family, int pointSize, int weight = QFont::Normal, bool italic = false);
43
//! Set common font for all axis labels
44
void setLabelFont(QFont const& font);
45
//! Set common color for all axis labels
46
void setLabelColor(Qwt3D::RGBA val);
48
//! Set line width for tic marks and axes
49
void setLineWidth(double val, double majfac = 0.9, double minfac = 0.5);
50
//! Set length for tic marks
51
void setTicLength(double major, double minor);
53
//! Switch autoscaling of axes
54
void setAutoScale(bool val = true);
56
Qwt3D::Triple first() const { return first_;}
57
Qwt3D::Triple second() const { return second_;}
59
void setAutoDecoration(bool val = true) {autodecoration_ = val;}
60
bool autoDecoration() const { return autodecoration_;}
62
void setLineSmooth(bool val = true) {smooth_ = val;} //!< draw smooth axes
63
bool lineSmooth() const {return smooth_;} //!< smooth axes ?
67
//! Defines whether a grid between the major and/or minor tics should be drawn
68
void setGridLines(bool majors, bool minors, int sides = Qwt3D::NOSIDEGRID);
69
int grids() const {return sides_;} //!< Returns grids switched on
71
//! The vector of all12 axes - use them to set axis properties individually.
72
std::vector<Axis> axes;
78
Qwt3D::Triple first_, second_;
79
Qwt3D::COORDSTYLE style_;
81
Qwt3D::RGBA gridlinecolor_;
86
void autoDecorateExposedAxis(Axis& ax, bool left);
87
void drawMajorGridLines(); //!< Draws a grid between the major tics on the site
88
void drawMinorGridLines(); //!< Draws a grid between the minor tics on the site
89
void drawMajorGridLines(Qwt3D::Axis&, Qwt3D::Axis&); //! Helper
90
void drawMinorGridLines(Qwt3D::Axis&, Qwt3D::Axis&); //! Helper
91
void recalculateAxesTics();
94
bool majorgridlines_, minorgridlines_;