Node Class Reference

#include <Node.h>

Collaboration diagram for Node:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 Node ()
 Node (Node *copied_node)
virtual ~Node ()
int operator== (Node &to_compare_node)
void setID (GLuint id)
GLuint getID ()
void setCaption (char const *caption)
char const * getCaption ()
void setPointVector (Vector3D *point_vector)
Vector3DgetPointVector () const
void setAngularWidth (GLfloat angular_width)
GLfloat getAngularWidth ()
void setRing (GLuint num_ring)
GLuint getRing () const
void setOneAdjacentNode (Node *node)
void deleteOneAdjacentNode (Node *node)
vector< Node * > * getListOfAdjacentNodes ()
vector< GLuint > * getListOfLeafeNodes ()
GLuint getDegree ()
void incrNumOfLeafs (Node *root)
GLuint getNumLeafs (Node *node)
GLuint getTotalNumOfLeafsExceptRoot (Node *root)
void eraseNode (Node *node)
void drawNode (GLUquadricObj *quadric, bool render_mode, bool caption_mode)
void setRadius (GLfloat ring_radius)
GLfloat getRadius () const
void setNodeRadius (GLfloat node_radius)
GLfloat getNodeRadius () const
void setAngle (GLfloat polar_phi)
GLfloat getAngle () const
void setRed (GLuint red)
void setGreen (GLuint green)
void setBlue (GLuint blue)
GLuint getRed ()
GLuint getGreen ()
GLuint getBlue ()
void setLastVisitor (GLint last_visitor)
GLint getLastVisitor ()
void setSelected (bool is_selected)
void addAngleOffset (GLfloat additional_angle_offset)
GLfloat getAngleOffset ()
void resetMembers ()
void setSceneRotation (GLfloat x_rotation, GLfloat y_rotation, GLfloat z_rotation)

Protected Attributes

GLuint id_
 The node's id.

char const * caption_
 The node's caption.

Vector3Dpoint_vector_
 The node vector indicating the position on the screen.

GLfloat angular_width_
 The angular width for this node.

GLint ring_number_
 The ring number indicating also the number of parents.

GLfloat ring_radius_
 The ring's radius.

GLfloat polar_phi_
 The phi angle of the polar coordinates.

GLfloat polar_r_
 The r (i.e. radius) of the polar coordinates.

GLfloat alpha_
 The alpha value for transparency.

GLfloat red_
 The red color in rgb format.

GLfloat green_
 The green color in rgb format.

GLfloat blue_
 The blue color in rgb format.

GLfloat node_radius_
 The radius of the node.

vector< Node * > adjacents_
 The adjacent nodes to this node.

vector< GLuint > num_leafs_
GLint last_visitor_
GLfloat angle_offset_
bool is_selected_
 This indicates wheter a node is selected (e.g. by mouse) or not.

GLfloat x_rotation_
 This holds the x rotation of the entire scene.

GLfloat y_rotation_
 This holds the y rotation of the entire scene.

GLfloat z_rotation_
 This holds the z rotation of the entire scene.


Detailed Description

This class is corresponds to a node (in Graph Theory). We store the position of the node, the number of children (depending on the ring constellation), the adjacent nodes and the ring itself on which the node sits on.

Definition at line 28 of file Node.h.


Constructor & Destructor Documentation

Node::Node  )  [inline]
 

The default constructor.

Definition at line 83 of file Node.h.

References angle_offset_, last_visitor_, point_vector_, x_rotation_, y_rotation_, and z_rotation_.

00083 : 00084 point_vector_(NULL), 00085 last_visitor_(-1), 00086 angle_offset_(0), 00087 x_rotation_(0), 00088 y_rotation_(0), 00089 z_rotation_(0) 00090 { 00091 }

Node::Node Node copied_node  )  [inline]
 

The copy constructor.

Definition at line 97 of file Node.h.

References angle_offset_, getID(), getPointVector(), id_, last_visitor_, point_vector_, x_rotation_, y_rotation_, and z_rotation_.

00097 : 00098 id_(copied_node->getID()), 00099 point_vector_(copied_node->getPointVector()), 00100 last_visitor_(-1), 00101 angle_offset_(0), 00102 x_rotation_(0), 00103 y_rotation_(0), 00104 z_rotation_(0) 00105 { 00106 }

Here is the call graph for this function:

virtual Node::~Node  )  [inline, virtual]
 

The destructor.

Parameters:
point_vector The point vector of the Node.
ring_number The ring on which this node sits.

Definition at line 115 of file Node.h.

References point_vector_.

00116 { 00117 if (point_vector_ != NULL) 00118 { 00119 delete point_vector_; 00120 } 00121 }


Member Function Documentation

void Node::addAngleOffset GLfloat  additional_angle_offset  ) 
 

This adds some angle value to the angle offset member.

Parameters:
additional_angle_offset The angle offset to add.

Referenced by Graph::initStartPositions().

void Node::deleteOneAdjacentNode Node node  ) 
 

