Developer Documentation
VSI::WayFind Class Reference

#include <Plugin-VSI/scene/wayfind.hh>

Classes

class  Node
 

Public Member Functions

 WayFind (GraphicsScene *_scene)
 Constructor. More...
 
 ~WayFind ()
 Destructor. More...
 
QPolygonF findWay (Connection *_conn, QPoint _from, QPoint _to)
 Finds a way from _from to _to ignoring any already existent connections from _conn. More...
 

Private Member Functions

QPoint validPos (unsigned int _dir, int _step, QPoint _pnt)
 
int heuristicDistance (const QPoint &_from, const QPoint &_to) const
 
void cleanup ()
 

Private Attributes

GraphicsScenescene_
 
unsigned int counter_
 
std::list< Node * > nodes_
 
QHash< QPair< int, int >, Node * > map_
 
Nodell_
 
QPoint oldFrom_
 
QRegion oldReg_
 

Detailed Description

A-Star way finding implementation with dynamic growing area

Definition at line 64 of file wayfind.hh.

Constructor & Destructor Documentation

◆ WayFind()

VSI::WayFind::WayFind ( GraphicsScene _scene)
explicit

Constructor.

Definition at line 75 of file wayfind.cc.

◆ ~WayFind()

VSI::WayFind::~WayFind ( )

Destructor.

Definition at line 85 of file wayfind.cc.

Member Function Documentation

◆ cleanup()

void VSI::WayFind::cleanup ( void  )
private

Definition at line 476 of file wayfind.cc.

◆ findWay()

QPolygonF VSI::WayFind::findWay ( Connection _conn,
QPoint  _from,
QPoint  _to 
)

Finds a way from _from to _to ignoring any already existent connections from _conn.

Definition at line 94 of file wayfind.cc.

◆ heuristicDistance()

int VSI::WayFind::heuristicDistance ( const QPoint &  _from,
const QPoint &  _to 
) const
private

Definition at line 467 of file wayfind.cc.

◆ validPos()

QPoint VSI::WayFind::validPos ( unsigned int  _dir,
int  _step,
QPoint  _pnt 
)
private

Definition at line 449 of file wayfind.cc.

Member Data Documentation

◆ counter_

unsigned int VSI::WayFind::counter_
private

Definition at line 136 of file wayfind.hh.

◆ ll_

Node* VSI::WayFind::ll_
private

Definition at line 141 of file wayfind.hh.

◆ map_

QHash<QPair<int, int>, Node*> VSI::WayFind::map_
private

Definition at line 139 of file wayfind.hh.

◆ nodes_

std::list<Node *> VSI::WayFind::nodes_
private

Definition at line 138 of file wayfind.hh.

◆ oldFrom_

QPoint VSI::WayFind::oldFrom_
private

Definition at line 142 of file wayfind.hh.

◆ oldReg_

QRegion VSI::WayFind::oldReg_
private

Definition at line 143 of file wayfind.hh.

◆ scene_

GraphicsScene* VSI::WayFind::scene_
private

Definition at line 134 of file wayfind.hh.


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