Mesh::MeshObject Class Reference

The MeshObject class provides an interface for the underlying MeshKernel class and most of its algorithm on it. More...

#include <Mesh.h>

Inheritance diagram for Mesh::MeshObject:
Data::ComplexGeoData Base::Persistence Base::Handled Base::BaseClass

List of all members.

Classes

class  const_facet_iterator
class  const_point_iterator

Public Types

typedef std::pair
< Base::Vector3f,
Base::Vector3f
TPlane
typedef std::list< std::vector
< Base::Vector3f > > 
TPolylines
enum  Type { PLANE, CYLINDER, SPHERE }

Public Member Functions

virtual Base::BoundBox3d getBoundBox (void) const
 Get the bound box.
const MeshCore::MeshKernelgetKernel (void) const
MeshCore::MeshKernelgetKernel (void)
Base::Matrix4D getTransform (void) const
 Return the current matrix This method has to be handled by the child classes.
virtual Base::Type getTypeId (void) const
 MeshObject (const MeshObject &)
 MeshObject (const MeshCore::MeshKernel &Kernel, const Base::Matrix4D &Mtrx)
 MeshObject (const MeshCore::MeshKernel &Kernel)
 MeshObject ()
void operator= (const MeshObject &)
void setKernel (const MeshCore::MeshKernel &m)
void setTransform (const Base::Matrix4D &rclTrf)
 Override the current transformation with the new one.
void swap (MeshObject &mesh)
void swap (MeshCore::MeshKernel &Kernel)
 Swaps the content of Kernel and the internal mesh kernel.
void transformGeometry (const Base::Matrix4D &rclMat)
 Applies a transformation on the real geometric data type.
 ~MeshObject ()
Manipulation



void addFacet (const MeshCore::MeshGeomFacet &facet)
void addFacets (const std::vector< Data::ComplexGeoData::Facet > &facets, const std::vector< Base::Vector3d > &points)
void addFacets (const std::vector< MeshCore::MeshFacet > &facets, const std::vector< Base::Vector3f > &points)
void addFacets (const std::vector< MeshCore::MeshFacet > &facets)
void addFacets (const std::vector< MeshCore::MeshGeomFacet > &facets)
void addMesh (const MeshCore::MeshKernel &)
 Combines two independent mesh objects.
void addMesh (const MeshObject &)
 Combines two independent mesh objects.
void clear (void)
 clears the Mesh
unsigned long countComponents () const
void crossSections (const std::vector< TPlane > &, std::vector< TPolylines > &sections, float fMinEps=1.0e-2f, bool bConnectPolygons=false) const
void deleteFacets (const std::vector< unsigned long > &removeIndices)
void deletePoints (const std::vector< unsigned long > &removeIndices)
void fillupHoles (unsigned long, int, MeshCore::AbstractPolygonTriangulator &)
std::vector< std::vector
< unsigned long > > 
getComponents () const
Base::Vector3d getPointNormal (unsigned long) const
void movePoint (unsigned long, const Base::Vector3d &v)
void offset (float fSize)
void offsetSpecial (float fSize, float zmax, float zmin)
void offsetSpecial2 (float fSize)
void removeComponents (unsigned long)
void setFacets (const std::vector< Data::ComplexGeoData::Facet > &facets, const std::vector< Base::Vector3d > &points)
void setFacets (const std::vector< MeshCore::MeshGeomFacet > &facets)
void setPoint (unsigned long, const Base::Vector3d &v)
void smooth (int iterations, float d_max)
void transformToEigenSystem ()
Selection



void addFacetsToSelection (const std::vector< unsigned long > &) const
void addPointsToSelection (const std::vector< unsigned long > &) const
void clearFacetSelection () const
void clearPointSelection () const
void deleteSelectedFacets ()
void deleteSelectedPoints ()
void getFacetsFromSelection (std::vector< unsigned long > &) const
void getPointsFromSelection (std::vector< unsigned long > &) const
void removeFacetsFromSelection (const std::vector< unsigned long > &) const
void removePointsFromSelection (const std::vector< unsigned long > &) const
Mesh segments



void addSegment (const std::vector< unsigned long > &)
void addSegment (const Segment &)
SegmentgetSegment (unsigned long)
const SegmentgetSegment (unsigned long) const
std::vector< SegmentgetSegmentsFromType (Type, const Segment &aSegment, float dev) const
MeshObjectmeshFromSegment (const std::vector< unsigned long > &) const
Topological operations



