dtCore::PointAxis Class Reference

creates a visible xyz axis which can be placed anywhere in the scene More...

#include <pointaxis.h>

Inheritance diagram for dtCore::PointAxis:

dtCore::Transformable dtCore::DeltaDrawable dtCore::Base

List of all members.

Public Types

enum  AXIS { X = 0L, Y, Z, NUMAXES }
 < ids used to specify which axis to manipulate More...
enum  AXISCOLOR {
  BLACK = 0L, WHITE, RED, YELLOW,
  GREEN, CYAN, BLUE, MAGENTA,
  CUSTOM_X, CUSTOM_Y, CUSTOM_Z, NUMAXISCOLORS
}
 < ids for preset color values More...
enum  FLAG {
  AXES = BIT(0L), LABELS = BIT(1L), LABEL_X = BIT(2L), LABEL_Y = BIT(3L),
  LABEL_Z = BIT(4L), XYZ_LABELS = BIT(5L), HPR_LABELS = BIT(6L), CUSTOM_LABELS = BIT(7L)
}
 < bit-masks for toggling features on/of More...

Public Member Functions

 PointAxis ()
 default constructor - no parameters
virtual void Enable (int f)
 enable rendering axes, labels and types of labels
virtual void Disable (int f)
 disable rendering axes, labels and types of labels
virtual const char * GetLabel (AXIS a) const
 get the current label for an axis
virtual void SetLabel (AXIS a, const char *l)
 set a custom label for an axis
virtual float GetLength (AXIS a) const
 get the length of an axis
virtual void SetLength (AXIS a, float l)
 set the length of an axis
virtual AXISCOLOR GetColor (AXIS a) const
 get the color-id of an axis
virtual void SetColor (AXIS a, AXISCOLOR c)
 set the color of an axis by a predefined color-id
virtual void GetColor (AXIS a, osg::Vec4 &c) const
 get the color value of an axis (0.0 - 1.0)
virtual void SetColor (AXIS a, const osg::Vec4 c)
 set a custom color value of an axis
virtual AXISCOLOR GetLabelColor (AXIS a) const
 get the color-id of a label
virtual void SetLabelColor (AXIS a, AXISCOLOR c)
 set the color of a label by a predefined color-id
virtual void GetLabelColor (AXIS a, osg::Vec4 &c) const
 get the color value of a label (0.0 - 1.0)
virtual void SetLabelColor (AXIS a, const osg::Vec4 c)
 set a custom color value of an label

Protected Member Functions

virtual ~PointAxis ()
 destructor


Detailed Description

creates a visible xyz axis which can be placed anywhere in the scene

The PointAxis class allows you to quickly add a visible axis-rose to the scene. To use, just create an instance of it, and add the PointAxis to the Scene for it to be rendered.

The default setting is to not display the axis labels. To turn them on call the Enable function with the appropriate FLAG enum (LABEL_X,LABEL_Y,LABEL_Z). They each must be enabled individually (FLAG::LABELS will toggle the label rendering only if the label has been previously enabled).

Custom labels can be set or HPR can be enabled. Colors of the axes and the length of the line can also be set through the interface functions.


Member Enumeration Documentation

enum dtCore::PointAxis::AXIS

< ids used to specify which axis to manipulate

Enumerator:
X 
Y 
Z 
NUMAXES 

enum dtCore::PointAxis::AXISCOLOR

< ids for preset color values

Enumerator:
BLACK 
WHITE 
RED 
YELLOW 
GREEN 
CYAN 
BLUE 
MAGENTA 
CUSTOM_X 
CUSTOM_Y 
CUSTOM_Z 
NUMAXISCOLORS 

enum dtCore::PointAxis::FLAG

< bit-masks for toggling features on/of

Enumerator:
AXES 
LABELS 
LABEL_X 
LABEL_Y 
LABEL_Z 
XYZ_LABELS 
HPR_LABELS 
CUSTOM_LABELS 


Constructor & Destructor Documentation

PointAxis::PointAxis (  ) 

default constructor - no parameters

default constructor

PointAxis::~PointAxis (  )  [protected, virtual]

destructor


Member Function Documentation

void PointAxis::Enable ( int  f  )  [virtual]

enable rendering axes, labels and types of labels

enable rendering axes, labels and label types

Parameters:
f : flags of the items to enable

void PointAxis::Disable ( int  f  )  [virtual]

disable rendering axes, labels and types of labels

disable rendering axes, labels and label types

Parameters:
f : flags of the items to disable

const char * PointAxis::GetLabel ( AXIS  a  )  const [virtual]

get the current label for an axis

get the label of a specific axis

Parameters:
a : id of the axis
Returns:
pointer to the label

void PointAxis::SetLabel ( AXIS  a,
const char *  l 
) [virtual]

set a custom label for an axis

set a custom label for a specific axis

Parameters:
a : id of the axis
l : pointer to the label

float PointAxis::GetLength ( AXIS  a  )  const [virtual]

get the length of an axis

get the length of a specific axis

Parameters:
a : id of the axis
Returns:
the axis length

void PointAxis::SetLength ( AXIS  a,
float  l 
) [virtual]

set the length of an axis

set the length of a specific axis

Parameters:
a : id of the axis
l : the new length

PointAxis::AXISCOLOR PointAxis::GetColor ( AXIS  a  )  const [virtual]

get the color-id of an axis

get the color-id of a specific axis

Parameters:
a : id of the axis
Returns:
the color-id

void PointAxis::SetColor ( AXIS  a,
AXISCOLOR  c 
) [virtual]

set the color of an axis by a predefined color-id

set the color of a specific axis by using a predefined color id

Parameters:
a : id of the axis
c : color-id to use

void PointAxis::GetColor ( AXIS  a,
osg::Vec4 &  c 
) const [virtual]

get the color value of an axis (0.0 - 1.0)

get the color value of a specific axis

Parameters:
a : id of the axis
c : the color value array

void PointAxis::SetColor ( AXIS  a,
const osg::Vec4  c 
) [virtual]

set a custom color value of an axis

set the color of a specific axis by using a custom color value

Parameters:
a : id of the axis
c : color value array

PointAxis::AXISCOLOR PointAxis::GetLabelColor ( AXIS  a  )  const [virtual]

get the color-id of a label

get the color-id of a specific label

Parameters:
a : id of the axis
Returns:
the color-id

void PointAxis::SetLabelColor ( AXIS  a,
AXISCOLOR  c 
) [virtual]

set the color of a label by a predefined color-id

set the color of a specific label by using a predefined color id

Parameters:
a : id of the axis
c : color-id to use

void PointAxis::GetLabelColor ( AXIS  a,
osg::Vec4 &  c 
) const [virtual]

get the color value of a label (0.0 - 1.0)

get the color value of a specific label

Parameters:
a : id of the axis
c : the color value array

void PointAxis::SetLabelColor ( AXIS  a,
const osg::Vec4  c 
) [virtual]

set a custom color value of an label

set the color of a specific label by using a custom color value

Parameters:
a : id of the axis
c : color value array


http://www.delta3d.org
2.0.0 generated 14 Feb 2008