<commit_before>/*******************************************************************************
* CGoGN: Combinatorial and Geometric modeling with Generic N-dimensional Maps  *
* version 0.1                                                                  *
* Copyright (C) 2009-2012, IGG Team, LSIIT, University of Strasbourg           *
*                                                                              *
* This library is free software; you can redistribute it and/or modify it      *
* under the terms of the GNU Lesser General Public License as published by the *
* Free Software Foundation; either version 2.1 of the License, or (at your     *
* option) any later version.                                                   *
*                                                                              *
* This library is distributed in the hope that it will be useful, but WITHOUT  *
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or        *
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License  *
* for more details.                                                            *
*                                                                              *
* You should have received a copy of the GNU Lesser General Public License     *
* along with this library; if not, write to the Free Software Foundation,      *
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301 USA.           *
*                                                                              *
* Web site: http://cgogn.unistra.fr/                                           *
* Contact information: <EMAIL>                                        *
*                                                                              *
****************************************************************/


#ifndef __IMPLICIT_HIERARCHICAL_MAP3__
#define __IMPLICIT_HIERARCHICAL_MAP3__

#include "Topology/generic/mapImpl/mapCPH.h"
#include "Topology/map/map3.h"
#include "Algo/Multiresolution/filter.h"


namespace CGoGN
{

namespace Algo
{
namespace Volume
{
namespace IHM
{

class ImplicitHierarchicalMap3 : public Map3< MapCPH >
{
//    template<typename T, unsigned int ORBIT>
//    friend class AttributeHandler_Traits<T, ORBIT, ImplicitHierarchicalMap3>::Handler ;
public:
    typedef Map3< MapCPH > Parent;
    typedef Parent ParentMap;
    typedef ImplicitHierarchicalMap3 MAP;
    typedef MAP TOPO_MAP;
    typedef MapCPH IMPL;
    template <typename T>
    struct VertexAttributeAccessorCPHMap {
        static inline T& at(MAP* map, AttributeMultiVector<T>* attrib, Cell<VERTEX> c)
        {
            const Dart d = c.dart;
            const unsigned int nbSteps = map->m_curLevel - map->vertexInsertionLevel(d) ;
            unsigned int index = map->Parent::template getEmbedding<VERTEX>(d) ;
//            std::cerr << "VertexAttributeAccessorCPHMap : nbSteps = " << nbSteps << std::endl;
            if(index == EMBNULL)
            {
                index = Algo::Topo::setOrbitEmbeddingOnNewCell<VERTEX>(*map, d) ;
                map->m_nextLevelCell->operator[](index) = EMBNULL ;
            }

            AttributeContainer& cont = map->getAttributeContainer<VERTEX>() ;
            unsigned int step = 0 ;
            while(step < nbSteps)
            {
                step++ ;
                unsigned int nextIdx = map->m_nextLevelCell->operator[](index) ;
                if (nextIdx == EMBNULL)
                {
                    nextIdx = map->newCell<VERTEX>() ;
                    map->copyCell<VERTEX>(nextIdx, index) ;
                    map->m_nextLevelCell->operator[](index) = nextIdx ;
//                    std::cerr << "m_nextLevelCell[" << index << "] = " << nextIdx << std::endl;
                    map->m_nextLevelCell->operator[](nextIdx) = EMBNULL ;
                    cont.refLine(index) ;
                }
                index = nextIdx ;
            }
            return attrib->operator[](index);
        }

