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
{
protected:
typename PFP::MAP& m_map ;
VertexAttribute<typename PFP::VEC3>& m_position ;
VertexAttribute<typename PFP::VEC3, typename PFP::MAP>& m_position ;
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)
......@@ -99,10 +99,10 @@ class CCEdgeVertexFunctor : public FunctorType
{
protected:
typename PFP::MAP& m_map ;
VertexAttribute<typename PFP::VEC3>& m_position ;
VertexAttribute<typename PFP::VEC3, typename PFP::MAP>& m_position ;
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)
......@@ -144,10 +144,10 @@ class CCFaceVertexFunctor : public FunctorType
{
protected:
typename PFP::MAP& m_map ;
VertexAttribute<typename PFP::VEC3>& m_position ;
VertexAttribute<typename PFP::VEC3, typename PFP::MAP>& m_position ;
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)
......
......@@ -48,10 +48,10 @@ class LerpVertexVertexFunctor : public FunctorType
{
protected:
typename PFP::MAP& m_map ;
VertexAttribute<typename PFP::VEC3>& m_position ;
VertexAttribute<typename PFP::VEC3, typename PFP::MAP>& m_position ;
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)
......@@ -74,10 +74,10 @@ class LerpEdgeVertexFunctor : public FunctorType
{
protected:
typename PFP::MAP& m_map ;
VertexAttribute<typename PFP::VEC3>& m_position ;
VertexAttribute<typename PFP::VEC3, typename PFP::MAP>& m_position ;
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)
......@@ -100,10 +100,10 @@ class LerpFaceVertexFunctor : public FunctorType
{
protected:
typename PFP::MAP& m_map ;
VertexAttribute<typename PFP::VEC3>& m_position ;
VertexAttribute<typename PFP::VEC3, typename PFP::MAP>& m_position ;
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)
......
......@@ -47,10 +47,10 @@ class LoopVertexVertexFunctor : public FunctorType
{
protected:
typename PFP::MAP& m_map ;
VertexAttribute<typename PFP::VEC3>& m_position ;
VertexAttribute<typename PFP::VEC3, typename PFP::MAP>& m_position ;
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)
......@@ -85,10 +85,10 @@ class LoopEdgeVertexFunctor : public FunctorType
{
protected:
typename PFP::MAP& m_map ;
VertexAttribute<typename PFP::VEC3>& m_position ;
VertexAttribute<typename PFP::VEC3, typename PFP::MAP>& m_position ;
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)
......
......@@ -48,10 +48,10 @@ class Sqrt3VertexVertexFunctor : public FunctorType
{
protected:
typename PFP::MAP& m_map ;
VertexAttribute<typename PFP::VEC3>& m_position ;
VertexAttribute<typename PFP::VEC3, typename PFP::MAP>& m_position ;
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)
......@@ -123,10 +123,10 @@ class Sqrt3FaceVertexFunctor : public FunctorType
{
protected:
typename PFP::MAP& m_map ;
VertexAttribute<typename PFP::VEC3>& m_position ;
VertexAttribute<typename PFP::VEC3, typename PFP::MAP>& m_position ;
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)
......
......@@ -29,7 +29,7 @@
#include "Algo/Geometry/centroid.h"
#include "Algo/Modelisation/tetrahedralization.h"
#include "Algo/Multiresolution/filter.h"
#include "Topology/generic/traversor2_closed.h"
#include "Topology/generic/traversor/traversor2_closed.h"
namespace CGoGN
{
......
......@@ -53,10 +53,10 @@ class LerpVertexVertexFunctor : public FunctorType
{
protected:
typename PFP::MAP& m_map ;
AttributeHandler<typename PFP::VEC3, VERTEX>& m_position ;
AttributeHandler<typename PFP::VEC3, VERTEX, typename PFP::MAP>& m_position ;
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)
......@@ -68,7 +68,7 @@ public:
// std::cout << " p du niv i+1 = " << p << std::endl;
m_position[d] = p;
//m_position[d] = p;
// m_map.decCurrentLevel() ;
// std::cout << "dec = " << m_position[d] << std::endl;
......@@ -84,10 +84,10 @@ class LerpEdgeVertexFunctor : public FunctorType
{
protected:
typename PFP::MAP& m_map ;
AttributeHandler<typename PFP::VEC3, VERTEX>& m_position ;
AttributeHandler<typename PFP::VEC3, VERTEX, typename PFP::MAP>& m_position ;
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)
......@@ -110,10 +110,10 @@ class LerpFaceVertexFunctor : public FunctorType
{
protected:
typename PFP::MAP& m_map ;
AttributeHandler<typename PFP::VEC3, VERTEX>& m_position ;
AttributeHandler<typename PFP::VEC3, VERTEX, typename PFP::MAP>& m_position ;
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)
......@@ -135,10 +135,10 @@ class LerpVolumeVertexFunctor : public FunctorType
{
protected:
typename PFP::MAP& m_map ;
AttributeHandler<typename PFP::VEC3, VERTEX>& m_position ;
AttributeHandler<typename PFP::VEC3, VERTEX, typename PFP::MAP>& m_position ;
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)
......
......@@ -193,9 +193,6 @@ public:
void setFaceVertexFunctor(FunctorType* f) { faceVertexFunctor = f ; }
void setVolumeVertexFunctor(FunctorType* f) { volumeVertexFunctor = f ; }
//@}
unsigned int subdivideHexa2(Dart d, bool OneLevelDifference = true);
void subdivideFace2(Dart d, bool triQuad);
};
} // namespace Adaptive
......
......@@ -141,6 +141,20 @@ public:
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
*/
......
......@@ -26,7 +26,7 @@
#define __TRAVERSOR2_CLOSED_H__
#include "Topology/generic/dart.h"
#include "Topology/generic/traversorGen.h"
#include "Topology/generic/traversor/traversorGen.h"
namespace CGoGN
{
......@@ -255,6 +255,6 @@ public:
} // namespace CGoGN
#include "Topology/generic/traversor2_closed.hpp"
#include "Topology/generic/traversor/traversor2_closed.hpp"
#endif
......@@ -32,11 +32,11 @@ namespace CGoGN
template<typename T, unsigned int ORBIT> class AttributeHandler_IHM ;
typedef EmbeddedMap2::TOPO_MAP TOPO_MAP;
class ImplicitHierarchicalMap2 : public EmbeddedMap2
{
template<typename T, unsigned int ORBIT> friend class AttributeHandler_IHM ;
typedef EmbeddedMap2::TOPO_MAP TOPO_MAP;
private:
unsigned int m_curLevel ;
......@@ -143,7 +143,7 @@ public:
void splitFace(Dart d, Dart e) ;
unsigned int vertexDegree(Dart d);
unsigned int vertexDegree(Dart d);
/***************************************************
* LEVELS MANAGEMENT *
......
......@@ -326,18 +326,14 @@ inline void ImplicitHierarchicalMap2::setCurrentLevel(unsigned int l)
inline void ImplicitHierarchicalMap2::incCurrentLevel()
{
if(m_curLevel < m_maxLevel)
++m_curLevel ;
else
CGoGNout << "incCurrentLevel : already at maximum resolution level" << CGoGNendl ;
assert(m_curLevel < m_maxLevel || "incCurrentLevel : already at maximum resolution level");
++m_curLevel ;
}
inline void ImplicitHierarchicalMap2::decCurrentLevel()
{
if(m_curLevel > 0)
--m_curLevel ;
else
CGoGNout << "decCurrentLevel : already at minimum resolution level" << CGoGNendl ;
assert(m_curLevel > 0 || "decCurrentLevel : already at minimum resolution level");
--m_curLevel ;
}
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 *
***************************************************/
/***************************************************
* LEVELS MANAGEMENT *
***************************************************/
void incCurrentLevel();
void decCurrentLevel();
unsigned int getCurrentLevel() const ;
void setCurrentLevel(unsigned int l) ;
unsigned int getMaxLevel() const ;
unsigned int getDartLevel(Dart d) const ;
void setDartLevel(Dart d, unsigned int i) ;
/***************************************************
* ID MANAGEMENT *
***************************************************/
//! Give a new unique id to all the edges of the map
/*!
*/
void initEdgeId() ;
//! Return the next available edge id
/*!
*/
unsigned int getNewEdgeId() ;
//! Return the id of the edge of d
/*!
*/
unsigned int getEdgeId(Dart d) ;
//! Set an edge id to all darts from an orbit of d
/*!
*/
void setEdgeId(Dart d, unsigned int i); //TODO a virer
void setDartEdgeId(Dart d, unsigned int i);
unsigned int triRefinementEdgeId(Dart d);
unsigned int quadRefinementEdgeId(Dart d);
//! Give a new unique id to all the faces of the map
/*!
*/
void initFaceId() ;
//! Return the next available face id
/*!
*/
unsigned int getNewFaceId() ;
//! Return the id of the face of d
/*!
*/
unsigned int getFaceId(Dart d) ;
unsigned int faceId(Dart d);
//! Set a face id to all darts from an orbit of d
/*!
*/
void setFaceId(Dart d, unsigned int i, unsigned int orbit); //TODO a virer
void setFaceId(unsigned int orbit, Dart d);
/***************************************************
* CELLS INFORMATION *
***************************************************/
//! Return the level of insertion of the vertex of d
/*!
*/
unsigned int vertexInsertionLevel(Dart d) const;
};
//TODO existe deja dans le fichier ihm2.h
//template <typename T, unsigned int ORBIT>
//class AttributeHandler_IHM : public AttributeHandler<T, ORBIT, ImplicitHierarchicalMap3>
//{
//public:
// typedef T DATA_TYPE ;
// AttributeHandler_IHM() : AttributeHandler<T, ORBIT, ImplicitHierarchicalMap3>()
// {}
// AttributeHandler_IHM(ImplicitHierarchicalMap3* m, AttributeMultiVector<T>* amv) : AttributeHandler<T, ORBIT, ImplicitHierarchicalMap3>(m, amv)
// {}
// AttributeMultiVector<T>* getDataVector() const
// {
// return AttributeHandler<T, ORBIT, ImplicitHierarchicalMap3>::getDataVector() ;
// }
// bool isValid() const
// {
// return AttributeHandler<T, ORBIT, ImplicitHierarchicalMap3>::isValid() ;
// }
// virtual T& operator[](Dart d) ;
// virtual const T& operator[](Dart d) const ;
// T& operator[](unsigned int a)
// {
// return AttributeHandler<T, ORBIT, ImplicitHierarchicalMap3>::operator[](a) ;
// }
// const T& operator[](unsigned int a) const
// {
// return AttributeHandler<T, ORBIT, ImplicitHierarchicalMap3>::operator[](a) ;
// }
//} ;
//template <typename T>
//class VertexAttribute_IHM : public AttributeHandler_IHM<T, VERTEX>
//{
//public:
// VertexAttribute_IHM() : IHM::AttributeHandler_IHM<T, VERTEX>() {}
// VertexAttribute_IHM(const IHM::AttributeHandler_IHM<T, VERTEX>& ah) : IHM::AttributeHandler_IHM<T, VERTEX>(ah) {}
//// VertexAttribute_IHM<T>& operator=(const IHM::AttributeHandler_IHM<T, VERTEX>& ah) { this->IHM::AttributeHandler_IHM<T, VERTEX>::operator=(ah); return *this; }
//};
} //namespace CGoGN
#include "Topology/ihmap/ihm3.hpp"
#endif