Version: 9.15.0
gui.graph Namespace Reference

Classes

class  MyCanvas
 
class  Graph
 
class  node
 
class  grid
 

Functions

def attrs (g, t=gv.AGRAPH)
 
def h (x, y, destx, desty)
 
def distance (node, new_node)
 

Function Documentation

◆ attrs()

def gui.graph.attrs (   g,
  t = gv.AGRAPH 
)

Definition at line 265 of file graph.py.

265 def attrs(g,t=gv.AGRAPH):
266  ah=None
267  while 1:
268  ah=gv.agnxtattr(g.handle,t,ah)
269  value=gv.agxget(g.handle,ah)
270  yield gv.agattrname(ah),value
271 
def attrs(g, t=gv.AGRAPH)
Definition: graph.py:265

Referenced by gui.graph.Graph.layout().

◆ distance()

def gui.graph.distance (   node,
  new_node 
)

Definition at line 275 of file graph.py.

275 def distance(node,new_node):
276  x,y=node.coord
277  x1,y1=new_node.coord
278  d= abs(x1-x)+abs(y1-y)
279  if node.parent != None:
280  x0,y0=node.parent.coord
281  if (x1-x)*(y0-y)-(y1-y)*(x0-x) != 0:
282  #corner add some cost to penalize
283  d=d+1
284  return d
285 
def distance(node, new_node)
Definition: graph.py:275

Referenced by YACS::ENGINE::SalomeHPContainerVectOfHelper.allocateFor(), YACS::ENGINE::PlayGround.BuildVectOfIdsFromVecBool(), and YACS::ENGINE::DynParaLoop.getBranchIDOfNode().

◆ h()

def gui.graph.h (   x,
  y,
  destx,
  desty 
)

Definition at line 272 of file graph.py.

272 def h(x,y,destx,desty):
273  return abs(destx-x)+abs(desty-y)
274 
def h(x, y, destx, desty)
Definition: graph.py:272

Referenced by YACS::HMI::MenusBase.addHeader(), Yacsgui_Resource.colorValue(), YACS::HMI::SceneElementaryNodeItem.paint(), YACS::HMI::SceneHeaderNodeItem.paint(), YACS::HMI::SceneProgressItem.paint(), and YACS::HMI::SceneNodeItem.setExpandedWH().