Commit 366ba117 authored by Pierre Kraemer's avatar Pierre Kraemer
Browse files

debug next() in MR case

parent 13408457
...@@ -164,32 +164,32 @@ public: ...@@ -164,32 +164,32 @@ public:
****************************************/ ****************************************/
/** /**
* get the current level of multi-resolution (use only in MRMaps) * get the current resolution level (use only in MRMaps)
*/ */
unsigned int getCurrentLevel() ; unsigned int getCurrentLevel() ;
/** /**
* set the current level of multi-resolution (use only in MRMaps) * set the current resolution level (use only in MRMaps)
*/ */
void setCurrentLevel(unsigned int l) ; void setCurrentLevel(unsigned int l) ;
/** /**
* store current level of multi-resolution on a stack (use only in MRMaps) * store current resolution level on a stack (use only in MRMaps)
*/ */
void pushLevel() ; void pushLevel() ;
/** /**
* get back level of multi-resolution of the stack in current (use only in MRMaps) * set as current the resolution level of the top of the stack (use only in MRMaps)
*/ */
void popLevel() ; void popLevel() ;
/** /**
* get the max level of multi-resolution (use only in MRMaps) * get the maximum resolution level (use only in MRMaps)
*/ */
unsigned int getMaxLevel() ; unsigned int getMaxLevel() ;
/** /**
* add a level of multi-resolution (use only in MRMaps) * add a resolution level (use only in MRMaps)
*/ */
void addLevel() ; void addLevel() ;
...@@ -213,7 +213,6 @@ protected: ...@@ -213,7 +213,6 @@ protected:
void deleteDart(Dart d) ; void deleteDart(Dart d) ;
public: public:
/** /**
* get the index of dart in topological table * get the index of dart in topological table
*/ */
......
...@@ -46,7 +46,7 @@ inline void GenericMap::setCurrentLevel(unsigned int l) ...@@ -46,7 +46,7 @@ inline void GenericMap::setCurrentLevel(unsigned int l)
if(l < m_mrDarts.size()) if(l < m_mrDarts.size())
m_mrCurrentLevel = l ; m_mrCurrentLevel = l ;
else else
CGoGNout << "try to access inexisting resolution level" << CGoGNendl ; CGoGNout << "setCurrentLevel : try to access inexisting resolution level" << CGoGNendl ;
} }
inline void GenericMap::pushLevel() inline void GenericMap::pushLevel()
...@@ -281,8 +281,10 @@ inline void GenericMap::next(Dart& d) ...@@ -281,8 +281,10 @@ inline void GenericMap::next(Dart& d)
{ {
if (m_isMultiRes) if (m_isMultiRes)
{ {
while ((d.index != m_mrattribs.end() ) && (getDartLevel(d.index) > m_mrCurrentLevel)) do
{
m_mrattribs.next(d.index) ; m_mrattribs.next(d.index) ;
} while ((d.index != m_mrattribs.end() ) && (getDartLevel(d.index) > m_mrCurrentLevel)) ;
} }
else else
m_attribs[DART].next(d.index) ; m_attribs[DART].next(d.index) ;
......
...@@ -25,12 +25,12 @@ ...@@ -25,12 +25,12 @@
#ifndef __MAP2MR_PRIMAL__ #ifndef __MAP2MR_PRIMAL__
#define __MAP2MR_PRIMAL__ #define __MAP2MR_PRIMAL__
#include "Topology/map/map2.h" #include "Topology/map/embeddedMap2.h"
namespace CGoGN namespace CGoGN
{ {
class Map2MR_Primal : protected Map2 class Map2MR_Primal : public EmbeddedMap2
{ {
public: public:
Map2MR_Primal() ; Map2MR_Primal() ;
...@@ -96,12 +96,24 @@ public: ...@@ -96,12 +96,24 @@ public:
* SUBDIVISION * * SUBDIVISION *
***************************************************/ ***************************************************/
/**
* subdivide the edge of d to the next level
*/
void subdivideEdge(Dart d) ; void subdivideEdge(Dart d) ;
/**
* subdivide the face of d to the next level
*/
void subdivideFace(Dart d) ; void subdivideFace(Dart d) ;
/**
* coarsen the edge of d from the next level
*/
void coarsenEdge(Dart d) ; void coarsenEdge(Dart d) ;
/**
* coarsen the face of d from the next level
*/
void coarsenFace(Dart d) ; void coarsenFace(Dart d) ;
} ; } ;
......
...@@ -155,13 +155,13 @@ void GenericMap::clear(bool removeAttrib) ...@@ -155,13 +155,13 @@ void GenericMap::clear(bool removeAttrib)
if (m_isMultiRes) if (m_isMultiRes)
{ {
m_mrattribs.clear(true); m_mrattribs.clear(true) ;
m_mrLevels = NULL; m_mrDarts.clear() ;
unsigned int nb = m_mrDarts.size();
for (unsigned int i = 0; i<nb; ++i) m_mrLevels = m_mrattribs.addAttribute<unsigned char>("MRLevel") ;
m_mrDarts[i]=NULL; addLevel() ;
m_mrCurrentLevel=0; setCurrentLevel(0) ;
m_mrLevelStack.clear(); m_mrLevelStack.clear() ;
} }
} }
......
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