Overview     Modules     Class Hierarchy     Classes     Members  
tlp::GlQuantitativeAxis Class Reference

A class to render an axis graduated with numerical values for a given range. More...

#include <GlQuantitativeAxis.h>

Inheritance diagram for tlp::GlQuantitativeAxis:
Collaboration diagram for tlp::GlQuantitativeAxis:

Public Member Functions

 GlQuantitativeAxis (const std::string &axisName, const Coord &axisBaseCoord, const float axisLength, const AxisOrientation &axisOrientation, const Color &axisColor, const float axisWidth=10, const bool addArrow=true, const bool ascendingOrder=true)
void setAxisParameters (const double min, const double max, const unsigned int nbGraduations, const LabelPosition &axisGradsLabelsPosition=LEFT_OR_BELOW, const bool drawFirstLabel=true)
void setAxisParameters (const int min, const int max, const unsigned int incrementStep, const LabelPosition &axisGradsLabelsPosition=LEFT_OR_BELOW, const bool drawFirstLabel=true)
void setNbGraduations (const unsigned int nbGraduations)
void setLogScale (const bool logScale, const unsigned int logBase=10)
void setAscendingOrder (const bool ascendingOrder)
void updateAxis ()
Coord getAxisPointCoordForValue (double value) const
double getValueForAxisPoint (const Coord &axisPointCoord)
bool hasAscendingOrder () const
double getAxisMinValue () const
double getAxisMaxValue () const
- Public Member Functions inherited from tlp::GlAxis
 GlAxis (const std::string &axisName, const Coord &axisBaseCoord, const float axisLength, const AxisOrientation &axisOrientation, const Color &axisColor, const float axisWidth=10)
virtual ~GlAxis ()
Coord getAxisBaseCoord () const
float getAxisLength () const
std::string getAxisName () const
AxisOrientation getAxisOrientation () const
float getAxisGradsWidth () const
float getSpaceBetweenAxisGrads () const
float getLabelHeight () const
float getMaxLabelWidth () const
Color getAxisColor () const
void setAxisName (const std::string &axisName)
void setAxisLength (const float axisLength)
void setAxisColor (const Color &axisColor)
void setAxisGradsWidth (const float axisGradsWidth)
void setMaxCaptionWidth (const float maxCaptionWidth)
void setAxisGraduations (const std::vector< std::string > &axisGradsLabels, const LabelPosition &axisGradsLabelsPosition=LEFT_OR_BELOW)
void setAxisGraduationsMaxLabelWidth (const float maxWidth)
void addCaption (const LabelPosition &captionPos, const float captionHeight, const bool captionFrame=false, const float maxCaptionWidth=0, const float captionOffset=0, const std::string caption="")
void translate (const Coord &c)
- Public Member Functions inherited from tlp::GlComposite
 GlComposite (bool deleteComponentsInDestructor=true)
 ~GlComposite ()
virtual void addLayerParent (GlLayer *layer)
virtual void removeLayerParent (GlLayer *layer)
void reset (bool deleteElems)
void addGlEntity (GlSimpleEntity *entity, const std::string &key)
void deleteGlEntity (const std::string &key, bool informTheEntity=true)
void deleteGlEntity (GlSimpleEntity *entity, bool informTheEntity=true)
std::string findKey (GlSimpleEntity *entity)
GlSimpleEntityfindGlEntity (const std::string &key)
std::map< std::string,
GlSimpleEntity * > * 
getDisplays ()
void notifyModified (GlSimpleEntity *entity)
virtual void draw (float, Camera *)
virtual void setStencil (int stencil)
virtual void acceptVisitor (GlSceneVisitor *visitor)
void setDeleteComponentsInDestructor (bool deleteComponentsInDestructor)
virtual void getXML (xmlNodePtr rootNode)
virtual void setWithXML (xmlNodePtr rootNode)
- Public Member Functions inherited from tlp::GlSimpleEntity
 GlSimpleEntity ()
virtual ~GlSimpleEntity ()
virtual void setVisible (bool visible)
bool isVisible ()
int getStencil ()
void setCheckByBoundingBoxVisitor (bool check)
bool isCheckByBoundingBoxVisitor ()
virtual BoundingBox getBoundingBox ()
void addParent (GlComposite *composite)
void removeParent (GlComposite *composite)
- Public Member Functions inherited from tlp::GlEntity
virtual ~GlEntity ()

Additional Inherited Members

