Revision: 73958
http://sourceforge.net/p/brlcad/code/73958
Author: starseeker
Date: 2019-09-18 19:55:32 +0000 (Wed, 18 Sep 2019)
Log Message:
-----------
Start thinking about how to use the openNURBS logic for getting overlapping
boxes from two rtrees to identify what we have to check for overlaps. Will
want to refactor their implementation into the version we're actually using
(and make sure it works the way we expect/need, or adjust it if it doesn't)
Modified Paths:
--------------
brlcad/trunk/src/libbrep/RTree.h
Modified: brlcad/trunk/src/libbrep/RTree.h
===================================================================
--- brlcad/trunk/src/libbrep/RTree.h 2019-09-18 17:44:41 UTC (rev 73957)
+++ brlcad/trunk/src/libbrep/RTree.h 2019-09-18 19:55:32 UTC (rev 73958)
@@ -102,6 +102,9 @@
/// \return Returns the number of entries found
int Search(const Element& a_min, const Element& a_max,
std::function<bool(const DataType&, void *)> callback, void *a_context) const;
+ // Find the overlapping leaves between this rtree and another rtree
+ bool Overlaps(RTree &other, double tolerance, std::function<bool(const
DataType&, const DataType&, void *)> callback, void *a_context);
+
/// Remove all entries from tree
void RemoveAll();
@@ -1643,6 +1646,16 @@
}
+
+// Based on the idea from the openNURBS code to search two R-trees for all
pairs elements whose bounding boxes overlap.
+RTREE_TEMPLATE
+bool RTREE_QUAL::Overlaps(RTree &other, double tolerance,
std::function<bool(const DataType&, const DataType&, void *)> callback, void
*a_context)
+{
+ if (!m_root || !other.m_root) return false;
+ if (tolerance < 0) return false;
+ return true;
+}
+
#undef RTREE_TEMPLATE
#undef RTREE_QUAL
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
_______________________________________________
BRL-CAD Source Commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/brlcad-commits