From c7d55f1dd628b533d3698431530cb43aead60684 Mon Sep 17 00:00:00 2001 From: Amael Marquez Date: Tue, 12 Dec 2023 14:36:35 +0100 Subject: [PATCH 1/2] [SpatialPartitioning] Improve kdtree to_string --- Ponca/src/SpatialPartitioning/KdTree/kdTree.h | 2 +- .../src/SpatialPartitioning/KdTree/kdTree.hpp | 47 ++++++++++++++----- 2 files changed, 35 insertions(+), 14 deletions(-) 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 Date: Tue, 12 Dec 2023 14:57:29 +0100 Subject: [PATCH 2/2] Update CHANGELOG --- CHANGELOG | 1 + 1 file changed, 1 insertion(+) 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)