Main Page | Class List | Class Members

osgchips::Stack Class Reference

An homogenous stack of chips defined by a osgchips::ChipBank::Chip instance. More...

List of all members.

Public Member Functions

 Stack ()
 Stack (ChipBank *chipBank)
void setCount (unsigned int count)
unsigned int getCount (void) const
void setPosition (const osg::Vec3 &position)
const osg::Vec3 & getPosition () const
void setChip (ChipBank::Chip *chip)
const ChipBank::ChipgetChip () const
unsigned int getValue () const


Detailed Description

An homogenous stack of chips defined by a osgchips::ChipBank::Chip instance.

A stack of chips of the same type. The size of the stack may be changed dynamically. The stack can be moved by modifying the center of the stack which is located at the bottom of the center of the cylinder. A stack that is not associated to an osgchips::ChipBank::Chip or that has a size of 0 is valid but is not drawn.

The stack does not support picking and is unable to calculate its own bounding box: it relies on its container (osgchips::Stacks). The type of the chip can be changed dynamically. It is the type of the chip that defines the color, transparency, texture and value of the chip.

The stack uses the texture unit 0 (if the osgchips::ChipBank::Chip has a texture) and sets the material attribute ((if the osgchips::ChipBank::Chip has a material). If a stack is made of chips that do not have textures, the caller may add its own texture without interfering. The same applies to the material. The caller must not alter the texture or the material if they are in use or unpredictable results will occur.

The behaviour of an osgchips::Stacks instance that is not a child of an osgchips::Stacks instance is undefined.


Constructor & Destructor Documentation

osgchips::Stack::Stack  ) 
 

Create a one chip high stack for a yet unknown chip type. It will not be drawn unless the setChips method is called at some point. Get mesh information from the osgchips::ChipBank singleton.

osgchips::Stack::Stack ChipBank chipBank  ) 
 

Create a one chip high stack for a yet unknown chip type. It will not be drawn unless the setChips method is called at some point. Get mesh information from the chipBank.

Parameters:
chipBank provider of vertexes, normals, texture coordinates and primitives to draw the stack.


Member Function Documentation

const ChipBank::Chip* osgchips::Stack::getChip  )  const [inline]
 

Retrieve the chip type of the stack, read only.

Returns:
the chip type of the stack.

unsigned int osgchips::Stack::getCount void   )  const [inline]
 

Get the height of the stack, in chips.

Returns:
the height of the stack, in chips.

const osg::Vec3& osgchips::Stack::getPosition  )  const [inline]
 

Retrieve the position of the center of the bottom of the stack. By default the stack is located on 0, 0, 0.

Returns:
the position of the stack.

unsigned int osgchips::Stack::getValue  )  const [inline]
 

Retreive the value of a single chip in the stack.

Returns:
the value of a chip as defined by the chip type.

void osgchips::Stack::setChip ChipBank::Chip chip  ) 
 

Set the type of the stack to chip. It defines the material and textures to use for drawing and provides the name and value of each chip in the stack.

Parameters:
chip a chip type from an osgchips::ChipBank instance

void osgchips::Stack::setCount unsigned int  count  ) 
 

Set the stack to be count chips high. If set to 0, the chip stack will not be drawn.

Parameters:
count the number of chips in the stack

void osgchips::Stack::setPosition const osg::Vec3 &  position  ) 
 

Set the center of the bottom of the stack to position. By default the stack is located on 0, 0, 0.

Parameters:
position translation of the stack from 0, 0, 0.


The documentation for this class was generated from the following file:
Generated on Wed Dec 15 14:45:58 2004 for osgchips by  doxygen 1.3.9.1