Salome HOME
caf695fecb4c4bfdbe0d80f7e98827051d09bbd1
[samples/datafiles.git] / Superv / Python / MacroWithGeom.py
1 #  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
2 #
3 #  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 #  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
5 #
6 #  This library is free software; you can redistribute it and/or
7 #  modify it under the terms of the GNU Lesser General Public
8 #  License as published by the Free Software Foundation; either
9 #  version 2.1 of the License.
10 #
11 #  This library is distributed in the hope that it will be useful,
12 #  but WITHOUT ANY WARRANTY; without even the implied warranty of
13 #  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14 #  Lesser General Public License for more details.
15 #
16 #  You should have received a copy of the GNU Lesser General Public
17 #  License along with this library; if not, write to the Free Software
18 #  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
19 #
20 #  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
21 #
22 # Generated python file of Graph aNewDataFlow
23 #
24 from SuperV import *
25
26 # Graph creation of aNewDataFlow
27 def DefaNewDataFlow() :
28     aNewDataFlow = Graph( 'aNewDataFlow' )
29     aNewDataFlow.SetName( 'aNewDataFlow' )
30     aNewDataFlow.SetAuthor( '' )
31     aNewDataFlow.SetComment( '' )
32     aNewDataFlow.Coords( 0 , 0 )
33     
34     # Creation of Factory Nodes
35     
36     TranslateDXDYDZ = aNewDataFlow.FNode( 'GEOM_Superv' , 'GEOM_Superv' , 'TranslateDXDYDZ' )
37     TranslateDXDYDZ.SetName( 'TranslateDXDYDZ' )
38     TranslateDXDYDZ.SetAuthor( '' )
39     TranslateDXDYDZ.SetContainer( 'localhost/FactoryServer' )
40     TranslateDXDYDZ.SetComment( 'TranslateDXDYDZ from GEOM_Superv' )
41     TranslateDXDYDZ.Coords( 735 , 14 )
42     ITranslateDXDYDZtheObject = TranslateDXDYDZ.GetInPort( 'theObject' )
43     ITranslateDXDYDZtheDX = TranslateDXDYDZ.GetInPort( 'theDX' )
44     ITranslateDXDYDZtheDY = TranslateDXDYDZ.GetInPort( 'theDY' )
45     ITranslateDXDYDZtheDZ = TranslateDXDYDZ.GetInPort( 'theDZ' )
46     ITranslateDXDYDZGate = TranslateDXDYDZ.GetInPort( 'Gate' )
47     OTranslateDXDYDZreturn = TranslateDXDYDZ.GetOutPort( 'return' )
48     OTranslateDXDYDZGate = TranslateDXDYDZ.GetOutPort( 'Gate' )
49     
50     MakeCopy = aNewDataFlow.FNode( 'GEOM_Superv' , 'GEOM_Superv' , 'MakeCopy' )
51     MakeCopy.SetName( 'MakeCopy' )
52     MakeCopy.SetAuthor( '' )
53     MakeCopy.SetContainer( 'localhost/FactoryServer' )
54     MakeCopy.SetComment( 'MakeCopy from GEOM_Superv' )
55     MakeCopy.Coords( 477 , 14 )
56     IMakeCopytheOriginal = MakeCopy.GetInPort( 'theOriginal' )
57     IMakeCopyGate = MakeCopy.GetInPort( 'Gate' )
58     OMakeCopyreturn = MakeCopy.GetOutPort( 'return' )
59     OMakeCopyGate = MakeCopy.GetOutPort( 'Gate' )
60     
61     MakeBox = aNewDataFlow.FNode( 'GEOM_Superv' , 'GEOM_Superv' , 'MakeBox' )
62     MakeBox.SetName( 'MakeBox' )
63     MakeBox.SetAuthor( '' )
64     MakeBox.SetContainer( 'localhost/FactoryServer' )
65     MakeBox.SetComment( 'MakeBox from GEOM_Superv' )
66     MakeBox.Coords( 219 , 14 )
67     IMakeBoxtheX1 = MakeBox.GetInPort( 'theX1' )
68     IMakeBoxtheY1 = MakeBox.GetInPort( 'theY1' )
69     IMakeBoxtheZ1 = MakeBox.GetInPort( 'theZ1' )
70     IMakeBoxtheX2 = MakeBox.GetInPort( 'theX2' )
71     IMakeBoxtheY2 = MakeBox.GetInPort( 'theY2' )
72     IMakeBoxtheZ2 = MakeBox.GetInPort( 'theZ2' )
73     IMakeBoxGate = MakeBox.GetInPort( 'Gate' )
74     OMakeBoxreturn = MakeBox.GetOutPort( 'return' )
75     OMakeBoxGate = MakeBox.GetOutPort( 'Gate' )
76     
77     MakeCopy_1 = aNewDataFlow.FNode( 'GEOM_Superv' , 'GEOM_Superv' , 'MakeCopy' )
78     MakeCopy_1.SetName( 'MakeCopy_1' )
79     MakeCopy_1.SetAuthor( '' )
80     MakeCopy_1.SetContainer( 'localhost/FactoryServer' )
81     MakeCopy_1.SetComment( 'MakeCopy from GEOM_Superv' )
82     MakeCopy_1.Coords( 482 , 306 )
83     IMakeCopy_1theOriginal = MakeCopy_1.GetInPort( 'theOriginal' )
84     IMakeCopy_1Gate = MakeCopy_1.GetInPort( 'Gate' )
85     OMakeCopy_1return = MakeCopy_1.GetOutPort( 'return' )
86     OMakeCopy_1Gate = MakeCopy_1.GetOutPort( 'Gate' )
87     
88     MakeFuse = aNewDataFlow.FNode( 'GEOM_Superv' , 'GEOM_Superv' , 'MakeFuse' )
89     MakeFuse.SetName( 'MakeFuse' )
90     MakeFuse.SetAuthor( '' )
91     MakeFuse.SetContainer( 'localhost/FactoryServer' )
92     MakeFuse.SetComment( 'MakeFuse from GEOM_Superv' )
93     MakeFuse.Coords( 950 , 121 )
94     IMakeFusetheShape1 = MakeFuse.GetInPort( 'theShape1' )
95     IMakeFusetheShape2 = MakeFuse.GetInPort( 'theShape2' )
96     IMakeFuseGate = MakeFuse.GetInPort( 'Gate' )
97     OMakeFusereturn = MakeFuse.GetOutPort( 'return' )
98     OMakeFuseGate = MakeFuse.GetOutPort( 'Gate' )
99     
100     MakeSphere = aNewDataFlow.FNode( 'GEOM_Superv' , 'GEOM_Superv' , 'MakeSphere' )
101     MakeSphere.SetName( 'MakeSphere' )
102     MakeSphere.SetAuthor( '' )
103     MakeSphere.SetContainer( 'localhost/FactoryServer' )
104     MakeSphere.SetComment( 'MakeSphere from GEOM_Superv' )
105     MakeSphere.Coords( 227 , 409 )
106     IMakeSpheretheX = MakeSphere.GetInPort( 'theX' )
107     IMakeSpheretheY = MakeSphere.GetInPort( 'theY' )
108     IMakeSpheretheZ = MakeSphere.GetInPort( 'theZ' )
109     IMakeSpheretheRadius = MakeSphere.GetInPort( 'theRadius' )
110     IMakeSphereGate = MakeSphere.GetInPort( 'Gate' )
111     OMakeSpherereturn = MakeSphere.GetOutPort( 'return' )
112     OMakeSphereGate = MakeSphere.GetOutPort( 'Gate' )
113     
114     MakeFuse_1 = aNewDataFlow.FNode( 'GEOM_Superv' , 'GEOM_Superv' , 'MakeFuse' )
115     MakeFuse_1.SetName( 'MakeFuse_1' )
116     MakeFuse_1.SetAuthor( '' )
117     MakeFuse_1.SetContainer( 'localhost/FactoryServer' )
118     MakeFuse_1.SetComment( 'MakeFuse from GEOM_Superv' )
119     MakeFuse_1.Coords( 1217 , 389 )
120     IMakeFuse_1theShape1 = MakeFuse_1.GetInPort( 'theShape1' )
121     IMakeFuse_1theShape2 = MakeFuse_1.GetInPort( 'theShape2' )
122     IMakeFuse_1Gate = MakeFuse_1.GetInPort( 'Gate' )
123     OMakeFuse_1return = MakeFuse_1.GetOutPort( 'return' )
124     OMakeFuse_1Gate = MakeFuse_1.GetOutPort( 'Gate' )
125     
126     SetStudyID = aNewDataFlow.FNode( 'GEOM_Superv' , 'GEOM_Superv' , 'SetStudyID' )
127     SetStudyID.SetName( 'SetStudyID' )
128     SetStudyID.SetAuthor( '' )
129     SetStudyID.SetContainer( 'localhost/FactoryServer' )
130     SetStudyID.SetComment( 'SetStudyID from GEOM_Superv' )
131     SetStudyID.Coords( 7 , 269 )
132     ISetStudyIDtheStudyID = SetStudyID.GetInPort( 'theStudyID' )
133     ISetStudyIDGate = SetStudyID.GetInPort( 'Gate' )
134     OSetStudyIDGate = SetStudyID.GetOutPort( 'Gate' )
135     
136     # Creation of Macro Nodes
137     aNewDataFlow_1 = DefaNewDataFlow_1()
138     Macro_aNewDataFlow_1 = aNewDataFlow.GraphMNode( aNewDataFlow_1 )
139     Macro_aNewDataFlow_1.SetCoupled( 'aNewDataFlow_1' )
140     Macro_aNewDataFlow_1.SetName( 'Macro_aNewDataFlow_1' )
141     Macro_aNewDataFlow_1.SetAuthor( '' )
142     Macro_aNewDataFlow_1.SetComment( 'Macro Node' )
143     Macro_aNewDataFlow_1.Coords( 480 , 145 )
144     IMacro_aNewDataFlow_1sum__a = Macro_aNewDataFlow_1.GetInPort( 'sum__a' )
145     IMacro_aNewDataFlow_1sum__b = Macro_aNewDataFlow_1.GetInPort( 'sum__b' )
146     IMacro_aNewDataFlow_1Gate = Macro_aNewDataFlow_1.GetInPort( 'Gate' )
147     OMacro_aNewDataFlow_1Mult__b = Macro_aNewDataFlow_1.GetOutPort( 'Mult__b' )
148     OMacro_aNewDataFlow_1Gate = Macro_aNewDataFlow_1.GetOutPort( 'Gate' )
149     
150     # Creation of Links
151     LMacro_aNewDataFlow_1Mult__bTranslateDXDYDZtheDY = aNewDataFlow.Link( OMacro_aNewDataFlow_1Mult__b , ITranslateDXDYDZtheDY )
152     
153     LTranslateDXDYDZreturnMakeFusetheShape1 = aNewDataFlow.Link( OTranslateDXDYDZreturn , IMakeFusetheShape1 )
154     
155     LMakeCopyreturnTranslateDXDYDZtheObject = aNewDataFlow.Link( OMakeCopyreturn , ITranslateDXDYDZtheObject )
156     
157     LMakeBoxreturnMakeCopytheOriginal = aNewDataFlow.Link( OMakeBoxreturn , IMakeCopytheOriginal )
158     
159     LMakeBoxreturnMakeCopy_1theOriginal = aNewDataFlow.Link( OMakeBoxreturn , IMakeCopy_1theOriginal )
160     
161     LMakeCopy_1returnMakeFusetheShape2 = aNewDataFlow.Link( OMakeCopy_1return , IMakeFusetheShape2 )
162     
163     LMakeFusereturnMakeFuse_1theShape1 = aNewDataFlow.Link( OMakeFusereturn , IMakeFuse_1theShape1 )
164     
165     LMakeSpherereturnMakeFuse_1theShape2 = aNewDataFlow.Link( OMakeSpherereturn , IMakeFuse_1theShape2 )
166     
167     LSetStudyIDGateMakeBoxGate = aNewDataFlow.Link( OSetStudyIDGate , IMakeBoxGate )
168     
169     LSetStudyIDGateMakeSphereGate = aNewDataFlow.Link( OSetStudyIDGate , IMakeSphereGate )
170     
171     # Input datas
172     IMacro_aNewDataFlow_1sum__a.Input( 1 )
173     IMacro_aNewDataFlow_1sum__b.Input( 2 )
174     ITranslateDXDYDZtheDX.Input( 25 )
175     ITranslateDXDYDZtheDZ.Input( 25 )
176     IMakeBoxtheX1.Input( 0 )
177     IMakeBoxtheY1.Input( 0 )
178     IMakeBoxtheZ1.Input( 0 )
179     IMakeBoxtheX2.Input( 50 )
180     IMakeBoxtheY2.Input( 50 )
181     IMakeBoxtheZ2.Input( 50 )
182     IMakeSpheretheX.Input( 0 )
183     IMakeSpheretheY.Input( 0 )
184     IMakeSpheretheZ.Input( 0 )
185     IMakeSpheretheRadius.Input( 12 )
186     ISetStudyIDtheStudyID.Input( 1 )
187     
188     # Output Ports of the graph
189     #OMakeFuse_1return = MakeFuse_1.GetOutPort( 'return' )
190     return aNewDataFlow
191
192 # Graph creation of aNewDataFlow_1
193 def DefaNewDataFlow_1() :
194     aNewDataFlow_1 = Graph( 'aNewDataFlow_1' )
195     aNewDataFlow_1.SetCoupled( 'Macro_aNewDataFlow_1' )
196     aNewDataFlow_1.SetName( 'aNewDataFlow_1' )
197     aNewDataFlow_1.SetAuthor( '' )
198     aNewDataFlow_1.SetComment( '' )
199     aNewDataFlow_1.Coords( 0 , 0 )
200     
201     # Creation of Factory Nodes
202     
203     # Creation of InLine Nodes
204     PyMult = []
205     PyMult.append( 'def Mult(a): ' )
206     PyMult.append( '   b = a*3 ' )
207     PyMult.append( '   return b ' )
208     Mult = aNewDataFlow_1.INode( 'Mult' , PyMult )
209     Mult.SetName( 'Mult' )
210     Mult.SetAuthor( '' )
211     Mult.SetComment( 'Compute Node' )
212     Mult.Coords( 382 , 78 )
213     IMulta = Mult.InPort( 'a' , 'double' )
214     IMultGate = Mult.GetInPort( 'Gate' )
215     OMultb = Mult.OutPort( 'b' , 'double' )
216     OMultGate = Mult.GetOutPort( 'Gate' )
217     
218     Pysum = []
219     Pysum.append( 'def sum(a, b): ' )
220     Pysum.append( '   return a+b' )
221     sum = aNewDataFlow_1.INode( 'sum' , Pysum )
222     sum.SetName( 'sum' )
223     sum.SetAuthor( '' )
224     sum.SetComment( 'Compute Node' )
225     sum.Coords( 47 , 87 )
226     Isuma = sum.InPort( 'a' , 'double' )
227     Isumb = sum.InPort( 'b' , 'double' )
228     IsumGate = sum.GetInPort( 'Gate' )
229     Osums = sum.OutPort( 's' , 'double' )
230     OsumGate = sum.GetOutPort( 'Gate' )
231     
232     # Creation of Links
233     LsumsMulta = aNewDataFlow_1.Link( Osums , IMulta )
234     
235     # Input Ports of the graph
236     #Isuma = sum.GetInPort( 'a' )
237     #Isumb = sum.GetInPort( 'b' )
238     
239     # Output Ports of the graph
240     #OMultb = Mult.GetOutPort( 'b' )
241     return aNewDataFlow_1
242
243
244 aNewDataFlow = DefaNewDataFlow()