Commit 3344bd1e authored by Thomas's avatar Thomas

Merge branch 'master' of cgogn:~kraemer/CGoGN

parents ecb5b2f0 b9185bb7
......@@ -877,8 +877,8 @@ void EdgeSelector_Curvature<PFP>::computeEdgeInfo(Dart d, EdgeInfo& einfo)
MAP& m = this->m_map ;
Dart dd = m.phi2(d) ;
unsigned int v1 = m.getEmbedding(d, VERTEX_ORBIT) ;
unsigned int v2 = m.getEmbedding(dd, VERTEX_ORBIT) ;
unsigned int v1 = m.getEmbedding(VERTEX_ORBIT, d) ;
unsigned int v2 = m.getEmbedding(VERTEX_ORBIT, dd) ;
m_positionApproximator->approximate(d) ;
......
......@@ -220,8 +220,8 @@ void Approximator_MidEdge<PFP>::approximate(Dart d)
// vertex split to reset the initial connectivity and embeddings
m.insertTrianglePair(d, d2, dd2) ;
m.embedOrbit(VERTEX_ORBIT, d, m.getEmbedding(d, VERTEX_ORBIT)) ;
m.embedOrbit(VERTEX_ORBIT, dd, m.getEmbedding(dd, VERTEX_ORBIT)) ;
m.embedOrbit(VERTEX_ORBIT, d, m.getEmbedding(VERTEX_ORBIT, d)) ;
m.embedOrbit(VERTEX_ORBIT, dd, m.getEmbedding(VERTEX_ORBIT, dd)) ;
}
}
......@@ -268,8 +268,8 @@ void Approximator_HalfCollapse<PFP>::approximate(Dart d)
// vertex split to reset the initial connectivity and embeddings
m.insertTrianglePair(d, d2, dd2) ;
m.embedOrbit(VERTEX_ORBIT, d, m.getEmbedding(d, VERTEX_ORBIT)) ;
m.embedOrbit(VERTEX_ORBIT, dd, m.getEmbedding(dd, VERTEX_ORBIT)) ;
m.embedOrbit(VERTEX_ORBIT, d, m.getEmbedding(VERTEX_ORBIT, d)) ;
m.embedOrbit(VERTEX_ORBIT, dd, m.getEmbedding(VERTEX_ORBIT, dd)) ;
}
}
......
......@@ -84,6 +84,13 @@ bool exportCTM(typename PFP::MAP& the_map, const typename PFP::TVEC3& position,
template <typename PFP>
bool exportPLYPTM(typename PFP::MAP& map, const char* filename, const typename PFP::TVEC3& position, const typename PFP::TVEC3 frame[3], const typename PFP::TVEC3 colorPTM[6], const FunctorSelect& good = SelectorTrue()) ;
/**
* export pout l'InESS
*/
template <typename PFP>
bool exportInESS(typename PFP::MAP& map, const char *filename, const typename PFP::TVEC3& position);
} // namespace Export
} // namespace Algo
......
......@@ -71,7 +71,7 @@ bool exportPLY(typename PFP::MAP& map, const typename PFP::TVEC3& position, cons
Dart dd = d ;
do
{
unsigned int vNum = map.getEmbedding(dd, VERTEX_ORBIT) ;
unsigned int vNum = map.getEmbedding(VERTEX_ORBIT, dd) ;
if(!markV.isMarked(dd))
{
markV.mark(dd) ;
......@@ -149,7 +149,7 @@ bool exportOFF(typename PFP::MAP& map, const typename PFP::TVEC3& position, cons
Dart dd = d ;
do
{
unsigned int vNum = map.getEmbedding(dd, VERTEX_ORBIT) ;
unsigned int vNum = map.getEmbedding(VERTEX_ORBIT, dd) ;
if(!markV.isMarked(dd))
{
markV.mark(dd) ;
......@@ -286,7 +286,7 @@ bool exportPLYPTM(typename PFP::MAP& map, const char* filename, const typename P
{
if (!markV.isMarked(e))
{
vertices.push_back(map.getEmbedding(e, VERTEX_ORBIT));
vertices.push_back(map.getEmbedding(VERTEX_ORBIT, e));
tableVertLab[e] = lab++;
markV.mark(e);
......@@ -434,7 +434,7 @@ bool exportPLYPTM(typename PFP::MAP& map, const char* filename, const typename P
{
if (!markV.isMarked(e))
{
vertices.push_back(map.getEmbedding(e, VERTEX_ORBIT));
vertices.push_back(map.getEmbedding(VERTEX_ORBIT, e));
tableVertLab[e] = lab++;
markV.mark(e);
......@@ -515,6 +515,23 @@ bool exportPLYPTM(typename PFP::MAP& map, const char* filename, const typename P
return true ;
}*/
template <typename PFP>
bool exportInESS(typename PFP::MAP& map, const char *filename, const typename PFP::TVEC3& position)
{
typedef typename PFP::MAP MAP;
typedef typename PFP::VEC3 VEC3;
std::ofstream out(filename, std::ios::out) ;
if (!out.good())
{
CGoGNerr << "Unable to open file " << CGoGNendl ;
return false ;
}
}
} // namespace Export
} // namespace Algo
......
......@@ -94,17 +94,17 @@ public:
virtual void next(Dart& d) ;
virtual bool foreach_dart_of_vertex(Dart d, FunctorType& f) ;
virtual bool foreach_dart_of_vertex(Dart d, FunctorType& f, unsigned int thread = 0) ;
virtual bool foreach_dart_of_edge(Dart d, FunctorType& f) ;
virtual bool foreach_dart_of_edge(Dart d, FunctorType& f, unsigned int thread = 0) ;
bool foreach_dart_of_oriented_face(Dart d, FunctorType& f);
virtual bool foreach_dart_of_face(Dart d, FunctorType& f) ;
bool foreach_dart_of_oriented_face(Dart d, FunctorType& f, unsigned int thread = 0);
virtual bool foreach_dart_of_face(Dart d, FunctorType& f, unsigned int thread = 0) ;
bool foreach_dart_of_oriented_volume(Dart d, FunctorType& f);
virtual bool foreach_dart_of_volume(Dart d, FunctorType& f) ;
bool foreach_dart_of_oriented_volume(Dart d, FunctorType& f, unsigned int thread = 0);
virtual bool foreach_dart_of_volume(Dart d, FunctorType& f, unsigned int thread = 0) ;
virtual bool foreach_dart_of_cc(Dart d, FunctorType& f) ;
virtual bool foreach_dart_of_cc(Dart d, FunctorType& f, unsigned int thread = 0) ;
/***************************************************
* MAP MANIPULATION *
......
......@@ -160,7 +160,7 @@ inline void ImplicitHierarchicalMap::next(Dart& d)
} while(d != Map2::end() && m_dartLevel[d] > m_curLevel) ;
}
inline bool ImplicitHierarchicalMap::foreach_dart_of_vertex(Dart d, FunctorType& f)
inline bool ImplicitHierarchicalMap::foreach_dart_of_vertex(Dart d, FunctorType& f, unsigned int thread)
{
Dart dNext = d;
do
......@@ -172,7 +172,7 @@ inline bool ImplicitHierarchicalMap::foreach_dart_of_vertex(Dart d, FunctorType&
return false;
}
inline bool ImplicitHierarchicalMap::foreach_dart_of_edge(Dart d, FunctorType& f)
inline bool ImplicitHierarchicalMap::foreach_dart_of_edge(Dart d, FunctorType& f, unsigned int thread)
{
if (f(d))
return true;
......@@ -184,7 +184,7 @@ inline bool ImplicitHierarchicalMap::foreach_dart_of_edge(Dart d, FunctorType& f
return false;
}
inline bool ImplicitHierarchicalMap::foreach_dart_of_oriented_face(Dart d, FunctorType& f)
inline bool ImplicitHierarchicalMap::foreach_dart_of_oriented_face(Dart d, FunctorType& f, unsigned int thread)
{
Dart dNext = d ;
do
......@@ -196,12 +196,12 @@ inline bool ImplicitHierarchicalMap::foreach_dart_of_oriented_face(Dart d, Funct
return false ;
}
inline bool ImplicitHierarchicalMap::foreach_dart_of_face(Dart d, FunctorType& f)
inline bool ImplicitHierarchicalMap::foreach_dart_of_face(Dart d, FunctorType& f, unsigned int thread)
{
return foreach_dart_of_oriented_face(d, f) ;
}
inline bool ImplicitHierarchicalMap::foreach_dart_of_oriented_volume(Dart d, FunctorType& f)
inline bool ImplicitHierarchicalMap::foreach_dart_of_oriented_volume(Dart d, FunctorType& f, unsigned int thread)
{
DartMarkerStore mark(*this); // Lock a marker
bool found = false; // Last functor return value
......@@ -237,12 +237,12 @@ inline bool ImplicitHierarchicalMap::foreach_dart_of_oriented_volume(Dart d, Fun
return found;
}
inline bool ImplicitHierarchicalMap::foreach_dart_of_volume(Dart d, FunctorType& f)
inline bool ImplicitHierarchicalMap::foreach_dart_of_volume(Dart d, FunctorType& f, unsigned int thread)
{
return foreach_dart_of_oriented_volume(d, f) ;
}
inline bool ImplicitHierarchicalMap::foreach_dart_of_cc(Dart d, FunctorType& f)
inline bool ImplicitHierarchicalMap::foreach_dart_of_cc(Dart d, FunctorType& f, unsigned int thread)
{
return foreach_dart_of_oriented_volume(d, f) ;
}
......@@ -258,8 +258,8 @@ inline void ImplicitHierarchicalMap::splitFace(Dart d, Dart e)
{
unsigned int cur = m_curLevel ;
m_curLevel = m_maxLevel ;
this->embedOrbit(FACE_ORBIT, d, this->getDartEmbedding(FACE_ORBIT, d)) ;
this->embedOrbit(FACE_ORBIT, e, this->getDartEmbedding(FACE_ORBIT, e)) ;
this->embedOrbit(FACE_ORBIT, d, this->getEmbedding(FACE_ORBIT, d)) ;
this->embedOrbit(FACE_ORBIT, e, this->getEmbedding(FACE_ORBIT, e)) ;
m_curLevel = cur ;
}
}
......@@ -345,7 +345,7 @@ T& AttributeHandler_IHM<T>::operator[](Dart d)
unsigned int orbit = this->getOrbit() ;
unsigned int nbSteps = m->m_curLevel - m->vertexInsertionLevel(d) ;
unsigned int index = m->getEmbedding(d, orbit) ;
unsigned int index = m->getEmbedding(orbit, d) ;
if(index == EMBNULL)
{
......@@ -381,7 +381,7 @@ const T& AttributeHandler_IHM<T>::operator[](Dart d) const
unsigned int orbit = this->getOrbit() ;
unsigned int nbSteps = m->m_curLevel - m->vertexInsertionLevel(d) ;
unsigned int index = m->getEmbedding(d, orbit) ;
unsigned int index = m->getEmbedding(orbit, d) ;
unsigned int step = 0 ;
while(step < nbSteps)
......
......@@ -106,17 +106,17 @@ public:
virtual void next(Dart& d) ;
virtual bool foreach_dart_of_vertex(Dart d, FunctorType& f) ;
virtual bool foreach_dart_of_vertex(Dart d, FunctorType& f, unsigned int thread = 0) ;
virtual bool foreach_dart_of_edge(Dart d, FunctorType& f) ;
virtual bool foreach_dart_of_edge(Dart d, FunctorType& f, unsigned int thread = 0) ;
bool foreach_dart_of_oriented_face(Dart d, FunctorType& f);
virtual bool foreach_dart_of_face(Dart d, FunctorType& f) ;
bool foreach_dart_of_oriented_face(Dart d, FunctorType& f, unsigned int thread = 0);
virtual bool foreach_dart_of_face(Dart d, FunctorType& f, unsigned int thread = 0) ;
bool foreach_dart_of_oriented_volume(Dart d, FunctorType& f);
virtual bool foreach_dart_of_volume(Dart d, FunctorType& f) ;
bool foreach_dart_of_oriented_volume(Dart d, FunctorType& f, unsigned int thread = 0);
virtual bool foreach_dart_of_volume(Dart d, FunctorType& f, unsigned int thread = 0) ;
virtual bool foreach_dart_of_cc(Dart d, FunctorType& f) ;
virtual bool foreach_dart_of_cc(Dart d, FunctorType& f, unsigned int thread = 0) ;
/****************************************************
......
......@@ -238,7 +238,7 @@ inline void ImplicitHierarchicalMap3::next(Dart& d)
} while(d != Map3::end() && m_dartLevel[d] > m_curLevel) ;
}
inline bool ImplicitHierarchicalMap3::foreach_dart_of_vertex(Dart d, FunctorType& f)
inline bool ImplicitHierarchicalMap3::foreach_dart_of_vertex(Dart d, FunctorType& f, unsigned int thread)
{
DartMarkerStore mv(*this); // Lock a marker
bool found = false; // Last functor return value
......@@ -276,7 +276,7 @@ inline bool ImplicitHierarchicalMap3::foreach_dart_of_vertex(Dart d, FunctorType
return found;
}
inline bool ImplicitHierarchicalMap3::foreach_dart_of_edge(Dart d, FunctorType& f)
inline bool ImplicitHierarchicalMap3::foreach_dart_of_edge(Dart d, FunctorType& f, unsigned int thread)
{
Dart dNext = d;
......@@ -296,7 +296,7 @@ inline bool ImplicitHierarchicalMap3::foreach_dart_of_edge(Dart d, FunctorType&
return false;
}
inline bool ImplicitHierarchicalMap3::foreach_dart_of_oriented_face(Dart d, FunctorType& f)
inline bool ImplicitHierarchicalMap3::foreach_dart_of_oriented_face(Dart d, FunctorType& f, unsigned int thread)
{
Dart dNext = d ;
do
......@@ -308,7 +308,7 @@ inline bool ImplicitHierarchicalMap3::foreach_dart_of_oriented_face(Dart d, Func
return false ;
}
inline bool ImplicitHierarchicalMap3::foreach_dart_of_face(Dart d, FunctorType& f)
inline bool ImplicitHierarchicalMap3::foreach_dart_of_face(Dart d, FunctorType& f, unsigned int thread)
{
if (foreach_dart_of_oriented_face(d,f)) return true;
......@@ -317,7 +317,7 @@ inline bool ImplicitHierarchicalMap3::foreach_dart_of_face(Dart d, FunctorType&
return false;
}
inline bool ImplicitHierarchicalMap3::foreach_dart_of_oriented_volume(Dart d, FunctorType& f)
inline bool ImplicitHierarchicalMap3::foreach_dart_of_oriented_volume(Dart d, FunctorType& f, unsigned int thread)
{
DartMarkerStore mark(*this); // Lock a marker
bool found = false; // Last functor return value
......@@ -353,12 +353,12 @@ inline bool ImplicitHierarchicalMap3::foreach_dart_of_oriented_volume(Dart d, Fu
return found;
}
inline bool ImplicitHierarchicalMap3::foreach_dart_of_volume(Dart d, FunctorType& f)
inline bool ImplicitHierarchicalMap3::foreach_dart_of_volume(Dart d, FunctorType& f, unsigned int thread)
{
return foreach_dart_of_oriented_volume(d, f) ;
}
inline bool ImplicitHierarchicalMap3::foreach_dart_of_cc(Dart d, FunctorType& f)
inline bool ImplicitHierarchicalMap3::foreach_dart_of_cc(Dart d, FunctorType& f, unsigned int thread)
{
return foreach_dart_of_oriented_volume(d, f) ;
}
......@@ -628,7 +628,7 @@ T& AttributeHandler_IHM<T>::operator[](Dart d)
unsigned int orbit = this->getOrbit() ;
unsigned int nbSteps = m->m_curLevel - m->vertexInsertionLevel(d) ;
unsigned int index = m->getEmbedding(d, orbit) ;
unsigned int index = m->getEmbedding(orbit, d) ;
if(index == EMBNULL)
{
......@@ -664,7 +664,7 @@ const T& AttributeHandler_IHM<T>::operator[](Dart d) const
unsigned int orbit = this->getOrbit() ;
unsigned int nbSteps = m->m_curLevel - m->vertexInsertionLevel(d) ;
unsigned int index = m->getEmbedding(d, orbit) ;
unsigned int index = m->getEmbedding(orbit, d) ;
unsigned int step = 0 ;
while(step < nbSteps)
......
......@@ -286,7 +286,7 @@ void subdivideVolume(typename PFP::MAP& map, Dart d, typename PFP::TVEC3& positi
map.unsewFaces(map.phi1(map.phi1(e)));
//TODO utile ?
if(map.phi2(map.phi1(e)) != map.phi1(e))
//if(map.phi2(map.phi1(e)) != map.phi1(e))
map.unsewFaces(map.phi1(e));
e = map.phi2(map.phi_1(e));
......
......@@ -72,7 +72,7 @@ template <typename PFP>
bool importTs(typename PFP::MAP& the_map, const std::string& filename, std::vector<std::string>& attrNames, float scaleFactor = 1.0f);
template <typename PFP>
bool importInESSSurfacique(typename PFP::MAP& the_map, const std::string& filename, std::vector<std::string>& attrNames);
bool importInESSSurfacique(typename PFP::MAP& the_map, const std::string& filename, std::vector<std::string>& attrNames, std::vector<std::pair<typename PFP::VEC3, typename PFP::VEC3> >& influences);
template <typename PFP>
bool importInESSVolumique(typename PFP::MAP& the_map, const std::string& filename, std::vector<std::string>& attrNames);
......
This diff is collapsed.
......@@ -96,11 +96,11 @@ bool importMesh(typename PFP::MAP& map, MeshTablesSurface<PFP>& mts)
// darts incident to end vertex of edge
std::vector<Dart>& vec = vecDartsPerVertex[map.phi1(d)];
unsigned int embd = map.getDartEmbedding(VERTEX_ORBIT, d);
unsigned int embd = map.getEmbedding(VERTEX_ORBIT, d);
Dart good_dart;
for (typename std::vector<Dart>::iterator it = vec.begin(); it != vec.end() && good_dart == Dart::nil(); ++it)
{
if (map.getDartEmbedding(VERTEX_ORBIT, map.phi1(*it)) == embd)
if (map.getEmbedding(VERTEX_ORBIT, map.phi1(*it)) == embd)
good_dart = *it;
}
......@@ -260,14 +260,14 @@ bool importMesh(typename PFP::MAP& map, MeshTablesVolume<PFP>& mtv)
std::vector<Dart>& vec = vecDartsPerVertex[map.phi1(d)];
//Phi3 reconstruction
unsigned int emb1d = map.getDartEmbedding(VERTEX_ORBIT, map.phi_1(d));
unsigned int emb2d = map.getDartEmbedding(VERTEX_ORBIT, map.phi1(map.phi1(d)));
unsigned int emb1d = map.getEmbedding(VERTEX_ORBIT, map.phi_1(d));
unsigned int emb2d = map.getEmbedding(VERTEX_ORBIT, map.phi1(map.phi1(d)));
for (typename std::vector<Dart>::iterator it = vec.begin(); it != vec.end(); ++it)
{
Dart dprim=*it;
unsigned int emb1dprim = map.getDartEmbedding(VERTEX_ORBIT, map.phi1(map.phi1(dprim)));
unsigned int emb2dprim = map.getDartEmbedding(VERTEX_ORBIT, map.phi_1(dprim));
unsigned int emb1dprim = map.getEmbedding(VERTEX_ORBIT, map.phi1(map.phi1(dprim)));
unsigned int emb2dprim = map.getEmbedding(VERTEX_ORBIT, map.phi_1(dprim));
if(emb1d == emb1dprim && emb2d == emb2dprim)
{
......@@ -276,14 +276,14 @@ bool importMesh(typename PFP::MAP& map, MeshTablesVolume<PFP>& mtv)
}
//Phi2 reconstruction
emb1d = map.getDartEmbedding(VERTEX_ORBIT, d);
emb2d = map.getDartEmbedding(VERTEX_ORBIT, map.phi1(d));
emb1d = map.getEmbedding(VERTEX_ORBIT, d);
emb2d = map.getEmbedding(VERTEX_ORBIT, map.phi1(d));
for (typename std::vector<Dart>::iterator it = vec.begin(); it != vec.end(); ++it)
{
Dart dprim=*it;
unsigned int emb1dprim = map.getDartEmbedding(VERTEX_ORBIT, map.phi1(dprim));
unsigned int emb2dprim = map.getDartEmbedding(VERTEX_ORBIT, dprim);
unsigned int emb1dprim = map.getEmbedding(VERTEX_ORBIT, map.phi1(dprim));
unsigned int emb2dprim = map.getEmbedding(VERTEX_ORBIT, dprim);
if(emb1d == emb1dprim && emb2d == emb2dprim)
{
......@@ -295,8 +295,6 @@ bool importMesh(typename PFP::MAP& map, MeshTablesVolume<PFP>& mtv)
}
}
return true ;
//
......@@ -387,7 +385,7 @@ bool importMesh(typename PFP::MAP& map, MeshTablesVolume<PFP>& mtv)
// // darts incident to end vertex of edge
// std::vector<Dart>& vec = vecDartsPerVertex[map.phi1(d)];
//
// unsigned int embd = map.getDartEmbedding(VERTEX_ORBIT, d);
// unsigned int embd = map.getEmbedding(VERTEX_ORBIT, d);
// unsigned int nbf = 0;
// Dart good_dart = d;
//
......@@ -395,7 +393,7 @@ bool importMesh(typename PFP::MAP& map, MeshTablesVolume<PFP>& mtv)
//
// for(typename std::vector<Dart>::iterator it = vec.begin(); it != vec.end(); ++it)
// {
// if (map.getDartEmbedding(VERTEX_ORBIT, map.phi1(*it)) == embd)
// if (map.getEmbedding(VERTEX_ORBIT, map.phi1(*it)) == embd)
// {
// good_dart = *it;
// nbf++;
......@@ -520,12 +518,12 @@ bool importMesh(typename PFP::MAP& map, const std::string& filename, std::vector
// // darts incident to end vertex of edge
// std::vector<Dart>& vec = vecDartsPerVertex[map.phi1(d)];
//
// unsigned int embd = map.getDartEmbedding(VERTEX_ORBIT, d);
// unsigned int embd = map.getEmbedding(VERTEX_ORBIT, d);
// unsigned int nbf=0;
// Dart good_dart;
// for (typename std::vector<Dart>::iterator it = vec.begin(); it != vec.end(); ++it)
// {
// if ( map.getDartEmbedding(VERTEX_ORBIT,map.phi1(*it))==embd)
// if ( map.getEmbedding(VERTEX_ORBIT,map.phi1(*it))==embd)
// {
// good_dart = *it;
// nbf++;
......@@ -566,7 +564,7 @@ bool importMesh(typename PFP::MAP& map, const std::string& filename, std::vector
//// typename std::vector<Dart>::iterator jt = vd.begin();
//// while (!map.isMarkedDart(*jt, m))
//// jt++;
//// unsigned int P = map.getDartEmbedding(VERTEX_ORBIT, *jt);
//// unsigned int P = map.getEmbedding(VERTEX_ORBIT, *jt);
//// // while vertex if a "non manifold point"
//// while (vecEmbNbFp[index] > 1)
//// {
......@@ -576,9 +574,9 @@ bool importMesh(typename PFP::MAP& map, const std::string& filename, std::vector
//// {
//// e = map.phi1(e);
//// // embedding of boundary darts on the fly
//// unsigned int emb = map.getDartEmbedding(VERTEX_ORBIT, map.phi1(map.phi2(e)));
//// unsigned int emb = map.getEmbedding(VERTEX_ORBIT, map.phi1(map.phi2(e)));
//// map.setDartEmbedding(VERTEX_ORBIT, e, emb);
//// } while (map.getDartEmbedding(VERTEX_ORBIT, map.phi2(e)) != P);
//// } while (map.getEmbedding(VERTEX_ORBIT, map.phi2(e)) != P);
//// // separate the face
//// map.phi1sew(map.phi2(*jt), e);
//// vecEmbNbFp[index]--;
......@@ -586,11 +584,11 @@ bool importMesh(typename PFP::MAP& map, const std::string& filename, std::vector
//// // copy embedding of vertex of boundary of last face
//// Dart e = map.phi2(*jt);
//// Dart d = e;
//// if (map.getDartEmbedding(VERTEX_ORBIT, d) == EMBNULL)
//// if (map.getEmbedding(VERTEX_ORBIT, d) == EMBNULL)
//// {
//// do
//// {
//// unsigned int emb = map.getDartEmbedding(VERTEX_ORBIT, map.phi1(map.phi2(d)));
//// unsigned int emb = map.getEmbedding(VERTEX_ORBIT, map.phi1(map.phi2(d)));
//// map.setDartEmbedding(VERTEX_ORBIT, d, emb);
//// d = map.phi1(d);
//// } while (d != e);
......
......@@ -206,7 +206,7 @@ public:
* @param y nb of quads in y
* @return the dart
*/
Dart grid_topo(int x, int y);
Dart grid_topo(unsigned int x, unsigned int y);
/**
* Create a subdivided (surface) cylinder
......
......@@ -178,7 +178,7 @@ Dart Polyhedron<PFP>::createOrientedPrism(typename PFP::MAP& the_map)
Dart top = the_map.newOrientedFace(3);
the_map.sewFaces(top,the_map.phi1(the_map.phi1(side1)));
the_map.sewFaces(the_map.phi_1(top),the_map.phi1(the_map.phi1(side2)));
the_map.sewFaces(the_map.phi1(the_map.phi1(top)),the_map.phi1(the_map.phi1(side3)));
the_map.sewFaces(the_map.phi1(top),the_map.phi1(the_map.phi1(side3)));
return base;
}
......@@ -202,7 +202,7 @@ Dart Polyhedron<PFP>::createOrientedPolyhedron(typename PFP::MAP& the_map, int n
}
template <typename PFP>
Dart Polyhedron<PFP>::grid_topo(int x, int y)
Dart Polyhedron<PFP>::grid_topo(unsigned int x, unsigned int y)
{
if (m_kind != NONE) return m_dart;
......@@ -216,29 +216,30 @@ Dart Polyhedron<PFP>::grid_topo(int x, int y)
m_tableVertDarts.reserve(nb);
// creation of quads and storing vertices
for (int i=0;i<y;++i)
for (unsigned int i = 0; i < y; ++i)
{
for (int j=1;j<=x;++j)
for (unsigned int j = 1; j <= x; ++j)
{
Dart d = m_map.newFace(4);
m_tableVertDarts.push_back(d);
if (j==x)
if (j == x)
m_tableVertDarts.push_back(m_map.phi1(d));
}
}
// store last row of vertices
for (int i=0;i<x;++i)
for (unsigned int i = 0; i < x; ++i)
{
m_tableVertDarts.push_back( m_map.phi_1(m_tableVertDarts[(y-1)*(x+1) + i]) );
}
m_tableVertDarts.push_back( m_map.phi1(m_tableVertDarts[(y-1)*(x+1) +x]) );
//sewing the quads
for (int i=0;i<y;++i)
for (unsigned int i = 0; i < y; ++i)
{
for (int j=0;j<x;++j)
for (unsigned int j = 0; j < x; ++j)
{
if (i>0) // sew with preceeding row
if (i > 0) // sew with preceeding row
{
int pos = i*(x+1)+j;
Dart d = m_tableVertDarts[pos];
......@@ -246,7 +247,7 @@ Dart Polyhedron<PFP>::grid_topo(int x, int y)
e = m_map.phi1(m_map.phi1(e));
m_map.sewFaces(d,e);
}
if (j>0) // sew with preceeding column
if (j > 0) // sew with preceeding column
{
int pos = i*(x+1)+j;
Dart d = m_tableVertDarts[pos];
......
......@@ -37,9 +37,9 @@ namespace Modelisation
namespace Tetrahedron
{
/***********************************************************************************************
* Tetrahedron functions *
***********************************************************************************************/
/************************************************************************************************
* Tetrahedron functions *
************************************************************************************************/
/**
......@@ -51,25 +51,25 @@ template <typename PFP>
bool isTetrahedron(typename PFP::MAP& the_map, Dart d);
/***********************************************************************************************
* Swap Functions *
***********************************************************************************************/
/************************************************************************************************
* Swap Functions *
************************************************************************************************/
/**
* Swap a configuration of 2 Tetrahedron to another one
* @param map
* @param d
* @param d a dart from the face between the two tetahedron to swap
*
* TODO ajouter image
*/
template <typename PFP>
void swap2To2(typename PFP::MAP& the_map, Dart d, typename PFP::TVEC3& positions);
void swap2To2(typename PFP::MAP& map, Dart d);
/**
*
*/
template <typename PFP>
void swap4To4(typename PFP::MAP& the_map, Dart d, typename PFP::TVEC3& positions);
void swap4To4(typename PFP::MAP& map, Dart d);
/**
* Swap a configuration of 3 tetrahedron to another one with 2 tetrahedron
......@@ -80,14 +80,13 @@ void swap4To4(typename PFP::MAP& the_map, Dart d, typename PFP::TVEC3& positions
*
*/
template <typename PFP>
void swap3To2(typename PFP::MAP& the_map, Dart d, typename PFP::TVEC3& positions);
void swap3To2(typename PFP::MAP& map, Dart d);
/**
*
*/
template <typename PFP>
void swap2To3(typename PFP::MAP& the_map, Dart d, typename PFP::TVEC3& positions);
Dart swap2To3(typename PFP::MAP& map, Dart d);
/**
*
......@@ -95,6 +94,28 @@ void swap2To3(typename PFP::MAP& the_map, Dart d, typename PFP::TVEC3& positions
template <typename PFP>
void swap5To4(typename PFP::MAP& the_map, Dart d, typename PFP::TVEC3& positions);
/************************************************************************************************
* Flip Functions *