Classes | Functions

wge Namespace Reference

Extend the wge utils namespace with additional methods relating WDataTexture3D. More...

Classes

class  UniformType
 Class helping to adapt types specified as template parameter into the best matching osg::Uniform (GLSL) type. More...
class  UniformType< double >
 Maps doubles to floats as only floats are allowed in uniforms. More...
class  UniformType< WVector3d >
 Maps WVector3d/WPosition to osg::Vec3. More...
class  UniformType< WItemSelector >
 Maps Selection Properties to ints. More...
class  GLType
 Class helping to adapt types specified as template parameter into the best matching OpenGL type. More...
class  GLType< double >
 Class helping to adapt types specified as template parameter into the best matching OpenGL type. More...
class  GLType< float >
 Class helping to adapt types specified as template parameter into the best matching OpenGL type. More...
class  GLType< int8_t >
 Class helping to adapt types specified as template parameter into the best matching OpenGL type. More...
class  GLType< uint8_t >
 Class helping to adapt types specified as template parameter into the best matching OpenGL type. More...
class  GLType< int16_t >
 Class helping to adapt types specified as template parameter into the best matching OpenGL type. More...
class  GLType< uint16_t >
 Class helping to adapt types specified as template parameter into the best matching OpenGL type. More...
class  GLType< int32_t >
 Class helping to adapt types specified as template parameter into the best matching OpenGL type. More...
class  GLType< uint32_t >
 Class helping to adapt types specified as template parameter into the best matching OpenGL type. More...

Functions

void bindTexture (osg::ref_ptr< osg::Node > node, osg::ref_ptr< WDataTexture3D > texture, size_t unit=0, std::string prefix="")
 Binds the specified texture to the specified unit.
osg::ref_ptr< osg::Geode > generateBoundingBoxGeode (const WBoundingBox &bb, const WColor &color)
 Generates an OSG geode for the bounding box.
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::Geometry > createUnitCube (const WColor &color)
 Creates a osg::Geometry containing an unit cube, having 3D texture coordinates.
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 > 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 > convertToOsgGeometry (WTriangleMesh::SPtr mesh, const WColoredVertices &colorMap, const WColor &defaultColor=WColor(1.0, 1.0, 1.0, 1.0), bool includeNormals=false, bool lighting=false)
 Extract the vertices and triangles from a WTriangleMesh and save them into an osg::Geometry.
osg::ref_ptr< osg::Geode > generateLineStripGeode (const WLine &line, const float thickness=3.0f, const WColor &color=WColor(0, 0, 0, 0))
 Generates a line geode with thickness and color as parameters.
osg::ref_ptr
< osg::PositionAttitudeTransform > 
addLabel (osg::Vec3 position, std::string text)
 helper function to add a label somewhere
osg::ref_ptr
< osg::PositionAttitudeTransform > 
vector2label (osg::Vec3 position)
 helper function to add a label with it's position vector
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.
osg::ref_ptr< osg::Group > creatCoordinateSystem (osg::Vec3 middle, double sizeX, double sizeY, double sizeZ)
 Create a coordinate system.
osg::ref_ptr< osg::Geode > genFinitePlane (osg::Vec3 const &base, osg::Vec3 const &a, osg::Vec3 const &b)
 Generates a geode out of two vectors and an origin position.
osg::ref_ptr< WGESubdividedPlanegenUnitSubdividedPlane (size_t resX, size_t resY, double spacing=0.01)
 Generates a plane subdivided into quads.
template<class Container >
osg::ref_ptr< osg::Geode > genPointBlobs (boost::shared_ptr< Container > points, double size, const WColor &color=WColor(1.0, 0.0, 0.0, 1.0))
 For each points in the STL container generate small cubes.
osg::ref_ptr< osg::Vec3Array > generateCuboidQuads (const std::vector< WPosition > &corners)
 Creates out of eight corner vertices QUAD vertices.
osg::Vec3 getQuadNormal (const WPosition &a, const WPosition &b, const WPosition &c)
 Generates for a QUAD given via 3 three points ( the fourth is not needed ) the normal.
osg::ref_ptr< osg::Vec3Array > generateCuboidQuadNormals (const std::vector< WPosition > &corners)
 Generates for all QUADS of the Cuboid the normals in the following order:
