MeshCore::MeshBuilder Class Reference
Class for creating the mesh structure by adding facets. More...
#include <Builder.h>
Helper class | |
class | MeshKernel |
MeshBuilder (MeshKernel &rclM) | |
~MeshBuilder (void) | |
void | SetTolerance (float) |
Set the tolerance for the comparison of points. More... | |
void | Initialize (size_t ctFacets, bool deletion=true) |
Initializes the class. More... | |
void | AddFacet (const MeshGeomFacet &facet, bool takeFlag=false, bool takeProperty=false) |
adding facets More... | |
void | AddFacet (const Base::Vector3f &pt1, const Base::Vector3f &pt2, const Base::Vector3f &pt3, const Base::Vector3f &normal, unsigned char flag=0, unsigned long prop=0) |
Add new facet. More... | |
void | AddFacet (Base::Vector3f *facetPoints, unsigned char flag=0, unsigned long prop=0) |
Add new facet. More... | |
void | Finish (bool freeMemory=false) |
Finishes building up the mesh structure. More... | |
Detailed Description
Class for creating the mesh structure by adding facets.
Building the structure needs 3 steps:
- initializing
- adding the facets
- finishing // Sample Code for building a mesh structureMeshBuilder builder(someMeshReference);builder.Initialize(numberOfFacets);...for (...)builder.AddFacet(...);...builder.Finish();
Constructor & Destructor Documentation
◆ MeshBuilder()
MeshBuilder::MeshBuilder | ( | MeshKernel & | rclM | ) |
◆ ~MeshBuilder()
MeshBuilder::~MeshBuilder | ( | void | ) |
Member Function Documentation
◆ AddFacet() [1/3]
void MeshBuilder::AddFacet | ( | Base::Vector3f * | facetPoints, |
unsigned char | flag = 0 , |
||
unsigned long | prop = 0 |
||
) |
Add new facet.
- Parameters
-
facetPoints Array of vectors (size 4) in order of vec1, vec2, vec3, normal flag prop
◆ AddFacet() [2/3]
void MeshBuilder::AddFacet | ( | const Base::Vector3f & | pt1, |
const Base::Vector3f & | pt2, | ||
const Base::Vector3f & | pt3, | ||
const Base::Vector3f & | normal, | ||
unsigned char | flag = 0 , |
||
unsigned long | prop = 0 |
||
) |
Add new facet.
References AddFacet().
◆ AddFacet() [3/3]
void MeshBuilder::AddFacet | ( | const MeshGeomFacet & | facet, |
bool | takeFlag = false , |
||
bool | takeProperty = false |
||
) |
adding facets
Add new facet
- Parameters
-
facet the facet takeFlag if true the flag from the MeshGeomFacet will be taken takeProperty
References MeshCore::MeshGeomFacet::GetNormal().
Referenced by AddFacet(), and MeshCore::MeshKernel::operator=().
◆ Finish()
void MeshBuilder::Finish | ( | bool | freeMemory = false | ) |
Finishes building up the mesh structure.
Must be done after adding facets.
- Parameters
-
freeMemory if false (default) only the memory of internal structures gets freed, otherwise additional unneeded memory in the mesh structure is tried to be freed.
- Remarks
- If you have called AddFacet() as many times as specified in Initialize() then absolutely no memory is wasted and you can leave the default value.
Referenced by MeshCore::MeshKernel::operator=().
◆ Initialize()
void MeshBuilder::Initialize | ( | size_t | ctFacets, |
bool | deletion = true |
||
) |
Initializes the class.
Must be done before adding facets
- Parameters
-
ctFacets count of facets. deletion if true (default) the mesh-kernel will be cleared otherwise you can add new facets on an existing mesh-kernel
- Remarks
- To be efficient you should add exactly ctFacets with AddFacet(), otherwise you'll possibly run into wastage of memory and performance problems.
Referenced by MeshCore::MeshKernel::operator=().
◆ SetTolerance()
void MeshBuilder::SetTolerance | ( | float | fTol | ) |
Set the tolerance for the comparison of points.
Normally you don't need to set the tolerance.
Friends And Related Function Documentation
◆ MeshKernel
|
friend |
The documentation for this class was generated from the following files:
- src/Mod/Mesh/App/Core/Builder.h
- src/Mod/Mesh/App/Core/Builder.cpp