Commit 652ebcbd authored by Pierre Kraemer's avatar Pierre Kraemer
Browse files

Merge remote-tracking branch 'cgogn/develop' into develop

parents 730a9724 4dc1bdba
...@@ -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)
......
...@@ -193,9 +193,6 @@ public: ...@@ -193,9 +193,6 @@ public:
void setFaceVertexFunctor(FunctorType* f) { faceVertexFunctor = f ; } void setFaceVertexFunctor(FunctorType* f) { faceVertexFunctor = f ; }
void setVolumeVertexFunctor(FunctorType* f) { volumeVertexFunctor = f ; } void setVolumeVertexFunctor(FunctorType* f) { volumeVertexFunctor = f ; }
//@} //@}
unsigned int subdivideHexa2(Dart d, bool OneLevelDifference = true);
void subdivideFace2(Dart d, bool triQuad);
}; };
} // namespace Adaptive } // namespace Adaptive
......
...@@ -141,6 +141,20 @@ public: ...@@ -141,6 +141,20 @@ public:
return (*m_markVector)[d_index]; return (*m_markVector)[d_index];
} }
// template <unsigned int ORBIT>
// inline bool isMarked(Cell<ORBIT> c) const
// {
// assert(m_map.template getMarkerSet<DART>(m_thread).testMark(m_mark));
// m_map.foreach_dart_of_orbit(c, [&] (Dart d)
// {
// if(!(*m_markVector)[m_map.dartIndex(d)].testMark(m_mark))
// return false;
// }
// , m_thread) ;
// return true;
// }
/** /**
* mark the darts of the given cell * mark the darts of the given cell
*/ */
......
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
#define __TRAVERSOR2_CLOSED_H__ #define __TRAVERSOR2_CLOSED_H__
#include "Topology/generic/dart.h" #include "Topology/generic/dart.h"
#include "Topology/generic/traversorGen.h" #include "Topology/generic/traversor/traversorGen.h"
namespace CGoGN namespace CGoGN
{ {
...@@ -255,6 +255,6 @@ public: ...@@ -255,6 +255,6 @@ public:
} // namespace CGoGN } // namespace CGoGN
#include "Topology/generic/traversor2_closed.hpp" #include "Topology/generic/traversor/traversor2_closed.hpp"
#endif #endif
...@@ -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 ;
...@@ -143,7 +143,7 @@ public: ...@@ -143,7 +143,7 @@ public:
void splitFace(Dart d, Dart e) ; void splitFace(Dart d, Dart e) ;
unsigned int vertexDegree(Dart d); unsigned int vertexDegree(Dart d);
/*************************************************** /***************************************************
* LEVELS MANAGEMENT * * LEVELS MANAGEMENT *
......
...@@ -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()
......
/*******************************************************************************
* 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: cgogn@unistra.fr *
* *
*******************************************************************************/
#ifndef __IMPLICIT_HIERARCHICAL_MAP3__
#define __IMPLICIT_HIERARCHICAL_MAP3__
#include "Topology/map/embeddedMap3.h"
namespace CGoGN
{
template<typename T, unsigned int ORBIT> class AttributeHandler_IHM ;
class ImplicitHierarchicalMap3 : public EmbeddedMap3
{
template<typename T, unsigned int ORBIT> friend class AttributeHandler_IHM ;
typedef EmbeddedMap3::TOPO_MAP TOPO_MAP;
private:
unsigned int m_curLevel ;
unsigned int m_maxLevel ;
unsigned int m_edgeIdCount ;
unsigned int m_faceIdCount;
DartAttribute<unsigned int, ImplicitHierarchicalMap3> m_dartLevel ;
DartAttribute<unsigned int, ImplicitHierarchicalMap3> m_edgeId ;
DartAttribute<unsigned int, ImplicitHierarchicalMap3> m_faceId ;
AttributeMultiVector<unsigned int>* m_nextLevelCell[NB_ORBITS] ;
public:
ImplicitHierarchicalMap3() ;
~ImplicitHierarchicalMap3() ;
static const unsigned int DIMENSION = 3 ;
//!
/*!
*
*/
void update_topo_shortcuts();
//!
/*!
*
*/
void initImplicitProperties();
/**
* clear the map
* @param remove attrib remove attribute (not only clear the content)
*/
void clear(bool removeAttrib);
/***************************************************
* ATTRIBUTES MANAGEMENT *
***************************************************/
// template <typename T, unsigned int ORBIT, typename MAP>
// AttributeHandler_IHM<T, ORBIT, MAP> addAttribute(const std::string& nameAttr) ;
// template <typename T, unsigned int ORBIT, typename MAP>
// AttributeHandler_IHM<T, ORBIT, MAP> getAttribute(const std::string& nameAttr) ;
/***************************************************
* MAP TRAVERSAL *
***************************************************/
inline Dart newDart() ;
inline Dart phi1(Dart d) const;
inline Dart phi_1(Dart d) const;
inline Dart phi2(Dart d) const;
private:
inline Dart phi2bis(Dart d) const;
public:
inline Dart phi3(Dart d) const;
inline Dart alpha0(Dart d) const;
inline Dart alpha1(Dart d) const;
inline Dart alpha2(Dart d) const;
inline Dart alpha_2(Dart d) const;
inline Dart begin() const;
inline Dart end() const;
inline void next(Dart& d) const ;
template <unsigned int ORBIT, typename FUNC>
void foreach_dart_of_orbit(Cell<ORBIT> c, FUNC f) const ;
template <unsigned int ORBIT, typename FUNC>
void foreach_dart_of_orbit(Cell<ORBIT> c, FUNC& f) const ;
template <typename FUNC>
void foreach_dart_of_vertex(Dart d, FUNC& f) const ;
template <typename FUNC>
void foreach_dart_of_edge(Dart d, FUNC& f) const ;
template <typename FUNC>
void foreach_dart_of_oriented_face(Dart d, FUNC& f) const;
template <typename FUNC>
void foreach_dart_of_face(Dart d, FUNC& f) const ;
template <typename FUNC>
void foreach_dart_of_oriented_volume(Dart d, FUNC& f) const;
template <typename FUNC>
void foreach_dart_of_volume(Dart d, FUNC& f) const ;
template <typename FUNC>
void foreach_dart_of_vertex1(Dart d, FUNC& f) const;
template <typename FUNC>
void foreach_dart_of_edge1(Dart d, FUNC& f) const;
template <typename FUNC>
void foreach_dart_of_vertex2(Dart d, FUNC& f) const;
template <typename FUNC>
void foreach_dart_of_edge2(Dart d, FUNC& f) const;
template <typename FUNC>
void foreach_dart_of_face2(Dart d, FUNC& f) const;
template <typename FUNC>
void foreach_dart_of_cc(Dart d, FUNC& f) const ;
/***************************************************
* MAP MANIPULATION *
***************************************************/