Questions tagged [quadtree]

A quadtree is a geometric data structure for storing points in two-dimensional space. Quadtrees recursively partition a space into four quadrants.

380 questions
0
votes
3 answers

How Can You Clear a Quad Tree Without Recursion ( using queue maybe? )

Ok given a class along the lines of class quadTree { short level; Vec2f midpoint; quadTree * nodes[4] = { NULL, NULL, NULL, NULL}; public: void newPartition() { float j = fWIDTH / 2 ^ level; float k = fHEIGHT / 2 ^ level; nodes[0] = new…
PhobicHD
  • 60
  • 10
0
votes
1 answer

Quadtree and size of region in constructor

I was reading nice tutorial about Quadtree from this site and now is my question. When I create quadtree I have to pass in constructor bounds of the screen, well What if my map's size 10000 x 10000px and game screen is 1280 x 720px, what should I…
Maj0r
  • 65
  • 1
  • 1
  • 4
0
votes
1 answer

postgresql: implementation of hierarchical tree

I have been struggling with marker-clustering problem with 1000+ markers (that should be put on a Google map). I am not very keen on rendering large JSON structures with all the markers, neither I am fond of some complex server "geo"-computations…
clime
  • 8,695
  • 10
  • 61
  • 82
0
votes
1 answer

Count quadtree quadrants number

I'm using a point quadtree and i need know how i can count the number of quadrants generated after insert the points on a quadtree?
julio
  • 1
0
votes
1 answer

Error inserting a specific vallue on a Dot Quadtree

First of all, sorry if the code it's huge there. I'll try to modularize to make it simple. Second, it's a strange error, so I've used a intuitive main with the example, if anyone want to test it. I want it to insert dots on a Quadtree that represent…
Breno Santos
  • 174
  • 1
  • 3
  • 12
0
votes
0 answers

Pre-emptive collisions with LibGdx

My current entity engine uses a quadtree that loops through all the Entities (an Array) and then checks for collisions using a libgdx Rectangle instance that every entity has. My QuadTree (Its pretty long so i figured id just link to it) In the…
Aman
  • 86
  • 1
  • 6
0
votes
1 answer

Web service for location data

I'm trying to design a web service on Heroku that collects GPS locations from many people in regular time intervals. Apart of keeping track of each person's location at any particular moment, I'd also like to be able to query who's within a certain…
Luke
  • 1,053
  • 2
  • 16
  • 26
0
votes
0 answers

Quadtree and kd-tree splitting and mandelbrot set?

I've read about a quadtree or kd-tree splitting and a mandelbrot set but what when the rectangle before the first split and the frame lies in the mandelbrot set or has the same iteration depth and the algorithm returns from tiling? How can I force…
Micromega
  • 12,486
  • 7
  • 35
  • 72
0
votes
1 answer

Querying quadtree causes overflow

I want to be able to inspect all elements in a quadtree that are contained in nodes that are intersected by a region. The problem though is if I call Query on a section that is as small as only having a height of 2 a stack overflow occurs. What is a…
Casey
  • 10,297
  • 11
  • 59
  • 88
0
votes
1 answer

Changing a struct value within a function with c++

I wanted to create a quick quadtree in c++ but found that when I change a value of a struct within a function the value reverts. Also within the recursive function I wont some of the data created to be global. How do I do this? #include…
josh247
  • 155
  • 1
  • 13
0
votes
2 answers

Utilising interfaces for polymorphism in C#

By way of an intro, I'm creating a basic Quadtree engine for personal learning purposes. I'm wanting this engine to have the capability of working with many different types of shapes (at the moment I'm going with circles and squares) that will all…
Djentleman
  • 1,137
  • 5
  • 13
  • 28
0
votes
1 answer

Plotting quadtree outline in gnuplot

I have a quadtree like structure in my code, which I want to visualise in gnuplot. This means I want to see the rectangular subdivisions. The reason why I would like to have this in gnuplot is because I want to plot a 2d function over this outline…
Ben Ruijl
  • 4,973
  • 3
  • 31
  • 44
0
votes
1 answer

best tree wavelet packet for python

I have a question related to wavelet packet decomposition. I need to compute a best tree(basis) from complete (full) tree (quad-tree). This can be done by MATLAB's function besttree. Unfortunately, I can't use m-files in my program. I write my…
-1
votes
1 answer

Weird issue with a quadtree implementation in C++

Below is the script for the quadtree... I'm relatively new to the concept of pointers, so my guess is that I have done something wrong with a double pointer, or something along those lines! #include "BoidQuadTree.h" #include…
-1
votes
1 answer

Trying to find leaf nodes in a Quadtree (C++)

I am making a Quadtree in C++. I need to find the leaf nodes of the tree. To do this I have this function that needs to return a vector of the leaf nodes. For now everything else seems to work, but this function doesn't and I don't understand…