WTriangleMesh::SPtr triangulate (const std::vector< WPosition > &points, double transformationFactor=0.0)
 Calculate the Delaunay Triangulation of the given points.
template<typename T >
void bindTexture (osg::ref_ptr< osg::Node > node, osg::ref_ptr< T > texture, size_t unit=0, std::string prefix="")
 Binds the specified texture to the specified unit.
template<typename T >
void bindTexture (osg::ref_ptr< osg::Node > node, osg::ref_ptr< WGETexture< T > > texture, size_t unit=0, std::string prefix="")
 Binds the specified texture to the specified unit.
void unbindTexture (osg::ref_ptr< osg::Node > node, size_t unit, size_t count=1)
 Removes the binding associated with the specified unit.
size_t getMaxTexUnits ()
 Returns the maximum number of textures that can be bound to a node.
osg::ref_ptr< WGETexture
< osg::Texture1D > > 
genWhiteNoiseTexture (size_t sizeX, size_t channels)
 This generates an 1D texture only containing white noise in its channels.
osg::ref_ptr< WGETexture
< osg::Texture2D > > 
genWhiteNoiseTexture (size_t sizeX, size_t sizeY, size_t channels)
 This generates an 2D texture only containing white noise in its channels.
osg::ref_ptr< WGETexture
< osg::Texture3D > > 
genWhiteNoiseTexture (size_t sizeX, size_t sizeY, size_t sizeZ, size_t channels)
 This generates an 3D texture only containing white noise in its channels.
osg::ref_ptr< osg::Image > genWhiteNoiseImage (size_t sizeX, size_t sizeY, size_t sizeZ, size_t channels=1)
 Generates an image only containing white noise in its channels.
WColor getRGBAColorFromDirection (const WPosition &pos1, const WPosition &pos2)
 Transforms a direction given via two points into a RGB color.
osg::ref_ptr< osg::Vec3Array > osgVec3Array (const std::vector< WPosition > &posArray)
 Converts a whole vector of WPositions into an osg::Vec3Array.
osg::Vec3 unprojectFromScreen (const osg::Vec3 screen, osg::ref_ptr< osg::Camera > camera)
 Converts screen coordinates into Camera coordinates.
WColor createColorFromIndex (int index)
 creates the same color as the atlas colormap shader from the index
WColor createColorFromHSV (int h, float s=1.0, float v=1.0)
 creates a rgb WColor from a HSV value
WColor getNthHSVColor (int n)
 creates the nth color of a partition of the hsv color circle

Detailed Description

Extend the wge utils namespace with additional methods relating WDataTexture3D.

Convinient functions for use with the graphics engine of OpenWalnut.

ATM the namespace is filled by several files: WGEGeodeUtils, WGEGeometryUtils and WGEUtils.


Function Documentation

osg::ref_ptr< osg::PositionAttitudeTransform > wge::addLabel ( osg::Vec3  position,
std::string  text 
)

helper function to add a label somewhere

Parameters:
position position of the label
text text
Returns:
a positionattitudetransfom object containing the label

Definition at line 381 of file WGEGeodeUtils.cpp.

References WPathHelper::getAllFonts().

Referenced by vector2label().

void wge::bindTexture ( osg::ref_ptr< osg::Node >  node,
osg::ref_ptr< WDataTexture3D texture,
size_t  unit = 0,
std::string  prefix = "" 
)

Binds the specified texture to the specified unit.

It automatically adds several uniforms which then can be utilized in the shader:

  • u_textureXUnit: the unit number (useful for accessing correct gl_TexCoord and so on)
  • u_textureXSampler: the needed sampler
  • u_textureXSizeX: width of the texture in pixels
  • u_textureXSizeY: height of the texture in pixels
  • u_textureXSizeZ: depth of the texture in pixels If the specified texture is a WGETexture, it additionally adds u_textureXMin and u_textureXScale for unscaling.
Parameters:
node where to bind
unit the unit to use
texture the texture to use.
prefix if specified, defines the uniform name prefix. (Sampler, Unit, Sizes, ...)
Template Parameters:
T the type of texture. Usually osg::Texture3D or osg::Texture2D.

Definition at line 146 of file WDataTexture3D.cpp.

Referenced by WGETexture< TextureType >::bind(), WGEOffscreenRenderPass::bind(), and WGEColormapping::callback().

