summaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2023-02-28 22:03:39 +0100
committerStanislaw Halik <sthalik@misaki.pl>2023-02-28 22:03:39 +0100
commit51398dfed2c6615aada518d85bf2d6d04f307063 (patch)
tree5f9a6a73865ac04341d28c89bb1a45e415806673 /src
parente24f379bccd1d61f68328e74bce2fef99e935713 (diff)
src/rtee: return whether removing a node succeeded
Diffstat (limited to 'src')
-rw-r--r--src/RTree.h2
-rw-r--r--src/RTree.hpp4
2 files changed, 3 insertions, 3 deletions
diff --git a/src/RTree.h b/src/RTree.h
index 04d84863..0f735ef8 100644
--- a/src/RTree.h
+++ b/src/RTree.h
@@ -78,7 +78,7 @@ public:
/// \param a_min Min of bounding rect
/// \param a_max Max of bounding rect
/// \param a_dataId Positive Id of data. Maybe zero, but negative numbers not allowed.
- void Remove(const ELEMTYPE a_min[NUMDIMS], const ELEMTYPE a_max[NUMDIMS], const DATATYPE& a_dataId);
+ bool Remove(const ELEMTYPE a_min[NUMDIMS], const ELEMTYPE a_max[NUMDIMS], const DATATYPE& a_dataId);
/// Find all within search rectangle
/// \param a_min Min of search bounding rect
diff --git a/src/RTree.hpp b/src/RTree.hpp
index 12b55157..4c0faf6e 100644
--- a/src/RTree.hpp
+++ b/src/RTree.hpp
@@ -185,7 +185,7 @@ void RTREE_QUAL::Insert(const ELEMTYPE a_min[NUMDIMS], const ELEMTYPE a_max[NUMD
RTREE_TEMPLATE
-void RTREE_QUAL::Remove(const ELEMTYPE a_min[NUMDIMS], const ELEMTYPE a_max[NUMDIMS], const DATATYPE& a_dataId)
+bool RTREE_QUAL::Remove(const ELEMTYPE a_min[NUMDIMS], const ELEMTYPE a_max[NUMDIMS], const DATATYPE& a_dataId)
{
#ifdef _DEBUG
for(int index=0; index<NUMDIMS; ++index)
@@ -202,7 +202,7 @@ void RTREE_QUAL::Remove(const ELEMTYPE a_min[NUMDIMS], const ELEMTYPE a_max[NUMD
rect.m_max[axis] = a_max[axis];
}
- RemoveRect(&rect, a_dataId, &m_root);
+ return !RemoveRect(&rect, a_dataId, &m_root);
}