void collapseEdge (unsigned long, unsigned long)
void collapseFacet (unsigned long)
void collapseFacets (const std::vector< unsigned long > &)
void insertVertex (unsigned long, const Base::Vector3f &v)
void optimizeEdges ()
void optimizeTopology (float)
void refine ()
void snapVertex (unsigned long, const Base::Vector3f &v)
void splitEdge (unsigned long, unsigned long, const Base::Vector3f &)
void splitEdges ()
void splitFacet (unsigned long, const Base::Vector3f &, const Base::Vector3f &)
void swapEdge (unsigned long, unsigned long)
Querying



unsigned long countEdges () const
unsigned long countFacets () const
unsigned long countPoints () const
unsigned long countSegments () const
void getFaces (std::vector< Base::Vector3d > &Points, std::vector< Facet > &Topo, float Accuracy, uint16_t flags=0) const
 Get faces from object with given accuracy.
Mesh::Facet getFacet (unsigned long) const
MeshPoint getPoint (unsigned long) const
double getSurface () const
double getVolume () const
bool isSolid () const
std::string representation () const
std::string topologyInfo () const
Mesh validation



unsigned long countNonUniformOrientedFacets () const
void flipNormals ()
void harmonizeNormals ()
bool hasNonManifolds () const
bool hasSelfIntersections () const
void removeDuplicatedFacets ()
void removeDuplicatedPoints ()
void removeFoldsOnSurface ()
void removeFullBoundaryFacets ()
void removeNonManifolds ()
void removeSelfIntersections (const std::vector< unsigned long > &)
void removeSelfIntersections ()
void validateDeformations (float fMaxAngle)
void validateDegenerations ()
void validateIndices ()
Subelement management



virtual unsigned long countSubElements (const char *Type) const
virtual std::vector< const char * > getElementTypes (void) const
 Sub type list List of different subelement types its NOT a list of the subelements itself.
virtual void getFacesFromSubelement (const Data::Segment *, std::vector< Base::Vector3d > &Points, std::vector< Base::Vector3d > &PointNormals, std::vector< Facet > &faces) const
 Get faces from segment.
virtual Data::SegmentgetSubElement (const char *Type, unsigned long) const
 get the subelement by type and number
I/O



unsigned int getMemSize (void) const
 This method is used to get the size of objects It is not meant to have the exact size, it is more or less an estimation which runs fast! Is it two bytes or a GB?
void load (std::istream &)
bool load (const char *file)
void Restore (Base::XMLReader &reader)
 This method is used to restore properties from an XML document.
void RestoreDocFile (Base::Reader &reader)
 This method is used to restore large amounts of data from a file In this method you simply stream in your with SaveDocFile() saved data.
void save (std::ostream &) const
void save (const char *file, MeshCore::MeshIO::Format f=MeshCore::MeshIO::Undefined, const MeshCore::Material *mat=0) const
void Save (Base::Writer &writer) const
 This method is used to save properties to an XML document.
void SaveDocFile (Base::Writer &writer) const
 This method is used to save large amounts of data to a binary file.
Boolean operations



MeshObjectinner (const MeshObject &) const
MeshObjectintersect (const MeshObject &) const
MeshObjectouter (const MeshObject &) const
MeshObjectsubtract (const MeshObject &) const
MeshObjectunite (const MeshObject &) const

Static Public Member Functions

static void * create (void)
static Base::Type getClassTypeId (void)
static void init (void)
Primitives



static MeshObjectcreateCone (float, float, float, int, float, int)
static MeshObjectcreateCube (float, float, float, float)
static MeshObjectcreateCube (float, float, float)
static MeshObjectcreateCylinder (float, float, int, float, int)
static MeshObjectcreateEllipsoid (float, float, int)
static MeshObjectcreateMeshFromList (Py::List &list)
static MeshObjectcreateSphere (float, int)
static MeshObjectcreateTorus (float, float, int)

Friends

class Segment

Iterator



typedef std::vector< Segment >
::const_iterator 
const_segment_iterator
const_facet_iterator facets_begin () const
const_facet_iterator facets_end () const
const_point_iterator points_begin () const
const_point_iterator points_end () const
const_segment_iterator segments_begin () const
const_segment_iterator segments_end () const

Detailed Description

The MeshObject class provides an interface for the underlying MeshKernel class and most of its algorithm on it.

Note:
Each instance of MeshObject has its own instance of a MeshKernel so it's not possible that several instances of MeshObject manage one instance of MeshKernel.

Definition at line 64 of file Mesh.h.


Member Typedef Documentation

typedef std::vector<Segment>::const_iterator Mesh::MeshObject::const_segment_iterator

Definition at line 330 of file Mesh.h.

Definition at line 72 of file Mesh.h.

typedef std::list<std::vector<Base::Vector3f> > Mesh::MeshObject::TPolylines

Definition at line 73 of file Mesh.h.


Member Enumeration Documentation

Enumerator:
PLANE 
CYLINDER 
SPHERE 

Definition at line 69 of file Mesh.h.