        static inline const T& at(MAP* map, const AttributeMultiVector<T>* attrib, Cell<VERTEX> c)
        {
            const Dart d = c.dart;
            const unsigned int nbSteps = map->m_curLevel - map->vertexInsertionLevel(d) ;
            unsigned int index = map->Parent::template getEmbedding<VERTEX>(d) ;
//            std::cerr << "(const) VertexAttributeAccessorCPHMap : nbSteps = " << nbSteps << std::endl;
            if(index == EMBNULL)
            {
                assert(false);
//                index = Algo::Topo::setOrbitEmbeddingOnNewCell<VERTEX>(*map, d) ;
//                map->m_nextLevelCell->operator[](index) = EMBNULL ;
            }


            unsigned int step = 0 ;
            while(step < nbSteps)
            {
                step++ ;
                const unsigned int nextIdx = map->m_nextLevelCell->operator[](index) ;
                if(nextIdx != EMBNULL)
                {
                    index = nextIdx ;
                } else
                {<commit_msg>cgogn extlib : temporarily not using the multi-resolution attributes for vertices.<commit_after>/*******************************************************************************
* CGoGN: Combinatorial and Geometric modeling with Generic N-dimensional Maps  *
* version 0.1                                                                  *
* Copyright (C) 2009-2012, IGG Team, LSIIT, University of Strasbourg           *
*                                                                              *
* This library is free software; you can redistribute it and/or modify it      *
* under the terms of the GNU Lesser General Public License as published by the *
* Free Software Foundation; either version 2.1 of the License, or (at your     *
* option) any later version.                                                   *
*                                                                              *
* This library is distributed in the hope that it will be useful, but WITHOUT  *
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or        *
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License  *
* for more details.                                                            *
*                                                                              *
* You should have received a copy of the GNU Lesser General Public License     *
* along with this library; if not, write to the Free Software Foundation,      *
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301 USA.           *
*                                                                              *
* Web site: http://cgogn.unistra.fr/                                           *
* Contact information: <EMAIL>                                        *
*                                                                              *
****************************************************************/


#ifndef __IMPLICIT_HIERARCHICAL_MAP3__
#define __IMPLICIT_HIERARCHICAL_MAP3__

#include "Topology/generic/mapImpl/mapCPH.h"
#include "Topology/map/map3.h"
#include "Algo/Multiresolution/filter.h"


namespace CGoGN
{

namespace Algo
{
namespace Volume
{
namespace IHM
{

class ImplicitHierarchicalMap3 : public Map3< MapCPH >
{
//    template<typename T, unsigned int ORBIT>
//    friend class AttributeHandler_Traits<T, ORBIT, ImplicitHierarchicalMap3>::Handler ;
public:
    typedef Map3< MapCPH > Parent;
    typedef Parent ParentMap;
    typedef ImplicitHierarchicalMap3 MAP;
    typedef MAP TOPO_MAP;
    typedef MapCPH IMPL;
    template <typename T>
    struct VertexAttributeAccessorCPHMap {
        static inline T& at(MAP* map, AttributeMultiVector<T>* attrib, Cell<VERTEX> c)
        {
            const Dart d = c.dart;
            const unsigned int nbSteps = map->m_curLevel - map->vertexInsertionLevel(d) ;
            unsigned int index = map->Parent::template getEmbedding<VERTEX>(d) ;
//            std::cerr << "VertexAttributeAccessorCPHMap : nbSteps = " << nbSteps << std::endl;
//            if(index == EMBNULL)
//            {
//                index = Algo::Topo::setOrbitEmbeddingOnNewCell<VERTEX>(*map, d) ;
//                map->m_nextLevelCell->operator[](index) = EMBNULL ;
//            }

//            AttributeContainer& cont = map->getAttributeContainer<VERTEX>() ;
//            unsigned int step = 0 ;
//            while(step < nbSteps)
//            {
//                step++ ;
//                unsigned int nextIdx = map->m_nextLevelCell->operator[](index) ;
//                if (nextIdx == EMBNULL)
//                {
//                    nextIdx = map->newCell<VERTEX>() ;
//                    map->copyCell<VERTEX>(nextIdx, index) ;
//                    map->m_nextLevelCell->operator[](index) = nextIdx ;
////                    std::cerr << "m_nextLevelCell[" << index << "] = " << nextIdx << std::endl;
//                    map->m_nextLevelCell->operator[](nextIdx) = EMBNULL ;
//                    cont.refLine(index) ;
//                }
//                index = nextIdx ;
//            }
            return attrib->operator[](index);
        }

        static inline const T& at(MAP* map, const AttributeMultiVector<T>* attrib, Cell<VERTEX> c)
        {
            const Dart d = c.dart;
            const unsigned int nbSteps = map->m_curLevel - map->vertexInsertionLevel(d) ;
            unsigned int index = map->Parent::template getEmbedding<VERTEX>(d) ;
//            std::cerr << "(const) VertexAttributeAccessorCPHMap : nbSteps = " << nbSteps << std::endl;
            if(index == EMBNULL)
            {
                assert(false);
//                index = Algo::Topo::setOrbitEmbeddingOnNewCell<VERTEX>(*map, d) ;
//                map->m_nextLevelCell->operator[](index) = EMBNULL ;
            }


            unsigned int step = 0 ;
            while(step < nbSteps)
            {
                step++ ;
                const unsigned int nextIdx = map->m_nextLevelCell->operator[](index) ;
                if(nextIdx != EMBNULL)
                {
                    index = nextIdx ;
                } else
                {
{'fraction_non_alphanumeric': 0.12046415576752877, 'fraction_numerical': 0.0064903136984954275, 'mean_word_length': 1.5117312916769572, 'pattern_counts': {'":': 0, '<': 85, '<?xml version=': 0, '>': 81, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 46, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1073623', 'n_tokens_mistral': 2593, 'n_tokens_neox': 2462, 'n_words': 661}