25 #ifndef __OSGPRIMITIVE_H
26 #define __OSGPRIMITIVE_H
30 #include <osg/ref_ptr>
33 #include <osgDB/ReadFile>
34 #include <osgText/Text>
49 : filename(filename), repeatOnR(repeatOnR), repeatOnS(repeatOnS)
76 virtual void setTexture(
const std::string& filename);
84 virtual std::vector<TextureDescr>
getTextures()
const;
88 virtual void setColor(
const std::string& color);
103 osg::ref_ptr<osg::ShapeDrawable>
shape;
120 virtual void setTexture(
const std::string& filename);
143 OSGBox(
float lengthX,
float lengthY,
float lengthZ);
161 OSGBoxTex(
float lengthX,
float lengthY,
float lengthZ);
240 virtual void setPoints(
const std::list<osg::Vec3>& points);
289 OSGText(
const std::string& text,
int fontsize = 12,
290 osgText::Text::AlignmentType align = osgText::Text::LEFT_BASE_LINE);
301 osgText::Text* osgText;
virtual void virtualInit(const OsgHandle &osgHandle)
Same as init, but the mesh file is not loaded and therefore not displayed.
Definition: osgprimitive.cpp:575
osg::ref_ptr< osg::ShapeDrawable > shape
Definition: osgprimitive.h:103
virtual void init(const OsgHandle &osgHandle, Quality quality=Middle)
Initialisation of the primitive.
Definition: osgprimitive.cpp:288
virtual void setColor(const Color &color)
sets the color for painting this primitive
Definition: osgprimitive.cpp:158
virtual osg::Vec3 getDim()
Definition: osgprimitive.cpp:269
float getRadius()
Definition: osgprimitive.h:221
virtual osg::Transform * getTransform()
returns a osg transformation object;
Definition: osgprimitive.cpp:92
virtual void setColor(const Color &color)
sets the color for painting this primitive
Definition: osgprimitive.cpp:749
virtual osg::Transform * getTransform()
returns a osg transformation object;
Definition: osgprimitive.cpp:754
float radius
Definition: osgprimitive.h:192
virtual osg::Transform * getTransform()
returns a osg transformation object;
Definition: osgprimitive.cpp:201
osg::Geometry * geometry
Definition: osgprimitive.h:244
Graphical capsule (a cylinder with round ends)
Definition: osgprimitive.h:198
Graphical Mesh or arbitrary OSG model.
Definition: osgprimitive.h:253
Graphical box with Textures.
Definition: osgprimitive.h:159
Matrixd Matrix
Definition: osgforwarddecl.h:47
OSGPrimitive()
Definition: osgprimitive.cpp:67
virtual void setDim(osg::Vec3)
Definition: osgprimitive.cpp:272
Interface class for graphic primitives like spheres, boxes, and meshes, which can be drawn by OSG...
Definition: osgprimitive.h:62
float scale
Definition: osgprimitive.h:275
osg::ref_ptr< osg::MatrixTransform > scaletrans
Definition: osgprimitive.h:278
virtual void setTextures(const std::vector< TextureDescr > &textures)
assign a set of texture to the surfaces of the primitive
Definition: osgprimitive.cpp:122
OSGBox(float lengthX, float lengthY, float lengthZ)
Definition: osgprimitive.cpp:236
virtual void init(const OsgHandle &osgHandle, Quality quality=Middle)
Initialisation of the primitive.
Definition: osgprimitive.cpp:579
virtual void setColor(const Color &color)
sets the color for painting this primitive
Definition: osgprimitive.cpp:197
OSGCapsule(float radius, float height)
Definition: osgprimitive.cpp:396
osg::Vec3 dim
Definition: osgprimitive.h:152
virtual void init(const OsgHandle &osgHandle, Quality quality=Middle)
Initialisation of the primitive.
Definition: osgprimitive.cpp:182
float getScale()
Definition: osgprimitive.h:271
std::string filename
Definition: osgprimitive.h:52
virtual void init(const OsgHandle &osgHandle, Quality quality=Middle)
Initialisation of the primitive.
Definition: osgprimitive.cpp:243
virtual void applyTextures()
this actually sets the textures, overwritten
Definition: osgprimitive.cpp:360
osg::ref_ptr< osg::Geode > faces[6]
Definition: osgprimitive.h:177
OSGSphere(float radius)
Definition: osgprimitive.cpp:366
virtual void init(const OsgHandle &osgHandle, Quality quality=Middle)=0
Initialisation of the primitive.
std::string filename
Definition: osgprimitive.h:274
osg::Box * box
Definition: osgprimitive.h:153
Data structure for accessing the OpenSceneGraph.
Definition: osghandle.h:79
Definition: osgprimitive.h:228
virtual void setColor(const Color &color)
sets the color for painting this primitive
Definition: osgprimitive.cpp:503
OSGMesh(const std::string &filename, float scale=1, const osgDB::ReaderWriter::Options *options=0)
Constuctor.
Definition: osgprimitive.cpp:517
virtual Color getColor()
returns the current color
Definition: osgprimitive.cpp:173
TextureDescr(const std::string &filename, double repeatOnR, double repeatOnS)
If repeatOnX is negativ then it is used as a unit length for the texture.
Definition: osgprimitive.h:48
Graphical box.
Definition: osgprimitive.h:141
A dummy graphical object, which has no representation in the graphical world.
Definition: osgprimitive.h:113
float radius
Definition: osgprimitive.h:207
OSGLine(const std::list< osg::Vec3 > &points)
Definition: osgprimitive.cpp:456
osg::Vec3 dim
Definition: osgprimitive.h:175
virtual ~OSGText()
Definition: osgprimitive.cpp:725
Vec3f Vec3
Definition: osgforwarddecl.h:42
Text to be displayed on the hud.
Definition: osgprimitive.h:287
virtual void init(const OsgHandle &osgHandle, Quality quality=Middle)
Initialisation of the primitive.
Definition: osgprimitive.cpp:209
virtual void init(const OsgHandle &osgHandle, Quality quality=Middle)
Initialisation of the primitive.
Definition: osgprimitive.cpp:731
virtual osg::Vec3 getDim() const
Definition: osgprimitive.h:166
virtual const OsgHandle & getOsgHandle()
returns the osgHandle object
Definition: osgprimitive.cpp:96
holds texture file and repeat information.
Definition: osgprimitive.h:42
virtual void setMatrix(const osg::Matrix &m4x4)
Sets the transformation matrix of this object (position and orientation)
Definition: osgprimitive.cpp:186
virtual void setMatrix(const osg::Matrix &m4x4)
Sets the transformation matrix of this object (position and orientation)
Definition: osgprimitive.cpp:83
virtual void internInit(const OsgHandle &osgHandle, bool loadAndDisplayMesh, Quality quality=Middle)
Definition: osgprimitive.cpp:532
Graphical sphere.
Definition: osgprimitive.h:184
TextureDescr()
Definition: osgprimitive.h:44
virtual void init(const OsgHandle &osgHandle, Quality quality=Middle)
Initialisation of the primitive.
Definition: osgprimitive.cpp:460
virtual void applyTextures()
this actually sets the textures
Definition: osgprimitive.h:235
Definition: osgprimitive.h:64
virtual void init(const OsgHandle &osgHandle, Quality quality=Middle)
Initialisation of the primitive.
Definition: osgprimitive.cpp:400
std::list< osg::Vec3 > points
Definition: osgprimitive.h:243
virtual ~OSGPrimitive()
Definition: osgprimitive.cpp:71
float height
Definition: osgprimitive.h:225
virtual void init(const OsgHandle &osgHandle, Quality quality=Middle)
Initialisation of the primitive.
Definition: osgprimitive.cpp:430
OSGCylinder(float radius, float height)
Definition: osgprimitive.cpp:426
OsgHandle osgHandle
Definition: osgprimitive.h:107
osg::ref_ptr< osg::MatrixTransform > transform
Definition: osgprimitive.h:102
virtual void setMatrix(const osg::Matrix &m4x4)
Sets the transformation matrix of this object (position and orientation)
Definition: osgprimitive.cpp:738
float getRadius()
Definition: osgprimitive.h:204
virtual std::vector< TextureDescr > getTextures() const
returns the list of textures
Definition: osgprimitive.cpp:135
Definition: osgprimitive.h:64
virtual osg::Group * getGroup()
returns the group object which is the root of all subcomponents of this primitive ...
Definition: osgprimitive.cpp:744
virtual void setDim(const osg::Vec3 &_dim)
Definition: osgprimitive.h:167
virtual void setTexture(const std::string &filename)
assigns a texture to the primitive
Definition: osgprimitive.cpp:101
const osgDB::ReaderWriter::Options * options
Definition: osgprimitive.h:276
Quality
Definition: osgprimitive.h:64
virtual void applyTextures()
this actually sets the textures
Definition: osgprimitive.cpp:139
OSGText(const std::string &text, int fontsize=12, osgText::Text::AlignmentType align=osgText::Text::LEFT_BASE_LINE)
Definition: osgprimitive.cpp:715
OSGBoxTex(float lengthX, float lengthY, float lengthZ)
Definition: osgprimitive.cpp:281
osg::ref_ptr< osg::Geode > geode
Definition: osgprimitive.h:101
float getHeight()
Definition: osgprimitive.h:205
OSGPlane()
Definition: osgprimitive.cpp:206
double repeatOnR
Definition: osgprimitive.h:53
virtual void updatePoints()
Definition: osgprimitive.cpp:483
Graphical cylinder.
Definition: osgprimitive.h:215
~OSGMesh()
Definition: osgprimitive.cpp:523
osg::ref_ptr< osg::Node > mesh
Definition: osgprimitive.h:277
OSGDummy()
Definition: osgprimitive.cpp:180
Definition: osgprimitive.h:64
virtual float getRadius()
Definition: osgprimitive.cpp:526
virtual osg::Group * getGroup()
returns the group object which is the root of all subcomponents of this primitive ...
Definition: osgprimitive.cpp:189
Graphical plane (represented as a large thin box, because OSG does not draw planes) ...
Definition: osgprimitive.h:130
virtual osg::Group * getGroup()
returns the group object which is the root of all subcomponents of this primitive ...
Definition: osgprimitive.cpp:88
float getRadius()
Definition: osgprimitive.h:190
float height
Definition: osgprimitive.h:208
virtual void setPoints(const std::list< osg::Vec3 > &points)
Definition: osgprimitive.cpp:478
virtual void init(const OsgHandle &osgHandle, Quality quality=Middle)
Initialisation of the primitive.
Definition: osgprimitive.cpp:370
double repeatOnS
Definition: osgprimitive.h:54
float getHeight()
Definition: osgprimitive.h:222
virtual void setColor(const Color &color)
sets the color for painting this primitive
Definition: osgprimitive.cpp:353
float radius
Definition: osgprimitive.h:224
std::vector< TextureDescr > textures
Definition: osgprimitive.h:105
virtual void setTexture(const std::string &filename)
assigns a texture to the primitive
Definition: osgprimitive.cpp:193