Constructor & Destructor Documentation

MeshObject::MeshObject (  ) 

Definition at line 58 of file Mesh.cpp.

Referenced by inner(), intersect(), meshFromSegment(), outer(), subtract(), and unite().

MeshObject::MeshObject ( const MeshCore::MeshKernel Kernel  )  [explicit]

Definition at line 62 of file Mesh.cpp.

MeshObject::MeshObject ( const MeshCore::MeshKernel Kernel,
const Base::Matrix4D Mtrx 
) [explicit]

Definition at line 68 of file Mesh.cpp.

MeshObject::MeshObject ( const MeshObject mesh  ) 

Definition at line 74 of file Mesh.cpp.

MeshObject::~MeshObject (  ) 

Definition at line 81 of file Mesh.cpp.


Member Function Documentation

void MeshObject::addFacet ( const MeshCore::MeshGeomFacet facet  ) 

Definition at line 397 of file Mesh.cpp.

References MeshCore::MeshKernel::AddFacet().

Referenced by Mesh::MeshPy::addFacet().

void MeshObject::addFacets ( const std::vector< Data::ComplexGeoData::Facet > &  facets,
const std::vector< Base::Vector3d > &  points 
)
void MeshObject::addFacets ( const std::vector< MeshCore::MeshFacet > &  facets,
const std::vector< Base::Vector3f > &  points 
)

Definition at line 412 of file Mesh.cpp.

References MeshCore::MeshKernel::AddFacets().

void MeshObject::addFacets ( const std::vector< MeshCore::MeshFacet > &  facets  ) 

Definition at line 407 of file Mesh.cpp.

References MeshCore::MeshKernel::AddFacets().

void MeshObject::addFacets ( const std::vector< MeshCore::MeshGeomFacet > &  facets  ) 

Definition at line 402 of file Mesh.cpp.

References MeshCore::MeshKernel::AddFacets().

Referenced by Mesh::MeshPy::addFacets().

void MeshObject::addFacetsToSelection ( const std::vector< unsigned long > &  inds  )  const
void MeshObject::addMesh ( const MeshCore::MeshKernel kernel  ) 

Combines two independent mesh objects.

Note:
The mesh object we want to add must not overlap or intersect with this mesh object.

Definition at line 474 of file Mesh.cpp.

References MeshCore::MeshKernel::Merge().

void MeshObject::addMesh ( const MeshObject mesh  ) 

Combines two independent mesh objects.

Note:
The mesh object we want to add must not overlap or intersect with this mesh object.

Definition at line 469 of file Mesh.cpp.

References MeshCore::MeshKernel::Merge().

Referenced by Mesh::MeshPy::addMesh(), and exporter().

void MeshObject::addPointsToSelection ( const std::vector< unsigned long > &  inds  )  const

Definition at line 560 of file Mesh.cpp.

References MeshCore::MeshPoint::SELECTED.

void MeshObject::addSegment ( const std::vector< unsigned long > &  inds  ) 

Definition at line 1354 of file Mesh.cpp.

References MeshCore::MeshKernel::CountFacets(), and Segment.

void MeshObject::addSegment ( const Segment s  ) 

Definition at line 1349 of file Mesh.cpp.

References Mesh::Segment::getIndices().

void MeshObject::clear ( void   ) 

clears the Mesh

Definition at line 726 of file Mesh.cpp.

References MeshCore::MeshKernel::Clear(), and setTransform().

Referenced by Mesh::GTSAlgos::boolean(), and Mesh::MeshPy::clear().

void MeshObject::clearFacetSelection (  )  const
void MeshObject::clearPointSelection (  )  const

Definition at line 550 of file Mesh.cpp.

References MeshCore::MeshPoint::SELECTED.

void MeshObject::collapseEdge ( unsigned long  facet,
unsigned long  neighbour 
)

Definition at line 936 of file Mesh.cpp.

References MeshCore::MeshTopoAlgorithm::CollapseEdge().

Referenced by Mesh::MeshPy::collapseEdge().

void MeshObject::collapseFacet ( unsigned long  facet  ) 

Definition at line 947 of file Mesh.cpp.

References MeshCore::MeshTopoAlgorithm::CollapseFacet().

Referenced by Mesh::MeshPy::collapseFacet().

void MeshObject::collapseFacets ( const std::vector< unsigned long > &  facets  ) 

Definition at line 957 of file Mesh.cpp.

References MeshCore::MeshTopoAlgorithm::CollapseFacet().

Referenced by Mesh::MeshPy::collapseFacets().

unsigned long MeshObject::countComponents (  )  const
unsigned long MeshObject::countEdges (  )  const

Definition at line 213 of file Mesh.cpp.

References MeshCore::MeshKernel::CountEdges().

