OSGPrimitive Class Reference

Interface class for graphic primitives like spheres, boxes, and meshes, which can be drawn by OSG. More...

#include <osgprimitive.h>

Inherited by OSGBox, OSGBoxTex, OSGCapsule, OSGCylinder, OSGDummy, OSGHeightField, OSGMesh, OSGPlane, and OSGSphere.

Inheritance diagram for OSGPrimitive:

Inheritance graph
[legend]
Collaboration diagram for OSGPrimitive:

Collaboration graph
[legend]
List of all members.

Public Types

 Low
 Middle
 High
enum  Quality { Low, Middle, High }

Public Member Functions

 OSGPrimitive ()
virtual ~OSGPrimitive ()
virtual void init (const OsgHandle &osgHandle, Quality quality=Middle)=0
 Initialisation of the primitive.
virtual void setMatrix (const osg::Matrix &m4x4)
 Sets the transformation matrix of this object (position and orientation).
virtual osg::Group * getGroup ()
 returns the group object which is the root of all subcomponents of this primitive
virtual void setTexture (const std::string &filename)
 assigns a texture to the primitive
virtual void setTexture (const std::string &filename, double repeatOnR, double repeatOnS)
 assigns a texture to the primitive, you can choose how often to repeat
virtual void setTexture (int surface, const std::string &filename, double repeatOnR, double repeatOnS)
 assigns a texture to the x-th surface of the primitive, you can choose how often to repeat
virtual std::vector< TextureDescrgetTextures ()
 returns the list of textures
virtual void setColor (const Color &color)
 sets the color for painting this primitive
virtual osg::Transform * getTransform ()
 returns a osg transformation object;

Protected Member Functions

virtual void applyTextures ()
 this actually sets the textures

Protected Attributes

osg::ref_ptr< osg::Geode > geode
osg::ref_ptr< osg::MatrixTransform > transform
osg::ref_ptr< osg::ShapeDrawable > shape
std::vector< TextureDescrtextures
const OsgHandleosgHandle

Detailed Description

Interface class for graphic primitives like spheres, boxes, and meshes, which can be drawn by OSG.

The idea is to hide all the details of the OSG implementation.


Member Enumeration Documentation

enum Quality

Enumerator:
Low 
Middle 
High 


Constructor & Destructor Documentation

OSGPrimitive (  ) 

~OSGPrimitive (  )  [virtual]


Member Function Documentation

void applyTextures (  )  [protected, virtual]

this actually sets the textures

Reimplemented in OSGBoxTex.

Group * getGroup (  )  [virtual]

returns the group object which is the root of all subcomponents of this primitive

Reimplemented in OSGDummy.

std::vector< TextureDescr > getTextures (  )  [virtual]

returns the list of textures

Transform * getTransform (  )  [virtual]

returns a osg transformation object;

Reimplemented in OSGDummy.

virtual void init ( const OsgHandle osgHandle,
Quality  quality = Middle 
) [pure virtual]

Initialisation of the primitive.

Must in order to place the object into the scene. This function should be overloaded

void setColor ( const Color color  )  [virtual]

sets the color for painting this primitive

Reimplemented in OSGDummy, and OSGBoxTex.

void setMatrix ( const osg::Matrix m4x4  )  [virtual]

Sets the transformation matrix of this object (position and orientation).

Reimplemented in OSGHeightField, and OSGDummy.

void setTexture ( int  surface,
const std::string &  filename,
double  repeatOnR,
double  repeatOnS 
) [virtual]

assigns a texture to the x-th surface of the primitive, you can choose how often to repeat

void setTexture ( const std::string &  filename,
double  repeatOnR,
double  repeatOnS 
) [virtual]

assigns a texture to the primitive, you can choose how often to repeat

void setTexture ( const std::string &  filename  )  [virtual]

assigns a texture to the primitive

Reimplemented in OSGDummy.


Member Data Documentation

osg::ref_ptr<osg::Geode> geode [protected]

const OsgHandle* osgHandle [protected]

osg::ref_ptr<osg::ShapeDrawable> shape [protected]

std::vector<TextureDescr > textures [protected]

osg::ref_ptr<osg::MatrixTransform> transform [protected]


The documentation for this class was generated from the following files:
Generated on Fri Oct 30 16:29:03 2009 for Robot Simulator of the Robotics Group for Self-Organization of Control by  doxygen 1.4.7