Commit 15beca88 authored by Sylvain Thery's avatar Sylvain Thery

return to old style next(d) because of possible dangerous usage of next with return value

parent e0f1b877
......@@ -87,11 +87,11 @@ public:
Dart alpha_1(Dart d) ;
virtual Dart begin() ;
virtual Dart begin() const ;
virtual Dart end() ;
virtual Dart end() const ;
virtual Dart next(Dart& d) ;
virtual void next(Dart& d) const ;
virtual bool foreach_dart_of_vertex(Dart d, FunctorType& f, unsigned int thread = 0) ;
......
......@@ -139,7 +139,7 @@ inline Dart ImplicitHierarchicalMap::alpha_1(Dart d)
return Map2::alpha_1(d) ;
}
inline Dart ImplicitHierarchicalMap::begin()
inline Dart ImplicitHierarchicalMap::begin() const
{
Dart d = Map2::begin() ;
while(d != Map2::end() && m_dartLevel[d] > m_curLevel)
......@@ -147,18 +147,17 @@ inline Dart ImplicitHierarchicalMap::begin()
return d ;
}
inline Dart ImplicitHierarchicalMap::end()
inline Dart ImplicitHierarchicalMap::end() const
{
return Map2::end() ;
}
inline Dart ImplicitHierarchicalMap::next(Dart& d)
inline void ImplicitHierarchicalMap::next(Dart& d) const
{
do
{
Map2::next(d) ;
} while(d != Map2::end() && m_dartLevel[d] > m_curLevel) ;
return d;
}
inline bool ImplicitHierarchicalMap::foreach_dart_of_vertex(Dart d, FunctorType& f, unsigned int thread)
......
......@@ -360,11 +360,11 @@ public:
*************************************************************************/
//@{
virtual Dart begin() ;
virtual Dart begin() const;
virtual Dart end() ;
virtual Dart end() const;
virtual Dart next(Dart& d) ;
virtual void next(Dart& d) const ;
virtual bool foreach_dart_of_vertex(Dart d, FunctorType& f, unsigned int thread = 0) ;
......
......@@ -200,7 +200,7 @@ inline Dart ImplicitHierarchicalMap3::alpha_2(Dart d)
return phi2(phi3(d));
}
inline Dart ImplicitHierarchicalMap3::begin()
inline Dart ImplicitHierarchicalMap3::begin() const
{
Dart d = Map3::begin() ;
while(m_dartLevel[d] > m_curLevel)
......@@ -208,18 +208,17 @@ inline Dart ImplicitHierarchicalMap3::begin()
return d ;
}
inline Dart ImplicitHierarchicalMap3::end()
inline Dart ImplicitHierarchicalMap3::end() const
{
return Map3::end() ;
}
inline Dart ImplicitHierarchicalMap3::next(Dart& d)
inline void ImplicitHierarchicalMap3::next(Dart& d) const
{
do
{
Map3::next(d) ;
} while(d != Map3::end() && m_dartLevel[d] > m_curLevel) ;
return d;
}
inline bool ImplicitHierarchicalMap3::foreach_dart_of_vertex(Dart d, FunctorType& f, unsigned int thread)
......
......@@ -53,9 +53,9 @@ namespace CGoGN
class MapBrowser
{
public:
virtual Dart begin() = 0;
virtual Dart end() = 0;
virtual Dart next(Dart& d) = 0;
virtual Dart begin() const = 0;
virtual Dart end() const = 0;
virtual void next(Dart& d) const = 0;
};
class AttributeHandlerGen ;
......@@ -259,7 +259,7 @@ public:
/**
* get the insertion level of a dart (use only in MRMaps)
*/
unsigned int getDartLevel(Dart d) ;
unsigned int getDartLevel(Dart d) const ;
/**
* get the number of darts inserted in the given leveldart (use only in MRMaps)
......@@ -526,20 +526,20 @@ public:
* Begin of map
* @return the first dart of the map
*/
Dart begin() ;
Dart begin() const;
/**
* End of map
* @return the end iterator (next of last) of the map
*/
Dart end() ;
Dart end() const;
/**
* allow to go from a dart to the next
* in the order of storage
* @param d reference to the dart to be modified
*/
Dart next(Dart& d) ;
void next(Dart& d) const ;
/**
* Apply a functor on each dart of the map
......
......@@ -194,7 +194,7 @@ inline unsigned int GenericMap::dartIndex(Dart d) const
return d.index;
}
inline unsigned int GenericMap::getDartLevel(Dart d)
inline unsigned int GenericMap::getDartLevel(Dart d) const
{
return (*m_mrLevels)[d.index] ;
}
......@@ -339,7 +339,7 @@ inline AttributeMultiVector<unsigned int>* GenericMap::getEmbeddingAttributeVect
* DARTS TRAVERSALS *
****************************************/
inline Dart GenericMap::begin()
inline Dart GenericMap::begin() const
{
if (m_isMultiRes)
{
......@@ -352,7 +352,7 @@ inline Dart GenericMap::begin()
return Dart::create(m_attribs[DART].begin()) ;
}
inline Dart GenericMap::end()
inline Dart GenericMap::end() const
{
if (m_isMultiRes)
return Dart::create(m_mrattribs.end()) ;
......@@ -360,7 +360,7 @@ inline Dart GenericMap::end()
return Dart::create(m_attribs[DART].end()) ;
}
inline Dart GenericMap::next(Dart& d)
inline void GenericMap::next(Dart& d) const
{
if (m_isMultiRes)
{
......@@ -371,7 +371,6 @@ inline Dart GenericMap::next(Dart& d)
}
else
m_attribs[DART].next(d.index) ;
return d;
}
/****************************************
......
......@@ -47,17 +47,17 @@ public:
m_map(m), m_selector(fs)
{}
Dart begin()
Dart begin() const
{
return m_map.begin() ;
}
Dart end()
Dart end() const
{
return m_map.end() ;
}
void next(Dart& d)
void next(Dart& d) const
{
do
{
......@@ -112,17 +112,17 @@ public:
m_end = NIL ;
}
Dart begin()
Dart begin() const
{
return m_first ;
}
Dart end()
Dart end() const
{
return NIL ;
}
void next(Dart& d)
void next(Dart& d) const
{
assert(d != NIL) ;
d = m_links[d] ;
......
......@@ -57,7 +57,7 @@ Dart TraversorCell<MAP>::begin()
current = m.begin() ;
while(current != m.end() && (m.isBoundaryMarked(current) || !m_good(current)))
current = m.next(current) ;
m.next(current) ;
if(current == m.end())
current = NIL ;
......@@ -92,7 +92,7 @@ Dart TraversorCell<MAP>::next()
while(current != NIL && (ismarked || m.isBoundaryMarked(current) || !m_good(current)))
{
current = m.next(current) ;
m.next(current) ;
if(current == m.end())
current = NIL ;
else
......
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