unsigned long MeshObject::countFacets (  )  const
unsigned long MeshObject::countNonUniformOrientedFacets (  )  const
unsigned long MeshObject::countPoints (  )  const
unsigned long MeshObject::countSegments (  )  const
unsigned long MeshObject::countSubElements ( const char *  Type  )  const [virtual]

Implements Data::ComplexGeoData.

Definition at line 94 of file Mesh.cpp.

References countSegments().

void * Mesh::MeshObject::create ( void   )  [static]

Reimplemented from Data::ComplexGeoData.

Definition at line 56 of file Mesh.cpp.

MeshObject * MeshObject::createCone ( float  radius1,
float  radius2,
float  len,
int  closed,
float  edgelen,
int  sampling 
) [static]
MeshObject * MeshObject::createCube ( float  length,
float  width,
float  height,
float  edgelen 
) [static]
MeshObject * MeshObject::createCube ( float  length,
float  width,
float  height 
) [static]
MeshObject * MeshObject::createCylinder ( float  radius,
float  length,
int  closed,
float  edgelen,
int  sampling 
) [static]
MeshObject * MeshObject::createEllipsoid ( float  radius1,
float  radius2,
int  sampling 
) [static]
MeshObject * MeshObject::createMeshFromList ( Py::List list  )  [static]
MeshObject * MeshObject::createSphere ( float  radius,
int  sampling 
) [static]
MeshObject * MeshObject::createTorus ( float  radius1,
float  radius2,
int  sampling 
) [static]
void MeshObject::crossSections ( const std::vector< TPlane > &  planes,
std::vector< TPolylines > &  sections,
float  fMinEps = 1.0e-2f,
bool  bConnectPolygons = false 
) const

Definition at line 775 of file Mesh.cpp.

References MeshCore::MeshAlgorithm::CutWithPlane().

Referenced by Mesh::MeshPy::crossSections().

void MeshObject::deleteFacets ( const std::vector< unsigned long > &  removeIndices  ) 
void MeshObject::deletePoints ( const std::vector< unsigned long > &  removeIndices  ) 

Definition at line 485 of file Mesh.cpp.

References MeshCore::MeshKernel::DeletePoints().

Referenced by deleteSelectedPoints().

void MeshObject::deleteSelectedFacets (  ) 

Definition at line 531 of file Mesh.cpp.

References deleteFacets(), and MeshCore::MeshFacet::SELECTED.

void MeshObject::deleteSelectedPoints (  ) 

Definition at line 538 of file Mesh.cpp.

References deletePoints(), and MeshCore::MeshPoint::SELECTED.

const_facet_iterator Mesh::MeshObject::facets_begin (  )  const [inline]

Definition at line 325 of file Mesh.h.

Referenced by Mesh::MeshPy::getFacets().

const_facet_iterator Mesh::MeshObject::facets_end (  )  const [inline]

Definition at line 327 of file Mesh.h.

Referenced by Mesh::MeshPy::getFacets().

void MeshObject::fillupHoles ( unsigned long  length,
int  level,
MeshCore::AbstractPolygonTriangulator cTria 
)
void MeshObject::flipNormals (  ) 
Base::BoundBox3d MeshObject::getBoundBox ( void   )  const [virtual]
Base::Type Mesh::MeshObject::getClassTypeId ( void   )  [static]

Reimplemented from Data::ComplexGeoData.

Definition at line 56 of file Mesh.cpp.

std::vector< std::vector< unsigned long > > MeshObject::getComponents (  )  const
std::vector< const char * > MeshObject::getElementTypes ( void   )  const [virtual]

Sub type list List of different subelement types its NOT a list of the subelements itself.

Implements Data::ComplexGeoData.

Definition at line 85 of file Mesh.cpp.

void MeshObject::getFaces ( std::vector< Base::Vector3d > &  Points,
std::vector< Facet > &  faces,
float  Accuracy,
uint16_t  flags = 0 
) const [virtual]
void MeshObject::getFacesFromSubelement ( const Data::Segment segm,
std::vector< Base::Vector3d > &  Points,
std::vector< Base::Vector3d > &  PointNormals,
std::vector< Facet > &  faces 
) const [virtual]

Get faces from segment.

Reimplemented from Data::ComplexGeoData.

Definition at line 115 of file Mesh.cpp.

References SketcherExample::f, and getFaces().

Mesh::Facet MeshObject::getFacet ( unsigned long  index  )  const

Definition at line 248 of file Mesh.cpp.

References MeshCore::MeshKernel::GetFacets().

void MeshObject::getFacetsFromSelection ( std::vector< unsigned long > &  inds  )  const
const MeshCore::MeshKernel& Mesh::MeshObject::getKernel ( void   )  const [inline]

