SPIN Framework
Public Member Functions

spin::Contour Class Reference

Represents a sequence of connected points in 3D space. More...

#include <Contour.h>

Inheritance diagram for spin::Contour:
spin::ReferencedNode

List of all members.

Public Member Functions

 Contour (SceneManager *sceneManager, const char *initID)
virtual void updateNodePath ()
virtual void callbackUpdate (osg::NodeVisitor *nv)
void updateTransforms ()
osg::Quat getOrientation (float index) const
osg::Vec3 getTranslation (float index) const
void setIndex (float newValue)
void prev ()
void next ()
void reset ()
void add (float x, float y, float z)
void setMaxVertices (int newValue)
void setTrackingMode (int newValue)
void setVisible (int newValue)
void setThickness (float newValue)
void setLineType (int newValue)
void setColor (float newR, float newG, float newB, float newA)
float getCurrentIndex () const
int getMaxVertices () const
int getTrackingMode () const
int getVisible () const
float getThickness () const
float getLineType () const
osg::Vec4 getColor () const
void setLighting (int i)
int getLighting () const
void draw ()
virtual std::vector< lo_message > getState () const

Detailed Description

Represents a sequence of connected points in 3D space.

The contour holds a number of vertices up the limit specified by _maxVertices New values are added to the front of the vectorArray, and once it is filled, we pop the last element off the end.

An index controls the point on which a child node is attached to the contour.


Member Function Documentation

void spin::Contour::add ( float  x,
float  y,
float  z 
)

Add a vertex to the front of the contour the (vectorArray). If the list of vectors reaches maximum size, the final vector is removed from the end of the contour. Please note that the index vertex (where children nodes are attached) remains in the same position on the contour even as the vertices change because this value is set as a proportion of the vertex length (a 0,1 range value).

void spin::Contour::callbackUpdate ( osg::NodeVisitor *  nv) [virtual]

For nodes that require regular programmatic control, there is a callback that is evaluated with every refresh. This function can thus be used for animations, or any other periodic updates.

Note that changes to the scene graph structure (eg, moving/deleting nodes should NOT be done within this callback because traversals stacks will become corrupted. The technique is rather to enable a flag and then do the actual change in the SceneManager::updateGraph() method.

Reimplemented from spin::ReferencedNode.

void spin::Contour::draw ( )

Draws the contour according to the parameters set, i.e. contour type, color, number of vertices.

osg::Vec4 spin::Contour::getColor ( ) const [inline]

Returns a Vector4 representing the RGBA value of the contour.

float spin::Contour::getCurrentIndex ( ) const [inline]

Returns a float indicating the current index vertex for the contour. A float will interpolate a point between vertices to act as the index.

int spin::Contour::getLighting ( ) const [inline]

Returns a boolean indicating whether the contour is affected by lighting.

float spin::Contour::getLineType ( ) const [inline]

Returns an integer representing the contour type according to the contourType enum.

int spin::Contour::getMaxVertices ( ) const [inline]

Returns the maximum number of vertices currently permitted for the contour.

osg::Quat spin::Contour::getOrientation ( float  index) const

This function gets the orientation of a given index into the soundLine. Note that the orientation along a line has only 2 degrees of freedom (roll is not defined). So we specify the Y_AXIS.

std::vector< lo_message > spin::Contour::getState ( ) const [virtual]

For each subclass of ReferencedNode, we override the getState() method to fill the vector with the correct set of methods for this particular node

Reimplemented from spin::ReferencedNode.

float spin::Contour::getThickness ( ) const [inline]

Returns a float representing the thickness value of the contour.

int spin::Contour::getTrackingMode ( ) const [inline]

Returns an integer representing the tracking mode of the contour (whether children moving along the contour rotate or not).

osg::Vec3 spin::Contour::getTranslation ( float  index) const

We allow the index to be a float, so position can be interpolated between two indices:

int spin::Contour::getVisible ( ) const [inline]

Returns an int representing whether the contour is visible or not.

void spin::Contour::next ( )

Sets the index to the vertex after the current index in the contour.

void spin::Contour::prev ( )

Sets the index to the vertex previous to the current index in the contour

void spin::Contour::reset ( )

Clears all information from the contour, leaving an empty node.

void spin::Contour::setColor ( float  newR,
float  newG,
float  newB,
float  newA 
)

Sets the color of the contour in RGBA value.

void spin::Contour::setIndex ( float  newValue)

Sets the "index" vertex where child nodes will be attached to the contour This is handled using a value in the range 0 to 1.

void spin::Contour::setLighting ( int  i)

Set whether the contour is influenced by lighting

void spin::Contour::setLineType ( int  newValue)

Sets the contour type according to the contourType enumerator. Determines whether the connections between vertices on the contour will be drawn as line segments (THIN), boxes (CUBIC), or circles (CYLINDRICAL).

void spin::Contour::setMaxVertices ( int  newValue)

Sets the maximum number of vertices on the contour.

void spin::Contour::setThickness ( float  newValue)

Sets the thickness of the contour.

void spin::Contour::setTrackingMode ( int  newValue)

Sets the mode of the contour according to the trackingMode enumerator. Determines whether children node will rotate as they move along the contour (FULL6D0F) or move along the contour without rotation (POSITION).

void spin::Contour::setVisible ( int  newValue)

Sets whether the contour is visible or not.

void spin::Contour::updateNodePath ( ) [virtual]

IMPORTANT: subclasses of ReferencedNode are allowed to contain complicated subgraphs and can also change their attachmentNode so that children are attached anywhere in this subgraph. If that is the case, the updateNodePath() function MUST be overridden, and extra nodes must be manually pushed onto the currentNodePath_.

void spin::Contour::updateTransforms ( )

Updates the contour with respect to any new parameters recently set. This function is called automatically by most of the other functions, such as setCurrentIndex, add, etc.


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