Création d'un compte pour un collaborateur extérieur au laboratoire depuis l'intranet ICube : https://intranet.icube.unistra.fr/fr/labs/member/profile

Commit a3d64939 by Basile Sauvage

### ajout des diag de Voronoi centroidaux (debut)

parent cbbaa4c7
 ... ... @@ -17,9 +17,8 @@ namespace Geometry template class VoronoiDiagram { private : protected : typedef typename PFP::REAL REAL; typedef typename PFP::VEC3 VEC3; typedef struct { ... ... @@ -53,7 +52,7 @@ public : void computeDiagram (); private : protected : void clear (); void initFrontWithSeeds(); void collectVertexFromFront(Dart e); ... ... @@ -61,6 +60,25 @@ private : void updateVertexInFront(Dart f, float d); }; template class CentroidalVoronoiDiagram : public VoronoiDiagram { private : typedef typename PFP::REAL REAL; VertexAttribute& distances; // distances from the seed VertexAttribute& pathOrigins; // previous vertex on the shortest path from origin public : CentroidalVoronoiDiagram (typename PFP::MAP& m, const EdgeAttribute& c, VertexAttribute& r, VertexAttribute& d, VertexAttribute& o); ~CentroidalVoronoiDiagram (); protected : void clear(); void collectVertexFromFront(Dart e); }; }// end namespace Geometry }// end namespace Algo }// end namespace CGoGN ... ...
 ... ... @@ -7,6 +7,10 @@ namespace Algo namespace Geometry { /*********************************************************** * class VoronoiDiagram ***********************************************************/ template VoronoiDiagram::VoronoiDiagram (typename PFP::MAP& m, const EdgeAttribute& p, VertexAttribute& r) : map(m), edgeCost (p), regions (r), vmReached(m) { ... ... @@ -79,10 +83,10 @@ void VoronoiDiagram::setCost (const EdgeAttribute& c){ template void VoronoiDiagram::collectVertexFromFront(Dart e){ front.erase(vertexInfo[e].it); vertexInfo[e].valid=false; // regions[e] = vertexInfo[e].region; regions[e] = regions[vertexInfo[e].pathOrigin]; front.erase(vertexInfo[e].it); vertexInfo[e].valid=false; } template ... ... @@ -138,6 +142,37 @@ void VoronoiDiagram::computeDiagram () } } /*********************************************************** * class CentroidalVoronoiDiagram ***********************************************************/ template CentroidalVoronoiDiagram::CentroidalVoronoiDiagram (typename PFP::MAP& m, const EdgeAttribute& c, VertexAttribute& r, VertexAttribute& d, VertexAttribute& o) : VoronoiDiagram(m,c,r), distances(d), pathOrigins(o) { } template CentroidalVoronoiDiagram::~CentroidalVoronoiDiagram () { } template void CentroidalVoronoiDiagram::clear () { VoronoiDiagram::clear(); distances.setAllValues(0.0); } template void CentroidalVoronoiDiagram::collectVertexFromFront(Dart e){ distances[e] = this->vertexInfo[e].it->first(); pathOrigins[e] = this->vertexInfo[e].pathOrigin; VoronoiDiagram::collectVertexFromFront(e); } }// end namespace Geometry }// end namespace Algo }// end 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!