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>

Classes

class  const_facet_iterator
 
class  const_point_iterator
 

Public Types

typedef std::pair< Base::Vector3f, Base::Vector3fTPlane
 
typedef std::list< std::vector< Base::Vector3f > > TPolylines
 

Public Member Functions

virtual Base::BoundBox3d getBoundBox (void) const
 Get the bound box. More...
 
MeshCore::MeshKernelgetKernel (void)
 
const MeshCore::MeshKernelgetKernel (void) const
 
Base::Matrix4D getTransform (void) const
 Return the current matrix This method has to be handled by the child classes. More...
 
 MeshObject ()
 
 MeshObject (const MeshCore::MeshKernel &Kernel)
 
 MeshObject (const MeshCore::MeshKernel &Kernel, const Base::Matrix4D &Mtrx)
 
 MeshObject (const 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. More...
 
void swap (MeshCore::MeshKernel &Kernel)
 Swaps the content of Kernel and the internal mesh kernel. More...
 
void swap (MeshObject &mesh)
 
void transformGeometry (const Base::Matrix4D &rclMat)
 Applies a transformation on the real geometric data type. More...
 
virtual ~MeshObject ()
 
Subelement management
virtual std::vector< const char * > getElementTypes (void) const
 Sub type list List of different subelement types its NOT a list of the subelements itself. More...
 
virtual unsigned long countSubElements (const char *Type) const
 
virtual Data::SegmentgetSubElement (const char *Type, unsigned long) const
 get the subelement by type and number More...
 
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. More...
 
Querying
std::string representation () const
 
std::string topologyInfo () const
 
unsigned long countPoints () const
 
unsigned long countFacets () const
 
unsigned long countEdges () const
 
unsigned long countSegments () const
 
bool isSolid () const
 
MeshPoint getPoint (unsigned long) const
 
Mesh::Facet getFacet (unsigned long) const
 
double getSurface () const
 
double getVolume () const
 
virtual void getPoints (std::vector< Base::Vector3d > &Points, std::vector< Base::Vector3d > &Normals, float Accuracy, uint16_t flags=0) const
 Get points from object with given accuracy. More...
 
virtual 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. More...
 
std::vector< unsigned long > getPointsFromFacets (const std::vector< unsigned long > &facets) const
 
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? More...
 
void Save (Base::Writer &writer) const
 This method is used to save properties to an XML document. More...
 
void SaveDocFile (Base::Writer &writer) const
 This method is used to save large amounts of data to a binary file. More...
 
void Restore (Base::XMLReader &reader)
 This method is used to restore properties from an XML document. More...
 
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. More...
 
void save (const char *file, MeshCore::MeshIO::Format f=MeshCore::MeshIO::Undefined, const MeshCore::Material *mat=0, const char *objectname=0) const
 
void save (std::ostream &, MeshCore::MeshIO::Format f, const MeshCore::Material *mat=0, const char *objectname=0) const
 
bool load (const char *file, MeshCore::Material *mat=0)
 
bool load (std::istream &, MeshCore::MeshIO::Format f, MeshCore::Material *mat=0)
 
void save (std::ostream &) const
 
void load (std::istream &)
 
Manipulation
void addFacet (const MeshCore::MeshGeomFacet &facet)
 
void addFacets (const std::vector< MeshCore::MeshGeomFacet > &facets)
 
void addFacets (const std::vector< MeshCore::MeshFacet > &facets)
 
void addFacets (const std::vector< MeshCore::MeshFacet > &facets, const std::vector< Base::Vector3f > &points)
 
void addFacets (const std::vector< Data::ComplexGeoData::Facet > &facets, const std::vector< Base::Vector3d > &points)
 
void setFacets (const std::vector< MeshCore::MeshGeomFacet > &facets)
 
void setFacets (const std::vector< Data::ComplexGeoData::Facet > &facets, const std::vector< Base::Vector3d > &points)
 
void addMesh (const MeshObject &)
 Combines two independent mesh objects. More...
 
void addMesh (const MeshCore::MeshKernel &)
 Combines two independent mesh objects. More...
 
void deleteFacets (const std::vector< unsigned long > &removeIndices)
 
void deletePoints (const std::vector< unsigned long > &removeIndices)
 
std::vector< std::vector< unsigned long > > getComponents () const
 
unsigned long countComponents () const
 
void removeComponents (unsigned long)
 
unsigned long getPointDegree (const std::vector< unsigned long > &facets, std::vector< unsigned long > &point_degree) const
 Checks for the given facet indices what will be the degree for each point when these facets are removed from the mesh kernel. More...
 
void fillupHoles (unsigned long, int, MeshCore::AbstractPolygonTriangulator &)
 
void offset (float fSize)
 
void offsetSpecial2 (float fSize)
 
void offsetSpecial (float fSize, float zmax, float zmin)
 
void clear (void)
 clears the Mesh More...
 
void transformToEigenSystem ()
 
Base::Matrix4D getEigenSystem (Base::Vector3d &v) const
 
void movePoint (unsigned long, const Base::Vector3d &v)
 
void setPoint (unsigned long, const Base::Vector3d &v)
 
void smooth (int iterations, float d_max)
 
Base::Vector3d getPointNormal (unsigned long) const
 
std::vector< Base::Vector3dgetPointNormals () const
 
void crossSections (const std::vector< TPlane > &, std::vector< TPolylines > &sections, float fMinEps=1.0e-2f, bool bConnectPolygons=false) const
 
void cut (const Base::Polygon2d &polygon, const Base::ViewProjMethod &proj, CutType)
 
void trim (const Base::Polygon2d &polygon, const Base::ViewProjMethod &proj, CutType)
 
Selection
void deleteSelectedFacets ()
 
void deleteSelectedPoints ()
 
void addFacetsToSelection (const std::vector< unsigned long > &) const
 
void addPointsToSelection (const std::vector< unsigned long > &) const
 
void removeFacetsFromSelection (const std::vector< unsigned long > &) const
 
void removePointsFromSelection (const std::vector< unsigned long > &) const
 
unsigned long countSelectedFacets () const
 
bool hasSelectedFacets () const
 
unsigned long countSelectedPoints () const
 
bool hasSelectedPoints () const
 
void getFacetsFromSelection (std::vector< unsigned long > &) const
 
void getPointsFromSelection (std::vector< unsigned long > &) const
 
void clearFacetSelection () const
 
void clearPointSelection () const
 
Boolean operations
MeshObjectunite (const MeshObject &) const
 
MeshObjectintersect (const MeshObject &) const
 
MeshObjectsubtract (const MeshObject &) const
 
MeshObjectinner (const MeshObject &) const
 
MeshObjectouter (const MeshObject &) const
 
Topological operations
void refine ()
 
void optimizeTopology (float)
 
void optimizeEdges ()
 
void splitEdges ()
 
void splitEdge (unsigned long, unsigned long, const Base::Vector3f &)
 
void splitFacet (unsigned long, const Base::Vector3f &, const Base::Vector3f &)
 
void swapEdge (unsigned long, unsigned long)
 
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 snapVertex (unsigned long, const Base::Vector3f &v)
 
Mesh validation
unsigned long countNonUniformOrientedFacets () const
 
void flipNormals ()
 
void harmonizeNormals ()
 
void validateIndices ()
 
void validateDeformations (float fMaxAngle, float fEps)
 
void validateDegenerations (float fEps)
 
void removeDuplicatedPoints ()
 
void removeDuplicatedFacets ()
 
bool hasNonManifolds () const
 
void removeNonManifolds ()
 
void removeNonManifoldPoints ()
 
bool hasSelfIntersections () const
 
void removeSelfIntersections ()
 
void removeSelfIntersections (const std::vector< unsigned long > &)
 
void removeFoldsOnSurface ()
 
void removeFullBoundaryFacets ()
 
bool hasInvalidPoints () const
 
void removeInvalidPoints ()
 
Mesh segments
void addSegment (const Segment &)
 
void addSegment (const std::vector< unsigned long > &)
 
const SegmentgetSegment (unsigned long) const
 
SegmentgetSegment (unsigned long)
 
MeshObjectmeshFromSegment (const std::vector< unsigned long > &) const
 
std::vector< SegmentgetSegmentsFromType (GeometryType, float dev, unsigned long minFacets) const
 
- Public Member Functions inherited from Data::ComplexGeoData
 ComplexGeoData (void)
 Constructor. More...
 
virtual ~ComplexGeoData ()
 Destructor. More...
 
virtual SegmentgetSubElementByName (const char *Name) const
 get subelement by combined name More...
 
virtual void getLinesFromSubelement (const Segment *, std::vector< Base::Vector3d > &Points, std::vector< Line > &lines) const
 Get lines from segment. More...
 
void applyTransform (const Base::Matrix4D &rclTrf)
 Applies an additional transformation to the current transformation. More...
 
void applyTranslation (const Base::Vector3d &)
 Applies an additional translation to the current transformation. More...
 
void applyRotation (const Base::Rotation &)
 Applies an additional rotation to the current transformation. More...
 
void setPlacement (const Base::Placement &rclPlacement)
 Override the current transformation with a placement using the setTransform() method. More...
 
Base::Placement getPlacement () const
 Return the current transformation as placement using getTransform(). More...
 
virtual Base::Vector3d getPointFromLineIntersection (const Base::Vector3f &base, const Base::Vector3f &dir) const
 Get point from line object intersection. More...
 
virtual void getLines (std::vector< Base::Vector3d > &Points, std::vector< Line > &lines, float Accuracy, uint16_t flags=0) const
 Get lines from object with given accuracy. More...
 
- Public Member Functions inherited from Base::Persistence
virtual Base::Type getTypeId (void) const
 
- Public Member Functions inherited from Base::BaseClass
 BaseClass ()
 Construction. More...
 
virtual PyObjectgetPyObject (void)
 This method returns the Python wrapper for a C++ object. More...
 
bool isDerivedFrom (const Type type) const
 
virtual void setPyObject (PyObject *)
 
virtual ~BaseClass ()
 Destruction. More...
 
- Public Member Functions inherited from Base::Handled
int getRefCount (void) const
 
 Handled ()
 
const Handledoperator= (const Handled &)
 
void ref () const
 
void unref () const
 
virtual ~Handled ()
 

Static Public Member Functions

Primitives
static MeshObjectcreateMeshFromList (Py::List &list)
 
static MeshObjectcreateSphere (float, int)
 
static MeshObjectcreateEllipsoid (float, float, int)
 
static MeshObjectcreateCylinder (float, float, int, float, int)
 
static MeshObjectcreateCone (float, float, float, int, float, int)
 
static MeshObjectcreateTorus (float, float, int)
 
static MeshObjectcreateCube (float, float, float)
 
static MeshObjectcreateCube (float, float, float, float)
 
- Static Public Member Functions inherited from Base::Persistence
static void * create (void)
 
static Base::Type getClassTypeId (void)
 
static void init (void)
 
- Static Public Member Functions inherited from Base::BaseClass
static void * create (void)
 
static Type getClassTypeId (void)
 
static void init (void)
 

Friends

class Segment
 

Iterator

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

Additional Inherited Members

- Protected Member Functions inherited from Data::ComplexGeoData
Base::Vector3f transformToInside (const Base::Vector3d &vec) const
 from local to inside More...
 
Base::Vector3d transformToOutside (const Base::Vector3f &vec) const
 from local to outside More...
 
- Static Protected Member Functions inherited from Base::BaseClass
static void initSubclass (Base::Type &toInit, const char *ClassName, const char *ParentName, Type::instantiationMethod method=0)
 

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.

Member Typedef Documentation

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

Member Enumeration Documentation

Enumerator
INNER 
OUTER 
Enumerator
PLANE 
CYLINDER 
SPHERE 

Constructor & Destructor Documentation

MeshObject::MeshObject ( )
MeshObject::MeshObject ( const MeshCore::MeshKernel Kernel)
explicit
MeshObject::MeshObject ( const MeshCore::MeshKernel Kernel,
const Base::Matrix4D Mtrx 
)
explicit
MeshObject::MeshObject ( const MeshObject mesh)
MeshObject::~MeshObject ( )
virtual

Member Function Documentation

void MeshObject::addFacet ( const MeshCore::MeshGeomFacet facet)
void MeshObject::addFacets ( const std::vector< MeshCore::MeshFacet > &  facets)
void MeshObject::addFacets ( const std::vector< MeshCore::MeshFacet > &  facets,
const std::vector< Base::Vector3f > &  points 
)
void MeshObject::addFacets ( const std::vector< Data::ComplexGeoData::Facet > &  facets,
const std::vector< Base::Vector3d > &  points 
)
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.

Referenced by Param::Param(), and Mesh::Module::~Module().

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.
void MeshObject::addPointsToSelection ( const std::vector< unsigned long > &  inds) const
void MeshObject::addSegment ( const std::vector< unsigned long > &  inds)
void MeshObject::clear ( void  )

clears the Mesh

References setTransform().

void MeshObject::clearPointSelection ( ) const
void MeshObject::collapseEdge ( unsigned long  facet,
unsigned long  neighbour 
)
void MeshObject::collapseFacet ( unsigned long  facet)
void MeshObject::collapseFacets ( const std::vector< unsigned long > &  facets)
unsigned long MeshObject::countComponents ( ) const
unsigned long MeshObject::countEdges ( ) const
unsigned long MeshObject::countNonUniformOrientedFacets ( ) const
unsigned long MeshObject::countSelectedFacets ( ) const
unsigned long MeshObject::countSelectedPoints ( ) const
unsigned long MeshObject::countSubElements ( const char *  Type) const
virtual

Implements Data::ComplexGeoData.

References countSegments().

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 
)
static
MeshObject * MeshObject::createCube ( float  length,
float  width,
float  height,
float  edgelen 
)
static

