Brève interruption de service ce midi pour augmentation de la mémoire 🤞

Commit 1e81b6fd authored by Sylvain Thery's avatar Sylvain Thery

resolve bug between MR and DartBrowser

parent e26736d1
......@@ -42,6 +42,7 @@ class DartContainerBrowserSelector : public ContainerBrowser
protected:
AttributeContainer* m_cont ;
const FunctorSelect* m_selector ;
AttribMap& m_map;
public:
DartContainerBrowserSelector(AttribMap& m, const FunctorSelect& fs);
......
......@@ -29,9 +29,17 @@ namespace CGoGN
{
inline DartContainerBrowserSelector::DartContainerBrowserSelector(AttribMap& m, const FunctorSelect& fs)
inline DartContainerBrowserSelector::DartContainerBrowserSelector(AttribMap& m, const FunctorSelect& fs):
m_map(m)
{
m_cont = &(m.getAttributeContainer<DART>());
if (GenericMap::isMultiRes())
{
m_cont = &(m.getMRAttributeContainer());
}
else
{
m_cont = &(m.getAttributeContainer<DART>());
}
m_selector = fs.copy();
}
......@@ -42,11 +50,20 @@ inline DartContainerBrowserSelector::~DartContainerBrowserSelector()
inline unsigned int DartContainerBrowserSelector::begin() const
{
unsigned int it = m_cont->realBegin() ;
while ( (it != m_cont->realEnd()) && !m_selector->operator()(Dart(it)) )
m_cont->realNext(it);
return it;
if (GenericMap::isMultiRes())
{
unsigned int it = m_cont->realBegin() ;
while ( (it != m_cont->realEnd()) && !m_selector->operator()(m_map.indexDart(it)) )
m_cont->realNext(it);
return it;
}
else
{
unsigned int it = m_cont->realBegin() ;
while ( (it != m_cont->realEnd()) && !m_selector->operator()(Dart(it)) )
m_cont->realNext(it);
return it;
}
}
inline unsigned int DartContainerBrowserSelector::end() const
......
......@@ -320,6 +320,16 @@ public:
*/
unsigned int dartIndex(Dart d) const;
/**
* get the Dart of index in topological table
*/
Dart indexDart(unsigned int index) const;
/**
* @brief are we in MR ?
*/
static bool isMultiRes() { return m_isMultiRes; }
/**
* get the insertion level of a dart (use only in MRMaps)
*/
......
......@@ -236,6 +236,14 @@ inline unsigned int GenericMap::dartIndex(Dart d) const
return d.index;
}
inline Dart GenericMap::indexDart(unsigned int index) const
{
if (m_isMultiRes)
return Dart( (*m_mrDarts[m_mrCurrentLevel])[index]) ;
return Dart(index);
}
inline unsigned int GenericMap::getDartLevel(Dart d) const
{
return (*m_mrLevels)[d.index] ;
......
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