25 #ifndef WGEGEODEUTILS_H
26 #define WGEGEODEUTILS_H
33 #include <osg/Geometry>
34 #include <osg/Drawable>
35 #include <osg/MatrixTransform>
36 #include <osg/PositionAttitudeTransform>
38 #include <osgText/Text>
40 #include "../common/math/WLine.h"
41 #include "../common/math/WPlane.h"
42 #include "../common/math/linearAlgebra/WPosition.h"
43 #include "../common/WColor.h"
44 #include "../common/datastructures/WColoredVertices.h"
46 #include "WGEGeometryUtils.h"
47 #include "WGESubdividedPlane.h"
49 #include "WTriangleMesh.h"
82 osg::ref_ptr< osg::Geometry >
createUnitCube(
const WColor& color );
135 const WColor&
defaultColor = WColor( 1.0, 1.0, 1.0, 1.0 ),
136 bool includeNormals =
false,
137 bool lighting =
false,
138 bool useMeshColor =
true );
155 const WColor&
defaultColor = WColor( 1.0, 1.0, 1.0, 1.0 ),
156 bool includeNormals =
false,
157 bool lighting =
false,
158 bool useMeshColor =
true );
174 const WColor&
defaultColor = WColor( 1.0, 1.0, 1.0, 1.0 ),
175 bool includeNormals =
false,
176 bool lighting =
false
190 const WColor&
defaultColor = WColor( 1.0, 1.0, 1.0, 1.0 ),
191 bool useMeshColor =
true );
200 osg::ref_ptr< osg::PositionAttitudeTransform >
addLabel( osg::Vec3 position, std::string text );
208 osg::ref_ptr< osg::PositionAttitudeTransform >
vector2label( osg::Vec3 position );
224 const WColor& color = WColor( 0.0, 0.7, 0.7, 1.0 ),
225 bool border =
false );
255 osg::ref_ptr< osg::Geode >
genFinitePlane( osg::Vec3
const& base, osg::Vec3
const& a, osg::Vec3
const& b,
256 const WColor& color = defaultColor::WHITE );
259 #endif // WGEGEODEUTILS_H
Represents a std::map where for each vertex ID a color is stored.
osg::ref_ptr< osg::Geometry > createUnitCubeAsLines(const WColor &color)
Creates a osg::Geometry containing an unit cube as line-strips, having 3D texture coordinates...
osg::ref_ptr< osg::Geometry > createUnitCube(const WColor &color)
Creates a osg::Geometry containing an unit cube, having 3D texture coordinates.
osg::ref_ptr< osg::PositionAttitudeTransform > addLabel(osg::Vec3 position, std::string text)
helper function to add a label somewhere
osg::ref_ptr< osg::Geode > genFinitePlane(double xSize, double ySize, const WPlane &p, const WColor &color=WColor(0.0, 0.7, 0.7, 1.0), bool border=false)
Generates a geode out of a Plane with a fixed size in direction of the vectors which span that plane...
This only is a 3d double vector.
osg::ref_ptr< osg::Geometry > convertToOsgGeometryLines(WTriangleMesh::SPtr mesh, const WColor &defaultColor=WColor(1.0, 1.0, 1.0, 1.0), bool useMeshColor=true)
Convert triangle mesh to lines representing it.
Represents a plane with a normal vector and a position in space.
osg::ref_ptr< osg::Geometry > convertToOsgGeometryFlatShaded(WTriangleMesh::SPtr mesh, const WColor &defaultColor=WColor(1.0, 1.0, 1.0, 1.0), bool includeNormals=false, bool lighting=false, bool useMeshColor=true)
Extract the vertices and triangles from a WTriangleMesh and save them into an osg::Geometry in order ...
Extend the wge utils namespace with additional methods relating WDataTexture3D.
osg::ref_ptr< osg::Group > creatCoordinateSystem(osg::Vec3 middle, double sizeX, double sizeY, double sizeZ)
Create a coordinate system.
osg::ref_ptr< osg::PositionAttitudeTransform > vector2label(osg::Vec3 position)
helper function to add a label with it's position vector
osg::ref_ptr< osg::Geometry > convertToOsgGeometry(WTriangleMesh::SPtr mesh, const WColor &defaultColor=WColor(1.0, 1.0, 1.0, 1.0), bool includeNormals=false, bool lighting=false, bool useMeshColor=true)
Extract the vertices and triangles from a WTriangleMesh and save them into an osg::Geometry.
osg::ref_ptr< osg::Node > generateSolidBoundingBoxNode(const WBoundingBox &bb, const WColor &color, bool threeDTexCoords=true)
Generates an OSG node for the specified bounding box.
osg::ref_ptr< osg::Geode > generateBoundingBoxGeode(const WBoundingBox &bb, const WColor &color)
Generates an OSG geode for the bounding box.
boost::shared_ptr< WTriangleMesh > SPtr
Shared pointer.
void createCube(osg::ref_ptr< osg::Geometry > geometry, const WPosition &position, const WPosition &size, const WColor &color)
Create an arbitrary cube and insert it into the given geometry.