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
OSGMesh Class Reference

Graphical Mesh or arbitrary OSG model. More...

#include <osgprimitive.h>

Inheritance diagram for OSGMesh:
Collaboration diagram for OSGMesh:

Public Member Functions

 OSGMesh (const std::string &filename, float scale=1, const osgDB::ReaderWriter::Options *options=0)
 Constuctor. More...
 
 ~OSGMesh ()
 
virtual void init (const OsgHandle &osgHandle, Quality quality=Middle)
 Initialisation of the primitive. More...
 
virtual void virtualInit (const OsgHandle &osgHandle)
 Same as init, but the mesh file is not loaded and therefore not displayed. More...
 
virtual float getRadius ()
 
float getScale ()
 
- Public Member Functions inherited from OSGPrimitive
 OSGPrimitive ()
 
virtual ~OSGPrimitive ()
 
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 internInit (const OsgHandle &osgHandle, bool loadAndDisplayMesh, Quality quality=Middle)
 
- Protected Member Functions inherited from OSGPrimitive
virtual void applyTextures ()
 this actually sets the textures More...
 

Protected Attributes

std::string filename
 
float scale
 
const
osgDB::ReaderWriter::Options * 
options
 
osg::ref_ptr< osg::Node > mesh
 
osg::ref_ptr
< osg::MatrixTransform > 
scaletrans
 
- Protected Attributes inherited from OSGPrimitive
osg::ref_ptr< osg::Geode > geode
 
osg::ref_ptr
< osg::MatrixTransform > 
transform
 
osg::ref_ptr< osg::ShapeDrawable > shape
 
std::vector< TextureDescrtextures
 
OsgHandle osgHandle
 

Additional Inherited Members

- Public Types inherited from OSGPrimitive
enum  Quality { Low, Middle, High }
 

Detailed Description

Graphical Mesh or arbitrary OSG model.

Constructor & Destructor Documentation

OSGMesh ( const std::string &  filename,
float  scale = 1,
const osgDB::ReaderWriter::Options *  options = 0 
)

Constuctor.

Parameters
filenamefilename of the model file (search path is osg data path)
scalescale factor used for scaling the model
optionsfor model reader
~OSGMesh ( )

Member Function Documentation

float getRadius ( )
virtual
float getScale ( )
inline
void init ( const OsgHandle osgHandle,
Quality  quality = Middle 
)
virtual

Initialisation of the primitive.

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

Implements OSGPrimitive.

void internInit ( const OsgHandle osgHandle,
bool  loadAndDisplayMesh,
Quality  quality = Middle 
)
protectedvirtual
void virtualInit ( const OsgHandle osgHandle)
virtual

Same as init, but the mesh file is not loaded and therefore not displayed.

This method ensures that the transform is correctly initialised.

Parameters
osgHandle

Member Data Documentation

std::string filename
protected
osg::ref_ptr<osg::Node> mesh
protected
const osgDB::ReaderWriter::Options* options
protected
float scale
protected
osg::ref_ptr<osg::MatrixTransform> scaletrans
protected

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