CEDRIC  Revision_backup-2009-02
OsgGeometry.h
Go to the documentation of this file.
1 /******************************************************************************
2  *
3  * Copyright (C) 2008 Boris Iven, Max Hermann
4  *
5  * This file is part of the "CEDRIC Event Display" application.
6  *
7  *****************************************************************************/
8 
9 #ifndef OSGGEOMETRY_H
10 #define OSGGEOMETRY_H
11 
12 #include <osg/Vec3>
13 #include <osg/BoundingBox>
14 #include <osg/Node>
15 #include <osg/StateSet>
16 #include <osg/ShapeDrawable>
17 
18 namespace OsgGeometry
19 {
21 osg::BoundingBox getBoundingBox( osg::Node* node );
22 
24 void setLineState( osg::StateSet* state, float linewidth, bool antialiased );
25 
27 void setLineStipple( osg::StateSet* state, int factor=1, unsigned short pattern=0xFF00 );
28 
30 osg::Drawable* createCross3D( osg::Vec3 position, float halfsize, osg::Vec4 color=osg::Vec4(1,1,1,1) );
31 
33 
35 osg::Drawable* createLine( osg::Vec3 v0, osg::Vec3 v1, osg::Vec4 color );
36 
38 osg::Drawable* createLineStrip( osg::Vec3Array* v, osg::Vec4 color );
39 
41 
54 osg::Drawable* createQuad( osg::Vec3 center, osg::Vec3 i, osg::Vec3 j, osg::Vec4 color );
55 
57 osg::Drawable* createBox( osg::Vec3 center, osg::Vec3 halfLengths, osg::Vec4 color );
58 
60 osg::Drawable* createBoxWireframe( osg::Vec3 center, osg::Vec3 hl, osg::Vec4 color );
61 
63 osg::Drawable* createBoxArray( osg::Vec3Array* centers, osg::Vec3Array* hls, osg::Vec4 color );
64 
66 osg::Drawable* createCylinder( osg::Vec3 center, float radius, float height );
67 
68 
70 osg::Node* createCheckerboard( osg::Vec3 center, osg::Vec3 u, osg::Vec3 v,
71  double checkerSize, float black, float white );
72 
73 } // namespace OsgGeometry
74 #endif
osg::Drawable * createLineStrip(Vec3Array *v, Vec4 color)
Definition: OsgGeometry.cpp:140
osg::Node * createCheckerboard(osg::Vec3 center, osg::Vec3 u, osg::Vec3 v, double checkerSize, float black, float white)
Create a simple checkerboard.
Definition: OsgGeometry.cpp:397
osg::Drawable * createCylinder(osg::Vec3 center, float radius, float height)
Create an axis-aligned cylinder.
osg::BoundingBox getBoundingBox(osg::Node *node)
Compute bounding box.
Definition: OsgGeometry.cpp:30
osg::Drawable * createBoxArray(osg::Vec3Array *centers, osg::Vec3Array *hls, osg::Vec4 color)
Put a lot of boxes into one Geometry.
Definition: OsgGeometry.cpp:232
osg::Drawable * createQuad(Vec3 center, Vec3 i, Vec3 j, Vec4 color)
Definition: OsgGeometry.cpp:161
void setLineState(StateSet *state, float linewidth=1.f, bool antialiased=true)
Definition: OsgGeometry.cpp:48
void setLineStipple(StateSet *state, int factor, unsigned short pattern)
Definition: OsgGeometry.cpp:37
osg::Drawable * createLine(Vec3 v0, Vec3 v1, Vec4 color)
Definition: OsgGeometry.cpp:116
osg::Drawable * createBox(osg::Vec3 center, osg::Vec3 hl, osg::Vec4 color)
Create an axis-aligned box.
Definition: OsgGeometry.cpp:259
osg::Drawable * createCross3D(Vec3 position, float halfsize, Vec4 color)
Definition: OsgGeometry.cpp:92
osg::Drawable * createBoxWireframe(Vec3 center, Vec3 hl, Vec4 color)
Definition: OsgGeometry.cpp:315