Skip to content

Loose Quadtree (Region Tree) simple C++11 implementation

License

Notifications You must be signed in to change notification settings

alexv-ds/loose_quadtree

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

39 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

loose_quadtree

CI codecov GitHub GitHub tag (with filter)

Loose Quadtree (Region Tree) simple C++11 implementation


Loose quadtree (unlike normal quadtrees which are for points only) is a region tree designed to store bounding boxes effectively. See boost::geometry::index::rtree for a more advanced, general solution!

This implementation features:

  • Fully adaptive behavior, adjusts its bounds, height and memory on demand
  • Every object will be stored on the level to which its size corresponds to
  • Gives theoretically optimal search results (see previous)
  • Uses tree structure instead of hashed (smaller memory footprint, cache friendly)
  • Uses as much data in-place as it can (by using its own allocator)
  • Allocates memory in big chunks
  • Uses axis-aligned bounding boxes for calculations
  • Uses left-top-width-height bounds for better precision (no right-bottom)
  • Uses left-top closed right-bottom open interval logic (for integral types)
  • Uses X-towards-right Y-towards-bottom screen-like coordinate system
  • It is suitable for both floating- and fixed-point logic
  • This library is not thread-safe but multiple queries can be run at once
  • Generic parameters are:
    • NumberT generic number type allows its floating- and fixed-point usage
    • ObjectT* only pointer is stored, no object copying is done, not an inclusive container
    • BoundingBoxExtractorT allows using your own bounding box type/source (see code)

Update 2024.05 (v2.0.0)

  • Fully rewritten cmake project
  • Rewritten tests using the Catch2 library
  • Continuous integration into github-actions has been set up
  • Added analysis of code coverage by tests using gcovr
  • Added valgrind memcheck
  • Fixed corrupted iterator assertions by MSVC
  • Fixed MSVC warnings
  • Fixed memory leak in BlockAllocator
  • Refactoring CamelCase into sneak_case

License

MIT. See LICENSE file

About

Loose Quadtree (Region Tree) simple C++11 implementation

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • C++ 68.3%
  • CMake 31.7%