Commit 3138f742 authored by Pierre Kraemer's avatar Pierre Kraemer
Browse files

merge cgogn:~jund/CGoGN

parent 911bd5a6
...@@ -48,7 +48,6 @@ void hexahedronToTetrahedron(typename PFP::MAP& map, Dart d); ...@@ -48,7 +48,6 @@ void hexahedronToTetrahedron(typename PFP::MAP& map, Dart d);
* Tetrahedron functions * * Tetrahedron functions *
************************************************************************************************/ ************************************************************************************************/
/** /**
* test if the volume is a tetrahedron * test if the volume is a tetrahedron
* @param map * @param map
...@@ -57,7 +56,6 @@ void hexahedronToTetrahedron(typename PFP::MAP& map, Dart d); ...@@ -57,7 +56,6 @@ void hexahedronToTetrahedron(typename PFP::MAP& map, Dart d);
template <typename PFP> template <typename PFP>
bool isTetrahedron(typename PFP::MAP& the_map, Dart d); bool isTetrahedron(typename PFP::MAP& the_map, Dart d);
/************************************************************************************************ /************************************************************************************************
* Swap Functions * * Swap Functions *
************************************************************************************************/ ************************************************************************************************/
...@@ -101,7 +99,6 @@ Dart swap2To3(typename PFP::MAP& map, Dart d); ...@@ -101,7 +99,6 @@ Dart swap2To3(typename PFP::MAP& map, Dart d);
template <typename PFP> template <typename PFP>
void swap5To4(typename PFP::MAP& the_map, Dart d, typename PFP::TVEC3& positions); void swap5To4(typename PFP::MAP& the_map, Dart d, typename PFP::TVEC3& positions);
/************************************************************************************************ /************************************************************************************************
* Flip Functions * * Flip Functions *
************************************************************************************************/ ************************************************************************************************/
...@@ -112,23 +109,20 @@ void swap5To4(typename PFP::MAP& the_map, Dart d, typename PFP::TVEC3& positions ...@@ -112,23 +109,20 @@ void swap5To4(typename PFP::MAP& the_map, Dart d, typename PFP::TVEC3& positions
template <typename PFP> template <typename PFP>
void flip1To4(typename PFP::MAP& map, Dart d, typename PFP::TVEC3& position); void flip1To4(typename PFP::MAP& map, Dart d, typename PFP::TVEC3& position);
/** /**
* *
*/ */
template <typename PFP> template <typename PFP>
void edgeBisection(typename PFP::MAP& map, Dart d, typename PFP::TVEC3& position); void edgeBisection(typename PFP::MAP& map, Dart d, typename PFP::TVEC3& position);
} // namespace Tetrahedralization
} // namespace Modelisation
} //end namespace Tetrahedralization } // namespace Algo
} //end namespace Modelisation
} //end namespace Algo } // namespace CGoGN
} //end namespace CGoGN
#include "Algo/Modelisation/tetrahedralization.hpp" #include "Algo/Modelisation/tetrahedralization.hpp"
#endif #endif
...@@ -22,8 +22,6 @@ ...@@ -22,8 +22,6 @@
* * * *
*******************************************************************************/ *******************************************************************************/
#include <list>
namespace CGoGN namespace CGoGN
{ {
...@@ -59,16 +57,16 @@ bool isTetrahedron(typename PFP::MAP& the_map, Dart d) ...@@ -59,16 +57,16 @@ bool isTetrahedron(typename PFP::MAP& the_map, Dart d)
{ {
DartMarkerStore mark(the_map); // Lock a marker DartMarkerStore mark(the_map); // Lock a marker
std::list<Dart> visitedFaces; // Faces that are traversed std::vector<Dart> visitedFaces; // Faces that are traversed
visitedFaces.reserve(64) ;
visitedFaces.push_back(d); visitedFaces.push_back(d);
std::list<Dart>::iterator faces;
int nbFaces = 0; // Count the faces unsigned int nbFaces = 0; // Count the faces
//Test the number of faces end its valency //Test the number of faces end its valency
for(faces = visitedFaces.begin() ; faces != visitedFaces.end() ; ++faces) for(unsigned int i = 0; i < visitedFaces.size(); ++i)
{ {
Dart dc = *faces; Dart dc = visitedFaces[i];
//if this dart is not marked //if this dart is not marked
if(!mark.isMarked(dc)) if(!mark.isMarked(dc))
...@@ -201,6 +199,7 @@ void insertFace(typename PFP::MAP& map, Dart d, Dart nF) ...@@ -201,6 +199,7 @@ void insertFace(typename PFP::MAP& map, Dart d, Dart nF)
/*********************************************************************************************** /***********************************************************************************************
* swap functions * * swap functions *
***********************************************************************************************/ ***********************************************************************************************/
//ok //ok
template <typename PFP> template <typename PFP>
void swap2To2(typename PFP::MAP& map, Dart d) void swap2To2(typename PFP::MAP& map, Dart d)
...@@ -335,8 +334,6 @@ void swap3To2(typename PFP::MAP& map, Dart d) ...@@ -335,8 +334,6 @@ void swap3To2(typename PFP::MAP& map, Dart d)
} }
//[precond] le brin doit venir d'une face partagé par 2 tetraèdres //[precond] le brin doit venir d'une face partagé par 2 tetraèdres
// renvoie un brin de l'ancienne couture entre les 2 tetras qui est devenu une arête // renvoie un brin de l'ancienne couture entre les 2 tetras qui est devenu une arête
template <typename PFP> template <typename PFP>
...@@ -404,7 +401,6 @@ void swap5To4(typename PFP::MAP& map, Dart d, typename PFP::TVEC3& positions) ...@@ -404,7 +401,6 @@ void swap5To4(typename PFP::MAP& map, Dart d, typename PFP::TVEC3& positions)
* Flip Functions * * Flip Functions *
************************************************************************************************/ ************************************************************************************************/
template <typename PFP> template <typename PFP>
void flip1To4(typename PFP::MAP& map, Dart d, typename PFP::TVEC3& position) void flip1To4(typename PFP::MAP& map, Dart d, typename PFP::TVEC3& position)
{ {
...@@ -488,8 +484,9 @@ void flip1To4(typename PFP::MAP& map, Dart d, typename PFP::TVEC3& position) ...@@ -488,8 +484,9 @@ void flip1To4(typename PFP::MAP& map, Dart d, typename PFP::TVEC3& position)
} }
/************************************************************************************************ /************************************************************************************************
* Bisection Functions * * Bisection Functions *
************************************************************************************************/ ************************************************************************************************/
template <typename PFP> template <typename PFP>
void edgeBisection(typename PFP::MAP& map, Dart d, typename PFP::TVEC3& position) void edgeBisection(typename PFP::MAP& map, Dart d, typename PFP::TVEC3& position)
{ {
...@@ -558,7 +555,6 @@ void edgeBisection(typename PFP::MAP& map, Dart d, typename PFP::TVEC3& position ...@@ -558,7 +555,6 @@ void edgeBisection(typename PFP::MAP& map, Dart d, typename PFP::TVEC3& position
} }
while(temp != d); while(temp != d);
// if(map.phi3(d) == d) // if(map.phi3(d) == d)
// { // {
// map.splitFace(map.phi_1(d), map.phi1(d)); // map.splitFace(map.phi_1(d), map.phi1(d));
...@@ -631,10 +627,9 @@ void edgeBisection(typename PFP::MAP& map, Dart d, typename PFP::TVEC3& position ...@@ -631,10 +627,9 @@ void edgeBisection(typename PFP::MAP& map, Dart d, typename PFP::TVEC3& position
// temp = map.alpha2(temp); // temp = map.alpha2(temp);
// } // }
// while(temp != d); // while(temp != d);
} }
//
///** ///**
// * create a tetra based on the two triangles that have a common dart and phi2(dart) // * create a tetra based on the two triangles that have a common dart and phi2(dart)
// * return a new dart inside the tetra // * return a new dart inside the tetra
...@@ -675,8 +670,6 @@ void edgeBisection(typename PFP::MAP& map, Dart d, typename PFP::TVEC3& position ...@@ -675,8 +670,6 @@ void edgeBisection(typename PFP::MAP& map, Dart d, typename PFP::TVEC3& position
// the_map.sewFaces(the_map.phi1(e),the_map.phi1(dd)); // the_map.sewFaces(the_map.phi1(e),the_map.phi1(dd));
// the_map.sewFaces(ss2e,the_map.phi3(the_map.phi1(dd))); // the_map.sewFaces(ss2e,the_map.phi3(the_map.phi1(dd)));
// //
//
//
// //embed the coords // //embed the coords
// the_map.setVertexEmb(d,the_map.getVertexEmb(d)); // the_map.setVertexEmb(d,the_map.getVertexEmb(d));
// the_map.setVertexEmb(e,the_map.getVertexEmb(e)); // the_map.setVertexEmb(e,the_map.getVertexEmb(e));
...@@ -876,10 +869,10 @@ void edgeBisection(typename PFP::MAP& map, Dart d, typename PFP::TVEC3& position ...@@ -876,10 +869,10 @@ void edgeBisection(typename PFP::MAP& map, Dart d, typename PFP::TVEC3& position
// return ret; // return ret;
//} //}
} // namespace Tetrahedralization
}//end namespace Tetrahedralization } // namespace Modelisation
}//end namespace Modelisation
}//end namespace Algo
}//end namespace CGoGN
} // namespace Algo
} // namespace CGoGN
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