PixelLightAPI  .
Public Member Functions
PLMath::GraphNode Class Reference

Graph node class. More...

#include <GraphNode.h>

Inheritance diagram for PLMath::GraphNode:
Inheritance graph
[legend]

List of all members.

Public Member Functions

PLMATH_API GraphNode (const PLCore::String &sName="", PLCore::ElementManager< GraphNode > *pManager=nullptr)
 Constructor.
PLMATH_API GraphNode (GraphNode &cSource)
 Constructor.
virtual PLMATH_API ~GraphNode ()
 Destructor.
PLMATH_API PLCore::uint32 GetNumOfNeighbours () const
 Returns the number of neighbours.
PLMATH_API void ClearNeighbours ()
 Clears all neighbour connectivity.
PLMATH_API bool IsNeighbour (const GraphNode &cNode) const
 Returns whether a node is a neighbour of this node or not.
PLMATH_API const GraphNodeGetNeighbour (PLCore::uint32 nNeighbour) const
 Returns a neighbour.
PLMATH_API GraphNodeGetNeighbour (PLCore::uint32 nNeighbour)
 Returns a neighbour.
PLMATH_API float GetNeighbourDistance (PLCore::uint32 nNeighbour) const
 Returns the distance to a neighbour.
PLMATH_API bool AddNeighbour (GraphNode &cNode, float fDistance=-1.0f)
 Adds a neighbour connection.
PLMATH_API bool RemoveNeighbour (GraphNode &cNode)
 Removes a neighbour connection.
PLMATH_API bool RemoveNeighbourAtIndex (PLCore::uint32 nNeighbour)
 Removes a neighbour connection at the given index.
PLMATH_API const Vector3GetPos () const
 Returns the node position.
PLMATH_API void SetPos (const Vector3 &vPos)
 Sets the node position.
PLMATH_API void SetPos (float fX=0.0f, float fY=0.0f, float fZ=0.0f)
 Sets the node position.
PLMATH_API float GetDistance (const GraphNode &cNode) const
 Returns the distance between two graph nodes.
virtual PLMATH_API GraphNodeoperator= (const GraphNode &cSource)

Detailed Description

Graph node class.


Constructor & Destructor Documentation

PLMATH_API PLMath::GraphNode::GraphNode ( const PLCore::String sName = "",
PLCore::ElementManager< GraphNode > *  pManager = nullptr 
)

Constructor.

Parameters:
[in]sNameElement name to set
[in]pManagerElement manager using this element, can be a null pointer
PLMATH_API PLMath::GraphNode::GraphNode ( GraphNode cSource)

Constructor.

Parameters:
[in]cSourceNode to copy from
virtual PLMATH_API PLMath::GraphNode::~GraphNode ( ) [virtual]

Destructor.


Member Function Documentation

PLMATH_API PLCore::uint32 PLMath::GraphNode::GetNumOfNeighbours ( ) const

Returns the number of neighbours.

Returns:
Number of neighbours

Clears all neighbour connectivity.

PLMATH_API bool PLMath::GraphNode::IsNeighbour ( const GraphNode cNode) const

Returns whether a node is a neighbour of this node or not.

Parameters:
[in]cNodeNode to check
Returns:
'true' if the given node is a neighbour of this node, else 'false'
PLMATH_API const GraphNode* PLMath::GraphNode::GetNeighbour ( PLCore::uint32  nNeighbour) const

Returns a neighbour.

Parameters:
[in]nNeighbourNeighbour index
Returns:
Requested neighbour node, a null pointer on error
PLMATH_API GraphNode* PLMath::GraphNode::GetNeighbour ( PLCore::uint32  nNeighbour)

Returns a neighbour.

Parameters:
[in]nNeighbourNeighbour index
Returns:
Requested neighbour node, a null pointer on error
PLMATH_API float PLMath::GraphNode::GetNeighbourDistance ( PLCore::uint32  nNeighbour) const

Returns the distance to a neighbour.

Parameters:
[in]nNeighbourNeighbour index
Returns:
Requested distance to a neighbour node, -1 on error
Note:
  • By default the neighbour distance from AddNeighbour() is set, if SetPos() is called the neighbour distances are updated automatically.
PLMATH_API bool PLMath::GraphNode::AddNeighbour ( GraphNode cNode,
float  fDistance = -1.0f 
)

Adds a neighbour connection.

Parameters:
[in]cNodeNeighbour node to add
[in]fDistanceDistance to the neighbour node, if negative the distance is calculated automatically using the current node positions. (see GetPos())
Returns:
'true' if all went fine, else 'false' (maybe this node is already a neighbour)
PLMATH_API bool PLMath::GraphNode::RemoveNeighbour ( GraphNode cNode)

Removes a neighbour connection.

Parameters:
[in]cNodeNeighbour node to remove
Returns:
'true' if all went fine, else 'false'
PLMATH_API bool PLMath::GraphNode::RemoveNeighbourAtIndex ( PLCore::uint32  nNeighbour)

Removes a neighbour connection at the given index.

Parameters:
[in]nNeighbourNeighbour index
Returns:
'true' if all went fine, else 'false'
PLMATH_API const Vector3& PLMath::GraphNode::GetPos ( ) const

Returns the node position.

Returns:
Node position
PLMATH_API void PLMath::GraphNode::SetPos ( const Vector3 vPos)

Sets the node position.

Parameters:
[in]vPosNode position
PLMATH_API void PLMath::GraphNode::SetPos ( float  fX = 0.0f,
float  fY = 0.0f,
float  fZ = 0.0f 
)

Sets the node position.

Parameters:
[in]fXX component of the node position
[in]fYY component of the node position
[in]fZZ component of the node position
PLMATH_API float PLMath::GraphNode::GetDistance ( const GraphNode cNode) const

Returns the distance between two graph nodes.

Parameters:
[in]cNodeOther node
Returns:
The positions (see GetPos()) are used to calculate the distance
virtual PLMATH_API GraphNode& PLMath::GraphNode::operator= ( const GraphNode cSource) [virtual]

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


PixelLight PixelLight 0.9.11-R1
Copyright (C) 2002-2012 by The PixelLight Team
Last modified Thu Feb 23 2012 14:09:34
The content of this PixelLight document is published under the
Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported