MeVisLab Toolbox Reference
Axis Class Reference

A class to administrate an axis coordinate system drawable in OpenGL. More...

#include <Axis.h>

Public Types

enum  AxisTextAlignMode { AXIS_TEXT_ALIGN_LEFT = 0 , AXIS_TEXT_ALIGN_CENTER , AXIS_TEXT_ALIGN_RIGHT }
 Type selector for text alignment modes. More...
 

Public Member Functions

 Axis ()
 Default constructor.
 
void setAxisColors (SbVec4f c[3])
 Set colors for the three axis.
 
void axisNumberingOn (bool b)
 Enable/Disable axis tick numbering for all three axis.
 
void setAxisStepSizes (float x, float y, float z)
 Set distances between axis ticks.
 
void setAxisVisibility (bool b1, bool b2, bool b3)
 Enable/Disable visibility of the three axis.
 
void setAxisOrigin (float x, float y, float z)
 Set world position where axis coordinate system is drawn.
 
void setAxisNumBias (float x, float y, float z)
 Set a offset added to the drawn axis numbers.
 
void setAxisNumScale (float x, float y, float z)
 Set a scale multiplied to the drawn axis numbers.
 
void setAxisMarkerLength (float x, float y, float z)
 Set length of axis ticks.
 
void setAxisWingLength (float sx, float sy, float sz)
 Set length of arrow wings.
 
void setAxisOverScale (float sx, float sy, float sz)
 Set scale factors for base axis, so that they're longer then axis ends.
 
void setAxisTicks (float xmi, float xma, float ymi, float yma, float zmi, float zma)
 Set start and end position of axis ticks.
 
void setNumberPreAndPostFixes (const char *numPrefix1Text, const char *numPrefix2Text, const char *numPrefix3Text, const char *numPostfix1Text, const char *numPostfix2Text, const char *numPostfix3Text)
 Set prefixes and postfixes to be inserted before/after each drawn number next to axis.
 
void setAxisTexts (const char *at0, const char *at1, const char *at2)
 Set description texts of the three axis.
 
void setAxisTextAlignModes (AxisTextAlignMode align0=AXIS_TEXT_ALIGN_LEFT, AxisTextAlignMode align1=AXIS_TEXT_ALIGN_LEFT, AxisTextAlignMode align2=AXIS_TEXT_ALIGN_LEFT)
 Set texts alignment for the three axis tip texts.
 
void setAxisNumberAlignModes (AxisTextAlignMode align0=AXIS_TEXT_ALIGN_LEFT, AxisTextAlignMode align1=AXIS_TEXT_ALIGN_LEFT, AxisTextAlignMode align2=AXIS_TEXT_ALIGN_LEFT)
 Set texts alignment for the three axis numbering texts.
 
void setAxisEnds (float xmi, float xma, float ymi, float yma, float zmi, float zma)
 Set minimum and maximum extends of all three axis.
 
void setMultiAxis (bool xy, bool xz, bool yx, bool yz, bool zx, bool zy)
 Set which additional cross axis shall be drawn.
 
void setSubTickSteps (float x, float y, float z)
 Set tick distances on additional cross axis, measured in parts of axisStepSizes.
 
void setSubTickScale (float x, float y, float z)
 Set tick lengths on additional cross axis, measured in parts of axisMarkerLength.
 
void subTickingOn (bool b1, bool b2, bool b3)
 Set sub tick drawing for base coordinate system lines.
 
void drawString (const char *s, const SbVec4f &color, AxisTextAlignMode alignMode=AXIS_TEXT_ALIGN_LEFT)
 Draws a string at the current raster position.
 
void drawAxis ()
 Draw axis coordinate system with current parameter set.
 
void setFontSize (MLuint32 size)
 The set size of the font, used in drawString().
 

Protected Member Functions

void drawSubLines (float axis_ori[3], float len, float step, float sld[3], float ad0[3], float ad1[3], const char *axisText, float startTick, float endTick, bool drawAxis[3], int numAxis, int baseAxis, float numBias, float numScale, MLint32 recursions)
 Draws one axis with its additional cross axis. It also calls draw_linearAxis.
 
void drawLinearAxis (float axisOri[3], float aml[3], float ass[3], float awl[3], const char *at[3], bool drawAxis[3], int baseAxis, MLint32 recursions=0)
 Draw the coordinate system and calls drawSubLines, so it is also called recursively.
 

Detailed Description

A class to administrate an axis coordinate system drawable in OpenGL.

Definition at line 22 of file Axis.h.

Member Enumeration Documentation

◆ AxisTextAlignMode

Type selector for text alignment modes.

Enumerator
AXIS_TEXT_ALIGN_LEFT 
AXIS_TEXT_ALIGN_CENTER 
AXIS_TEXT_ALIGN_RIGHT 