template<typename T >
void wge::bindTexture ( osg::ref_ptr< osg::Node >  node,
osg::ref_ptr< T >  texture,
size_t  unit = 0,
std::string  prefix = "" 
)

Binds the specified texture to the specified unit.

It automatically adds several uniforms which then can be utilized in the shader:

  • u_textureXUnit: the unit number (useful for accessing correct gl_TexCoord and so on)
  • u_textureXSampler: the needed sampler
  • u_textureXSizeX: width of the texture in pixels
  • u_textureXSizeY: height of the texture in pixels
  • u_textureXSizeZ: depth of the texture in pixels
Parameters:
node where to bind
unit the unit to use
texture the texture to use.
prefix if specified, defines the uniform name prefix. (Sampler, Unit, Sizes, ...)
Template Parameters:
T the type of texture. Usually osg::Texture3D or osg::Texture2D.

Definition at line 147 of file WGETextureUtils.h.

template<typename T >
void wge::bindTexture ( osg::ref_ptr< osg::Node >  node,
osg::ref_ptr< WGETexture< T > >  texture,
size_t  unit = 0,
std::string  prefix = "" 
)

Binds the specified texture to the specified unit.

It automatically adds several uniforms which then can be utilized in the shader:

  • u_textureXUnit: the unit number (useful for accessing correct gl_TexCoord and so on)
  • u_textureXSampler: the needed sampler
  • u_textureXSizeX: width of the texture in pixels
  • u_textureXSizeY: height of the texture in pixels
  • u_textureXSizeZ: depth of the texture in pixels If the specified texture is a WGETexture, it additionally adds u_textureXMin and u_textureXScale for unscaling.
Parameters:
node where to bind
unit the unit to use
texture the texture to use.
prefix if specified, defines the uniform name prefix. (Sampler, Unit, Sizes, ...)
Template Parameters:
T the type of texture. Usually osg::Texture3D or osg::Texture2D.

Definition at line 164 of file WGETextureUtils.h.

osg::ref_ptr< osg::Geometry > wge::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.

It can use the normals and per-vertex colors of the mesh.

Parameters:
mesh the WTriangleMesh used as input
includeNormals When true, calculate the vertex normals and include them into the geometry.
defaultColor This color is used in case the useMeshColor parameter is false or no colors are defined in the mesh.
lighting if true, a standard lighting is activated for this geometry
useMeshColor if true, the mesh color is used. If false, the defaultColor is used.
Returns:
an osg::Geometry containing the mesh
Notes:
mesh cannot be const since osg::Geometry needs non-const pointers to the contained arrays

Definition at line 243 of file WGEGeodeUtils.cpp.

Referenced by convertToOsgGeometry().

osg::ref_ptr< osg::Geometry > wge::convertToOsgGeometry ( WTriangleMesh::SPtr  mesh,
const WColoredVertices colorMap,
const WColor &  defaultColor = WColor( 1.0, 1.0, 1.0, 1.0 ),
bool  includeNormals = false,
bool  lighting = false 
)

Extract the vertices and triangles from a WTriangleMesh and save them into an osg::Geometry.

It can use the normals and per-vertex colors of the mesh. This method additionally uses the specified vertexID-color map to provide additional coloring.

Parameters:
mesh the WTriangleMesh used as input
colorMap the map from vertex to color.
includeNormals When true, calculate the vertex normals and include them into the geometry.
defaultColor This color is used in case the colorMap does not provide a color for a vertex
lighting if true, a standard lighting is activated for this geometry*
Returns:
an osg::Geometry containing the mesh
Notes:
mesh cannot be const since osg::Geometry needs non-const pointers to the contained arrays

Definition at line 313 of file WGEGeodeUtils.cpp.

References convertToOsgGeometry(), and WColoredVertices::getData().

osg::ref_ptr< osg::Group > wge::creatCoordinateSystem ( osg::Vec3  middle,
double  sizeX,
double  sizeY,
double  sizeZ 
)

Create a coordinate system.

The coordinate system is build from cylinders and cones and includes a positive-to-negative color gradient.

Parameters:
middle osg::Vec3( middleX, middleY, middleZ ) middle points of X, Y, Z
sizeX whole lenght of X
sizeY whole lenght of Y
sizeZ whole lenght of Z
Returns:
Group Node

Definition at line 554 of file WGEGeodeUtils.cpp.

