MeshCore::MeshFacet Class Reference

The MeshFacet class represent a triangle facet in the mesh data.structure. More...

#include <Elements.h>

Public Types

Public Member Functions

unsigned short CountOpenEdges () const
 Counts the number of edges without neighbour. More...
 
void Decrement (unsigned long ulIndex)
 Decrement the index for each corner point that is higher than ulIndex. More...
 
void FlipNormal (void)
 Flips the orientation of the facet. More...
 
void GetEdge (unsigned short usSide, MeshHelpEdge &rclEdge) const
 Returns the indices of the corner points of the given edge number. More...
 
std::pair< unsigned long, unsigned long > GetEdge (unsigned short usSide) const
 Returns the indices of the corner points of the given edge number. More...
 
bool HasNeighbour (unsigned short usSide) const
 Checks if the neighbour exists at the given edge-number. More...
 
bool HasOpenEdge () const
 Returns true if there is an edge without neighbour, otherwise false. More...
 
bool HasPoint (unsigned long) const
 Checks if the facets references the given point index. More...
 
bool HasSameOrientation (const MeshFacet &) const
 Returns true if the two facets have the same orientation, false otherwise Therefore the two facets must be adjacent. More...
 
bool IsDegenerated () const
 Checks wether the facet is degenerated to a line of point. More...
 
bool IsEqual (const MeshFacet &rcFace) const
 Returns true if this facet shares the same three points as rcFace. More...
 
MeshFacetoperator= (const MeshFacet &rclF)
 
void ReplaceNeighbour (unsigned long ulOrig, unsigned long ulNew)
 Replaces the index of the neighbour facet that is equal to ulOrig by ulNew. More...
 
void SetNeighbours (unsigned long, unsigned long, unsigned long)
 
void SetVertices (unsigned long, unsigned long, unsigned long)
 
unsigned short Side (unsigned long ulNIndex) const
 Returns the edge-number to the given index of neighbour facet. More...
 
unsigned short Side (unsigned long ulP0, unsigned long P1) const
 Returns the edge-number defined by two points. More...
 
unsigned short Side (const MeshFacet &rcFace) const
 Returns the edge-number defined by the shared edge of both facets. More...
 
void Transpose (unsigned long ulOrig, unsigned long ulNew)
 Replaces the index of the corner point that is equal to ulOrig by ulNew. More...
 
Construction
 MeshFacet (void)
 
 MeshFacet (const MeshFacet &rclF)
 
 MeshFacet (unsigned long p1, unsigned long p2, unsigned long p3, unsigned long n1=ULONG_MAX, unsigned long n2=ULONG_MAX, unsigned long n3=ULONG_MAX)
 
 ~MeshFacet (void)
 
Flag state
Note
All flag methods are const as they do NOT change the actual behaviour of the object
void SetFlag (TFlagType tF) const
 
void ResetFlag (TFlagType tF) const
 
bool IsFlag (TFlagType tF) const
 
void ResetInvalid (void) const
 
void SetProperty (unsigned long uP) const
 
void SetInvalid (void) const
 Marks a facet as invalid. More...
 
bool IsValid (void) const
 

Detailed Description

The MeshFacet class represent a triangle facet in the mesh data.structure.

A facet indexes three neighbour facets and also three corner points. This class only keeps topologic information but no geometric information at all.

Here are the most important conventions concerning the facet's orientation:

  • neighbour or edge number of 0 is defined by corner 0 and 1
  • neighbour or edge number of 1 is defined by corner 1 and 2
  • neighbour or edge number of 2 is defined by corner 2 and 0
  • neighbour index is set to ULONG_MAX if there is no neighbour facet

Note: The status flag SEGMENT mark a facet to be part of certain subset, a segment. This flag must not be set by any algorithm unless it adds or removes facets to a segment.

Note: The status flag SELECTED mark a facet to be selected which is e.g. used in the GUI. This flag must not be set by any algorithm unless it adds or removes facets to the selection.

Member Enumeration Documentation

Enumerator
INVALID 
VISIT 
SEGMENT 
MARKED 
SELECTED 
REV 
TMP0 
TMP1 

Constructor & Destructor Documentation

MeshCore::MeshFacet::MeshFacet ( void  )
inline
MeshCore::MeshFacet::MeshFacet ( const MeshFacet rclF)
inline
MeshCore::MeshFacet::MeshFacet ( unsigned long  p1,
unsigned long  p2,
unsigned long  p3,
unsigned long  n1 = ULONG_MAX,
unsigned long  n2 = ULONG_MAX,
unsigned long  n3 = ULONG_MAX 
)
inline
MeshCore::MeshFacet::~MeshFacet ( void  )
inline

Member Function Documentation

unsigned short MeshCore::MeshFacet::CountOpenEdges ( ) const
inline

Counts the number of edges without neighbour.

References HasNeighbour().

Referenced by HasOpenEdge().

void MeshCore::MeshFacet::Decrement ( unsigned long  ulIndex)
inline