This deletes one adjacent node.

Parameters:
node The adjacent node to delet.

void Node::drawNode GLUquadricObj *  quadric,
bool  render_mode,
bool  caption_mode
 

This draws thee node into an OpenGL viewport.

Parameters:
quadric The quadric which represents the node for drawing.
render_mode The render mode of the quardric.
render_mode The caption mode of the quardric.

void Node::eraseNode Node node  ) 
 

This erases this node. That means that every link to this node is going to be erased.

Parameters:
node The node to hang out of the graph.

GLfloat Node::getAngle  )  const
 

This returns the angle of one node

Returns:
Returns The phi angle of the node

Referenced by NodeAnimation::interpolatePolarCoord().

GLfloat Node::getAngleOffset  ) 
 

This returns the angle offset of the node.

Returns:
The angle offset.

Referenced by Graph::initStartPositions().

GLfloat Node::getAngularWidth  ) 
 

This returns the angular width for the node.

Returns:
The angular width.

Referenced by Graph::initStartPositions().

GLuint Node::getBlue  ) 
 

This returns the blue color part of the RGB color of one node

Returns:
red Returns the blue part of tehe RGB color.

char const* Node::getCaption  ) 
 

This returns the caption of the node.

Returns:
Returns the cpation of the node.

GLuint Node::getDegree  ) 
 

This returns the degree of the node.

Returns:
The degree of the node.

GLuint Node::getGreen  ) 
 

This returns the green color part of the RGB color of one node

Returns:
red Returns the green part of tehe RGB color.

GLuint Node::getID  ) 
 

This returns the ID of one node

Returns:
id The ID of the node

Referenced by Graph::initStartPositions(), and Node().

GLint Node::getLastVisitor  ) 
 

This returns the last visitor-root during the leaf number actualization process.

Returns:
Returns the last visitor root.

vector<Node*>* Node::getListOfAdjacentNodes  ) 
 

This returns the list (i.e. vector) of adjacent nodes.

Returns:
The list of adjacent nodes.

Referenced by Graph::initStartPositions().

vector<GLuint>* Node::getListOfLeafeNodes  ) 
 

This returns the list (i.e. vector) of adjacent nodes.

Returns:
The list of adjacent nodes.

Referenced by Graph::initStartPositions().

GLfloat Node::getNodeRadius  )  const
 

This returns the radius of one node.

Returns:
Returns The radius of the node

GLuint Node::getNumLeafs Node node  ) 
 

This returns the number of leafs for the corresponding Node in the adjacent nodes list.

Parameters:
node The adjacent node from which we query the number of leafs.
Returns:
The number of leafs.

Vector3D* Node::getPointVector  )  const
 

This returns the point vector which indicates the position of the node in the space.

Returns:
Returs the point vector of the node.

Referenced by Node().

GLfloat Node::getRadius  )  const
 

This returns the radius of one node

Returns:
Returns The radius of the node

Referenced by NodeAnimation::interpolatePolarCoord().

GLuint Node::getRed  ) 
 

This returns the red color part of the RGB color of one node

Returns:
red Returns the red part of tehe RGB color.

GLuint Node::getRing  )  const
 

This returns the ring on which the node is sitting on.

Returns:
The ring.

GLuint Node::getTotalNumOfLeafsExceptRoot Node root  ) 
 

This returns the number of leafs for the corresponding Node in the adjacent nodes list and excludes the root.

Returns:
The number of leafs.

void Node::incrNumOfLeafs Node root  ) 
 

This increments the number of leafs which are reachable from this node coming from the specified node (see parameter).

Parameters:
root The root of the sub-tree.

int Node::operator== Node to_compare_node  ) 
 

This compares two nodes and returns 0 if they are not equal (member wise) and 1 else.

Returns:
Returns 0 if two nodes aren't equal and 0 else.

void Node::resetMembers  ) 
 

This resets the members of the node to default values.

void Node::setAngle GLfloat  polar_phi  ) 
 

This sets the angle of one node

Parameters:
polar_phi_ The phi angle of the node

Referenced by Graph::initStartPositions(), and NodeAnimation::interpolatePolarCoord().

void Node::setAngularWidth GLfloat  angular_width  ) 
 

This sets the angular width for the node.

Parameters:
angular_width The angular width to set.

void Node::setBlue GLuint  blue  ) 
 

This sets the color of one node

Parameters:
blue The blue part of tehe RGB color.

Referenced by NodeAnimation::calculateNodeRadiusAndColor().

void Node::setCaption char const *  caption  ) 
 

This sets the caption of the node

Parameters:
caption The caption to set.

Referenced by Graph::createGraph().

void Node::setGreen GLuint  green  ) 
 

This sets the color of one node

Parameters:
green The green part of tehe RGB color.

Referenced by NodeAnimation::calculateNodeRadiusAndColor().

void Node::setID GLuint  id  ) 
 

This sets the ID of one node

Parameters:
id The ID of the node