Definition at line 26 of file Axis.h.

Constructor & Destructor Documentation

◆ Axis()

Axis::Axis ( )

Default constructor.

Member Function Documentation

◆ axisNumberingOn()

void Axis::axisNumberingOn ( bool b)

Enable/Disable axis tick numbering for all three axis.

◆ drawAxis()

void Axis::drawAxis ( )

Draw axis coordinate system with current parameter set.

◆ drawLinearAxis()

void Axis::drawLinearAxis ( float axisOri[3],
float aml[3],
float ass[3],
float awl[3],
const char * at[3],
bool drawAxis[3],
int baseAxis,
MLint32 recursions = 0 )
protected

Draw the coordinate system and calls drawSubLines, so it is also called recursively.

◆ drawString()

void Axis::drawString ( const char * s,
const SbVec4f & color,
AxisTextAlignMode alignMode = AXIS_TEXT_ALIGN_LEFT )

Draws a string at the current raster position.

◆ drawSubLines()

void Axis::drawSubLines ( float axis_ori[3],
float len,
float step,
float sld[3],
float ad0[3],
float ad1[3],
const char * axisText,
float startTick,
float endTick,
bool drawAxis[3],
int numAxis,
int baseAxis,
float numBias,
float numScale,
MLint32 recursions )
protected

Draws one axis with its additional cross axis. It also calls draw_linearAxis.

◆ setAxisColors()

void Axis::setAxisColors ( SbVec4f c[3])

Set colors for the three axis.

◆ setAxisEnds()

void Axis::setAxisEnds ( float xmi,
float xma,
float ymi,
float yma,
float zmi,
float zma )

Set minimum and maximum extends of all three axis.

◆ setAxisMarkerLength()

void Axis::setAxisMarkerLength ( float x,
float y,
float z )

Set length of axis ticks.

◆ setAxisNumberAlignModes()

Set texts alignment for the three axis numbering texts.

◆ setAxisNumBias()

void Axis::setAxisNumBias ( float x,
float y,
float z )

Set a offset added to the drawn axis numbers.

◆ setAxisNumScale()

void Axis::setAxisNumScale ( float x,
float y,
float z )

Set a scale multiplied to the drawn axis numbers.

◆ setAxisOrigin()

void Axis::setAxisOrigin ( float x,
float y,
float z )

Set world position where axis coordinate system is drawn.

◆ setAxisOverScale()

void Axis::setAxisOverScale ( float sx,
float sy,
float sz )

Set scale factors for base axis, so that they're longer then axis ends.

◆ setAxisStepSizes()

void Axis::setAxisStepSizes ( float x,
float y,
float z )

Set distances between axis ticks.

◆ setAxisTextAlignModes()

Set texts alignment for the three axis tip texts.

◆ setAxisTexts()

void Axis::setAxisTexts ( const char * at0,
const char * at1,
const char * at2 )

Set description texts of the three axis.

◆ setAxisTicks()

void Axis::setAxisTicks ( float xmi,
float xma,
float ymi,
float yma,
float zmi,
float zma )

Set start and end position of axis ticks.

◆ setAxisVisibility()

void Axis::setAxisVisibility ( bool b1,
bool b2,
bool b3 )

Enable/Disable visibility of the three axis.

◆ setAxisWingLength()

void Axis::setAxisWingLength ( float sx,
float sy,
float sz )

Set length of arrow wings.

◆ setFontSize()

void Axis::setFontSize ( MLuint32 size)
inline

The set size of the font, used in drawString().

Definition at line 111 of file Axis.h.

◆ setMultiAxis()

void Axis::setMultiAxis ( bool xy,
bool xz,
bool yx,
bool yz,
bool zx,
bool zy )

Set which additional cross axis shall be drawn.

◆ setNumberPreAndPostFixes()

void Axis::setNumberPreAndPostFixes ( const char * numPrefix1Text,
const char * numPrefix2Text,
const char * numPrefix3Text,
const char * numPostfix1Text,
const char * numPostfix2Text,
const char * numPostfix3Text )

Set prefixes and postfixes to be inserted before/after each drawn number next to axis.

◆ setSubTickScale()

void Axis::setSubTickScale ( float x,
float y,
float z )

Set tick lengths on additional cross axis, measured in parts of axisMarkerLength.

◆ setSubTickSteps()

void Axis::setSubTickSteps ( float x,
float y,
float z )

Set tick distances on additional cross axis, measured in parts of axisStepSizes.

◆ subTickingOn()

void Axis::subTickingOn ( bool b1,
bool b2,
bool b3 )

Set sub tick drawing for base coordinate system lines.


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