FreeCAD C++
Public Member Functions | Public Attributes | List of all members
MeshCore::MeshFacet Class Reference

#include <Mod/Mesh/App/Core/Elements.h>

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:

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.

Public Member Functions

void GetEdge (unsigned short usSide, MeshHelpEdge &rclEdge) const
 
std::pair< unsigned long, unsigned long > GetEdge (unsigned short usSide) const
 
unsigned short Side (unsigned long ulNIndex) const
 
unsigned short Side (unsigned long ulP0, unsigned long P1) const
 
unsigned short Side (const MeshFacet &rcFace) const
 
bool IsEqual (const MeshFacet &rcFace) const
 
void Transpose (unsigned long ulOrig, unsigned long ulNew)
 
void Decrement (unsigned long ulIndex)
 
bool HasPoint (unsigned long) const
 
void ReplaceNeighbour (unsigned long ulOrig, unsigned long ulNew)
 
bool HasNeighbour (unsigned short usSide) const
 
unsigned short CountOpenEdges () const
 
bool HasOpenEdge () const
 
bool HasSameOrientation (const MeshFacet &) const
 
bool IsDegenerated () const
 
void FlipNormal (void)
 
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
 
bool IsValid (void) const
 

Public Attributes

unsigned char _ucFlag
 
unsigned long _ulProp
 
unsigned long _aulPoints [3]
 
unsigned long _aulNeighbours [3]
 

Member Function Documentation

◆ CountOpenEdges()

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

Counts the number of edges without neighbour.

◆ Decrement()

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

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

◆ FlipNormal()

void MeshCore::MeshFacet::FlipNormal ( void  )

Flips the orientation of the facet.

◆ GetEdge() [1/2]

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

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

◆ GetEdge() [2/2]

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

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

◆ HasNeighbour()

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

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

◆ HasOpenEdge()

bool MeshCore::MeshFacet::HasOpenEdge ( ) const

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

◆ HasPoint()

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

Checks if the facets references the given point index.

◆ HasSameOrientation()

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

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

◆ IsDegenerated()

bool MeshCore::MeshFacet::IsDegenerated ( ) const

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

◆ IsEqual()

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

Returns true if this facet shares the same three points as rcFace. The orientation is not of interest in this case.

◆ ReplaceNeighbour()

void MeshCore::MeshFacet::ReplaceNeighbour ( unsigned long  ulOrig,
unsigned long  ulNew 
)

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.

◆ SetInvalid()

void MeshCore::MeshFacet::SetInvalid ( void  ) const

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.

◆ Side() [1/3]

unsigned short MeshCore::MeshFacet::Side ( unsigned long  ulNIndex) const

Returns the edge-number to the given index of neighbour facet. If ulNIndex is not a neighbour USHRT_MAX is returned.

◆ Side() [2/3]

unsigned short MeshCore::MeshFacet::Side ( unsigned long  ulP0,
unsigned long  P1 
) const

Returns the edge-number defined by two points. If one point is not a corner point USHRT_MAX is returned.

◆ Side() [3/3]

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

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.

◆ Transpose()

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

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.

Member Data Documentation

◆ _aulNeighbours

unsigned long MeshCore::MeshFacet::_aulNeighbours[3]

Indices of neighbour facets.

◆ _aulPoints

unsigned long MeshCore::MeshFacet::_aulPoints[3]

Indices of corner points.

◆ _ucFlag

unsigned char MeshCore::MeshFacet::_ucFlag

Flag member.

◆ _ulProp

unsigned long MeshCore::MeshFacet::_ulProp

Free usable property.