Commit 49f3fe2c authored by untereiner's avatar untereiner
Browse files

correction d'un pb de reserve de vector

parent 51620456
...@@ -748,7 +748,7 @@ Dart subdivideVolume(typename PFP::MAP& map, Dart d, typename PFP::TVEC3& positi ...@@ -748,7 +748,7 @@ Dart subdivideVolume(typename PFP::MAP& map, Dart d, typename PFP::TVEC3& positi
//test si la face est triangulaire ou non //test si la face est triangulaire ou non
if(map.phi1(map.phi1(map.phi1(d))) == d) if(map.phi1(map.phi1(map.phi1(d))) == d)
{ {
std::cout << "trian" << std::endl; //std::cout << "trian" << std::endl;
Dart cf = map.phi2(map.phi1(d)); Dart cf = map.phi2(map.phi1(d));
Dart e = cf; Dart e = cf;
do do
...@@ -759,7 +759,7 @@ Dart subdivideVolume(typename PFP::MAP& map, Dart d, typename PFP::TVEC3& positi ...@@ -759,7 +759,7 @@ Dart subdivideVolume(typename PFP::MAP& map, Dart d, typename PFP::TVEC3& positi
} }
else else
{ {
std::cout << "quad" << std::endl; //std::cout << "quad" << std::endl;
Dart cf = map.phi1(d); Dart cf = map.phi1(d);
Dart e = cf; Dart e = cf;
do do
......
...@@ -236,6 +236,20 @@ public: ...@@ -236,6 +236,20 @@ public:
*/ */
void insertTrianglePair(Dart d, Dart v1, Dart v2) ; void insertTrianglePair(Dart d, Dart v1, Dart v2) ;
/**
* Unsew opposite edges from the faces around a vertex
* \warning Darts may have
* @param d a dart from the vertex
*/
void unsewAroundVertex(Dart d) ;
/**
* Unsex the Umbrella aroud a vertex, close the hole and then
* create a symetric to construct a polyedron
* @param d a dart from the vertex
*/
void explodPolyhedron(Dart d);
//! Merge two volumes along two faces. //! Merge two volumes along two faces.
/*! Works only if the two faces have the same number of edges. /*! Works only if the two faces have the same number of edges.
* The faces adjacent to the two given faces are pairwise phi2-linked * The faces adjacent to the two given faces are pairwise phi2-linked
......
...@@ -230,7 +230,6 @@ public: ...@@ -230,7 +230,6 @@ public:
*/ */
virtual Dart cutSpike(Dart d); virtual Dart cutSpike(Dart d);
//! //!
/* /*
* *
......
...@@ -172,7 +172,6 @@ unsigned int ImplicitHierarchicalMap3::volumeLevel(Dart d) ...@@ -172,7 +172,6 @@ unsigned int ImplicitHierarchicalMap3::volumeLevel(Dart d)
{ {
assert(m_dartLevel[d] <= m_curLevel || !"Access to a dart introduced after current level") ; assert(m_dartLevel[d] <= m_curLevel || !"Access to a dart introduced after current level") ;
if(m_curLevel == 0) if(m_curLevel == 0)
return 0 ; return 0 ;
...@@ -182,7 +181,7 @@ unsigned int ImplicitHierarchicalMap3::volumeLevel(Dart d) ...@@ -182,7 +181,7 @@ unsigned int ImplicitHierarchicalMap3::volumeLevel(Dart d)
DartMarkerStore mark(*this); // Lock a marker DartMarkerStore mark(*this); // Lock a marker
std::vector<Dart> visitedFaces; // Faces that are traversed std::vector<Dart> visitedFaces; // Faces that are traversed
visitedFaces.reserve(16); visitedFaces.reserve(512);
visitedFaces.push_back(d); // Start with the face of d visitedFaces.push_back(d); // Start with the face of d
std::vector<Dart>::iterator face; std::vector<Dart>::iterator face;
...@@ -265,6 +264,7 @@ unsigned int ImplicitHierarchicalMap3::volumeLevel(Dart d) ...@@ -265,6 +264,7 @@ unsigned int ImplicitHierarchicalMap3::volumeLevel(Dart d)
if(!mark.isMarked(ee)) // not already marked if(!mark.isMarked(ee)) // not already marked
{ {
visitedFaces.push_back(ee) ; visitedFaces.push_back(ee) ;
std::cout << "brin ajoute = " << ee << std::endl;
mark.markOrbit(FACE, ee) ; mark.markOrbit(FACE, ee) ;
} }
e = phi1(e) ; e = phi1(e) ;
...@@ -541,9 +541,11 @@ bool ImplicitHierarchicalMap3::neighborhoodLevelDiffersByOne(Dart d) ...@@ -541,9 +541,11 @@ bool ImplicitHierarchicalMap3::neighborhoodLevelDiffersByOne(Dart d)
{ {
// add all face neighbours to the table // add all face neighbours to the table
if(phi3(e) != e && (abs(volumeLevel(phi3(e)) - vLevel) > 1)) if(phi3(e) != e)
{ {
found = true; Dart old = volumeOldestDart(phi3(e));
if((abs(volumeLevel(old) - vLevel) > 1))
found = true;
} }
Dart ee = phi2(e) ; Dart ee = phi2(e) ;
......
...@@ -298,6 +298,40 @@ void Map2::insertTrianglePair(Dart d, Dart v1, Dart v2) ...@@ -298,6 +298,40 @@ void Map2::insertTrianglePair(Dart d, Dart v1, Dart v2)
phi2sew(phi1(d), vv1) ; phi2sew(phi1(d), vv1) ;
} }
void Map2::unsewAroundVertex(Dart d)
{
Dart e = d;
do
{
Dart temp = phi1(e);
Dart e_1 = phi_1(e);
do
{
unsewFaces(temp);
temp = phi1(temp);
}while(temp != e_1);
e = alpha1(e);
}
while(e != d);
}
void Map2::explodPolyhedron(Dart d)
{
unsewAroundVertex(d);
closeHole(phi1(d));
//Recherche du (ou un des) sommet oppose
//tourner autour du sommet
//si quad alors sommet oppose
//
//si pas de quad alors un sommet du trian
//
}
bool Map2::mergeVolumes(Dart d, Dart e) bool Map2::mergeVolumes(Dart d, Dart e)
{ {
// First traversal of both faces to check the face sizes // First traversal of both faces to check the face sizes
......
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