A generator class that implements the Delaunay Triangulation algorithm. More...
#include <triangulator.h>
Public Types | |
typedef std::vector< DelaunaySegment > | DelaunaySegmentContainer |
Convenience typedef for the storage of delaunay segments to be processed by this class. | |
typedef std::vector< LineSegment2D > | SegmentContainer |
Convenience typedef for the storage of segments to be processed by this class. | |
Public Types inherited from Mezzanine::Graphics::Procedural::MeshGenerator< Triangulator > | |
enum | GeneratorOptions |
A convenience enum used to describe boolean options for a generator. | |
Public Member Functions | |||
Triangulator () | |||
Class constructor. | |||
virtual | ~Triangulator () | ||
Class destructor. | |||
virtual void | AddToTriangleBuffer (TriangleBuffer &Buffer) const | ||
Adds the vertices and indices as configured in this generator to a triangle buffer. More... | |||
Triangulator & | SetManualSuperTriangle (Triangle2D *Tri) | ||
Sets manual super triangle. More... | |||
Triangulator & | SetMultiShapeToTriangulate (const MultiShape *TriMultiShape) | ||
Sets multi shape to triangulate. More... | |||
Triangulator & | SetRemoveOutside (const Boole Remove) | ||
Sets if the outside of the shape must be removed. More... | |||
Triangulator & | SetSegmentListToTriangulate (SegmentContainer *Segments) | ||
Sets segment list to triangulate. More... | |||
Triangulator & | SetShapeToTriangulate (const Shape *TriShape) | ||
Sets shape to triangulate. More... | |||
void | Triangulate (IndexContainer &Indexes, Point2DContainer &Vertices) const | ||
Executes the Constrained Delaunay Triangulation algorithm.
| |||
Public Member Functions inherited from Mezzanine::Graphics::Procedural::MeshGenerator< Triangulator > | |||
MeshGenerator () | |||
Class constructor. | |||
virtual | ~MeshGenerator () | ||
Class destructor. | |||
TriangleBuffer | BuildTriangleBuffer () const | ||
Creates a TriangleBuffer with the the vertices and indices as configured in this generator. More... | |||
Mesh * | GenerateMesh (const String &MeshName, const String &MeshGroup, const String &MatName, const String &MatGroup) const | ||
Generates the mesh. More... | |||
Triangulator & | ResetTransforms () | ||
Resets all transforms (orientation, position and scale) that would have been applied to the mesh to their default values. More... | |||
Triangulator & | SetEnableNormals (Boole EnableNormals) | ||
Sets whether normals are enabled or not. More... | |||
Triangulator & | SetNumTexCoordSet (const UInt8 NumSets) | ||
Sets the number of texture coordintate sets. More... | |||
Triangulator & | SetOrientation (const Quaternion &Ori) | ||
Sets an orientation baked into the resulting mesh. More... | |||
Triangulator & | SetOrientation (const Real X, const Real Y, const Real Z, const Real W) | ||
Sets an orientation baked into the resulting mesh. More... | |||
Triangulator & | SetPosition (const Vector3 &Loc) | ||
Sets a translation baked into the resulting mesh. More... | |||
Triangulator & | SetPosition (const Real X, const Real Y, const Real Z) | ||
Sets a translation baked into the resulting mesh. More... | |||
Triangulator & | SetScale (const Vector3 &Scaling) | ||
Sets a scale baked into the resulting mesh. More... | |||
Triangulator & | SetScale (const Real Scaling) | ||
Sets a uniform scale baked into the resulting mesh. More... | |||
Triangulator & | SetScale (const Real X, const Real Y, const Real Z) | ||
Sets a scale baked into the resulting mesh. More... | |||
Triangulator & | SetSwitchUV (Boole SwitchUV) | ||
Sets whether to switch U and V texture coordinates. More... | |||
Triangulator & | SetTextureRectangle (const Real RectLeft, const Real RectRight, const Real RectTop, const Real RectBottom) | ||
Sets the texture rectangle. More... | |||
Triangulator & | SetUTile (const Real uTile) | ||
Sets the U Tile. More... | |||
Triangulator & | SetVTile (const Real vTile) | ||
Sets the V Tile. More... | |||
Protected Member Functions | |
void | _AddConstraints (DelaunayTriangleBuffer &TriBuf, const Point2DContainer &List, const IndexContainer &SegmentListIndices) const |
Forces specific segments to be present in the resulting triangulation. More... | |
void | _RecursiveTriangulatePolygon (const DelaunaySegment &CuttingSeg, const IndexContainer &InputPoints, DelaunayTriangleBuffer &TriBuf, const Point2DContainer &List) const |
Recursively generates a Delaunay triangle from a container of points. More... | |
void | Delaunay (Point2DContainer &List, DelaunayTriangleBuffer &TriBuf) const |
Performs a Delaunay Triangulation on a provided list of points in 2D space and populates a triangle buffer with the results. More... | |
Protected Member Functions inherited from Mezzanine::Graphics::Procedural::MeshGenerator< Triangulator > | |
void | AddPoint (TriangleBuffer &Buffer, const Vector3 &Loc, const Vector3 &Norm, const Vector2 &UV) const |
Adds a new point to a triangle buffer, using the format defined for that MeshGenerator. More... | |
Protected Attributes | |
Triangle2D * | ManualSuperTriangle |
A pointer to an optional triangle that encompasses all points to be triangulated. More... | |
const MultiShape * | MultiShapeToTriangulate |
A pointer to the MultiShape to be triangulated. More... | |
Boole | RemoveOutside |
Stores whether or not the super triangle should be removed at the end of triangulation. More... | |
SegmentContainer * | SegmentListToTriangulate |
A pointer to a container of segments forming the shape to triangulate. More... | |
const Shape * | ShapeToTriangulate |
A pointer to the Shape to be triangulated. More... | |
Protected Attributes inherited from Mezzanine::Graphics::Procedural::MeshGenerator< Triangulator > | |
UInt8 | GeneratorOpts |
Storage for the boolean options to be used by this generator. More... | |
UInt8 | NumTexCoordSet |
The number of texture coordinate sets to include. More... | |
Quaternion | Orientation |
Orientation to apply the mesh. More... | |
Vector3 | Position |
Position to apply to the mesh. More... | |
Vector3 | Scale |
Scale to apply to the mesh. More... | |
Real | UTile |
U tile for texture coords generation. More... | |
Vector2 | UVOrigin |
Rectangle in which the texture coordinates will be placed. More... | |
Real | VTile |
V tile for texture coords generation. More... | |
A generator class that implements the Delaunay Triangulation algorithm.
This generator works with 2D geometry to generate triangles for 3D meshes.
Definition at line 252 of file triangulator.h.
|
protected |
Forces specific segments to be present in the resulting triangulation.
TriBuf | The triangule buffer storing the results of the triangulation. |
List | The container of Vector2's to perform the triangulation on. |
SegmentListIndices | A container of indexes to segments that will be forced to exist in the resulting triangulation. |
Definition at line 398 of file triangulator.cpp.
|
protected |
Recursively generates a Delaunay triangle from a container of points.
CuttingSeg | The segment used to generate the previous delaunay triangle that is a part of the provided available points. |
InputPoints | The remaining available points to generate a triangle from. |
TriBuf | The triangule buffer storing the results of the triangulation. |
List | The container of Vector2's to perform the triangulation on. |
Definition at line 540 of file triangulator.cpp.
|
virtual |
Adds the vertices and indices as configured in this generator to a triangle buffer.
Buffer | The buffer to append this generators vertices and indices to. |
Implements Mezzanine::Graphics::Procedural::MeshGenerator< Triangulator >.
Definition at line 594 of file triangulator.cpp.
|
protected |
Performs a Delaunay Triangulation on a provided list of points in 2D space and populates a triangle buffer with the results.
List | The container of Vector2's to perform the triangulation on. |
TriBuf | The triangle buffer storing the results of the triangulation. |
Definition at line 270 of file triangulator.cpp.
Triangulator & Mezzanine::Graphics::Procedural::Triangulator::SetManualSuperTriangle | ( | Triangle2D * | Tri | ) |
Sets manual super triangle.
Tri | The super triangle to manually set for triangulation. |
Definition at line 741 of file triangulator.cpp.
Triangulator & Mezzanine::Graphics::Procedural::Triangulator::SetMultiShapeToTriangulate | ( | const MultiShape * | TriMultiShape | ) |
Sets multi shape to triangulate.
TriMultiShape | The multi-shape that will be triangulated. |
Definition at line 725 of file triangulator.cpp.
Triangulator & Mezzanine::Graphics::Procedural::Triangulator::SetRemoveOutside | ( | const Boole | Remove | ) |
Sets if the outside of the shape must be removed.
RemoveOutside | Whether or not the outside of the shape should be removed during triangulation. |
Definition at line 747 of file triangulator.cpp.
Triangulator & Mezzanine::Graphics::Procedural::Triangulator::SetSegmentListToTriangulate | ( | SegmentContainer * | Segments | ) |
Sets segment list to triangulate.
Segments | A pointer to the container of line segments that will be triangulated. |
Definition at line 733 of file triangulator.cpp.
Triangulator & Mezzanine::Graphics::Procedural::Triangulator::SetShapeToTriangulate | ( | const Shape * | TriShape | ) |
Sets shape to triangulate.
TriShape | The shape that will be triangulated. |
Definition at line 717 of file triangulator.cpp.
void Mezzanine::Graphics::Procedural::Triangulator::Triangulate | ( | IndexContainer & | Indexes, |
Point2DContainer & | Vertices | ||
) | const |
Executes the Constrained Delaunay Triangulation algorithm.
An | INVALID_STATE_EXCEPTION will be thrown if either a Shape, MultiShape, or Segment List is not set when this is called. |
Indexes | A vector of indexes where is outputed the resulting triangle indexes. |
Vertices | A vector of vertices where is outputed the resulting triangle vertices. |
Definition at line 616 of file triangulator.cpp.
|
protected |
A pointer to an optional triangle that encompasses all points to be triangulated.
Definition at line 275 of file triangulator.h.
|
protected |
A pointer to the MultiShape to be triangulated.
Definition at line 267 of file triangulator.h.
|
protected |
Stores whether or not the super triangle should be removed at the end of triangulation.
Definition at line 278 of file triangulator.h.
|
protected |
A pointer to a container of segments forming the shape to triangulate.
Definition at line 271 of file triangulator.h.
|
protected |
A pointer to the Shape to be triangulated.
Definition at line 263 of file triangulator.h.