Overview     Modules     Class Hierarchy     Classes     Members  

A base class to draw an axis with graduations. More...

#include <GlAxis.h>

Inheritance diagram for tlp::GlAxis:
Collaboration diagram for tlp::GlAxis:

List of all members.

Public Types

Public Member Functions

Protected Member Functions

Protected Attributes


Detailed Description

A base class to draw an axis with graduations.

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


Member Enumeration Documentation

Enumerator:
HORIZONTAL_AXIS 
VERTICAL_AXIS 
Enumerator:
LEFT_OR_BELOW 
RIGHT_OR_ABOVE 

Constructor & Destructor Documentation

tlp::GlAxis::GlAxis ( const std::string &  axisName,
const Coord &  axisBaseCoord,
const float  axisLength,
const AxisOrientation axisOrientation,
const Color &  axisColor,
const float  axisWidth = 10 
)

GlAxis constructor

Parameters:
axisNamethe name of the axis
axisBaseCoordthe base coord of the axis (if the axis is horizontal, it is the the left end, if vertical it is the down end)
axisLengththe length of the axis
axisOrientationthe orientation of the axis, 2 possible values (HORIZONTAL_AXIS or VERTICAL_AXIS)
axisColorthe color of the axis
virtual tlp::GlAxis::~GlAxis ( ) [virtual]

GlAxis destructor


Member Function Documentation

void tlp::GlAxis::addAxisCaption ( const Coord &  captionLabelCenter,
const bool  captionFrame 
) [protected]
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:
captionPosthe 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
captionHeightthe caption text height
captionFrameif true the caption will be framed
maxCaptionWidthfill this parameter if you want to restrain the caption width
captionOffsetfill this parameter if you want to fix the offset between the axis and the caption
captionif this parameter is filled, use this value as caption text, otherwise the caption text will be the axis name
void tlp::GlAxis::computeBoundingBox ( ) [protected]
virtual Coord tlp::GlAxis::computeCaptionCenter ( ) [protected, virtual]
virtual void tlp::GlAxis::computeCaptionSize ( float  height) [protected, virtual]
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:
axisGradsLabelsthe labels of the graduations, they will be equally spaced on the axis
axisGradsLabelsPositionthe 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::setAxisGraduationsMaxLabelWidth ( const float  maxWidth) [inline]
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.


Member Data Documentation

Coord tlp::GlAxis::axisBaseCoord [protected]
Color tlp::GlAxis::axisColor [protected]
float tlp::GlAxis::axisGradsWidth [protected]
float tlp::GlAxis::axisLength [protected]
std::string tlp::GlAxis::axisName [protected]
float tlp::GlAxis::axisWidth [protected]
bool tlp::GlAxis::captionFrame [protected]
float tlp::GlAxis::captionHeight [protected]
float tlp::GlAxis::captionOffset [protected]
bool tlp::GlAxis::captionSet [protected]
std::string tlp::GlAxis::captionText [protected]
float tlp::GlAxis::captionWidth [protected]
float tlp::GlAxis::labelHeight [protected]
float tlp::GlAxis::maxCaptionWidth [protected]


Tulip Software by LaBRI Visualization Team    2001 - 2012