Commit ddce97d7 authored by Pierre Kraemer's avatar Pierre Kraemer

simplif IN_PARENT ORBITS

parent 46b0188f
......@@ -206,7 +206,7 @@ bool importMRDAT(typename PFP::MAP& map, const std::string& filename, std::vecto
unsigned int emb = qt.verticesID[idx] ;
FunctorSetEmb<typename PFP::MAP, VERTEX> fsetemb(map, emb) ;
map.foreach_dart_of_orbit<VERTEX + PFP::MAP::IN_PARENT>(d, fsetemb) ;
map.foreach_dart_of_orbit<PFP::MAP::VERTEX_OF_PARENT>(d, fsetemb) ;
m.mark(d) ; // mark on the fly to unmark on second loop
vecDartsPerVertex[emb].push_back(d) ; // store incident darts for fast adjacency reconstruction
......
......@@ -80,7 +80,7 @@ bool importMesh(typename PFP::MAP& map, MeshTablesSurface<PFP>& mts)
FunctorSetEmb<typename PFP::MAP, VERTEX> fsetemb(map, em);
// foreach_dart_of_orbit_in_parent<typename PFP::MAP>(&map, VERTEX, d, fsetemb) ;
map.template foreach_dart_of_orbit<VERTEX + PFP::MAP::IN_PARENT>(d, fsetemb);
map.template foreach_dart_of_orbit<PFP::MAP::VERTEX_OF_PARENT>(d, fsetemb);
m.mark(d) ; // mark on the fly to unmark on second loop
vecDartsPerVertex[em].push_back(d); // store incident darts for fast adjacency reconstruction
......@@ -186,14 +186,14 @@ bool importMeshSToV(typename PFP::MAP& map, MeshTablesSurface<PFP>& mts, float d
FunctorSetEmb<typename PFP::MAP, VERTEX> fsetemb(map, em);
//foreach_dart_of_orbit_in_parent<typename PFP::MAP>(&map, VERTEX, d, fsetemb) ;
map.template foreach_dart_of_orbit<VERTEX + PFP::MAP::IN_PARENT>(d, fsetemb);
map.template foreach_dart_of_orbit<PFP::MAP::VERTEX_OF_PARENT>(d, fsetemb);
//Embed the other base face
Dart d2 = map.phi1(map.phi1(map.phi2(d)));
unsigned int em2 = backEdgesBuffer[em];
FunctorSetEmb<typename PFP::MAP, VERTEX> fsetemb2(map, em2);
//foreach_dart_of_orbit_in_parent<typename PFP::MAP>(&map, VERTEX, d2, fsetemb2) ;
map.template foreach_dart_of_orbit<VERTEX + PFP::MAP::IN_PARENT>(d2, fsetemb2);
map.template foreach_dart_of_orbit<PFP::MAP::VERTEX_OF_PARENT>(d2, fsetemb2);
m.mark(d) ; // mark on the fly to unmark on second loop
vecDartsPerVertex[em].push_back(d); // store incident darts for fast adjacency reconstruction
......
......@@ -164,7 +164,7 @@ bool importNodeWithELERegions(typename PFP::MAP& map, const std::string& filenam
for(unsigned int j = 0 ; j < 3 ; ++j)
{
FunctorSetEmb<typename PFP::MAP, VERTEX> fsetemb(map, verticesID[pt[2-j]]);
map.template foreach_dart_of_orbit<VERTEX + PFP::MAP::IN_PARENT>(d, fsetemb);
map.template foreach_dart_of_orbit<PFP::MAP::VERTEX_OF_PARENT>(d, fsetemb);
//store darts per vertices to optimize reconstruction
Dart dd = d;
......@@ -183,7 +183,7 @@ bool importNodeWithELERegions(typename PFP::MAP& map, const std::string& filenam
d = map.phi_1(map.phi2(d));
FunctorSetEmb<typename PFP::MAP, VERTEX> fsetemb(map, verticesID[pt[3]]);
map.template foreach_dart_of_orbit<VERTEX + PFP::MAP::IN_PARENT>(d, fsetemb);
map.template foreach_dart_of_orbit<PFP::MAP::VERTEX_OF_PARENT>(d, fsetemb);
//store darts per vertices to optimize reconstruction
Dart dd = d;
......@@ -225,7 +225,7 @@ bool importNodeWithELERegions(typename PFP::MAP& map, const std::string& filenam
}
else
{
m.unmarkOrbit<FACE + PFP::MAP::IN_PARENT>(d);
m.unmarkOrbit<PFP::MAP::FACE_OF_PARENT>(d);
++nbBoundaryFaces;
}
}
......
......@@ -159,7 +159,7 @@ bool importOFFWithELERegions(typename PFP::MAP& map, const std::string& filename
for(unsigned int j = 0 ; j < 3 ; ++j)
{
FunctorSetEmb<typename PFP::MAP, VERTEX> fsetemb(map, verticesID[pt[2-j]]);
map.template foreach_dart_of_orbit<VERTEX + PFP::MAP::IN_PARENT>(d, fsetemb);
map.template foreach_dart_of_orbit<PFP::MAP::VERTEX_OF_PARENT>(d, fsetemb);
//store darts per vertices to optimize reconstruction
Dart dd = d;
......@@ -178,7 +178,7 @@ bool importOFFWithELERegions(typename PFP::MAP& map, const std::string& filename
d = map.phi_1(map.phi2(d));
FunctorSetEmb<typename PFP::MAP, VERTEX> fsetemb(map, verticesID[pt[3]]);
map.template foreach_dart_of_orbit<VERTEX + PFP::MAP::IN_PARENT>(d, fsetemb);
map.template foreach_dart_of_orbit<PFP::MAP::VERTEX_OF_PARENT>(d, fsetemb);
//store darts per vertices to optimize reconstruction
Dart dd = d;
......@@ -220,7 +220,7 @@ bool importOFFWithELERegions(typename PFP::MAP& map, const std::string& filename
}
else
{
m.template unmarkOrbit<FACE + PFP::MAP::IN_PARENT>(d);
m.template unmarkOrbit<PFP::MAP::FACE_OF_PARENT>(d);
++nbBoundaryFaces;
}
}
......
......@@ -129,7 +129,7 @@ bool importTet(typename PFP::MAP& map, const std::string& filename, std::vector<
for(unsigned int j = 0 ; j < 3 ; ++j)
{
FunctorSetEmb<typename PFP::MAP, VERTEX> fsetemb(map, verticesID[pt[2-j]]);
map.template foreach_dart_of_orbit<VERTEX + PFP::MAP::IN_PARENT>(d, fsetemb);
map.template foreach_dart_of_orbit<PFP::MAP::VERTEX_OF_PARENT>(d, fsetemb);
//store darts per vertices to optimize reconstruction
Dart dd = d;
......@@ -147,7 +147,7 @@ bool importTet(typename PFP::MAP& map, const std::string& filename, std::vector<
d = map.phi_1(map.phi2(d));
FunctorSetEmb<typename PFP::MAP, VERTEX> fsetemb(map, verticesID[pt[3]]);
map.template foreach_dart_of_orbit<VERTEX + PFP::MAP::IN_PARENT>(d, fsetemb);
map.template foreach_dart_of_orbit<PFP::MAP::VERTEX_OF_PARENT>(d, fsetemb);
//store darts per vertices to optimize reconstruction
Dart dd = d;
......@@ -187,7 +187,7 @@ bool importTet(typename PFP::MAP& map, const std::string& filename, std::vector<
}
else
{
m.unmarkOrbit<FACE + PFP::MAP::IN_PARENT>(d);
m.unmarkOrbit<PFP::MAP::FACE_OF_PARENT>(d);
++nbBoundaryFaces;
}
}
......
......@@ -136,7 +136,7 @@ bool importTs(typename PFP::MAP& map, const std::string& filename, std::vector<s
for(unsigned int j = 0 ; j < 3 ; ++j)
{
FunctorSetEmb<typename PFP::MAP, VERTEX> fsetemb(map, verticesID[pt[2-j]]);
map.template foreach_dart_of_orbit<VERTEX + PFP::MAP::IN_PARENT>(d, fsetemb);
map.template foreach_dart_of_orbit<PFP::MAP::VERTEX_OF_PARENT>(d, fsetemb);
//store darts per vertices to optimize reconstruction
Dart dd = d;
......@@ -154,7 +154,7 @@ bool importTs(typename PFP::MAP& map, const std::string& filename, std::vector<s
d = map.phi_1(map.phi2(d));
FunctorSetEmb<typename PFP::MAP, VERTEX> fsetemb(map, verticesID[pt[3]]);
map.template foreach_dart_of_orbit<VERTEX + PFP::MAP::IN_PARENT>(d, fsetemb);
map.template foreach_dart_of_orbit<PFP::MAP::VERTEX_OF_PARENT>(d, fsetemb);
//store darts per vertices to optimize reconstruction
Dart dd = d;
......@@ -194,7 +194,7 @@ bool importTs(typename PFP::MAP& map, const std::string& filename, std::vector<s
}
else
{
m.unmarkOrbit<FACE + PFP::MAP::IN_PARENT>(d);
m.unmarkOrbit<PFP::MAP::FACE_OF_PARENT>(d);
++nbBoundaryFaces;
}
}
......
......@@ -104,13 +104,13 @@ Dart MarchingCube<DataType, Windowing, PFP>::createTriEmb(unsigned int e1, unsi
L_DART d = m_map->newFace(3,false);
FunctorSetEmb<GenericMap, VERTEX> fsetemb(*m_map, e1);
m_map->template foreach_dart_of_orbit<VERTEX + PFP::MAP::IN_PARENT>(d, fsetemb);
m_map->template foreach_dart_of_orbit<PFP::MAP::VERTEX_OF_PARENT>(d, fsetemb);
d = m_map->phi1(d);
fsetemb.changeEmb(e2);
m_map->template foreach_dart_of_orbit<VERTEX + PFP::MAP::IN_PARENT>(d, fsetemb);
m_map->template foreach_dart_of_orbit<PFP::MAP::VERTEX_OF_PARENT>(d, fsetemb);
d = m_map->phi1(d);
fsetemb.changeEmb(e3);
m_map->template foreach_dart_of_orbit<VERTEX + PFP::MAP::IN_PARENT>(d, fsetemb);
m_map->template foreach_dart_of_orbit<PFP::MAP::VERTEX_OF_PARENT>(d, fsetemb);
d = m_map->phi1(d);
return d;
......
......@@ -230,12 +230,10 @@ void CatmullClarkSubdivision(typename PFP::MAP& map, EMBV& attributs, const Func
{
center += attributs[it];
++count ;
// me.unmarkOrbitInParent<typename PFP::MAP>(EDGE, it);
me.unmarkOrbit<EDGE + PFP::MAP::IN_PARENT>(it);
me.unmarkOrbit<PFP::MAP::EDGE_OF_PARENT>(it);
it = map.phi1(it) ;
// me.unmarkOrbitInParent<typename PFP::MAP>(EDGE, it);
me.unmarkOrbit<EDGE + PFP::MAP::IN_PARENT>(it);
me.unmarkOrbit<PFP::MAP::EDGE_OF_PARENT>(it);
it = map.phi1(it) ;
} while(it != d) ;
center /= double(count);
......
......@@ -287,7 +287,7 @@ void catmullClarkVol(typename PFP::MAP& map, EMBV& attributs, const FunctorSelec
if(selected(d) && !mv.isMarked(d))
{
l_vertices.push_back(d);
mv.markOrbit<VERTEX + PFP::MAP::IN_PARENT>(d);
mv.markOrbit<PFP::MAP::VERTEX_OF_PARENT>(d);
}
Dart f = map.phi1(d);
......
......@@ -93,7 +93,7 @@ void ExplodeVolumeRender::updateData(typename PFP::MAP& map, const VertexAttribu
std::vector<VEC3> buffer;
buffer.reserve(16384);
TraversorCell<typename PFP::MAP, FACE + PFP::MAP::IN_PARENT> traFace(map, good);
TraversorCell<typename PFP::MAP, PFP::MAP::FACE_OF_PARENT> traFace(map, good);
for (Dart d = traFace.begin(); d != traFace.end(); d = traFace.next())
{
......@@ -148,7 +148,7 @@ void ExplodeVolumeRender::updateData(typename PFP::MAP& map, const VertexAttribu
buffer.clear();
TraversorCell<typename PFP::MAP, EDGE + PFP::MAP::IN_PARENT> traEdge(map, good);
TraversorCell<typename PFP::MAP, PFP::MAP::EDGE_OF_PARENT> traEdge(map, good);
for (Dart d = traEdge.begin(); d != traEdge.end(); d = traEdge.next())
{
buffer.push_back(centerVolumes[d]);
......@@ -192,7 +192,7 @@ void ExplodeVolumeRender::updateData(typename PFP::MAP& map, const VertexAttribu
if (withColors)
bufferColors.reserve(16384);
TraversorCell<typename PFP::MAP, FACE + PFP::MAP::IN_PARENT> traFace(map, good);
TraversorCell<typename PFP::MAP, PFP::MAP::FACE_OF_PARENT> traFace(map, good);
for (Dart d = traFace.begin(); d != traFace.end(); d = traFace.next())
{
......@@ -247,7 +247,7 @@ void ExplodeVolumeRender::updateData(typename PFP::MAP& map, const VertexAttribu
buffer.clear();
TraversorCell<typename PFP::MAP, EDGE + PFP::MAP::IN_PARENT> traEdge(map, good);
TraversorCell<typename PFP::MAP, PFP::MAP::EDGE_OF_PARENT> traEdge(map, good);
for (Dart d = traEdge.begin(); d != traEdge.end(); d = traEdge.next())
{
buffer.push_back(centerVolumes[d]);
......
......@@ -109,7 +109,7 @@ void Topo3Render::updateDataMap3(typename PFP::MAP& mapx, const VertexAttribute<
unsigned int posDBI=0;
// traverse each face of each volume
TraversorCell<typename PFP::MAP, FACE + PFP::MAP::IN_PARENT> traFace(mapx, allDarts);
TraversorCell<typename PFP::MAP, PFP::MAP::FACE_OF_PARENT> traFace(mapx, allDarts);
for (Dart d = traFace.begin(); d != traFace.end(); d = traFace.next())
{
vecDartFaces.push_back(d);
......@@ -359,7 +359,7 @@ void Topo3Render::updateDataGMap3(typename PFP::MAP& mapx, const VertexAttribute
unsigned int posDBI=0;
//traverse each face of each volume
TraversorCell<typename PFP::MAP, FACE + PFP::MAP::IN_PARENT> traFace(mapx, good);
TraversorCell<typename PFP::MAP, PFP::MAP::FACE_OF_PARENT> traFace(mapx, good);
for (Dart d = traFace.begin(); d != traFace.end(); d = traFace.next())
{
vecDartFaces.push_back(d);
......
......@@ -253,7 +253,7 @@ public:
}
protected:
DartMarkerStore(const DartMarkerStore& dm) : DartMarkerGen(dm),m_markedDarts(dm.m_markedDarts)
DartMarkerStore(const DartMarkerStore& dm) : DartMarkerGen(dm), m_markedDarts(dm.m_markedDarts)
{}
public:
......@@ -341,7 +341,7 @@ public:
{
return m_marker.isMarked(d);
}
FunctorSelect* copy() const { return new SelectorMarked(m_marker);}
FunctorSelect* copy() const { return new SelectorMarked(m_marker); }
};
class SelectorUnmarked : public FunctorSelect
......@@ -354,7 +354,7 @@ public:
{
return !m_marker.isMarked(d);
}
FunctorSelect* copy() const { return new SelectorUnmarked(m_marker);}
FunctorSelect* copy() const { return new SelectorUnmarked(m_marker); }
};
// Functor version (needed for use with foreach_xxx)
......
......@@ -602,17 +602,16 @@ public:
virtual bool foreach_dart_of_vertex(Dart d, FunctorType& f, unsigned int thread = 0) = 0 ;
virtual bool foreach_dart_of_edge(Dart d, FunctorType& f, unsigned int thread = 0) = 0 ;
virtual bool foreach_dart_of_face(Dart d, FunctorType& f, unsigned int thread = 0) { std::cerr<< "Not implemented"<< std::endl; return false;}
virtual bool foreach_dart_of_volume(Dart d, FunctorType& f, unsigned int thread = 0) { std::cerr<< "Not implemented"<< std::endl; return false;}
virtual bool foreach_dart_of_cc(Dart d, FunctorType& f, unsigned int thread = 0) { std::cerr<< "Not implemented"<< std::endl; return false;}
virtual bool foreach_dart_of_face(Dart d, FunctorType& f, unsigned int thread = 0) { std::cerr << "Not implemented" << std::endl; return false; }
virtual bool foreach_dart_of_volume(Dart d, FunctorType& f, unsigned int thread = 0) { std::cerr << "Not implemented" << std::endl; return false; }
virtual bool foreach_dart_of_cc(Dart d, FunctorType& f, unsigned int thread = 0) { std::cerr << "Not implemented" << std::endl; return false; }
virtual bool foreach_dart_of_vertex1(Dart d, FunctorType& f, unsigned int thread = 0) { std::cerr << "Not implemented" << std::endl; return false; }
virtual bool foreach_dart_of_edge1(Dart d, FunctorType& f, unsigned int thread = 0) { std::cerr << "Not implemented" << std::endl; return false; }
virtual bool foreach_dart_of_vertex1(Dart d, FunctorType& f, unsigned int thread = 0) { std::cerr<< "Not implemented"<< std::endl; return false;}
virtual bool foreach_dart_of_edge1(Dart d, FunctorType& f, unsigned int thread = 0) { std::cerr<< "Not implemented"<< std::endl; return false;}
virtual bool foreach_dart_of_vertex2(Dart d, FunctorType& f, unsigned int thread = 0) { std::cerr<< "Not implemented"<< std::endl; return false;}
virtual bool foreach_dart_of_edge2(Dart d, FunctorType& f, unsigned int thread = 0) { std::cerr<< "Not implemented"<< std::endl; return false;}
virtual bool foreach_dart_of_face2(Dart d, FunctorType& f, unsigned int thread = 0) { std::cerr<< "Not implemented"<< std::endl; return false;}
virtual bool foreach_dart_of_vertex2(Dart d, FunctorType& f, unsigned int thread = 0) { std::cerr << "Not implemented" << std::endl; return false; }
virtual bool foreach_dart_of_edge2(Dart d, FunctorType& f, unsigned int thread = 0) { std::cerr << "Not implemented" << std::endl; return false; }
virtual bool foreach_dart_of_face2(Dart d, FunctorType& f, unsigned int thread = 0) { std::cerr << "Not implemented" << std::endl; return false; }
/**
* execute functor for each orbit
......
......@@ -290,7 +290,7 @@ void GenericMap::setDartEmbedding(Dart d, unsigned int emb)
if (emb != EMBNULL)
m_attribs[ORBIT].refLine(emb); // ref the new emb
(*m_embeddings[ORBIT])[dartIndex(d)] = emb ; // finally affect the embedding to the dart
(*m_embeddings[ORBIT])[dartIndex(d)] = emb ; // finally affect the embedding to the dart
}
template <unsigned int ORBIT>
......@@ -519,13 +519,6 @@ bool GenericMap::foreach_dart_of_orbit(Dart d, FunctorType& f, unsigned int thre
{
switch(ORBIT)
{
// case DART: return f(d);
// case VERTEX: return foreach_dart_of_vertex(d, f, thread);
// case EDGE: return foreach_dart_of_edge(d, f, thread);
// case ORIENTED_FACE: return foreach_dart_of_oriented_face(d, f, thread);
// case FACE: return foreach_dart_of_face(d, f, thread);
// case VOLUME: return foreach_dart_of_volume(d, f, thread);
case DART: return f(d);
case VERTEX: return foreach_dart_of_vertex(d, f, thread);
case EDGE: return foreach_dart_of_edge(d, f, thread);
......@@ -536,7 +529,7 @@ bool GenericMap::foreach_dart_of_orbit(Dart d, FunctorType& f, unsigned int thre
case VERTEX2: return foreach_dart_of_vertex2(d, f, thread);
case EDGE2: return foreach_dart_of_edge2(d, f, thread);
case FACE2: return foreach_dart_of_face2(d, f, thread);
default: assert(!"Cells of this dimension are not handled");break;
default: assert(!"Cells of this dimension are not handled"); break;
}
return false;
}
......
......@@ -42,7 +42,6 @@ MarkerForTraversor<MAP, ORBIT>::MarkerForTraversor(MAP& map, bool forceDartMarke
m_dmark = new DartMarkerStore(map, thread) ;
}
template <typename MAP, unsigned int ORBIT>
MarkerForTraversor<MAP, ORBIT>::~MarkerForTraversor()
{
......@@ -200,8 +199,6 @@ Dart Traversor3XY<MAP, ORBX, ORBY>::next()
return m_current ;
}
//*********************************************
// Traversor cellX to cellX adjacent by cell Y
//*********************************************
......@@ -214,10 +211,10 @@ Traversor3XXaY<MAP, ORBX, ORBY>::Traversor3XXaY(MAP& map, Dart dart, bool forceD
mk.mark(dart);
Traversor3XY<MAP, ORBX, ORBY> traAdj(map, dart, forceDartMarker, thread);
for (Dart d = traAdj.begin(); d!=traAdj.end(); d=traAdj.next())
for (Dart d = traAdj.begin(); d != traAdj.end(); d = traAdj.next())
{
Traversor3XY<MAP, ORBY, ORBX> traInci(map, d, mk, forceDartMarker, thread);
for (Dart e = traInci.begin(); e!=traInci.end(); e=traInci.next())
for (Dart e = traInci.begin(); e != traInci.end(); e = traInci.next())
m_vecDarts.push_back(e);
}
m_vecDarts.push_back(NIL);
......@@ -245,7 +242,6 @@ Dart Traversor3XXaY<MAP, ORBX, ORBY>::next()
}
//template<typename MAP>
//Traversor3<MAP>* Traversor3<MAP>::createXY(MAP& map, Dart dart, unsigned int orbX, unsigned int orbY)
//{
......@@ -355,7 +351,4 @@ Dart Traversor3XXaY<MAP, ORBX, ORBY>::next()
// return NULL;
//}
} // namespace CGoGN
......@@ -43,7 +43,7 @@ protected:
public:
typedef GMap1 ParentMap;
inline static unsigned int ORBIT_IN_PARENT(unsigned int o) { return o+5; }
inline static unsigned int ORBIT_IN_PARENT(unsigned int o) { return o+5; }
static const unsigned int IN_PARENT = 5 ;
......
......@@ -43,7 +43,7 @@ protected:
public:
typedef GMap2 ParentMap;
inline static unsigned int ORBIT_IN_PARENT(unsigned int o) { return o+7; }
inline static unsigned int ORBIT_IN_PARENT(unsigned int o) { return o+7; }
inline static unsigned int ORBIT_IN_PARENT2(unsigned int o) { return o+5; }
static const unsigned int IN_PARENT = 7 ;
......
......@@ -55,7 +55,7 @@ protected:
public:
typedef Map1 ParentMap;
inline static unsigned int ORBIT_IN_PARENT(unsigned int o) { return o+5; }
inline static unsigned int ORBIT_IN_PARENT(unsigned int o) { return o+5; }
static const unsigned int IN_PARENT = 5 ;
......
......@@ -57,7 +57,7 @@ protected:
public:
typedef Map2 ParentMap;
inline static unsigned int ORBIT_IN_PARENT(unsigned int o) { return o+7; }
inline static unsigned int ORBIT_IN_PARENT(unsigned int o){ return o+7; }
inline static unsigned int ORBIT_IN_PARENT2(unsigned int o) { return o+5; }
static const unsigned int IN_PARENT = 7 ;
......
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