Public Member Functions | |
DelaunayConstraint () | |
void | addtriangle (int i1, int i2, int i3) |
const osg::DrawElementsUInt * | getTriangles () const |
osg::DrawElementsUInt * | getTriangles () |
osg::Vec3Array * | getPoints (const osg::Vec3Array *points) |
osg::DrawElementsUInt * | makeDrawable () |
void | merge (DelaunayConstraint *dco) |
void | removeVerticesInside (const DelaunayConstraint *dco) |
float | windingNumber (const osg::Vec3 &testpoint) const |
virtual bool | contains (const osg::Vec3 &testpoint) const |
virtual bool | outside (const osg::Vec3 &testpoint) const |
void | handleOverlaps (void) |
Protected Types | |
typedef std::vector< int * > | trilist |
Protected Member Functions | |
virtual | ~DelaunayConstraint () |
Protected Attributes | |
trilist | _interiorTris |
osg::ref_ptr < osg::DrawElementsUInt > | prim_tris_ |
Add DelaunayConstraints (or derived class) to control the triangulation edges.
typedef std::vector< int* > osgUtil::DelaunayConstraint::trilist [protected] |
osgUtil::DelaunayConstraint::DelaunayConstraint | ( | ) | [inline] |
virtual osgUtil::DelaunayConstraint::~DelaunayConstraint | ( | ) | [inline, protected, virtual] |
void osgUtil::DelaunayConstraint::addtriangle | ( | int | i1, | |
int | i2, | |||
int | i3 | |||
) |
Each primitiveset is a list of vertices which may be closed by joining up to its start to make a loop. Constraints should be simple lines, not crossing themselves. Constraints which cross other constraints can cause difficulties - see the example for methods of dealing with them. collect up indices of triangle from delaunay triangles. The delaunay triangles inside the DelaunayConstraint area can be used to fill the area or generate geometry that terrain follows the area in some way. These triangles can form a canopy or a field.
const osg::DrawElementsUInt * osgUtil::DelaunayConstraint::getTriangles | ( | ) | const [inline] |
Get the filling primitive. One: triangulate must have bneen called and two: triangle list is filled when DelaunayTriangulator::removeInternalTriangles is called. These return the triangles removed from the delaunay triangulation by DelaunayTriangulator::removeInternalTriangles.
References osg::ref_ptr< T >::get(), and prim_tris_.
osg::DrawElementsUInt * osgUtil::DelaunayConstraint::getTriangles | ( | ) | [inline] |
References osg::ref_ptr< T >::get(), and prim_tris_.
osg::Vec3Array* osgUtil::DelaunayConstraint::getPoints | ( | const osg::Vec3Array * | points | ) |
Call BEFORE makeDrawable to reorder points to make optimised set
osg::DrawElementsUInt* osgUtil::DelaunayConstraint::makeDrawable | ( | ) |
converts simple list of triangles into a drawarray.
void osgUtil::DelaunayConstraint::merge | ( | DelaunayConstraint * | dco | ) |
Add vertices and constraint loops from dco Can be used to generate extra vertices where dco crosses 'this' using osgUtil::Tessellator to insert overlap vertices.
void osgUtil::DelaunayConstraint::removeVerticesInside | ( | const DelaunayConstraint * | dco | ) |
remove from line the vertices that are inside dco
float osgUtil::DelaunayConstraint::windingNumber | ( | const osg::Vec3 & | testpoint | ) | const |
return winding number as a float of loop around testpoint; may use multiple loops does not reject points on the edge or very very close to the edge
virtual bool osgUtil::DelaunayConstraint::contains | ( | const osg::Vec3 & | testpoint | ) | const [virtual] |
true if testpoint is internal (or external) to constraint.
virtual bool osgUtil::DelaunayConstraint::outside | ( | const osg::Vec3 & | testpoint | ) | const [virtual] |
void osgUtil::DelaunayConstraint::handleOverlaps | ( | void | ) |
Tessellate the constraint loops so that the crossing points are interpolated and added to the contraints for the triangulation.
trilist osgUtil::DelaunayConstraint::_interiorTris [protected] |
Referenced by getTriangles().