]> SALOME platform Git repositories - modules/gui.git/blob - src/SALOME_SWIG/supervisiongeomexample.py
Salome HOME
e30e66b6c18e13a9fab44f22f09862d14500c040
[modules/gui.git] / src / SALOME_SWIG / supervisiongeomexample.py
1 #  Copyright (C) 2005  CEA/DEN, EDF R&D, OPEN CASCADE, PRINCIPIA R&D
2 #
3 #  This library is free software; you can redistribute it and/or
4 #  modify it under the terms of the GNU Lesser General Public
5 #  License as published by the Free Software Foundation; either
6 #  version 2.1 of the License.
7 #
8 #  This library is distributed in the hope that it will be useful,
9 #  but WITHOUT ANY WARRANTY; without even the implied warranty of
10 #  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
11 #  Lesser General Public License for more details.
12 #
13 #  You should have received a copy of the GNU Lesser General Public
14 #  License along with this library; if not, write to the Free Software
15 #  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
16 #
17 #  See http://www.salome-platform.org/
18 #
19
20 # Generated python file of Graph GraphGeom2Essai
21
22 from SuperV import *
23
24 import salome
25
26 import geompy
27
28
29 geom = lcc.FindOrLoadComponent("FactoryServer", "Geometry")
30 geom.GetCurrentStudy(salome.myStudyId)
31
32 myBuilder = salome.myStudy.NewBuilder()
33
34 # Graph creation 
35 GraphGeom2Essai = Graph( 'GraphGeom2Essai' )
36 print GraphGeom2Essai.SetAuthor( '' )
37 print GraphGeom2Essai.SetComment( '' )
38 GraphGeom2Essai.Coords( 0 , 0 )
39
40 # Creation of Nodes
41 MakeSphere = GraphGeom2Essai.Node( 'Geometry' , 'Geometry' , 'MakeSphere' )
42 print MakeSphere.SetAuthor( '' )
43 print MakeSphere.SetContainer( 'FactoryServer' )
44 print MakeSphere.SetComment( '' )
45 MakeSphere.Coords( 26 , 13 )
46 MakeCopy = GraphGeom2Essai.Node( 'Geometry' , 'Geometry' , 'MakeCopy' )
47 print MakeCopy.SetAuthor( '' )
48 print MakeCopy.SetContainer( 'FactoryServer' )
49 print MakeCopy.SetComment( '' )
50 MakeCopy.Coords( 219 , 12 )
51 MakeTranslation = GraphGeom2Essai.Node( 'Geometry' , 'Geometry' , 'MakeTranslation' )
52 print MakeTranslation.SetAuthor( '' )
53 print MakeTranslation.SetContainer( 'FactoryServer' )
54 print MakeTranslation.SetComment( '' )
55 MakeTranslation.Coords( 219 , 159 )
56 MakeFuse = GraphGeom2Essai.Node( 'Geometry' , 'Geometry' , 'MakeFuse' )
57 print MakeFuse.SetAuthor( '' )
58 print MakeFuse.SetContainer( 'FactoryServer' )
59 print MakeFuse.SetComment( '' )
60 MakeFuse.Coords( 465 , 106 )
61
62 # Creation of intermediate Output variables and of links
63 MakeSphereshape = MakeSphere.Port( 'shape' )
64 MakeCopyshape1 = GraphGeom2Essai.Link( MakeSphereshape , MakeCopy.Port( 'shape1' ) )
65 MakeTranslationshape1 = GraphGeom2Essai.Link( MakeSphereshape , MakeTranslation.Port( 'shape1' ) )
66 MakeCopyshape = MakeCopy.Port( 'shape' )
67 MakeFuseshape1 = GraphGeom2Essai.Link( MakeCopyshape , MakeFuse.Port( 'shape1' ) )
68 MakeTranslationshape = MakeTranslation.Port( 'shape' )
69 MakeFuseshape2 = GraphGeom2Essai.Link( MakeTranslationshape , MakeFuse.Port( 'shape2' ) )
70
71 # Creation of Input datas
72 MakeSpherex1 = MakeSphere.Input( 'x1' , 0)
73 MakeSpherey1 = MakeSphere.Input( 'y1' , 0)
74 MakeSpherez1 = MakeSphere.Input( 'z1' , 0)
75 MakeSphereradius = MakeSphere.Input( 'radius' , 50)
76 MakeTranslationx1 = MakeTranslation.Input( 'x1' , 80)
77 MakeTranslationy1 = MakeTranslation.Input( 'y1' , 0)
78 MakeTranslationz1 = MakeTranslation.Input( 'z1' , 0)
79
80 # Missing Input datas : None
81
82 # Creation of Output variables
83 MakeFuseshape = MakeFuse.Port( 'shape' )
84
85 # State of Ports of the Graph
86 GraphGeom2Essai.PrintPorts()
87
88 # Start asynchronous run
89 print GraphGeom2Essai.Run()
90
91 # Done ?
92 print GraphGeom2Essai.IsDone()
93
94 # Events of execution :
95 aStatus,aNode,anEvent,aState = GraphGeom2Essai.Event()
96 while aStatus :
97     print aNode.Thread(),aNode.SubGraph(),aNode.Name(),anEvent,aState
98     aStatus,aNode,anEvent,aState = GraphGeom2Essai.Event()
99 print GraphGeom2Essai.IsDone()
100
101 # Waiting end of execution :
102 print GraphGeom2Essai.DoneW()
103
104 print " "
105 print "Type print GraphGeom2Essai.IsDone()"
106 print "1 <==> It's done"
107 print " "
108 print "Type print GraphGeom2Essai.DoneW()"
109 print "Wait until end of execution : 1(success)"
110 print " "
111 print "Type GraphGeom2Essai.PrintPorts()"
112 print "     to see input and output values of the graph"
113 print " "
114 print "Type MakeSphere.PrintPorts()"
115 print "Type MakeCopy.PrintPorts()"
116 print "Type MakeTranslation.PrintPorts()"
117 print "Type MakeFuse.PrintPorts()"
118 print "     to see input and output values of nodes"
119 print " "
120 print "Type print GraphGeom2Essai.Export('File-Name')"
121 print "You will get a .py and a .xml file of this graph"