Commit 5ebd12a3 authored by Kenneth Vanhoey's avatar Kenneth Vanhoey

Merge branch 'develop' of cgogn:~thery/CGoGN into develop

Conflicts:
	include/Algo/Geometry/normal.hpp
parents d2a242bd 735e431d
......@@ -77,7 +77,10 @@ typename ATT::DATA_TYPE smooth(MAP& map, Vertex v, const ATT& attributs)
template <typename MAP, typename ATT>
void applySmooth(MAP& map, const ATT& att_in, ATT& att_out)
{
foreach_cell<VERTEX>(map,[&](Vertex v) // for all edge e of map do
// check at compile if ATT is an AttributeHandler on orbit VERTEX
CHECK_ATTRIBUTEHANDER_ORBIT_TYPE(ATT,VERTEX);
foreach_cell<VERTEX>(map,[&](Vertex v) // for all vertex v of map do
{
att_out[v] = smooth(map,v,att_in);
});
......
......@@ -112,6 +112,8 @@ void computeNewPositions(MAP& map, VertexAttribute<VEC3, MAP>& pos)
template<typename ATTRIB>
void dumpAttribute(const ATTRIB& attr)
{
CHECK_ATTRIBUTEHANDER__TYPE(ATTRIB);
std::cout << "Attribute " <<attr.name() << " of orbit "<< orbitName(attr.getOrbit())<< " of type "<< attr.typeName()<< std::endl;
// NEVER USE 0 AND ++ IN FOR LOOP ON ATTRIBUTE !
......
......@@ -85,25 +85,33 @@ typename V_ATT::DATA_TYPE faceNormal(typename PFP::MAP& map, Face f, const V_ATT
template<typename PFP, typename V_ATT>
typename V_ATT::DATA_TYPE vertexNormal(typename PFP::MAP& map, Vertex v, const V_ATT& position)
{
typedef typename V_ATT::DATA_TYPE VEC3 ;
CHECK_ATTRIBUTEHANDER_ORBIT_TYPE(V_ATT,VERTEX);
typedef typename V_ATT::DATA_TYPE VEC3 ;
VEC3 N(0) ;
foreach_incident2<FACE>(map, v, [&] (Face f)
{
VEC3 n = faceNormal<PFP>(map, f, position) ;
if(!n.hasNan())
{
VEC3 v1 = vectorOutOfDart<PFP>(map, f.dart, position) ;
VEC3 v2 = vectorOutOfDart<PFP>(map, map.phi_1(f), position) ;
typename VEC3::DATA_TYPE l = (v1.norm2() * v2.norm2());
if (l > (typename VEC3::DATA_TYPE(0.0)) )
{
n *= convexFaceArea<PFP>(map, f, position) / l ;
N += n ;
}
}
});
N.normalize() ;
return N ;
}
VEC3 N(0) ;
foreach_incident2<FACE>(map, v, [&] (Face f)
{
VEC3 n = faceNormal<PFP>(map, f, position) ;
if(!n.hasNan())
{
VEC3 v1 = vectorOutOfDart<PFP>(map, f.dart, position) ;
VEC3 v2 = vectorOutOfDart<PFP>(map, map.phi_1(f), position) ;
n *= convexFaceArea<PFP>(map, f, position) / (v1.norm2() * v2.norm2()) ;
N += n ;
}
});
N.normalize() ;
return N ;
}
template<typename PFP, typename V_ATT>
typename V_ATT::DATA_TYPE vertexBorderNormal(typename PFP::MAP& map, Vertex v, const V_ATT& position)
......
......@@ -33,6 +33,14 @@
#include "Container/fakeAttribute.h"
#include "Topology/generic/cells.h"
/// Macro that check if ATTRIBUTEHANDLER type is an AttributeHandler of orbit ORBITVALUE
#define CHECK_ATTRIBUTEHANDER_ORBIT_TYPE(ATTRIBUTEHANDLER, ORBITVALUE) \
static_assert(std::is_base_of<AttributeHandlerGen,ATTRIBUTEHANDLER>::value, "Error not AttributeHandler");\
static_assert(ATTRIBUTEHANDLER::ORBIT==ORBITVALUE,"Error wrong orbit of AttributeHandler");
#define CHECK_ATTRIBUTEHANDER__TYPE(ATTRIBUTEHANDLER) \
static_assert(std::is_base_of<AttributeHandlerGen,ATTRIBUTEHANDLER>::value, "Error not AttributeHandler");
namespace CGoGN
{
......@@ -78,7 +86,7 @@ protected:
* - [ dart ]
* - begin / end / next to manage indexing
*/
template <typename T, unsigned int ORBIT, typename MAP>
template <typename T, unsigned int ORB, typename MAP>
class AttributeHandler : public AttributeHandlerGen
{
protected:
......@@ -92,6 +100,7 @@ protected:
public:
typedef T DATA_TYPE ;
static const unsigned int ORBIT = ORB;
/**
* Default constructor
......@@ -110,7 +119,7 @@ public:
* Copy constructor
* @param ta the table attribute
*/
AttributeHandler(const AttributeHandler<T, ORBIT, MAP>& ta) ;
AttributeHandler(const AttributeHandler<T, ORB, MAP>& ta) ;
/**
* Transmute Constructor
......@@ -124,14 +133,14 @@ public:
* affectation operator
* @param ta the table attribute to affect to this
*/
AttributeHandler<T, ORBIT, MAP>& operator=(const AttributeHandler<T, ORBIT, MAP>& ta) ;
AttributeHandler<T, ORB, MAP>& operator=(const AttributeHandler<T, ORB, MAP>& ta) ;
/**
* transmuted affectation operator
* @param ta the table attribute to affect to this
*/
template <unsigned int ORBIT2>
AttributeHandler<T, ORBIT, MAP>& operator=(const AttributeHandler<T, ORBIT2, MAP>& ta) ;
AttributeHandler<T, ORB, MAP>& operator=(const AttributeHandler<T, ORBIT2, MAP>& ta) ;
/**
* Destructor (empty & virtual)
......@@ -190,12 +199,12 @@ public:
/**
* [] operator with cell parameter
*/
T& operator[](Cell<ORBIT> c) ;
T& operator[](Cell<ORB> c) ;
/**
* const [] operator with cell parameter
*/
const T& operator[](Cell<ORBIT> c) const ;
const T& operator[](Cell<ORB> c) const ;
/**
* at operator (same as [] but with index parameter)
......@@ -241,75 +250,39 @@ public:
void next(unsigned int& iter) const;
} ;
/**
* shortcut class for Dart Attribute (Handler)
* c++11 shortcut for Dart Attribute (Handler)
*/
template <typename T, typename MAP>
class DartAttribute : public AttributeHandler<T, DART, MAP>
{
public:
DartAttribute() : AttributeHandler<T, DART, MAP>() {}
DartAttribute(const AttributeHandler<T, DART, MAP>& ah) : AttributeHandler<T, DART, MAP>(ah) {}
DartAttribute(MAP* m, AttributeMultiVector<T>* amv) : AttributeHandler<T, DART, MAP>(m,amv) {}
DartAttribute<T, MAP>& operator=(const AttributeHandler<T, DART, MAP>& ah) { this->AttributeHandler<T, DART, MAP>::operator=(ah); return *this; }
};
using DartAttribute = AttributeHandler<T, DART, MAP>;
/**
* shortcut class for Vertex Attribute (Handler)
* c++11 shortcut for Vertex Attribute (Handler)
*/
template <typename T, typename MAP>
class VertexAttribute : public AttributeHandler<T, VERTEX, MAP>
{
public:
VertexAttribute() : AttributeHandler<T, VERTEX, MAP>() {}
VertexAttribute(const AttributeHandler<T, VERTEX, MAP>& ah) : AttributeHandler<T, VERTEX, MAP>(ah) {}
VertexAttribute(MAP* m, AttributeMultiVector<T>* amv) : AttributeHandler<T, VERTEX, MAP>(m,amv) {}
VertexAttribute<T, MAP>& operator=(const AttributeHandler<T, VERTEX, MAP>& ah) { this->AttributeHandler<T, VERTEX, MAP>::operator=(ah); return *this; }
VertexAttribute<T, MAP>& operator=(const AttributeHandler<T, EDGE, MAP>& ah) { this->AttributeHandler<T,VERTEX, MAP>::operator=(ah); return *this; }
VertexAttribute<T, MAP>& operator=(const AttributeHandler<T, FACE, MAP>& ah) { this->AttributeHandler<T,VERTEX, MAP>::operator=(ah); return *this; }
VertexAttribute<T, MAP>& operator=(const AttributeHandler<T, VOLUME, MAP>& ah) { this->AttributeHandler<T,VERTEX, MAP>::operator=(ah); return *this; }
};
using VertexAttribute = AttributeHandler<T, VERTEX, MAP>;
/**
* shortcut class for Edge Attribute (Handler)
* c++11 shortcut for Edge Attribute (Handler)
*/
template <typename T, typename MAP>
class EdgeAttribute : public AttributeHandler<T, EDGE, MAP>
{
public:
EdgeAttribute() : AttributeHandler<T, EDGE, MAP>() {}
EdgeAttribute(const AttributeHandler<T, EDGE, MAP>& ah) : AttributeHandler<T, EDGE, MAP>(ah) {}
EdgeAttribute(MAP* m, AttributeMultiVector<T>* amv) : AttributeHandler<T, EDGE, MAP>(m,amv) {}
EdgeAttribute<T, MAP>& operator=(const AttributeHandler<T, EDGE, MAP>& ah) { this->AttributeHandler<T, EDGE, MAP>::operator=(ah); return *this; }
};
using EdgeAttribute = AttributeHandler<T, EDGE, MAP>;
/**
* shortcut class for Face Attribute (Handler)
* c++11 shortcut for Face Attribute (Handler)
*/
template <typename T, typename MAP>
class FaceAttribute : public AttributeHandler<T, FACE, MAP>
{
public:
FaceAttribute() : AttributeHandler<T, FACE, MAP>() {}
FaceAttribute(const AttributeHandler<T, FACE, MAP>& ah) : AttributeHandler<T, FACE, MAP>(ah) {}
FaceAttribute(MAP* m, AttributeMultiVector<T>* amv) : AttributeHandler<T, FACE, MAP>(m,amv) {}
FaceAttribute<T, MAP>& operator=(const AttributeHandler<T, FACE, MAP>& ah) { this->AttributeHandler<T, FACE, MAP>::operator=(ah); return *this; }
FaceAttribute<T, MAP>& operator=(const AttributeHandler<T, VERTEX, MAP>& ah) { this->AttributeHandler<T,FACE, MAP>::operator=(ah); return *this; }
};
using FaceAttribute = AttributeHandler<T, FACE, MAP>;
/**
* shortcut class for Volume Attribute (Handler)
* c++11 shortcut for Volume Attribute (Handler)
*/
template <typename T, typename MAP>
class VolumeAttribute : public AttributeHandler<T, VOLUME, MAP>
{
public:
VolumeAttribute() : AttributeHandler<T, VOLUME, MAP>() {}
VolumeAttribute(const AttributeHandler<T, VOLUME, MAP>& ah) : AttributeHandler<T, VOLUME, MAP>(ah) {}
VolumeAttribute(MAP* m, AttributeMultiVector<T>* amv) : AttributeHandler<T, VOLUME, MAP>(m,amv) {}
VolumeAttribute<T, MAP>& operator=(const AttributeHandler<T, VOLUME, MAP>& ah) { this->AttributeHandler<T, VOLUME, MAP>::operator=(ah); return *this; }
VolumeAttribute<T, MAP>& operator=(const AttributeHandler<T, VERTEX, MAP>& ah) { this->AttributeHandler<T, VOLUME, MAP>::operator=(ah); return *this; }
};
using VolumeAttribute = AttributeHandler<T, VOLUME, MAP>;
// turn_to<b>(A*</b> obj) changes class of the object
......
......@@ -29,15 +29,15 @@
namespace CGoGN
{
template <typename T, unsigned int ORBIT, typename MAP>
inline void AttributeHandler<T, ORBIT, MAP>::registerInMap()
template <typename T, unsigned int ORB, typename MAP>
inline void AttributeHandler<T, ORB, MAP>::registerInMap()
{
std::lock_guard<std::mutex> lockAH(m_map->attributeHandlersMutex);
m_map->attributeHandlers.insert(std::pair<AttributeMultiVectorGen*, AttributeHandlerGen*>(m_attrib, this)) ;
}
template <typename T, unsigned int ORBIT, typename MAP>
inline void AttributeHandler<T, ORBIT, MAP>::unregisterFromMap()
template <typename T, unsigned int ORB, typename MAP>
inline void AttributeHandler<T, ORB, MAP>::unregisterFromMap()
{
typedef std::multimap<AttributeMultiVectorGen*, AttributeHandlerGen*>::iterator IT ;
......@@ -56,22 +56,22 @@ inline void AttributeHandler<T, ORBIT, MAP>::unregisterFromMap()
// =================================================================
template <typename T, unsigned int ORBIT, typename MAP>
AttributeHandler<T, ORBIT, MAP>::AttributeHandler() :
template <typename T, unsigned int ORB, typename MAP>
AttributeHandler<T, ORB, MAP>::AttributeHandler() :
AttributeHandlerGen(false),
m_map(NULL),
m_attrib(NULL)
{}
template <typename T, unsigned int ORBIT, typename MAP>
AttributeHandler<T, ORBIT, MAP>::AttributeHandler(MAP* m, AttributeMultiVector<T>* amv) :
template <typename T, unsigned int ORB, typename MAP>
AttributeHandler<T, ORB, MAP>::AttributeHandler(MAP* m, AttributeMultiVector<T>* amv) :
AttributeHandlerGen(false),
m_map(m),
m_attrib(amv)
{
if(m != NULL && amv != NULL && amv->getIndex() != AttributeContainer::UNKNOWN)
{
assert(ORBIT == amv->getOrbit() || !"AttributeHandler: orbit incompatibility") ;
assert(ORB == amv->getOrbit() || !"AttributeHandler: orbit incompatibility") ;
valid = true ;
registerInMap() ;
}
......@@ -79,8 +79,8 @@ AttributeHandler<T, ORBIT, MAP>::AttributeHandler(MAP* m, AttributeMultiVector<T
valid = false ;
}
template <typename T, unsigned int ORBIT, typename MAP>
AttributeHandler<T, ORBIT, MAP>::AttributeHandler(const AttributeHandler<T, ORBIT, MAP>& ta) :
template <typename T, unsigned int ORB, typename MAP>
AttributeHandler<T, ORB, MAP>::AttributeHandler(const AttributeHandler<T, ORB, MAP>& ta) :
AttributeHandlerGen(ta.valid),
m_map(ta.m_map),
m_attrib(ta.m_attrib)
......@@ -89,9 +89,9 @@ AttributeHandler<T, ORBIT, MAP>::AttributeHandler(const AttributeHandler<T, ORBI
registerInMap() ;
}
template <typename T, unsigned int ORBIT, typename MAP>
template <typename T, unsigned int ORB, typename MAP>
template <unsigned int ORBIT2>
AttributeHandler<T, ORBIT, MAP>::AttributeHandler(const AttributeHandler<T, ORBIT2, MAP>& h) :
AttributeHandler<T, ORB, MAP>::AttributeHandler(const AttributeHandler<T, ORBIT2, MAP>& h) :
AttributeHandlerGen(h.valid),
m_map(h.m_map),
m_attrib(h.m_attrib)
......@@ -105,8 +105,8 @@ AttributeHandler<T, ORBIT, MAP>::AttributeHandler(const AttributeHandler<T, ORBI
valid = false;
}
template <typename T, unsigned int ORBIT, typename MAP>
inline AttributeHandler<T, ORBIT, MAP>& AttributeHandler<T, ORBIT, MAP>::operator=(const AttributeHandler<T, ORBIT, MAP>& ta)
template <typename T, unsigned int ORB, typename MAP>
inline AttributeHandler<T, ORB, MAP>& AttributeHandler<T, ORB, MAP>::operator=(const AttributeHandler<T, ORB, MAP>& ta)
{
if(valid)
unregisterFromMap() ;
......@@ -118,9 +118,9 @@ inline AttributeHandler<T, ORBIT, MAP>& AttributeHandler<T, ORBIT, MAP>::operato
return *this ;
}
template <typename T, unsigned int ORBIT, typename MAP>
template <typename T, unsigned int ORB, typename MAP>
template <unsigned int ORBIT2>
inline AttributeHandler<T, ORBIT, MAP>& AttributeHandler<T, ORBIT, MAP>::operator=(const AttributeHandler<T, ORBIT2, MAP>& ta)
inline AttributeHandler<T, ORB, MAP>& AttributeHandler<T, ORB, MAP>::operator=(const AttributeHandler<T, ORBIT2, MAP>& ta)
{
if(valid)
unregisterFromMap() ;
......@@ -132,64 +132,64 @@ inline AttributeHandler<T, ORBIT, MAP>& AttributeHandler<T, ORBIT, MAP>::operato
return *this ;
}
template <typename T, unsigned int ORBIT, typename MAP>
AttributeHandler<T, ORBIT, MAP>::~AttributeHandler()
template <typename T, unsigned int ORB, typename MAP>
AttributeHandler<T, ORB, MAP>::~AttributeHandler()
{
if(valid)
unregisterFromMap() ;
}
template <typename T, unsigned int ORBIT, typename MAP>
inline AttributeMultiVector<T>* AttributeHandler<T, ORBIT, MAP>::getDataVector() const
template <typename T, unsigned int ORB, typename MAP>
inline AttributeMultiVector<T>* AttributeHandler<T, ORB, MAP>::getDataVector() const
{
return m_attrib ;
}
template <typename T, unsigned int ORBIT, typename MAP>
inline AttributeMultiVectorGen* AttributeHandler<T, ORBIT, MAP>::getDataVectorGen() const
template <typename T, unsigned int ORB, typename MAP>
inline AttributeMultiVectorGen* AttributeHandler<T, ORB, MAP>::getDataVectorGen() const
{
return m_attrib ;
}
template <typename T, unsigned int ORBIT, typename MAP>
inline int AttributeHandler<T, ORBIT, MAP>::getSizeOfType() const
template <typename T, unsigned int ORB, typename MAP>
inline int AttributeHandler<T, ORB, MAP>::getSizeOfType() const
{
return sizeof(T) ;
}
template <typename T, unsigned int ORBIT, typename MAP>
inline unsigned int AttributeHandler<T, ORBIT, MAP>::getOrbit() const
template <typename T, unsigned int ORB, typename MAP>
inline unsigned int AttributeHandler<T, ORB, MAP>::getOrbit() const
{
return ORBIT ;
return ORB ;
}
template <typename T, unsigned int ORBIT, typename MAP>
inline unsigned int AttributeHandler<T, ORBIT, MAP>::getIndex() const
template <typename T, unsigned int ORB, typename MAP>
inline unsigned int AttributeHandler<T, ORB, MAP>::getIndex() const
{
return m_attrib->getIndex() ;
}
template <typename T, unsigned int ORBIT, typename MAP>
inline const std::string& AttributeHandler<T, ORBIT, MAP>::name() const
template <typename T, unsigned int ORB, typename MAP>
inline const std::string& AttributeHandler<T, ORB, MAP>::name() const
{
return m_attrib->getName() ;
}
template <typename T, unsigned int ORBIT, typename MAP>
inline const std::string& AttributeHandler<T, ORBIT, MAP>::typeName() const
template <typename T, unsigned int ORB, typename MAP>
inline const std::string& AttributeHandler<T, ORB, MAP>::typeName() const
{
return m_attrib->getTypeName();
}
template <typename T, unsigned int ORBIT, typename MAP>
inline unsigned int AttributeHandler<T, ORBIT, MAP>::nbElements() const
template <typename T, unsigned int ORB, typename MAP>
inline unsigned int AttributeHandler<T, ORB, MAP>::nbElements() const
{
return m_map->template getAttributeContainer<ORBIT>().size() ;
return m_map->template getAttributeContainer<ORB>().size() ;
}
template <typename T, unsigned int ORBIT, typename MAP>
inline T& AttributeHandler<T, ORBIT, MAP>::operator[](Cell<ORBIT> c)
template <typename T, unsigned int ORB, typename MAP>
inline T& AttributeHandler<T, ORB, MAP>::operator[](Cell<ORB> c)
{
assert(valid || !"Invalid AttributeHandler") ;
unsigned int a = m_map->getEmbedding(c) ;
......@@ -200,71 +200,71 @@ inline T& AttributeHandler<T, ORBIT, MAP>::operator[](Cell<ORBIT> c)
return m_attrib->operator[](a) ;
}
template <typename T, unsigned int ORBIT, typename MAP>
inline const T& AttributeHandler<T, ORBIT, MAP>::operator[](Cell<ORBIT> c) const
template <typename T, unsigned int ORB, typename MAP>
inline const T& AttributeHandler<T, ORB, MAP>::operator[](Cell<ORB> c) const
{
assert(valid || !"Invalid AttributeHandler") ;
unsigned int a = m_map->getEmbedding(c) ;
return m_attrib->operator[](a) ;
}
template <typename T, unsigned int ORBIT, typename MAP>
inline T& AttributeHandler<T, ORBIT, MAP>::operator[](unsigned int a)
template <typename T, unsigned int ORB, typename MAP>
inline T& AttributeHandler<T, ORB, MAP>::operator[](unsigned int a)
{
assert(valid || !"Invalid AttributeHandler") ;
return m_attrib->operator[](a) ;
}
template <typename T, unsigned int ORBIT, typename MAP>
inline const T& AttributeHandler<T, ORBIT, MAP>::operator[](unsigned int a) const
template <typename T, unsigned int ORB, typename MAP>
inline const T& AttributeHandler<T, ORB, MAP>::operator[](unsigned int a) const
{
assert(valid || !"Invalid AttributeHandler") ;
return m_attrib->operator[](a) ;
}
template <typename T, unsigned int ORBIT, typename MAP>
inline unsigned int AttributeHandler<T, ORBIT, MAP>::insert(const T& elt)
template <typename T, unsigned int ORB, typename MAP>
inline unsigned int AttributeHandler<T, ORB, MAP>::insert(const T& elt)
{
assert(valid || !"Invalid AttributeHandler") ;
unsigned int idx = m_map->template getAttributeContainer<ORBIT>().insertLine() ;
unsigned int idx = m_map->template getAttributeContainer<ORB>().insertLine() ;
m_attrib->operator[](idx) = elt ;
return idx ;
}
template <typename T, unsigned int ORBIT, typename MAP>
inline unsigned int AttributeHandler<T, ORBIT, MAP>::newElt()
template <typename T, unsigned int ORB, typename MAP>
inline unsigned int AttributeHandler<T, ORB, MAP>::newElt()
{
assert(valid || !"Invalid AttributeHandler") ;
unsigned int idx = m_map->template getAttributeContainer<ORBIT>().insertLine() ;
unsigned int idx = m_map->template getAttributeContainer<ORB>().insertLine() ;
return idx ;
}
template <typename T, unsigned int ORBIT, typename MAP>
inline void AttributeHandler<T, ORBIT, MAP>::setAllValues(const T& v)
template <typename T, unsigned int ORB, typename MAP>
inline void AttributeHandler<T, ORB, MAP>::setAllValues(const T& v)
{
for(unsigned int i = begin(); i != end(); next(i))
m_attrib->operator[](i) = v ;
}
template <typename T, unsigned int ORBIT, typename MAP>
inline unsigned int AttributeHandler<T, ORBIT, MAP>::begin() const
template <typename T, unsigned int ORB, typename MAP>
inline unsigned int AttributeHandler<T, ORB, MAP>::begin() const
{
assert(valid || !"Invalid AttributeHandler") ;
return m_map->template getAttributeContainer<ORBIT>().begin() ;
return m_map->template getAttributeContainer<ORB>().begin() ;
}
template <typename T, unsigned int ORBIT, typename MAP>
inline unsigned int AttributeHandler<T, ORBIT, MAP>::end() const
template <typename T, unsigned int ORB, typename MAP>
inline unsigned int AttributeHandler<T, ORB, MAP>::end() const
{
assert(valid || !"Invalid AttributeHandler") ;
return m_map->template getAttributeContainer<ORBIT>().end() ;
return m_map->template getAttributeContainer<ORB>().end() ;
}
template <typename T, unsigned int ORBIT, typename MAP>
inline void AttributeHandler<T, ORBIT, MAP>::next(unsigned int& iter) const
template <typename T, unsigned int ORB, typename MAP>
inline void AttributeHandler<T, ORB, MAP>::next(unsigned int& iter) const
{
assert(valid || !"Invalid AttributeHandler") ;
m_map->template getAttributeContainer<ORBIT>().next(iter) ;
m_map->template getAttributeContainer<ORB>().next(iter) ;
}
......
......@@ -86,102 +86,39 @@ struct RefCompo3Type
template <typename T1, typename T2, typename T3>
class Vertex3Attributes
{
VertexAttribute<T1>& m_h1;
VertexAttribute<T2>& m_h2;
VertexAttribute<T3>& m_h3;
public:
typedef Compo3Type<T1,T2,T3> DATA_TYPE;
typedef RefCompo3Type<T1,T2,T3> REF_DATA_TYPE;
Vertex3Attributes(VertexAttribute<T1>& h1, VertexAttribute<T2>& h2, VertexAttribute<T3>& h3):
m_h1(h1), m_h2(h2), m_h3(h3) {}
RefCompo3Type<T1,T2,T3> operator[](unsigned int a)
{
return RefCompo3Type<T1,T2,T3>(m_h1[a],m_h2[a],m_h3[a]);
}
RefCompo3Type<T1,T2,T3> operator[](Vertex d)
{
return RefCompo3Type<T1,T2,T3>(m_h1[d],m_h2[d],m_h3[d]);
}
const RefCompo3Type<T1,T2,T3> operator[](unsigned int a) const
{
return RefCompo3Type<T1,T2,T3>(m_h1[a],m_h2[a],m_h3[a]);
}
const RefCompo3Type<T1,T2,T3> operator[](Vertex d) const
{
return RefCompo3Type<T1,T2,T3>(m_h1[d],m_h2[d],m_h3[d]);
}
static unsigned int getOrbit() { return VERTEX; }
};
template <typename T1, typename T2, typename T3>
class Edge3Attributes
template <typename T1, typename T2, typename T3, unsigned int ORB, typename MAP>
class Cell3Attributes: public AttributeHandlerGen
{
EdgeAttribute<T1>& m_h1;
EdgeAttribute<T2>& m_h2;
EdgeAttribute<T3>& m_h3;
public:
typedef Compo3Type<T1,T2,T3> DATA_TYPE;
typedef RefCompo3Type<T1,T2,T3> REF_DATA_TYPE;
Edge3Attributes(EdgeAttribute<T1>& h1, EdgeAttribute<T2>& h2, EdgeAttribute<T3>& h3):
m_h1(h1), m_h2(h2), m_h3(h3) {}
RefCompo3Type<T1,T2,T3> operator[](unsigned int a)
{
return RefCompo3Type<T1,T2,T3>(m_h1[a],m_h2[a],m_h3[a]);
}
RefCompo3Type<T1,T2,T3> operator[](Edge d)
{
return RefCompo3Type<T1,T2,T3>(m_h1[d],m_h2[d],m_h3[d]);
}
const RefCompo3Type<T1,T2,T3> operator[](unsigned int a) const
{
return RefCompo3Type<T1,T2,T3>(m_h1[a],m_h2[a],m_h3[a]);
}
const RefCompo3Type<T1,T2,T3> operator[](Edge d) const
{
return RefCompo3Type<T1,T2,T3>(m_h1[d],m_h2[d],m_h3[d]);
}
static unsigned int getOrbit() { return EDGE; }
};
template <typename T1, typename T2, typename T3>
class Face3Attributes
{
FaceAttribute<T1>& m_h1;
FaceAttribute<T2>& m_h2;
FaceAttribute<T3>& m_h3;
AttributeHandler<T1, ORB, MAP>& m_h1;
AttributeHandler<T2, ORB, MAP>& m_h2;
AttributeHandler<T3, ORB, MAP>& m_h3;
public:
typedef Compo3Type<T1,T2,T3> DATA_TYPE;