WColor wge::createColorFromHSV ( int  h,
float  s = 1.0,
float  v = 1.0 
)

creates a rgb WColor from a HSV value

Parameters:
h hue
s saturation
v value
Returns:
the color

Definition at line 127 of file WGEUtils.cpp.

Referenced by getNthHSVColor().

WColor wge::createColorFromIndex ( int  index  ) 

creates the same color as the atlas colormap shader from the index

Parameters:
index unsigned char that indexes the color
Returns:
the color

Definition at line 53 of file WGEUtils.cpp.

osg::ref_ptr< osg::Geometry > wge::createUnitCube ( const WColor &  color  ) 

Creates a osg::Geometry containing an unit cube, having 3D texture coordinates.

Parameters:
color the color to set for all vertices
Returns:
the geometry

Definition at line 95 of file WGEGeodeUtils.cpp.

Referenced by generateSolidBoundingBoxNode().

osg::ref_ptr< osg::Geometry > wge::createUnitCubeAsLines ( const WColor &  color  ) 

Creates a osg::Geometry containing an unit cube as line-strips, having 3D texture coordinates.

Parameters:
color the color to set for all vertices
Returns:
the geometry

Definition at line 164 of file WGEGeodeUtils.cpp.

Referenced by WGEGridNode::WGEGridNode().

osg::ref_ptr< osg::Geode > wge::generateBoundingBoxGeode ( const WBoundingBox bb,
const WColor &  color 
)

Generates an OSG geode for the bounding box.

Parameters:
bb The axis aligned bounding box to generate a geode from.
color The color in which the bounding box should be generated
Returns:
The OSG geode containing the 12 edges of the box.

Definition at line 48 of file WGEGeodeUtils.cpp.

References WBoundingBoxImpl< VT >::getMax(), and WBoundingBoxImpl< VT >::getMin().

osg::ref_ptr< osg::Vec3Array > wge::generateCuboidQuadNormals ( const std::vector< WPosition > &  corners  ) 

Generates for all QUADS of the Cuboid the normals in the following order:

        z-axis  y-axis
        |      /
        | h___/_g
        |/:    /|
        d_:___c |
        | :...|.|
        |.e   | f
        |_____|/ ____x-axis
       a      b
       
  • a,b,c,d
  • b,f,g,c
  • f,e,h,g
  • e,a,d,h
  • d,c,g,h
  • a,b,f,e
Parameters:
corners Corner points of the cuboid.
Returns:
Array of normals in the order as shown above.

Definition at line 85 of file WGEGeometryUtils.cpp.

References getQuadNormal().

Referenced by genPointBlobs().

osg::ref_ptr< osg::Vec3Array > wge::generateCuboidQuads ( const std::vector< WPosition > &  corners  ) 

Creates out of eight corner vertices QUAD vertices.

Parameters:
corners The eight corner vertices which must be in the following order:
        z-axis  y-axis
        |      /
        | h___/_g
        |/:    /|
        d_:___c |
        | :...|.|
        |.e   | f
        |_____|/ ____x-axis
       a      b
       

The QUADS are generated in the following order:

  • a,b,c,d
  • b,f,g,c
  • f,e,h,g
  • e,a,d,h
  • d,c,g,h
  • a,b,f,e
Returns:
OSG vertex array where every four vertices describing a QUAD.

Definition at line 38 of file WGEGeometryUtils.cpp.

Referenced by genPointBlobs().

osg::ref_ptr< osg::Geode > wge::generateLineStripGeode ( const WLine line,
const float  thickness = 3.0f,
const WColor &  color = WColor( 0, 0, 0, 0 ) 
)

Generates a line geode with thickness and color as parameters.

Parameters:
line sequence of points
thickness How thick the line strip should be
color If present this color is used for the whole line, otherwise local coloring is used
Returns:
The new assembled geode for this line

Definition at line 340 of file WGEGeodeUtils.cpp.

References WMixinVector< ValueT >::back(), getRGBAColorFromDirection(), and WMixinVector< ValueT >::size().

osg::ref_ptr< osg::Node > wge::generateSolidBoundingBoxNode ( const WBoundingBox bb,
const WColor &  color,
bool  threeDTexCoords = true 
)

Generates an OSG node for the specified bounding box.

It uses solid faces. This actually returns a MatrixTransform node and is especially useful for shader based raytracing.

