Commit 734ba6e6 authored by Sylvain Thery's avatar Sylvain Thery

constification of Topo

parent 0c1647ba
......@@ -222,7 +222,7 @@ void MyQT::traverse2()
{
Algo::Render::drawerCell<PFP>(VERTEX+m_second2, m_drawer, myMap, m_selected, position, m_expl);
m_drawer.color3f(1.0f,0.0f,0.0f);
Traversor<PFP::MAP>* tra = TraversorFactory<PFP::MAP>::createIncident(myMap, m_selected, 2, VERTEX+m_second2, VERTEX+m_first2);
Traversor* tra = TraversorFactory<PFP::MAP>::createIncident(myMap, m_selected, 2, VERTEX+m_second2, VERTEX+m_first2);
for (Dart d=tra->begin(); d != tra->end(); d= tra->next())
m_affDarts.push_back(d);
Algo::Render::drawerCells<PFP>(VERTEX+m_first2, m_drawer, myMap, m_affDarts, position, m_expl);
......@@ -231,7 +231,7 @@ void MyQT::traverse2()
{
Algo::Render::drawerCell<PFP>(VERTEX+m_first2, m_drawer, myMap, m_selected, position, m_expl);
m_drawer.color3f(1.0f,0.0f,0.0f);
Traversor<PFP::MAP>* tra = TraversorFactory<PFP::MAP>::createAdjacent(myMap, m_selected, 2, VERTEX+m_first2, VERTEX+m_second2);
Traversor* tra = TraversorFactory<PFP::MAP>::createAdjacent(myMap, m_selected, 2, VERTEX+m_first2, VERTEX+m_second2);
for (Dart d = tra->begin(); d != tra->end(); d = tra->next())
m_affDarts.push_back(d);
Algo::Render::drawerCells<PFP>(VERTEX+m_first2, m_drawer, myMap, m_affDarts, position, m_expl);
......@@ -291,7 +291,7 @@ void MyQT::traverse3()
dynamicMarkOrbit(VERTEX+m_second3);
m_drawer.color3f(1.0f,0.0f,0.0f);
Traversor<PFP::MAP>* tra = TraversorFactory<PFP::MAP>::createIncident(myMap,m_selected, 3, VERTEX+m_second3, VERTEX+m_first3);
Traversor* tra = TraversorFactory<PFP::MAP>::createIncident(myMap,m_selected, 3, VERTEX+m_second3, VERTEX+m_first3);
for (Dart d = tra->begin(); d != tra->end(); d = tra->next())
{
m_affDarts.push_back(d);
......@@ -312,7 +312,7 @@ void MyQT::traverse3()
dynamicMarkOrbit(VERTEX+m_first3);
m_drawer.color3f(1.0f,0.0f,0.0f);
Traversor<PFP::MAP>* tra = TraversorFactory<PFP::MAP>::createAdjacent(myMap,m_selected, 3, VERTEX+m_first3, VERTEX+m_second3);
Traversor* tra = TraversorFactory<PFP::MAP>::createAdjacent(myMap,m_selected, 3, VERTEX+m_first3, VERTEX+m_second3);
for (Dart d = tra->begin(); d != tra->end(); d = tra->next())
{
m_affDarts.push_back(d);
......
......@@ -67,7 +67,7 @@ void MyQT::orbit_list(int x)
m_selected.clear();
// easy way to traverse darts of orbit
Traversor<MAP>* tra = TraversorFactory<MAP>::createDartsOfOrbits(myMap,m_clicked,orbs[current_orbit]);
Traversor* tra = TraversorFactory<MAP>::createDartsOfOrbits(myMap,m_clicked,orbs[current_orbit]);
for (Dart e = tra->begin(); e != tra->end(); e = tra->next())
m_selected.push_back(e);
}
......@@ -173,7 +173,7 @@ void MyQT::cb_mousePress(int /*button*/, int x, int y)
m_selected.clear();
// easy way to traverse darts of orbit
Traversor<MAP>* tra = TraversorFactory<MAP>::createDartsOfOrbits(myMap,m_clicked,orbs[current_orbit]);
Traversor* tra = TraversorFactory<MAP>::createDartsOfOrbits(myMap,m_clicked,orbs[current_orbit]);
for (Dart e = tra->begin(); e != tra->end(); e = tra->next())
m_selected.push_back(e);
}
......
......@@ -120,25 +120,25 @@ public:
//@{
virtual Dart newDart() ;
Dart phi1(Dart d) ;
Dart phi1(Dart d) const;
Dart phi_1(Dart d) ;
Dart phi_1(Dart d) const;
Dart phi2(Dart d) ;
Dart phi2(Dart d) const;
private:
Dart phi2bis(Dart d) ;
Dart phi2bis(Dart d) const;
public:
Dart phi3(Dart d);
Dart phi3(Dart d) const;
Dart alpha0(Dart d);
Dart alpha0(Dart d) const;
Dart alpha1(Dart d);
Dart alpha1(Dart d) const;
Dart alpha2(Dart d);
Dart alpha2(Dart d) const;
Dart alpha_2(Dart d);
Dart alpha_2(Dart d) const;
//@}
/*! @name Topological Operators with Cells id management
......@@ -207,7 +207,7 @@ public:
/*!
*
*/
unsigned int getCurrentLevel() ;
unsigned int getCurrentLevel() const ;
//!
/*!
......@@ -219,13 +219,13 @@ public:
/*!
*
*/
unsigned int getMaxLevel() ;
unsigned int getMaxLevel() const ;
//!
/*!
*
*/
unsigned int getDartLevel(Dart d) ;
unsigned int getDartLevel(Dart d) const ;
//!
/*!
......@@ -290,7 +290,7 @@ public:
//! Return the level of insertion of the vertex of d
/*!
*/
unsigned int vertexInsertionLevel(Dart d) ;
unsigned int vertexInsertionLevel(Dart d) const;
//! Return the level of the edge of d in the current level map
/*!
......@@ -379,28 +379,28 @@ public:
virtual void next(Dart& d) const ;
virtual bool foreach_dart_of_vertex(Dart d, FunctorType& f, unsigned int thread = 0) ;
virtual bool foreach_dart_of_vertex(Dart d, FunctorType& f, unsigned int thread = 0) const ;
virtual bool foreach_dart_of_edge(Dart d, FunctorType& f, unsigned int thread = 0) ;
virtual bool foreach_dart_of_edge(Dart d, FunctorType& f, unsigned int thread = 0) const ;
bool foreach_dart_of_oriented_face(Dart d, FunctorType& f, unsigned int thread = 0);
virtual bool foreach_dart_of_face(Dart d, FunctorType& f, unsigned int thread = 0) ;
bool foreach_dart_of_oriented_face(Dart d, FunctorType& f, unsigned int thread = 0) const;
virtual bool foreach_dart_of_face(Dart d, FunctorType& f, unsigned int thread = 0) const ;
bool foreach_dart_of_oriented_volume(Dart d, FunctorType& f, unsigned int thread = 0);
virtual bool foreach_dart_of_volume(Dart d, FunctorType& f, unsigned int thread = 0) ;
bool foreach_dart_of_oriented_volume(Dart d, FunctorType& f, unsigned int thread = 0) const;
virtual bool foreach_dart_of_volume(Dart d, FunctorType& f, unsigned int thread = 0) const ;
virtual bool foreach_dart_of_cc(Dart d, FunctorType& f, unsigned int thread = 0) ;
virtual bool foreach_dart_of_cc(Dart d, FunctorType& f, unsigned int thread = 0) const ;
virtual bool foreach_dart_of_vertex2(Dart d, FunctorType& f, unsigned int thread = 0);
virtual bool foreach_dart_of_vertex2(Dart d, FunctorType& f, unsigned int thread = 0) const;
virtual bool foreach_dart_of_edge2(Dart d, FunctorType& f, unsigned int thread = 0);
virtual bool foreach_dart_of_edge2(Dart d, FunctorType& f, unsigned int thread = 0) const;
virtual bool foreach_dart_of_face2(Dart d, FunctorType& f, unsigned int thread = 0);
virtual bool foreach_dart_of_face2(Dart d, FunctorType& f, unsigned int thread = 0) const;
//@}
template <unsigned int ORBIT>
unsigned int getEmbedding(Dart d);
unsigned int getEmbedding(Dart d) const;
} ;
template <typename T, unsigned int ORBIT>
......
......@@ -92,7 +92,7 @@ inline Dart ImplicitHierarchicalMap3::newDart()
return d ;
}
inline Dart ImplicitHierarchicalMap3::phi1(Dart d)
inline Dart ImplicitHierarchicalMap3::phi1(Dart d) const
{
assert(m_dartLevel[d] <= m_curLevel || !"Access to a dart introduced after current level") ;
bool finished = false ;
......@@ -117,7 +117,7 @@ inline Dart ImplicitHierarchicalMap3::phi1(Dart d)
return it ;
}
inline Dart ImplicitHierarchicalMap3::phi_1(Dart d)
inline Dart ImplicitHierarchicalMap3::phi_1(Dart d) const
{
assert(m_dartLevel[d] <= m_curLevel || !"Access to a dart introduced after current level") ;
bool finished = false ;
......@@ -139,7 +139,7 @@ inline Dart ImplicitHierarchicalMap3::phi_1(Dart d)
return it ;
}
inline Dart ImplicitHierarchicalMap3::phi2bis(Dart d)
inline Dart ImplicitHierarchicalMap3::phi2bis(Dart d) const
{
unsigned int faceId = m_faceId[d];
Dart it = d;
......@@ -161,14 +161,14 @@ inline Dart ImplicitHierarchicalMap3::phi2bis(Dart d)
}
}
inline Dart ImplicitHierarchicalMap3::phi2(Dart d)
inline Dart ImplicitHierarchicalMap3::phi2(Dart d) const
{
assert(m_dartLevel[d] <= m_curLevel || !"Access to a dart introduced after current level") ;
return Map3::phi2(Map3::phi_1(phi1(d))) ;
}
inline Dart ImplicitHierarchicalMap3::phi3(Dart d)
inline Dart ImplicitHierarchicalMap3::phi3(Dart d) const
{
assert(m_dartLevel[d] <= m_curLevel || !"Access to a dart introduced after current level") ;
......@@ -178,26 +178,26 @@ inline Dart ImplicitHierarchicalMap3::phi3(Dart d)
return Map3::phi3(Map3::phi_1(phi1(d)));
}
inline Dart ImplicitHierarchicalMap3::alpha0(Dart d)
inline Dart ImplicitHierarchicalMap3::alpha0(Dart d) const
{
return phi3(d) ;
}
inline Dart ImplicitHierarchicalMap3::alpha1(Dart d)
inline Dart ImplicitHierarchicalMap3::alpha1(Dart d) const
{
//assert(m_dartLevel[d] <= m_curLevel || !"Access to a dart introduced after current level") ;
return phi3(phi_1(d)) ;
}
inline Dart ImplicitHierarchicalMap3::alpha2(Dart d)
inline Dart ImplicitHierarchicalMap3::alpha2(Dart d) const
{
assert(m_dartLevel[d] <= m_curLevel || !"Access to a dart introduced after current level") ;
return phi3(phi2(d));
}
inline Dart ImplicitHierarchicalMap3::alpha_2(Dart d)
inline Dart ImplicitHierarchicalMap3::alpha_2(Dart d) const
{
assert(m_dartLevel[d] <= m_curLevel || !"Access to a dart introduced after current level") ;
......@@ -225,7 +225,7 @@ inline void ImplicitHierarchicalMap3::next(Dart& d) const
} while(d != Map3::end() && m_dartLevel[d] > m_curLevel) ;
}
inline bool ImplicitHierarchicalMap3::foreach_dart_of_vertex(Dart d, FunctorType& f, unsigned int thread)
inline bool ImplicitHierarchicalMap3::foreach_dart_of_vertex(Dart d, FunctorType& f, unsigned int thread) const
{
DartMarkerStore mv(*this, thread); // Lock a marker
bool found = false; // Last functor return value
......@@ -258,7 +258,7 @@ inline bool ImplicitHierarchicalMap3::foreach_dart_of_vertex(Dart d, FunctorType
return found;
}
inline bool ImplicitHierarchicalMap3::foreach_dart_of_edge(Dart d, FunctorType& f, unsigned int thread)
inline bool ImplicitHierarchicalMap3::foreach_dart_of_edge(Dart d, FunctorType& f, unsigned int thread) const
{
Dart dNext = d;
do {
......@@ -269,7 +269,7 @@ inline bool ImplicitHierarchicalMap3::foreach_dart_of_edge(Dart d, FunctorType&
return false;
}
inline bool ImplicitHierarchicalMap3::foreach_dart_of_oriented_face(Dart d, FunctorType& f, unsigned int /*thread*/)
inline bool ImplicitHierarchicalMap3::foreach_dart_of_oriented_face(Dart d, FunctorType& f, unsigned int /*thread*/) const
{
Dart dNext = d ;
do
......@@ -281,12 +281,12 @@ inline bool ImplicitHierarchicalMap3::foreach_dart_of_oriented_face(Dart d, Func
return false ;
}
inline bool ImplicitHierarchicalMap3::foreach_dart_of_face(Dart d, FunctorType& f, unsigned int thread)
inline bool ImplicitHierarchicalMap3::foreach_dart_of_face(Dart d, FunctorType& f, unsigned int thread) const
{
return foreach_dart_of_oriented_face(d, f, thread) || foreach_dart_of_oriented_face(phi3(d), f, thread);
}
inline bool ImplicitHierarchicalMap3::foreach_dart_of_oriented_volume(Dart d, FunctorType& f, unsigned int thread)
inline bool ImplicitHierarchicalMap3::foreach_dart_of_oriented_volume(Dart d, FunctorType& f, unsigned int thread) const
{
DartMarkerStore mark(*this, thread); // Lock a marker
bool found = false; // Last functor return value
......@@ -322,12 +322,12 @@ inline bool ImplicitHierarchicalMap3::foreach_dart_of_oriented_volume(Dart d, Fu
return found;
}
inline bool ImplicitHierarchicalMap3::foreach_dart_of_volume(Dart d, FunctorType& f, unsigned int thread)
inline bool ImplicitHierarchicalMap3::foreach_dart_of_volume(Dart d, FunctorType& f, unsigned int thread) const
{
return foreach_dart_of_oriented_volume(d, f, thread) ;
}
inline bool ImplicitHierarchicalMap3::foreach_dart_of_cc(Dart d, FunctorType& f, unsigned int thread)
inline bool ImplicitHierarchicalMap3::foreach_dart_of_cc(Dart d, FunctorType& f, unsigned int thread) const
{
DartMarkerStore mark(*this, thread); // Lock a marker
bool found = false; // Last functor return value
......@@ -401,7 +401,7 @@ inline bool ImplicitHierarchicalMap3::foreach_dart_of_cc(Dart d, FunctorType& f,
}
inline bool ImplicitHierarchicalMap3::foreach_dart_of_vertex2(Dart d, FunctorType& f, unsigned int /*thread*/)
inline bool ImplicitHierarchicalMap3::foreach_dart_of_vertex2(Dart d, FunctorType& f, unsigned int /*thread*/) const
{
Dart dNext = d;
do
......@@ -413,14 +413,14 @@ inline bool ImplicitHierarchicalMap3::foreach_dart_of_vertex2(Dart d, FunctorTyp
return false;
}
inline bool ImplicitHierarchicalMap3::foreach_dart_of_edge2(Dart d, FunctorType& f, unsigned int /*thread*/)
inline bool ImplicitHierarchicalMap3::foreach_dart_of_edge2(Dart d, FunctorType& f, unsigned int /*thread*/) const
{
if (f(d))
return true;
return f(phi2(d));
}
inline bool ImplicitHierarchicalMap3::foreach_dart_of_face2(Dart d, FunctorType& f, unsigned int thread)
inline bool ImplicitHierarchicalMap3::foreach_dart_of_face2(Dart d, FunctorType& f, unsigned int thread) const
{
return foreach_dart_of_oriented_face(d,f,thread);
}
......@@ -447,7 +447,7 @@ inline void ImplicitHierarchicalMap3::decCurrentLevel()
inline unsigned int ImplicitHierarchicalMap3::getCurrentLevel()
inline unsigned int ImplicitHierarchicalMap3::getCurrentLevel() const
{
return m_curLevel ;
}
......@@ -457,12 +457,12 @@ inline void ImplicitHierarchicalMap3::setCurrentLevel(unsigned int l)
m_curLevel = l ;
}
inline unsigned int ImplicitHierarchicalMap3::getMaxLevel()
inline unsigned int ImplicitHierarchicalMap3::getMaxLevel() const
{
return m_maxLevel ;
}
inline unsigned int ImplicitHierarchicalMap3::getDartLevel(Dart d)
inline unsigned int ImplicitHierarchicalMap3::getDartLevel(Dart d) const
{
return m_dartLevel[d] ;
}
......@@ -571,7 +571,7 @@ inline void ImplicitHierarchicalMap3::setFaceId(Dart d, unsigned int i, unsigned
***************************************************/
//TODO
inline unsigned int ImplicitHierarchicalMap3::vertexInsertionLevel(Dart d)
inline unsigned int ImplicitHierarchicalMap3::vertexInsertionLevel(Dart d) const
{
assert(m_dartLevel[d] <= m_curLevel || !"Access to a dart introduced after current level") ;
return m_dartLevel[d] ;
......@@ -602,7 +602,7 @@ inline unsigned int ImplicitHierarchicalMap3::edgeLevel(Dart d)
}
template <unsigned int ORBIT>
inline unsigned int ImplicitHierarchicalMap3::getEmbedding(Dart d)
inline unsigned int ImplicitHierarchicalMap3::getEmbedding(Dart d) const
{
unsigned int nbSteps = m_curLevel - vertexInsertionLevel(d);
unsigned int index = EmbeddedMap3::getEmbedding<ORBIT>(d);
......
......@@ -171,7 +171,7 @@ void foreach_cell(MAP& map, std::vector<FunctorMapThreaded<MAP>*>& funcs, bool n
AttributeContainer* cont = NULL;
DartMarker* dmark = NULL;
CellMarker<ORBIT>* cmark = NULL;
AttributeMultiVector<Dart>* quickTraversal = map.template getQuickTraversal<ORBIT>() ;
const AttributeMultiVector<Dart>* quickTraversal = map.template getQuickTraversal<ORBIT>() ;
// fill each vd buffers with SIZE_BUFFER_THREAD darts
Dart d;
......
......@@ -451,7 +451,7 @@ public:
* @param fs a file stream
* @param id the id to save
*/
void saveBin(CGoGNostream& fs, unsigned int id);
void saveBin(CGoGNostream& fs, unsigned int id) const;
/**
* get id from file binary stream
......
......@@ -56,6 +56,8 @@ public:
releaseOnDestruct(true)
{}
~CellMarkerGen()
{}
......@@ -94,8 +96,18 @@ public:
*/
CellMarkerBase(GenericMap& map, unsigned int thread = 0) : CellMarkerGen(map, CELL, thread)
{
if(!map.isOrbitEmbedded<CELL>())
map.addEmbedding<CELL>() ;
if(!m_map.isOrbitEmbedded<CELL>())
m_map.addEmbedding<CELL>() ;
m_mark = m_map.getMarkerSet<CELL>(m_thread).getNewMark() ;
m_markVector = m_map.getMarkVector<CELL>(m_thread) ;
m_map.cellMarkers[m_thread].push_back(this) ;
}
CellMarkerBase(const GenericMap& map, unsigned int thread = 0) :
CellMarkerGen(const_cast<GenericMap&>(map), CELL, thread)
{
if(!m_map.isOrbitEmbedded<CELL>())
m_map.addEmbedding<CELL>() ;
m_mark = m_map.getMarkerSet<CELL>(m_thread).getNewMark() ;
m_markVector = m_map.getMarkVector<CELL>(m_thread) ;
m_map.cellMarkers[m_thread].push_back(this) ;
......@@ -240,6 +252,10 @@ public:
CellMarker(GenericMap& map, unsigned int thread = 0) : CellMarkerBase<CELL>(map, thread)
{}
CellMarker(const GenericMap& map, unsigned int thread = 0) :
CellMarkerBase<CELL>(map, thread)
{}
~CellMarker()
{
unmarkAll() ;
......@@ -276,6 +292,10 @@ public:
CellMarkerStore(GenericMap& map, unsigned int thread = 0) : CellMarkerBase<CELL>(map, thread)
{}
CellMarkerStore(const GenericMap& map, unsigned int thread = 0) :
CellMarkerBase<CELL>(map, thread)
{}
~CellMarkerStore()
{
unmarkAll() ;
......@@ -325,6 +345,11 @@ public:
CellMarkerMemo(GenericMap& map, unsigned int thread = 0) : CellMarkerBase<CELL>(map, thread)
{}
CellMarkerMemo(const GenericMap& map, unsigned int thread = 0) :
CellMarkerBase<CELL>(map, thread)
{}
~CellMarkerMemo()
{
unmarkAll() ;
......@@ -376,6 +401,11 @@ public:
CellMarkerNoUnmark(GenericMap& map, unsigned int thread = 0) : CellMarkerBase<CELL>(map, thread)
{}
CellMarkerNoUnmark(const GenericMap& map, unsigned int thread = 0) :
CellMarkerBase<CELL>(map, thread)
{}
~CellMarkerNoUnmark()
{
// assert(isAllUnmarked()) ;
......@@ -409,6 +439,7 @@ protected:
const CellMarkerBase<CELL>& m_cmarker ;
public:
SelectorCellMarked(const CellMarkerBase<CELL>& cm) : m_cmarker(cm) {}
inline bool operator()(Dart d) const
{
if (m_cmarker.isMarked(d))
......
......@@ -61,6 +61,14 @@ public:
m_map.dartMarkers[m_thread].push_back(this) ;
}
DartMarkerGen(const GenericMap& map, unsigned int thread = 0) :
m_map(const_cast<GenericMap&>(map)), m_thread(thread), releaseOnDestruct(true)
{
m_mark = m_map.getMarkerSet<DART>(m_thread).getNewMark() ;
m_markVector = m_map.getMarkVector<DART>(m_thread) ;
m_map.dartMarkers[m_thread].push_back(this) ;
}
~DartMarkerGen()
{
if (releaseOnDestruct)
......@@ -214,12 +222,12 @@ public:
class DartMarker : public DartMarkerGen
{
public:
DartMarker(GenericMap& map) :
DartMarker(const GenericMap& map) :
DartMarkerGen(map)
{
}
{ }
DartMarker(GenericMap& map, unsigned int thread) :
DartMarker(const GenericMap& map, unsigned int thread) :
DartMarkerGen(map, thread)
{
}
......@@ -256,15 +264,15 @@ protected:
std::vector<unsigned int> m_markedDarts ;
public:
DartMarkerStore(GenericMap& map) :
DartMarkerStore(const GenericMap& map) :
DartMarkerGen(map)
{
}
{ }
DartMarkerStore(GenericMap& map, unsigned int thread) :
DartMarkerStore(const GenericMap& map, unsigned int thread) :
DartMarkerGen(map, thread)
{
}
{ }
~DartMarkerStore()
{
......@@ -325,15 +333,14 @@ public:
class DartMarkerNoUnmark : public DartMarkerGen
{
public:
DartMarkerNoUnmark(GenericMap& map) :
DartMarkerNoUnmark(const GenericMap& map) :
DartMarkerGen(map)
{
}
{ }
DartMarkerNoUnmark(GenericMap& map, unsigned int th) :
DartMarkerNoUnmark(const GenericMap& map, unsigned int th) :
DartMarkerGen(map, th)
{
}
{ }
~DartMarkerNoUnmark()
{
......
......@@ -44,6 +44,14 @@ public:
virtual bool operator()(Dart d) = 0;
};
class FunctorConstType
{
public:
FunctorConstType() {}
virtual ~FunctorConstType() {}
virtual bool operator()(Dart d) = 0;
};
// Base Class for Functors that need access to the map
/********************************************************/
template <typename MAP>
......@@ -55,6 +63,16 @@ public:
FunctorMap(MAP& m): m_map(m) {}
};
template <typename MAP>
class FunctorConstMap : public virtual FunctorType
{
protected:
const MAP& m_map ;
public:
FunctorConstMap(const MAP& m): m_map(m) {}
};
// Selector functors : return true to select or false to not select a dart
/********************************************************/
class FunctorSelect
......@@ -125,9 +143,9 @@ class SelectorVertexBoundary : public FunctorSelect
{
public:
protected:
MAP& m_map;
const MAP& m_map;
public:
SelectorVertexBoundary(MAP& m): m_map(m) {}
SelectorVertexBoundary(const MAP& m): m_map(m) {}
bool operator()(Dart d) const { return m_map.isBoundaryVertex(d); }
FunctorSelect* copy() const { return new SelectorVertexBoundary(m_map);}
};
......@@ -137,9 +155,9 @@ class SelectorVertexNoBoundary : public FunctorSelect
{
public:
protected:
MAP& m_map;
const MAP& m_map;
public:
SelectorVertexNoBoundary(MAP& m): m_map(m) {}
SelectorVertexNoBoundary(const MAP& m): m_map(m) {}
bool operator()(Dart d) const { return !m_map.isBoundaryVertex(d); }
FunctorSelect* copy() const { return new SelectorVertexNoBoundary(m_map);}
};
......@@ -149,9 +167,9 @@ class SelectorEdgeBoundary : public FunctorSelect
{
public:
protected:
MAP& m_map;
const MAP& m_map;
public:
SelectorEdgeBoundary(MAP& m): m_map(m) {}
SelectorEdgeBoundary(const MAP& m): m_map(m) {}
bool operator()(Dart d) const { return m_map.isBoundaryEdge(d); }
FunctorSelect* copy() const { return new SelectorEdgeBoundary(m_map);}
};
......@@ -162,9 +180,9 @@ class SelectorEdgeNoBoundary : public FunctorSelect
{
public:
protected:
MAP& m_map;
const MAP& m_map;
public:
SelectorEdgeNoBoundary(MAP& m): m_map(m) {}
SelectorEdgeNoBoundary(const MAP& m): m_map(m) {}
bool operator()(Dart d) const { return !m_map.isBoundaryEdge(d); }
FunctorSelect* copy() const { return new SelectorEdgeNoBoundary(m_map);}
};
......@@ -177,9 +195,9 @@ class SelectorDartBoundary : public FunctorSelect
{
public:
protected:
MAP& m_map;
const MAP& m_map;
public:
SelectorDartBoundary(MAP& m): m_map(m) {}
SelectorDartBoundary(const MAP& m): m_map(m) {}
bool operator()(Dart d) const { return m_map.template isBoundaryMarked<MAP::DIMENSION>(d); }
FunctorSelect* copy() const { return new SelectorDartBoundary(m_map);}
};
......@@ -193,9 +211,9 @@ class SelectorDartNoBoundary : public FunctorSelect
{
public:
protected:
MAP& m_map;
const MAP& m_map;
public:
SelectorDartNoBoundary(MAP& m): m_map(m) {}
SelectorDartNoBoundary(const MAP& m): m_map(m) {}
bool operator()(Dart d) const { return !m_map.template isBoundaryMarked<MAP::DIMENSION>(d); }
FunctorSelect* copy() const { return new SelectorDartNoBoundary(m_map);}
};
......@@ -205,10 +223,10 @@ class SelectorLevel : public FunctorSelect
{
public:
protected:
MAP& m_map;
const MAP& m_map;
unsigned int m_level;
public:
SelectorLevel(MAP& m, unsigned int l): m_map(m), m_level(l) {}
SelectorLevel(const MAP& m, unsigned int l): m_map(m), m_level(l) {}
bool operator()(Dart d) const { return m_map.getDartLevel(d) == m_level; }
FunctorSelect* copy() const { return new SelectorLevel(m_map, m_level);}
};
......@@ -218,10 +236,10 @@ class SelectorEdgeLevel : public FunctorSelect
{
public:
protected:
MAP& m_map;
const MAP& m_map;
unsigned int m_level;
public:
SelectorEdgeLevel(MAP& m, unsigned int l): m_map(m), m_level(l) {}
SelectorEdgeLevel(const MAP& m, unsigned int l): m_map(m), m_level(l) {}
bool operator()(Dart d) const { return (m_map.getDartLevel(d) == m_level) && (m_map.getDartLevel(m_map.phi2(d)) == m_level); }
FunctorSelect* copy() const { return new SelectorEdgeLevel(m_map, m_level);}
};
......@@ -286,13 +304,13 @@ public:
// Functor Check Embedding : to check the embeddings of the given map
template <typename MAP>
class FunctorCheckEmbedding : public FunctorMap<MAP>
class FunctorCheckEmbedding : public FunctorConstMap<MAP>
{
protected:
unsigned int orbit;
unsigned int emb;
public:
FunctorCheckEmbedding(MAP& map, unsigned int orb, unsigned int e) : FunctorMap<MAP>(map), orbit(orb), emb(e)
FunctorCheckEmbedding(const MAP& map, unsigned int orb, unsigned int e) : FunctorConstMap<MAP>(map), orbit(orb), emb(e)
{}
bool operator()(Dart d)
......@@ -348,12 +366,12 @@ public:
template <typename MAP>