MeshCore::MeshBuilder Class Reference

Class for creating the mesh structure by adding facets. More...

#include <Builder.h>

List of all members.

Public Member Functions

void AddFacet (Base::Vector3f *facetPoints, unsigned char flag=0, unsigned long prop=0)
 Add new facet.
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.
void AddFacet (const MeshGeomFacet &facet, bool takeFlag=false, bool takeProperty=false)
 adding facets
void Finish (bool freeMemory=false)
 Finishes building up the mesh structure.
void Initialize (unsigned long ctFacets, bool deletion=true)
 Initializes the class.
 MeshBuilder (MeshKernel &rclM)
void SetTolerance (float)
 Set the tolerance for the comparison of points.
 ~MeshBuilder (void)

Friends

class MeshKernel

Detailed Description

Class for creating the mesh structure by adding facets.

Building the structure needs 3 steps: 1. initializing 2. adding the facets 3. finishing

 // Sample Code for building a mesh structure
 MeshBuilder builder(someMeshReference);
 builder.Initialize(numberOfFacets);
 ...
 for (...)
   builder.AddFacet(...);
 ...
 builder.Finish();
Author:
Berthold Grupp

Definition at line 59 of file Builder.h.


Constructor & Destructor Documentation

MeshBuilder::MeshBuilder ( MeshKernel rclM  ) 

Definition at line 39 of file Builder.cpp.

References MeshCore::MeshDefinitions::_fMinPointDistanceD1.

MeshBuilder::~MeshBuilder ( void   ) 

Definition at line 44 of file Builder.cpp.

References MeshCore::MeshDefinitions::_fMinPointDistanceD1.


Member Function Documentation

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 

Definition at line 116 of file Builder.cpp.

References MeshCore::MeshKernel::_aclFacetArray, MeshCore::MeshFacet::_aulPoints, MeshCore::MeshFacet::_ucFlag, MeshCore::MeshPoint::_ulProp, MeshCore::MeshFacet::_ulProp, SketcherExample::f, Base::SequencerLauncher::next(), draftTools::p, and boost::numeric::bindings::atlas::swap().

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.

Definition at line 110 of file Builder.cpp.

References AddFacet().

void MeshBuilder::AddFacet ( const MeshGeomFacet facet,
bool  takeFlag = false,
bool  takeProperty = false 
)
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.

Definition at line 214 of file Builder.cpp.

References MeshCore::MeshKernel::_aclFacetArray, MeshCore::MeshKernel::_aclPointArray, Mesh2Shape::faces, MeshCore::MeshKernel::RecalcBoundBox(), and boost::numeric::bindings::atlas::swap().

Referenced by best_fit_test(), MeshCore::MeshInput::LoadAsciiSTL(), MeshCore::MeshInput::LoadBinarySTL(), MeshCore::MeshKernel::operator=(), SpringbackCorrection::Perform(), ReadDyna::PutInMesh(), best_fit::Tesselate_Face(), best_fit::Tesselate_Shape(), tesselateShape(), and SpringbackCorrection::TransferFaceTriangulationtoFreeCAD().

void MeshBuilder::Initialize ( unsigned long  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.

Definition at line 55 of file Builder.cpp.

References MeshCore::MeshKernel::_aclFacetArray, MeshCore::MeshKernel::_aclPointArray, MeshCore::MeshKernel::Clear(), and SketcherExample::f.

Referenced by best_fit_test(), MeshCore::MeshInput::LoadAsciiSTL(), MeshCore::MeshInput::LoadBinarySTL(), MeshCore::MeshKernel::operator=(), SpringbackCorrection::Perform(), ReadDyna::PutInMesh(), best_fit::Tesselate_Face(), best_fit::Tesselate_Shape(), tesselateShape(), and SpringbackCorrection::TransferFaceTriangulationtoFreeCAD().

void MeshBuilder::SetTolerance ( float  fTol  ) 

Set the tolerance for the comparison of points.

Normally you don't need to set the tolerance.

Definition at line 50 of file Builder.cpp.

References MeshCore::MeshDefinitions::_fMinPointDistanceD1.


Friends And Related Function Documentation

friend class MeshKernel [friend]

Definition at line 161 of file Builder.h.


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