Definition at line 131 of file Mesh.h.

MeshCore::MeshKernel& Mesh::MeshObject::getKernel ( void   )  [inline]

Definition at line 129 of file Mesh.h.

Referenced by CmdApproxSurface::activated(), CmdMeshSmoothing::activated(), CmdMeshEvaluateSolid::activated(), CmdMeshFromGeometry::activated(), best_fit_complete(), Mesh::GTSAlgos::coarsen(), Mesh::MeshPy::collapseEdge(), MeshGui::SoFCMeshObjectBoundary::computeBBox(), MeshGui::SoFCMeshSegmentShape::computeBBox(), MeshGui::SoFCMeshObjectShape::computeBBox(), MeshGui::SoFCMeshOpenEdge::computeBBox(), MeshGui::SoFCMeshNode::computeBBox(), Mesh::MeshPy::copy(), Mesh::GTSAlgos::createGTSSurface(), MeshGui::ViewProviderMesh::deselectComponent(), Mesh::SetOperations::execute(), Mesh::SegmentByMesh::execute(), Mesh::Curvature::execute(), Mesh::GTSAlgos::fillMeshFromGTSSurface(), fit_iter(), MeshGui::SoFCMeshObjectBoundary::generatePrimitives(), MeshGui::SoFCMeshSegmentShape::generatePrimitives(), MeshGui::SoFCMeshObjectShape::generatePrimitives(), MeshGui::SoFCMeshNode::generatePrimitives(), MeshGui::SoFCMeshObjectBoundary::getPrimitiveCount(), MeshGui::SoFCMeshOpenEdge::getPrimitiveCount(), Inspection::InspectNominalFastMesh::InspectNominalFastMesh(), Inspection::InspectNominalMesh::InspectNominalMesh(), MeshGui::RemoveComponents::invertSelection(), MeshGui::SoFCMeshPickNode::notify(), offset_mesh(), MeshGui::DlgEvaluateMeshImp::on_analyzeDegeneratedButton_clicked(), MeshGui::DlgEvaluateMeshImp::on_analyzeDuplicatedFacesButton_clicked(), MeshGui::DlgEvaluateMeshImp::on_analyzeDuplicatedPointsButton_clicked(), MeshGui::DlgEvaluateMeshImp::on_analyzeFoldsButton_clicked(), MeshGui::DlgEvaluateMeshImp::on_analyzeIndicesButton_clicked(), MeshGui::DlgEvaluateMeshImp::on_analyzeNonmanifoldsButton_clicked(), MeshGui::DlgEvaluateMeshImp::on_analyzeOrientationButton_clicked(), MeshGui::DlgEvaluateMeshImp::on_analyzeSelfIntersectionButton_clicked(), MeshGui::RemoveComponents::on_deselectComponents_clicked(), MeshGui::DlgEvaluateMeshImp::on_repairAllTogether_clicked(), MeshGui::RemoveComponents::on_selectComponents_clicked(), MeshGui::SoFCMeshPickNode::pick(), Mesh::MeshPy::rotate(), MeshGui::ViewProviderMesh::selectComponent(), MeshGui::ViewProviderMeshFolds::showDefects(), MeshGui::ViewProviderMeshSelfIntersections::showDefects(), MeshGui::ViewProviderMeshIndices::showDefects(), MeshGui::ViewProviderMeshDegenerations::showDefects(), MeshGui::ViewProviderMeshDuplicatedPoints::showDefects(), MeshGui::ViewProviderMeshDuplicatedFaces::showDefects(), MeshGui::ViewProviderMeshNonManifolds::showDefects(), MeshGui::ViewProviderMeshOrientation::showDefects(), MeshGui::DlgEvaluateMeshImp::showInformation(), Mesh::MeshPy::splitEdge(), Mesh::MeshPy::splitFacet(), spring_back(), Mesh::MeshPy::swapEdge(), Mesh::MeshPy::transform(), Mesh::MeshPy::translate(), useMesh(), wireFromSegment(), MeshGui::SoFCMeshNode::write(), and Mesh::MeshPy::writeInventor().

unsigned int MeshObject::getMemSize ( void   )  const [virtual]

This method is used to get the size of objects It is not meant to have the exact size, it is more or less an estimation which runs fast! Is it two bytes or a GB?

Implements Base::Persistence.

Definition at line 275 of file Mesh.cpp.

References MeshCore::MeshKernel::GetMemSize().

MeshPoint MeshObject::getPoint ( unsigned long  index  )  const
Base::Vector3d MeshObject::getPointNormal ( unsigned long  index  )  const
void MeshObject::getPointsFromSelection ( std::vector< unsigned long > &  inds  )  const

Definition at line 580 of file Mesh.cpp.

References MeshCore::MeshPoint::SELECTED.

