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

Replace the next(d) of map by d = next(d) : better functional syntax

parent f29d13fe
...@@ -91,7 +91,7 @@ public: ...@@ -91,7 +91,7 @@ public:
virtual Dart end() ; virtual Dart end() ;
virtual void next(Dart& d) ; virtual Dart next(Dart& d) ;
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) ;
......
...@@ -152,12 +152,13 @@ inline Dart ImplicitHierarchicalMap::end() ...@@ -152,12 +152,13 @@ inline Dart ImplicitHierarchicalMap::end()
return Map2::end() ; return Map2::end() ;
} }
inline void ImplicitHierarchicalMap::next(Dart& d) inline Dart ImplicitHierarchicalMap::next(Dart& d)
{ {
do do
{ {
Map2::next(d) ; Map2::next(d) ;
} while(d != Map2::end() && m_dartLevel[d] > m_curLevel) ; } 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) inline bool ImplicitHierarchicalMap::foreach_dart_of_vertex(Dart d, FunctorType& f, unsigned int thread)
......
...@@ -354,7 +354,7 @@ public: ...@@ -354,7 +354,7 @@ public:
virtual Dart end() ; virtual Dart end() ;
virtual void next(Dart& d) ; virtual Dart next(Dart& d) ;
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) ;
......
...@@ -213,12 +213,13 @@ inline Dart ImplicitHierarchicalMap3::end() ...@@ -213,12 +213,13 @@ inline Dart ImplicitHierarchicalMap3::end()
return Map3::end() ; return Map3::end() ;
} }
inline void ImplicitHierarchicalMap3::next(Dart& d) inline Dart ImplicitHierarchicalMap3::next(Dart& d)
{ {
do do
{ {
Map3::next(d) ; Map3::next(d) ;
} while(d != Map3::end() && m_dartLevel[d] > m_curLevel) ; } 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) inline bool ImplicitHierarchicalMap3::foreach_dart_of_vertex(Dart d, FunctorType& f, unsigned int thread)
......
...@@ -47,7 +47,8 @@ namespace GL2 ...@@ -47,7 +47,8 @@ namespace GL2
{ {
/** /**
* Class that allors * Class that update VBO to allow the rendering of per face color rendering
* Warning: do not use same position & color VBO than with pervertex rendering !
*/ */
class ColorPerFaceRender class ColorPerFaceRender
{ {
......
...@@ -41,13 +41,9 @@ namespace GL2 ...@@ -41,13 +41,9 @@ namespace GL2
{ {
//inline ColorPerFaceRender::ColorPerFaceRender(Utils::VBO& vboPosition, Utils::VBO& vboColor):
// m_vboPos(vboPosition), m_vboColors(vboColor), m_nbTris(0)
//{
//}
inline ColorPerFaceRender::ColorPerFaceRender(): inline ColorPerFaceRender::ColorPerFaceRender():
m_nbTris(0) m_nbTris(0)
{ {
} }
......
...@@ -55,7 +55,7 @@ class MapBrowser ...@@ -55,7 +55,7 @@ class MapBrowser
public: public:
virtual Dart begin() = 0; virtual Dart begin() = 0;
virtual Dart end() = 0; virtual Dart end() = 0;
virtual void next(Dart& d) = 0; virtual Dart next(Dart& d) = 0;
}; };
class AttributeHandlerGen ; class AttributeHandlerGen ;
...@@ -540,7 +540,7 @@ public: ...@@ -540,7 +540,7 @@ public:
* in the order of storage * in the order of storage
* @param d reference to the dart to be modified * @param d reference to the dart to be modified
*/ */
void next(Dart& d) ; Dart next(Dart& d) ;
/** /**
* Apply a functor on each dart of the map * Apply a functor on each dart of the map
......
...@@ -360,7 +360,7 @@ inline Dart GenericMap::end() ...@@ -360,7 +360,7 @@ inline Dart GenericMap::end()
return Dart::create(m_attribs[DART].end()) ; return Dart::create(m_attribs[DART].end()) ;
} }
inline void GenericMap::next(Dart& d) inline Dart GenericMap::next(Dart& d)
{ {
if (m_isMultiRes) if (m_isMultiRes)
{ {
...@@ -371,6 +371,7 @@ inline void GenericMap::next(Dart& d) ...@@ -371,6 +371,7 @@ inline void GenericMap::next(Dart& d)
} }
else else
m_attribs[DART].next(d.index) ; m_attribs[DART].next(d.index) ;
return d;
} }
/**************************************** /****************************************
......
...@@ -57,7 +57,7 @@ Dart TraversorCell<MAP>::begin() ...@@ -57,7 +57,7 @@ Dart TraversorCell<MAP>::begin()
current = m.begin() ; current = m.begin() ;
while(current != m.end() && (m.isBoundaryMarked(current) || !m_good(current))) while(current != m.end() && (m.isBoundaryMarked(current) || !m_good(current)))
m.next(current) ; current = m.next(current) ;
if(current == m.end()) if(current == m.end())
current = NIL ; current = NIL ;
...@@ -92,7 +92,7 @@ Dart TraversorCell<MAP>::next() ...@@ -92,7 +92,7 @@ Dart TraversorCell<MAP>::next()
while(current != NIL && (ismarked || m.isBoundaryMarked(current) || !m_good(current))) while(current != NIL && (ismarked || m.isBoundaryMarked(current) || !m_good(current)))
{ {
m.next(current) ; current = m.next(current) ;
if(current == m.end()) if(current == m.end())
current = NIL ; current = NIL ;
else 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