The MeshSearchNeighbours class provides methods to get all points in the neighbourhood of a given facet. More...
#include <Tools.h>
Classes | |
struct | CDistRad |
Public Member Functions | |
MeshSearchNeighbours (const MeshKernel &rclM, float fSampleDistance=1.0f) | |
unsigned long | NeighboursFacetFromFacet (unsigned long ulFacetIdx, float fDistance, std::vector< Base::Vector3f > &raclResultPoints, std::vector< unsigned long > &raclResultFacets) |
Searches for facets from the start facet. | |
unsigned long | NeighboursFromFacet (unsigned long ulFacetIdx, float fDistance, unsigned long ulMinPoints, std::vector< Base::Vector3f > &raclResultPoints) |
Collects all neighbour points from the facet (by index), the result are the points of the facets lying inside a sphere of radius fDistance, center center of the original facet. | |
unsigned long | NeighboursFromSampledFacets (unsigned long ulFacetIdx, float fDistance, std::vector< Base::Vector3f > &raclResultPoints) |
Searches for facets from the start facet, sample the neighbour facets and accumulates the points. | |
void | Reinit (float fSampleDistance) |
Re-initilaizes internal structures. | |
virtual | ~MeshSearchNeighbours () |
Protected Member Functions | |
bool | AccumulateNeighbours (const MeshFacet &rclF, unsigned long ulFIdx) |
bool | CheckDistToFacet (const MeshFacet &rclF) |
bool | ExpandRadius (unsigned long ulMinPoints) |
bool | InnerPoint (const Base::Vector3f &rclPt) const |
void | SampleAllFacets (void) |
Subsamples the mesh. | |
bool | TriangleCutsSphere (const MeshFacet &rclF) const |
Protected Attributes | |
std::set< unsigned long > | _aclOuter |
std::vector< Base::Vector3f > | _aclPointsResult |
std::set< unsigned long > | _aclResult |
std::vector< std::vector < Base::Vector3f > > | _aclSampledFacets |
Wm4::Sphere3< float > | _akSphere |
bool | _bTooFewPoints |
Base::Vector3f | _clCenter |
MeshRefPointToFacets | _clPt2Fa |
float | _fMaxDistanceP2 |
float | _fSampleDistance |
const MeshFacetArray & | _rclFAry |
const MeshKernel & | _rclMesh |
const MeshPointArray & | _rclPAry |
The MeshSearchNeighbours class provides methods to get all points in the neighbourhood of a given facet.
Definition at line 43 of file Mod/Mesh/App/Core/Tools.h.
MeshSearchNeighbours::MeshSearchNeighbours | ( | const MeshKernel & | rclM, | |
float | fSampleDistance = 1.0f | |||
) |
Definition at line 36 of file Mod/Mesh/App/Core/Tools.cpp.
References _rclMesh, MeshCore::MeshPoint::MARKED, and MeshCore::MeshFacet::MARKED.
virtual MeshCore::MeshSearchNeighbours::~MeshSearchNeighbours | ( | ) | [inline, virtual] |
Definition at line 47 of file Mod/Mesh/App/Core/Tools.h.
bool MeshSearchNeighbours::AccumulateNeighbours | ( | const MeshFacet & | rclF, | |
unsigned long | ulFIdx | |||
) | [protected] |
Definition at line 212 of file Mod/Mesh/App/Core/Tools.cpp.
References _aclOuter, _aclPointsResult, _aclResult, _aclSampledFacets, MeshCore::MeshFacet::_aulPoints, _clCenter, _fMaxDistanceP2, _rclPAry, Base::DistanceP2(), InnerPoint(), k, and TriangleCutsSphere().
Referenced by NeighboursFromSampledFacets().
bool MeshCore::MeshSearchNeighbours::CheckDistToFacet | ( | const MeshFacet & | rclF | ) | [inline, protected] |
Definition at line 97 of file Mod/Mesh/App/Core/Tools.h.
References _aclOuter, _aclResult, MeshCore::MeshFacet::_aulPoints, _clCenter, _fMaxDistanceP2, _rclPAry, Base::DistanceP2(), MeshCore::MeshPoint::MARKED, and MeshCore::MeshPointArray::SetFlag().
Referenced by NeighboursFacetFromFacet(), and NeighboursFromFacet().
bool MeshSearchNeighbours::ExpandRadius | ( | unsigned long | ulMinPoints | ) | [protected] |
Definition at line 248 of file Mod/Mesh/App/Core/Tools.cpp.
References _aclOuter, _aclResult, _fMaxDistanceP2, _rclPAry, and MeshCore::MeshPoint::MARKED.
Referenced by NeighboursFromFacet().
bool MeshCore::MeshSearchNeighbours::InnerPoint | ( | const Base::Vector3f & | rclPt | ) | const [inline, protected] |
Definition at line 121 of file Mod/Mesh/App/Core/Tools.h.
References _clCenter, _fMaxDistanceP2, and Base::DistanceP2().
Referenced by AccumulateNeighbours(), and NeighboursFromSampledFacets().
unsigned long MeshSearchNeighbours::NeighboursFacetFromFacet | ( | unsigned long | ulFacetIdx, | |
float | fDistance, | |||
std::vector< Base::Vector3f > & | raclResultPoints, | |||
std::vector< unsigned long > & | raclResultFacets | |||
) |
Searches for facets from the start facet.
Definition at line 263 of file Mod/Mesh/App/Core/Tools.cpp.
References _aclOuter, _aclResult, MeshCore::MeshFacet::_aulPoints, _clCenter, _clPt2Fa, _fMaxDistanceP2, _rclFAry, _rclMesh, _rclPAry, CheckDistToFacet(), Base::DistanceP2(), MeshCore::MeshKernel::GetFacet(), MeshCore::MeshGeomFacet::GetGravityPoint(), MeshCore::MeshFacet::IsFlag(), MeshCore::MeshPoint::MARKED, MeshCore::MeshFacet::MARKED, MeshCore::MeshFacet::SetFlag(), and MeshCore::MeshFacetArray::SetFlag().
unsigned long MeshSearchNeighbours::NeighboursFromFacet | ( | unsigned long | ulFacetIdx, | |
float | fDistance, | |||
unsigned long | ulMinPoints, | |||
std::vector< Base::Vector3f > & | raclResultPoints | |||
) |
Collects all neighbour points from the facet (by index), the result are the points of the facets lying inside a sphere of radius fDistance, center center of the original facet.
This method uses the MARKED flags.
Definition at line 54 of file Mod/Mesh/App/Core/Tools.cpp.
References _aclOuter, _aclResult, _clCenter, _clPt2Fa, _fMaxDistanceP2, _rclFAry, _rclMesh, _rclPAry, CheckDistToFacet(), ExpandRadius(), MeshCore::MeshKernel::GetFacet(), MeshCore::MeshGeomFacet::GetGravityPoint(), MeshCore::MeshFacet::IsFlag(), MeshCore::MeshPoint::MARKED, MeshCore::MeshFacet::MARKED, MeshCore::MeshFacet::SetFlag(), and MeshCore::MeshFacetArray::SetFlag().
unsigned long MeshSearchNeighbours::NeighboursFromSampledFacets | ( | unsigned long | ulFacetIdx, | |
float | fDistance, | |||
std::vector< Base::Vector3f > & | raclResultPoints | |||
) |
Searches for facets from the start facet, sample the neighbour facets and accumulates the points.
Definition at line 150 of file Mod/Mesh/App/Core/Tools.cpp.
References _aclOuter, _aclPointsResult, _aclResult, _akSphere, _clCenter, _clPt2Fa, _fMaxDistanceP2, _rclFAry, _rclMesh, _rclPAry, AccumulateNeighbours(), Wm4::Sphere3< Real >::Center, draftlibs::dxfLibrary::copy, MeshCore::MeshKernel::GetFacet(), MeshCore::MeshGeomFacet::GetGravityPoint(), InnerPoint(), MeshCore::MeshFacet::IsFlag(), MeshCore::MeshFacet::MARKED, Wm4::Sphere3< Real >::Radius, SampleAllFacets(), MeshCore::MeshFacet::SetFlag(), MeshCore::MeshFacetArray::SetFlag(), Base::Vector3< _Precision >::x, Base::Vector3< _Precision >::y, and Base::Vector3< _Precision >::z.
void MeshSearchNeighbours::Reinit | ( | float | fSampleDistance | ) |
Re-initilaizes internal structures.
Definition at line 47 of file Mod/Mesh/App/Core/Tools.cpp.
References _fSampleDistance, _rclMesh, MeshCore::MeshPoint::MARKED, and MeshCore::MeshFacet::MARKED.
void MeshSearchNeighbours::SampleAllFacets | ( | void | ) | [protected] |
Subsamples the mesh.
Definition at line 134 of file Mod/Mesh/App/Core/Tools.cpp.
References _aclSampledFacets, _fSampleDistance, _rclMesh, draftlibs::dxfLibrary::copy, MeshCore::MeshKernel::CountFacets(), MeshCore::MeshFacetIterator::Init(), MeshCore::MeshFacetIterator::More(), and MeshCore::MeshFacetIterator::Next().
Referenced by NeighboursFromSampledFacets().
bool MeshCore::MeshSearchNeighbours::TriangleCutsSphere | ( | const MeshFacet & | rclF | ) | const [inline, protected] |
Definition at line 126 of file Mod/Mesh/App/Core/Tools.h.
References _akSphere, MeshCore::MeshFacet::_aulPoints, _rclPAry, Wm4::Sphere3< Real >::Center, Wm4::DistVector3Triangle3< Real >::GetSquared(), Wm4::Sphere3< Real >::Radius, Base::Vector3< _Precision >::x, Base::Vector3< _Precision >::y, and Base::Vector3< _Precision >::z.
Referenced by AccumulateNeighbours().
std::set<unsigned long> MeshCore::MeshSearchNeighbours::_aclOuter [protected] |
Definition at line 85 of file Mod/Mesh/App/Core/Tools.h.
Referenced by AccumulateNeighbours(), CheckDistToFacet(), ExpandRadius(), NeighboursFacetFromFacet(), NeighboursFromFacet(), and NeighboursFromSampledFacets().
std::vector<Base::Vector3f> MeshCore::MeshSearchNeighbours::_aclPointsResult [protected] |
Definition at line 86 of file Mod/Mesh/App/Core/Tools.h.
Referenced by AccumulateNeighbours(), and NeighboursFromSampledFacets().
std::set<unsigned long> MeshCore::MeshSearchNeighbours::_aclResult [protected] |
Definition at line 84 of file Mod/Mesh/App/Core/Tools.h.
Referenced by AccumulateNeighbours(), CheckDistToFacet(), ExpandRadius(), NeighboursFacetFromFacet(), NeighboursFromFacet(), and NeighboursFromSampledFacets().
std::vector<std::vector<Base::Vector3f> > MeshCore::MeshSearchNeighbours::_aclSampledFacets [protected] |
Definition at line 87 of file Mod/Mesh/App/Core/Tools.h.
Referenced by AccumulateNeighbours(), and SampleAllFacets().
Wm4::Sphere3<float> MeshCore::MeshSearchNeighbours::_akSphere [protected] |
Definition at line 89 of file Mod/Mesh/App/Core/Tools.h.
Referenced by NeighboursFromSampledFacets(), and TriangleCutsSphere().
bool MeshCore::MeshSearchNeighbours::_bTooFewPoints [protected] |
Definition at line 90 of file Mod/Mesh/App/Core/Tools.h.
Definition at line 83 of file Mod/Mesh/App/Core/Tools.h.
Referenced by AccumulateNeighbours(), CheckDistToFacet(), InnerPoint(), NeighboursFacetFromFacet(), NeighboursFromFacet(), and NeighboursFromSampledFacets().
Definition at line 81 of file Mod/Mesh/App/Core/Tools.h.
Referenced by NeighboursFacetFromFacet(), NeighboursFromFacet(), and NeighboursFromSampledFacets().
float MeshCore::MeshSearchNeighbours::_fMaxDistanceP2 [protected] |
Definition at line 82 of file Mod/Mesh/App/Core/Tools.h.
Referenced by AccumulateNeighbours(), CheckDistToFacet(), ExpandRadius(), InnerPoint(), NeighboursFacetFromFacet(), NeighboursFromFacet(), and NeighboursFromSampledFacets().
float MeshCore::MeshSearchNeighbours::_fSampleDistance [protected] |
Definition at line 88 of file Mod/Mesh/App/Core/Tools.h.
Referenced by Reinit(), and SampleAllFacets().
const MeshFacetArray& MeshCore::MeshSearchNeighbours::_rclFAry [protected] |
Definition at line 79 of file Mod/Mesh/App/Core/Tools.h.
Referenced by NeighboursFacetFromFacet(), NeighboursFromFacet(), and NeighboursFromSampledFacets().
const MeshKernel& MeshCore::MeshSearchNeighbours::_rclMesh [protected] |
Definition at line 78 of file Mod/Mesh/App/Core/Tools.h.
Referenced by MeshSearchNeighbours(), NeighboursFacetFromFacet(), NeighboursFromFacet(), NeighboursFromSampledFacets(), Reinit(), and SampleAllFacets().
const MeshPointArray& MeshCore::MeshSearchNeighbours::_rclPAry [protected] |
Definition at line 80 of file Mod/Mesh/App/Core/Tools.h.
Referenced by AccumulateNeighbours(), CheckDistToFacet(), ExpandRadius(), NeighboursFacetFromFacet(), NeighboursFromFacet(), NeighboursFromSampledFacets(), and TriangleCutsSphere().