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 | |
| |
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 |
MeshFacet & | operator= (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, PointIndex > | GetEdge (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... | |
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.
MeshCore::MeshFacet::MeshFacet | ( | ) |
MeshCore::MeshFacet::MeshFacet | ( | const MeshFacet & | rclF | ) |
MeshCore::MeshFacet::MeshFacet | ( | PointIndex | p1, |
PointIndex | p2, | ||
PointIndex | p3, | ||
FacetIndex | n1 = FACET_INDEX_MAX , |
||
FacetIndex | n2 = FACET_INDEX_MAX , |
||
FacetIndex | n3 = FACET_INDEX_MAX |
||
) |
MeshCore::MeshFacet::~MeshFacet | ( | ) |
unsigned short MeshCore::MeshFacet::CountOpenEdges | ( | ) | const |
Counts the number of edges without neighbour.
References HasNeighbour().
Referenced by HasOpenEdge().
void MeshCore::MeshFacet::Decrement | ( | PointIndex | ulIndex | ) |
Decrement the index for each corner point that is higher than ulIndex.
void MeshCore::MeshFacet::FlipNormal | ( | ) |
Flips the orientation of the facet.
Referenced by MeshCore::MeshKernel::AdjustNormal().
std::pair< PointIndex, PointIndex > MeshCore::MeshFacet::GetEdge | ( | unsigned short | usSide | ) | const |
Returns the indices of the corner points of the given edge number.
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().
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().
bool MeshCore::MeshFacet::HasOpenEdge | ( | ) | const |
Returns true if there is an edge without neighbour, otherwise false.
References CountOpenEdges().
Referenced by MeshCore::MeshTopoAlgorithm::SnapVertex().
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().
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().
bool MeshCore::MeshFacet::IsDegenerated | ( | ) | const |
Checks whether the facet is degenerated to a line of point.
Referenced by MeshCore::MeshFixCorruptedFacets::Fixup().
Returns true if this facet shares the same three points as rcFace.
The orientation is not of interest in this case.
Referenced by MeshCore::MeshTopoAlgorithm::AdjustEdgesToCurvatureDirection(), MeshCore::MeshTopoAlgorithm::DelaunayFlip(), IsValid(), MeshCore::MeshSearchNeighbours::NeighboursFacetFromFacet(), MeshCore::MeshSearchNeighbours::NeighboursFromFacet(), MeshCore::MeshSearchNeighbours::NeighboursFromSampledFacets(), Mesh::MeshObject::splitEdges(), and MeshCore::MeshOrientationCollector::Visit().
bool MeshCore::MeshFacet::IsValid | ( | ) | const |
References INVALID, and IsFlag().
Referenced by MeshCore::MeshTopoAlgorithm::CollapseEdge(), and MeshCore::MeshTopoAlgorithm::CollapseFacet().
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().
void MeshCore::MeshFacet::ResetFlag | ( | TFlagType | tF | ) | const |
Referenced by ResetInvalid().
void MeshCore::MeshFacet::ResetInvalid | ( | ) | const |
References INVALID, and ResetFlag().
void MeshCore::MeshFacet::SetFlag | ( | TFlagType | tF | ) | const |
Referenced by MeshCore::MeshTopoAlgorithm::AdjustEdgesToCurvatureDirection(), MeshCore::MeshTopoAlgorithm::DelaunayFlip(), MeshCore::MeshSearchNeighbours::NeighboursFacetFromFacet(), MeshCore::MeshSearchNeighbours::NeighboursFromFacet(), MeshCore::MeshSearchNeighbours::NeighboursFromSampledFacets(), SetInvalid(), Mesh::MeshObject::splitEdges(), and MeshCore::MeshOrientationCollector::Visit().
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().
void MeshCore::MeshFacet::SetNeighbours | ( | FacetIndex | n1, |
FacetIndex | n2, | ||
FacetIndex | n3 | ||
) |
void MeshCore::MeshFacet::SetProperty | ( | unsigned long | uP | ) | const |
Referenced by MeshCore::MeshInput::LoadOBJ(), and MeshCore::MeshInput::LoadSMF().
void MeshCore::MeshFacet::SetVertices | ( | PointIndex | p1, |
PointIndex | p2, | ||
PointIndex | p3 | ||
) |
Referenced by MeshCore::MeshInput::LoadOBJ(), MeshCore::MeshInput::LoadOFF(), and MeshCore::MeshInput::LoadSMF().
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().
unsigned short MeshCore::MeshFacet::Side | ( | FacetIndex | 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(), Side(), MeshCore::MeshTopoAlgorithm::SplitEdge(), MeshCore::MeshTopoAlgorithm::SwapEdge(), and MeshCore::QuasiDelaunayTriangulator::Triangulate().
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.
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().