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 | |
unsigned short | CountOpenEdges () const |
Counts the number of edges without neighbour. | |
void | Decrement (unsigned long ulIndex) |
Decrement the index for each corner point that is higher than ulIndex. | |
void | FlipNormal (void) |
Flips the orientation of the facet. | |
std::pair< unsigned long, unsigned long > | GetEdge (unsigned short usSide) const |
Returns the indices of the corner points of the given edge number. | |
void | GetEdge (unsigned short usSide, MeshHelpEdge &rclEdge) const |
Returns the indices of the corner points of the given edge number. | |
bool | HasNeighbour (unsigned short usSide) const |
Checks if the neighbour exists at the given edge-number. | |
bool | HasOpenEdge () const |
Returns true if there is an edge without neighbour, otherwise false. | |
bool | HasSameOrientation (const MeshFacet &) const |
Returns true if the two facets have the same orientation, false otherwise Therefore the two facets must be adjacent. | |
bool | IsDegenerated () const |
Checks wether the facet is degenerated to a line of point. | |
bool | IsEqual (const MeshFacet &rcFace) const |
Returns true if this facet shares the same three points as rcFace. | |
MeshFacet & | operator= (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. | |
void | SetNeighbours (unsigned long, unsigned long, unsigned long) |
void | SetVertices (unsigned long, unsigned long, unsigned long) |
unsigned short | Side (const MeshFacet &rcFace) const |
Returns the edge-number defined by the shared edge of both facets. | |
unsigned short | Side (unsigned long ulP0, unsigned long P1) const |
Returns the edge-number defined by two points. | |
unsigned short | Side (unsigned long ulNIndex) const |
Returns the edge-number to the given index of neighbour facet. | |
void | Transpose (unsigned long ulOrig, unsigned long ulNew) |
Replaces the index of the corner point that is equal to ulOrig by ulNew. | |
Flag state | |
bool | IsFlag (TFlagType tF) const |
bool | IsValid (void) const |
void | ResetFlag (TFlagType tF) const |
void | ResetInvalid (void) const |
void | SetFlag (TFlagType tF) const |
void | SetInvalid (void) const |
Marks a facet as invalid. | |
void | SetProperty (unsigned long uP) const |
Construction | |
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 (const MeshFacet &rclF) | |
MeshFacet (void) | |
~MeshFacet (void) | |
Public Attributes | |
unsigned long | _aulNeighbours [3] |
Indices of neighbour facets. | |
unsigned long | _aulPoints [3] |
Indices of corner points. | |
unsigned char | _ucFlag |
Flag member. | |
unsigned long | _ulProp |
Free usable property. |
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.
Definition at line 171 of file Elements.h.
Definition at line 174 of file Elements.h.
MeshCore::MeshFacet::MeshFacet | ( | void | ) | [inline] |
Definition at line 736 of file Elements.h.
References _aulNeighbours, and _aulPoints.
MeshCore::MeshFacet::MeshFacet | ( | const MeshFacet & | rclF | ) | [inline] |
Definition at line 744 of file Elements.h.
References _aulNeighbours, and _aulPoints.
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] |
Definition at line 757 of file Elements.h.
References _aulNeighbours, and _aulPoints.
MeshCore::MeshFacet::~MeshFacet | ( | void | ) | [inline] |
Definition at line 182 of file Elements.h.
unsigned short MeshCore::MeshFacet::CountOpenEdges | ( | ) | const [inline] |
Counts the number of edges without neighbour.
Definition at line 839 of file Elements.h.
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.
Definition at line 822 of file Elements.h.
References _aulPoints.
void MeshCore::MeshFacet::FlipNormal | ( | void | ) | [inline] |
Flips the orientation of the facet.
Definition at line 275 of file Elements.h.
References _aulNeighbours, _aulPoints, and boost::numeric::bindings::atlas::swap().
Referenced by MeshCore::MeshKernel::AdjustNormal().
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.
Definition at line 807 of file Elements.h.
References _aulPoints.
void MeshCore::MeshFacet::GetEdge | ( | unsigned short | usSide, | |
MeshHelpEdge & | rclEdge | |||
) | const [inline] |
Returns the indices of the corner points of the given edge number.
Definition at line 801 of file Elements.h.
References _aulPoints, and MeshCore::MeshHelpEdge::_ulIndex.
Referenced by MeshCore::MeshAlgorithm::GetFacetBorders().
bool MeshCore::MeshFacet::HasNeighbour | ( | unsigned short | usSide | ) | const [inline] |
Checks if the neighbour exists at the given edge-number.
Definition at line 262 of file Elements.h.
References _aulNeighbours.
Referenced by CountOpenEdges().
bool MeshCore::MeshFacet::HasOpenEdge | ( | ) | const [inline] |
Returns true if there is an edge without neighbour, otherwise false.
Definition at line 847 of file Elements.h.
References CountOpenEdges().
Referenced by MeshCore::MeshTopoAlgorithm::SnapVertex().
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.
Definition at line 852 of file Elements.h.
References _aulPoints.
Referenced by MeshCore::MeshSameOrientationCollector::Visit(), MeshCore::MeshOrientationCollector::Visit(), and MeshCore::MeshOrientationVisitor::Visit().
bool MeshCore::MeshFacet::IsDegenerated | ( | ) | const [inline] |
Checks wether the facet is degenerated to a line of point.
Definition at line 868 of file Elements.h.
References _aulPoints.
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.
Definition at line 927 of file Elements.h.
References _aulPoints.
Referenced by MeshCore::MeshAlgorithm::FillupHole().
bool MeshCore::MeshFacet::IsFlag | ( | TFlagType | tF | ) | const [inline] |
Definition at line 193 of file Elements.h.
References _ucFlag.
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 | ( | void | ) | const [inline] |
Definition at line 206 of file Elements.h.
References INVALID, and IsFlag().
Referenced by MeshCore::MeshTopoAlgorithm::CollapseEdge(), MeshCore::MeshTopoAlgorithm::CollapseFacet(), and MeshCore::MeshKernel::RemoveInvalids().
Definition at line 771 of file Elements.h.
References _aulNeighbours, _aulPoints, _ucFlag, and _ulProp.
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.
Definition at line 829 of file Elements.h.
References _aulNeighbours.
void MeshCore::MeshFacet::ResetFlag | ( | TFlagType | tF | ) | const [inline] |
void MeshCore::MeshFacet::ResetInvalid | ( | void | ) | const [inline] |
Definition at line 195 of file Elements.h.
References INVALID, and ResetFlag().
void MeshCore::MeshFacet::SetFlag | ( | TFlagType | tF | ) | const [inline] |
Definition at line 189 of file Elements.h.
References _ucFlag.
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 | ( | 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.
Definition at line 204 of file Elements.h.
References INVALID, and SetFlag().
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] |
Definition at line 794 of file Elements.h.
References _aulNeighbours.
void MeshCore::MeshFacet::SetProperty | ( | unsigned long | uP | ) | const [inline] |
Definition at line 197 of file Elements.h.
References _ulProp.
Referenced by MeshCore::MeshInput::LoadOBJ().
void MeshCore::MeshFacet::SetVertices | ( | unsigned long | p1, | |
unsigned long | p2, | |||
unsigned long | p3 | |||
) | [inline] |
Definition at line 787 of file Elements.h.
References _aulPoints.
Referenced by MeshCore::MeshInput::LoadOBJ().
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.
Definition at line 915 of file Elements.h.
References _aulPoints, and Side().
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.
Definition at line 891 of file Elements.h.
References _aulPoints.
unsigned short MeshCore::MeshFacet::Side | ( | unsigned long | ulNIndex | ) | const [inline] |
Returns the edge-number to the given index of neighbour facet.
If ulNIndex is not a neighbour USHRT_MAX is returned.
Definition at line 879 of file Elements.h.
References _aulNeighbours.
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().
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.
Definition at line 812 of file Elements.h.
References _aulPoints.
Referenced by MeshCore::MeshTopoAlgorithm::CollapseEdge(), and MeshCore::MeshTopoAlgorithm::CollapseFacet().
unsigned long MeshCore::MeshFacet::_aulNeighbours[3] |
Indices of neighbour facets.
Definition at line 285 of file Elements.h.
Referenced by MeshCore::MeshKernel::AddFacet(), MeshCore::MeshTopoAlgorithm::CollapseEdge(), Mesh::MeshPy::collapseEdge(), MeshCore::MeshTopoAlgorithm::CollapseFacet(), MeshCore::MeshTopoAlgorithm::DelaunayFlip(), MeshCore::MeshEvalNeighbourhood::Evaluate(), MeshGui::ViewProviderMesh::faceInfo(), Mesh::Facet::Facet(), MeshCore::MeshFixDeformedFacets::Fixup(), FlipNormal(), MeshCore::MeshAlgorithm::GetBorderPoints(), MeshCore::MeshAlgorithm::GetFacetBorders(), MeshCore::MeshEvalNeighbourhood::GetIndices(), HasNeighbour(), MeshCore::MeshTopoAlgorithm::InsertVertex(), MeshCore::MeshTopoAlgorithm::InsertVertexAndSwapEdge(), MeshFacet(), operator=(), MeshCore::MeshKernel::RebuildNeighbours(), MeshCore::MeshTopoAlgorithm::RemoveCorruptedFacet(), MeshCore::MeshTopoAlgorithm::RemoveDegeneratedFacet(), ReplaceNeighbour(), SetNeighbours(), Side(), MeshCore::MeshTopoAlgorithm::SnapVertex(), MeshCore::MeshTopoAlgorithm::SplitEdge(), Mesh::MeshPy::splitEdge(), MeshCore::MeshTopoAlgorithm::SplitFacet(), MeshCore::MeshTopoAlgorithm::SplitOpenEdge(), MeshCore::MeshTopoAlgorithm::SwapEdge(), and Mesh::MeshPy::swapEdge().
unsigned long MeshCore::MeshFacet::_aulPoints[3] |
Indices of corner points.
Definition at line 284 of file Elements.h.
Referenced by MeshCore::MeshSearchNeighbours::AccumulateNeighbours(), CmdApproxSurface::activated(), MeshCore::MeshKernel::AddFacet(), MeshCore::MeshBuilder::AddFacet(), Mesh::MeshPy::addFacets(), Mesh::MeshObject::addFacets(), MeshCore::MeshTopoAlgorithm::AdjustEdgesToCurvatureDirection(), MeshCore::MeshKernel::AdjustNormal(), MeshCore::MeshSearchNeighbours::CheckDistToFacet(), MeshCore::MeshTopoAlgorithm::CollapseEdge(), MeshCore::MeshTopoAlgorithm::CollapseFacet(), MeshGui::SoFCMeshSegmentShape::computeBBox(), MeshPart::Mesher::createMesh(), Decrement(), MeshCore::MeshTopoAlgorithm::DelaunayFlip(), MeshCore::MeshKernel::DeleteFacets(), MeshCore::MeshInfo::DetailedEdgeInfo(), MeshCore::MeshEvalSelfIntersection::Evaluate(), MeshCore::MeshEvalOrientation::Evaluate(), MeshGui::ViewProviderMesh::faceInfo(), Mesh::Facet::Facet(), MeshCore::MeshAlgorithm::FillupHole(), FlipNormal(), MeshGui::SoFCMeshSegmentShape::generatePrimitives(), MeshCore::MeshAlgorithm::GetBorderPoints(), getBoundary_Conditions(), GetEdge(), MeshCore::MeshKernel::GetFacet(), MeshCore::MeshKernel::GetGravityPoint(), MeshCore::MeshEvalSelfIntersection::GetIntersections(), MeshCore::MeshKernel::GetNormal(), HasSameOrientation(), import_NASTRAN(), MeshCore::MeshTopoAlgorithm::InsertVertex(), IsDegenerated(), IsEqual(), MeshCore::MeshTopoAlgorithm::IsSwapEdgeLegal(), MeshCore::MeshInput::LoadNastran(), MeshFacet(), minBoundingBox(), MeshCore::MeshSearchNeighbours::NeighboursFacetFromFacet(), operator=(), MeshCore::MeshTopoAlgorithm::OptimizeTopology(), MeshGui::SoSFMeshFacetArray::read1Value(), Mesh::Interface< Kernel >::release(), MeshCore::MeshTopoAlgorithm::RemoveCorruptedFacet(), MeshCore::MeshTopoAlgorithm::RemoveDegeneratedFacet(), MeshCore::MeshFixDegeneratedFacets::RemoveEdgeTooSmall(), MeshVRML::Save(), MeshCore::MeshOutput::SaveInventor(), MeshCore::MeshOutput::SaveNastran(), MeshCore::MeshOutput::SavePLY(), Mesh::MeshObject::setFacets(), SetVertices(), MeshCore::MeshTopoAlgorithm::ShouldSwapEdge(), Side(), SMESH_PCA(), MeshCore::MeshTopoAlgorithm::SnapVertex(), MeshCore::MeshTopoAlgorithm::SplitEdge(), MeshCore::MeshTopoAlgorithm::SplitFacet(), MeshCore::MeshTopoAlgorithm::SplitOpenEdge(), MeshCore::MeshTopoAlgorithm::SwapEdge(), Transpose(), MeshCore::MeshSearchNeighbours::TriangleCutsSphere(), MeshCore::DelaunayTriangulator::Triangulate(), MeshCore::QuasiDelaunayTriangulator::Triangulate(), MeshCore::EarClippingTriangulator::Triangulate(), MeshCore::MeshSearchNeighbourFacetsVisitor::Visit(), MeshCore::MeshKernel::VisitNeighbourFacetsOverCorners(), and MeshGui::SoSFMeshFacetArray::write1Value().
unsigned char MeshCore::MeshFacet::_ucFlag |
Flag member.
Definition at line 282 of file Elements.h.
Referenced by MeshCore::MeshBuilder::AddFacet(), MeshCore::MeshFacetIterator::Dereference(), MeshCore::MeshKernel::GetFacet(), IsFlag(), operator=(), ResetFlag(), and SetFlag().
unsigned long MeshCore::MeshFacet::_ulProp |
Free usable property.
Definition at line 283 of file Elements.h.
Referenced by MeshCore::MeshBuilder::AddFacet(), MeshCore::MeshFacetIterator::Dereference(), SpringbackCorrection::FacetRegionGrowing(), MeshCore::MeshKernel::GetFacet(), operator=(), SetProperty(), and SpringbackCorrection::Visit().