References createMeshFromList().

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::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
void MeshObject::cut ( const Base::Polygon2d polygon,
const Base::ViewProjMethod proj,
MeshObject::CutType  type 
)
void MeshObject::deleteFacets ( const std::vector< unsigned long > &  removeIndices)
void MeshObject::deletePoints ( const std::vector< unsigned long > &  removeIndices)
void MeshObject::deleteSelectedFacets ( )
void MeshObject::deleteSelectedPoints ( )
const_facet_iterator Mesh::MeshObject::facets_begin ( ) const
inline

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

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

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

void MeshObject::fillupHoles ( unsigned long  length,
int  level,
MeshCore::AbstractPolygonTriangulator cTria 
)
void MeshObject::flipNormals ( )
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.

void MeshObject::getFaces ( std::vector< Base::Vector3d > &  Points,
std::vector< Facet > &  faces,
float  Accuracy,
uint16_t  flags = 0 
) const
virtual

Get faces from object with given accuracy.

Reimplemented from Data::ComplexGeoData.

References getPoint(), Data::ComplexGeoData::Facet::I1, Data::ComplexGeoData::Facet::I2, and Data::ComplexGeoData::Facet::I3.

Referenced by getFacesFromSubelement().

void MeshObject::getFacesFromSubelement ( const Data::Segment ,
std::vector< Base::Vector3d > &  Points,
std::vector< Base::Vector3d > &  PointNormals,
std::vector< Facet > &  faces 
) const
virtual

