Add method to find segment of a facet index

This commit is contained in:
wmayer 2012-05-30 17:32:55 +02:00
parent 93e0c6688d
commit 1cc9993954
2 changed files with 11 additions and 0 deletions

View File

@ -46,6 +46,16 @@ void MeshSurfaceSegment::AddSegment(const std::vector<unsigned long>& segm)
}
}
MeshSegment MeshSurfaceSegment::FindSegment(unsigned long index) const
{
for (std::vector<MeshSegment>::const_iterator it = segments.begin(); it != segments.end(); ++it) {
if (std::find(it->begin(), it->end(), index) != it->end())
return *it;
}
return MeshSegment();
}
// --------------------------------------------------------
MeshDistancePlanarSegment::MeshDistancePlanarSegment(const MeshKernel& mesh, unsigned long minFacets, float tol)

View File

@ -46,6 +46,7 @@ public:
virtual void AddFacet(const MeshFacet& rclFacet);
void AddSegment(const std::vector<unsigned long>&);
const std::vector<MeshSegment>& GetSegments() const { return segments; }
MeshSegment FindSegment(unsigned long) const;
protected:
std::vector<MeshSegment> segments;