9 #ifndef GlobeEngine_GraphNode_h
10 #define GlobeEngine_GraphNode_h
12 #include "OpenGL_Includes.h"
32 neighbors.push_back(_edge);
40 return this->neighbors.size();
44 if (neighbors.size() > 2)
50 if (neighbors.size() == 2)
57 if (_edgeID != neighbors[0] && _edgeID != neighbors[1]) {
58 std::cout <<
"cannot find this edge connected to graph node" << std::endl;
60 if(_edgeID == neighbors[0]) {
66 std::cout <<
"node is not a connector" << std::endl;
68 return std::numeric_limits<T>::max();
72 if (neighbors.size() == 1)
78 if (neighbors.size() == 0)
84 for (
int i = 0;i < this->neighbors.size();i++) {
85 if(this->neighbors[i] == _edgeID){
104 friend std::ostream& operator<< (std::ostream &out, const GraphNode< T > &graphNode) {
105 out <<
"uid " << graphNode.uid <<
" has " << graphNode.neighbors.size() <<
" neighbors: ";
106 for (
int i = 0;i < graphNode.neighbors.size();i++) {
107 out << graphNode.neighbors[i] <<
" ";
115 std::vector< T > neighbors;
bool hasNeighbors()
Definition: GraphNode.h:77
GraphNode()
Definition: GraphNode.h:22
bool isCrossing()
Definition: GraphNode.h:43
T getOppositeEdge(T _edgeID)
Definition: GraphNode.h:55
T getUID()
Definition: GraphNode.h:27
Definition: DirectedEdge.h:16
bool isEndpoint()
Definition: GraphNode.h:71
GraphNode(T _uid)
Definition: GraphNode.h:23
void mark()
Definition: GraphNode.h:92
bool isConnector()
Definition: GraphNode.h:49
bool isIDaNeighborEdge(T _edgeID)
Definition: GraphNode.h:83
unsigned int getNeighborCount()
Definition: GraphNode.h:39
bool isMarked()
Definition: GraphNode.h:100
void unmark()
Definition: GraphNode.h:96
void addEdge(T _edge)
Definition: GraphNode.h:31
std::vector< T > getNeighbors()
Definition: GraphNode.h:35
Definition: GraphNode.h:19