Commit 552df716 authored by Pierre Kraemer's avatar Pierre Kraemer

correct Traversor3XY to skip boundary volumes

parent 1fc89677
......@@ -615,7 +615,7 @@ unsigned int GenericMap::getNbOrbits(const FunctorSelect& good)
template <typename MAP, unsigned int ORBIT, unsigned int INCIDENT>
unsigned int GenericMap::degree(Dart d)
{
assert(ORBIT != INCIDENT || !"degree does not manage adjacency counting");
assert(ORBIT != INCIDENT || !"degree does not manage adjacency counting") ;
Traversor<MAP>* t = TraversorFactory<MAP>::createIncident(*(reinterpret_cast<MAP*>(this)), d, dimension(), ORBIT, INCIDENT) ;
FunctorCount fcount ;
t->applyFunctor(fcount) ;
......
......@@ -69,8 +69,6 @@ private:
CellMarkerStore<ORBY>* m_cmark ;
Dart m_current ;
TraversorDartsOfOrbit<MAP, ORBX> m_tradoo;
// unsigned int m_orbx;
// unsigned int m_orby;
bool m_allocated;
bool m_first;
public:
......@@ -104,8 +102,6 @@ public:
};
/**
* Traverse vertices incident to volume
*/
......@@ -136,7 +132,6 @@ public:
Traversor3WF(MAP& m, Dart dart, bool forceDartMarker = false, unsigned int thread = 0) : Traversor3XY<MAP, VOLUME, FACE>(m, dart, forceDartMarker, thread) {}
};
/**
* Traverse vertices incident to face
*/
......@@ -167,7 +162,6 @@ public:
Traversor3FW(MAP& m, Dart dart, bool forceDartMarker = false, unsigned int thread = 0) : Traversor3XY<MAP, FACE, VOLUME>(m, dart, forceDartMarker, thread) {}
};
/**
* Traverse vertices incident to edge
*/
......@@ -198,8 +192,6 @@ public:
Traversor3EW(MAP& m, Dart dart, bool forceDartMarker = false, unsigned int thread = 0) : Traversor3XY<MAP, EDGE, VOLUME>(m, dart, forceDartMarker, thread) {}
};
/**
* Traverse edges incident to vertex
*/
......@@ -230,8 +222,6 @@ public:
Traversor3VW(MAP& m, Dart dart, bool forceDartMarker = false, unsigned int thread = 0) : Traversor3XY<MAP, VERTEX, VOLUME>(m, dart, forceDartMarker, thread) {}
};
/**
* Traverse vertices adjacent to a vertex by an edge
*/
......@@ -262,7 +252,6 @@ public:
Traversor3VVaW(MAP& m, Dart d, bool forceDartMarker = false, unsigned int thread = 0) : Traversor3XXaY<MAP, VERTEX, VOLUME>(m, d, forceDartMarker, thread) {}
};
/**
* Traverse edges adjacent to an egde by a vertex
*/
......@@ -293,7 +282,6 @@ public:
Traversor3EEaW(MAP& m, Dart d, bool forceDartMarker = false, unsigned int thread = 0) : Traversor3XXaY<MAP, EDGE, VOLUME>(m, d, forceDartMarker, thread) {}
};
/**
* Traverse faces adjacent to a face by a vertex
*/
......@@ -324,7 +312,6 @@ public:
Traversor3FFaW(MAP& m, Dart d, bool forceDartMarker = false, unsigned int thread = 0) : Traversor3XXaY<MAP, FACE, VOLUME>(m, d, forceDartMarker, thread) {}
};
/**
* Traverse volumes adjacent to a volume by a vertex
*/
......@@ -355,7 +342,6 @@ public:
Traversor3WWaF(MAP& m, Dart d, bool forceDartMarker = false, unsigned int thread = 0) : Traversor3XXaY<MAP, VOLUME, FACE>(m, d, forceDartMarker, thread) {}
};
} // namespace CGoGN
#include "Topology/generic/traversor3.hpp"
......
......@@ -141,7 +141,7 @@ Dart Traversor3XY<MAP, ORBX, ORBY>::begin()
else
m_dmark->unmarkAll();
}
m_first=false;
m_first = false;
m_current = m_tradoo.begin() ;
// for the case of beginning with a given MarkerForTraversor
......@@ -158,6 +158,13 @@ Dart Traversor3XY<MAP, ORBX, ORBY>::begin()
m_current = m_tradoo.next();
}
}
if(ORBY == VOLUME)
{
if(m_map.isBoundaryMarked(m_current))
m_current = next();
}
return m_current;
}
......@@ -176,6 +183,11 @@ Dart Traversor3XY<MAP, ORBX, ORBY>::next()
{
m_cmark->mark(m_current);
m_current = m_tradoo.next();
if(ORBY == VOLUME)
{
if(m_map.isBoundaryMarked(m_current))
m_cmark->mark(m_current);
}
while ((m_current != NIL) && m_cmark->isMarked(m_current))
m_current = m_tradoo.next();
}
......@@ -192,6 +204,22 @@ Dart Traversor3XY<MAP, ORBX, ORBY>::next()
else
m_dmark->markOrbit<ORBY>(m_current);
m_current = m_tradoo.next();
if(ORBY == VOLUME)
{
if(m_map.isBoundaryMarked(m_current))
{
if (ORBX == VOLUME)
{
// if allocated we are in a local traversal of volume so we can mark only darts of volume
if (m_allocated)
m_dmark->markOrbit<ORBY + MAP::IN_PARENT>(m_current);
else
m_dmark->markOrbit<ORBY>(m_current); // here we need to mark all the darts
}
else
m_dmark->markOrbit<ORBY>(m_current);
}
}
while ((m_current != NIL) && m_dmark->isMarked(m_current))
m_current = m_tradoo.next();
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment