Commit f3916a06 authored by Sylvain Thery's avatar Sylvain Thery

optim virt/novirt traversors

parent 119ac9f2
...@@ -527,20 +527,6 @@ inline void GenericMap::updateQuickIncidentTraversal() ...@@ -527,20 +527,6 @@ inline void GenericMap::updateQuickIncidentTraversal()
vd.reserve(buffer.size()); vd.reserve(buffer.size());
vd.assign(buffer.begin(),buffer.end()); vd.assign(buffer.begin(),buffer.end());
} }
// TraversorCell<MAP,ORBIT> tra_glob(map);
// for (Dart d = tra_glob.begin(); d != tra_glob.end(); d = tra_glob.next())
// {
// buffer.clear();
// Traversor3XY<MAP,ORBIT,INCI> tra_loc(map,d);
// for (Dart e = tra_loc.begin(); e != tra_loc.end(); e = tra_loc.next())
// buffer.push_back(e);
// buffer.push_back(NIL);
// std::vector<Dart>& vd = (*ptrVD)[getEmbedding<ORBIT>(d)];
// vd.reserve(buffer.size());
// vd.assign(buffer.begin(),buffer.end());
// }
m_quickLocalIncidentTraversal[ORBIT][INCI] = ptrVD; m_quickLocalIncidentTraversal[ORBIT][INCI] = ptrVD;
} }
...@@ -570,7 +556,7 @@ inline void GenericMap::enableQuickAdjacentTraversal() ...@@ -570,7 +556,7 @@ inline void GenericMap::enableQuickAdjacentTraversal()
if(!isOrbitEmbedded<ORBIT>()) if(!isOrbitEmbedded<ORBIT>())
addEmbedding<ORBIT>() ; addEmbedding<ORBIT>() ;
std::stringstream ss; std::stringstream ss;
ss << "m_quickLocalAdjacentTraversal" << ADJ; ss << "quickLocalAdjacentTraversal" << ADJ;
m_quickLocalAdjacentTraversal[ORBIT][ADJ] = m_attribs[ORBIT].addAttribute<NoTypeNameAttribute<std::vector<Dart> > >(ss.str()) ; m_quickLocalAdjacentTraversal[ORBIT][ADJ] = m_attribs[ORBIT].addAttribute<NoTypeNameAttribute<std::vector<Dart> > >(ss.str()) ;
} }
updateQuickAdjacentTraversal<MAP,ORBIT,ADJ>() ; updateQuickAdjacentTraversal<MAP,ORBIT,ADJ>() ;
...@@ -602,20 +588,6 @@ inline void GenericMap::updateQuickAdjacentTraversal() ...@@ -602,20 +588,6 @@ inline void GenericMap::updateQuickAdjacentTraversal()
vd.reserve(buffer.size()); vd.reserve(buffer.size());
vd.assign(buffer.begin(),buffer.end()); vd.assign(buffer.begin(),buffer.end());
} }
// TraversorCell<MAP,ORBIT> tra_glob(map);
// for (Dart d = tra_glob.begin(); d != tra_glob.end(); d = tra_glob.next())
// {
// buffer.clear();
// Traversor3XXaY<MAP,ORBIT,ADJ> tra_loc(map,d);
// for (Dart e = tra_loc.begin(); e != tra_loc.end(); e = tra_loc.next())
// buffer.push_back(e);
// buffer.push_back(NIL);
// std::vector<Dart>& vd = (*ptrVD)[getEmbedding<ORBIT>(d)];
// vd.reserve(buffer.size());
// vd.assign(buffer.begin(),buffer.end());
// }
m_quickLocalAdjacentTraversal[ORBIT][ADJ] = ptrVD; m_quickLocalAdjacentTraversal[ORBIT][ADJ] = ptrVD;
} }
......
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
#define __TRAVERSOR2_H__ #define __TRAVERSOR2_H__
#include "Topology/generic/dart.h" #include "Topology/generic/dart.h"
#include "Topology/generic/traversorGen.h" //#include "Topology/generic/traversorGen.h"
namespace CGoGN namespace CGoGN
{ {
...@@ -37,7 +37,7 @@ namespace CGoGN ...@@ -37,7 +37,7 @@ namespace CGoGN
// Traverse the edges incident to a given vertex // Traverse the edges incident to a given vertex
template <typename MAP> template <typename MAP>
class Traversor2VE: public Traversor<MAP> class Traversor2VE//: public Traversor<MAP>
{ {
private: private:
MAP& m ; MAP& m ;
...@@ -55,7 +55,7 @@ public: ...@@ -55,7 +55,7 @@ public:
// Traverse the faces incident to a given vertex // Traverse the faces incident to a given vertex
template <typename MAP> template <typename MAP>
class Traversor2VF : public Traversor<MAP> class Traversor2VF //: public Traversor<MAP>
{ {
private: private:
MAP& m ; MAP& m ;
...@@ -73,7 +73,7 @@ public: ...@@ -73,7 +73,7 @@ public:
// Traverse the vertices adjacent to a given vertex through sharing a common edge // Traverse the vertices adjacent to a given vertex through sharing a common edge
template <typename MAP> template <typename MAP>
class Traversor2VVaE : public Traversor<MAP> class Traversor2VVaE //: public Traversor<MAP>
{ {
private: private:
MAP& m ; MAP& m ;
...@@ -91,7 +91,7 @@ public: ...@@ -91,7 +91,7 @@ public:
// Traverse the vertices adjacent to a given vertex through sharing a common face // Traverse the vertices adjacent to a given vertex through sharing a common face
template <typename MAP> template <typename MAP>
class Traversor2VVaF : public Traversor<MAP> class Traversor2VVaF //: public Traversor<MAP>
{ {
private: private:
MAP& m ; MAP& m ;
...@@ -115,7 +115,7 @@ public: ...@@ -115,7 +115,7 @@ public:
// Traverse the vertices incident to a given edge // Traverse the vertices incident to a given edge
template <typename MAP> template <typename MAP>
class Traversor2EV : public Traversor<MAP> class Traversor2EV //: public Traversor<MAP>
{ {
private: private:
MAP& m ; MAP& m ;
...@@ -133,7 +133,7 @@ public: ...@@ -133,7 +133,7 @@ public:
// Traverse the faces incident to a given edge // Traverse the faces incident to a given edge
template <typename MAP> template <typename MAP>
class Traversor2EF : public Traversor<MAP> class Traversor2EF //: public Traversor<MAP>
{ {
private: private:
MAP& m ; MAP& m ;
...@@ -151,7 +151,7 @@ public: ...@@ -151,7 +151,7 @@ public:
// Traverse the edges adjacent to a given edge through sharing a common vertex // Traverse the edges adjacent to a given edge through sharing a common vertex
template <typename MAP> template <typename MAP>
class Traversor2EEaV : public Traversor<MAP> class Traversor2EEaV //: public Traversor<MAP>
{ {
private: private:
MAP& m ; MAP& m ;
...@@ -171,7 +171,7 @@ public: ...@@ -171,7 +171,7 @@ public:
// Traverse the edges adjacent to a given edge through sharing a common face // Traverse the edges adjacent to a given edge through sharing a common face
template <typename MAP> template <typename MAP>
class Traversor2EEaF : public Traversor<MAP> class Traversor2EEaF //: public Traversor<MAP>
{ {
private: private:
MAP& m ; MAP& m ;
...@@ -195,7 +195,7 @@ public: ...@@ -195,7 +195,7 @@ public:
// Traverse the vertices incident to a given face // Traverse the vertices incident to a given face
template <typename MAP> template <typename MAP>
class Traversor2FV : public Traversor<MAP> class Traversor2FV //: public Traversor<MAP>
{ {
private: private:
MAP& m ; MAP& m ;
...@@ -222,7 +222,7 @@ public: ...@@ -222,7 +222,7 @@ public:
// 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
template <typename MAP> template <typename MAP>
class Traversor2FFaV : public Traversor<MAP> class Traversor2FFaV //: public Traversor<MAP>
{ {
private: private:
MAP& m ; MAP& m ;
...@@ -242,7 +242,7 @@ public: ...@@ -242,7 +242,7 @@ public:
// Traverse the faces adjacent to a given face through sharing a common edge // Traverse the faces adjacent to a given face through sharing a common edge
template <typename MAP> template <typename MAP>
class Traversor2FFaE : public Traversor<MAP> class Traversor2FFaE //: public Traversor<MAP>
{ {
private: private:
MAP& m ; MAP& m ;
......
/*******************************************************************************
* CGoGN: Combinatorial and Geometric modeling with Generic N-dimensional Maps *
* version 0.1 *
* Copyright (C) 2009-2012, IGG Team, LSIIT, University of Strasbourg *
* *
* This library is free software; you can redistribute it and/or modify it *
* under the terms of the GNU Lesser General Public License as published by the *
* Free Software Foundation; either version 2.1 of the License, or (at your *
* option) any later version. *
* *
* This library is distributed in the hope that it will be useful, but WITHOUT *
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or *
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License *
* for more details. *
* *
* You should have received a copy of the GNU Lesser General Public License *
* along with this library; if not, write to the Free Software Foundation, *
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. *
* *
* Web site: http://cgogn.unistra.fr/ *
* Contact information: cgogn@unistra.fr *
* *
*******************************************************************************/
#ifndef __VTraversor2_VIRT_H__
#define __VTraversor2_VIRT_H__
#include "Topology/generic/dart.h"
#include "Topology/generic/traversorGen.h"
namespace CGoGN
{
/*******************************************************************************
VERTEX CENTERED TRAVERSALS
*******************************************************************************/
// Traverse the edges incident to a given vertex
template <typename MAP>
class VTraversor2VE: public Traversor<MAP>
{
private:
MAP& m ;
Dart start ;
Dart current ;
std::vector<Dart>* m_QLT;
std::vector<Dart>::iterator m_ItDarts;
public:
VTraversor2VE(MAP& map, Dart dart) ;
Dart begin() ;
Dart end() ;
Dart next() ;
} ;
// Traverse the faces incident to a given vertex
template <typename MAP>
class VTraversor2VF : public Traversor<MAP>
{
private:
MAP& m ;
Dart start ;
Dart current ;
std::vector<Dart>* m_QLT;
std::vector<Dart>::iterator m_ItDarts;
public:
VTraversor2VF(MAP& map, Dart dart) ;
Dart begin() ;
Dart end() ;
Dart next() ;
} ;
// Traverse the vertices adjacent to a given vertex through sharing a common edge
template <typename MAP>
class VTraversor2VVaE : public Traversor<MAP>
{
private:
MAP& m ;
Dart start ;
Dart current ;
std::vector<Dart>* m_QLT;
std::vector<Dart>::iterator m_ItDarts;
public:
VTraversor2VVaE(MAP& map, Dart dart) ;
Dart begin() ;
Dart end() ;
Dart next() ;
} ;
// Traverse the vertices adjacent to a given vertex through sharing a common face
template <typename MAP>
class VTraversor2VVaF : public Traversor<MAP>
{
private:
MAP& m ;
Dart start ;
Dart current ;
Dart stop ;
std::vector<Dart>* m_QLT;
std::vector<Dart>::iterator m_ItDarts;
public:
VTraversor2VVaF(MAP& map, Dart dart) ;
Dart begin() ;
Dart end() ;
Dart next() ;
} ;
/*******************************************************************************
EDGE CENTERED TRAVERSALS
*******************************************************************************/
// Traverse the vertices incident to a given edge
template <typename MAP>
class VTraversor2EV : public Traversor<MAP>
{
private:
MAP& m ;
Dart start ;
Dart current ;
std::vector<Dart>* m_QLT;
std::vector<Dart>::iterator m_ItDarts;
public:
VTraversor2EV(MAP& map, Dart dart) ;
Dart begin() ;
Dart end() ;
Dart next() ;
} ;
// Traverse the faces incident to a given edge
template <typename MAP>
class VTraversor2EF : public Traversor<MAP>
{
private:
MAP& m ;
Dart start ;
Dart current ;
std::vector<Dart>* m_QLT;
std::vector<Dart>::iterator m_ItDarts;
public:
VTraversor2EF(MAP& map, Dart dart) ;
Dart begin() ;
Dart end() ;
Dart next() ;
} ;
// Traverse the edges adjacent to a given edge through sharing a common vertex
template <typename MAP>
class VTraversor2EEaV : public Traversor<MAP>
{
private:
MAP& m ;
Dart start ;
Dart current ;
Dart stop1, stop2 ;
std::vector<Dart>* m_QLT;
std::vector<Dart>::iterator m_ItDarts;
public:
VTraversor2EEaV(MAP& map, Dart dart) ;
Dart begin() ;
Dart end() ;
Dart next() ;
} ;
// Traverse the edges adjacent to a given edge through sharing a common face
template <typename MAP>
class VTraversor2EEaF : public Traversor<MAP>
{
private:
MAP& m ;
Dart start ;
Dart current ;
Dart stop1, stop2 ;
std::vector<Dart>* m_QLT;
std::vector<Dart>::iterator m_ItDarts;
public:
VTraversor2EEaF(MAP& map, Dart dart) ;
Dart begin() ;
Dart end() ;
Dart next() ;
} ;
/*******************************************************************************
FACE CENTERED TRAVERSALS
*******************************************************************************/
// Traverse the vertices incident to a given face
template <typename MAP>
class VTraversor2FV : public Traversor<MAP>
{
private:
MAP& m ;
Dart start ;
Dart current ;
std::vector<Dart>* m_QLT;
std::vector<Dart>::iterator m_ItDarts;
public:
VTraversor2FV(MAP& map, Dart dart) ;
Dart begin() ;
Dart end() ;
Dart next() ;
} ;
// Traverse the edges incident to a given face (equivalent to vertices)
template <typename MAP>
class VTraversor2FE: public VTraversor2FV<MAP>
{
public:
VTraversor2FE(MAP& map, Dart dart):VTraversor2FV<MAP>(map,dart){}
} ;
// Traverse the faces adjacent to a given face through sharing a common vertex
template <typename MAP>
class VTraversor2FFaV : public Traversor<MAP>
{
private:
MAP& m ;
Dart start ;
Dart current ;
Dart stop ;
std::vector<Dart>* m_QLT;
std::vector<Dart>::iterator m_ItDarts;
public:
VTraversor2FFaV(MAP& map, Dart dart) ;
Dart begin() ;
Dart end() ;
Dart next() ;
} ;
// Traverse the faces adjacent to a given face through sharing a common edge
template <typename MAP>
class VTraversor2FFaE : public Traversor<MAP>
{
private:
MAP& m ;
Dart start ;
Dart current ;
std::vector<Dart>* m_QLT;
std::vector<Dart>::iterator m_ItDarts;
public:
VTraversor2FFaE(MAP& map, Dart dart) ;
Dart begin() ;
Dart end() ;
Dart next() ;
} ;
} // namespace CGoGN
#include "Topology/generic/traversor2Virt.hpp"
#endif
This diff is collapsed.
This diff is collapsed.
/*******************************************************************************
* CGoGN: Combinatorial and Geometric modeling with Generic N-dimensional Maps *
* version 0.1 *
* Copyright (C) 2009-2012, IGG Team, LSIIT, University of Strasbourg *
* *
* This library is free software; you can redistribute it and/or modify it *
* under the terms of the GNU Lesser General Public License as published by the *
* Free Software Foundation; either version 2.1 of the License, or (at your *
* option) any later version. *
* *
* This library is distributed in the hope that it will be useful, but WITHOUT *
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or *
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License *
* for more details. *
* *
* You should have received a copy of the GNU Lesser General Public License *
* along with this library; if not, write to the Free Software Foundation, *
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. *
* *
* Web site: http://cgogn.unistra.fr/ *
* Contact information: cgogn@unistra.fr *
* *
*******************************************************************************/
#ifndef __VTraversor2_H__
#define __VTraversor2_H__
#include "Topology/generic/dart.h"
#include "Topology/generic/traversorGen.h"
namespace CGoGN
{
/*******************************************************************************
VERTEX CENTERED TRAVERSALS
*******************************************************************************/
// Traverse the edges incident to a given vertex
template <typename MAP>
class VTraversor2VE: public Traversor<MAP>
{
private:
MAP& m ;
Dart start ;
Dart current ;
std::vector<Dart>* m_QLT;
std::vector<Dart>::iterator m_ItDarts;
public:
VTraversor2VE(MAP& map, Dart dart) ;
Dart begin() ;
Dart end() ;
Dart next() ;
} ;
// Traverse the faces incident to a given vertex
template <typename MAP>
class VTraversor2VF : public Traversor<MAP>
{
private:
MAP& m ;
Dart start ;
Dart current ;
std::vector<Dart>* m_QLT;
std::vector<Dart>::iterator m_ItDarts;
public:
VTraversor2VF(MAP& map, Dart dart) ;
Dart begin() ;
Dart end() ;
Dart next() ;
} ;
// Traverse the vertices adjacent to a given vertex through sharing a common edge
template <typename MAP>
class VTraversor2VVaE : public Traversor<MAP>
{
private:
MAP& m ;
Dart start ;
Dart current ;
std::vector<Dart>* m_QLT;
std::vector<Dart>::iterator m_ItDarts;
public:
VTraversor2VVaE(MAP& map, Dart dart) ;
Dart begin() ;
Dart end() ;
Dart next() ;
} ;
// Traverse the vertices adjacent to a given vertex through sharing a common face
template <typename MAP>
class VTraversor2VVaF : public Traversor<MAP>
{
private:
MAP& m ;
Dart start ;
Dart current ;
Dart stop ;
std::vector<Dart>* m_QLT;
std::vector<Dart>::iterator m_ItDarts;
public:
VTraversor2VVaF(MAP& map, Dart dart) ;
Dart begin() ;
Dart end() ;
Dart next() ;
} ;
/*******************************************************************************
EDGE CENTERED TRAVERSALS
*******************************************************************************/
// Traverse the vertices incident to a given edge
template <typename MAP>
class VTraversor2EV : public Traversor<MAP>
{
private:
MAP& m ;
Dart start ;
Dart current ;
std::vector<Dart>* m_QLT;
std::vector<Dart>::iterator m_ItDarts;
public:
VTraversor2EV(MAP& map, Dart dart) ;
Dart begin() ;
Dart end() ;
Dart next() ;
} ;
// Traverse the faces incident to a given edge
template <typename MAP>
class VTraversor2EF : public Traversor<MAP>
{
private:
MAP& m ;
Dart start ;
Dart current ;
std::vector<Dart>* m_QLT;
std::vector<Dart>::iterator m_ItDarts;
public:
VTraversor2EF(MAP& map, Dart dart) ;
Dart begin() ;
Dart end() ;
Dart next() ;
} ;
// Traverse the edges adjacent to a given edge through sharing a common vertex
template <typename MAP>
class VTraversor2EEaV : public Traversor<MAP>
{
private: