61 CMesh(TiXmlElement &Element);
110 void PopulateTiXmlElement(TiXmlElement &Element,
OUTPUT_TYPE OutputType)
const;
117 list<int>::iterator ConvertQuadtoTriangles(list<int>::iterator itQuad);
120 void ConvertTrianglestoSegments();
123 void ConvertQuadstoTriangles(
bool bQuality =
true);
126 void ConvertHextoQuad();
129 void ConvertWedgeto2D();
132 void ConvertTettoTriangle();
135 void ConvertHextoWedge(
bool bQuality =
true);
138 void ConvertWedgetoTetandPyramid(
bool bQuality =
true);
141 void ConvertPyramidtoTet(
bool bQuality =
true);
148 void ConvertWedgetoTet(
bool bQuality =
true);
154 void ConvertHextoTet(
bool bQuality =
true);
157 void ConvertPyramidto2D();
160 void Convert3Dto2D();
163 void ConvertToSurfaceMesh();
167 void ConvertToTetMesh();
171 void ConvertToTriangleMesh();
174 void ConvertToSegmentMesh();
181 void ConvertTriToQuad(
double Tolerance = 1e-6 );
188 pair<XYZ, XYZ> GetAABB(
double dGrowDistance = 0)
const;
195 int MergeNodes(
const double Tolerance = 1e-8);
198 int RemoveUnreferencedNodes();
201 void RemoveAllElementsExcept(ELEMENT_TYPE Type);
204 void RemoveElementType( ELEMENT_TYPE Type );
207 int DeleteNodes(
const set<int> &Nodes);
210 void ChangeNodeIndices(
int iChangeTo,
int iChangeFrom);
219 void ChangeNodeIndices(
int iChangeTo,
int iChangeFrom, vector<vector<int*> > &References);
222 void RemoveOpposingTriangles();
225 void RemoveOpposingQuads();
228 void RemoveDegenerateTriangles();
231 void RemoveDuplicateTriangles();
234 void RemoveDuplicateSegments();
246 void GetNodeElementReferences(vector<vector<int*> > &References);
254 int InsertNodes(
const CMesh &Mesh,
XYZ Offset =
XYZ(0, 0, 0));
261 void InsertMesh(
const CMesh &Mesh,
XYZ Offset =
XYZ(0, 0, 0));
264 void Rotate(
WXYZ Rotation,
XYZ Origin =
XYZ(0,0,0));
267 void Translate(
XYZ Vector);
279 void MeshClosedLoop(
const XYZ &Normal,
const vector<int> &ClosedLoopVector,
bool bQuality =
false);
289 void MeshConvexHull();
295 void CopySelfToRange(
XYZ Vector,
int iLowerLimit,
int iUpperLimit);
304 int OutputNodes(ostream &Output,
int iStartIndex = 1,
string Seperator =
", ",
bool bSCIRun =
false)
const;
315 int OutputElements(ostream &Output, ELEMENT_TYPE ElementType,
int iStartIndex = 1,
int iIndexOffset = 1,
string Seperator =
", ",
bool bSCIRun =
false)
const;
325 double CalculateVolume()
const;
328 vector<XYZ> GetElementCenters()
const;
331 vector<XYZ> GetElementCenters( ELEMENT_TYPE type );
337 int CountInvertedElements()
const;
343 int CountInvertedElements(ELEMENT_TYPE ElementType)
const;
360 int IntersectLine(
const XYZ &P1,
const XYZ &P2, vector< pair<double, XYZ> > &IntersectionPoints, pair<bool, bool> TrimResults = make_pair(
false,
false),
bool bForceFind =
false)
const;
371 void BuildGrid(
XYZ Min,
XYZ Max,
int iNumX,
int iNumY,
int iNumZ);
380 void BuildGrid(
XYZ Min,
XYZ Max,
double dPointsPerUnit);
388 vector<pair<int, int> > GetNodePairs(
XYZ Vector,
const double Tolerance = 1e-6)
const;
389 void GetNodePairs(
XYZ Vector, vector<pair<int, int> > &NodePairs,
const double Tolerance = 1e-6)
const;
396 int GetClosestNode(
XYZ Position)
const;
404 int GetClosestNodeDistance(
XYZ Position,
double dTol )
const;
411 void ConvertElementListToVector( ELEMENT_TYPE ElementType, vector<int> &Indices );
423 bool SaveToSTL(
string Filename,
bool bBinary =
true)
const;
430 bool SaveToVTK(
string Filename,
const vector<CMeshDataBase*> *pMeshData =
NULL)
const;
446 bool SaveToABAQUS(
string Filename,
const vector<POINT_INFO> *pElementInfo =
NULL,
bool bCreateStep =
true,
bool bCreateMaterial =
true,
int iElementType = 0);
449 bool SaveToSMESH(
string Filename)
const;
455 bool SaveToSCIRun(
string Filename);
464 bool AddElement(ELEMENT_TYPE Type,
const vector<int> &Indices);
467 int GetNumElements(ELEMENT_TYPE Type)
const;
470 int GetNumElements()
const;
472 vector<XYZ>::const_iterator NodesBegin()
const;
473 vector<XYZ>::const_iterator NodesEnd()
const;
474 vector<XYZ>::iterator NodesBegin();
475 vector<XYZ>::iterator NodesEnd();
478 const int AddNode(
XYZ Node);
480 void SetNode(
int iIndex,
XYZ Node);
482 const XYZ& GetNode(
int iIndex)
const;
484 vector<XYZ>::iterator DeleteNode(vector<XYZ>::iterator it);
486 int GetNumNodes()
const;
488 const bool NodesEmpty()
const;
490 const vector<XYZ>& GetNodes()
const;
491 vector<XYZ>& GetNodes();
493 void SetNumNodes(
int NumNodes);
496 const list<int>& GetIndices(ELEMENT_TYPE ElemType)
const;
497 list<int>& GetIndices(ELEMENT_TYPE ElemType);
505 static void AddOrCancel(list<pair<int, int> > &EdgeStack, pair<int, int> Edge);
507 static void WriteBinaryXYZ(ostream &Output,
XYZ Vector);
509 int FillVTKPointData(TiXmlElement &Points)
const;
510 int FillVTKCellData(TiXmlElement &Cells)
const;
515 list<int> m_Indices[NUM_ELEMENT_TYPES];
Defines the nodes and elements of a surface or volume mesh.
static int GetNumNodes(ELEMENT_TYPE Type)
Get the number of nodes a particular element type contains.
ELEMENT_TYPE
Each element type is represented by a unique integer value.
vector< XYZ > m_Nodes
List of nodes.
Namespace containing a series of customised math operations not found in the standard c++ library.
double Max(XYZ &Vector)
Get maximum element of vector and return it.
XYZ Min(const XYZ &P1, const XYZ &P2)
Given two points, return a new point who's coordinates are the smaller of the two.
Struct for representing a quaternion.
Struct for representing points in 3D space.