X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FMEDCoupling%2FMEDCouplingSkyLineArray.hxx;h=d7ae93d4082d8688518a714676ea4d6366b5a918;hb=b8616069f6667dcec3f90574a05bfc9e66d87fa5;hp=a56d94b9ad28d7ebfab79d15d675f0baf7d93db7;hpb=1c9761aeac9192f62f324ad7a04430f2482bc843;p=tools%2Fmedcoupling.git diff --git a/src/MEDCoupling/MEDCouplingSkyLineArray.hxx b/src/MEDCoupling/MEDCouplingSkyLineArray.hxx index a56d94b9a..d7ae93d40 100644 --- a/src/MEDCoupling/MEDCouplingSkyLineArray.hxx +++ b/src/MEDCoupling/MEDCouplingSkyLineArray.hxx @@ -1,4 +1,4 @@ -// Copyright (C) 2007-2020 CEA/DEN, EDF R&D +// Copyright (C) 2007-2021 CEA/DEN, EDF R&D // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public @@ -17,8 +17,7 @@ // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // -#ifndef __PARAMEDMEM_MEDCOUPLINGSKYLINEARRAY_HXX__ -#define __PARAMEDMEM_MEDCOUPLINGSKYLINEARRAY_HXX__ +#pragma once #include "MEDCoupling.hxx" #include "MEDCouplingMemArray.hxx" @@ -105,10 +104,15 @@ namespace MEDCoupling DataArrayIdType* getIndexArray() const; DataArrayIdType* getValuesArray() const; + MEDCouplingSkyLineArray *deepCopy() const; + std::string simpleRepr() const; + void thresholdPerPack(mcIdType threshold, MCAuto& left, MCAuto& right) const; + MEDCouplingSkyLineArray *groupPacks(const DataArrayIdType *indexedPacks) const; MEDCouplingSkyLineArray *uniqueNotSortedByPack() const; + static MEDCouplingSkyLineArray *AggregatePacks(const std::vector& sks); void getSimplePackSafe(const mcIdType absolutePackId, std::vector & pack) const; const mcIdType * getSimplePackSafePtr(const mcIdType absolutePackId, mcIdType & packSize) const; @@ -141,5 +145,24 @@ namespace MEDCoupling MCAuto _values; }; + template + class SkyLineArrayGenIterator : public std::iterator< std::input_iterator_tag, const mcIdType *, mcIdType, const mcIdType **, const mcIdType *> + { + std::size_t _num = 0; + std::vector *_data = nullptr; + public: + explicit SkyLineArrayGenIterator(std::size_t num , std::vector *data) : _num(num),_data(data) {} + SkyLineArrayGenIterator& operator++() { ++_num; return *this; } + bool operator==(const SkyLineArrayGenIterator& other) const { return _num == other._num; } + bool operator!=(const SkyLineArrayGenIterator& other) const { return !(*this == other); } + reference operator*() const { T tt; return tt((*_data)[_num]); } + }; + + struct SkyLineArrayIndexPtrFunctor { const mcIdType *operator()(const MEDCouplingSkyLineArray *ska) { return ska->getIndex(); } }; + + using SkyLineArrayIndexIterator = SkyLineArrayGenIterator; + + struct SkyLineArrayValuesPtrFunctor { const mcIdType *operator()(const MEDCouplingSkyLineArray *ska) { return ska->getValues(); } }; + + using SkyLineArrayValuesIterator = SkyLineArrayGenIterator; } -# endif