Referenced by Mesh::MeshPy::getPointSelection().

Segment & MeshObject::getSegment ( unsigned long  index  ) 

Definition at line 1370 of file Mesh.cpp.

const Segment & MeshObject::getSegment ( unsigned long  index  )  const
std::vector< Segment > MeshObject::getSegmentsFromType ( MeshObject::Type  type,
const Segment aSegment,
float  dev 
) const
Data::Segment * MeshObject::getSubElement ( const char *  Type,
unsigned long  n 
) const [virtual]

get the subelement by type and number

Implements Data::ComplexGeoData.

Definition at line 104 of file Mesh.cpp.

double MeshObject::getSurface (  )  const

Definition at line 229 of file Mesh.cpp.

References MeshCore::MeshKernel::GetSurface().

Base::Matrix4D MeshObject::getTransform ( void   )  const [virtual]

Return the current matrix This method has to be handled by the child classes.

the actual placement and matrix is not part of this class.

Implements Data::ComplexGeoData.

Definition at line 137 of file Mesh.cpp.

Referenced by Mesh::Segment::const_facet_iterator::const_facet_iterator(), Mesh::GTSAlgos::createGTSSurface(), Inspection::InspectActualMesh::InspectActualMesh(), Inspection::InspectNominalFastMesh::InspectNominalFastMesh(), Inspection::InspectNominalMesh::InspectNominalMesh(), and Mesh::Feature::onChanged().

Base::Type Mesh::MeshObject::getTypeId ( void   )  const [virtual]

Reimplemented from Data::ComplexGeoData.

Definition at line 56 of file Mesh.cpp.

double MeshObject::getVolume (  )  const

Definition at line 234 of file Mesh.cpp.

References MeshCore::MeshKernel::GetVolume().

void MeshObject::harmonizeNormals (  ) 
bool MeshObject::hasNonManifolds (  )  const

Definition at line 998 of file Mesh.cpp.

References MeshCore::MeshEvalTopology::Evaluate().

Referenced by Mesh::MeshPy::hasNonManifolds().

bool MeshObject::hasSelfIntersections (  )  const
void Mesh::MeshObject::init ( void   )  [static]

Reimplemented from Data::ComplexGeoData.

Definition at line 56 of file Mesh.cpp.

Referenced by initMesh().

MeshObject * MeshObject::inner ( const MeshObject mesh  )  const
void MeshObject::insertVertex ( unsigned long  facet,
const Base::Vector3f v 
)

Definition at line 967 of file Mesh.cpp.

References MeshCore::MeshTopoAlgorithm::InsertVertex().

Referenced by Mesh::MeshPy::insertVertex().

MeshObject * MeshObject::intersect ( const MeshObject mesh  )  const
bool MeshObject::isSolid (  )  const

Definition at line 223 of file Mesh.cpp.

References MeshCore::MeshEvalSolid::Evaluate().

Referenced by Mesh::MeshPy::isSolid().

void MeshObject::load ( std::istream &  in  ) 
bool MeshObject::load ( const char *  file  ) 
MeshObject * MeshObject::meshFromSegment ( const std::vector< unsigned long > &  indices  )  const
void MeshObject::movePoint ( unsigned long  index,
const Base::Vector3d v 
)
void MeshObject::offset ( float  fSize  ) 
void MeshObject::offsetSpecial ( float  fSize,
float  zmax,
float  zmin 
)
void MeshObject::offsetSpecial2 ( float  fSize  ) 
void MeshObject::operator= ( const MeshObject mesh  ) 

Reimplemented from Base::Handled.

Definition at line 154 of file Mesh.cpp.

References setTransform().

void MeshObject::optimizeEdges (  ) 
void MeshObject::optimizeTopology ( float  fMaxAngle  ) 
MeshObject * MeshObject::outer ( const MeshObject mesh  )  const
const_point_iterator Mesh::MeshObject::points_begin (  )  const [inline]

Definition at line 320 of file Mesh.h.

Referenced by Mesh::MeshPy::getPoints(), and Mesh::MeshPy::writeInventor().

const_point_iterator Mesh::MeshObject::points_end (  )  const [inline]

Definition at line 322 of file Mesh.h.

Referenced by Mesh::MeshPy::getPoints(), and Mesh::MeshPy::writeInventor().

void MeshObject::refine (  ) 
void MeshObject::removeComponents ( unsigned long  count  ) 
void MeshObject::removeDuplicatedFacets (  ) 
void MeshObject::removeDuplicatedPoints (  ) 
void MeshObject::removeFacetsFromSelection ( const std::vector< unsigned long > &  inds  )  const
void MeshObject::removeFoldsOnSurface (  ) 
void MeshObject::removeFullBoundaryFacets (  ) 

