Commit 818e0d50 authored by Thery Sylvain's avatar Thery Sylvain

Merge branch 'master' of cgogn.u-strasbg.fr:~kraemer/CGoGN

parents 50ccee4a 6ad82bac
......@@ -46,6 +46,10 @@ int main(int argc, char **argv)
void MyQT::createMap()
{
// creation of a new attribute on vertices of type 3D vector for position.
// a handler to this attribute is returned
position = myMap.addAttribute<VEC3, VERTEX>("position");
// creation of 2 new faces: 1 triangle and 1 square
Dart d1 = myMap.newFace(3);
Dart d2 = myMap.newFace(4);
......@@ -53,10 +57,6 @@ void MyQT::createMap()
// sew these faces along one of their edge
myMap.sewFaces(d1, d2);
// creation of a new attribute on vertices of type 3D vector for position.
// a handler to this attribute is returned
position = myMap.addAttribute<VEC3, VERTEX>("position");
// affect position by moving in the map
position[d1] = VEC3(0, 0, 0);
position[PHI1(d1)] = VEC3(2, 0, 0);
......
......@@ -561,8 +561,11 @@ inline Dart GenericMap::begin() const
if (m_isMultiRes)
{
unsigned int d = m_mrattribs.begin() ;
while (getDartLevel(d) > m_mrCurrentLevel)
m_mrattribs.next(d) ;
if(d != m_mrattribs.end())
{
while (getDartLevel(d) > m_mrCurrentLevel)
m_mrattribs.next(d) ;
}
return Dart::create(d) ;
}
......
......@@ -39,6 +39,11 @@ class EmbeddedMap2 : public Map2
public:
typedef Map2 TOPO_MAP;
/*
*
*/
virtual Dart newFace(unsigned int nbEdges, bool withBoundary = true) ;
/**
* The attributes attached to the old vertex are duplicated on both resulting vertices
*/
......
......@@ -30,6 +30,35 @@
namespace CGoGN
{
Dart EmbeddedMap2::newFace(unsigned int nbEdges, bool withBoundary)
{
Dart d = Map2::newFace(nbEdges, withBoundary);
if(withBoundary)
{
if (isOrbitEmbedded<VERTEX>())
{
Traversor2FV<EmbeddedMap2> t(*this, d);
for(Dart it = t.begin(); it != t.end(); it = t.next())
initOrbitEmbeddingNewCell<VERTEX>(it) ;
}
if(isOrbitEmbedded<EDGE>())
{
Traversor2FE<EmbeddedMap2> t(*this, d);
for(Dart it = t.begin(); it != t.end(); it = t.next())
initOrbitEmbeddingNewCell<EDGE>(it) ;
}
if(isOrbitEmbedded<FACE>())
{
initOrbitEmbeddingNewCell<FACE>(d) ;
initOrbitEmbeddingNewCell<FACE>(phi2(d)) ;
}
}
return d ;
}
void EmbeddedMap2::splitVertex(Dart d, Dart e)
{
Dart dd = phi2(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