Get faces from segment.

Reimplemented from Data::ComplexGeoData.

References getFaces().

Mesh::Facet MeshObject::getFacet ( unsigned long  index) const
MeshCore::MeshKernel& Mesh::MeshObject::getKernel ( void  )
inline

Referenced by MeshGui::Segmentation::accept(), MeshGui::TaskSmoothing::accept(), MeshGui::SoFCMeshObjectShape::computeBBox(), MeshGui::SoFCMeshSegmentShape::computeBBox(), MeshGui::SoFCMeshObjectBoundary::computeBBox(), Mesh::GTSAlgos::createGTSSurface(), MeshGui::ViewProviderMeshBuilder::createMesh(), createMeshFromList(), MeshGui::MeshSelection::deleteSelection(), MeshGui::MeshSelection::deleteSelectionBorder(), MeshGui::MeshSelection::deselectComponent(), MeshGui::ViewProviderMesh::deselectComponent(), MeshGui::SoFCMeshObjectShape::doAction(), Mesh::Sphere::execute(), Mesh::Curvature::execute(), Mesh::SetOperations::execute(), Mesh::SegmentByMesh::execute(), Mesh::Ellipsoid::execute(), Mesh::Cylinder::execute(), Mesh::Cone::execute(), Mesh::Torus::execute(), Mesh::Cube::execute(), MeshGui::ViewProviderMesh::faceInfo(), MeshGui::ViewProviderMesh::fillHole(), Mesh::GTSAlgos::fillMeshFromGTSSurface(), MeshGui::MeshFaceAddition::finishEditing(), MeshGui::MeshFillHole::finishEditing(), MeshGui::SoFCMeshObjectShape::generatePrimitives(), MeshGui::SoFCMeshSegmentShape::generatePrimitives(), MeshGui::SoFCMeshObjectBoundary::generatePrimitives(), MeshGui::ViewProviderMesh::getFacetsFromPolygon(), MeshGui::SoFCMeshObjectBoundary::getPrimitiveCount(), MeshGui::SoFCMeshObjectShape::GLRender(), MeshGui::SoFCMeshSegmentShape::GLRender(), MeshGui::SoFCMeshObjectBoundary::GLRender(), MeshGui::ViewProviderMeshNode::handleEvent(), Inspection::InspectNominalFastMesh::InspectNominalFastMesh(), Inspection::InspectNominalMesh::InspectNominalMesh(), MeshGui::MeshSelection::invertSelection(), MeshGui::ViewProviderMesh::invertSelection(), MeshGui::ViewProviderMesh::isFacetSelected(), MeshGui::SoFCMeshPickNode::notify(), 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::DlgEvaluateMeshImp::on_repairAllTogether_clicked(), Param::Param(), MeshGui::SoFCMeshPickNode::pick(), MeshGui::ViewProviderMesh::segmentMesh(), MeshGui::MeshSelection::selectComponent(), MeshGui::ViewProviderMesh::selectComponent(), MeshGui::MeshSelection::setRemoveComponentOnClick(), MeshGui::PropertyMeshKernelItem::setValue(), MeshGui::ViewProviderMeshOrientation::showDefects(), MeshGui::ViewProviderMeshNonManifolds::showDefects(), MeshGui::ViewProviderMeshNonManifoldPoints::showDefects(), MeshGui::ViewProviderMeshDuplicatedFaces::showDefects(), MeshGui::ViewProviderMeshDegenerations::showDefects(), MeshGui::ViewProviderMeshDuplicatedPoints::showDefects(), MeshGui::ViewProviderMeshIndices::showDefects(), MeshGui::ViewProviderMeshSelfIntersections::showDefects(), MeshGui::ViewProviderMeshFolds::showDefects(), MeshGui::DlgEvaluateMeshImp::showInformation(), MeshGui::ViewProviderMesh::splitMesh(), MeshGui::PropertyMeshKernelItem::value(), Mesh::MeshPy::writeInventor(), MeshPart::Module::~Module(), and Mesh::Module::~Module().

