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

debug next() in MR case

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