Salome HOME
Merge from V6_main_20120808 08Aug12
[samples/datafiles.git] / Superv / Python / MacroWithGeomGates.py
1 #  Copyright (C) 2007-2011  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_1_4
23 #
24 from SuperV import *
25
26 # Graph creation of aNewDataFlow_1_4
27 def DefaNewDataFlow_1_4() :
28     aNewDataFlow_1_4 = Graph( 'aNewDataFlow_1_4' )
29     aNewDataFlow_1_4.SetName( 'aNewDataFlow_1_4' )
30     aNewDataFlow_1_4.SetAuthor( '' )
31     aNewDataFlow_1_4.SetComment( '' )
32     aNewDataFlow_1_4.Coords( 0 , 0 )
33     
34     # Creation of Factory Nodes
35     
36     TranslateDXDYDZ = aNewDataFlow_1_4.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( 1051 , 118 )
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_1_4.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( 656 , 101 )
56     IMakeCopytheOriginal = MakeCopy.GetInPort( 'theOriginal' )
57     IMakeCopyGate = MakeCopy.GetInPort( 'Gate' )
58     OMakeCopyreturn = MakeCopy.GetOutPort( 'return' )
59     OMakeCopyGate = MakeCopy.GetOutPort( 'Gate' )
60     
61     MakeBox = aNewDataFlow_1_4.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_1_4.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( 1286 , 14 )
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_1_4.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( 1549 , 146 )
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_1_4.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( 1749 , 41 )
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_1_4.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( 2007 , 210 )
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_1_4.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_1_2 = DefaNewDataFlow_1_1_2()
138     Macro_aNewDataFlow_1 = aNewDataFlow_1_4.GraphMNode( aNewDataFlow_1_1_2 )
139     Macro_aNewDataFlow_1.SetCoupled( 'aNewDataFlow_1_1_2' )
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( 718 , 263 )
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_1_4.Link( OMacro_aNewDataFlow_1Mult__b , ITranslateDXDYDZtheDY )
152     
153     LTranslateDXDYDZreturnMakeFusetheShape1 = aNewDataFlow_1_4.Link( OTranslateDXDYDZreturn , IMakeFusetheShape1 )
154     
155     LTranslateDXDYDZGateMakeCopy_1Gate = aNewDataFlow_1_4.Link( OTranslateDXDYDZGate , IMakeCopy_1Gate )
156     
157     LMakeCopyreturnTranslateDXDYDZtheObject = aNewDataFlow_1_4.Link( OMakeCopyreturn , ITranslateDXDYDZtheObject )
158     
159     LMakeCopyGateTranslateDXDYDZGate = aNewDataFlow_1_4.Link( OMakeCopyGate , ITranslateDXDYDZGate )
160     
161     LMakeBoxreturnMakeCopytheOriginal = aNewDataFlow_1_4.Link( OMakeBoxreturn , IMakeCopytheOriginal )
162     
163     LMakeBoxreturnMakeCopy_1theOriginal = aNewDataFlow_1_4.Link( OMakeBoxreturn , IMakeCopy_1theOriginal )
164     
165     LMakeBoxGateMakeCopyGate = aNewDataFlow_1_4.Link( OMakeBoxGate , IMakeCopyGate )
166     
167     LMakeCopy_1returnMakeFusetheShape2 = aNewDataFlow_1_4.Link( OMakeCopy_1return , IMakeFusetheShape2 )
168     
169     LMakeCopy_1GateMakeFuseGate = aNewDataFlow_1_4.Link( OMakeCopy_1Gate , IMakeFuseGate )
170     
171     LMakeFusereturnMakeFuse_1theShape1 = aNewDataFlow_1_4.Link( OMakeFusereturn , IMakeFuse_1theShape1 )
172     
173     LMakeFuseGateMakeSphereGate = aNewDataFlow_1_4.Link( OMakeFuseGate , IMakeSphereGate )
174     
175     LMakeSpherereturnMakeFuse_1theShape2 = aNewDataFlow_1_4.Link( OMakeSpherereturn , IMakeFuse_1theShape2 )
176     
177     LMakeSphereGateMakeFuse_1Gate = aNewDataFlow_1_4.Link( OMakeSphereGate , IMakeFuse_1Gate )
178     
179     LSetStudyIDGateMakeBoxGate = aNewDataFlow_1_4.Link( OSetStudyIDGate , IMakeBoxGate )
180     
181     # Input datas
182     IMacro_aNewDataFlow_1sum__a.Input( 1 )
183     IMacro_aNewDataFlow_1sum__b.Input( 2 )
184     ITranslateDXDYDZtheDX.Input( 25 )
185     ITranslateDXDYDZtheDZ.Input( 25 )
186     IMakeBoxtheX1.Input( 0 )
187     IMakeBoxtheY1.Input( 0 )
188     IMakeBoxtheZ1.Input( 0 )
189     IMakeBoxtheX2.Input( 50 )
190     IMakeBoxtheY2.Input( 50 )
191     IMakeBoxtheZ2.Input( 50 )
192     IMakeSpheretheX.Input( 0 )
193     IMakeSpheretheY.Input( 0 )
194     IMakeSpheretheZ.Input( 0 )
195     IMakeSpheretheRadius.Input( 12 )
196     ISetStudyIDtheStudyID.Input( 12 )
197     
198     # Output Ports of the graph
199     #OMakeFuse_1return = MakeFuse_1.GetOutPort( 'return' )
200     return aNewDataFlow_1_4
201
202 # Graph creation of aNewDataFlow_1_1_2
203 def DefaNewDataFlow_1_1_2() :
204     aNewDataFlow_1_1_2 = Graph( 'aNewDataFlow_1_1_2' )
205     aNewDataFlow_1_1_2.SetCoupled( 'Macro_aNewDataFlow_1' )
206     aNewDataFlow_1_1_2.SetName( 'aNewDataFlow_1_1_2' )
207     aNewDataFlow_1_1_2.SetAuthor( '' )
208     aNewDataFlow_1_1_2.SetComment( '' )
209     aNewDataFlow_1_1_2.Coords( 0 , 0 )
210     
211     # Creation of Factory Nodes
212     
213     # Creation of InLine Nodes
214     PyMult = []
215     PyMult.append( 'def Mult(a): ' )
216     PyMult.append( '   b = a*3 ' )
217     PyMult.append( '   return b ' )
218     Mult = aNewDataFlow_1_1_2.INode( 'Mult' , PyMult )
219     Mult.SetName( 'Mult' )
220     Mult.SetAuthor( '' )
221     Mult.SetComment( 'Compute Node' )
222     Mult.Coords( 382 , 78 )
223     IMulta = Mult.InPort( 'a' , 'double' )
224     IMultGate = Mult.GetInPort( 'Gate' )
225     OMultb = Mult.OutPort( 'b' , 'double' )
226     OMultGate = Mult.GetOutPort( 'Gate' )
227     
228     Pysum = []
229     Pysum.append( 'def sum(a, b): ' )
230     Pysum.append( '   return a+b' )
231     sum = aNewDataFlow_1_1_2.INode( 'sum' , Pysum )
232     sum.SetName( 'sum' )
233     sum.SetAuthor( '' )
234     sum.SetComment( 'Compute Node' )
235     sum.Coords( 47 , 87 )
236     Isuma = sum.InPort( 'a' , 'double' )
237     Isumb = sum.InPort( 'b' , 'double' )
238     IsumGate = sum.GetInPort( 'Gate' )
239     Osums = sum.OutPort( 's' , 'double' )
240     OsumGate = sum.GetOutPort( 'Gate' )
241     
242     # Creation of Links
243     LsumsMulta = aNewDataFlow_1_1_2.Link( Osums , IMulta )
244     
245     # Input Ports of the graph
246     #Isuma = sum.GetInPort( 'a' )
247     #Isumb = sum.GetInPort( 'b' )
248     
249     # Output Ports of the graph
250     #OMultb = Mult.GetOutPort( 'b' )
251     return aNewDataFlow_1_1_2
252
253
254 aNewDataFlow_1_4 = DefaNewDataFlow_1_4()