Version: 8.3.0
gui.graph Namespace Reference

Classes

class  MyCanvas
 
class  Graph
 
class  node
 
class  grid
 

Functions

def attrs
 
def h
 
def distance
 

Function Documentation

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

Definition at line 265 of file graph.py.

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

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

Definition at line 275 of file graph.py.

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

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

Definition at line 272 of file graph.py.

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

273 def h(x,y,destx,desty):
274  return abs(destx-x)+abs(desty-y)