#include <LinkMatrix.hxx>
Public Member Functions | |
LinkMatrix (SceneComposedNodeItem *bloc) | |
virtual | ~LinkMatrix () |
void | compute () |
void | addRowCols () |
void | explore (AbstractSceneItem *child, bool setObstacle=false) |
void | defineCost (AbstractSceneItem *child) |
void | getBoundingBox (SceneItem *obstacle, int margin, bool setObstacle=false) |
std::pair< int, int > | cellFrom (YACS::ENGINE::OutPort *outp) |
std::pair< int, int > | cellFrom (YACS::ENGINE::OutGate *outp) |
std::pair< int, int > | cellTo (YACS::ENGINE::InPort *inp) |
std::pair< int, int > | cellTo (YACS::ENGINE::InGate *inp) |
std::list< linkdef > | getListOfCtrlLinkDef () |
std::list< linkdef > | getListOfDataLinkDef () |
LinkPath | getPath (LNodePath lnp) |
void | incrementCost (LNodePath lnp) |
int | cost (int i, int j) const |
int | imax () const |
int | jmax () const |
Protected Attributes | |
SceneComposedNodeItem * | _bloc |
int | _im |
int | _jm |
double | _pas |
std::set< double > | _sxm |
std::set< double > | _sym |
std::vector< double > | _xm |
std::vector< double > | _ym |
std::map< double, int > | _x2i |
std::map< double, int > | _y2j |
std::vector< int > | _cost |
QtGuiContext * | _context |
Definition at line 79 of file LinkMatrix.hxx.
LinkMatrix::LinkMatrix | ( | SceneComposedNodeItem * | bloc | ) |
|
virtual |
Definition at line 65 of file LinkMatrix.cxx.
void LinkMatrix::addRowCols | ( | ) |
Definition at line 391 of file LinkMatrix.cxx.
References _pas, _sxm, _sym, and CORBAEngineTest::i.
Referenced by compute().
std::pair< int, int > LinkMatrix::cellFrom | ( | YACS::ENGINE::OutPort * | outp | ) |
Definition at line 115 of file LinkMatrix.cxx.
References _context, _im, _jm, YACS::HMI::QtGuiContext::_mapOfSceneItem, YACS::HMI::GuiContext::_mapOfSubjectDataPort, _xm, _ym, YACS::HMI::SceneItem::boundingRect(), cost(), DEBTRACE, and CORBAEngineTest::i.
Referenced by getListOfCtrlLinkDef(), and getListOfDataLinkDef().
std::pair< int, int > LinkMatrix::cellFrom | ( | YACS::ENGINE::OutGate * | outp | ) |
Definition at line 144 of file LinkMatrix.cxx.
References _context, _im, _jm, YACS::HMI::QtGuiContext::_mapOfSceneItem, YACS::HMI::GuiContext::_mapOfSubjectNode, _xm, _ym, YACS::HMI::SceneItem::boundingRect(), cost(), DEBTRACE, YACS::HMI::SceneHeaderNodeItem::getCtrlOutPortItem(), YACS::HMI::SceneNodeItem::getHeader(), YACS::ENGINE::Port::getNode(), CORBAEngineTest::i, and YASSERT.
std::pair< int, int > LinkMatrix::cellTo | ( | YACS::ENGINE::InPort * | inp | ) |
Definition at line 178 of file LinkMatrix.cxx.
References _context, _im, _jm, YACS::HMI::QtGuiContext::_mapOfSceneItem, YACS::HMI::GuiContext::_mapOfSubjectDataPort, _xm, _ym, YACS::HMI::SceneItem::boundingRect(), cost(), DEBTRACE, and CORBAEngineTest::i.
Referenced by getListOfCtrlLinkDef(), and getListOfDataLinkDef().
std::pair< int, int > LinkMatrix::cellTo | ( | YACS::ENGINE::InGate * | inp | ) |
Definition at line 207 of file LinkMatrix.cxx.
References _context, _im, _jm, YACS::HMI::QtGuiContext::_mapOfSceneItem, YACS::HMI::GuiContext::_mapOfSubjectNode, _xm, _ym, YACS::HMI::SceneItem::boundingRect(), cost(), DEBTRACE, YACS::HMI::SceneHeaderNodeItem::getCtrlInPortItem(), YACS::HMI::SceneNodeItem::getHeader(), YACS::ENGINE::Port::getNode(), CORBAEngineTest::i, and YASSERT.
void LinkMatrix::compute | ( | ) |
Definition at line 69 of file LinkMatrix.cxx.
References YACS::HMI::Scene::_addRowCols, _bloc, _cost, _im, _jm, _sxm, _sym, _x2i, _xm, _y2j, _ym, addRowCols(), cost(), DEBTRACE, explore(), getBoundingBox(), CORBAEngineTest::i, and gui.GraphViewer::m.
Referenced by YACS::HMI::SceneComposedNodeItem::rebuildLinks().
|
inline |
Definition at line 98 of file LinkMatrix.hxx.
Referenced by YACS::HMI::LinkAStar::addNeighbours(), cellFrom(), cellTo(), and compute().
void YACS::HMI::LinkMatrix::defineCost | ( | AbstractSceneItem * | child | ) |
void LinkMatrix::explore | ( | AbstractSceneItem * | child, |
bool | setObstacle = false |
||
) |
find recursively elementary nodes and node headers and call getBoundingBox on each item. first pass with setObstacle = false stores the x and y coordinates of the mesh boundaries. second pass with setObstacle = true fills the mesh with obstacles i.e. elementary nodes or nodeHeaders.
Definition at line 340 of file LinkMatrix.cxx.
References getBoundingBox(), YACS::HMI::SceneComposedNodeItem::getChildren(), and YACS::HMI::SceneNodeItem::getHeader().
Referenced by compute().
void LinkMatrix::getBoundingBox | ( | SceneItem * | obstacle, |
int | margin, | ||
bool | setObstacle = false |
||
) |
first pass with setObstacle = false stores the x and y coordinates of the mesh boundaries. second pass with setObstacle = true fills the mesh with obstacles i.e. elementary nodes or nodeHeaders. For elementary nodes, the bounding box is smaller to let a path between nodes that are stick together.
Definition at line 364 of file LinkMatrix.cxx.
References _cost, _jm, _sxm, _sym, _x2i, _y2j, YACS::HMI::SceneItem::boundingRect(), DEBTRACE, CORBAEngineTest::i, imax(), and jmax().
Referenced by compute(), and explore().
std::list< linkdef > LinkMatrix::getListOfCtrlLinkDef | ( | ) |
Definition at line 241 of file LinkMatrix.cxx.
References _context, YACS::HMI::QtGuiContext::_mapOfSceneItem, YACS::HMI::GuiContext::_mapOfSubjectControlLink, cellFrom(), cellTo(), DEBTRACE, YACS::HMI::linkdef::from, YACS::HMI::AbstractSceneItem::getLabel(), YACS::HMI::linkdef::item, and YACS::HMI::linkdef::to.
Referenced by YACS::HMI::SceneComposedNodeItem::rebuildLinks().
std::list< linkdef > LinkMatrix::getListOfDataLinkDef | ( | ) |
Definition at line 262 of file LinkMatrix.cxx.
References _context, YACS::HMI::QtGuiContext::_mapOfSceneItem, YACS::HMI::GuiContext::_mapOfSubjectLink, cellFrom(), cellTo(), DEBTRACE, YACS::HMI::linkdef::from, YACS::HMI::AbstractSceneItem::getLabel(), YACS::HMI::linkdef::item, and YACS::HMI::linkdef::to.
Referenced by YACS::HMI::SceneComposedNodeItem::rebuildLinks().
Definition at line 283 of file LinkMatrix.cxx.
References _im, _jm, _xm, _ym, gui.CONNECTOR::a, DEBTRACE, CORBAEngineTest::i, YACS::HMI::Resource::link_separation_weight, YACS::HMI::linkPoint::x, and YACS::HMI::linkPoint::y.
Referenced by YACS::HMI::SceneComposedNodeItem::rebuildLinks().
|
inline |
Definition at line 99 of file LinkMatrix.hxx.
References _im.
Referenced by YACS::HMI::LinkAStar::addNeighbours(), and getBoundingBox().
void LinkMatrix::incrementCost | ( | LNodePath | lnp | ) |
Definition at line 319 of file LinkMatrix.cxx.
References _cost, _jm, CORBAEngineTest::i, and YACS::HMI::Resource::link_separation_weight.
Referenced by YACS::HMI::SceneComposedNodeItem::rebuildLinks().
|
inline |
Definition at line 100 of file LinkMatrix.hxx.
References _jm.
Referenced by YACS::HMI::LinkAStar::addNeighbours(), and getBoundingBox().
|
protected |
Definition at line 100 of file LinkMatrix.hxx.
Referenced by compute().
|
protected |
Definition at line 114 of file LinkMatrix.hxx.
Referenced by cellFrom(), cellTo(), getListOfCtrlLinkDef(), getListOfDataLinkDef(), and LinkMatrix().
|
protected |
Definition at line 113 of file LinkMatrix.hxx.
Referenced by compute(), cost(), getBoundingBox(), incrementCost(), and LinkMatrix().
|
protected |
Definition at line 104 of file LinkMatrix.hxx.
Referenced by cellFrom(), cellTo(), compute(), getPath(), imax(), and LinkMatrix().
|
protected |
Definition at line 105 of file LinkMatrix.hxx.
Referenced by cellFrom(), cellTo(), compute(), cost(), getBoundingBox(), getPath(), incrementCost(), jmax(), and LinkMatrix().
|
protected |
Definition at line 106 of file LinkMatrix.hxx.
Referenced by addRowCols(), and LinkMatrix().
|
protected |
Definition at line 107 of file LinkMatrix.hxx.
Referenced by addRowCols(), compute(), getBoundingBox(), and LinkMatrix().
|
protected |
Definition at line 108 of file LinkMatrix.hxx.
Referenced by addRowCols(), compute(), getBoundingBox(), and LinkMatrix().
|
protected |
Definition at line 111 of file LinkMatrix.hxx.
Referenced by compute(), getBoundingBox(), and LinkMatrix().
|
protected |
Definition at line 109 of file LinkMatrix.hxx.
Referenced by cellFrom(), cellTo(), compute(), getPath(), and LinkMatrix().
|
protected |
Definition at line 112 of file LinkMatrix.hxx.
Referenced by compute(), getBoundingBox(), and LinkMatrix().
|
protected |
Definition at line 110 of file LinkMatrix.hxx.
Referenced by cellFrom(), cellTo(), compute(), getPath(), and LinkMatrix().