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 (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 | |
| |
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 |
MeshFacet & | operator= (const MeshFacet &rclF) |
void | SetVertices (unsigned long, unsigned long, unsigned long) |
void | SetNeighbours (unsigned long, unsigned long, unsigned long) |
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... | |
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... | |
bool | IsEqual (const MeshFacet &rcFace) const |
Returns true if this facet shares the same three points as rcFace. More... | |
void | Transpose (unsigned long ulOrig, unsigned long ulNew) |
Replaces the index of the corner point that is equal to ulOrig by ulNew. More... | |
void | Decrement (unsigned long ulIndex) |
Decrement the index for each corner point that is higher than ulIndex. More... | |
bool | HasPoint (unsigned long) const |
Checks if the facets references the given point index. More... | |
void | ReplaceNeighbour (unsigned long ulOrig, unsigned long 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 (void) |
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 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
◆ TFlagType
Constructor & Destructor Documentation
◆ MeshFacet() [1/3]
MeshCore::MeshFacet::MeshFacet | ( | void | ) |
◆ MeshFacet() [2/3]
MeshCore::MeshFacet::MeshFacet | ( | const MeshFacet & | rclF | ) |
◆ MeshFacet() [3/3]
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 |
||
) |
◆ ~MeshFacet()
MeshCore::MeshFacet::~MeshFacet | ( | void | ) |
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.
Referenced by MeshCore::MeshKernel::AdjustNormal().
◆ GetEdge() [1/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.
◆ 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.
Referenced by HasPoint().
◆ HasOpenEdge()
bool MeshCore::MeshFacet::HasOpenEdge | ( | ) | const |
Returns true if there is an edge without neighbour, otherwise false.
Referenced by MeshCore::MeshTopoAlgorithm::SnapVertex().
◆ HasPoint()
bool MeshCore::MeshFacet::HasPoint | ( | unsigned long | ulIndex | ) | const |
Checks if the facets references the given point index.
References HasNeighbour().
Referenced by MeshCore::MeshTopoAlgorithm::CollapseVertex(), and MeshCore::MeshPointFacetAdjacency::SetFacetNeighbourhood().
◆ HasSameOrientation()
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.
◆ IsEqual()
Returns true if this facet shares the same three points as rcFace.
The orientation is not of interest in this case.
References MeshCore::MeshIsFlag< TCLASS >::operator()().
◆ IsFlag()
Referenced by MeshCore::MeshTopoAlgorithm::AdjustEdgesToCurvatureDirection(), MeshCore::MeshTopoAlgorithm::DelaunayFlip(), MeshCore::MeshSearchNeighbours::NeighboursFacetFromFacet(), MeshCore::MeshSearchNeighbours::NeighboursFromFacet(), MeshCore::MeshSearchNeighbours::NeighboursFromSampledFacets(), Mesh::MeshObject::splitEdges(), and MeshCore::MeshOrientationCollector::Visit().
◆ IsValid()
bool MeshCore::MeshFacet::IsValid | ( | void | ) | const |
◆ operator=()
◆ 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.
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 |
◆ ResetInvalid()
void MeshCore::MeshFacet::ResetInvalid | ( | void | ) | const |
◆ SetFlag()
void MeshCore::MeshFacet::SetFlag | ( | TFlagType | tF | ) | const |
Referenced by MeshCore::MeshTopoAlgorithm::AdjustEdgesToCurvatureDirection(), MeshCore::MeshTopoAlgorithm::DelaunayFlip(), MeshCore::MeshSearchNeighbours::NeighboursFacetFromFacet(), MeshCore::MeshSearchNeighbours::NeighboursFromFacet(), MeshCore::MeshSearchNeighbours::NeighboursFromSampledFacets(), Mesh::MeshObject::splitEdges(), and MeshCore::MeshOrientationCollector::Visit().
◆ 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.
Referenced by MeshCore::MeshTopoAlgorithm::CollapseEdge(), MeshCore::MeshTopoAlgorithm::CollapseFacet(), MeshCore::MeshTopoAlgorithm::CollapseVertex(), MeshCore::MeshKernel::DeleteFacets(), and MeshCore::MeshRemoveNeedles::Fixup().
◆ SetNeighbours()
void MeshCore::MeshFacet::SetNeighbours | ( | unsigned long | n1, |
unsigned long | n2, | ||
unsigned long | n3 | ||
) |
◆ SetProperty()
void MeshCore::MeshFacet::SetProperty | ( | unsigned long | uP | ) | const |
Referenced by MeshCore::MeshInput::LoadOBJ(), and MeshCore::MeshInput::LoadSMF().
◆ SetVertices()
void MeshCore::MeshFacet::SetVertices | ( | unsigned long | p1, |
unsigned long | p2, | ||
unsigned long | p3 | ||
) |
Referenced by MeshCore::MeshInput::LoadOBJ(), MeshCore::MeshInput::LoadOFF(), and MeshCore::MeshInput::LoadSMF().
◆ 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.
◆ Side() [2/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.
Referenced by MeshCore::MeshTopoAlgorithm::AdjustEdgesToCurvatureDirection(), MeshCore::MeshTopoAlgorithm::CollapseEdge(), MeshCore::MeshTopoAlgorithm::CollapseFacet(), MeshCore::MeshTopoAlgorithm::DelaunayFlip(), MeshCore::MeshEvalNeighbourhood::Evaluate(), MeshCore::MeshAlgorithm::FillupHole(), MeshCore::MeshEvalNeighbourhood::GetIndices(), MeshCore::MeshTopoAlgorithm::IsSwapEdgeLegal(), MeshCore::MeshTopoAlgorithm::OptimizeTopology(), MeshCore::MeshKernel::RebuildNeighbours(), MeshCore::MeshTopoAlgorithm::RemoveDegeneratedFacet(), MeshCore::MeshTopoAlgorithm::ShouldSwapEdge(), MeshCore::MeshTopoAlgorithm::SplitEdge(), MeshCore::MeshTopoAlgorithm::SwapEdge(), and MeshCore::QuasiDelaunayTriangulator::Triangulate().
◆ Side() [3/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.
◆ 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.
Referenced by MeshCore::MeshTopoAlgorithm::CollapseEdge(), MeshCore::MeshTopoAlgorithm::CollapseFacet(), and MeshCore::MeshTopoAlgorithm::CollapseVertex().
The documentation for this class was generated from the following file:
- src/Mod/Mesh/App/Core/Elements.h