Skip to content

Commit

Permalink
remove idle function
Browse files Browse the repository at this point in the history
  • Loading branch information
jrd730 committed Sep 16, 2013
1 parent 4f86dc7 commit 8f6df20
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 17 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
CXX = g++
CPPFLAGS = -g
CPPFLAGS = -g -w

# uncomment the lines for the machine you are compiling on
# comment out the lines for the other two machines
Expand Down
7 changes: 5 additions & 2 deletions QTNode.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,13 @@ class QTNode{
}
~QTNode (){ for (int i=0; i < 4; ++i) if (child[i]){delete child[i];}}

vertex center, range;

// used by stem nodes
bool leaf;
QTNode* child[4];
vertex center, range;

// used by leaf nodes
vector <pair <vertex, T> > bucket;
T data;

};
6 changes: 6 additions & 0 deletions QuadTree.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,12 @@ void QuadTree<T>::draw ()
}
}

template <typename T>
vector <pair <vertex, T> >& QuadTree<T>::getObjectsInRegion (vertex minXY, vertex maxXY)
{
vector <pair <vertex, T> >& results;
}

template <typename T>
void QuadTree<T>::draw (QTNode<T>* node)
{
Expand Down
4 changes: 1 addition & 3 deletions QuadTree.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,7 @@ class QuadTree
void draw ();
string print ();

//vector <vertex> getPointsInRegion ();
//vector <vertex> getPointsInRadius ();
vector <pair <vertex, T> >& getObjectsInRegion (vertex minXY, vertex maxXY);

private:

Expand All @@ -57,7 +56,6 @@ class QuadTree
QTNode<T>* childNode (const vertex& v, QTNode<T>* node);
void insert (vertex v, T data, QTNode<T>* node, unsigned depth);
void reduce (stack <QTNode<T>*>& node);
bool remove (vertex v, QTNode<T>* parent, QTNode<T>* child);
void draw (QTNode<T>* node);

QTNode<T>* root;
Expand Down
12 changes: 1 addition & 11 deletions main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -212,25 +212,16 @@ static void mouse (int button, int state, int x, int y)
}
break;
}
glutPostRedisplay();
}

static void motion (int x, int y)
{
vertex newpoint ( x*pixToXCoord + graphXMin,
-y*pixToYCoord + graphYMax);

//qtree->remove (targetPoint.back());
//targetPoint.pop_back ();

targetPoint.push_back(newpoint);
qtree->insert (newpoint, 1);
}

static void idle(void)
{
if (going){

}
glutPostRedisplay();
}

Expand All @@ -248,7 +239,6 @@ int main(int argc, char *argv[])
glutKeyboardFunc(key);
glutMouseFunc(mouse);
glutMotionFunc(motion);
glutIdleFunc(idle);
glClearColor(0,0,0,0);
glutMainLoop();
return EXIT_SUCCESS;
Expand Down

0 comments on commit 8f6df20

Please sign in to comment.