Commit 443b9e63 authored by Pierre Kraemer's avatar Pierre Kraemer

grosse mise a jour des Containers, AttributeHandler, etc..

parent 54d09f40
......@@ -536,44 +536,27 @@ void MyGlutWin::myKeyboard(unsigned char keycode, int x, int y)
case 'd':
{
GLint t1 = glutGet(GLUT_ELAPSED_TIME);
myMap.removeAttribute<PFP::VEC3>(normal) ;
myMap.removeAttribute<PFP::VEC3>(laplacian) ;
AttributeHandler<PFP::VEC3> newPosition = myMap.addAttribute<PFP::VEC3>(FACE_ORBIT, "position") ;
Algo::Geometry::computeCentroidFaces<PFP>(myMap, position, newPosition) ;
std::vector<std::string> attrNames ;
for(unsigned int i = 0; i < NB_ORBITS; ++i)
{
AttributeContainer& cont = myMap.getAttributeContainer(i) ;
std::cout << "container " << i << " (" << cont.getNbAttributes() << ") :" << std::endl ;
cont.getAttributesNames(attrNames) ;
for(unsigned int j = 0; j < attrNames.size(); ++j)
std::cout << " -> " << attrNames[j] << std::endl ;
}
std::cout << std::endl ;
GLint t1 = glutGet(GLUT_ELAPSED_TIME);
Algo::Modelisation::computeDual<PFP>(myMap) ;
for(unsigned int i = 0; i < NB_ORBITS; ++i)
{
AttributeContainer& cont = myMap.getAttributeContainer(i) ;
std::cout << "container " << i << " (" << cont.getNbAttributes() << ") :" << std::endl ;
cont.getAttributesNames(attrNames) ;
for(unsigned int j = 0; j < attrNames.size(); ++j)
std::cout << " -> " << attrNames[j] << std::endl ;
}
GLint t2 = glutGet(GLUT_ELAPSED_TIME);
GLfloat seconds = (t2 - t1) / 1000.0f;
std::cout << "dual computation: "<< seconds << "sec" << std::endl;
newPosition = myMap.getAttribute<PFP::VEC3>(FACE_ORBIT, "position") ;
myMap.removeAttribute<PFP::VEC3>(newPosition) ;
position = myMap.getAttribute<PFP::VEC3>(VERTEX_ORBIT, "position") ;
normal = myMap.addAttribute<PFP::VEC3>(VERTEX_ORBIT, "normal") ;
laplacian = myMap.addAttribute<PFP::VEC3>(VERTEX_ORBIT, "laplacian") ;
GLint t2 = glutGet(GLUT_ELAPSED_TIME);
GLfloat seconds = (t2 - t1) / 1000.0f;
std::cout << "dual computation: "<< seconds << "sec" << std::endl;
t1 = glutGet(GLUT_ELAPSED_TIME);
updateVBOprimitives(Algo::Render::VBO::TRIANGLES | Algo::Render::VBO::LINES | Algo::Render::VBO::POINTS) ;
updateVBOdata(Algo::Render::VBO::POSITIONS | Algo::Render::VBO::NORMALS) ;
......@@ -743,6 +726,7 @@ int main(int argc, char** argv)
std::cerr << "could not import " << filename << std::endl ;
return 1 ;
}
mgw->position = myMap.getAttribute<PFP::VEC3>(VERTEX_ORBIT, attrNames[0]) ;
GLint t2 = glutGet(GLUT_ELAPSED_TIME) ;
GLfloat seconds = (t2 - t1) / 1000.0f ;
......
......@@ -211,7 +211,7 @@ public:
AttributeHandler_IHM() : AttributeHandler<T>()
{}
AttributeHandler_IHM(GenericMap* m, unsigned int idAttr) : AttributeHandler<T>(m, idAttr)
AttributeHandler_IHM(GenericMap* m, unsigned int orbit, unsigned int index) : AttributeHandler<T>(m, orbit, index)
{}
AttributeMultiVector<T>* getDataVector() const
......
......@@ -54,14 +54,14 @@ AttributeHandler_IHM<T> ImplicitHierarchicalMap::addAttribute(unsigned int orbit
amv[i] = EMBNULL ;
}
return AttributeHandler_IHM<T>(this, h.id()) ;
return AttributeHandler_IHM<T>(this, h.getOrbit(), h.getIndex()) ;
}
template <typename T>
AttributeHandler_IHM<T> ImplicitHierarchicalMap::getAttribute(unsigned int orbit, const std::string& nameAttr)
{
AttributeHandler<T> h = Map2::getAttribute<T>(orbit, nameAttr) ;
return AttributeHandler_IHM<T>(this, h.id()) ;
return AttributeHandler_IHM<T>(this, h.getOrbit(), h.getIndex()) ;
}
/***************************************************
......@@ -344,7 +344,7 @@ T& AttributeHandler_IHM<T>::operator[](Dart d)
assert(m->m_dartLevel[d] <= m->m_curLevel || !"Access to a dart introduced after current level") ;
assert(m->vertexInsertionLevel(d) <= m->m_curLevel || !"Access to the embedding of a vertex inserted after current level") ;
unsigned int orbit = AttributeContainer::orbitAttr(this->m_id) ;
unsigned int orbit = this->m_orbit ;
unsigned int nbSteps = m->m_curLevel - m->vertexInsertionLevel(d) ;
unsigned int index = m->getEmbedding(d, orbit) ;
......@@ -381,7 +381,7 @@ const T& AttributeHandler_IHM<T>::operator[](Dart d) const
assert(m->m_dartLevel[d] <= m->m_curLevel || !"Access to a dart introduced after current level") ;
assert(m->vertexInsertionLevel(d) <= m->m_curLevel || !"Access to the embedding of a vertex inserted after current level") ;
unsigned int orbit = AttributeContainer::orbitAttr(this->m_id) ;
unsigned int orbit = this->m_orbit ;
unsigned int nbSteps = m->m_curLevel - m->vertexInsertionLevel(d) ;
unsigned int index = m->getEmbedding(d, orbit) ;
......
......@@ -444,7 +444,7 @@ void computeDual(typename PFP::MAP& map, const FunctorSelect& selected)
for(Dart d = map.begin(); d != map.end(); map.next(d))
{
Dart dd = map.alpha1(d) ;
Dart dd = map.alpha_1(d) ;
new_phi1[d] = dd ;
new_phi_1[dd] = d ;
}
......@@ -469,7 +469,6 @@ template <typename PFP, typename EMBV, typename EMB>
void quadranguleFacesVolume(typename PFP::MAP& map, EMBV& attributs, const FunctorSelect& selected)
{
}
template <typename PFP, typename EMBV, typename EMB>
......
......@@ -36,8 +36,6 @@ namespace Render
namespace VBO
{
template <typename ATTR_HANDLER>
void MapRender_VBO::updateData(int upType, const ATTR_HANDLER& attrib, ConvertAttrib* conv)
{
......@@ -64,8 +62,6 @@ void MapRender_VBO::updateData(int upType, const ATTR_HANDLER& attrib, ConvertAt
fillBufferDirect(indexVBO, attrib) ;
}
template <typename ATTR_HANDLER>
void MapRender_VBO::fillBufferDirect(unsigned int indexVBO, const ATTR_HANDLER& attrib)
{
......@@ -73,7 +69,7 @@ void MapRender_VBO::fillBufferDirect(unsigned int indexVBO, const ATTR_HANDLER&
std::vector<void*> addr;
unsigned int byteTableSize;
unsigned int nbb = mv->getStartAddresses(addr, byteTableSize);
unsigned int nbb = mv->getBlocksPointers(addr, byteTableSize);
glBindBufferARB(GL_ARRAY_BUFFER, m_VBOBuffers[indexVBO]);
glBufferDataARB(GL_ARRAY_BUFFER, nbb * byteTableSize, 0, GL_STREAM_DRAW);
......@@ -88,7 +84,6 @@ void MapRender_VBO::fillBufferDirect(unsigned int indexVBO, const ATTR_HANDLER&
}
}
template <typename ATTR_HANDLER>
void MapRender_VBO::fillBufferConvert(unsigned int indexVBO, const ATTR_HANDLER& attrib, ConvertAttrib* conv)
{
......@@ -96,10 +91,10 @@ void MapRender_VBO::fillBufferConvert(unsigned int indexVBO, const ATTR_HANDLER&
std::vector<void*> addr;
unsigned int byteTableSize;
unsigned int nbb = mv->getStartAddresses(addr, byteTableSize);
unsigned int nbb = mv->getBlocksPointers(addr, byteTableSize);
// alloue la memoire pour le buffer et initialise le conv
conv->reserve(mv->BlockSize());
conv->reserve(mv->getBlockSize());
// bind buffer to update
glBindBufferARB(GL_ARRAY_BUFFER, m_VBOBuffers[indexVBO]);
......@@ -338,9 +333,6 @@ void MapRender_VBO::initPrimitives(typename PFP::MAP& map, const FunctorSelect&
glBufferDataARB(GL_ELEMENT_ARRAY_BUFFER, size*sizeof(GLuint), &(tableIndices[0]), GL_STREAM_DRAW);
}
template<typename PFP>
void MapRender_VBO::initFlatTriangles(typename PFP::MAP& map, const FunctorSelect& good)
{
......@@ -393,13 +385,8 @@ void MapRender_VBO::initFlatTriangles(typename PFP::MAP& map, const FunctorSelec
//creating VBO for flat
glBindBufferARB(GL_ARRAY_BUFFER, m_VBOBuffers[FLAT_BUFFER]);
glBufferDataARB(GL_ARRAY_BUFFER, tableFlat.size() * sizeof(Geom::Vec3f), (char*)(&(tableFlat[0])), GL_STREAM_DRAW);
}
} // namespace VBO
} // namespace Render
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -33,8 +33,6 @@
namespace CGoGN
{
//WARNING WE USE SHORT INT BLOCK_SIZE MUST BE < 65536
class HoleBlockRef
{
protected:
......
......@@ -50,7 +50,7 @@ public:
/**
* Ajout de l'attribut au container (A IMPLEMENTER)
*/
virtual unsigned int addAttribute(AttributeContainer& container, const std::string& attribName)=0;
virtual AttributeMultiVectorGen* addAttribute(AttributeContainer& container, const std::string& attribName) = 0;
};
/**
......@@ -64,7 +64,7 @@ class RegisteredAttribute : public RegisteredBaseAttribute
{
public:
unsigned int addAttribute(AttributeContainer& container, const std::string& attribName)
AttributeMultiVectorGen* addAttribute(AttributeContainer& container, const std::string& attribName)
{
return container.addAttribute<T>(attribName);
}
......
......@@ -31,35 +31,33 @@ inline AttributeHandler<T> AttribMap::addAttribute(unsigned int orbit, const std
if(!isOrbitEmbedded(orbit))
addEmbedding(orbit) ;
AttributeContainer& cellCont = m_attribs[orbit] ;
unsigned int index = cellCont.addAttribute<T>(nameAttr) ;
unsigned int idAttr = AttributeContainer::attrId(orbit, index) ; // assume here that we have less than 16M attributes and 255 orbits!!
return AttributeHandler<T>(this, idAttr) ;
AttributeMultiVector<T>* amv = cellCont.addAttribute<T>(nameAttr) ;
return AttributeHandler<T>(this, amv) ;
}
template <typename T>
inline bool AttribMap::removeAttribute(AttributeHandler<T>& attr)
{
assert(attr.isValid() || !"Invalid attribute handler") ;
unsigned int idAttr = attr.id() ;
return m_attribs[AttributeContainer::orbitAttr(idAttr)].removeAttribute(AttributeContainer::indexAttr(idAttr)) ;
return m_attribs[attr.getOrbit()].removeAttribute(attr.getIndex()) ;
}
template <typename T>
inline AttributeHandler<T> AttribMap::getAttribute(unsigned int orbit, const std::string& nameAttr)
{
assert(isOrbitEmbedded(orbit) || !"Invalid parameter: orbit not embedded");
unsigned int index = m_attribs[orbit].getAttribute(nameAttr) ;
return AttributeHandler<T>(this, AttributeContainer::attrId(orbit, index)) ;
AttributeMultiVector<T>& amv = m_attribs[orbit].getDataVector<T>(nameAttr) ;
return AttributeHandler<T>(this, &amv) ;
}
template <typename T>
inline bool AttribMap::swapAttributes(AttributeHandler<T>& attr1, AttributeHandler<T>& attr2)
{
assert((attr1.isValid() && attr2.isValid()) || !"Invalid attribute handler") ;
assert(AttributeContainer::orbitAttr(attr1.id()) == AttributeContainer::orbitAttr(attr2.id()) || !"Cannot swap attributes of different orbits") ;
unsigned int orbit = AttributeContainer::orbitAttr(attr1.id()) ;
unsigned int index1 = AttributeContainer::indexAttr(attr1.id()) ;
unsigned int index2 = AttributeContainer::indexAttr(attr2.id()) ;
assert(attr1.getOrbit() == attr2.getOrbit() || !"Cannot swap attributes of different orbits") ;
unsigned int orbit = attr1.getOrbit() ;
unsigned int index1 = attr1.getIndex() ;
unsigned int index2 = attr2.getIndex() ;
if(index1 != index2)
return m_attribs[orbit].swapAttributes(index1, index2) ;
return false ;
......@@ -69,10 +67,10 @@ template <typename T>
inline bool AttribMap::copyAttribute(AttributeHandler<T>& dst, AttributeHandler<T>& src)
{
assert((dst.isValid() && src.isValid()) || !"Invalid attribute handler") ;
unsigned int orbit = AttributeContainer::orbitAttr(dst.id()) ;
assert(orbit == AttributeContainer::orbitAttr(src.id()) || !"Cannot copy attributes of different orbits") ;
unsigned int index_dst = AttributeContainer::indexAttr(dst.id()) ;
unsigned int index_src = AttributeContainer::indexAttr(src.id()) ;
unsigned int orbit = dst.getOrbit() ;
assert(orbit == src.getOrbit() || !"Cannot copy attributes of different orbits") ;
unsigned int index_dst = dst.getIndex() ;
unsigned int index_src = src.getIndex() ;
if(index_dst != index_src)
return m_attribs[orbit].copyAttribute(index_dst, index_src) ;
return false ;
......@@ -92,14 +90,13 @@ inline AttributeMultiVector<Dart>* AttribMap::addRelation(const std::string& nam
{
AttributeContainer& cont = m_attribs[DART_ORBIT] ;
unsigned int index = cont.addAttribute<Dart>(name) ;
AttributeMultiVector<Dart>& amv = cont.getDataVector<Dart>(index) ;
AttributeMultiVector<Dart>* amv = cont.addAttribute<Dart>(name) ;
// set new relation to fix point for all the darts of the map
for(unsigned int i = cont.begin(); i < cont.end(); cont.next(i))
amv[i] = i ;
amv->operator[](i) = i ;
return &amv ;
return amv ;
}
} // namespace CGoGN
......@@ -49,24 +49,22 @@ protected:
// we need the map to use dart as index
GenericMap* m_map;
// id of the attribute
unsigned int m_id;
// access to the data
AttributeMultiVector<T>* m_attrib;
protected:
/**
* Constructor
* @param idAttr identifiant of attribute
* @param m the map which belong attribute
* @param orbit orbit of attribute
* @param orbit index of attribute
*/
AttributeHandler(GenericMap* m, unsigned int idAttr) ;
AttributeHandler(GenericMap* m, AttributeMultiVector<T>* amv) ;
public:
typedef T DATA_TYPE ;
AttributeHandler() : m_map(NULL), m_id(AttributeContainer::UNKNOWN), m_attrib(NULL) {}
AttributeHandler() : m_map(NULL), m_attrib(NULL) {}
/**
* Copy constructor
......@@ -96,9 +94,14 @@ public:
AttributeMultiVector<T>* getDataVector() const ;
/**
* get attribute id
* get attribute orbit
*/
unsigned int id() const ;
unsigned int getOrbit() const ;
/**
* get attribute index
*/
unsigned int getIndex() const ;
/**
* get attribute name
......@@ -150,13 +153,13 @@ public:
unsigned int begin() const;
/**
* begin of table
* end of table
* @return the iterator of the end of container
*/
unsigned int end() const;
/**
* Next on iterator (equivalent too stl ++)
* Next on iterator (equivalent to stl ++)
* @param iter iterator to
*/
void next(unsigned int& iter) const;
......
......@@ -26,21 +26,15 @@ namespace CGoGN
{
template <typename T>
AttributeHandler<T>::AttributeHandler(GenericMap* m, unsigned int idAttr):
m_map(m), m_id(idAttr)
AttributeHandler<T>::AttributeHandler(GenericMap* m, AttributeMultiVector<T>* amv):
m_map(m)
{
if(idAttr != AttributeContainer::UNKNOWN)
{
AttributeMultiVector<T>& atm = m_map->getAttributeVector<T>(m_id);
m_attrib = &atm;
}
else
m_attrib = NULL ;
m_attrib = amv ;
}
template <typename T>
AttributeHandler<T>::AttributeHandler(const AttributeHandler<T>& ta):
m_map(ta.m_map), m_id(ta.m_id), m_attrib(ta.m_attrib)
m_map(ta.m_map), m_attrib(ta.m_attrib)
{}
template <typename T>
......@@ -48,7 +42,6 @@ inline void AttributeHandler<T>::operator=(const AttributeHandler<T>& ta)
{
m_map = ta.m_map ;
m_attrib = ta.m_attrib ;
m_id = ta.m_id ;
}
template <typename T>
......@@ -68,31 +61,40 @@ AttributeMultiVector<T>* AttributeHandler<T>::getDataVector() const
}
template <typename T>
unsigned int AttributeHandler<T>::id() const
unsigned int AttributeHandler<T>::getOrbit() const
{
return m_id ;
return m_attrib->getOrbit() ;
}
template <typename T>
unsigned int AttributeHandler<T>::getIndex() const
{
return m_attrib->getIndex() ;
}
template <typename T>
const std::string& AttributeHandler<T>::name() const
{
return m_map->getAttributeContainer(AttributeContainer::orbitAttr(m_id)).getAttributeName(AttributeContainer::indexAttr(m_id)) ;
return m_attrib->getName() ;
}
template <typename T>
bool AttributeHandler<T>::isValid() const
{
return (m_id != AttributeContainer::UNKNOWN) && (m_map != NULL) && (m_attrib != NULL) ;
return (m_attrib->getIndex() != AttributeContainer::UNKNOWN &&
m_map != NULL &&
m_attrib != NULL) ;
}
template <typename T>
inline T& AttributeHandler<T>::operator[](Dart d)
{
assert(isValid() || !"Invalid AttributeHandler") ;
unsigned int a = m_map->getEmbedding(d, AttributeContainer::orbitAttr(m_id));
unsigned int orbit = m_attrib->getOrbit() ;
unsigned int a = m_map->getEmbedding(d, orbit) ;
if (a == EMBNULL)
a = m_map->embedNewCell(AttributeContainer::orbitAttr(m_id), d);
a = m_map->embedNewCell(orbit, d);
return m_attrib->operator[](a);
}
......@@ -101,8 +103,8 @@ template <typename T>
inline const T& AttributeHandler<T>::operator[](Dart d) const
{
assert(isValid() || !"Invalid AttributeHandler") ;
unsigned int a = m_map->getEmbedding(d, AttributeContainer::orbitAttr(m_id));
return m_attrib->operator[](a);
unsigned int a = m_map->getEmbedding(d, m_attrib->getOrbit()) ;
return m_attrib->operator[](a) ;
}
template <typename T>
......@@ -123,7 +125,7 @@ template <typename T>
inline unsigned int AttributeHandler<T>::insert(const T& elt)
{
assert(isValid() || !"Invalid AttributeHandler") ;
unsigned int idx = m_map->getAttributeContainer(AttributeContainer::orbitAttr(m_id)).insertLine();
unsigned int idx = m_map->getAttributeContainer(m_attrib->getOrbit()).insertLine();
m_attrib->operator[](idx) = elt;
return idx;
}
......@@ -132,7 +134,7 @@ template <typename T>
inline unsigned int AttributeHandler<T>::newElt()
{
assert(isValid() || !"Invalid AttributeHandler") ;
unsigned int idx = m_map->getAttributeContainer(AttributeContainer::orbitAttr(m_id)).insertLine();
unsigned int idx = m_map->getAttributeContainer(m_attrib->getOrbit()).insertLine();
return idx;
}
......@@ -140,21 +142,21 @@ template <typename T>
inline unsigned int AttributeHandler<T>::begin() const
{
assert(isValid() || !"Invalid AttributeHandler") ;
return m_map->getAttributeContainer(AttributeContainer::orbitAttr(m_id)).begin();
return m_map->getAttributeContainer(m_attrib->getOrbit()).begin();
}
template <typename T>
inline unsigned int AttributeHandler<T>::end() const
{
assert(isValid() || !"Invalid AttributeHandler") ;
return m_map->getAttributeContainer(AttributeContainer::orbitAttr(m_id)).end();
return m_map->getAttributeContainer(m_attrib->getOrbit()).end();
}
template <typename T>
inline void AttributeHandler<T>::next(unsigned int& iter) const
{
assert(isValid() || !"Invalid AttributeHandler") ;
m_map->getAttributeContainer(AttributeContainer::orbitAttr(m_id)).next(iter);
m_map->getAttributeContainer(m_attrib->getOrbit()).next(iter);
}
} //namespace CGoGN
......@@ -53,10 +53,8 @@ public:
if(!m.isOrbitEmbedded(orbit))
m.addEmbedding(orbit) ;
AttributeContainer& cellCont = this->m_map->m_attribs[orbit] ;
unsigned int index = cellCont.addAttribute<T>(nameAttr) ;
AttributeMultiVector<T>& atm = cellCont.getDataVector<T>(index);
this->m_attrib = &atm;
this->m_id = AttributeContainer::attrId(orbit, index) ;
AttributeMultiVector<T>* amv = cellCont.addAttribute<T>(nameAttr) ;
this->m_attrib = amv ;
}
~AutoAttributeHandler()
......
......@@ -232,17 +232,19 @@ public:
/**
* get a multi vector of attribute (direct access with [i])
* @param idAttr code (orbit+attribute)
* @param orbit orbit of attribute
* @param index index of attribute
*/
template <typename T>
AttributeMultiVector<T>& getAttributeVector(unsigned int idAttr);
AttributeMultiVector<T>& getAttributeVector(unsigned int orbit, unsigned int index);
/**
* get a virtual multi vector of attribute
* No access to data, usefull for access to address (VBO)
* @param idAttr code (orbit+attribute)
* No access to data, useful for access to address (VBO)
* @param orbit orbit of attribute
* @param index index of attribute
*/
AttributeMultiVectorGen& getAttributeVectorGen(unsigned int idAttr);
AttributeMultiVectorGen& getAttributeVectorGen(unsigned int orbit, unsigned int index);
/**
* get a multi vector of marker attribute (direct access with [i])
......@@ -257,7 +259,7 @@ public:
AttributeMultiVector<unsigned int>* getEmbeddingAttributeVector(unsigned int orbit);
/**
*
* swap two attribute containers
*/
void swapEmbeddingContainers(unsigned int orbit1, unsigned int orbit2);
......
......@@ -222,16 +222,16 @@ inline AttributeContainer& GenericMap::getAttributeContainer(unsigned int orbit)
}
template <typename T>
inline AttributeMultiVector<T>& GenericMap::getAttributeVector(unsigned int idAttr)
inline AttributeMultiVector<T>& GenericMap::getAttributeVector(unsigned int orbit, unsigned int index)
{
assert(idAttr != AttributeContainer::UNKNOWN) ;
return m_attribs[AttributeContainer::orbitAttr(idAttr)].getDataVector<T>(AttributeContainer::indexAttr(idAttr)) ;
assert(index != AttributeContainer::UNKNOWN) ;
return m_attribs[orbit].getDataVector<T>(index) ;
}
inline AttributeMultiVectorGen& GenericMap::getAttributeVectorGen(unsigned int idAttr)
inline AttributeMultiVectorGen& GenericMap::getAttributeVectorGen(unsigned int orbit, unsigned int index)
{
assert(idAttr != AttributeContainer::UNKNOWN) ;
return m_attribs[AttributeContainer::orbitAttr(idAttr)].getVirtualDataVector(AttributeContainer::indexAttr(idAttr)) ;
assert(index != AttributeContainer::UNKNOWN) ;
return m_attribs[orbit].getVirtualDataVector(index) ;
}
inline AttributeMultiVector<Mark>* GenericMap::getMarkerVector(unsigned int orbit)
......@@ -248,10 +248,22 @@ inline void GenericMap::swapEmbeddingContainers(unsigned int orbit1, unsigned in
{
assert(orbit1 != orbit2 || !"Cannot swap a container with itself") ;
assert((orbit1 != DART_ORBIT && orbit2 != DART_ORBIT) || !"Cannot swap the darts container") ;
m_attribs[orbit1].swap(m_attribs[orbit2]) ;
AttributeMultiVector<unsigned int>* e1 = m_embeddings[orbit1] ;
m_attribs[orbit1].setOrbit(orbit1) ; // to update the orbit information
m_attribs[orbit2].setOrbit(orbit2) ; // in the contained AttributeMultiVectors
AttributeMultiVector<unsigned int>* e = m_embeddings[orbit1] ;
m_embeddings[orbit1] = m_embeddings[orbit2] ;
m_embeddings[orbit2] = e1 ;
m_embeddings[orbit2] = e ;
AttributeMultiVector<Mark>* m = m_markerTables[orbit1] ;
m_markerTables[orbit1] = m_markerTables[orbit2] ;
m_markerTables[orbit2] = m ;
MarkerSet ms = m_orbMarker[orbit1] ;
m_orbMarker[orbit1] = m_orbMarker[orbit2] ;
m_orbMarker[orbit2] = ms ;
}
/****************************************
......
This diff is collapsed.
......@@ -30,9 +30,8 @@ namespace CGoGN
AttribMap::AttribMap() : GenericMap()
{
AttributeContainer& dartCont = m_attribs[DART_ORBIT] ;
unsigned int mark_index = dartCont.addAttribute<Mark>("Mark") ;
AttributeMultiVector<Mark>& amv = dartCont.getDataVector<Mark>(mark_index) ;
m_markerTables[DART_ORBIT] = &amv ;
AttributeMultiVector<Mark>* amv = dartCont.addAttribute<Mark>("Mark") ;
m_markerTables[DART_ORBIT] = amv ;
}
/****************************************
......@@ -47,18 +46,16 @@ void AttribMap::addEmbedding(unsigned int orbit)
oss << "EMB_" << orbit;