const MeshCore::MeshKernel& Mesh::MeshObject::getKernel ( void  ) const
inline
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.

MeshPoint MeshObject::getPoint ( unsigned long  index) const

Referenced by getFaces().

unsigned long MeshObject::getPointDegree ( const std::vector< unsigned long > &  facets,
std::vector< unsigned long > &  point_degree 
) const

Checks for the given facet indices what will be the degree for each point when these facets are removed from the mesh kernel.

The point degree information is stored in point_degree. The return value gives the number of points which will have a degree of zero.

Referenced by MeshGui::ViewProviderMesh::removeFacets().

void MeshObject::getPoints ( std::vector< Base::Vector3d > &  Points,
std::vector< Base::Vector3d > &  Normals,
float  Accuracy,
uint16_t  flags = 0 
) const
virtual

Get points from object with given accuracy.

Reimplemented from Data::ComplexGeoData.

void MeshObject::getPointsFromSelection ( std::vector< unsigned long > &  inds) const
Segment & MeshObject::getSegment ( unsigned long  index)
std::vector< Segment > MeshObject::getSegmentsFromType ( MeshObject::GeometryType  type,
float  dev,
unsigned long  minFacets 
) const
Data::Segment * MeshObject::getSubElement ( const char *  Type,
unsigned long   
) const
virtual

