diff --git a/CGoGN/include/Algo/Selection/collector.h b/CGoGN/include/Algo/Selection/collector.h index a4d09b39f12493753f460a1af8746fd402a55536..0abfc86849d761dffe9e2918654722d967b5acc0 100644 --- a/CGoGN/include/Algo/Selection/collector.h +++ b/CGoGN/include/Algo/Selection/collector.h @@ -481,7 +481,7 @@ protected: typedef struct { - typename std::multimap::iterator it ; + typename std::multimap::iterator it; bool valid ; static std::string CGoGNnameOfType() { return "DijkstraVertexInfo" ; } } DijkstraVertexInfo ; @@ -489,7 +489,7 @@ protected: VertexAttribute vertexInfo ; - std::multimap front ; + std::multimap front; public: Collector_Dijkstra_Vertices(MAP& m, const EdgeAttribute& c, REAL d = 0) : @@ -532,7 +532,7 @@ protected: typedef struct { - typename std::multimap::iterator it ; + typename std::multimap::iterator it; bool valid ; static std::string CGoGNnameOfType() { return "DijkstraVertexInfo" ; } } DijkstraVertexInfo ; @@ -540,7 +540,7 @@ protected: VertexAttribute vertexInfo ; - std::multimap front ; + std::multimap front; public: Collector_Dijkstra(MAP& m, const VertexAttribute& p, REAL d = 0) : @@ -563,7 +563,7 @@ public: void collectBorder(Dart d); private : - inline float edgeLength (Dart d); + inline REAL edgeLength(Dart d); // inline Dart oppositeVertex (Dart d); }; diff --git a/CGoGN/include/Algo/Selection/collector.hpp b/CGoGN/include/Algo/Selection/collector.hpp index f3c8188bae9ec6f95384d947ccf1fecb1e66475e..b9844b9a56f23c26b7d95cfdcdd5947cb7cb73f9 100644 --- a/CGoGN/include/Algo/Selection/collector.hpp +++ b/CGoGN/include/Algo/Selection/collector.hpp @@ -948,14 +948,14 @@ void Collector_Dijkstra_Vertices::collectAll(Dart dinit) this->isInsideCollected = true; CellMarkerStore vmReached (this->map); - vertexInfo[this->centerDart].it = front.insert(std::pair(0.0, this->centerDart)); + vertexInfo[this->centerDart].it = front.insert(std::pair(0.0f, this->centerDart)); vertexInfo[this->centerDart].valid = true; vmReached.mark(this->centerDart); while ( !front.empty() && front.begin()->first < this->maxDist) { Dart e = front.begin()->second; - float d = front.begin()->first; + REAL d = front.begin()->first; front.erase(vertexInfo[e].it); vertexInfo[e].valid=false; this->insideVertices.push_back(e); @@ -968,17 +968,17 @@ void Collector_Dijkstra_Vertices::collectAll(Dart dinit) { if (vi.valid) // probably useless (because of distance test) but faster { - float dist = d + edge_cost[f]; + REAL dist = d + edge_cost[f]; if (dist < vi.it->first) { front.erase(vi.it); - vi.it = front.insert(std::pair(dist, f)); + vi.it = front.insert(std::pair(dist, f)); } } } else { - vi.it = front.insert(std::pair(d + edge_cost[f], f)); + vi.it = front.insert(std::pair(d + edge_cost[f], f)); vi.valid=true; vmReached.mark(f); } @@ -1033,14 +1033,14 @@ void Collector_Dijkstra_Vertices::collectBorder(Dart dinit) init(dinit); CellMarkerStore vmReached (this->map); - vertexInfo[this->centerDart].it = front.insert(std::pair(0.0, this->centerDart)); + vertexInfo[this->centerDart].it = front.insert(std::pair(0.0f, this->centerDart)); vertexInfo[this->centerDart].valid = true; vmReached.mark(this->centerDart); while ( !front.empty() && front.begin()->first < this->maxDist) { Dart e = front.begin()->second; - float d = front.begin()->first; + REAL d = front.begin()->first; front.erase(vertexInfo[e].it); vertexInfo[e].valid=false; this->insideVertices.push_back(e); @@ -1053,17 +1053,17 @@ void Collector_Dijkstra_Vertices::collectBorder(Dart dinit) { if (vi.valid) // probably useless (because of distance test) but faster { - float dist = d + edge_cost[f]; + REAL dist = d + edge_cost[f]; if (dist < vi.it->first) { front.erase(vi.it); - vi.it = front.insert(std::pair(dist, f)); + vi.it = front.insert(std::pair(dist, f)); } } } else { - vi.it = front.insert(std::pair(d + edge_cost[f], f)); + vi.it = front.insert(std::pair(d + edge_cost[f], f)); vi.valid = true; vmReached.mark(f); } @@ -1107,14 +1107,14 @@ void Collector_Dijkstra::collectAll(Dart dinit) this->isInsideCollected = true; CellMarkerStore vmReached (this->map); - vertexInfo[this->centerDart].it = front.insert(std::pair(0.0, this->centerDart)); + vertexInfo[this->centerDart].it = front.insert(std::pair(0.0f, this->centerDart)); vertexInfo[this->centerDart].valid = true; vmReached.mark(this->centerDart); while ( !front.empty() && front.begin()->first < this->maxDist) { Dart e = front.begin()->second; - float d = front.begin()->first; + REAL d = front.begin()->first; front.erase(vertexInfo[e].it); vertexInfo[e].valid=false; this->insideVertices.push_back(e); @@ -1127,17 +1127,17 @@ void Collector_Dijkstra::collectAll(Dart dinit) { if (vi.valid) // probably useless (because of distance test) but faster { - float dist = d + edgeLength(f); + REAL dist = d + edgeLength(f); if (dist < vi.it->first) { front.erase(vi.it); - vi.it = front.insert(std::pair(dist, f)); + vi.it = front.insert(std::pair(dist, f)); } } } else { - vi.it = front.insert(std::pair(d + edgeLength(f), f)); + vi.it = front.insert(std::pair(d + edgeLength(f), f)); vi.valid = true; vmReached.mark(f); } @@ -1190,14 +1190,14 @@ void Collector_Dijkstra::collectBorder(Dart dinit) init(dinit); CellMarkerStore vmReached (this->map); - vertexInfo[this->centerDart].it = front.insert(std::pair(0.0, this->centerDart)); + vertexInfo[this->centerDart].it = front.insert(std::pair(0.0f, this->centerDart)); vertexInfo[this->centerDart].valid = true; vmReached.mark(this->centerDart); while ( !front.empty() && front.begin()->first < this->maxDist) { Dart e = front.begin()->second; - float d = front.begin()->first; + REAL d = front.begin()->first; front.erase(vertexInfo[e].it); vertexInfo[e].valid=false; this->insideVertices.push_back(e); @@ -1210,17 +1210,17 @@ void Collector_Dijkstra::collectBorder(Dart dinit) { if (vi.valid) // probably useless (because of distance test) but faster { - float dist = d + edgeLength(f); + REAL dist = d + edgeLength(f); if (dist < vi.it->first) { front.erase(vi.it); - vi.it = front.insert(std::pair(dist, f)); + vi.it = front.insert(std::pair(dist, f)); } } } else { - vi.it = front.insert(std::pair(d + edgeLength(f), f)); + vi.it = front.insert(std::pair(d + edgeLength(f), f)); vi.valid = true; vmReached.mark(f); } @@ -1255,7 +1255,7 @@ void Collector_Dijkstra::collectBorder(Dart dinit) } template -inline float Collector_Dijkstra::edgeLength (Dart d) +inline typename PFP::REAL Collector_Dijkstra::edgeLength(Dart d) { typename PFP::VEC3 v = Algo::Geometry::vectorOutOfDart(this->map, d, this->position); return v.norm();