- Public Types inherited from tlp::GlAxis
enum  AxisOrientation { HORIZONTAL_AXIS, VERTICAL_AXIS }
enum  LabelPosition { LEFT_OR_BELOW, RIGHT_OR_ABOVE }
- Protected Member Functions inherited from tlp::GlAxis
void computeBoundingBox ()
virtual Coord computeCaptionCenter ()
virtual void computeCaptionSize (float height)
void addAxisCaption (const Coord &captionLabelCenter, const bool captionFrame)
- Protected Attributes inherited from tlp::GlAxis
std::string axisName
Coord axisBaseCoord
float axisLength
AxisOrientation axisOrientation
Color axisColor
float axisGradsWidth
float spaceBetweenAxisGrads
float captionWidth
float captionHeight
bool captionFrame
std::string captionText
float labelHeight
float captionOffset
GlCompositeaxisLinesComposite
GlCompositecaptionComposite
GlCompositegradsComposite
bool captionSet
LabelPosition captionPosition
float maxCaptionWidth
float maxGraduationLabelWidth
float axisWidth

Detailed Description

A class to render an axis graduated with numerical values for a given range.

This class allows to draw a quantitative axis (i.e. an axis axis graduated with numerical values for a given range)

Constructor & Destructor Documentation

tlp::GlQuantitativeAxis::GlQuantitativeAxis ( const std::string &  axisName,
const Coord &  axisBaseCoord,
const float  axisLength,
const AxisOrientation axisOrientation,
const Color &  axisColor,
const float  axisWidth = 10,
const bool  addArrow = true,
const bool  ascendingOrder = true 
)

GlQuantitativeAxis constructor. Create an quantitative axis without graduations (need to call setAxisParameters to build them)

Parameters
axisNamethe 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 If true, an arrow will be added to one end of the axis according to the axis order (ascending or descending) If true, the min value will be at the bottom end and the max will be at the top end if the axis is vertical (min at the left and max at the right if it is horizontal). If false this positions are switched

Member Function Documentation

double tlp::GlQuantitativeAxis::getAxisMaxValue ( ) const
inline
double tlp::GlQuantitativeAxis::getAxisMinValue ( ) const
inline
Coord tlp::GlQuantitativeAxis::getAxisPointCoordForValue ( double  value) const

Method to get the axis point coordinates for a given value

Parameters
valuethe value we want to retrieve axis point coordinates
double tlp::GlQuantitativeAxis::getValueForAxisPoint ( const Coord &  axisPointCoord)

Method to get the value associated to an axis point

Parameters
axisPointCoordthe axis point coordinates we want to retrieve associated value
bool tlp::GlQuantitativeAxis::hasAscendingOrder ( ) const
inline

Method to get the order of the values on the axis (ascending or descending)

void tlp::GlQuantitativeAxis::setAscendingOrder ( const bool  ascendingOrder)
inline

Method to set the order of the values on the axis (ascending or descending). A call to updateAxis has to be done after calling this method to build or update the axis graduations

void tlp::GlQuantitativeAxis::setAxisParameters ( const double  min,
const double  max,
const unsigned int  nbGraduations,
const LabelPosition axisGradsLabelsPosition = LEFT_OR_BELOW,
const bool  drawFirstLabel = true 
)

Method to set the quantitative axis parameters. A call to updateAxis has to be done after calling this method to build or update the axis graduations

Parameters
minthe min value of the range the axis represents
maxthe max value of the range the axis represents
nbGraduationsthe number of graduations to build
axisGradsLabelsPositionthe relative position of the axis graduations label. Two possible values : LEFT_OR_BELOW (if the axis is vertical, labels will be on the left of the axis, otherwise below) or RIGHT_OR_ABOVE
drawFirstLabelIf false, the first graduation label will not be drawn (usefull when some axis have the same base coord to avoid labels overlapping)
void tlp::GlQuantitativeAxis::setAxisParameters ( const int  min,
const int  max,
const unsigned int  incrementStep,
const LabelPosition axisGradsLabelsPosition = LEFT_OR_BELOW,
const bool  drawFirstLabel = true 
)
void tlp::GlQuantitativeAxis::setLogScale ( const bool  logScale,
const unsigned int  logBase = 10 
)

Method to set a logarithmic scale on the axis. A call to updateAxis has to be done after calling this method to build or update the axis graduations

Parameters
logScaleIf true, activate the logarithmic scale on the axis
logBaseIf filled, set the logarithm base
void tlp::GlQuantitativeAxis::setNbGraduations ( const unsigned int  nbGraduations)
inline
void tlp::GlQuantitativeAxis::updateAxis ( )
virtual

Method to update the axis drawing. It has to be called when one (or more) of the setters method above has been used. This method redraw the whole axis and the graduations.

Reimplemented from tlp::GlAxis.



Tulip Software by LaBRI Visualization Team    2001 - 2012