Commit 781c9c5a authored by Lionel Untereiner's avatar Lionel Untereiner

modifs sur les IHM3 + correction attributs

parent 6e1d2b03
...@@ -407,7 +407,7 @@ int main(int argc, char **argv) ...@@ -407,7 +407,7 @@ int main(int argc, char **argv)
{ {
*/ */
if(extension == std::string(".map")) if(extension == std::string(".mapbin"))
{ {
myMap.loadMapBin(filename); myMap.loadMapBin(filename);
position = myMap.getAttribute<VEC3, VERTEX,MAP>("position") ; position = myMap.getAttribute<VEC3, VERTEX,MAP>("position") ;
......
...@@ -78,7 +78,7 @@ IF(WIN32) ...@@ -78,7 +78,7 @@ IF(WIN32)
ELSE(WIN32) ELSE(WIN32)
find_package(SuiteSparse REQUIRED) find_package(SuiteSparse REQUIRED)
SET (COMMON_INCLUDES ${COMMON_INCLUDES} ${SUITESPARSE_INCLUDE_DIRS}) SET (COMMON_INCLUDES ${COMMON_INCLUDES} ${SUITESPARSE_INCLUDE_DIRS})
SET (COMMON_LIBS ${COMMON_LIBS} ${SUITESPARSE_LIBRARIES}) SET (COMMON_LIBS ${SUITESPARSE_LIBRARIES} lapack blas ${COMMON_LIBS})
ENDIF(WIN32) ENDIF(WIN32)
......
...@@ -996,7 +996,7 @@ bool exportChoupi(typename PFP::MAP& map, const VertexAttribute<typename PFP::VE ...@@ -996,7 +996,7 @@ bool exportChoupi(typename PFP::MAP& map, const VertexAttribute<typename PFP::VE
return false ; return false ;
} }
out << map.template getNbOrbits<VERTEX>() << " " << map.template getNbOrbits<EDGE>() << std::endl; out << Algo::Topo::getNbOrbits<VERTEX>(map) << " " << Algo::Topo::getNbOrbits<EDGE>(map) << std::endl;
TraversorV<MAP> travV(map); TraversorV<MAP> travV(map);
for(Dart dit = travV.begin() ; dit != travV.end() ; dit = travV.next()) for(Dart dit = travV.begin() ; dit != travV.end() ; dit = travV.next())
......
...@@ -103,7 +103,7 @@ public: ...@@ -103,7 +103,7 @@ public:
EarTriangulation(MAP& map) : m_map(map), m_dartEars(map) EarTriangulation(MAP& map) : m_map(map), m_dartEars(map)
{ {
m_position = map.template getAttribute<VEC3, VERTEX>("position"); m_position = map.template getAttribute<VEC3, VERTEX, MAP>("position");
} }
// void trianguleFace(Dart d, DartMarker& mark); // void trianguleFace(Dart d, DartMarker& mark);
......
...@@ -351,8 +351,6 @@ unsigned int IHM2<PFP>::subdivideFace(Dart d, bool triQuad, bool OneLevelDiffere ...@@ -351,8 +351,6 @@ unsigned int IHM2<PFP>::subdivideFace(Dart d, bool triQuad, bool OneLevelDiffere
unsigned int fLevel = faceLevel(d) ; unsigned int fLevel = faceLevel(d) ;
Dart old = faceOldestDart(d) ; Dart old = faceOldestDart(d) ;
//std::cout << "faceLevel = " << fLevel << std::endl;
unsigned int cur = m_map.getCurrentLevel() ; unsigned int cur = m_map.getCurrentLevel() ;
m_map.setCurrentLevel(fLevel) ; // go to the level of the face to subdivide its edges m_map.setCurrentLevel(fLevel) ; // go to the level of the face to subdivide its edges
......
...@@ -137,7 +137,7 @@ protected: ...@@ -137,7 +137,7 @@ protected:
/*************************************************** /***************************************************
* SUBDIVISION * * SUBDIVISION *
***************************************************/ ***************************************************/
public:
/** /**
* subdivide the edge of d to the next level * subdivide the edge of d to the next level
*/ */
...@@ -158,11 +158,11 @@ protected: ...@@ -158,11 +158,11 @@ protected:
*/ */
void coarsenFace(Dart d) ; void coarsenFace(Dart d) ;
public:
//! Subdivide the volume of d to hexahedral cells //! Subdivide the volume of d to hexahedral cells
/*! @param d Dart from the volume /*! @param d Dart from the volume
*/ */
unsigned int subdivideVolume(Dart d, bool triQuad = true, bool OneLevelDifference = true); Dart subdivideVolume(Dart d, bool triQuad = true, bool OneLevelDifference = true);
/*! /*!
* \brief subdivideHexa * \brief subdivideHexa
...@@ -179,6 +179,8 @@ public: ...@@ -179,6 +179,8 @@ public:
*/ */
void subdivideVolumeTetOcta(Dart d) ; void subdivideVolumeTetOcta(Dart d) ;
void coarsenVolume(Dart d) ;
/** /**
* vertices attributes management * vertices attributes management
*/ */
...@@ -201,6 +203,6 @@ public: ...@@ -201,6 +203,6 @@ public:
} // namespace CGoGN } // namespace CGoGN
#include "Algo/Multiresolution/IHM2/ihm2_PrimalAdapt.hpp" #include "Algo/Multiresolution/IHM3/ihm3_PrimalAdapt.hpp"
#endif #endif
...@@ -47,10 +47,10 @@ class CCVertexVertexFunctor : public FunctorType ...@@ -47,10 +47,10 @@ class CCVertexVertexFunctor : public FunctorType
{ {
protected: protected:
typename PFP::MAP& m_map ; typename PFP::MAP& m_map ;
VertexAttribute<typename PFP::VEC3>& m_position ; VertexAttribute<typename PFP::VEC3, typename PFP::MAP>& m_position ;
public: public:
CCVertexVertexFunctor(typename PFP::MAP& m, VertexAttribute<typename PFP::VEC3>& p) : m_map(m), m_position(p) CCVertexVertexFunctor(typename PFP::MAP& m, VertexAttribute<typename PFP::VEC3, typename PFP::MAP>& p) : m_map(m), m_position(p)
{} {}
bool operator() (Dart d) bool operator() (Dart d)
...@@ -99,10 +99,10 @@ class CCEdgeVertexFunctor : public FunctorType ...@@ -99,10 +99,10 @@ class CCEdgeVertexFunctor : public FunctorType
{ {
protected: protected:
typename PFP::MAP& m_map ; typename PFP::MAP& m_map ;
VertexAttribute<typename PFP::VEC3>& m_position ; VertexAttribute<typename PFP::VEC3, typename PFP::MAP>& m_position ;
public: public:
CCEdgeVertexFunctor(typename PFP::MAP& m, VertexAttribute<typename PFP::VEC3>& p) : m_map(m), m_position(p) CCEdgeVertexFunctor(typename PFP::MAP& m, VertexAttribute<typename PFP::VEC3, typename PFP::MAP>& p) : m_map(m), m_position(p)
{} {}
bool operator() (Dart d) bool operator() (Dart d)
...@@ -144,10 +144,10 @@ class CCFaceVertexFunctor : public FunctorType ...@@ -144,10 +144,10 @@ class CCFaceVertexFunctor : public FunctorType
{ {
protected: protected:
typename PFP::MAP& m_map ; typename PFP::MAP& m_map ;
VertexAttribute<typename PFP::VEC3>& m_position ; VertexAttribute<typename PFP::VEC3, typename PFP::MAP>& m_position ;
public: public:
CCFaceVertexFunctor(typename PFP::MAP& m, VertexAttribute<typename PFP::VEC3>& p) : m_map(m), m_position(p) CCFaceVertexFunctor(typename PFP::MAP& m, VertexAttribute<typename PFP::VEC3, typename PFP::MAP>& p) : m_map(m), m_position(p)
{} {}
bool operator() (Dart d) bool operator() (Dart d)
......
...@@ -48,10 +48,10 @@ class LerpVertexVertexFunctor : public FunctorType ...@@ -48,10 +48,10 @@ class LerpVertexVertexFunctor : public FunctorType
{ {
protected: protected:
typename PFP::MAP& m_map ; typename PFP::MAP& m_map ;
VertexAttribute<typename PFP::VEC3>& m_position ; VertexAttribute<typename PFP::VEC3, typename PFP::MAP>& m_position ;
public: public:
LerpVertexVertexFunctor(typename PFP::MAP& m, VertexAttribute<typename PFP::VEC3>& p) : m_map(m), m_position(p) LerpVertexVertexFunctor(typename PFP::MAP& m, VertexAttribute<typename PFP::VEC3, typename PFP::MAP>& p) : m_map(m), m_position(p)
{} {}
bool operator() (Dart d) bool operator() (Dart d)
...@@ -74,10 +74,10 @@ class LerpEdgeVertexFunctor : public FunctorType ...@@ -74,10 +74,10 @@ class LerpEdgeVertexFunctor : public FunctorType
{ {
protected: protected:
typename PFP::MAP& m_map ; typename PFP::MAP& m_map ;
VertexAttribute<typename PFP::VEC3>& m_position ; VertexAttribute<typename PFP::VEC3, typename PFP::MAP>& m_position ;
public: public:
LerpEdgeVertexFunctor(typename PFP::MAP& m, VertexAttribute<typename PFP::VEC3>& p) : m_map(m), m_position(p) LerpEdgeVertexFunctor(typename PFP::MAP& m, VertexAttribute<typename PFP::VEC3, typename PFP::MAP>& p) : m_map(m), m_position(p)
{} {}
bool operator() (Dart d) bool operator() (Dart d)
...@@ -100,10 +100,10 @@ class LerpFaceVertexFunctor : public FunctorType ...@@ -100,10 +100,10 @@ class LerpFaceVertexFunctor : public FunctorType
{ {
protected: protected:
typename PFP::MAP& m_map ; typename PFP::MAP& m_map ;
VertexAttribute<typename PFP::VEC3>& m_position ; VertexAttribute<typename PFP::VEC3, typename PFP::MAP>& m_position ;
public: public:
LerpFaceVertexFunctor(typename PFP::MAP& m, VertexAttribute<typename PFP::VEC3>& p) : m_map(m), m_position(p) LerpFaceVertexFunctor(typename PFP::MAP& m, VertexAttribute<typename PFP::VEC3, typename PFP::MAP>& p) : m_map(m), m_position(p)
{} {}
bool operator() (Dart d) bool operator() (Dart d)
......
...@@ -47,10 +47,10 @@ class LoopVertexVertexFunctor : public FunctorType ...@@ -47,10 +47,10 @@ class LoopVertexVertexFunctor : public FunctorType
{ {
protected: protected:
typename PFP::MAP& m_map ; typename PFP::MAP& m_map ;
VertexAttribute<typename PFP::VEC3>& m_position ; VertexAttribute<typename PFP::VEC3, typename PFP::MAP>& m_position ;
public: public:
LoopVertexVertexFunctor(typename PFP::MAP& m, VertexAttribute<typename PFP::VEC3>& p) : m_map(m), m_position(p) LoopVertexVertexFunctor(typename PFP::MAP& m, VertexAttribute<typename PFP::VEC3, typename PFP::MAP>& p) : m_map(m), m_position(p)
{} {}
bool operator() (Dart d) bool operator() (Dart d)
...@@ -85,10 +85,10 @@ class LoopEdgeVertexFunctor : public FunctorType ...@@ -85,10 +85,10 @@ class LoopEdgeVertexFunctor : public FunctorType
{ {
protected: protected:
typename PFP::MAP& m_map ; typename PFP::MAP& m_map ;
VertexAttribute<typename PFP::VEC3>& m_position ; VertexAttribute<typename PFP::VEC3, typename PFP::MAP>& m_position ;
public: public:
LoopEdgeVertexFunctor(typename PFP::MAP& m, VertexAttribute<typename PFP::VEC3>& p) : m_map(m), m_position(p) LoopEdgeVertexFunctor(typename PFP::MAP& m, VertexAttribute<typename PFP::VEC3, typename PFP::MAP>& p) : m_map(m), m_position(p)
{} {}
bool operator() (Dart d) bool operator() (Dart d)
......
...@@ -48,10 +48,10 @@ class Sqrt3VertexVertexFunctor : public FunctorType ...@@ -48,10 +48,10 @@ class Sqrt3VertexVertexFunctor : public FunctorType
{ {
protected: protected:
typename PFP::MAP& m_map ; typename PFP::MAP& m_map ;
VertexAttribute<typename PFP::VEC3>& m_position ; VertexAttribute<typename PFP::VEC3, typename PFP::MAP>& m_position ;
public: public:
Sqrt3VertexVertexFunctor(typename PFP::MAP& m, VertexAttribute<typename PFP::VEC3>& p) : m_map(m), m_position(p) Sqrt3VertexVertexFunctor(typename PFP::MAP& m, VertexAttribute<typename PFP::VEC3, typename PFP::MAP>& p) : m_map(m), m_position(p)
{} {}
bool operator() (Dart d) bool operator() (Dart d)
...@@ -123,10 +123,10 @@ class Sqrt3FaceVertexFunctor : public FunctorType ...@@ -123,10 +123,10 @@ class Sqrt3FaceVertexFunctor : public FunctorType
{ {
protected: protected:
typename PFP::MAP& m_map ; typename PFP::MAP& m_map ;
VertexAttribute<typename PFP::VEC3>& m_position ; VertexAttribute<typename PFP::VEC3, typename PFP::MAP>& m_position ;
public: public:
Sqrt3FaceVertexFunctor(typename PFP::MAP& m, VertexAttribute<typename PFP::VEC3>& p) : m_map(m), m_position(p) Sqrt3FaceVertexFunctor(typename PFP::MAP& m, VertexAttribute<typename PFP::VEC3, typename PFP::MAP>& p) : m_map(m), m_position(p)
{} {}
bool operator() (Dart d) bool operator() (Dart d)
......
...@@ -29,7 +29,7 @@ ...@@ -29,7 +29,7 @@
#include "Algo/Geometry/centroid.h" #include "Algo/Geometry/centroid.h"
#include "Algo/Modelisation/tetrahedralization.h" #include "Algo/Modelisation/tetrahedralization.h"
#include "Algo/Multiresolution/filter.h" #include "Algo/Multiresolution/filter.h"
#include "Topology/generic/traversor2_closed.h" #include "Topology/generic/traversor/traversor2_closed.h"
namespace CGoGN namespace CGoGN
{ {
......
...@@ -53,10 +53,10 @@ class LerpVertexVertexFunctor : public FunctorType ...@@ -53,10 +53,10 @@ class LerpVertexVertexFunctor : public FunctorType
{ {
protected: protected:
typename PFP::MAP& m_map ; typename PFP::MAP& m_map ;
AttributeHandler<typename PFP::VEC3, VERTEX>& m_position ; AttributeHandler<typename PFP::VEC3, VERTEX, typename PFP::MAP>& m_position ;
public: public:
LerpVertexVertexFunctor(typename PFP::MAP& m, AttributeHandler<typename PFP::VEC3, VERTEX>& p) : m_map(m), m_position(p) LerpVertexVertexFunctor(typename PFP::MAP& m, AttributeHandler<typename PFP::VEC3, VERTEX, typename PFP::MAP>& p) : m_map(m), m_position(p)
{} {}
bool operator() (Dart d) bool operator() (Dart d)
...@@ -68,7 +68,7 @@ public: ...@@ -68,7 +68,7 @@ public:
// std::cout << " p du niv i+1 = " << p << std::endl; // std::cout << " p du niv i+1 = " << p << std::endl;
m_position[d] = p; //m_position[d] = p;
// m_map.decCurrentLevel() ; // m_map.decCurrentLevel() ;
// std::cout << "dec = " << m_position[d] << std::endl; // std::cout << "dec = " << m_position[d] << std::endl;
...@@ -84,10 +84,10 @@ class LerpEdgeVertexFunctor : public FunctorType ...@@ -84,10 +84,10 @@ class LerpEdgeVertexFunctor : public FunctorType
{ {
protected: protected:
typename PFP::MAP& m_map ; typename PFP::MAP& m_map ;
AttributeHandler<typename PFP::VEC3, VERTEX>& m_position ; AttributeHandler<typename PFP::VEC3, VERTEX, typename PFP::MAP>& m_position ;
public: public:
LerpEdgeVertexFunctor(typename PFP::MAP& m, AttributeHandler<typename PFP::VEC3, VERTEX>& p) : m_map(m), m_position(p) LerpEdgeVertexFunctor(typename PFP::MAP& m, AttributeHandler<typename PFP::VEC3, VERTEX, typename PFP::MAP>& p) : m_map(m), m_position(p)
{} {}
bool operator() (Dart d) bool operator() (Dart d)
...@@ -110,10 +110,10 @@ class LerpFaceVertexFunctor : public FunctorType ...@@ -110,10 +110,10 @@ class LerpFaceVertexFunctor : public FunctorType
{ {
protected: protected:
typename PFP::MAP& m_map ; typename PFP::MAP& m_map ;
AttributeHandler<typename PFP::VEC3, VERTEX>& m_position ; AttributeHandler<typename PFP::VEC3, VERTEX, typename PFP::MAP>& m_position ;
public: public:
LerpFaceVertexFunctor(typename PFP::MAP& m, AttributeHandler<typename PFP::VEC3, VERTEX>& p) : m_map(m), m_position(p) LerpFaceVertexFunctor(typename PFP::MAP& m, AttributeHandler<typename PFP::VEC3, VERTEX, typename PFP::MAP>& p) : m_map(m), m_position(p)
{} {}
bool operator() (Dart d) bool operator() (Dart d)
...@@ -135,10 +135,10 @@ class LerpVolumeVertexFunctor : public FunctorType ...@@ -135,10 +135,10 @@ class LerpVolumeVertexFunctor : public FunctorType
{ {
protected: protected:
typename PFP::MAP& m_map ; typename PFP::MAP& m_map ;
AttributeHandler<typename PFP::VEC3, VERTEX>& m_position ; AttributeHandler<typename PFP::VEC3, VERTEX, typename PFP::MAP>& m_position ;
public: public:
LerpVolumeVertexFunctor(typename PFP::MAP& m, AttributeHandler<typename PFP::VEC3, VERTEX>& p) : m_map(m), m_position(p) LerpVolumeVertexFunctor(typename PFP::MAP& m, AttributeHandler<typename PFP::VEC3, VERTEX, typename PFP::MAP>& p) : m_map(m), m_position(p)
{} {}
bool operator() (Dart d) bool operator() (Dart d)
......
...@@ -32,11 +32,11 @@ namespace CGoGN ...@@ -32,11 +32,11 @@ namespace CGoGN
template<typename T, unsigned int ORBIT> class AttributeHandler_IHM ; template<typename T, unsigned int ORBIT> class AttributeHandler_IHM ;
typedef EmbeddedMap2::TOPO_MAP TOPO_MAP;
class ImplicitHierarchicalMap2 : public EmbeddedMap2 class ImplicitHierarchicalMap2 : public EmbeddedMap2
{ {
template<typename T, unsigned int ORBIT> friend class AttributeHandler_IHM ; template<typename T, unsigned int ORBIT> friend class AttributeHandler_IHM ;
typedef EmbeddedMap2::TOPO_MAP TOPO_MAP;
private: private:
unsigned int m_curLevel ; unsigned int m_curLevel ;
......
...@@ -326,18 +326,14 @@ inline void ImplicitHierarchicalMap2::setCurrentLevel(unsigned int l) ...@@ -326,18 +326,14 @@ inline void ImplicitHierarchicalMap2::setCurrentLevel(unsigned int l)
inline void ImplicitHierarchicalMap2::incCurrentLevel() inline void ImplicitHierarchicalMap2::incCurrentLevel()
{ {
if(m_curLevel < m_maxLevel) assert(m_curLevel < m_maxLevel || "incCurrentLevel : already at maximum resolution level");
++m_curLevel ; ++m_curLevel ;
else
CGoGNout << "incCurrentLevel : already at maximum resolution level" << CGoGNendl ;
} }
inline void ImplicitHierarchicalMap2::decCurrentLevel() inline void ImplicitHierarchicalMap2::decCurrentLevel()
{ {
if(m_curLevel > 0) assert(m_curLevel > 0 || "decCurrentLevel : already at minimum resolution level");
--m_curLevel ; --m_curLevel ;
else
CGoGNout << "decCurrentLevel : already at minimum resolution level" << CGoGNendl ;
} }
inline unsigned int ImplicitHierarchicalMap2::getMaxLevel() inline unsigned int ImplicitHierarchicalMap2::getMaxLevel()
......
...@@ -32,12 +32,12 @@ namespace CGoGN ...@@ -32,12 +32,12 @@ namespace CGoGN
template<typename T, unsigned int ORBIT> class AttributeHandler_IHM ; template<typename T, unsigned int ORBIT> class AttributeHandler_IHM ;
typedef EmbeddedMap3::TOPO_MAP TOPO_MAP;
class ImplicitHierarchicalMap3 : public EmbeddedMap3 class ImplicitHierarchicalMap3 : public EmbeddedMap3
{ {
template<typename T, unsigned int ORBIT> friend class AttributeHandler_IHM ; template<typename T, unsigned int ORBIT> friend class AttributeHandler_IHM ;
typedef EmbeddedMap3::TOPO_MAP TOPO_MAP;
private: private:
unsigned int m_curLevel ; unsigned int m_curLevel ;
...@@ -80,11 +80,11 @@ public: ...@@ -80,11 +80,11 @@ public:
* ATTRIBUTES MANAGEMENT * * ATTRIBUTES MANAGEMENT *
***************************************************/ ***************************************************/
template <typename T, unsigned int ORBIT> // template <typename T, unsigned int ORBIT, typename MAP>
AttributeHandler_IHM<T, ORBIT> addAttribute(const std::string& nameAttr) ; // AttributeHandler_IHM<T, ORBIT, MAP> addAttribute(const std::string& nameAttr) ;
template <typename T, unsigned int ORBIT> // template <typename T, unsigned int ORBIT, typename MAP>
AttributeHandler_IHM<T, ORBIT> getAttribute(const std::string& nameAttr) ; // AttributeHandler_IHM<T, ORBIT, MAP> getAttribute(const std::string& nameAttr) ;
/*************************************************** /***************************************************
* MAP TRAVERSAL * * MAP TRAVERSAL *
...@@ -163,6 +163,8 @@ public: ...@@ -163,6 +163,8 @@ public:
* MAP MANIPULATION * * MAP MANIPULATION *
***************************************************/ ***************************************************/
Dart cutEdge(Dart d);
/*************************************************** /***************************************************
* LEVELS MANAGEMENT * * LEVELS MANAGEMENT *
***************************************************/ ***************************************************/
...@@ -201,8 +203,15 @@ public: ...@@ -201,8 +203,15 @@ public:
//! Set an edge id to all darts from an orbit of d //! Set an edge id to all darts from an orbit of d
/*! /*!
*/ */
void setEdgeId(Dart d, unsigned int i, unsigned int orbit); //TODO a virer void setEdgeId(Dart d, unsigned int i); //TODO a virer
void setEdgeId(Dart d, unsigned int i); void setDartEdgeId(Dart d, unsigned int i);
unsigned int getTriRefinementEdgeId(Dart d);
unsigned int getQuadRefinementEdgeId(Dart d);
//! Give a new unique id to all the faces of the map //! Give a new unique id to all the faces of the map
/*! /*!
......
...@@ -28,33 +28,33 @@ namespace CGoGN ...@@ -28,33 +28,33 @@ namespace CGoGN
/*************************************************** /***************************************************
* ATTRIBUTES MANAGEMENT * * ATTRIBUTES MANAGEMENT *
***************************************************/ ***************************************************/
template <typename T, unsigned int ORBIT> //template <typename T, unsigned int ORBIT, typename MAP>
AttributeHandler_IHM<T, ORBIT> ImplicitHierarchicalMap3::addAttribute(const std::string& nameAttr) //AttributeHandler_IHM<T, ORBIT, MAP> ImplicitHierarchicalMap3::addAttribute(const std::string& nameAttr)
{ //{
bool addNextLevelCell = false ; // bool addNextLevelCell = false ;
if(!isOrbitEmbedded<ORBIT>()) // if(!isOrbitEmbedded<ORBIT>())
addNextLevelCell = true ; // addNextLevelCell = true ;
AttributeHandler<T, ORBIT, ImplicitHierarchicalMap3> h = Map3::addAttribute<T, ORBIT, ImplicitHierarchicalMap3>(nameAttr) ; // AttributeHandler<T, ORBIT, ImplicitHierarchicalMap3> h = Map3::addAttribute<T, ORBIT, ImplicitHierarchicalMap3>(nameAttr) ;
if(addNextLevelCell) // if(addNextLevelCell)
{ // {
AttributeContainer& cellCont = m_attribs[ORBIT] ; // AttributeContainer& cellCont = m_attribs[ORBIT] ;
AttributeMultiVector<unsigned int>* amv = cellCont.addAttribute<unsigned int>("nextLevelCell") ; // AttributeMultiVector<unsigned int>* amv = cellCont.addAttribute<unsigned int>("nextLevelCell") ;
m_nextLevelCell[ORBIT] = amv ; // m_nextLevelCell[ORBIT] = amv ;
for(unsigned int i = cellCont.begin(); i < cellCont.end(); cellCont.next(i)) // for(unsigned int i = cellCont.begin(); i < cellCont.end(); cellCont.next(i))
amv->operator[](i) = EMBNULL ; // amv->operator[](i) = EMBNULL ;
} // }
return AttributeHandler_IHM<T, ORBIT>(this, h.getDataVector()) ; // return AttributeHandler_IHM<T, ORBIT>(this, h.getDataVector()) ;
} //}
template <typename T, unsigned int ORBIT> //template <typename T, unsigned int ORBIT, typename MAP>
AttributeHandler_IHM<T, ORBIT> ImplicitHierarchicalMap3::getAttribute(const std::string& nameAttr) //AttributeHandler_IHM<T, ORBIT, MAP> ImplicitHierarchicalMap3::getAttribute(const std::string& nameAttr)
{ //{
AttributeHandler<T, ORBIT, ImplicitHierarchicalMap3> h = Map3::getAttribute<T, ORBIT, ImplicitHierarchicalMap3>(nameAttr) ; // AttributeHandler<T, ORBIT, ImplicitHierarchicalMap3> h = Map3::getAttribute<T, ORBIT, ImplicitHierarchicalMap3>(nameAttr) ;
return AttributeHandler_IHM<T, ORBIT>(this, h.getDataVector()) ; // return AttributeHandler_IHM<T, ORBIT>(this, h.getDataVector()) ;
} //}
inline void ImplicitHierarchicalMap3::update_topo_shortcuts() inline void ImplicitHierarchicalMap3::update_topo_shortcuts()
{ {
...@@ -72,7 +72,7 @@ inline void ImplicitHierarchicalMap3::update_topo_shortcuts() ...@@ -72,7 +72,7 @@ inline void ImplicitHierarchicalMap3::update_topo_shortcuts()
***************************************************/ ***************************************************/
inline Dart ImplicitHierarchicalMap3::newDart() inline Dart ImplicitHierarchicalMap3::newDart()
{ {
Dart d = Map3::newDart() ; Dart d = TOPO_MAP::newDart() ;
m_dartLevel[d] = m_curLevel ; m_dartLevel[d] = m_curLevel ;
if(m_curLevel > m_maxLevel) // update max level if(m_curLevel > m_maxLevel) // update max level
m_maxLevel = m_curLevel ; // if needed m_maxLevel = m_curLevel ; // if needed
...@@ -457,18 +457,14 @@ inline void ImplicitHierarchicalMap3::foreach_dart_of_cc(Dart d, FUNC& f, unsign ...@@ -457,18 +457,14 @@ inline void ImplicitHierarchicalMap3::foreach_dart_of_cc(Dart d, FUNC& f, unsign
inline void ImplicitHierarchicalMap3::incCurrentLevel() inline void ImplicitHierarchicalMap3::incCurrentLevel()
{ {
if(m_curLevel < m_maxLevel) assert(m_curLevel < m_maxLevel || "incCurrentLevel : already at maximum resolution level");
++m_curLevel ; ++m_curLevel ;
else
CGoGNout << "incCurrentLevel : already at maximum resolution level" << CGoGNendl ;
} }
inline void ImplicitHierarchicalMap3::decCurrentLevel() inline void ImplicitHierarchicalMap3::decCurrentLevel()
{ {
if(m_curLevel > 0) assert(m_curLevel > 0 || "decCurrentLevel : already at minimum resolution level");
--m_curLevel ; --m_curLevel ;
else
CGoGNout << "decCurrentLevel : already at minimum resolution level" << CGoGNendl ;
} }
inline unsigned int ImplicitHierarchicalMap3::getCurrentLevel() const inline unsigned int ImplicitHierarchicalMap3::getCurrentLevel() const
...@@ -511,24 +507,57 @@ inline unsigned int ImplicitHierarchicalMap3::getEdgeId(Dart d) ...@@ -511,24 +507,57 @@ inline unsigned int ImplicitHierarchicalMap3::getEdgeId(Dart d)
return m_edgeId[d] ; return m_edgeId[d] ;
} }
inline void ImplicitHierarchicalMap3::setEdgeId(Dart d, unsigned int i, unsigned int orbit) inline void ImplicitHierarchicalMap3::setEdgeId(Dart d, unsigned int i)
{ {
if(orbit == EDGE) Dart e = d;
{
Dart e = d;
do do
{ {
m_edgeId[e] = i; m_edgeId[e] = i;
m_edgeId[Map3::phi2(e)] = i; m_edgeId[Map3::phi2(e)] = i;
e = Map3::alpha2(e); e = Map3::alpha2(e);
} while(e != d); } while(e != d);
}
else if(orbit == DART) }
{
m_edgeId[d] = i; inline void ImplicitHierarchicalMap3::setDartEdgeId(Dart d, unsigned int i)
} {
m_edgeId[d] = i;
}
inline unsigned int ImplicitHierarchicalMap3::triRefinementEdgeId(Dart d)
{
unsigned int dId = getEdgeId(phi_1(d));
unsigned int eId = getEdgeId(phi1(d));