Commit ec7f05bd authored by Sylvain Thery's avatar Sylvain Thery
Browse files

remove template orbit (replace by parameter) in Traversor3XY and Traversor3XXaY

parent 3036f4ac
...@@ -34,15 +34,16 @@ namespace CGoGN ...@@ -34,15 +34,16 @@ namespace CGoGN
* class Marker for Traversor usefull to combine * class Marker for Traversor usefull to combine
* several TraversorXY * several TraversorXY
*/ */
template <typename MAP, unsigned int ORBIT> template <typename MAP>
class MarkerForTraversor class MarkerForTraversor
{ {
private: private:
MAP& m_map ; MAP& m_map ;
DartMarkerStore* m_dmark ; DartMarkerStore* m_dmark ;
CellMarkerStore* m_cmark ; CellMarkerStore* m_cmark ;
unsigned int m_orbit;
public: public:
MarkerForTraversor(MAP& map, bool forceDartMarker = false, unsigned int thread = 0) ; MarkerForTraversor(MAP& map, unsigned int orbit, bool forceDartMarker = false, unsigned int thread = 0) ;
~MarkerForTraversor(); ~MarkerForTraversor();
DartMarkerStore* dmark(); DartMarkerStore* dmark();
CellMarkerStore* cmark(); CellMarkerStore* cmark();
...@@ -55,7 +56,7 @@ public: ...@@ -55,7 +56,7 @@ public:
* Generic class Traversor (do not use directly) * Generic class Traversor (do not use directly)
* Traverse all Y incident to X * Traverse all Y incident to X
*/ */
template <typename MAP, unsigned int ORBIT_X, unsigned int ORBIT_Y> template <typename MAP>
class Traversor3XY class Traversor3XY
{ {
private: private:
...@@ -64,11 +65,13 @@ private: ...@@ -64,11 +65,13 @@ private:
CellMarkerStore* m_cmark ; CellMarkerStore* m_cmark ;
Dart m_current ; Dart m_current ;
TraversorDartsOfOrbit<MAP> m_tradoo; TraversorDartsOfOrbit<MAP> m_tradoo;
unsigned int m_orbx;
unsigned int m_orby;
bool m_allocated; bool m_allocated;
bool m_first; bool m_first;
public: public:
Traversor3XY(MAP& map, Dart dart, bool forceDartMarker = false, unsigned int thread = 0) ; Traversor3XY(MAP& map, Dart dart, unsigned int orbX, unsigned int orbY, bool forceDartMarker = false, unsigned int thread = 0) ;
Traversor3XY(MAP& map, Dart dart, MarkerForTraversor<MAP,ORBIT_Y>& tmo, bool forceDartMarker = false, unsigned int thread = 0) ; Traversor3XY(MAP& map, Dart dart, unsigned int orbX, unsigned int orbY, MarkerForTraversor<MAP>& tmo, bool forceDartMarker = false, unsigned int thread = 0) ;
~Traversor3XY(); ~Traversor3XY();
Dart begin() ; Dart begin() ;
Dart end() ; Dart end() ;
...@@ -80,7 +83,7 @@ public: ...@@ -80,7 +83,7 @@ public:
* Generic class Traversor (do not use directly) * Generic class Traversor (do not use directly)
* Traverse all X adjacent to X by an Y * Traverse all X adjacent to X by an Y
*/ */
template <typename MAP, unsigned int ORB_X, unsigned int ORB_Y> template <typename MAP>
class Traversor3XXaY class Traversor3XXaY
{ {
private: private:
...@@ -88,7 +91,7 @@ private: ...@@ -88,7 +91,7 @@ private:
std::vector<Dart> m_vecDarts; std::vector<Dart> m_vecDarts;
std::vector<Dart>::iterator m_iter; std::vector<Dart>::iterator m_iter;
public: public:
Traversor3XXaY(MAP& map, Dart dart, bool forceDartMarker = false, unsigned int thread = 0); Traversor3XXaY(MAP& map, Dart dart, unsigned int orbX, unsigned int orbY, bool forceDartMarker = false, unsigned int thread = 0);
Dart begin(); Dart begin();
...@@ -104,30 +107,30 @@ public: ...@@ -104,30 +107,30 @@ public:
* Traverse vertices incident to volume * Traverse vertices incident to volume
*/ */
template <typename MAP> template <typename MAP>
class Traversor3WV: public Traversor3XY<MAP,VOLUME,VERTEX> class Traversor3WV: public Traversor3XY<MAP>
{ {
public: public:
Traversor3WV(MAP& m, Dart dart, bool forceDartMarker = false, unsigned int thread = 0) : Traversor3XY<MAP,VOLUME,VERTEX>(m, dart, forceDartMarker, thread) {} Traversor3WV(MAP& m, Dart dart, bool forceDartMarker = false, unsigned int thread = 0) : Traversor3XY<MAP>(m, dart,VOLUME,VERTEX,forceDartMarker, thread) {}
}; };
/** /**
* Traverse edges incident to volume * Traverse edges incident to volume
*/ */
template <typename MAP> template <typename MAP>
class Traversor3WE: public Traversor3XY<MAP,VOLUME,EDGE> class Traversor3WE: public Traversor3XY<MAP>
{ {
public: public:
Traversor3WE(MAP& m, Dart dart, bool forceDartMarker = false, unsigned int thread = 0) : Traversor3XY<MAP,VOLUME,EDGE>(m, dart, forceDartMarker, thread) {} Traversor3WE(MAP& m, Dart dart, bool forceDartMarker = false, unsigned int thread = 0) : Traversor3XY<MAP>(m, dart,VOLUME,EDGE, forceDartMarker, thread) {}
}; };
/** /**
* Traverse faces incident to volume * Traverse faces incident to volume
*/ */
template <typename MAP> template <typename MAP>
class Traversor3WF: public Traversor3XY<MAP,VOLUME,FACE> class Traversor3WF: public Traversor3XY<MAP>
{ {
public: public:
Traversor3WF(MAP& m, Dart dart, bool forceDartMarker = false, unsigned int thread = 0) : Traversor3XY<MAP,VOLUME,FACE>(m, dart, forceDartMarker, thread) {} Traversor3WF(MAP& m, Dart dart, bool forceDartMarker = false, unsigned int thread = 0) : Traversor3XY<MAP>(m, dart,VOLUME,FACE, forceDartMarker, thread) {}
}; };
...@@ -135,30 +138,30 @@ public: ...@@ -135,30 +138,30 @@ public:
* Traverse vertices incident to face * Traverse vertices incident to face
*/ */
template <typename MAP> template <typename MAP>
class Traversor3FV: public Traversor3XY<MAP,FACE,VERTEX> class Traversor3FV: public Traversor3XY<MAP>
{ {
public: public:
Traversor3FV(MAP& m, Dart dart, bool forceDartMarker = false, unsigned int thread = 0) : Traversor3XY<MAP,FACE,VERTEX>(m, dart, forceDartMarker, thread) {} Traversor3FV(MAP& m, Dart dart, bool forceDartMarker = false, unsigned int thread = 0) : Traversor3XY<MAP>(m, dart,FACE,VERTEX, forceDartMarker, thread) {}
}; };
/** /**
* Traverse edges incident to face * Traverse edges incident to face
*/ */
template <typename MAP> template <typename MAP>
class Traversor3FE: public Traversor3XY<MAP,FACE,EDGE> class Traversor3FE: public Traversor3XY<MAP>
{ {
public: public:
Traversor3FE(MAP& m, Dart dart, bool forceDartMarker = false, unsigned int thread = 0) : Traversor3XY<MAP,FACE,EDGE>(m, dart, forceDartMarker, thread) {} Traversor3FE(MAP& m, Dart dart, bool forceDartMarker = false, unsigned int thread = 0) : Traversor3XY<MAP>(m, dart,FACE,EDGE, forceDartMarker, thread) {}
}; };
/** /**
* Traverse volumes incident to face * Traverse volumes incident to face
*/ */
template <typename MAP> template <typename MAP>
class Traversor3FW: public Traversor3XY<MAP,FACE,VOLUME> class Traversor3FW: public Traversor3XY<MAP>
{ {
public: public:
Traversor3FW(MAP& m, Dart dart, bool forceDartMarker = false, unsigned int thread = 0) : Traversor3XY<MAP,FACE,VOLUME>(m, dart, forceDartMarker, thread) {} Traversor3FW(MAP& m, Dart dart, bool forceDartMarker = false, unsigned int thread = 0) : Traversor3XY<MAP>(m, dart,FACE,VOLUME, forceDartMarker, thread) {}
}; };
...@@ -166,30 +169,30 @@ public: ...@@ -166,30 +169,30 @@ public:
* Traverse vertices incident to edge * Traverse vertices incident to edge
*/ */
template <typename MAP> template <typename MAP>
class Traversor3EV: public Traversor3XY<MAP,EDGE,VERTEX> class Traversor3EV: public Traversor3XY<MAP>
{ {
public: public:
Traversor3EV(MAP& m, Dart dart, bool forceDartMarker = false, unsigned int thread = 0) : Traversor3XY<MAP,EDGE,VERTEX>(m, dart, forceDartMarker, thread) {} Traversor3EV(MAP& m, Dart dart, bool forceDartMarker = false, unsigned int thread = 0) : Traversor3XY<MAP>(m, dart,EDGE,VERTEX, forceDartMarker, thread) {}
}; };
/** /**
* Traverse faces incident to edge * Traverse faces incident to edge
*/ */
template <typename MAP> template <typename MAP>
class Traversor3EF: public Traversor3XY<MAP,EDGE,FACE> class Traversor3EF: public Traversor3XY<MAP>
{ {
public: public:
Traversor3EF(MAP& m, Dart dart, bool forceDartMarker = false, unsigned int thread = 0) : Traversor3XY<MAP,EDGE,FACE>(m, dart, forceDartMarker, thread) {} Traversor3EF(MAP& m, Dart dart, bool forceDartMarker = false, unsigned int thread = 0) : Traversor3XY<MAP>(m, dart,EDGE,FACE, forceDartMarker, thread) {}
}; };
/** /**
* Traverse volumes incident to edge * Traverse volumes incident to edge
*/ */
template <typename MAP> template <typename MAP>
class Traversor3EW: public Traversor3XY<MAP,EDGE,VOLUME> class Traversor3EW: public Traversor3XY<MAP>
{ {
public: public:
Traversor3EW(MAP& m, Dart dart, bool forceDartMarker = false, unsigned int thread = 0) : Traversor3XY<MAP,EDGE,VOLUME>(m, dart, forceDartMarker, thread) {} Traversor3EW(MAP& m, Dart dart, bool forceDartMarker = false, unsigned int thread = 0) : Traversor3XY<MAP>(m, dart,EDGE,VOLUME, forceDartMarker, thread) {}
}; };
...@@ -198,30 +201,30 @@ public: ...@@ -198,30 +201,30 @@ public:
* Traverse edges incident to vertex * Traverse edges incident to vertex
*/ */
template <typename MAP> template <typename MAP>
class Traversor3VE: public Traversor3XY<MAP,VERTEX,EDGE> class Traversor3VE: public Traversor3XY<MAP>
{ {
public: public:
Traversor3VE(MAP& m, Dart dart, bool forceDartMarker = false, unsigned int thread = 0) : Traversor3XY<MAP,VERTEX,EDGE>(m, dart, forceDartMarker, thread) {} Traversor3VE(MAP& m, Dart dart, bool forceDartMarker = false, unsigned int thread = 0) : Traversor3XY<MAP>(m, dart,VERTEX,EDGE, forceDartMarker, thread) {}
}; };
/** /**
* Traverse faces incident to vertex * Traverse faces incident to vertex
*/ */
template <typename MAP> template <typename MAP>
class Traversor3VF: public Traversor3XY<MAP,VERTEX,FACE> class Traversor3VF: public Traversor3XY<MAP>
{ {
public: public:
Traversor3VF(MAP& m, Dart dart, bool forceDartMarker = false, unsigned int thread = 0) : Traversor3XY<MAP,VERTEX,FACE>(m, dart, forceDartMarker, thread) {} Traversor3VF(MAP& m, Dart dart, bool forceDartMarker = false, unsigned int thread = 0) : Traversor3XY<MAP>(m, dart,VERTEX,FACE, forceDartMarker, thread) {}
}; };
/** /**
* Traverse volumes incident to vertex * Traverse volumes incident to vertex
*/ */
template <typename MAP> template <typename MAP>
class Traversor3VW: public Traversor3XY<MAP,VERTEX,VOLUME> class Traversor3VW: public Traversor3XY<MAP>
{ {
public: public:
Traversor3VW(MAP& m, Dart dart, bool forceDartMarker = false, unsigned int thread = 0) : Traversor3XY<MAP,VERTEX,VOLUME>(m, dart, forceDartMarker, thread) {} Traversor3VW(MAP& m, Dart dart, bool forceDartMarker = false, unsigned int thread = 0) : Traversor3XY<MAP>(m, dart,VERTEX,VOLUME, forceDartMarker, thread) {}
}; };
...@@ -230,30 +233,30 @@ public: ...@@ -230,30 +233,30 @@ public:
* Traverse vertices adjacent to a vertex by an edge * Traverse vertices adjacent to a vertex by an edge
*/ */
template <typename MAP> template <typename MAP>
class Traversor3VVaE: public Traversor3XXaY<MAP,VERTEX,EDGE> class Traversor3VVaE: public Traversor3XXaY<MAP>
{ {
public: public:
Traversor3VVaE(MAP& m, Dart d, bool forceDartMarker = false, unsigned int thread = 0) : Traversor3XXaY<MAP,VERTEX,EDGE>(m, d, forceDartMarker, thread) {} Traversor3VVaE(MAP& m, Dart d, bool forceDartMarker = false, unsigned int thread = 0) : Traversor3XXaY<MAP>(m, d,VERTEX,EDGE, forceDartMarker, thread) {}
}; };
/** /**
* Traverse vertices adjacent to a vertex by a face * Traverse vertices adjacent to a vertex by a face
*/ */
template <typename MAP> template <typename MAP>
class Traversor3VVaF: public Traversor3XXaY<MAP,VERTEX,FACE> class Traversor3VVaF: public Traversor3XXaY<MAP>
{ {
public: public:
Traversor3VVaF(MAP& m, Dart d, bool forceDartMarker = false, unsigned int thread = 0) : Traversor3XXaY<MAP,VERTEX,FACE>(m, d, forceDartMarker, thread) {} Traversor3VVaF(MAP& m, Dart d, bool forceDartMarker = false, unsigned int thread = 0) : Traversor3XXaY<MAP>(m, d,VERTEX,FACE, forceDartMarker, thread) {}
}; };
/** /**
* Traverse vertices adjacent to a vertex by a volume * Traverse vertices adjacent to a vertex by a volume
*/ */
template <typename MAP> template <typename MAP>
class Traversor3VVaW: public Traversor3XXaY<MAP,VERTEX,VOLUME> class Traversor3VVaW: public Traversor3XXaY<MAP>
{ {
public: public:
Traversor3VVaW(MAP& m, Dart d, bool forceDartMarker = false, unsigned int thread = 0) : Traversor3XXaY<MAP,VERTEX,VOLUME>(m, d, forceDartMarker, thread) {} Traversor3VVaW(MAP& m, Dart d, bool forceDartMarker = false, unsigned int thread = 0) : Traversor3XXaY<MAP>(m, d,VERTEX,VOLUME, forceDartMarker, thread) {}
}; };
...@@ -261,30 +264,30 @@ public: ...@@ -261,30 +264,30 @@ public:
* Traverse edges adjacent to an egde by a vertex * Traverse edges adjacent to an egde by a vertex
*/ */
template <typename MAP> template <typename MAP>
class Traversor3EEaV: public Traversor3XXaY<MAP,EDGE,VERTEX> class Traversor3EEaV: public Traversor3XXaY<MAP>
{ {
public: public:
Traversor3EEaV(MAP& m, Dart d, bool forceDartMarker = false, unsigned int thread = 0) : Traversor3XXaY<MAP,EDGE,VERTEX>(m, d, forceDartMarker, thread) {} Traversor3EEaV(MAP& m, Dart d, bool forceDartMarker = false, unsigned int thread = 0) : Traversor3XXaY<MAP>(m, d,EDGE,VERTEX, forceDartMarker, thread) {}
}; };
/** /**
* Traverse edges adjacent to an egde by a face * Traverse edges adjacent to an egde by a face
*/ */
template <typename MAP> template <typename MAP>
class Traversor3EEaF: public Traversor3XXaY<MAP,EDGE,FACE> class Traversor3EEaF: public Traversor3XXaY<MAP>
{ {
public: public:
Traversor3EEaF(MAP& m, Dart d, bool forceDartMarker = false, unsigned int thread = 0) : Traversor3XXaY<MAP,EDGE,FACE>(m, d, forceDartMarker, thread) {} Traversor3EEaF(MAP& m, Dart d, bool forceDartMarker = false, unsigned int thread = 0) : Traversor3XXaY<MAP>(m, d,EDGE,FACE, forceDartMarker, thread) {}
}; };
/** /**
* Traverse edges adjacent to an egde by a volume * Traverse edges adjacent to an egde by a volume
*/ */
template <typename MAP> template <typename MAP>
class Traversor3EEaW: public Traversor3XXaY<MAP,EDGE,VOLUME> class Traversor3EEaW: public Traversor3XXaY<MAP>
{ {
public: public:
Traversor3EEaW(MAP& m, Dart d, bool forceDartMarker = false, unsigned int thread = 0) : Traversor3XXaY<MAP,EDGE,VOLUME>(m, d, forceDartMarker, thread) {} Traversor3EEaW(MAP& m, Dart d, bool forceDartMarker = false, unsigned int thread = 0) : Traversor3XXaY<MAP>(m, d,EDGE,VOLUME, forceDartMarker, thread) {}
}; };
...@@ -292,30 +295,30 @@ public: ...@@ -292,30 +295,30 @@ public:
* Traverse faces adjacent to a face by a vertex * Traverse faces adjacent to a face by a vertex
*/ */
template <typename MAP> template <typename MAP>
class Traversor3FFaV: public Traversor3XXaY<MAP,FACE,VERTEX> class Traversor3FFaV: public Traversor3XXaY<MAP>
{ {
public: public:
Traversor3FFaV(MAP& m, Dart d, bool forceDartMarker = false, unsigned int thread = 0) : Traversor3XXaY<MAP,FACE,VERTEX>(m, d, forceDartMarker, thread) {} Traversor3FFaV(MAP& m, Dart d, bool forceDartMarker = false, unsigned int thread = 0) : Traversor3XXaY<MAP>(m, d,FACE,VERTEX, forceDartMarker, thread) {}
}; };
/** /**
* Traverse faces adjacent to a face by an edge * Traverse faces adjacent to a face by an edge
*/ */
template <typename MAP> template <typename MAP>
class Traversor3FFaE: public Traversor3XXaY<MAP,FACE,EDGE> class Traversor3FFaE: public Traversor3XXaY<MAP>
{ {
public: public:
Traversor3FFaE(MAP& m, Dart d, bool forceDartMarker = false, unsigned int thread = 0) : Traversor3XXaY<MAP,FACE,EDGE>(m, d, forceDartMarker, thread) {} Traversor3FFaE(MAP& m, Dart d, bool forceDartMarker = false, unsigned int thread = 0) : Traversor3XXaY<MAP>(m, d,FACE,EDGE, forceDartMarker, thread) {}
}; };
/** /**
* Traverse faces adjacent to a face by a volume * Traverse faces adjacent to a face by a volume
*/ */
template <typename MAP> template <typename MAP>
class Traversor3FFaW: public Traversor3XXaY<MAP,FACE,VOLUME> class Traversor3FFaW: public Traversor3XXaY<MAP>
{ {
public: public:
Traversor3FFaW(MAP& m, Dart d, bool forceDartMarker = false, unsigned int thread = 0) : Traversor3XXaY<MAP,FACE,VOLUME>(m, d, forceDartMarker, thread) {} Traversor3FFaW(MAP& m, Dart d, bool forceDartMarker = false, unsigned int thread = 0) : Traversor3XXaY<MAP>(m, d,FACE,VOLUME, forceDartMarker, thread) {}
}; };
...@@ -323,30 +326,30 @@ public: ...@@ -323,30 +326,30 @@ public:
* Traverse volumes adjacent to a volumee by a vertex * Traverse volumes adjacent to a volumee by a vertex
*/ */
template <typename MAP> template <typename MAP>
class Traversor3WWaV: public Traversor3XXaY<MAP,VOLUME,VERTEX> class Traversor3WWaV: public Traversor3XXaY<MAP>
{ {
public: public:
Traversor3WWaV(MAP& m, Dart d, bool forceDartMarker = false, unsigned int thread = 0) : Traversor3XXaY<MAP,VOLUME,VERTEX>(m, d, forceDartMarker, thread) {} Traversor3WWaV(MAP& m, Dart d, bool forceDartMarker = false, unsigned int thread = 0) : Traversor3XXaY<MAP>(m, d,VOLUME,VERTEX, forceDartMarker, thread) {}
}; };
/** /**
* Traverse volumes adjacent to a volumee by an edge * Traverse volumes adjacent to a volumee by an edge
*/ */
template <typename MAP> template <typename MAP>
class Traversor3WWaE: public Traversor3XXaY<MAP,VOLUME,EDGE> class Traversor3WWaE: public Traversor3XXaY<MAP>
{ {
public: public:
Traversor3WWaE(MAP& m, Dart d, bool forceDartMarker = false, unsigned int thread = 0) : Traversor3XXaY<MAP,VOLUME,EDGE>(m, d, forceDartMarker, thread) {} Traversor3WWaE(MAP& m, Dart d, bool forceDartMarker = false, unsigned int thread = 0) : Traversor3XXaY<MAP>(m, d,VOLUME,EDGE, forceDartMarker, thread) {}
}; };
/** /**
* Traverse volumes adjacent to a volumee by a face * Traverse volumes adjacent to a volumee by a face
*/ */
template <typename MAP> template <typename MAP>
class Traversor3WWaF: public Traversor3XXaY<MAP,VOLUME,FACE> class Traversor3WWaF: public Traversor3XXaY<MAP>
{ {
public: public:
Traversor3WWaF(MAP& m, Dart d, bool forceDartMarker = false, unsigned int thread = 0) : Traversor3XXaY<MAP,VOLUME,FACE>(m, d, forceDartMarker, thread) {} Traversor3WWaF(MAP& m, Dart d, bool forceDartMarker = false, unsigned int thread = 0) : Traversor3XXaY<MAP>(m, d,VOLUME,FACE, forceDartMarker, thread) {}
}; };
......
...@@ -30,21 +30,22 @@ namespace CGoGN ...@@ -30,21 +30,22 @@ namespace CGoGN
// Marker for traversor // Marker for traversor
//********************** //**********************
template <typename MAP, unsigned int ORBIT> template <typename MAP>
MarkerForTraversor<MAP,ORBIT>::MarkerForTraversor(MAP& map, bool forceDartMarker, unsigned int thread) : MarkerForTraversor<MAP>::MarkerForTraversor(MAP& map, unsigned int orbit, bool forceDartMarker, unsigned int thread) :
m_map(map), m_map(map),
m_dmark(NULL), m_dmark(NULL),
m_cmark(NULL) m_cmark(NULL),
m_orbit(orbit)
{ {
if(!forceDartMarker && map.isOrbitEmbedded(ORBIT)) if(!forceDartMarker && map.isOrbitEmbedded(m_orbit))
m_cmark = new CellMarkerStore(map, ORBIT, thread) ; m_cmark = new CellMarkerStore(map, m_orbit, thread) ;
else else
m_dmark = new DartMarkerStore(map, thread) ; m_dmark = new DartMarkerStore(map, thread) ;
} }
template <typename MAP, unsigned int ORBIT> template <typename MAP>
MarkerForTraversor<MAP,ORBIT>::~MarkerForTraversor() MarkerForTraversor<MAP>::~MarkerForTraversor()
{ {
if (m_cmark) if (m_cmark)
delete m_cmark; delete m_cmark;
...@@ -52,41 +53,41 @@ MarkerForTraversor<MAP,ORBIT>::~MarkerForTraversor() ...@@ -52,41 +53,41 @@ MarkerForTraversor<MAP,ORBIT>::~MarkerForTraversor()
delete m_dmark; delete m_dmark;
} }
template <typename MAP, unsigned int ORBIT> template <typename MAP>
void MarkerForTraversor<MAP,ORBIT>::mark(Dart d) void MarkerForTraversor<MAP>::mark(Dart d)
{ {
if (m_cmark) if (m_cmark)
m_cmark->mark(d);