Version: 9.16.0
gui.graph Namespace Reference

Classes

class  Graph
 
class  grid
 
class  MyCanvas
 
class  node
 

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.

265def 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.

275def 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 
)