Version: 8.3.0
YACS::HMI::LNode Class Reference

#include <LinkMatrix.hxx>

Collaboration diagram for YACS::HMI::LNode:

Public Member Functions

 LNode (int x, int y)
 
 LNode (std::pair< int, int > m)
 
virtual ~LNode ()
 
int getX () const
 
int getY () const
 
std::pair< int, int > getPos () const
 
bool isEqual (const LNode &o) const
 
double distance (const LNode &o) const
 

Protected Attributes

int _x
 
int _y
 

Detailed Description

Definition at line 46 of file LinkMatrix.hxx.

Constructor & Destructor Documentation

YACS::HMI::LNode::LNode ( int  x,
int  y 
)
inline

Definition at line 49 of file LinkMatrix.hxx.

49 : _x(x), _y(y) {};
YACS::HMI::LNode::LNode ( std::pair< int, int >  m)
inline

Definition at line 50 of file LinkMatrix.hxx.

50 : _x(m.first), _y(m.second) {};
virtual YACS::HMI::LNode::~LNode ( )
inlinevirtual

Definition at line 51 of file LinkMatrix.hxx.

51 {};

Member Function Documentation

double LNode::distance ( const LNode o) const

Definition at line 42 of file LinkMatrix.cxx.

References _x, and _y.

43 {
44  int dx = _x -o._x;
45  int dy = _y -o._y;
46  return sqrt(double(dx*dx +dy*dy));
47 }
std::pair<int,int> YACS::HMI::LNode::getPos ( ) const
inline

Definition at line 54 of file LinkMatrix.hxx.

References _x, and _y.

Referenced by YACS::HMI::LinkAStar::computePath(), and YACS::HMI::LinkAStar::givePath().

54 { return std::pair<int,int>(_x, _y); };
int YACS::HMI::LNode::getX ( ) const
inline

Definition at line 52 of file LinkMatrix.hxx.

References _x.

Referenced by YACS::HMI::LinkAStar::addNeighbours(), YACS::HMI::LinkAStar::computePath(), and YACS::HMI::LinkAStar::givePath().

52 {return _x; };
int YACS::HMI::LNode::getY ( ) const
inline

Definition at line 53 of file LinkMatrix.hxx.

References _y.

Referenced by YACS::HMI::LinkAStar::addNeighbours(), YACS::HMI::LinkAStar::computePath(), and YACS::HMI::LinkAStar::givePath().

53 {return _y; };
bool YACS::HMI::LNode::isEqual ( const LNode o) const
inline

Definition at line 55 of file LinkMatrix.hxx.

References _x, and _y.

Referenced by YACS::HMI::LinkAStar::givePath().

55 { return ((_x == o._x) && (_y == o._y)); };

Member Data Documentation

int YACS::HMI::LNode::_x
protected

Definition at line 58 of file LinkMatrix.hxx.

Referenced by distance(), getPos(), getX(), and isEqual().

int YACS::HMI::LNode::_y
protected

Definition at line 59 of file LinkMatrix.hxx.

Referenced by distance(), getPos(), getY(), and isEqual().


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