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, OSGSphere, and OSGText.
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. | |
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 TextureDescr &texture) |
assigns a texture to the primitive, you can choose how often to repeat | |
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 | |
virtual void | setTextures (const std::vector< TextureDescr > &textures) |
assign a set of texture to the surfaces of the primitive | |
virtual std::vector< TextureDescr > | getTextures () const |
returns the list of textures | |
virtual void | setColor (const Color &color) |
sets the color for painting this primitive | |
virtual void | setColor (const std::string &color) |
sets the color using the colorschema of osgHandle | |
virtual Color | getColor () |
returns the current color | |
virtual osg::Transform * | getTransform () |
returns a osg transformation object; | |
virtual const OsgHandle & | getOsgHandle () |
returns the osgHandle 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< TextureDescr > | textures |
OsgHandle | osgHandle |
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.
enum Quality |
OSGPrimitive | ( | ) |
~OSGPrimitive | ( | ) | [virtual] |
void applyTextures | ( | ) | [protected, virtual] |
this actually sets the textures
Reimplemented in OSGBoxTex.
Color getColor | ( | ) | [virtual] |
returns the current color
Group * getGroup | ( | ) | [virtual] |
const OsgHandle & getOsgHandle | ( | ) | [virtual] |
returns the osgHandle object
std::vector< TextureDescr > getTextures | ( | ) | const [virtual] |
returns the list of textures
Transform * getTransform | ( | ) | [virtual] |
Initialisation of the primitive.
Must in order to place the object into the scene. This function should be overloaded
Implemented in OSGHeightField, OSGDummy, OSGPlane, OSGBox, OSGBoxTex, OSGSphere, OSGCapsule, OSGCylinder, OSGMesh, and OSGText.
void setColor | ( | const std::string & | color | ) | [virtual] |
sets the color using the colorschema of osgHandle
void setColor | ( | const Color & | color | ) | [virtual] |
void setMatrix | ( | const osg::Matrix & | m4x4 | ) | [virtual] |
Sets the transformation matrix of this object (position and orientation).
Reimplemented in OSGHeightField, OSGDummy, and OSGText.
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 setTexture | ( | const TextureDescr & | texture | ) | [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.
void setTextures | ( | const std::vector< TextureDescr > & | textures | ) | [virtual] |
assign a set of texture to the surfaces of the primitive
osg::ref_ptr<osg::Geode> geode [protected] |
osg::ref_ptr<osg::ShapeDrawable> shape [protected] |
std::vector<TextureDescr > textures [protected] |
osg::ref_ptr<osg::MatrixTransform> transform [protected] |