Definition at line 1091 of file Mesh.cpp.

References deleteFacets().

void MeshObject::removeNonManifolds (  ) 
void MeshObject::removePointsFromSelection ( const std::vector< unsigned long > &  inds  )  const

Definition at line 570 of file Mesh.cpp.

References MeshCore::MeshPoint::SELECTED.

void MeshObject::removeSelfIntersections ( const std::vector< unsigned long > &  indices  ) 
void MeshObject::removeSelfIntersections (  ) 
std::string MeshObject::representation ( void   )  const

Definition at line 187 of file Mesh.cpp.

References MeshCore::MeshInfo::GeneralInformation().

Referenced by Mesh::MeshPy::representation().

void MeshObject::Restore ( Base::XMLReader  )  [virtual]

This method is used to restore properties from an XML document.

It uses the XMLReader class, which bases on SAX, to read the in Save() written information. Again the Vector as an example:

 void PropertyVector::Restore(Base::XMLReader &reader)
 {
   // read my Element
   reader.readElement("PropertyVector");
   // get the value of my Attribute
   _cVec.x = (float)reader.getAttributeAsFloat("valueX");
   _cVec.y = (float)reader.getAttributeAsFloat("valueY");
   _cVec.z = (float)reader.getAttributeAsFloat("valueZ");
 }

Implements Base::Persistence.

Definition at line 290 of file Mesh.cpp.

void MeshObject::RestoreDocFile ( Base::Reader  )  [virtual]

This method is used to restore large amounts of data from a file In this method you simply stream in your with SaveDocFile() saved data.

Again you have to apply for the call of this method in the Restore() call:

 void PropertyMeshKernel::Restore(Base::XMLReader &reader)
 {
   reader.readElement("Mesh");
   std::string file (reader.getAttribute("file") );
 
   if(file == "")
   {
     // read XML
     MeshCore::MeshDocXML restorer(*_pcMesh);
     restorer.Restore(reader);
   }else{
     // initate a file read
     reader.addFile(file.c_str(),this);
  }
 }

After you issued the reader.addFile() your RestoreDocFile() is called:

 void PropertyMeshKernel::RestoreDocFile(Base::Reader &reader)
 {
     _pcMesh->Read( reader );
 }
See also:
Base::Reader,Base::XMLReader

Reimplemented from Base::Persistence.

Definition at line 295 of file Mesh.cpp.

References load().

void MeshObject::save ( std::ostream &  out  )  const

Definition at line 308 of file Mesh.cpp.

References MeshCore::MeshKernel::Write().

void MeshObject::save ( const char *  file,
MeshCore::MeshIO::Format  f = MeshCore::MeshIO::Undefined,
const MeshCore::Material mat = 0 
) const
void MeshObject::Save ( Base::Writer  )  const [virtual]

This method is used to save properties to an XML document.

A good example you'll find in PropertyStandard.cpp, e.g. the vector:

  void PropertyVector::Save (Writer &writer) const
  {
     writer << writer.ind() << "<PropertyVector valueX=\"" <<  _cVec.x <<
                                            "\" valueY=\"" <<  _cVec.y <<
                                            "\" valueZ=\"" <<  _cVec.z <<"\"/>" << endl;
  }

The writer.ind() expression writes the indention, just for pretty printing of the XML. As you see, the writing of the XML document is not done with a DOM implementation because of performance reasons. Therefore the programmer has to take care that a valid XML document is written. This means closing tags and writing UTF-8.

See also:
Base::Writer

Implements Base::Persistence.

Definition at line 280 of file Mesh.cpp.

void MeshObject::SaveDocFile ( Base::Writer  )  const [virtual]

This method is used to save large amounts of data to a binary file.

