sparkle::Node Class Reference
[Sparkle Library]

Basic node type. More...

#include <node.h>

Collaboration diagram for sparkle::Node:

Collaboration graph
[legend]
List of all members.

Public Member Functions

ctors/dtor
 Node (double initialX, double initialY, Shape *newOwner)
 ~Node ()
Modifiers
void applyForce (double xForce, double yForce)
void setPosition (double newX, double newY)
void addEdge (Edge *newEdge)
void setOwner (Shape *newOwner)
Getters
Not necessarily const

double getX () const
double getY () const
Vector< double > getVector () const
Shapeowner () const

Protected Attributes

sparkle::Vector< double > loc
ShapeownerShape
std::vector< Edge * > edges

Detailed Description

Basic node type.

The Most basic component of the physics engine


Constructor & Destructor Documentation

sparkle::Node::Node double  initialX,
double  initialY,
Shape newOwner
[inline]
 

Constructs node at x,y with optional owner newOwner

Parameters:
initialX Initial x coord of node
initialY Initial y coord of node
newOwner Shape to own this node

Node::~Node  ) 
 

Deconstructor


Member Function Documentation

void Node::applyForce double  xForce,
double  yForce
 

Apply a force to the node. This function will notify the parent sparkle::Shape of the force

Parameters:
xForce Force in the positive x direction
yForce Force in the positive y direction

void Node::setPosition double  newX,
double  newY
 

Change the position of the node

Parameters:
newX New x coord of node
newY New y coord of node
See also:

void Node::addEdge Edge newEdge  ) 
 

Lets this node know it's a member of the edge

Parameters:
newEdge POinter to the new edge

void Node::setOwner Shape newOwner  ) 
 

Set the owner of the node since a node by itself is rather useless

Parameters:
newOwner The new owner of the node

double sparkle::Node::getX  )  const [inline]
 

Retrieve x-coord

Returns:
x coord of node
See also:

double sparkle::Node::getY  )  const [inline]
 

Retrieve y-coord

Returns:
y coord of node
See also:

Vector<double> sparkle::Node::getVector  )  const [inline]
 

Returns:
Vector of location

Shape* sparkle::Node::owner  )  const [inline]
 

Get the owner of the node. If there is no owner, it will return 0.

Returns:
A pointer to the owner of the node


Member Data Documentation

sparkle::Vector<double> sparkle::Node::loc [protected]
 

Vector of node

Shape* sparkle::Node::ownerShape [protected]
 

Owner of node

std::vector<Edge*> sparkle::Node::edges [protected]
 

Edges connected to this node


Hosted by SourceForge.net Logo Generated on Sat Sep 16 01:51:09 2006 for Sparkle by Doxygen 1.4.6.