Commit 026b5ffd authored by Sylvain Thery's avatar Sylvain Thery
Browse files

update Traversor2Virts

parent 279b47b7
...@@ -471,7 +471,6 @@ Dart Traversor2EEaF<MAP>::next() ...@@ -471,7 +471,6 @@ Dart Traversor2EEaF<MAP>::next()
} }
else if (current == stop2) else if (current == stop2)
current = NIL ; current = NIL ;
} }
return current ; return current ;
} }
......
...@@ -40,13 +40,13 @@ template <typename MAP> ...@@ -40,13 +40,13 @@ template <typename MAP>
class VTraversor2VE: public Traversor class VTraversor2VE: public Traversor
{ {
private: private:
MAP& m ; const MAP& m ;
Dart start ; Dart start ;
Dart current ; Dart current ;
const std::vector<Dart>* m_QLT; const std::vector<Dart>* m_QLT;
std::vector<Dart>::const_iterator m_ItDarts; std::vector<Dart>::const_iterator m_ItDarts;
public: public:
VTraversor2VE(MAP& map, Dart dart) ; VTraversor2VE(const MAP& map, Dart dart) ;
Dart begin() ; Dart begin() ;
Dart end() ; Dart end() ;
...@@ -58,13 +58,13 @@ template <typename MAP> ...@@ -58,13 +58,13 @@ template <typename MAP>
class VTraversor2VF : public Traversor class VTraversor2VF : public Traversor
{ {
private: private:
MAP& m ; const MAP& m ;
Dart start ; Dart start ;
Dart current ; Dart current ;
const std::vector<Dart>* m_QLT; const std::vector<Dart>* m_QLT;
std::vector<Dart>::const_iterator m_ItDarts; std::vector<Dart>::const_iterator m_ItDarts;
public: public:
VTraversor2VF(MAP& map, Dart dart) ; VTraversor2VF(const MAP& map, Dart dart) ;
Dart begin() ; Dart begin() ;
Dart end() ; Dart end() ;
...@@ -76,13 +76,13 @@ template <typename MAP> ...@@ -76,13 +76,13 @@ template <typename MAP>
class VTraversor2VVaE : public Traversor class VTraversor2VVaE : public Traversor
{ {
private: private:
MAP& m ; const MAP& m ;
Dart start ; Dart start ;
Dart current ; Dart current ;
const std::vector<Dart>* m_QLT; const std::vector<Dart>* m_QLT;
std::vector<Dart>::const_iterator m_ItDarts; std::vector<Dart>::const_iterator m_ItDarts;
public: public:
VTraversor2VVaE(MAP& map, Dart dart) ; VTraversor2VVaE(const MAP& map, Dart dart) ;
Dart begin() ; Dart begin() ;
Dart end() ; Dart end() ;
...@@ -94,7 +94,7 @@ template <typename MAP> ...@@ -94,7 +94,7 @@ template <typename MAP>
class VTraversor2VVaF : public Traversor class VTraversor2VVaF : public Traversor
{ {
private: private:
MAP& m ; const MAP& m ;
Dart start ; Dart start ;
Dart current ; Dart current ;
...@@ -102,7 +102,7 @@ private: ...@@ -102,7 +102,7 @@ private:
const std::vector<Dart>* m_QLT; const std::vector<Dart>* m_QLT;
std::vector<Dart>::const_iterator m_ItDarts; std::vector<Dart>::const_iterator m_ItDarts;
public: public:
VTraversor2VVaF(MAP& map, Dart dart) ; VTraversor2VVaF(const MAP& map, Dart dart) ;
Dart begin() ; Dart begin() ;
Dart end() ; Dart end() ;
...@@ -118,13 +118,13 @@ template <typename MAP> ...@@ -118,13 +118,13 @@ template <typename MAP>
class VTraversor2EV : public Traversor class VTraversor2EV : public Traversor
{ {
private: private:
MAP& m ; const MAP& m ;
Dart start ; Dart start ;
Dart current ; Dart current ;
const std::vector<Dart>* m_QLT; const std::vector<Dart>* m_QLT;
std::vector<Dart>::const_iterator m_ItDarts; std::vector<Dart>::const_iterator m_ItDarts;
public: public:
VTraversor2EV(MAP& map, Dart dart) ; VTraversor2EV(const MAP& map, Dart dart) ;
Dart begin() ; Dart begin() ;
Dart end() ; Dart end() ;
...@@ -136,13 +136,13 @@ template <typename MAP> ...@@ -136,13 +136,13 @@ template <typename MAP>
class VTraversor2EF : public Traversor class VTraversor2EF : public Traversor
{ {
private: private:
MAP& m ; const MAP& m ;
Dart start ; Dart start ;
Dart current ; Dart current ;
const std::vector<Dart>* m_QLT; const std::vector<Dart>* m_QLT;
std::vector<Dart>::const_iterator m_ItDarts; std::vector<Dart>::const_iterator m_ItDarts;
public: public:
VTraversor2EF(MAP& map, Dart dart) ; VTraversor2EF(const MAP& map, Dart dart) ;
Dart begin() ; Dart begin() ;
Dart end() ; Dart end() ;
...@@ -154,7 +154,7 @@ template <typename MAP> ...@@ -154,7 +154,7 @@ template <typename MAP>
class VTraversor2EEaV : public Traversor class VTraversor2EEaV : public Traversor
{ {
private: private:
MAP& m ; const MAP& m ;
Dart start ; Dart start ;
Dart current ; Dart current ;
...@@ -162,7 +162,7 @@ private: ...@@ -162,7 +162,7 @@ private:
const std::vector<Dart>* m_QLT; const std::vector<Dart>* m_QLT;
std::vector<Dart>::const_iterator m_ItDarts; std::vector<Dart>::const_iterator m_ItDarts;
public: public:
VTraversor2EEaV(MAP& map, Dart dart) ; VTraversor2EEaV(const MAP& map, Dart dart) ;
Dart begin() ; Dart begin() ;
Dart end() ; Dart end() ;
...@@ -174,7 +174,7 @@ template <typename MAP> ...@@ -174,7 +174,7 @@ template <typename MAP>
class VTraversor2EEaF : public Traversor class VTraversor2EEaF : public Traversor
{ {
private: private:
MAP& m ; const MAP& m ;
Dart start ; Dart start ;
Dart current ; Dart current ;
...@@ -182,7 +182,7 @@ private: ...@@ -182,7 +182,7 @@ private:
const std::vector<Dart>* m_QLT; const std::vector<Dart>* m_QLT;
std::vector<Dart>::const_iterator m_ItDarts; std::vector<Dart>::const_iterator m_ItDarts;
public: public:
VTraversor2EEaF(MAP& map, Dart dart) ; VTraversor2EEaF(const MAP& map, Dart dart) ;
Dart begin() ; Dart begin() ;
Dart end() ; Dart end() ;
...@@ -198,13 +198,13 @@ template <typename MAP> ...@@ -198,13 +198,13 @@ template <typename MAP>
class VTraversor2FV : public Traversor class VTraversor2FV : public Traversor
{ {
private: private:
MAP& m ; const MAP& m ;
Dart start ; Dart start ;
Dart current ; Dart current ;
const std::vector<Dart>* m_QLT; const std::vector<Dart>* m_QLT;
std::vector<Dart>::const_iterator m_ItDarts; std::vector<Dart>::const_iterator m_ItDarts;
public: public:
VTraversor2FV(MAP& map, Dart dart) ; VTraversor2FV(const MAP& map, Dart dart) ;
Dart begin() ; Dart begin() ;
Dart end() ; Dart end() ;
...@@ -217,7 +217,7 @@ template <typename MAP> ...@@ -217,7 +217,7 @@ template <typename MAP>
class VTraversor2FE: public VTraversor2FV<MAP> class VTraversor2FE: public VTraversor2FV<MAP>
{ {
public: public:
VTraversor2FE(MAP& map, Dart dart):VTraversor2FV<MAP>(map,dart){} VTraversor2FE(const MAP& map, Dart dart):VTraversor2FV<MAP>(map,dart){}
} ; } ;
// Traverse the faces adjacent to a given face through sharing a common vertex // Traverse the faces adjacent to a given face through sharing a common vertex
...@@ -225,7 +225,7 @@ template <typename MAP> ...@@ -225,7 +225,7 @@ template <typename MAP>
class VTraversor2FFaV : public Traversor class VTraversor2FFaV : public Traversor
{ {
private: private:
MAP& m ; const MAP& m ;
Dart start ; Dart start ;
Dart current ; Dart current ;
...@@ -233,7 +233,7 @@ private: ...@@ -233,7 +233,7 @@ private:
const std::vector<Dart>* m_QLT; const std::vector<Dart>* m_QLT;
std::vector<Dart>::const_iterator m_ItDarts; std::vector<Dart>::const_iterator m_ItDarts;
public: public:
VTraversor2FFaV(MAP& map, Dart dart) ; VTraversor2FFaV(const MAP& map, Dart dart) ;
Dart begin() ; Dart begin() ;
Dart end() ; Dart end() ;
...@@ -245,13 +245,13 @@ template <typename MAP> ...@@ -245,13 +245,13 @@ template <typename MAP>
class VTraversor2FFaE : public Traversor class VTraversor2FFaE : public Traversor
{ {
private: private:
MAP& m ; const MAP& m ;
Dart start ; Dart start ;
Dart current ; Dart current ;
const std::vector<Dart>* m_QLT; const std::vector<Dart>* m_QLT;
std::vector<Dart>::const_iterator m_ItDarts; std::vector<Dart>::const_iterator m_ItDarts;
public: public:
VTraversor2FFaE(MAP& map, Dart dart) ; VTraversor2FFaE(const MAP& map, Dart dart) ;
Dart begin() ; Dart begin() ;
Dart end() ; Dart end() ;
......
...@@ -32,7 +32,7 @@ namespace CGoGN ...@@ -32,7 +32,7 @@ namespace CGoGN
// VTraversor2VE // VTraversor2VE
template <typename MAP> template <typename MAP>
VTraversor2VE<MAP>::VTraversor2VE(MAP& map, Dart dart) : m(map), start(dart),m_QLT(NULL) VTraversor2VE<MAP>::VTraversor2VE(const MAP& map, Dart dart) : m(map), start(dart),m_QLT(NULL)
{ {
const AttributeMultiVector<NoTypeNameAttribute<std::vector<Dart> > >* quickTraversal = map.template getQuickIncidentTraversal<VERTEX,EDGE>() ; const AttributeMultiVector<NoTypeNameAttribute<std::vector<Dart> > >* quickTraversal = map.template getQuickIncidentTraversal<VERTEX,EDGE>() ;
if (quickTraversal != NULL) if (quickTraversal != NULL)
...@@ -81,7 +81,7 @@ Dart VTraversor2VE<MAP>::next() ...@@ -81,7 +81,7 @@ Dart VTraversor2VE<MAP>::next()
// VTraversor2VF // VTraversor2VF
template <typename MAP> template <typename MAP>
VTraversor2VF<MAP>::VTraversor2VF(MAP& map, Dart dart) : m(map), start(dart),m_QLT(NULL) VTraversor2VF<MAP>::VTraversor2VF(const MAP& map, Dart dart) : m(map), start(dart),m_QLT(NULL)
{ {
const AttributeMultiVector<NoTypeNameAttribute<std::vector<Dart> > >* quickTraversal = map.template getQuickIncidentTraversal<VERTEX,FACE>() ; const AttributeMultiVector<NoTypeNameAttribute<std::vector<Dart> > >* quickTraversal = map.template getQuickIncidentTraversal<VERTEX,FACE>() ;
if (quickTraversal != NULL) if (quickTraversal != NULL)
...@@ -135,7 +135,7 @@ Dart VTraversor2VF<MAP>::next() ...@@ -135,7 +135,7 @@ Dart VTraversor2VF<MAP>::next()
// VTraversor2VVaE // VTraversor2VVaE
template <typename MAP> template <typename MAP>
VTraversor2VVaE<MAP>::VTraversor2VVaE(MAP& map, Dart dart) : m(map),m_QLT(NULL) VTraversor2VVaE<MAP>::VTraversor2VVaE(const MAP& map, Dart dart) : m(map),m_QLT(NULL)
{ {
const AttributeMultiVector<NoTypeNameAttribute<std::vector<Dart> > >* quickTraversal = map.template getQuickAdjacentTraversal<VERTEX,EDGE>() ; const AttributeMultiVector<NoTypeNameAttribute<std::vector<Dart> > >* quickTraversal = map.template getQuickAdjacentTraversal<VERTEX,EDGE>() ;
if (quickTraversal != NULL) if (quickTraversal != NULL)
...@@ -186,7 +186,7 @@ Dart VTraversor2VVaE<MAP>::next() ...@@ -186,7 +186,7 @@ Dart VTraversor2VVaE<MAP>::next()
// VTraversor2VVaF // VTraversor2VVaF
template <typename MAP> template <typename MAP>
VTraversor2VVaF<MAP>::VTraversor2VVaF(MAP& map, Dart dart) : m(map),m_QLT(NULL) VTraversor2VVaF<MAP>::VTraversor2VVaF(const MAP& map, Dart dart) : m(map),m_QLT(NULL)
{ {
const AttributeMultiVector<NoTypeNameAttribute<std::vector<Dart> > >* quickTraversal = map.template getQuickAdjacentTraversal<VERTEX,FACE>() ; const AttributeMultiVector<NoTypeNameAttribute<std::vector<Dart> > >* quickTraversal = map.template getQuickAdjacentTraversal<VERTEX,FACE>() ;
if (quickTraversal != NULL) if (quickTraversal != NULL)
...@@ -260,7 +260,7 @@ Dart VTraversor2VVaF<MAP>::next() ...@@ -260,7 +260,7 @@ Dart VTraversor2VVaF<MAP>::next()
// VTraversor2EV // VTraversor2EV
template <typename MAP> template <typename MAP>
VTraversor2EV<MAP>::VTraversor2EV(MAP& map, Dart dart) : m(map), start(dart),m_QLT(NULL) VTraversor2EV<MAP>::VTraversor2EV(const MAP& map, Dart dart) : m(map), start(dart),m_QLT(NULL)
{ {
const AttributeMultiVector<NoTypeNameAttribute<std::vector<Dart> > >* quickTraversal = map.template getQuickIncidentTraversal<EDGE,VERTEX>() ; const AttributeMultiVector<NoTypeNameAttribute<std::vector<Dart> > >* quickTraversal = map.template getQuickIncidentTraversal<EDGE,VERTEX>() ;
if (quickTraversal != NULL) if (quickTraversal != NULL)
...@@ -307,7 +307,7 @@ Dart VTraversor2EV<MAP>::next() ...@@ -307,7 +307,7 @@ Dart VTraversor2EV<MAP>::next()
// VTraversor2EF // VTraversor2EF
template <typename MAP> template <typename MAP>
VTraversor2EF<MAP>::VTraversor2EF(MAP& map, Dart dart) : m(map), start(dart),m_QLT(NULL) VTraversor2EF<MAP>::VTraversor2EF(const MAP& map, Dart dart) : m(map), start(dart),m_QLT(NULL)
{ {
const AttributeMultiVector<NoTypeNameAttribute<std::vector<Dart> > >* quickTraversal = map.template getQuickIncidentTraversal<EDGE,FACE>() ; const AttributeMultiVector<NoTypeNameAttribute<std::vector<Dart> > >* quickTraversal = map.template getQuickIncidentTraversal<EDGE,FACE>() ;
if (quickTraversal != NULL) if (quickTraversal != NULL)
...@@ -359,7 +359,7 @@ Dart VTraversor2EF<MAP>::next() ...@@ -359,7 +359,7 @@ Dart VTraversor2EF<MAP>::next()
// VTraversor2EEaV // VTraversor2EEaV
template <typename MAP> template <typename MAP>
VTraversor2EEaV<MAP>::VTraversor2EEaV(MAP& map, Dart dart) : m(map),m_QLT(NULL) VTraversor2EEaV<MAP>::VTraversor2EEaV(const MAP& map, Dart dart) : m(map),m_QLT(NULL)
{ {
const AttributeMultiVector<NoTypeNameAttribute<std::vector<Dart> > >* quickTraversal = map.template getQuickAdjacentTraversal<EDGE,VERTEX>() ; const AttributeMultiVector<NoTypeNameAttribute<std::vector<Dart> > >* quickTraversal = map.template getQuickAdjacentTraversal<EDGE,VERTEX>() ;
if (quickTraversal != NULL) if (quickTraversal != NULL)
...@@ -414,7 +414,7 @@ Dart VTraversor2EEaV<MAP>::next() ...@@ -414,7 +414,7 @@ Dart VTraversor2EEaV<MAP>::next()
// VTraversor2EEaF // VTraversor2EEaF
template <typename MAP> template <typename MAP>
VTraversor2EEaF<MAP>::VTraversor2EEaF(MAP& map, Dart dart) : m(map),m_QLT(NULL) VTraversor2EEaF<MAP>::VTraversor2EEaF(const MAP& map, Dart dart) : m(map),m_QLT(NULL)
{ {
const AttributeMultiVector<NoTypeNameAttribute<std::vector<Dart> > >* quickTraversal = map.template getQuickAdjacentTraversal<EDGE,FACE>() ; const AttributeMultiVector<NoTypeNameAttribute<std::vector<Dart> > >* quickTraversal = map.template getQuickAdjacentTraversal<EDGE,FACE>() ;
if (quickTraversal != NULL) if (quickTraversal != NULL)
...@@ -423,9 +423,12 @@ VTraversor2EEaF<MAP>::VTraversor2EEaF(MAP& map, Dart dart) : m(map),m_QLT(NULL) ...@@ -423,9 +423,12 @@ VTraversor2EEaF<MAP>::VTraversor2EEaF(MAP& map, Dart dart) : m(map),m_QLT(NULL)
} }
else else
{ {
start = m.phi1(dart) ; if (m.isBoundaryMarked2(dart))
stop1 = dart ; stop1 = m.phi2(dart);
stop2 = m.phi2(dart) ; else
stop1 = dart;
stop2 = m.phi2(stop1) ;
start = m.phi1(stop1);
} }
} }
...@@ -458,9 +461,14 @@ Dart VTraversor2EEaF<MAP>::next() ...@@ -458,9 +461,14 @@ Dart VTraversor2EEaF<MAP>::next()
if(current != NIL) if(current != NIL)
{ {
current = m.phi1(current) ; current = m.phi1(current) ;
if(current == stop1) if (current == stop1)
current = m.phi1(stop2) ; {
else if(current == stop2) if (!m.isBoundaryMarked2(stop2))
current = m.phi1(stop2) ;
else
current=NIL;
}
else if (current == stop2)
current = NIL ; current = NIL ;
} }
return current ; return current ;
...@@ -473,7 +481,7 @@ Dart VTraversor2EEaF<MAP>::next() ...@@ -473,7 +481,7 @@ Dart VTraversor2EEaF<MAP>::next()
// VTraversor2FV // VTraversor2FV
template <typename MAP> template <typename MAP>
VTraversor2FV<MAP>::VTraversor2FV(MAP& map, Dart dart) : m(map), start(dart),m_QLT(NULL) VTraversor2FV<MAP>::VTraversor2FV(const MAP& map, Dart dart) : m(map), start(dart),m_QLT(NULL)
{ {
const AttributeMultiVector<NoTypeNameAttribute<std::vector<Dart> > >* quickTraversal = map.template getQuickIncidentTraversal<FACE,VERTEX>() ; const AttributeMultiVector<NoTypeNameAttribute<std::vector<Dart> > >* quickTraversal = map.template getQuickIncidentTraversal<FACE,VERTEX>() ;
if (quickTraversal != NULL) if (quickTraversal != NULL)
...@@ -520,7 +528,7 @@ Dart VTraversor2FV<MAP>::next() ...@@ -520,7 +528,7 @@ Dart VTraversor2FV<MAP>::next()
// VTraversor2FFaV // VTraversor2FFaV
template <typename MAP> template <typename MAP>
VTraversor2FFaV<MAP>::VTraversor2FFaV(MAP& map, Dart dart) : m(map),m_QLT(NULL) VTraversor2FFaV<MAP>::VTraversor2FFaV(const MAP& map, Dart dart) : m(map),m_QLT(NULL)
{ {
const AttributeMultiVector<NoTypeNameAttribute<std::vector<Dart> > >* quickTraversal = map.template getQuickAdjacentTraversal<FACE,VERTEX>() ; const AttributeMultiVector<NoTypeNameAttribute<std::vector<Dart> > >* quickTraversal = map.template getQuickAdjacentTraversal<FACE,VERTEX>() ;
if (quickTraversal != NULL) if (quickTraversal != NULL)
...@@ -530,12 +538,12 @@ VTraversor2FFaV<MAP>::VTraversor2FFaV(MAP& map, Dart dart) : m(map),m_QLT(NULL) ...@@ -530,12 +538,12 @@ VTraversor2FFaV<MAP>::VTraversor2FFaV(MAP& map, Dart dart) : m(map),m_QLT(NULL)
else else
{ {
start = m.phi2(m.phi_1(m.phi2(m.phi_1(dart)))) ; start = m.phi2(m.phi_1(m.phi2(m.phi_1(dart)))) ;
current = start ; while (start == dart)
if(start == dart)
{ {
stop = m.phi2(m.phi_1(dart)) ; dart = m.phi1(dart);
start = next() ; start = m.phi2(m.phi_1(m.phi2(m.phi_1(dart)))) ;
} }
current = start ;
stop = dart ; stop = dart ;
if(m.isBoundaryMarked2(start)) if(m.isBoundaryMarked2(start))
start = next() ; start = next() ;
...@@ -577,7 +585,8 @@ Dart VTraversor2FFaV<MAP>::next() ...@@ -577,7 +585,8 @@ Dart VTraversor2FFaV<MAP>::next()
current = m.phi2(m.phi_1(m.phi2(m.phi_1(d)))) ; current = m.phi2(m.phi_1(m.phi2(m.phi_1(d)))) ;
if(current == d) if(current == d)
{ {
stop = m.phi2(m.phi_1(d)) ; stop = m.phi1(d);
current = m.phi2(d);
return next() ; return next() ;
} }
stop = d ; stop = d ;
...@@ -593,7 +602,7 @@ Dart VTraversor2FFaV<MAP>::next() ...@@ -593,7 +602,7 @@ Dart VTraversor2FFaV<MAP>::next()
// VTraversor2FFaE // VTraversor2FFaE
template <typename MAP> template <typename MAP>
VTraversor2FFaE<MAP>::VTraversor2FFaE(MAP& map, Dart dart) : m(map),m_QLT(NULL) VTraversor2FFaE<MAP>::VTraversor2FFaE(const MAP& map, Dart dart) : m(map),m_QLT(NULL)
{ {
const AttributeMultiVector<NoTypeNameAttribute<std::vector<Dart> > >* quickTraversal = map.template getQuickAdjacentTraversal<FACE,EDGE>() ; const AttributeMultiVector<NoTypeNameAttribute<std::vector<Dart> > >* quickTraversal = map.template getQuickAdjacentTraversal<FACE,EDGE>() ;
if (quickTraversal != NULL) if (quickTraversal != NULL)
......
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