Commit 40687654 authored by Sylvain Thery's avatar Sylvain Thery

cell parameter in [] of AttributeHandler

parent c9c55962
......@@ -31,6 +31,7 @@
#include "Topology/generic/genericmap.h"
#include "Container/attributeContainer.h"
#include "Container/fakeAttribute.h"
#include "Topology/generic/cells.h"
namespace CGoGN
{
......@@ -189,14 +190,14 @@ public:
unsigned int nbElements() const;
/**
* [] operator with dart parameter
* [] operator with cell parameter
*/
T& operator[](Dart d) ;
T& operator[](Cell<ORBIT> c) ;
/**
* const [] operator with dart parameter
* const [] operator with cell parameter
*/
const T& operator[](Dart d) const ;
const T& operator[](Cell<ORBIT> c) const ;
/**
* at operator (same as [] but with index parameter)
......
......@@ -185,7 +185,7 @@ inline unsigned int AttributeHandler<T, ORBIT, MAP_IMPL>::nbElements() const
}
template <typename T, unsigned int ORBIT, typename MAP_IMPL>
inline T& AttributeHandler<T, ORBIT, MAP_IMPL>::operator[](Dart d)
inline T& AttributeHandler<T, ORBIT, MAP_IMPL>::operator[](Cell<ORBIT> d)
{
assert(valid || !"Invalid AttributeHandler") ;
unsigned int a = m_map->template getEmbedding<ORBIT>(d) ;
......@@ -197,7 +197,7 @@ inline T& AttributeHandler<T, ORBIT, MAP_IMPL>::operator[](Dart d)
}
template <typename T, unsigned int ORBIT, typename MAP_IMPL>
inline const T& AttributeHandler<T, ORBIT, MAP_IMPL>::operator[](Dart d) const
inline const T& AttributeHandler<T, ORBIT, MAP_IMPL>::operator[](Cell<ORBIT> d) const
{
assert(valid || !"Invalid AttributeHandler") ;
unsigned int a = m_map->template getEmbedding<ORBIT>(d) ;
......
......@@ -25,6 +25,8 @@
#ifndef __MULTI3ATTRIBS_H_
#define __MULTI3ATTRIBS_H_
#include "Topology/generic/cells.h"
namespace CGoGN
{
......@@ -102,7 +104,7 @@ public:
return RefCompo3Type<T1,T2,T3>(m_h1[a],m_h2[a],m_h3[a]);
}
RefCompo3Type<T1,T2,T3> operator[](Dart d)
RefCompo3Type<T1,T2,T3> operator[](Vertex d)
{
return RefCompo3Type<T1,T2,T3>(m_h1[d],m_h2[d],m_h3[d]);
}
......@@ -112,7 +114,7 @@ public:
return RefCompo3Type<T1,T2,T3>(m_h1[a],m_h2[a],m_h3[a]);
}
const RefCompo3Type<T1,T2,T3> operator[](Dart d) const
const RefCompo3Type<T1,T2,T3> operator[](Vertex d) const
{
return RefCompo3Type<T1,T2,T3>(m_h1[d],m_h2[d],m_h3[d]);
}
......@@ -139,7 +141,7 @@ public:
return RefCompo3Type<T1,T2,T3>(m_h1[a],m_h2[a],m_h3[a]);
}
RefCompo3Type<T1,T2,T3> operator[](Dart d)
RefCompo3Type<T1,T2,T3> operator[](Edge d)
{
return RefCompo3Type<T1,T2,T3>(m_h1[d],m_h2[d],m_h3[d]);
}
......@@ -149,7 +151,7 @@ public:
return RefCompo3Type<T1,T2,T3>(m_h1[a],m_h2[a],m_h3[a]);
}
const RefCompo3Type<T1,T2,T3> operator[](Dart d) const
const RefCompo3Type<T1,T2,T3> operator[](Edge d) const
{
return RefCompo3Type<T1,T2,T3>(m_h1[d],m_h2[d],m_h3[d]);
}
......@@ -177,7 +179,7 @@ public:
return RefCompo3Type<T1,T2,T3>(m_h1[a],m_h2[a],m_h3[a]);
}
RefCompo3Type<T1,T2,T3> operator[](Dart d)
RefCompo3Type<T1,T2,T3> operator[](Face d)
{
return RefCompo3Type<T1,T2,T3>(m_h1[d],m_h2[d],m_h3[d]);
}
......@@ -187,7 +189,7 @@ public:
return RefCompo3Type<T1,T2,T3>(m_h1[a],m_h2[a],m_h3[a]);
}
const RefCompo3Type<T1,T2,T3> operator[](Dart d) const
const RefCompo3Type<T1,T2,T3> operator[](Face d) const
{
return RefCompo3Type<T1,T2,T3>(m_h1[d],m_h2[d],m_h3[d]);
}
......@@ -213,7 +215,7 @@ public:
return RefCompo3Type<T1,T2,T3>(m_h1[a],m_h2[a],m_h3[a]);
}
RefCompo3Type<T1,T2,T3> operator[](Dart d)
RefCompo3Type<T1,T2,T3> operator[](Vol d)
{
return RefCompo3Type<T1,T2,T3>(m_h1[d],m_h2[d],m_h3[d]);
}
......@@ -223,7 +225,7 @@ public:
return RefCompo3Type<T1,T2,T3>(m_h1[a],m_h2[a],m_h3[a]);
}
const RefCompo3Type<T1,T2,T3> operator[](Dart d) const
const RefCompo3Type<T1,T2,T3> operator[](Vol d) const
{
return RefCompo3Type<T1,T2,T3>(m_h1[d],m_h2[d],m_h3[d]);
}
......
......@@ -25,6 +25,8 @@
#ifndef __MULTI4ATTRIBS_H_
#define __MULTI4ATTRIBS_H_
#include "Topology/generic/cells.h"
namespace CGoGN
{
......@@ -105,7 +107,7 @@ public:
return RefCompo4Type<T1,T2,T3,T4>(m_h1[a],m_h2[a],m_h3[a],m_h4[a]);
}
RefCompo4Type<T1,T2,T3,T4> operator[](Dart d)
RefCompo4Type<T1,T2,T3,T4> operator[](Vertex d)
{
return RefCompo4Type<T1,T2,T3,T4>(m_h1[d],m_h2[d],m_h3[d],m_h4[d]);
}
......@@ -115,7 +117,7 @@ public:
return RefCompo4Type<T1,T2,T3,T4>(m_h1[a],m_h2[a],m_h3[a],m_h4[a]);
}
const RefCompo4Type<T1,T2,T3,T4> operator[](Dart d) const
const RefCompo4Type<T1,T2,T3,T4> operator[](Vertex d) const
{
return RefCompo4Type<T1,T2,T3,T4>(m_h1[d],m_h2[d],m_h3[d],m_h4[d]);
}
......@@ -143,7 +145,7 @@ public:
return RefCompo4Type<T1,T2,T3,T4>(m_h1[a],m_h2[a],m_h3[a],m_h4[a]);
}
RefCompo4Type<T1,T2,T3,T4> operator[](Dart d)
RefCompo4Type<T1,T2,T3,T4> operator[](Edge d)
{
return RefCompo4Type<T1,T2,T3,T4>(m_h1[d],m_h2[d],m_h3[d],m_h4[d]);
}
......@@ -153,7 +155,7 @@ public:
return RefCompo4Type<T1,T2,T3,T4>(m_h1[a],m_h2[a],m_h3[a],m_h4[a]);
}
const RefCompo4Type<T1,T2,T3,T4> operator[](Dart d) const
const RefCompo4Type<T1,T2,T3,T4> operator[](Edge d) const
{
return RefCompo4Type<T1,T2,T3,T4>(m_h1[d],m_h2[d],m_h3[d],m_h4[d]);
}
......@@ -182,7 +184,7 @@ public:
return RefCompo4Type<T1,T2,T3,T4>(m_h1[a],m_h2[a],m_h3[a],m_h4[a]);
}
RefCompo4Type<T1,T2,T3,T4> operator[](Dart d)
RefCompo4Type<T1,T2,T3,T4> operator[](Face d)
{
return RefCompo4Type<T1,T2,T3,T4>(m_h1[d],m_h2[d],m_h3[d],m_h4[d]);
}
......@@ -192,7 +194,7 @@ public:
return RefCompo4Type<T1,T2,T3,T4>(m_h1[a],m_h2[a],m_h3[a],m_h4[a]);
}
const RefCompo4Type<T1,T2,T3,T4> operator[](Dart d) const
const RefCompo4Type<T1,T2,T3,T4> operator[](Face d) const
{
return RefCompo4Type<T1,T2,T3,T4>(m_h1[d],m_h2[d],m_h3[d],m_h4[d]);
}
......@@ -219,7 +221,7 @@ public:
return RefCompo4Type<T1,T2,T3,T4>(m_h1[a],m_h2[a],m_h3[a],m_h4[a]);
}
RefCompo4Type<T1,T2,T3,T4> operator[](Dart d)
RefCompo4Type<T1,T2,T3,T4> operator[](Vol d)
{
return RefCompo4Type<T1,T2,T3,T4>(m_h1[d],m_h2[d],m_h3[d],m_h4[d]);
}
......@@ -229,7 +231,7 @@ public:
return RefCompo4Type<T1,T2,T3,T4>(m_h1[a],m_h2[a],m_h3[a],m_h4[a]);
}
const RefCompo4Type<T1,T2,T3,T4> operator[](Dart d) const
const RefCompo4Type<T1,T2,T3,T4> operator[](Vol d) const
{
return RefCompo4Type<T1,T2,T3,T4>(m_h1[d],m_h2[d],m_h3[d],m_h4[d]);
}
......
......@@ -25,6 +25,8 @@
#ifndef __MULTI2ATTRIBS_H_
#define __MULTI2ATTRIBS_H_
#include "Topology/generic/cells.h"
namespace CGoGN
{
......@@ -114,7 +116,7 @@ public:
return RefCompo2Type<T1,T2>(m_h1[a],m_h2[a]);
}
RefCompo2Type<T1,T2> operator[](Dart d)
RefCompo2Type<T1,T2> operator[](Vertex d)
{
return RefCompo2Type<T1,T2>(m_h1[d],m_h2[d]);
}
......@@ -124,7 +126,7 @@ public:
return RefCompo2Type<T1,T2>(m_h1[a],m_h2[a]);
}
const RefCompo2Type<T1,T2> operator[](Dart d) const
const RefCompo2Type<T1,T2> operator[](Vertex d) const
{
return RefCompo2Type<T1,T2>(m_h1[d],m_h2[d]);
}
......@@ -149,7 +151,7 @@ public:
return RefCompo2Type<T1,T2>(m_h1[a],m_h2[a]);
}
RefCompo2Type<T1,T2> operator[](Dart d)
RefCompo2Type<T1,T2> operator[](Edge d)
{
return RefCompo2Type<T1,T2>(m_h1[d],m_h2[d]);
}
......@@ -159,7 +161,7 @@ public:
return RefCompo2Type<T1,T2>(m_h1[a],m_h2[a]);
}
const RefCompo2Type<T1,T2> operator[](Dart d) const
const RefCompo2Type<T1,T2> operator[](Edge d) const
{
return RefCompo2Type<T1,T2>(m_h1[d],m_h2[d]);
}
......@@ -184,7 +186,7 @@ public:
return RefCompo2Type<T1,T2>(m_h1[a],m_h2[a]);
}
RefCompo2Type<T1,T2> operator[](Dart d)
RefCompo2Type<T1,T2> operator[](Face d)
{
return RefCompo2Type<T1,T2>(m_h1[d],m_h2[d]);
}
......@@ -194,7 +196,7 @@ public:
return RefCompo2Type<T1,T2>(m_h1[a],m_h2[a]);
}
const RefCompo2Type<T1,T2> operator[](Dart d) const
const RefCompo2Type<T1,T2> operator[](Face d) const
{
return RefCompo2Type<T1,T2>(m_h1[d],m_h2[d]);
}
......@@ -219,7 +221,7 @@ public:
return RefCompo2Type<T1,T2>(m_h1[a],m_h2[a]);
}
RefCompo2Type<T1,T2> operator[](Dart d)
RefCompo2Type<T1,T2> operator[](Vol d)
{
return RefCompo2Type<T1,T2>(m_h1[d],m_h2[d]);
}
......@@ -229,7 +231,7 @@ public:
return RefCompo2Type<T1,T2>(m_h1[a],m_h2[a]);
}
const RefCompo2Type<T1,T2> operator[](Dart d) const
const RefCompo2Type<T1,T2> operator[](Vol d) const
{
return RefCompo2Type<T1,T2>(m_h1[d],m_h2[d]);
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment