Skip to content
Snippets Groups Projects
Commit 69c252e5 authored by Dr. Felix Tobias Schindler's avatar Dr. Felix Tobias Schindler
Browse files

[fitlers] add AllIntersectionsOnce

parent 5c183c9d
No related branches found
No related tags found
No related merge requests found
......@@ -362,6 +362,41 @@ public:
}; // class AllIntersections
/**
* \brief A filter which selects all intersections only once.
*
* \sa Walker
* \sa IntersectionFilter
*/
template <class GL>
class AllIntersectionsOnce : public IntersectionFilter<GL>
{
using BaseType = IntersectionFilter<GL>;
public:
using typename BaseType::GridViewType;
using typename BaseType::IntersectionType;
explicit AllIntersectionsOnce() = default;
IntersectionFilter<GridViewType>* copy() const override final
{
return new AllIntersectionsOnce<GridViewType>();
}
bool contains(const GridViewType& grid_layer, const IntersectionType& intersection) const override final
{
if (!intersection.neighbor())
return true;
else {
const auto inside_element = intersection.inside();
const auto outside_element = intersection.outside();
return grid_layer.indexSet().index(inside_element) < grid_layer.indexSet().index(outside_element);
}
}
}; // class AllIntersectionsOnce
/**
* \brief A filter which selects no intersections.
*
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment