33#ifndef __H__UG_remove_duplicates_util
34#define __H__UG_remove_duplicates_util
43template <
class TElemIter>
46 typedef typename TElemIter::value_type TElemPtr;
52 std::vector<std::pair<TElem*, TElem*> > doubles;
55 for(TElemIter iter = elemsBegin; iter != elemsEnd; ++iter){
58 typename TElem::ConstVertexArray vrts = e->vertices();
59 const size_t numVrts = e->num_vertices();
61 bool allMarked =
true;
62 for(
size_t i = 0; i < numVrts; ++i){
69 bool isDouble =
false;
75 for(
size_t i = 0; i < elems.size(); ++i){
80 doubles.push_back(std::make_pair(e, te));
89 for(
size_t i = 0; i < numVrts; ++i)
98 for(
size_t i = 0; i < doubles.size(); ++i){
102 grid.
erase(doubles[i].first);
Manages the elements of a grid and their interconnection.
Definition grid.h:132
void end_marking()
ends a marking sequence. Call this method when you're done with marking.
Definition grid.cpp:1285
bool is_marked(GridObject *obj) const
returns true if the object is marked, false if not.
Definition grid_impl.hpp:843
void mark(GridObject *obj)
marks the object. Calls are only valid between calls to Grid::begin_marking and Grid::end_marking.
Definition grid_impl.hpp:773
void erase(GridObject *geomObj)
Definition grid.cpp:459
void begin_marking()
begin marking.
Definition grid.cpp:1262
void objects_will_be_merged(Vertex *target, Vertex *elem1, Vertex *elem2)
notifies the grid that two objects will be merged.
Definition grid_impl.hpp:244
void associated_elements(traits< Vertex >::secure_container &elemsOut, TElem *e)
Puts all elements of type TAss which are contained in 'e' or which contain 'e' into elemsOut.
Definition grid_impl.hpp:466
bool CompareVertices(const FaceVertices *fv1, const FaceVertices *fv2)
Checks whether fv1 and fv2 contain the same vertices.
Definition grid_util.cpp:44
void RemoveDuplicates(Grid &grid, TElemIter elemsBegin, TElemIter elemsEnd)
Removes elements which share the same set of vertices with other elements in the given range.
Definition remove_duplicates_util.h:44
PointerConstArray< TElem * > secure_container
Definition grid.h:146
void base_type
Definition grid_base_objects.h:1011