TexGen
|
Creates a mesh of a section using open source package triangle http://www.cs.cmu.edu/~quake/triangle.html. More...
#include <SectionMeshTriangulate.h>
Public Member Functions | |
CSectionMeshTriangulate (double dMinAngle=20, double dMaxArea=1) | |
Set the mesh quality parameters. More... | |
CSectionMeshTriangulate (TiXmlElement &Element) | |
~CSectionMeshTriangulate (void) | |
CSectionMesh * | Copy () const |
This is a function to allow copying of derived classes correctly. More... | |
string | GetType () const |
Derived class should return the class name. More... | |
void | PopulateTiXmlElement (TiXmlElement &Element, OUTPUT_TYPE OutputType) const |
Used for saving data to XML. More... | |
const CMesh & | GetMesh (const vector< XY > &Section) const |
Accessor methods. More... | |
virtual void | SetNumLayers (int iNumLayers) |
virtual int | GetNumLayers () |
Static Public Member Functions | |
static CMesh | GetSimpleMesh (const vector< XY > &Section) |
static CMesh | GetTriangleMesh (const vector< XY > &Section) |
static CObjectContainer< CSectionMesh > | CreateSectionMesh (TiXmlElement &Element) |
Create a section from TiXmlElement. More... | |
Protected Member Functions | |
bool | CreateMesh (const vector< XY > &Section) const |
Create a mesh out of given list of points representing the edge of the section. More... | |
bool | CreateMeshIfNeeded (const vector< XY > &Section) const |
Create the mesh if it has not already been created. More... | |
Protected Attributes | |
double | m_dMinAngle |
double | m_dMaxArea |
CMesh | m_Mesh |
Used to cache the result of the previous mesh for efficiency. More... | |
vector< XY > | m_Section |
Store the section used to request a mesh the last time. More... | |
Creates a mesh of a section using open source package triangle http://www.cs.cmu.edu/~quake/triangle.html.
Definition at line 28 of file SectionMeshTriangulate.h.
CSectionMeshTriangulate::CSectionMeshTriangulate | ( | double | dMinAngle = 20 , |
double | dMaxArea = 1 |
||
) |
Set the mesh quality parameters.
dMinAngle | Minimum angle between two triangle edges generated by the triangulator. Increasing is value will result in a higher quality mesh but more elements. If this value is too high the mesh generator will hang. |
dMaxArea | Maximum size of triangle generated by the triangulator. Decreasing this value will result in more elements in the mesh. The value is normalised with the area of the total section. Thus a value of 0.1 will not create any triangles with an area greater than 0.1 times the the area of the section. |
Definition at line 32 of file SectionMeshTriangulate.cpp.
CSectionMeshTriangulate::CSectionMeshTriangulate | ( | TiXmlElement & | Element | ) |
Definition at line 42 of file SectionMeshTriangulate.cpp.
References m_dMaxArea, and m_dMinAngle.
CSectionMeshTriangulate::~CSectionMeshTriangulate | ( | void | ) |
Definition at line 38 of file SectionMeshTriangulate.cpp.
|
inlinevirtual |
This is a function to allow copying of derived classes correctly.
Derived classes should implement this as CSectionMesh* Copy() const { return new CSectionMeshDerived(*this); } where CSectionMeshDerived should be replaced by the name of the derived class
Implements TexGen::CSectionMesh.
Definition at line 45 of file SectionMeshTriangulate.h.
|
protectedvirtual |
Create a mesh out of given list of points representing the edge of the section.
Implements TexGen::CSectionMesh.
Definition at line 55 of file SectionMeshTriangulate.cpp.
References TexGen::CMesh::AddNode(), TexGen::CMesh::Clear(), TexGen::CSection::GetArea(), TexGen::CMesh::GetIndices(), m_dMaxArea, m_dMinAngle, TexGen::CSectionMesh::m_Mesh, TexGen::CMesh::TRI, TexGen::XYZ::x, and TexGen::XYZ::y.
|
protectedinherited |
Create the mesh if it has not already been created.
Definition at line 67 of file SectionMesh.cpp.
References TexGen::CSectionMesh::CreateMesh(), and TexGen::CSectionMesh::m_Section.
Referenced by TexGen::CSectionMesh::GetMesh().
|
staticinherited |
Create a section from TiXmlElement.
Definition at line 52 of file SectionMesh.cpp.
Referenced by TexGen::CSection::CSection(), TexGen::CTextile3DWeave::CTextile3DWeave(), and TexGen::CTextileWeave::CTextileWeave().
Accessor methods.
Definition at line 77 of file SectionMesh.cpp.
References TexGen::CSectionMesh::CreateMeshIfNeeded(), and TexGen::CSectionMesh::m_Mesh.
|
inlinevirtualinherited |
Definition at line 58 of file SectionMesh.h.
Function to mesh 2d list of points that form a closed loop. This function does not use triangle instead it used homegrown code.
Definition at line 211 of file SectionMeshTriangulate.cpp.
References TexGen::CMesh::AddNode(), and TexGen::CMesh::MeshClosedLoop().
Definition at line 133 of file SectionMeshTriangulate.cpp.
References TexGen::CMesh::AddNode(), TexGen::CSection::GetArea(), TexGen::CMesh::GetIndices(), TexGen::CMesh::TRI, TexGen::XYZ::x, and TexGen::XYZ::y.
Referenced by TexGen::CYarn::AddEndCapsToMesh().
|
inlinevirtual |
Derived class should return the class name.
Implements TexGen::CSectionMesh.
Definition at line 46 of file SectionMeshTriangulate.h.
|
virtual |
Used for saving data to XML.
Reimplemented from TexGen::CSectionMesh.
Definition at line 48 of file SectionMeshTriangulate.cpp.
References m_dMaxArea, m_dMinAngle, TexGen::CSectionMesh::PopulateTiXmlElement(), and TexGen::stringify().
|
inlinevirtualinherited |
Reimplemented in TexGen::CSectionMeshRectangleSection, and TexGen::CSectionMeshRectangular.
Definition at line 57 of file SectionMesh.h.
|
protected |
Definition at line 57 of file SectionMeshTriangulate.h.
Referenced by CreateMesh(), CSectionMeshTriangulate(), and PopulateTiXmlElement().
|
protected |
Definition at line 57 of file SectionMeshTriangulate.h.
Referenced by CreateMesh(), CSectionMeshTriangulate(), and PopulateTiXmlElement().
|
mutableprotectedinherited |
Used to cache the result of the previous mesh for efficiency.
Definition at line 68 of file SectionMesh.h.
Referenced by TexGen::CSectionMeshRectangleSection::CreateMesh(), TexGen::CSectionMeshRectangular::CreateMesh(), CreateMesh(), TexGen::CSectionMeshRectangular::CreateSingleLayerMesh(), and TexGen::CSectionMesh::GetMesh().
|
mutableprotectedinherited |
Store the section used to request a mesh the last time.
If the given section is the same as given last time then no need to remesh, simply re-used the result of last time.
Definition at line 75 of file SectionMesh.h.
Referenced by TexGen::CSectionMesh::CreateMeshIfNeeded().