get the subelement by type and number

Implements Data::ComplexGeoData.

double MeshObject::getSurface ( ) const
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.

Referenced by Mesh::GTSAlgos::createGTSSurface(), Inspection::InspectActualMesh::InspectActualMesh(), Inspection::InspectNominalFastMesh::InspectNominalFastMesh(), Inspection::InspectNominalMesh::InspectNominalMesh(), and Mesh::Module::~Module().

double MeshObject::getVolume ( void  ) const
bool MeshObject::hasInvalidPoints ( ) const
bool MeshObject::hasNonManifolds ( ) const
bool MeshObject::hasSelectedPoints ( ) const

References countSelectedPoints().

bool MeshObject::hasSelfIntersections ( ) const
MeshObject * MeshObject::inner ( const MeshObject mesh) const
void MeshObject::insertVertex ( unsigned long  facet,
const Base::Vector3f v 
)
bool MeshObject::isSolid ( ) const
MeshObject * MeshObject::meshFromSegment ( const std::vector< unsigned long > &  indices) const
void MeshObject::offset ( float  fSize)
void MeshObject::offsetSpecial ( float  fSize,
float  zmax,
float  zmin 
)
void MeshObject::operator= ( const MeshObject mesh)

References setTransform().

void MeshObject::optimizeEdges ( )
void MeshObject::optimizeTopology ( float  fMaxAngle)
const_point_iterator Mesh::MeshObject::points_begin ( ) const
inline
const_point_iterator Mesh::MeshObject::points_end ( ) const
inline
void MeshObject::removeComponents ( unsigned long  count)
void MeshObject::removeFacetsFromSelection ( const std::vector< unsigned long > &  inds) const
void MeshObject::removeFullBoundaryFacets ( )

References deleteFacets().

void MeshObject::removeInvalidPoints ( )
void MeshObject::removePointsFromSelection ( const std::vector< unsigned long > &  inds) const
void MeshObject::removeSelfIntersections ( const std::vector< unsigned long > &  indices)
std::string MeshObject::representation ( void  ) const
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 = reader.getAttributeAsFloat("valueX");
_cVec.y = reader.getAttributeAsFloat("valueY");
_cVec.z = reader.getAttributeAsFloat("valueZ");
}

Implements Base::Persistence.

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:

{
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:

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

Reimplemented from Base::Persistence.

References load().

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 indentation, 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.

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:

{
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:

{
_pcMesh->Write( writer );
}

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

Reimplemented from Base::Persistence.

References Base::Writer::Stream().

const_segment_iterator Mesh::MeshObject::segments_begin ( ) const
inline
const_segment_iterator Mesh::MeshObject::segments_end ( ) const
inline
void MeshObject::setFacets ( const std::vector< MeshCore::MeshGeomFacet > &  facets)
void MeshObject::setFacets ( const std::vector< Data::ComplexGeoData::Facet > &  facets,
const std::vector< Base::Vector3d > &  points 
)
void MeshObject::setKernel ( const MeshCore::MeshKernel m)
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.

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

void MeshObject::smooth ( int  iterations,
float  d_max 
)
void MeshObject::snapVertex ( unsigned long  facet,
const Base::Vector3f v 
)
void MeshObject::splitEdge ( unsigned long  facet,
unsigned long  neighbour,
const Base::Vector3f v 
)
void MeshObject::splitFacet ( unsigned long  facet,
const Base::Vector3f v1,
const Base::Vector3f v2 
)
void MeshObject::swap ( MeshCore::MeshKernel Kernel)

Swaps the content of Kernel and the internal mesh kernel.

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

void MeshObject::swap ( MeshObject mesh)
void MeshObject::swapEdge ( unsigned long  facet,
unsigned long  neighbour 
)
std::string MeshObject::topologyInfo ( ) const
void MeshObject::transformGeometry ( const Base::Matrix4D rclMat)
virtual

Applies a transformation on the real geometric data type.

Implements Data::ComplexGeoData.

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

void MeshObject::transformToEigenSystem ( )
void MeshObject::validateDeformations ( float  fMaxAngle,
float  fEps 
)
void MeshObject::validateDegenerations ( float  fEps)

Friends And Related Function Documentation

friend class Segment
friend

The documentation for this class was generated from the following files:
  • src/src/Mod/Mesh/App/Mesh.h
  • src/src/Mod/Mesh/App/Mesh.cpp