Parameters:
bb The axis aligned bounding box
color The color in which the bounding box should be generated
threeDTexCoords True if 3D texture coordinates should be created.
Returns:
The OSG node containing the 12 edges of the box.

Definition at line 207 of file WGEGeodeUtils.cpp.

References createUnitCube(), WBoundingBoxImpl< VT >::getMax(), and WBoundingBoxImpl< VT >::getMin().

osg::ref_ptr< osg::Geode > wge::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.

Parameters:
xSize how far the plane from its center along the x-axis should be drawn (both directions)
ySize how far the plane from its center along the y-axis should be drawn (both directions)
p The plane instance
color The color of the plane
border If true than a border around each plane is drawn in inverse color of the plane
Returns:
The new assembled geode for this plane

Definition at line 416 of file WGEGeodeUtils.cpp.

References WPlane::getPointInPlane().

Referenced by WGEOffscreenTexturePass::setup().

osg::ref_ptr< osg::Geode > wge::genFinitePlane ( osg::Vec3 const &  base,
osg::Vec3 const &  a,
osg::Vec3 const &  b 
)

Generates a geode out of two vectors and an origin position.

Parameters:
base the origin position. NOT the center.
a the first vector spanning the plane
b the second vector spanning the plane
Returns:
the geode

Definition at line 458 of file WGEGeodeUtils.cpp.

template<class Container >
osg::ref_ptr< osg::Geode > wge::genPointBlobs ( boost::shared_ptr< Container >  points,
double  size,
const WColor &  color = WColor( 1.0, 0.0, 0.0, 1.0 ) 
) [inline]

For each points in the STL container generate small cubes.