Referenced by Graph::createGraph().

void Node::setLastVisitor GLint  last_visitor  ) 
 

This sets the last visitor root.

Parameters:
last_visitor The last visitor root to set.

void Node::setNodeRadius GLfloat  node_radius  ) 
 

This sets the radius of one node,

Parameters:
ring_radius_ The node/ring

Referenced by NodeAnimation::calculateNodeRadiusAndColor().

void Node::setOneAdjacentNode Node node  ) 
 

This sets one adjacent node to this node.

Parameters:
node The adjacent node to set.

Referenced by Graph::createGraph().

void Node::setPointVector Vector3D point_vector  ) 
 

This sets point vector which indicates the position of the node in the space.

Parameters:
point_vector The point vector of the node.

Referenced by Graph::createGraph().

void Node::setRadius GLfloat  ring_radius  ) 
 

This sets the radius of one node

Parameters:
ring_radius_ The node/ring

Referenced by Graph::initStartPositions(), and NodeAnimation::interpolatePolarCoord().

void Node::setRed GLuint  red  ) 
 

This sets the color of one node

Parameters:
red The red part of tehe RGB color.

Referenced by NodeAnimation::calculateNodeRadiusAndColor().

void Node::setRing GLuint  num_ring  ) 
 

This sets the ring.

Parameters:
num_ring The ring.

Referenced by Graph::initStartPositions().

void Node::setSceneRotation GLfloat  x_rotation,
GLfloat  y_rotation,
GLfloat  z_rotation
 

This sets the current rotation of the entire scene.

Parameters:
x_rotation The rotation along the x axis.
y_rotation The rotation along the y axis.
z_rotation The rotation along the z axis.

void Node::setSelected bool  is_selected  ) 
 

This sets a node to be selected (for highlighting).

Parameters:
is_selected Indicates if a node has been selected.


Member Data Documentation

vector<Node*> Node::adjacents_ [protected]
 

The adjacent nodes to this node.

Definition at line 58 of file Node.h.

GLfloat Node::alpha_ [protected]
 

The alpha value for transparency.

Definition at line 48 of file Node.h.

GLfloat Node::angle_offset_ [protected]
 

This holds the current angle offset when calculating the angles for all adjacent nodes.

Definition at line 68 of file Node.h.

Referenced by Node().

GLfloat Node::angular_width_ [protected]
 

The angular width for this node.

Definition at line 38 of file Node.h.

GLfloat Node::blue_ [protected]
 

The blue color in rgb format.

Definition at line 54 of file Node.h.

char const* Node::caption_ [protected]
 

The node's caption.

Definition at line 34 of file Node.h.

GLfloat Node::green_ [protected]
 

The green color in rgb format.

Definition at line 52 of file Node.h.

GLuint Node::id_ [protected]
 

The node's id.

Definition at line 32 of file Node.h.

Referenced by Node().

bool Node::is_selected_ [protected]
 

This indicates wheter a node is selected (e.g. by mouse) or not.

Definition at line 70 of file Node.h.

GLint Node::last_visitor_ [protected]
 

This stores the last root which visited the current node when increasing the number of leafes.

Definition at line 65 of file Node.h.

Referenced by Node().

GLfloat Node::node_radius_ [protected]
 

The radius of the node.

Definition at line 56 of file Node.h.

vector<GLuint> Node::num_leafs_ [protected]
 

The list of leafs for each adjacent node. Node on the position 0 in adjacents_ list has a number of leafs (checked on position 0 in num_leafs).

Definition at line 62 of file Node.h.

Vector3D* Node::point_vector_ [protected]
 

The node vector indicating the position on the screen.

Definition at line 36 of file Node.h.

Referenced by Node(), and ~Node().

GLfloat Node::polar_phi_ [protected]
 

The phi angle of the polar coordinates.

Definition at line 44 of file Node.h.

GLfloat Node::polar_r_ [protected]
 

The r (i.e. radius) of the polar coordinates.

Definition at line 46 of file Node.h.

GLfloat Node::red_ [protected]
 

The red color in rgb format.

Definition at line 50 of file Node.h.

GLint Node::ring_number_ [protected]
 

The ring number indicating also the number of parents.

Definition at line 40 of file Node.h.

GLfloat Node::ring_radius_ [protected]
 

The ring's radius.

Definition at line 42 of file Node.h.

GLfloat Node::x_rotation_ [protected]
 

This holds the x rotation of the entire scene.

Definition at line 72 of file Node.h.

Referenced by Node().

GLfloat Node::y_rotation_ [protected]
 

This holds the y rotation of the entire scene.

Definition at line 74 of file Node.h.

Referenced by Node().

GLfloat Node::z_rotation_ [protected]
 

This holds the z rotation of the entire scene.

Definition at line 76 of file Node.h.

Referenced by Node().


The documentation for this class was generated from the following file:
Generated on Mon Jun 14 12:49:10 2004 for InfoVis by doxygen 1.3.7