MeshCore::AbstractPolygonTriangulator Class Reference

#include <Triangulation.h>

Inheritance diagram for MeshCore::AbstractPolygonTriangulator:
MeshCore::ConstraintDelaunayTriangulator MeshCore::DelaunayTriangulator MeshCore::EarClippingTriangulator MeshCore::FlatTriangulator MeshCore::Triangulator MeshCore::QuasiDelaunayTriangulator

List of all members.

Public Member Functions

 AbstractPolygonTriangulator ()
std::vector< Base::Vector3fAddedPoints () const
 The triangulation algorithm may create new points when calling Triangulate().
void Discard ()
const std::vector< MeshFacet > & GetFacets () const
 Returns the topologic facets of the polygon.
std::vector< unsigned long > GetInfo () const
 Get information about the pol<gons that were processed.
float GetLength () const
 Returns the length of the polygon.
std::vector< Base::Vector3fGetPolygon () const
 Get the polygon points to be triangulated.
Base::Matrix4D GetTransformToFitPlane () const
 Computes the best-fit plane and returns a transformation matrix built out of the axes of the plane.
const std::vector
< MeshGeomFacet > & 
GetTriangles () const
 Returns the geometric triangles of the polygon.
virtual void ProjectOntoSurface (const std::vector< Base::Vector3f > &)
 If points were added then we get the 3D points by projecting the added 2D points onto a surface which fits into the given points.
std::vector< Base::Vector3fProjectToFitPlane ()
 If the points of the polygon set by SetPolygon() doesn't lie in a plane this method can be used to project the points in a common plane.
void SetPolygon (const std::vector< Base::Vector3f > &raclPoints)
 Sets the polygon to be triangulated.
bool TriangulatePolygon ()
 Computes the triangulation of a polygon.
virtual ~AbstractPolygonTriangulator ()

Protected Member Functions

void Done ()
virtual bool Triangulate ()=0
 Computes the triangulation of a polygon.

Protected Attributes

bool _discard
std::vector< MeshFacet_facets
std::vector< unsigned long > _info
Base::Matrix4D _inverse
std::vector< Base::Vector3f_newpoints
std::vector< Base::Vector3f_points
std::vector< MeshGeomFacet_triangles

Detailed Description

Definition at line 34 of file Triangulation.h.


Constructor & Destructor Documentation

AbstractPolygonTriangulator::AbstractPolygonTriangulator (  ) 

Definition at line 41 of file Triangulation.cpp.

References _discard.

AbstractPolygonTriangulator::~AbstractPolygonTriangulator (  )  [virtual]

Definition at line 46 of file Triangulation.cpp.


Member Function Documentation

std::vector< Base::Vector3f > AbstractPolygonTriangulator::AddedPoints (  )  const

The triangulation algorithm may create new points when calling Triangulate().

This method returns these added points.

Note:
: Make sure to have called ProjectOntoSurface() before using this method if you want the surface points the new points are lying on.

Definition at line 78 of file Triangulation.cpp.

References _inverse, and _newpoints.

Referenced by MeshCore::MeshAlgorithm::FillupHole().

void AbstractPolygonTriangulator::Discard (  ) 

Definition at line 172 of file Triangulation.cpp.

References _discard, and _info.

Referenced by MeshCore::MeshAlgorithm::FillupHole().

void AbstractPolygonTriangulator::Done (  )  [protected]

Definition at line 180 of file Triangulation.cpp.

References _discard, _info, and _points.

Referenced by TriangulatePolygon().

const std::vector<MeshFacet>& MeshCore::AbstractPolygonTriangulator::GetFacets ( void   )  const [inline]
std::vector< unsigned long > AbstractPolygonTriangulator::GetInfo (  )  const

Get information about the pol<gons that were processed.

It returns an array of the number of edges for each closed polygon.

Definition at line 167 of file Triangulation.cpp.

References _info.

float AbstractPolygonTriangulator::GetLength (  )  const

Returns the length of the polygon.

Definition at line 64 of file Triangulation.cpp.

References _points, and Sketcher::Distance.

std::vector< Base::Vector3f > AbstractPolygonTriangulator::GetPolygon (  )  const

Get the polygon points to be triangulated.

The points may be projected onto its average plane.

Definition at line 59 of file Triangulation.cpp.

References _points.

Referenced by MeshCore::MeshAlgorithm::FillupHole(), MeshCore::ConstraintDelaunayTriangulator::Triangulate(), and MeshCore::FlatTriangulator::Triangulate().

Base::Matrix4D AbstractPolygonTriangulator::GetTransformToFitPlane (  )  const
const std::vector<MeshGeomFacet>& MeshCore::AbstractPolygonTriangulator::GetTriangles (  )  const [inline]

Returns the geometric triangles of the polygon.

Definition at line 70 of file Triangulation.h.

Referenced by MeshCore::ConstraintDelaunayTriangulator::Triangulate(), and MeshCore::FlatTriangulator::Triangulate().

void AbstractPolygonTriangulator::ProjectOntoSurface ( const std::vector< Base::Vector3f > &  points  )  [virtual]

If points were added then we get the 3D points by projecting the added 2D points onto a surface which fits into the given points.

Reimplemented in MeshCore::FlatTriangulator.

Definition at line 124 of file Triangulation.cpp.

References _inverse, _newpoints, MeshCore::Approximation::AddPoint(), MeshCore::Approximation::CountPoints(), MeshCore::PolynomialFit::Fit(), FLOAT_MAX, Base::Vector3< _Precision >::TransformToCoordinateSystem(), and MeshCore::PolynomialFit::Value().

Referenced by MeshCore::MeshAlgorithm::FillupHole().

std::vector< Base::Vector3f > AbstractPolygonTriangulator::ProjectToFitPlane (  ) 

If the points of the polygon set by SetPolygon() doesn't lie in a plane this method can be used to project the points in a common plane.

Definition at line 112 of file Triangulation.cpp.

References _inverse, _points, and GetTransformToFitPlane().

Referenced by MeshCore::ConstraintDelaunayTriangulator::Triangulate(), MeshCore::FlatTriangulator::Triangulate(), and MeshCore::EarClippingTriangulator::Triangulate().

void AbstractPolygonTriangulator::SetPolygon ( const std::vector< Base::Vector3f > &  raclPoints  ) 
virtual bool MeshCore::AbstractPolygonTriangulator::Triangulate (  )  [protected, pure virtual]
bool AbstractPolygonTriangulator::TriangulatePolygon (  ) 

Member Data Documentation

Definition at line 90 of file Triangulation.h.

Referenced by AbstractPolygonTriangulator(), Discard(), and Done().

std::vector<unsigned long> MeshCore::AbstractPolygonTriangulator::_info [protected]

Definition at line 96 of file Triangulation.h.

Referenced by Discard(), Done(), and GetInfo().

Definition at line 91 of file Triangulation.h.

Referenced by AddedPoints(), ProjectOntoSurface(), and ProjectToFitPlane().


The documentation for this class was generated from the following files:

Generated on Wed Nov 23 19:02:23 2011 for FreeCAD by  doxygen 1.6.1