Put framework in place for dealing with graphs in 3 dimensions
This commit is contained in:
13
graph.h
13
graph.h
@ -24,10 +24,11 @@ using std::list;
|
||||
class Vertex
|
||||
{
|
||||
public:
|
||||
Vertex(int x, int y, int r, int colour = 0, int score = 0);
|
||||
Vertex(int x, int y, int z, int r, int colour = 0, int score = 0);
|
||||
|
||||
int x;
|
||||
int y;
|
||||
int z;
|
||||
int r;
|
||||
int colour;
|
||||
int score;
|
||||
@ -45,10 +46,10 @@ class Graph
|
||||
list<Vertex*> get_vertices() const { return vertices; }
|
||||
list<Vertex*> get_colour(int colour);
|
||||
|
||||
bool point_in_vertex(int x, int y);
|
||||
Vertex * vertex_at(int x, int y);
|
||||
virtual bool add_vertex(int x, int y, int r, int colour = 0, int score = 0,
|
||||
Vertex* src=NULL);
|
||||
bool point_in_vertex(int x, int y, int z);
|
||||
Vertex * vertex_at(int x, int y, int z);
|
||||
virtual bool add_vertex(int x, int y, int z, int r, int colour = 0,
|
||||
int score = 0, Vertex* src=NULL);
|
||||
void remove_vertex(Vertex* target);
|
||||
|
||||
bool is_planar() const { return planar; }
|
||||
@ -58,7 +59,7 @@ class Graph
|
||||
list<Vertex*> vertices;
|
||||
|
||||
private:
|
||||
bool vertex_would_overlap(int x, int y, int r);
|
||||
bool vertex_would_overlap(int x, int y, int z, int r);
|
||||
bool crosses_edge(Vertex* a, Vertex* b);
|
||||
bool planar;
|
||||
};
|
||||
|
Reference in New Issue
Block a user