Open Inventor Reference
SoUnits Class Reference

Node that scales to convert units of length. More...

#include <Inventor/nodes/SoUnits.h>

Inheritance diagram for SoUnits:
SoTransformation SoNode SoFieldContainer SoBase

List of all members.

Public Types

enum  Units {
  METERS, CENTIMETERS, MILLIMETERS, MICROMETERS,
  MICRONS, NANOMETERS, ANGSTROMS, KILOMETERS,
  FEET, INCHES, POINTS, YARDS,
  MILES, NAUTICAL_MILES
}

Public Member Functions

 SoUnits ()
 Creates a unit conversion node with default settings.
virtual void doAction (SoAction *action)
 This method performs the "typical" operation of a node for any action.
virtual void callback (SoCallbackAction *action)
virtual void getBoundingBox (SoGetBoundingBoxAction *action)
virtual void getMatrix (SoGetMatrixAction *action)
virtual void GLRender (SoGLRenderAction *action)
 These virtual functions implement all of the actions for nodes, Most of the default implementations do nothing.
virtual void pick (SoPickAction *action)

Static Public Member Functions

static void initClass ()
 Initializes base node class.

Public Attributes

Fields
SoSFEnum units
 Defines the current unit.

Protected Member Functions

virtual ~SoUnits ()

Detailed Description

This node defines a uniform 3D scale about the origin relative to the previously defined units. The default units for all data are meters. Adding a units node with the value INCHES will have the same effect as adding an SoScale node with the scaleFactor of (.0254, .0254, .0254). Any subsequent SoUnits node will take the previous units into account. When building a composite object out of a bunch of pieces, it would be a good practice to add an SoUnits node at the beginning of each of the pieces, under an SoSeparator node, to make sure all the pieces fit together with the same scale.

File Format/Default
Action Behavior
SoGLRenderAction, SoCallbackAction, SoGetBoundingBoxAction, SoRayPickAction
Accumulates the scale that is the ratio of the size from the previous unit to the current unit into the current transformation.
SoGetMatrixAction
Returns the matrix corresponding to the units scaling.
See Also
SoScale, SoTransform

Definition at line 99 of file SoUnits.h.


Member Enumeration Documentation

Enumerator:
METERS 
CENTIMETERS 
MILLIMETERS 
MICROMETERS 
MICRONS 
NANOMETERS 
ANGSTROMS 
KILOMETERS 
FEET 
INCHES 
POINTS 
YARDS 
MILES 
NAUTICAL_MILES 

Definition at line 104 of file SoUnits.h.


Constructor & Destructor Documentation

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

Member Function Documentation

virtual void SoUnits::callback ( SoCallbackAction action) [virtual]

Reimplemented from SoNode.

virtual void SoUnits::doAction ( SoAction action) [virtual]

The default implementation does nothing.

Reimplemented from SoNode.

virtual void SoUnits::getBoundingBox ( SoGetBoundingBoxAction action) [virtual]

Reimplemented from SoNode.

virtual void SoUnits::getMatrix ( SoGetMatrixAction action) [virtual]

Reimplemented from SoNode.

virtual void SoUnits::GLRender ( SoGLRenderAction action) [virtual]

Reimplemented from SoNode.

static void SoUnits::initClass ( ) [static]

Reimplemented from SoTransformation.

virtual void SoUnits::pick ( SoPickAction action) [virtual]

Reimplemented from SoNode.


Member Data Documentation

Definition at line 125 of file SoUnits.h.


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