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