Commit c9120b7a authored by Basile Sauvage's avatar Basile Sauvage
Browse files

complements dans diag de Voronoi centroidaux

parent a3d64939
...@@ -53,9 +53,9 @@ public : ...@@ -53,9 +53,9 @@ public :
void computeDiagram (); void computeDiagram ();
protected : protected :
void clear (); virtual void clear ();
void initFrontWithSeeds(); void initFrontWithSeeds();
void collectVertexFromFront(Dart e); virtual void collectVertexFromFront(Dart e);
void addVertexToFront(Dart f, float d); void addVertexToFront(Dart f, float d);
void updateVertexInFront(Dart f, float d); void updateVertexInFront(Dart f, float d);
}; };
......
...@@ -70,7 +70,6 @@ void VoronoiDiagram<PFP>::initFrontWithSeeds () ...@@ -70,7 +70,6 @@ void VoronoiDiagram<PFP>::initFrontWithSeeds ()
vmReached.mark(d); vmReached.mark(d);
vertexInfo[d].it = front.insert(std::pair<float,Dart>(0.0, d)); vertexInfo[d].it = front.insert(std::pair<float,Dart>(0.0, d));
vertexInfo[d].valid = true; vertexInfo[d].valid = true;
// vertexInfo[d].region = i;
regions[d] = i; regions[d] = i;
vertexInfo[d].pathOrigin = d; vertexInfo[d].pathOrigin = d;
} }
...@@ -83,7 +82,6 @@ void VoronoiDiagram<PFP>::setCost (const EdgeAttribute<typename PFP::REAL>& c){ ...@@ -83,7 +82,6 @@ void VoronoiDiagram<PFP>::setCost (const EdgeAttribute<typename PFP::REAL>& c){
template <typename PFP> template <typename PFP>
void VoronoiDiagram<PFP>::collectVertexFromFront(Dart e){ void VoronoiDiagram<PFP>::collectVertexFromFront(Dart e){
// regions[e] = vertexInfo[e].region;
regions[e] = regions[vertexInfo[e].pathOrigin]; regions[e] = regions[vertexInfo[e].pathOrigin];
front.erase(vertexInfo[e].it); front.erase(vertexInfo[e].it);
vertexInfo[e].valid=false; vertexInfo[e].valid=false;
...@@ -94,7 +92,6 @@ void VoronoiDiagram<PFP>::addVertexToFront(Dart f, float d){ ...@@ -94,7 +92,6 @@ void VoronoiDiagram<PFP>::addVertexToFront(Dart f, float d){
VertexInfo& vi (vertexInfo[f]); VertexInfo& vi (vertexInfo[f]);
vi.it = front.insert(std::pair<float,Dart>(d + edgeCost[f], f)); vi.it = front.insert(std::pair<float,Dart>(d + edgeCost[f], f));
vi.valid=true; vi.valid=true;
// vi.region = regions[map.phi2(f)];
vi.pathOrigin = map.phi2(f); vi.pathOrigin = map.phi2(f);
vmReached.mark(f); vmReached.mark(f);
} }
...@@ -107,7 +104,6 @@ void VoronoiDiagram<PFP>::updateVertexInFront(Dart f, float d){ ...@@ -107,7 +104,6 @@ void VoronoiDiagram<PFP>::updateVertexInFront(Dart f, float d){
{ {
front.erase(vi.it); front.erase(vi.it);
vi.it = front.insert(std::pair<float,Dart>(dist, f)); vi.it = front.insert(std::pair<float,Dart>(dist, f));
// vi.region = regions[map.phi2(f)];
vi.pathOrigin = map.phi2(f); vi.pathOrigin = map.phi2(f);
} }
} }
...@@ -166,7 +162,7 @@ void CentroidalVoronoiDiagram<PFP>::clear () ...@@ -166,7 +162,7 @@ void CentroidalVoronoiDiagram<PFP>::clear ()
template <typename PFP> template <typename PFP>
void CentroidalVoronoiDiagram<PFP>::collectVertexFromFront(Dart e){ void CentroidalVoronoiDiagram<PFP>::collectVertexFromFront(Dart e){
distances[e] = this->vertexInfo[e].it->first(); distances[e] = this->vertexInfo[e].it->first;
pathOrigins[e] = this->vertexInfo[e].pathOrigin; pathOrigins[e] = this->vertexInfo[e].pathOrigin;
VoronoiDiagram<PFP>::collectVertexFromFront(e); VoronoiDiagram<PFP>::collectVertexFromFront(e);
......
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