Salome HOME
PR: merge from tag mergeto_trunk_20Jan05
[modules/kernel.git] / src / SALOME_SWIG_WITHOUTIHM / supervisiongeomexample.py.in
1 # Generated python file of Graph GraphGeom2Essai
2
3 from SuperV import *
4
5 import salome
6
7 import geompy
8
9
10 geom = lcc.FindOrLoadComponent("FactoryServer", "Geometry")
11 geom.GetCurrentStudy(salome.myStudyId)
12
13 myBuilder = salome.myStudy.NewBuilder()
14
15 # Graph creation 
16 GraphGeom2Essai = Graph( 'GraphGeom2Essai' )
17 print GraphGeom2Essai.SetAuthor( '' )
18 print GraphGeom2Essai.SetComment( '' )
19 GraphGeom2Essai.Coords( 0 , 0 )
20
21 # Creation of Nodes
22 MakeSphere = GraphGeom2Essai.Node( 'Geometry' , 'Geometry' , 'MakeSphere' )
23 print MakeSphere.SetAuthor( '' )
24 print MakeSphere.SetContainer( 'FactoryServer' )
25 print MakeSphere.SetComment( '' )
26 MakeSphere.Coords( 26 , 13 )
27 MakeCopy = GraphGeom2Essai.Node( 'Geometry' , 'Geometry' , 'MakeCopy' )
28 print MakeCopy.SetAuthor( '' )
29 print MakeCopy.SetContainer( 'FactoryServer' )
30 print MakeCopy.SetComment( '' )
31 MakeCopy.Coords( 219 , 12 )
32 MakeTranslation = GraphGeom2Essai.Node( 'Geometry' , 'Geometry' , 'MakeTranslation' )
33 print MakeTranslation.SetAuthor( '' )
34 print MakeTranslation.SetContainer( 'FactoryServer' )
35 print MakeTranslation.SetComment( '' )
36 MakeTranslation.Coords( 219 , 159 )
37 MakeFuse = GraphGeom2Essai.Node( 'Geometry' , 'Geometry' , 'MakeFuse' )
38 print MakeFuse.SetAuthor( '' )
39 print MakeFuse.SetContainer( 'FactoryServer' )
40 print MakeFuse.SetComment( '' )
41 MakeFuse.Coords( 465 , 106 )
42
43 # Creation of intermediate Output variables and of links
44 MakeSphereshape = MakeSphere.Port( 'shape' )
45 MakeCopyshape1 = GraphGeom2Essai.Link( MakeSphereshape , MakeCopy.Port( 'shape1' ) )
46 MakeTranslationshape1 = GraphGeom2Essai.Link( MakeSphereshape , MakeTranslation.Port( 'shape1' ) )
47 MakeCopyshape = MakeCopy.Port( 'shape' )
48 MakeFuseshape1 = GraphGeom2Essai.Link( MakeCopyshape , MakeFuse.Port( 'shape1' ) )
49 MakeTranslationshape = MakeTranslation.Port( 'shape' )
50 MakeFuseshape2 = GraphGeom2Essai.Link( MakeTranslationshape , MakeFuse.Port( 'shape2' ) )
51
52 # Creation of Input datas
53 MakeSpherex1 = MakeSphere.Input( 'x1' , 0)
54 MakeSpherey1 = MakeSphere.Input( 'y1' , 0)
55 MakeSpherez1 = MakeSphere.Input( 'z1' , 0)
56 MakeSphereradius = MakeSphere.Input( 'radius' , 50)
57 MakeTranslationx1 = MakeTranslation.Input( 'x1' , 80)
58 MakeTranslationy1 = MakeTranslation.Input( 'y1' , 0)
59 MakeTranslationz1 = MakeTranslation.Input( 'z1' , 0)
60
61 # Missing Input datas : None
62
63 # Creation of Output variables
64 MakeFuseshape = MakeFuse.Port( 'shape' )
65
66 # State of Ports of the Graph
67 GraphGeom2Essai.PrintPorts()
68
69 # Start asynchronous run
70 print GraphGeom2Essai.Run()
71
72 # Done ?
73 print GraphGeom2Essai.IsDone()
74
75 # Events of execution :
76 aStatus,aNode,anEvent,aState = GraphGeom2Essai.Event()
77 while aStatus :
78     print aNode.Thread(),aNode.SubGraph(),aNode.Name(),anEvent,aState
79     aStatus,aNode,anEvent,aState = GraphGeom2Essai.Event()
80 print GraphGeom2Essai.IsDone()
81
82 # Waiting end of execution :
83 print GraphGeom2Essai.DoneW()
84
85 print " "
86 print "Type print GraphGeom2Essai.IsDone()"
87 print "1 <==> It's done"
88 print " "
89 print "Type print GraphGeom2Essai.DoneW()"
90 print "Wait until end of execution : 1(success)"
91 print " "
92 print "Type GraphGeom2Essai.PrintPorts()"
93 print "     to see input and output values of the graph"
94 print " "
95 print "Type MakeSphere.PrintPorts()"
96 print "Type MakeCopy.PrintPorts()"
97 print "Type MakeTranslation.PrintPorts()"
98 print "Type MakeFuse.PrintPorts()"
99 print "     to see input and output values of nodes"
100 print " "
101 print "Type print GraphGeom2Essai.Export('File-Name')"
102 print "You will get a .py and a .xml file of this graph"