GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - tonnesr/QuadTreeF: A generic quadtree implementation using float values in C#

BranchesTags
Open more actions menu

Latest commit

 

History

18 Commits
18 Commits

Folders and files

NameName
Last commit message
Last commit date
bin/Debug
bin/Debug
 
 
obj
obj
 
 
src
src
 
 
LICENSE
LICENSE
 
 
QuadTreeF.csproj
QuadTreeF.csproj
 
 
README.md
README.md
 
 

Repository files navigation

License NuGet

QuadTreeF

A generic QuadTree implementation where all nodes are stored in the leafs of the tree, and rectangles plus points are stored as floats.

MonoGame

Extensions for MonoGame can be found here

Usage example

  public void Examples() {
    // Create a new tree
    RectangleF bounds = new RectangleF(0, 0, 10, 10); 
    QuadTree<int> tree = new QuadTree<int>(bounds);

    // Add a node to the tree
    tree.Add(0f, 1f, 100); 
    tree.Add(new QuadNode<int>(0f, 1f, 100));

    // Remove a node from the tree
    tree.Remove(1f, 0f);
    tree.Remove(new PointF(1f, 0));

    // Try to get a node from a tree. Will return null if no node is found
    QuadNode<int> node = tree.Search(0f, 1f);
    QuadNode<int> node2 = tree.Search(new PointF(0f, 1f));

    // Check if the tree contains a node at a point
    bool containsNode = tree.Contains(0f, 1f); 
    bool containsNode2 = tree.Contains(new PointF(0f, 1f));

    // Clear all nodes (+ branches and leafs) from tree
    tree.Clear();

    // Check equality of two trees
    bool equals = tree.Equals(tree2);
  }

Compatibility

About

A generic quadtree implementation using float values in C#

Topics

classlibdotnetquadtree

Resources

Readme
MIT license
Activity

Stars

2 stars

Watchers

1 watching

Forks

0 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.