diff --git a/CHANGELOG b/CHANGELOG index 167bf000..90753c8d 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -20,6 +20,7 @@ Current head (v.1.2 RC) - [spatialPartitioning] Fix potential compilation issues in KnnGraph (#111) - [spatialPartitioning] Fix debug macros in KnnGraphRangeQuery (#121) - [fitting] Fix sphere fit eigen solver (#112) + - [spatialPartitioning] Improve kdtree to_string to output data in YAML format (#125) -Docs - [fitting] Clarify documentation on FIT_RESULT (#108) diff --git a/Ponca/src/SpatialPartitioning/KdTree/kdTree.h b/Ponca/src/SpatialPartitioning/KdTree/kdTree.h index 57cdecca..572cebd8 100644 --- a/Ponca/src/SpatialPartitioning/KdTree/kdTree.h +++ b/Ponca/src/SpatialPartitioning/KdTree/kdTree.h @@ -186,7 +186,7 @@ class KdTreeBase Converter c); inline bool valid() const; - inline std::string to_string() const; + inline std::string to_string(bool verbose = false) const; // Accessors --------------------------------------------------------------- public: diff --git a/Ponca/src/SpatialPartitioning/KdTree/kdTree.hpp b/Ponca/src/SpatialPartitioning/KdTree/kdTree.hpp index 0ace85f2..e0f746f4 100644 --- a/Ponca/src/SpatialPartitioning/KdTree/kdTree.hpp +++ b/Ponca/src/SpatialPartitioning/KdTree/kdTree.hpp @@ -95,30 +95,51 @@ bool KdTreeBase::valid() const } template -std::string KdTreeBase::to_string() const +std::string KdTreeBase::to_string(bool verbose) const { - if (m_indices.empty()) return ""; - std::stringstream str; - str << "indices (" << index_count() << ") :\n"; - for(IndexType i=0; i