Tonnes.QuadTreeF 1.0.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package Tonnes.QuadTreeF --version 1.0.0
NuGet\Install-Package Tonnes.QuadTreeF -Version 1.0.0
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Tonnes.QuadTreeF" Version="1.0.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Tonnes.QuadTreeF --version 1.0.0
#r "nuget: Tonnes.QuadTreeF, 1.0.0"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install Tonnes.QuadTreeF as a Cake Addin
#addin nuget:?package=Tonnes.QuadTreeF&version=1.0.0

// Install Tonnes.QuadTreeF as a Cake Tool
#tool nuget:?package=Tonnes.QuadTreeF&version=1.0.0

License

QuadTreeF

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

Usage example:

  // Create a new tree
  public void CreateTree() {
    RectangleF bounds = new RectangleF(0, 0, 10, 10); // Bounds/Rectangle of tree
    QuadTree<int> tree = new QuadTree<int>(bounds, 5); // Construct a new QuadTree instance with (0, 0, 10, 10) bounds and max 5 nodes per leaf
  }

  // Add nodes to trees
  public void AddNode(QuadTree<int> tree) { // Adds a node at x: 0, y: 1 with value 100
    tree.Add(0f, 1f, 100); 
    tree.Add(new QuadNode<int>(0f, 1f, 100));
  }

  // Remove nodes from trees
  public void RemoveNode(QuadTree<int> tree) { // Removes node at x: 1, y: 0
    tree.Remove(1f, 0f);
    tree.Remove(new PointF(1f, 0));
  }

  // Get nodes from trees
  public void GetNodes(QuadTree<int> tree) { // Returns null if not found
    QuadNode<int> node = tree.Search(0f, 1f); 
    QuadNode<int> node2 = tree.Search(new PointF(0f, 1f));
  }

  // Check if tree contains a node at point
  public void TreeContainsNode(QuadTree<int> tree) { // Checks if tree contains a note at point x: 0, y: 1
    bool containsNode = tree.Contains(0f, 1f); 
    bool containsNode = tree.Contains(new PointF(0f, 1f));
  }

  // Clear all nodes from tree
  public void ClearTree(QuadTree<int> tree) => tree.Clear(); // Removes all nodes and leafs/branches in tree. Root bounds and max nodes remains.

  // Check equality of two trees
  public bool IsEqual(QuadTree<int> tree, QuadTree<int> tree2) => tree?.Equals(tree2) ?? false;
Product Compatible and additional computed target framework versions.
.NET net5.0 is compatible.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net5.0

    • No dependencies.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on Tonnes.QuadTreeF:

Package Downloads
Tonnes.QuadTreeF.MonoGame

Package Description

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.0.6 445 1/21/2021
1.0.4 352 1/19/2021
1.0.3 352 1/19/2021
1.0.1 665 1/19/2021
1.0.0 362 1/19/2021