QWT API (English) 7.3.0
Qt Widget Library for Technical Applications - English API Documentation
Loading...
Searching...
No Matches
Classes | Public Member Functions | List of all members
Qwt3D::Axis Class Reference

Autoscalable axis with caption. More...

#include <qwt3d_axis.h>

Inheritance diagram for Qwt3D::Axis:
Qwt3D::Drawable

Classes

class  PrivateData
 

Public Member Functions

 Axis ()
 Default constructor.
 
 Axis (Qwt3D::Triple beg, Qwt3D::Triple end)
 Constructs an axis with specified start and end positions.
 
void draw () override
 Draws the axis including base line, tics, and label.
 
void setPosition (const Qwt3D::Triple &beg, const Qwt3D::Triple &end)
 Sets the axis position.
 
void position (Qwt3D::Triple &beg, Qwt3D::Triple &end) const
 
Qwt3D::Triple begin () const
 
Qwt3D::Triple end () const
 
double length () const
 
void setTicLength (double majorl, double minorl)
 Sets tic length.
 
void ticLength (double &majorl, double &minorl) const
 
void setTicOrientation (double tx, double ty, double tz)
 Sets tic orientation from individual components.
 
void setTicOrientation (const Qwt3D::Triple &val)
 Sets tic orientation from a Triple vector.
 
Qwt3D::Triple ticOrientation () const
 
void setSymmetricTics (bool b)
 
void setLabelFont (QString const &family, int pointSize, int weight=QFont::Normal, bool italic=false)
 Sets the font for the axis label.
 
void setLabelFont (QFont const &font)
 Sets the font for the axis label.
 
QFont const & labelFont () const
 
void setLabelString (QString const &name)
 Sets the axis label string.
 
void setLabelPosition (const Qwt3D::Triple &pos, Qwt3D::ANCHOR)
 Sets label position in conjunction with an anchoring strategy.
 
void setLabelColor (Qwt3D::RGBA col)
 Sets color for the axis label.
 
void setLabel (bool val)
 
void adjustLabel (int val)
 
void setScaling (bool val)
 
bool scaling () const
 
void setScale (Qwt3D::SCALETYPE)
 Sets one of the predefined scaling types.
 
void setScale (Scale *item)
 Sets a user-defined scale object.
 
void setNumbers (bool val)
 
bool numbers () const
 
void setNumberColor (Qwt3D::RGBA col)
 Sets the color for axis numbers.
 
Qwt3D::RGBA numberColor () const
 
void setNumberFont (QString const &family, int pointSize, int weight=QFont::Normal, bool italic=false)
 Sets the font for axis numbers.
 
void setNumberFont (QFont const &)
 Sets the font for axis numbers.
 
QFont const & numberFont () const
 
void setNumberAnchor (Qwt3D::ANCHOR a)
 
void adjustNumbers (int val)
 
void setAutoScale (bool val=true)
 
bool autoScale () const
 
void setMajors (int val)
 Sets number of major intervals.
 
void setMinors (int val)
 Sets number of minor intervals.
 
int majors () const
 
int minors () const
 
Qwt3D::TripleField const & majorPositions () const
 
Qwt3D::TripleField const & minorPositions () const
 
void setLineWidth (double val, double majfac=0.9, double minfac=0.5)
 Sets line width for axis and tics.
 
double lineWidth () const
 
double majLineWidth () const
 
double minLineWidth () const
 
void setLimits (double start, double stop)
 
void limits (double &start, double &stop) const
 
void recalculateTics ()
 
- Public Member Functions inherited from Qwt3D::Drawable
virtual void saveGLState ()
 
virtual void restoreGLState ()
 
void attach (Drawable *)
 
void detach (Drawable *)
 
void detachAll ()
 
virtual void setColor (double r, double g, double b, double a=1)
 
virtual void setColor (Qwt3D::RGBA rgba)
 
Qwt3D::Triple relativePosition (Qwt3D::Triple rel)
 Calculates world coordinates from relative viewport position.
 

Additional Inherited Members

- Protected Member Functions inherited from Qwt3D::Drawable
void Enable (GLenum what, GLboolean val)
 
Qwt3D::Triple ViewPort2World (Qwt3D::Triple win, bool *err=nullptr)
 Converts viewport coordinates to world coordinates (glUnProject)
 
Qwt3D::Triple World2ViewPort (Qwt3D::Triple obj, bool *err=nullptr)
 Converts world coordinates to viewport coordinates (glProject)
 
 Drawable (Drawable &&other) noexcept
 
Drawableoperator= (Drawable &&other) noexcept
 
- Protected Attributes inherited from Qwt3D::Drawable
Qwt3D::RGBA color
 