Decrement the index for each corner point that is higher than ulIndex.

void MeshCore::MeshFacet::FlipNormal ( void  )
inline

Flips the orientation of the facet.

Referenced by MeshCore::MeshKernel::AdjustNormal().

void MeshCore::MeshFacet::GetEdge ( unsigned short  usSide,
MeshHelpEdge rclEdge 
) const
inline

Returns the indices of the corner points of the given edge number.

Referenced by MeshCore::MeshAlgorithm::GetFacetBorders().

std::pair< unsigned long, unsigned long > MeshCore::MeshFacet::GetEdge ( unsigned short  usSide) const
inline

Returns the indices of the corner points of the given edge number.

bool MeshCore::MeshFacet::HasNeighbour ( unsigned short  usSide) const
inline

Checks if the neighbour exists at the given edge-number.

Referenced by CountOpenEdges().

bool MeshCore::MeshFacet::HasOpenEdge ( ) const
inline

Returns true if there is an edge without neighbour, otherwise false.

References CountOpenEdges().

Referenced by MeshGui::MeshFaceAddition::finishEditing(), and MeshCore::MeshTopoAlgorithm::SnapVertex().

bool MeshCore::MeshFacet::HasPoint ( unsigned long  ulIndex) const
inline

Checks if the facets references the given point index.

Referenced by MeshCore::MeshPointFacetAdjacency::SetFacetNeighbourhood().

bool MeshCore::MeshFacet::HasSameOrientation ( const MeshFacet f) const
inline

Returns true if the two facets have the same orientation, false otherwise Therefore the two facets must be adjacent.

Referenced by MeshCore::MeshEvalOrientation::Evaluate(), MeshCore::MeshOrientationVisitor::Visit(), MeshCore::MeshOrientationCollector::Visit(), and MeshCore::MeshSameOrientationCollector::Visit().

bool MeshCore::MeshFacet::IsDegenerated ( ) const
inline

Checks wether the facet is degenerated to a line of point.

bool MeshCore::MeshFacet::IsEqual ( const MeshFacet rcFace) const
inline

Returns true if this facet shares the same three points as rcFace.

The orientation is not of interest in this case.

Referenced by MeshCore::MeshAlgorithm::FillupHole().

MeshFacet & MeshCore::MeshFacet::operator= ( const MeshFacet rclF)
inline
void MeshCore::MeshFacet::ReplaceNeighbour ( unsigned long  ulOrig,
unsigned long  ulNew 
)
inline

Replaces the index of the neighbour facet that is equal to ulOrig by ulNew.

If the facet does not have a neighbourt with this index nothing happens.

Referenced by MeshCore::MeshTopoAlgorithm::InsertVertex(), MeshCore::MeshTopoAlgorithm::RemoveCorruptedFacet(), and MeshCore::MeshTopoAlgorithm::RemoveDegeneratedFacet().

void MeshCore::MeshFacet::ResetFlag ( TFlagType  tF) const
inline
void MeshCore::MeshFacet::ResetInvalid ( void  ) const
inline
void MeshCore::MeshFacet::SetInvalid ( void  ) const
inline

Marks a facet as invalid.

Should be used only temporary from within an algorithm (e.g. deletion of several facets) but must not be set permanently. From outside the data-structure must not have invalid facets.

Referenced by MeshCore::MeshTopoAlgorithm::CollapseEdge(), MeshCore::MeshTopoAlgorithm::CollapseFacet(), MeshCore::MeshKernel::DeleteFacets(), and MeshCore::MeshFixDegeneratedFacets::RemoveEdgeTooSmall().

void MeshCore::MeshFacet::SetNeighbours ( unsigned long  n1,
unsigned long  n2,
unsigned long  n3 
)
inline
void MeshCore::MeshFacet::SetProperty ( unsigned long  uP) const
inline
void MeshCore::MeshFacet::SetVertices ( unsigned long  p1,
unsigned long  p2,
unsigned long  p3 
)
inline
unsigned short MeshCore::MeshFacet::Side ( unsigned long  ulP0,
unsigned long  P1 
) const
inline

Returns the edge-number defined by two points.

If one point is not a corner point USHRT_MAX is returned.

unsigned short MeshCore::MeshFacet::Side ( const MeshFacet rcFace) const
inline

Returns the edge-number defined by the shared edge of both facets.

If the facets don't share a common edge USHRT_MAX is returned.

References Side().

void MeshCore::MeshFacet::Transpose ( unsigned long  ulOrig,
unsigned long  ulNew 
)
inline

Replaces the index of the corner point that is equal to ulOrig by ulNew.

If the facet does not have a corner point with this index nothing happens.

Referenced by MeshCore::MeshTopoAlgorithm::CollapseEdge(), and MeshCore::MeshTopoAlgorithm::CollapseFacet().


The documentation for this class was generated from the following file:
  • src/src/Mod/Mesh/App/Core/Elements.h