-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathQuadTree.h
28 lines (25 loc) · 867 Bytes
/
QuadTree.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#ifndef QuadTree_H_INCLUDED
#define QuadTree_H_INCLUDED
#include "NoQuad.h"
#include "Cidade.h"
class QuadTree
{
public:
QuadTree();
~QuadTree();
bool vazia();
bool busca(float X, float Y);
void insere(Cidade *Cidade);
void imprime();
void imprimeArquivo(string filename);
bool sameCoord(NoQuad *r, NoQuad *p);
vector<Cidade *> buscaRange(float x0, float y0, float x1, float y1);
private:
NoQuad *raiz; // ponteiro para o No raiz da arvore
bool auxBusca(NoQuad *p, float X, float Y);
void imprimePorNivel(NoQuad *p, int nivel, string R);
void imprimePorNivelArquivo(NoQuad *p, int nivel, string R, ofstream &file);
NoQuad *auxInsere(NoQuad *P, Cidade *Cidade);
vector<Cidade *> auxBuscaRange(NoQuad *p, vector<Cidade *> *cidades, float x0, float y0, float x1, float y1);
};
#endif // QuadTree_H_INCLUDED