GLdouble modelMatrix [16]
 
GLdouble projMatrix [16]
 
GLint viewport [4]
 

Detailed Description

Autoscalable axis with caption.

Axes are highly customizable especially in terms of labeling and scaling.

Constructor & Destructor Documentation

◆ Axis() [1/2]

Axis::Axis ( )

Default constructor.

Constructs an uninitialized axis with default parameters.

Destructor

◆ Axis() [2/2]

Axis::Axis ( Qwt3D::Triple  beg,
Qwt3D::Triple  end 
)

Constructs an axis with specified start and end positions.

Parameters
begStart position of the axis
endEnd position of the axis

Member Function Documentation

◆ draw()

void Axis::draw ( )
overridevirtual

Draws the axis including base line, tics, and label.

Reimplemented from Qwt3D::Drawable.

◆ setLabelColor()

void Axis::setLabelColor ( Qwt3D::RGBA  col)

Sets color for the axis label.

Parameters
colRGBA color value for the label

◆ setLabelFont() [1/2]

void Axis::setLabelFont ( QFont const &  font)

Sets the font for the axis label.

Parameters
fontQFont object to use for the axis label

◆ setLabelFont() [2/2]

void Axis::setLabelFont ( QString const &  family,
int  pointSize,
int  weight = QFont::Normal,
bool  italic = false 
)

Sets the font for the axis label.

Parameters
familyFont family name
pointSizeFont point size
weightFont weight
italicWhether font is italic

◆ setLabelPosition()

void Axis::setLabelPosition ( const Qwt3D::Triple pos,
Qwt3D::ANCHOR  an 
)

Sets label position in conjunction with an anchoring strategy.

Parameters
posPosition for the label
anAnchor strategy for the label

◆ setLabelString()

void Axis::setLabelString ( QString const &  name)

Sets the axis label string.

Parameters
nameThe label text string

◆ setLineWidth()

void Axis::setLineWidth ( double  val,
double  majfac = 0.9,
double  minfac = 0.5 
)

Sets line width for axis and tics.

Parameters
valThickness for axis base line
majfacRelative thickness for axis major tics (majfac*val)
minfacRelative thickness for axis minor tics (minfac*val)

◆ setMajors()

void Axis::setMajors ( int  val)

Sets number of major intervals.

Parameters
valNumber of major intervals (always >= 1)

◆ setMinors()

void Axis::setMinors ( int  val)

Sets number of minor intervals.

Parameters
valNumber of minor intervals (always >= 1)
See also
LogScale::setMinors()

◆ setNumberColor()

void Axis::setNumberColor ( Qwt3D::RGBA  col)

Sets the color for axis numbers.

Parameters
colRGBA color value for axis numbers

◆ setNumberFont() [1/2]

void Axis::setNumberFont ( QFont const &  font)

Sets the font for axis numbers.

Parameters
fontQFont object to use for axis numbers

◆ setNumberFont() [2/2]

void Axis::setNumberFont ( QString const &  family,
int  pointSize,
int  weight = QFont::Normal,
bool  italic = false 
)

Sets the font for axis numbers.

Parameters
familyFont family name
pointSizeFont point size
weightFont weight
italicWhether font is italic

◆ setPosition()

void Axis::setPosition ( const Qwt3D::Triple beg,
const Qwt3D::Triple end 
)

Sets the axis position.

Parameters
begStart position of the axis
endEnd position of the axis

◆ setScale() [1/2]

void Axis::setScale ( Qwt3D::SCALETYPE  val)

Sets one of the predefined scaling types.

Parameters
valPredefined scale type (LINEARSCALE or LOG10SCALE)
Warning
Too small intervals in logarithmic scales lead to empty scales (or perhaps a scale only containing an isolated major tic). Better switch to linear scales in such cases.

◆ setScale() [2/2]

void Axis::setScale ( Scale val)

Sets a user-defined scale object.

Parameters
valPointer to a Scale object. Use with a heap based initialized pointer only. The axis adopts ownership.

◆ setTicLength()

void Axis::setTicLength ( double  majorl,
double  minorl 
)

Sets tic length.

Parameters
majorlLength of major tics
minorlLength of minor tics

◆ setTicOrientation() [1/2]

void Axis::setTicOrientation ( const Qwt3D::Triple val)

Sets tic orientation from a Triple vector.

Parameters
valOrientation vector for tics (will be normalized)

◆ setTicOrientation() [2/2]

void Axis::setTicOrientation ( double  tx,
double  ty,
double  tz 
)

Sets tic orientation from individual components.

Parameters
txX component of tic orientation
tyY component of tic orientation
tzZ component of tic orientation

The documentation for this class was generated from the following files: