This class allow to render an axis with graduations. This class is there for code factorisation and should not be used directly. Use derivated classes instead : GlQuantitativeAxis for a numerical graduated axis and GlNominativeAxis for a string graduated axis
axisName the name of the axis the base coord of the axis (if the axis is horizontal, it is the the left end, if vertical it is the down end) the length of the axis the orientation of the axis, 2 possible values (HORIZONTAL_AXIS or VERTICAL_AXIS) the color of the axis
void tlp::GlAxis::addCaption (const LabelPosition & captionPos, const float captionHeight, const bool captionFrame = false, const float maxCaptionWidth = 0, const float captionOffset = 0, const std::string caption = '')Method which adds a caption to the axis. No need to call updateAxis after calling this method.
Parameters:
captionPos the relative position of the caption. Two possible values : LEFT_OR_BELOW (if the axis is vertical, caption will be below of the axis, otherwise on the left) or RIGHT_OR_ABOVE
captionHeight the caption text height
captionFrame if true the caption will be framed
maxCaptionWidth fill this parameter if you want to restrain the caption width
captionOffset fill this parameter if you want to fix the offset between the axis and the caption
caption if this parameter is filled, use this value as caption text, otherwise the caption text will be the axis name
Coord tlp::GlAxis::getAxisBaseCoord () const [inline]Method which returns the base coordinates of the axis
Color tlp::GlAxis::getAxisColor () const [inline]Method which returns the color of the axis
float tlp::GlAxis::getAxisGradsWidth () const [inline]Method which returns the width of the axis graduations
float tlp::GlAxis::getAxisLength () const [inline]Method which returns the length of the axis
std::string tlp::GlAxis::getAxisName () const [inline]Method which returns the name of the axis
AxisOrientation tlp::GlAxis::getAxisOrientation () const [inline]Method which returns the orientation of the axis
float tlp::GlAxis::getLabelHeight () const [inline]Method which returns the axis graduations labels height
float tlp::GlAxis::getMaxLabelWidth () const [inline]Method which returns the max axis graduations labels width
float tlp::GlAxis::getSpaceBetweenAxisGrads () const [inline]Method which returns the distance between the axis graduations
void tlp::GlAxis::setAxisColor (const Color & axisColor) [inline]Method to set the axis color
void tlp::GlAxis::setAxisGradsWidth (const float axisGradsWidth) [inline]Methods to set the axis graduations Width
void tlp::GlAxis::setAxisGraduations (const std::vector< std::string > & axisGradsLabels, const LabelPosition & axisGradsLabelsPosition = LEFT_OR_BELOW)Method to set the axis graduations. No need to call updateAxis after calling this method.
Parameters:
axisGradsLabels the labels of the graduations, they will be equally spaced on the axis
axisGradsLabelsPosition the relative position of the axis graduations label. Two possible values : LEFT_OR_BELOW (if the axis is horizontal, labels will be on the left of the axis, otherwise below) or RIGHT_OR_ABOVE
void tlp::GlAxis::setAxisLength (const float axisLength) [inline]Method to set the axis length
void tlp::GlAxis::setAxisName (const std::string & axisName) [inline]Method to set the axis name
void tlp::GlAxis::setMaxCaptionWidth (const float maxCaptionWidth) [inline]Methods to set the max caption width
void tlp::GlAxis::translate (const Coord & mouvement) [virtual]translate the composite with children
Reimplemented from tlp::GlComposite.
Reimplemented in tlp::GlNominativeAxis.
virtual void tlp::GlAxis::updateAxis () [virtual]Method to update the axis drawing. It has to be called when one (ore more) of the setters methods above has been used This method erase the whole axis drawing and redraw the axis line and the caption (if any) The axis graduations have to be reset by calling setAxisGraduations
Reimplemented in tlp::GlNominativeAxis, and tlp::GlQuantitativeAxis.