Sometimes it makes no sense to write property data as XML. In case the amount of data is too big or the data type has a more effective way to save itself. In this cases it is possible to write the data in a seperate file inside the document archive. In case you want do so you have to re-implement SaveDocFile(). First, you have to inform the framework in Save() that you want do so. Here an example from the Mesh module which can save a (pontetionaly big) triangle mesh:

 void PropertyMeshKernel::Save (Base::Writer &writer) const
 {
   if (writer.isForceXML())
   {
     writer << writer.ind() << "<Mesh>" << std::endl;
     MeshCore::MeshDocXML saver(*_pcMesh);
     saver.Save(writer);
   }else{
    writer << writer.ind() << "<Mesh file=\"" << writer.addFile("MeshKernel.bms", this) << "\"/>" << std::endl;
 }

The writer.isForceXML() is an indication to force you to write XML. Regardless of size and effectivness. The second part informs the Base::writer through writer.addFile("MeshKernel.bms", this) that this object wants to write a file with the given name. The method addFile() returns a unique name that then is written in the XML stream. This allows your RestoreDocFile() method to identify and read the file again. Later your SaveDocFile() method is called as many times as you issued the addFile() call:

 void PropertyMeshKernel::SaveDocFile (Base::Writer &writer) const
 {
     _pcMesh->Write( writer );
 }

In this method you can simply stream your content to the file (Base::Writer inheriting from ostream).

Reimplemented from Base::Persistence.

Definition at line 285 of file Mesh.cpp.

References Base::Writer::Stream(), and MeshCore::MeshKernel::Write().

const_segment_iterator Mesh::MeshObject::segments_begin (  )  const [inline]

Definition at line 331 of file Mesh.h.

const_segment_iterator Mesh::MeshObject::segments_end (  )  const [inline]

Definition at line 333 of file Mesh.h.

void MeshObject::setFacets ( const std::vector< Data::ComplexGeoData::Facet > &  facets,
const std::vector< Base::Vector3d > &  points 
)
void MeshObject::setFacets ( const std::vector< MeshCore::MeshGeomFacet > &  facets  ) 

Definition at line 441 of file Mesh.cpp.

Referenced by CmdMeshFromGeometry::activated().

void MeshObject::setKernel ( const MeshCore::MeshKernel m  ) 

Definition at line 164 of file Mesh.cpp.

Referenced by MeshTestJob::run().

void MeshObject::setPoint ( unsigned long  index,
const Base::Vector3d v 
)
void MeshObject::setTransform ( const Base::Matrix4D rclTrf  )  [virtual]

Override the current transformation with the new one.

This method has to be handled by the child classes. the actual placement and matrix is not part of this class.

Implements Data::ComplexGeoData.

Definition at line 132 of file Mesh.cpp.

Referenced by clear(), Mesh::Feature::onChanged(), operator=(), and transformToEigenSystem().

void MeshObject::smooth ( int  iterations,
float  d_max 
)

Definition at line 756 of file Mesh.cpp.

References MeshCore::MeshKernel::Smooth().

Referenced by Mesh::MeshPy::smooth().

void MeshObject::snapVertex ( unsigned long  facet,
const Base::Vector3f v 
)

Definition at line 973 of file Mesh.cpp.

References MeshCore::MeshTopoAlgorithm::SnapVertex().

Referenced by Mesh::MeshPy::snapVertex().

void MeshObject::splitEdge ( unsigned long  facet,
unsigned long  neighbour,
const Base::Vector3f v 
)

Definition at line 918 of file Mesh.cpp.

References MeshCore::MeshTopoAlgorithm::SplitEdge().

Referenced by Mesh::MeshPy::splitEdge().

void MeshObject::splitEdges (  ) 
void MeshObject::splitFacet ( unsigned long  facet,
const Base::Vector3f v1,
const Base::Vector3f v2 
)

Definition at line 924 of file Mesh.cpp.

References MeshCore::MeshTopoAlgorithm::SplitFacet().

Referenced by Mesh::MeshPy::splitFacet().

MeshObject * MeshObject::subtract ( const MeshObject mesh  )  const
void MeshObject::swap ( MeshObject mesh  ) 

Definition at line 178 of file Mesh.cpp.

References MeshCore::MeshKernel::Swap().

void MeshObject::swap ( MeshCore::MeshKernel Kernel  ) 

Swaps the content of Kernel and the internal mesh kernel.

Definition at line 170 of file Mesh.cpp.

References MeshCore::MeshKernel::Swap().

Referenced by MeshPart::Mesher::createMesh(), MeshTestJob::run(), and transformGeometry().

void MeshObject::swapEdge ( unsigned long  facet,
unsigned long  neighbour 
)

Definition at line 930 of file Mesh.cpp.

References MeshCore::MeshTopoAlgorithm::SwapEdge().

Referenced by Mesh::MeshPy::swapEdge().

std::string MeshObject::topologyInfo (  )  const

Definition at line 195 of file Mesh.cpp.

References MeshCore::MeshInfo::TopologyInformation().

void MeshObject::transformGeometry ( const Base::Matrix4D rclMat  )  [virtual]

Applies a transformation on the real geometric data type.

Implements Data::ComplexGeoData.

Definition at line 124 of file Mesh.cpp.

References swap(), and MeshCore::MeshKernel::Transform().

void MeshObject::transformToEigenSystem (  ) 
MeshObject * MeshObject::unite ( const MeshObject mesh  )  const
void MeshObject::validateDeformations ( float  fMaxAngle  ) 
void MeshObject::validateDegenerations (  ) 
void MeshObject::validateIndices (  ) 

Friends And Related Function Documentation

friend class Segment [friend]

Definition at line 338 of file Mesh.h.

Referenced by addSegment(), getSegmentsFromType(), and load().


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

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