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 );
134 const WColor&
defaultColor = WColor( 1.0, 1.0, 1.0, 1.0 ),
135 bool includeNormals =
false,
136 bool lighting =
false,
137 bool useMeshColor =
true );
154 const WColor&
defaultColor = WColor( 1.0, 1.0, 1.0, 1.0 ),
155 bool includeNormals =
false,
156 bool lighting =
false,
157 bool useMeshColor =
true );
173 const WColor&
defaultColor = WColor( 1.0, 1.0, 1.0, 1.0 ),
174 bool includeNormals =
false,
175 bool lighting =
false
189 const WColor&
defaultColor = WColor( 1.0, 1.0, 1.0, 1.0 ),
190 bool useMeshColor =
true );
199 osg::ref_ptr< osg::PositionAttitudeTransform >
addLabel( osg::Vec3 position, std::string text );
207 osg::ref_ptr< osg::PositionAttitudeTransform >
vector2label( osg::Vec3 position );
223 const WColor& color = WColor( 0.0, 0.7, 0.7, 1.0 ),
224 bool border =
false );
254 osg::ref_ptr< osg::Geode >
genFinitePlane( osg::Vec3
const& base, osg::Vec3
const& a, osg::Vec3
const& b,
255 const WColor& color = defaultColor::WHITE );
Represents a std::map where for each vertex ID a color is stored.
Represents a plane with a normal vector and a position in space.
This only is a 3d double vector.
std::shared_ptr< WTriangleMesh > SPtr
Shared pointer.
Extend the wge utils namespace with additional methods relating WDataTexture3D.
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.
osg::ref_ptr< osg::Geode > generateBoundingBoxGeode(const WBoundingBox &bb, const WColor &color)
Generates an OSG geode for the bounding box.
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::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::Group > creatCoordinateSystem(osg::Vec3 middle, double sizeX, double sizeY, double sizeZ)
Create a coordinate system.
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 ...
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 > 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.
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.
osg::ref_ptr< osg::Geometry > createUnitCubeAsLines(const WColor &color, bool asLines=false)
Creates a osg::Geometry containing an unit cube as line-strips, having 3D texture coordinates.