Path Finder (2D/3D) 1.0.1
Create and use simple navigation graphs for 2D/3D path finding with choice of 4 search algorithms.
pathfinder.GraphNode Class Reference
Inheritance diagram for pathfinder.GraphNode:

Public Member Functions

 GraphNode (int id)
 
 GraphNode (int id, double x, double y, double z)
 
 GraphNode (int id, double x, double y)
 
int id ()
 
void id (int id)
 
double x ()
 
float xf ()
 
void x (float x)
 
double y ()
 
float yf ()
 
void y (float y)
 
double z ()
 
float zf ()
 
void z (float z)
 
int compareTo (Object o)
 

Protected Attributes

int id
 

Detailed Description

This class represents a node (vertex) that can be used with the Graph class.

The node has a position in 3D space for 2D applications the z value should be zero.

Each node should be given a unique ID number >= 0. Node ID numbers do not need to start at 0 (zero) or be sequential but they must be unique.

It is the responsibility of the user to ensure that each node ID is unique as duplicate ID numbers can lead to unpredictable behaviour.

Author
Peter Lager

Constructor & Destructor Documentation

◆ GraphNode() [1/3]

pathfinder.GraphNode.GraphNode ( int  id)

Create a node with a given ID

Parameters
id

◆ GraphNode() [2/3]

pathfinder.GraphNode.GraphNode ( int  id,
double  x,
double  y,
double  z 
)

Create a node

Parameters
idunique id number for this node
x
y
zset to 0 (zero for 2D applications

◆ GraphNode() [3/3]

pathfinder.GraphNode.GraphNode ( int  id,
double  x,
double  y 
)

Create a node

Parameters
idunique id number for this node
x
y

Member Function Documentation

◆ compareTo()

int pathfinder.GraphNode.compareTo ( Object  o)

Compare nodes based on ID number.

◆ id() [1/2]

int pathfinder.GraphNode.id ( )

Get the node ID

Returns
the id

◆ id() [2/2]

void pathfinder.GraphNode.id ( int  id)

Change the node id.
Care should be taken to ensure the new ID number is unique

Parameters
idthe id to set

◆ x() [1/2]

double pathfinder.GraphNode.x ( )
Returns
the x position

◆ x() [2/2]

void pathfinder.GraphNode.x ( float  x)
Parameters
xthe new x position

◆ xf()

float pathfinder.GraphNode.xf ( )
Returns
the x position as a float

◆ y() [1/2]

double pathfinder.GraphNode.y ( )
Returns
the y position

◆ y() [2/2]

void pathfinder.GraphNode.y ( float  y)
Parameters
ythe new y position

◆ yf()

float pathfinder.GraphNode.yf ( )
Returns
the y position as a float

◆ z() [1/2]

double pathfinder.GraphNode.z ( )
Returns
the z position

◆ z() [2/2]

void pathfinder.GraphNode.z ( float  z)
Parameters
zthe new z position

◆ zf()

float pathfinder.GraphNode.zf ( )
Returns
the y position as a float

The documentation for this class was generated from the following file: