MeshCore::MeshFacet Class Reference

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

#include <Elements.h>

Public Types

enum  TFlagType {
  INVALID =1 , VISIT =2 , SEGMENT =4 , MARKED =8 ,
  SELECTED =16 , REV =32 , TMP0 =64 , TMP1 =128
}
 

Public Member Functions

Construction
 MeshFacet ()
 
 MeshFacet (const MeshFacet &rclF)
 
 MeshFacet (PointIndex p1, PointIndex p2, PointIndex p3, FacetIndex n1=FACET_INDEX_MAX, FacetIndex n2=FACET_INDEX_MAX, FacetIndex n3=FACET_INDEX_MAX)
 
 ~MeshFacet ()
 
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 () const
 
void SetProperty (unsigned long uP) const
 
void SetInvalid () const
 Marks a facet as invalid. More...
 
bool IsValid () const
 
MeshFacetoperator= (const MeshFacet &rclF)
 
void SetVertices (PointIndex, PointIndex, PointIndex)
 
void SetNeighbours (FacetIndex, FacetIndex, FacetIndex)
 
void GetEdge (unsigned short usSide, MeshHelpEdge &rclEdge) const
 Returns the indices of the corner points of the given edge number. More...
 
std::pair< PointIndex, PointIndexGetEdge (unsigned short usSide) const
 Returns the indices of the corner points of the given edge number. More...
 
unsigned short Side (FacetIndex ulNIndex) const
 Returns the edge-number to the given index of neighbour facet. More...
 
unsigned short Side (PointIndex ulP0, PointIndex 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...
 
bool IsEqual (const MeshFacet &rcFace) const
 Returns true if this facet shares the same three points as rcFace. More...
 
void Transpose (PointIndex ulOrig, PointIndex ulNew)
 Replaces the index of the corner point that is equal to ulOrig by ulNew. More...
 
void Decrement (PointIndex ulIndex)
 Decrement the index for each corner point that is higher than ulIndex. More...
 
bool HasPoint (PointIndex) const
 Checks if the facets references the given point index. More...
 
void ReplaceNeighbour (FacetIndex ulOrig, FacetIndex ulNew)
 Replaces the index of the neighbour facet that is equal to ulOrig by ulNew. More...
 
bool HasNeighbour (unsigned short usSide) const
 Checks if the neighbour exists at the given edge-number. More...
 
unsigned short CountOpenEdges () const
 Counts the number of edges without neighbour. More...
 
bool HasOpenEdge () const
 Returns true if there is an edge without neighbour, otherwise false. 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 whether the facet is degenerated to a line of point. More...
 
void FlipNormal ()
 Flips the orientation of the facet. More...
 

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 FACET_INDEX_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

◆ TFlagType

Enumerator
INVALID 
VISIT 
SEGMENT 
MARKED 
SELECTED 
REV 
TMP0 
TMP1 

Constructor & Destructor Documentation

◆ MeshFacet() [1/3]

MeshCore::MeshFacet::MeshFacet ( )

◆ MeshFacet() [2/3]

MeshCore::MeshFacet::MeshFacet ( const MeshFacet rclF)

◆ MeshFacet() [3/3]

MeshCore::MeshFacet::MeshFacet ( PointIndex  p1,
PointIndex  p2,
PointIndex  p3,
FacetIndex  n1 = FACET_INDEX_MAX,
FacetIndex  n2 = FACET_INDEX_MAX,
FacetIndex  n3 = FACET_INDEX_MAX 
)

◆ ~MeshFacet()

MeshCore::MeshFacet::~MeshFacet ( )

Member Function Documentation

◆ CountOpenEdges()

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

Counts the number of edges without neighbour.

References HasNeighbour().

Referenced by HasOpenEdge().

◆ Decrement()

void MeshCore::MeshFacet::Decrement ( PointIndex  ulIndex)

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

◆ FlipNormal()

void MeshCore::MeshFacet::FlipNormal ( )

Flips the orientation of the facet.

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

◆ GetEdge() [1/2]

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

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

◆ GetEdge() [2/2]

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

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

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

◆ HasNeighbour()

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

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

References MeshCore::FACET_INDEX_MAX.

Referenced by CountOpenEdges().

◆ HasOpenEdge()

bool MeshCore::MeshFacet::HasOpenEdge ( ) const

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

References CountOpenEdges().

Referenced by MeshCore::MeshTopoAlgorithm::SnapVertex().

◆ HasPoint()

bool MeshCore::MeshFacet::HasPoint ( PointIndex  ulIndex) const

Checks if the facets references the given point index.

Referenced by MeshCore::MeshTopoAlgorithm::CollapseVertex(), and MeshCore::MeshPointFacetAdjacency::SetFacetNeighbourhood().

◆ 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.

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

◆ IsDegenerated()

bool MeshCore::MeshFacet::IsDegenerated ( ) const

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

Referenced by MeshCore::MeshFixCorruptedFacets::Fixup().

◆ 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.

◆ IsFlag()

◆ IsValid()

bool MeshCore::MeshFacet::IsValid ( ) const

◆ operator=()

MeshFacet & MeshCore::MeshFacet::operator= ( const MeshFacet rclF)

◆ ReplaceNeighbour()

void MeshCore::MeshFacet::ReplaceNeighbour ( FacetIndex  ulOrig,
FacetIndex  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.

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

◆ ResetFlag()

void MeshCore::MeshFacet::ResetFlag ( TFlagType  tF) const

Referenced by ResetInvalid().

◆ ResetInvalid()

void MeshCore::MeshFacet::ResetInvalid ( ) const

References INVALID, and ResetFlag().

◆ SetFlag()

◆ SetInvalid()

void MeshCore::MeshFacet::SetInvalid ( ) 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.

References INVALID, and SetFlag().

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

◆ SetNeighbours()

void MeshCore::MeshFacet::SetNeighbours ( FacetIndex  n1,
FacetIndex  n2,
FacetIndex  n3 
)

◆ SetProperty()

void MeshCore::MeshFacet::SetProperty ( unsigned long  uP) const

◆ SetVertices()

void MeshCore::MeshFacet::SetVertices ( PointIndex  p1,
PointIndex  p2,
PointIndex  p3 
)

◆ Side() [1/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.

References Side().

◆ Side() [2/3]

◆ Side() [3/3]

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

Returns the edge-number defined by two points.

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

◆ Transpose()

void MeshCore::MeshFacet::Transpose ( PointIndex  ulOrig,
PointIndex  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.

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


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