Parameters:
points Center point of the cubes
size The size of the cubes
color The color of the cubes
Template Parameters:
An STL container with WPositions as elements ( don't try it with different than vector, set, list or queue )
Returns:
Geode with as many cubes as points in the container where each cube is around a certain position.

Definition at line 233 of file WGEGeodeUtils.h.

References generateCuboidQuadNormals(), and generateCuboidQuads().

osg::ref_ptr< WGESubdividedPlane > wge::genUnitSubdividedPlane ( size_t  resX,
size_t  resY,
double  spacing = 0.01 
)

Generates a plane subdivided into quads.

Parameters:
resX How many quads in x-direction
resY How many quads in y-direction
spacing Not implement yet
Returns:
The new uncolored plane geode

Definition at line 502 of file WGEGeodeUtils.cpp.

Referenced by WGEGeodeUtilsTest::testCenterPoints(), and WGEGeodeUtilsTest::testNumQuadsAndTheirVerticesWithoutSpacing().

osg::ref_ptr< osg::Image > wge::genWhiteNoiseImage ( size_t  sizeX,
size_t  sizeY,
size_t  sizeZ,
size_t  channels = 1 
)

Generates an image only containing white noise in its channels.

Parameters:
sizeX size in x direction (in pixels)
sizeY size in y direction (in pixels)
sizeZ size in z direction (in pixels)
channels the number of channels. Valid are 1, 3 and 4.
Returns:
the generated image.

Definition at line 89 of file WGETextureUtils.cpp.

Referenced by genWhiteNoiseTexture().

osg::ref_ptr< WGETexture< osg::Texture2D > > wge::genWhiteNoiseTexture ( size_t  sizeX,
size_t  sizeY,
size_t  channels 
)

This generates an 2D texture only containing white noise in its channels.

Parameters:
sizeX size in x direction (in pixels)
sizeY size in y direction (in pixels)
channels the number of channels. Valid are 1, 3 and 4.
Returns:
the generated texture.

Definition at line 61 of file WGETextureUtils.cpp.

References genWhiteNoiseImage().

osg::ref_ptr< WGETexture< osg::Texture1D > > wge::genWhiteNoiseTexture ( size_t  sizeX,
size_t  channels 
)

This generates an 1D texture only containing white noise in its channels.

Parameters:
sizeX size in x direction (in pixels)
channels the number of channels. Valid are 1, 3 and 4.
Returns:
the generated texture.

Definition at line 49 of file WGETextureUtils.cpp.

References genWhiteNoiseImage().

osg::ref_ptr< WGETexture< osg::Texture3D > > wge::genWhiteNoiseTexture ( size_t  sizeX,
size_t  sizeY,
size_t  sizeZ,
size_t  channels 
)

This generates an 3D texture only containing white noise in its channels.

Parameters:
sizeX size in x direction (in pixels)
sizeY size in y direction (in pixels)
sizeZ size in z direction (in pixels)
channels the number of channels. Valid are 1, 3 and 4.
Returns:
the generated texture.

Definition at line 74 of file WGETextureUtils.cpp.

References genWhiteNoiseImage().

size_t wge::getMaxTexUnits (  ) 

Returns the maximum number of textures that can be bound to a node.

Call this only from withing the OSG thread!

Returns:
the max number of texture units.

Definition at line 40 of file WGETextureUtils.cpp.

Referenced by WGEColormapping::callback().

WColor wge::getNthHSVColor ( int  n  ) 

creates the nth color of a partition of the hsv color circle

Parameters:
n number of the color
Returns:
the color

Definition at line 159 of file WGEUtils.cpp.

References createColorFromHSV().

osg::Vec3 wge::getQuadNormal ( const WPosition a,
const WPosition b,
const WPosition c 
)

Generates for a QUAD given via 3 three points ( the fourth is not needed ) the normal.

Parameters:
a First point of the QUAD
b Second point of the QUAD
c Third point of the QUAD
Returns:
OSG Vector of the normal of the QUAD

Definition at line 75 of file WGEGeometryUtils.cpp.

Referenced by generateCuboidQuadNormals().

WColor wge::getRGBAColorFromDirection ( const WPosition pos1,
const WPosition pos2 
) [inline]

Transforms a direction given via two points into a RGB color.

Parameters:
pos1 First point
pos2 Second point
Returns:
converts a vector to a color

Definition at line 101 of file WGEUtils.h.

Referenced by generateLineStripGeode().

osg::ref_ptr< osg::Vec3Array > wge::osgVec3Array ( const std::vector< WPosition > &  posArray  ) 

Converts a whole vector of WPositions into an osg::Vec3Array.

Parameters:
posArray The given positions vector
Returns:
Refernce to the same vector but as osg::Vec3Array.

Definition at line 36 of file WGEUtils.cpp.

Referenced by triangulate().

WTriangleMesh::SPtr wge::triangulate ( const std::vector< WPosition > &  points,
double  transformationFactor = 0.0 
)

Calculate the Delaunay Triangulation of the given points.

If the parameter transformationFactor is not zero, the points will be transformed to calcule the triangles to get a better triangulation, but the returned mesh will consist of the original points. Every point which lies above the centroid of all points will be put away from this centroid by transformationFactor * height above the centroid. Any point below the centroid will be drawn to the centroid because its height is negative. This effect is inverted with a negative transformationFactor. This transformation is used to calculate the head surface between several electrodes, were a transformationFactor of -0.005 is reasonable.

Parameters:
points vector of the points to triangulate
transformationFactor magnitude of the transformation before the triangulation
Returns:
triangulation as WTriangleMesh

Definition at line 98 of file WGEGeometryUtils.cpp.

References osgVec3Array().

Referenced by WGEGeometryUtilsTest::testTriangulate().

void wge::unbindTexture ( osg::ref_ptr< osg::Node >  node,
size_t  unit,
size_t  count = 1 
)

Removes the binding associated with the specified unit.

Parameters:
unit the unit to unbind
node the node from which the binding should be removed
count the number of units beginning at the specified one should be unbound? 1 is the default.

Definition at line 31 of file WGETextureUtils.cpp.

Referenced by WGEColormapping::callback().

osg::Vec3 wge::unprojectFromScreen ( const osg::Vec3  screen,
osg::ref_ptr< osg::Camera >  camera 
)

Converts screen coordinates into Camera coordinates.

Parameters:
screen the screen coordinates
camera The matrices of this camera will used for unprojecting.
Returns:
un-projects a screen coordinate back to world space

Definition at line 48 of file WGEUtils.cpp.

Referenced by WROISphere::updateGFX(), and WROIBox::updateGFX().

osg::ref_ptr< osg::PositionAttitudeTransform > wge::vector2label ( osg::Vec3  position  ) 

helper function to add a label with it's position vector

Parameters:
position position of the label
Returns:
a positionattitudetransfom object containing the label

Definition at line 409 of file WGEGeodeUtils.cpp.

References addLabel().

 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends