Robot Simulator of the Robotics Group for Self-Organization of Control  0.8.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
OSGPrimitive Class Referenceabstract

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

#include <osgprimitive.h>

Inheritance diagram for OSGPrimitive:
Collaboration diagram for OSGPrimitive:

Public Types

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. More...
 
virtual void setMatrix (const osg::Matrix &m4x4)
 Sets the transformation matrix of this object (position and orientation) More...
 
virtual osg::Group * getGroup ()
 returns the group object which is the root of all subcomponents of this primitive More...
 
virtual void setTexture (const std::string &filename)
 assigns a texture to the primitive More...
 
virtual void setTexture (const TextureDescr &texture)
 assigns a texture to the primitive, you can choose how often to repeat More...
 
virtual void setTexture (int surface, const TextureDescr &texture)
 assigns a texture to the x-th surface of the primitive, you can choose how often to repeat More...
 
virtual void setTextures (const std::vector< TextureDescr > &textures)
 assign a set of texture to the surfaces of the primitive More...
 
virtual std::vector< TextureDescrgetTextures () const
 returns the list of textures More...
 
virtual void setColor (const Color &color)
 sets the color for painting this primitive More...
 
virtual void setColor (const std::string &color)
 sets the color using the colorschema of osgHandle More...
 
virtual Color getColor ()
 returns the current color More...
 
virtual osg::Transform * getTransform ()
 returns a osg transformation object; More...
 
virtual const OsgHandlegetOsgHandle ()
 returns the osgHandle object More...
 

Protected Member Functions

virtual void applyTextures ()
 this actually sets the textures More...
 

Protected Attributes

osg::ref_ptr< osg::Geode > geode
 
osg::ref_ptr
< osg::MatrixTransform > 
transform
 
osg::ref_ptr< osg::ShapeDrawable > shape
 
std::vector< TextureDescrtextures
 
OsgHandle osgHandle
 

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 ( )
virtual

Member Function Documentation

void applyTextures ( )
protectedvirtual

this actually sets the textures

Reimplemented in OSGLine, and OSGBoxTex.

Color getColor ( )
virtual

returns the current color

Group * getGroup ( )
virtual

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

Reimplemented in OSGText, and OSGDummy.

const OsgHandle & getOsgHandle ( )
virtual

returns the osgHandle object

std::vector< TextureDescr > getTextures ( ) const
virtual

returns the list of textures

Transform * getTransform ( )
virtual

returns a osg transformation object;

Reimplemented in OSGText, and 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

Implemented in OSGText, OSGMesh, OSGLine, OSGCylinder, OSGCapsule, OSGSphere, OSGBoxTex, OSGBox, OSGPlane, OSGDummy, and OSGHeightField.

void setColor ( const Color color)
virtual

sets the color for painting this primitive

Reimplemented in OSGText, OSGLine, OSGBoxTex, and OSGDummy.

void setColor ( const std::string &  color)
virtual

sets the color using the colorschema of osgHandle

void setMatrix ( const osg::Matrix m4x4)
virtual

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

Reimplemented in OSGText, OSGDummy, and OSGHeightField.

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

assigns a texture to the primitive

Reimplemented in OSGDummy.

void setTexture ( const TextureDescr texture)
virtual

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

void setTexture ( int  surface,
const TextureDescr texture 
)
virtual

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

void setTextures ( const std::vector< TextureDescr > &  textures)
virtual

assign a set of texture to the surfaces of the primitive

Member Data Documentation

osg::ref_ptr<osg::Geode> geode
protected
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: