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

enum  CutType { INNER , OUTER }
 
enum  GeometryType { PLANE , CYLINDER , SPHERE }
 
typedef std::pair< Base::Vector3f, Base::Vector3fTPlane
 
typedef std::list< std::vector< Base::Vector3f > > TPolylines
 

Public Member Functions

 MeshObject ()
 
 MeshObject (const MeshCore::MeshKernel &Kernel)
 
 MeshObject (const MeshCore::MeshKernel &Kernel, const Base::Matrix4D &Mtrx)
 
 MeshObject (const MeshObject &)
 
void operator= (const MeshObject &)
 
virtual ~MeshObject ()
 
Subelement management
virtual std::vector< const char * > getElementTypes () 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...
 
void setTransform (const Base::Matrix4D &rclTrf)
 Override the current transformation with the new one. More...
 
Base::Matrix4D getTransform () const
 Return the current matrix This method has to be handled by the child classes. More...
 
void transformGeometry (const Base::Matrix4D &rclMat)
 Applies a transformation on the real geometric data type. More...
 
void swap (MeshCore::MeshKernel &Kernel)
 Swaps the content of Kernel and the internal mesh kernel. More...
 
void swap (MeshObject &mesh)
 
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
 
Base::Vector3d getPoint (PointIndex) const
 
MeshPoint getMeshPoint (PointIndex) const
 
Mesh::Facet getMeshFacet (FacetIndex) 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< PointIndexgetPointsFromFacets (const std::vector< FacetIndex > &facets) const
 
void setKernel (const MeshCore::MeshKernel &m)
 
MeshCore::MeshKernelgetKernel ()
 
const MeshCore::MeshKernelgetKernel () const
 
virtual Base::BoundBox3d getBoundBox () const
 Get the bound box. More...
 
virtual bool getCenterOfGravity (Base::Vector3d &center) const
 Get the center of gravity If this method is implemented then true is returned and the center of gravity. More...
 
I/O
unsigned int getMemSize () 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 SaveDocFile() saved data. More...
 
void save (const char *file, MeshCore::MeshIO::Format f=MeshCore::MeshIO::Undefined, const MeshCore::Material *mat=nullptr, const char *objectname=nullptr) const
 
void save (std::ostream &, MeshCore::MeshIO::Format f, const MeshCore::Material *mat=nullptr, const char *objectname=nullptr) const
 
bool load (const char *file, MeshCore::Material *mat=nullptr)
 
bool load (std::istream &, MeshCore::MeshIO::Format f, MeshCore::Material *mat=nullptr)
 
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, bool checkManifolds)
 
void addFacets (const std::vector< MeshCore::MeshFacet > &facets, const std::vector< Base::Vector3f > &points, bool checkManifolds)
 
void addFacets (const std::vector< Data::ComplexGeoData::Facet > &facets, const std::vector< Base::Vector3d > &points, bool checkManifolds)
 
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< FacetIndex > &removeIndices)
 
void deletePoints (const std::vector< PointIndex > &removeIndices)
 
std::vector< std::vector< FacetIndex > > getComponents () const
 
unsigned long countComponents () const
 
void removeComponents (unsigned long)
 
unsigned long getPointDegree (const std::vector< FacetIndex > &facets, std::vector< PointIndex > &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 ()
 clears the Mesh More...
 
void transformToEigenSystem ()
 
Base::Matrix4D getEigenSystem (Base::Vector3d &v) const
 
void movePoint (PointIndex, const Base::Vector3d &v)
 
void setPoint (PointIndex, const Base::Vector3d &v)
 
void smooth (int iterations, float d_max)
 
void decimate (float fTolerance, float fReduction)
 
void decimate (int targetSize)
 
Base::Vector3d getPointNormal (PointIndex) 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)
 
void trimByPlane (const Base::Vector3f &base, const Base::Vector3f &normal)
 
Selection
void deleteSelectedFacets ()
 
void deleteSelectedPoints ()
 
void addFacetsToSelection (const std::vector< FacetIndex > &) const
 
void addPointsToSelection (const std::vector< PointIndex > &) const
 
void removeFacetsFromSelection (const std::vector< FacetIndex > &) const
 
void removePointsFromSelection (const std::vector< PointIndex > &) const
 
unsigned long countSelectedFacets () const
 
bool hasSelectedFacets () const
 
unsigned long countSelectedPoints () const
 
bool hasSelectedPoints () const
 
void getFacetsFromSelection (std::vector< FacetIndex > &) const
 
void getPointsFromSelection (std::vector< PointIndex > &) 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
 
std::vector< std::vector< Base::Vector3f > > section (const MeshObject &, bool connectLines, float fMinDist) const
 
Topological operations
void refine ()
 
void removeNeedles (float)
 
void optimizeTopology (float)
 
void optimizeEdges ()
 
void splitEdges ()
 
void splitEdge (FacetIndex, FacetIndex, const Base::Vector3f &)
 
void splitFacet (FacetIndex, const Base::Vector3f &, const Base::Vector3f &)
 
void swapEdge (FacetIndex, FacetIndex)
 
void collapseEdge (FacetIndex, FacetIndex)
 
void collapseFacet (FacetIndex)
 
void collapseFacets (const std::vector< FacetIndex > &)
 
void insertVertex (FacetIndex, const Base::Vector3f &v)
 
void snapVertex (FacetIndex, const Base::Vector3f &v)
 
Mesh validation
unsigned long countNonUniformOrientedFacets () const
 
void flipNormals ()
 
void harmonizeNormals ()
 
void validateIndices ()
 
void validateCaps (float fMaxAngle, float fSplitFactor)
 
void validateDeformations (float fMaxAngle, float fEps)
 
void validateDegenerations (float fEps)
 
void removeDuplicatedPoints ()
 
void removeDuplicatedFacets ()
 
bool hasNonManifolds () const
 
bool hasInvalidNeighbourhood () const
 
bool hasPointsOutOfRange () const
 
bool hasFacetsOutOfRange () const
 
bool hasCorruptedFacets () const
 
void removeNonManifolds ()
 
void removeNonManifoldPoints ()
 
bool hasSelfIntersections () const
 
void removeSelfIntersections ()
 
void removeSelfIntersections (const std::vector< FacetIndex > &)
 
void removeFoldsOnSurface ()
 
void removeFullBoundaryFacets ()
 
bool hasInvalidPoints () const
 
void removeInvalidPoints ()
 
void mergeFacets ()
 
bool hasPointsOnEdge () const
 
void removePointsOnEdge (bool fillBoundary)
 
Mesh segments
void addSegment (const Segment &)
 
void addSegment (const std::vector< FacetIndex > &)
 
const SegmentgetSegment (unsigned long) const
 
SegmentgetSegment (unsigned long)
 
MeshObjectmeshFromSegment (const std::vector< FacetIndex > &) const
 
std::vector< SegmentgetSegmentsOfType (GeometryType, float dev, unsigned long minFacets) const
 
- Public Member Functions inherited from Data::ComplexGeoData
 ComplexGeoData ()
 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
void dumpToStream (std::ostream &stream, int compression)
 
virtual unsigned int getMemSize () const =0
 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...
 
virtual Base::Type getTypeId (void) const
 
virtual void Restore (XMLReader &)=0
 This method is used to restore properties from an XML document. More...
 
virtual void RestoreDocFile (Reader &)
 This method is used to restore large amounts of data from a file In this method you simply stream in your SaveDocFile() saved data. More...
 
void restoreFromStream (std::istream &stream)
 
virtual void Save (Writer &) const =0
 This method is used to save properties to an XML document. More...
 
virtual void SaveDocFile (Writer &) const
 This method is used to save large amounts of data to a binary file. More...
 
- Public Member Functions inherited from Base::BaseClass
 BaseClass ()
 Construction. More...
 
 BaseClass (const BaseClass &)=default
 
virtual PyObjectgetPyObject ()
 This method returns the Python wrapper for a C++ object. More...
 
virtual Type getTypeId () const
 
bool isDerivedFrom (const Type type) const
 
BaseClassoperator= (const BaseClass &)=default
 
virtual void setPyObject (PyObject *)
 
virtual ~BaseClass ()
 Destruction. More...
 
- Public Member Functions inherited from Base::Handled
int getRefCount () 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 MeshObjectcreateCube (const Base::BoundBox3d &)
 
- Static Public Member Functions inherited from Data::ComplexGeoData
static const std::string & elementMapPrefix ()
 Special prefix to mark the beginning of a mapped sub-element name. More...
 
static const std::string & tagPostfix ()
 Special postfix to mark the following tag. More...
 
static const std::string & indexPostfix ()
 Special postfix to mark the index of an array element. More...
 
static const std::string & missingPrefix ()
 Special prefix to mark a missing element. More...
 
static bool hasMissingElement (const char *subname)
 Check if a subname contains missing element. More...
 
static const char * isMappedElement (const char *name)
 Check if the name starts with elementMapPrefix() More...
 
static std::string newElementName (const char *name)
 Strip out the trailing element name if there is mapped element name precedes it. More...
 
static std::string oldElementName (const char *name)
 Strip out the mapped element name if there is one. More...
 
static std::string noElementName (const char *name)
 Strip out the old and new element name if there is one. More...
 
static const char * findElementName (const char *subname)
 Find the start of an element name in a subname. More...
 
static const char * hasMappedElementName (const char *subname)
 
- Static Public Member Functions inherited from Base::Persistence
static void * create (void)
 
static std::string encodeAttribute (const std::string &)
 Encodes an attribute upon saving. More...
 
static Base::Type getClassTypeId (void)
 
static void init (void)
 
- Static Public Member Functions inherited from Base::BaseClass
static void * create ()
 
static Type getClassTypeId ()
 
static void init ()
 

Iterator

typedef std::vector< Segment >::const_iterator const_segment_iterator
 
class Segment
 
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

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

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

◆ const_segment_iterator

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

◆ TPlane

◆ TPolylines

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

Member Enumeration Documentation

◆ CutType

Enumerator
INNER 
OUTER 

◆ GeometryType

Enumerator
PLANE 
CYLINDER 
SPHERE 

Constructor & Destructor Documentation

◆ MeshObject() [1/4]

MeshObject::MeshObject ( )

◆ MeshObject() [2/4]

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

◆ MeshObject() [3/4]

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

◆ MeshObject() [4/4]

MeshObject::MeshObject ( const MeshObject mesh)

◆ ~MeshObject()

MeshObject::~MeshObject ( )
virtual

Member Function Documentation

◆ addFacet()

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

◆ addFacets() [1/4]

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

◆ addFacets() [2/4]

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

◆ addFacets() [3/4]

void MeshObject::addFacets ( const std::vector< MeshCore::MeshFacet > &  facets,
const std::vector< Base::Vector3f > &  points,
bool  checkManifolds 
)

◆ addFacets() [4/4]

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

◆ addFacetsToSelection()

◆ addMesh() [1/2]

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.

Referenced by PathScripts.PathCamoticsGui.CamoticsSimulation::worker().

◆ addMesh() [2/2]

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 Mesh::MergeExporter::addMesh(), and PathScripts.PathCamoticsGui.CamoticsSimulation::worker().

◆ addPointsToSelection()

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

◆ addSegment() [1/2]

◆ addSegment() [2/2]

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

◆ clear()

void MeshObject::clear ( )

clears the Mesh

References setTransform().

◆ clearFacetSelection()

◆ clearPointSelection()

void MeshObject::clearPointSelection ( ) const

◆ collapseEdge()

void MeshObject::collapseEdge ( FacetIndex  facet,
FacetIndex  neighbour 
)

◆ collapseFacet()

void MeshObject::collapseFacet ( FacetIndex  facet)

◆ collapseFacets()

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

◆ countComponents()

unsigned long MeshObject::countComponents ( ) const

◆ countEdges()

unsigned long MeshObject::countEdges ( ) const

◆ countFacets()

◆ countNonUniformOrientedFacets()

unsigned long MeshObject::countNonUniformOrientedFacets ( ) const

◆ countPoints()

◆ countSegments()

◆ countSelectedFacets()

unsigned long MeshObject::countSelectedFacets ( ) const

◆ countSelectedPoints()

unsigned long MeshObject::countSelectedPoints ( ) const

◆ countSubElements()

unsigned long MeshObject::countSubElements ( const char *  Type) const
virtual

Implements Data::ComplexGeoData.

References countSegments().

◆ createCone()

MeshObject * MeshObject::createCone ( float  radius1,
float  radius2,
float  len,
int  closed,
float  edgelen,
int  sampling 
)
static

References createMeshFromList().

Referenced by Mesh::Cone::execute().

◆ createCube() [1/3]

MeshObject * MeshObject::createCube ( const Base::BoundBox3d bbox)
static

◆ createCube() [2/3]

MeshObject * MeshObject::createCube ( float  length,
float  width,
float  height 
)
static

References createMeshFromList().

Referenced by Mesh::Cube::execute().

◆ createCube() [3/3]

MeshObject * MeshObject::createCube ( float  length,
float  width,
float  height,
float  edgelen 
)
static

References createMeshFromList().

◆ createCylinder()

MeshObject * MeshObject::createCylinder ( float  radius,
float  length,
int  closed,
float  edgelen,
int  sampling 
)
static

References createMeshFromList().

Referenced by Mesh::Cylinder::execute().

◆ createEllipsoid()

MeshObject * MeshObject::createEllipsoid ( float  radius1,
float  radius2,
int  sampling 
)
static

◆ createMeshFromList()

◆ createSphere()

MeshObject * MeshObject::createSphere ( float  radius,
int  sampling 
)
static

References createMeshFromList().

Referenced by Mesh::Sphere::execute().

◆ createTorus()

MeshObject * MeshObject::createTorus ( float  radius1,
float  radius2,
int  sampling 
)
static

References createMeshFromList().

Referenced by Mesh::Torus::execute().

◆ crossSections()

void MeshObject::crossSections ( const std::vector< TPlane > &  planes,
std::vector< TPolylines > &  sections,
float  fMinEps = 1.0e-2f,
bool  bConnectPolygons = false 
) const

◆ cut()

void MeshObject::cut ( const Base::Polygon2d polygon,
const Base::ViewProjMethod proj,
MeshObject::CutType  type 
)

◆ decimate() [1/2]

void MeshObject::decimate ( float  fTolerance,
float  fReduction 
)

◆ decimate() [2/2]

void MeshObject::decimate ( int  targetSize)

◆ deleteFacets()

◆ deletePoints()

void MeshObject::deletePoints ( const std::vector< PointIndex > &  removeIndices)

◆ deleteSelectedFacets()

void MeshObject::deleteSelectedFacets ( )

◆ deleteSelectedPoints()

void MeshObject::deleteSelectedPoints ( )

◆ facets_begin()

const_facet_iterator Mesh::MeshObject::facets_begin ( ) const

◆ facets_end()

const_facet_iterator Mesh::MeshObject::facets_end ( ) const

◆ fillupHoles()

void MeshObject::fillupHoles ( unsigned long  length,
int  level,
MeshCore::AbstractPolygonTriangulator cTria 
)

◆ flipNormals()

void MeshObject::flipNormals ( )

◆ getBoundBox()

◆ getCenterOfGravity()

bool MeshObject::getCenterOfGravity ( Base::Vector3d center) const
virtual

Get the center of gravity If this method is implemented then true is returned and the center of gravity.

The default implementation only returns false.

Reimplemented from Data::ComplexGeoData.

References MeshCore::MeshAlgorithm::GetGravityPoint(), and Data::ComplexGeoData::transformToOutside().

◆ getComponents()

std::vector< std::vector< FacetIndex > > MeshObject::getComponents ( ) const

◆ getEigenSystem()

◆ getElementTypes()

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.

◆ getFaces()

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(), and Data::ComplexGeoData::Facet::I1.

◆ getFacesFromSubElement()

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

◆ getFacetsFromSelection()

void MeshObject::getFacetsFromSelection ( std::vector< FacetIndex > &  inds) const

◆ getKernel() [1/2]

MeshCore::MeshKernel & Mesh::MeshObject::getKernel ( )

Referenced by MeshPartGui::CurveOnMeshHandler::Private::createGrid(), MeshGui::MeshSelection::deleteSelection(), MeshGui::MeshSelection::deleteSelectionBorder(), MeshGui::MeshSelection::deselectComponent(), MeshGui::ViewProviderMesh::deselectComponent(), Mesh::Curvature::execute(), Mesh::SegmentByMesh::execute(), Mesh::SetOperations::execute(), MeshGui::ViewProviderMesh::faceInfo(), MeshGui::ViewProviderMesh::fillHole(), MeshGui::ViewProviderMesh::getFacetsFromPolygon(), MeshGui::ViewProviderMeshNode::handleEvent(), Inspection::InspectNominalFastMesh::InspectNominalFastMesh(), MeshGui::ViewProviderMesh::invertSelection(), MeshGui::ViewProviderMesh::isFacetSelected(), MeshGui::RemeshGmsh::loadOutput(), MeshPartGui::Mesh2ShapeGmsh::loadOutput(), 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(), MeshGui::SoFCMeshPickNode::pick(), MeshGui::ViewProviderMesh::segmentMesh(), MeshGui::MeshSelection::selectComponent(), MeshGui::ViewProviderMesh::selectComponent(), MeshGui::DlgEvaluateMeshImp::showInformation(), MeshGui::ViewProviderMesh::splitMesh(), and MeshGui::PropertyMeshKernelItem::value().

◆ getKernel() [2/2]

const MeshCore::MeshKernel & Mesh::MeshObject::getKernel ( ) const

◆ getMemSize()

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.

◆ getMeshFacet()

Mesh::Facet MeshObject::getMeshFacet ( FacetIndex  index) const

◆ getMeshPoint()

MeshPoint MeshObject::getMeshPoint ( PointIndex  index) const

References getPoint().

◆ getPoint()

◆ getPointDegree()

unsigned long MeshObject::getPointDegree ( const std::vector< FacetIndex > &  facets,
std::vector< PointIndex > &  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().

◆ getPointNormal()

◆ getPointNormals()

◆ getPoints()

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.

References getPoint(), Base::Vector3< _Precision >::x, Base::Vector3< _Precision >::y, and Base::Vector3< _Precision >::z.

◆ getPointsFromFacets()

std::vector< PointIndex > MeshObject::getPointsFromFacets ( const std::vector< FacetIndex > &  facets) const

◆ getPointsFromSelection()

void MeshObject::getPointsFromSelection ( std::vector< PointIndex > &  inds) const

◆ getSegment() [1/2]

Segment & MeshObject::getSegment ( unsigned long  index)

◆ getSegment() [2/2]

const Segment & MeshObject::getSegment ( unsigned long  index) const

◆ getSegmentsOfType()

std::vector< Segment > MeshObject::getSegmentsOfType ( MeshObject::GeometryType  type,
float  dev,
unsigned long  minFacets 
) const

◆ getSubElement()

Data::Segment * MeshObject::getSubElement ( const char *  Type,
unsigned long  n 
) const
virtual

get the subelement by type and number

Implements Data::ComplexGeoData.

References countSegments(), getSegment(), Mesh::MeshSegment::mesh, MeshObject(), Mesh::MeshSegment::segment, and Segment.

◆ getSurface()

double MeshObject::getSurface ( ) const

◆ getTransform()

Base::Matrix4D MeshObject::getTransform ( ) 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 MeshPartGui::CurveOnMeshHandler::Private::createGrid(), Inspection::InspectActualMesh::InspectActualMesh(), Inspection::InspectNominalFastMesh::InspectNominalFastMesh(), and Inspection::InspectNominalMesh::InspectNominalMesh().

◆ getVolume()

double MeshObject::getVolume ( void  ) const

◆ harmonizeNormals()

◆ hasCorruptedFacets()

bool MeshObject::hasCorruptedFacets ( ) const

◆ hasFacetsOutOfRange()

bool MeshObject::hasFacetsOutOfRange ( ) const

◆ hasInvalidNeighbourhood()

bool MeshObject::hasInvalidNeighbourhood ( ) const

◆ hasInvalidPoints()

bool MeshObject::hasInvalidPoints ( ) const

◆ hasNonManifolds()

bool MeshObject::hasNonManifolds ( ) const

◆ hasPointsOnEdge()

bool MeshObject::hasPointsOnEdge ( ) const

◆ hasPointsOutOfRange()

bool MeshObject::hasPointsOutOfRange ( ) const

◆ hasSelectedFacets()

◆ hasSelectedPoints()

bool MeshObject::hasSelectedPoints ( ) const

References countSelectedPoints().

◆ hasSelfIntersections()

bool MeshObject::hasSelfIntersections ( ) const

◆ inner()

MeshObject * MeshObject::inner ( const MeshObject mesh) const

◆ insertVertex()

void MeshObject::insertVertex ( FacetIndex  facet,
const Base::Vector3f v 
)

◆ intersect()

◆ isSolid()

bool MeshObject::isSolid ( ) const

◆ load() [1/3]

◆ load() [2/3]

◆ load() [3/3]

◆ mergeFacets()

void MeshObject::mergeFacets ( )

◆ meshFromSegment()

MeshObject * MeshObject::meshFromSegment ( const std::vector< FacetIndex > &  indices) const

◆ movePoint()

void MeshObject::movePoint ( PointIndex  index,
const Base::Vector3d v 
)

◆ offset()

◆ offsetSpecial()

void MeshObject::offsetSpecial ( float  fSize,
float  zmax,
float  zmin 
)

◆ offsetSpecial2()

◆ operator=()

void MeshObject::operator= ( const MeshObject mesh)

References setTransform().

◆ optimizeEdges()

void MeshObject::optimizeEdges ( )

◆ optimizeTopology()

void MeshObject::optimizeTopology ( float  fMaxAngle)

◆ outer()

◆ points_begin()

const_point_iterator Mesh::MeshObject::points_begin ( ) const

◆ points_end()

const_point_iterator Mesh::MeshObject::points_end ( ) const

◆ refine()

◆ removeComponents()

void MeshObject::removeComponents ( unsigned long  count)

◆ removeDuplicatedFacets()

void MeshObject::removeDuplicatedFacets ( )

◆ removeDuplicatedPoints()

void MeshObject::removeDuplicatedPoints ( )

◆ removeFacetsFromSelection()

◆ removeFoldsOnSurface()

◆ removeFullBoundaryFacets()

void MeshObject::removeFullBoundaryFacets ( )

References deleteFacets().

◆ removeInvalidPoints()

void MeshObject::removeInvalidPoints ( )

◆ removeNeedles()

void MeshObject::removeNeedles ( float  length)

◆ removeNonManifoldPoints()

◆ removeNonManifolds()

◆ removePointsFromSelection()

void MeshObject::removePointsFromSelection ( const std::vector< PointIndex > &  inds) const

◆ removePointsOnEdge()

void MeshObject::removePointsOnEdge ( bool  fillBoundary)

◆ removeSelfIntersections() [1/2]

◆ removeSelfIntersections() [2/2]

void MeshObject::removeSelfIntersections ( const std::vector< FacetIndex > &  indices)

◆ representation()

◆ Restore()

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.

◆ RestoreDocFile()

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 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{
// initiate 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().

◆ Save()

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.

◆ save() [1/3]

◆ save() [2/3]

◆ save() [3/3]

◆ SaveDocFile()

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 separate 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 effectiveness. 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().

◆ section()

std::vector< std::vector< Base::Vector3f > > MeshObject::section ( const MeshObject mesh,
bool  connectLines,
float  fMinDist 
) const

◆ segments_begin()

const_segment_iterator Mesh::MeshObject::segments_begin ( ) const

◆ segments_end()

const_segment_iterator Mesh::MeshObject::segments_end ( ) const

◆ setFacets() [1/2]

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

◆ setFacets() [2/2]

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

◆ setKernel()

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

◆ setPoint()

◆ setTransform()

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(), operator=(), and transformToEigenSystem().

◆ smooth()

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

◆ snapVertex()

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

◆ splitEdge()

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

◆ splitEdges()

◆ splitFacet()

void MeshObject::splitFacet ( FacetIndex  facet,
const Base::Vector3f v1,
const Base::Vector3f v2 
)

◆ subtract()

◆ swap() [1/2]

◆ swap() [2/2]

void MeshObject::swap ( MeshObject mesh)

◆ swapEdge()

void MeshObject::swapEdge ( FacetIndex  facet,
FacetIndex  neighbour 
)

◆ topologyInfo()

std::string MeshObject::topologyInfo ( ) const

◆ transformGeometry()

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().

◆ transformToEigenSystem()

void MeshObject::transformToEigenSystem ( )

◆ trim()

void MeshObject::trim ( const Base::Polygon2d polygon,
const Base::ViewProjMethod proj,
MeshObject::CutType  type 
)

◆ trimByPlane()

void MeshObject::trimByPlane ( const Base::Vector3f base,
const Base::Vector3f normal 
)

References deleteFacets(), and trim().

◆ unite()

◆ validateCaps()

void MeshObject::validateCaps ( float  fMaxAngle,
float  fSplitFactor 
)

◆ validateDeformations()

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

◆ validateDegenerations()

void MeshObject::validateDegenerations ( float  fEps)

◆ validateIndices()

Friends And Related Function Documentation

◆ Segment

friend class Segment
friend

Referenced by getSubElement().


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