Salome HOME
Join modifications from branch OCC_development_for_3_2_0a2
[samples/datafiles.git] / Superv / Python / MacroWithGeomGates.py
1
2 # Generated python file of Graph aNewDataFlow_1_4
3
4 from SuperV import *
5
6 # Graph creation of aNewDataFlow_1_4
7 def DefaNewDataFlow_1_4() :
8     aNewDataFlow_1_4 = Graph( 'aNewDataFlow_1_4' )
9     aNewDataFlow_1_4.SetName( 'aNewDataFlow_1_4' )
10     aNewDataFlow_1_4.SetAuthor( '' )
11     aNewDataFlow_1_4.SetComment( '' )
12     aNewDataFlow_1_4.Coords( 0 , 0 )
13     
14     # Creation of Factory Nodes
15     
16     TranslateDXDYDZ = aNewDataFlow_1_4.FNode( 'GEOM_Superv' , 'GEOM_Superv' , 'TranslateDXDYDZ' )
17     TranslateDXDYDZ.SetName( 'TranslateDXDYDZ' )
18     TranslateDXDYDZ.SetAuthor( '' )
19     TranslateDXDYDZ.SetContainer( 'localhost/FactoryServer' )
20     TranslateDXDYDZ.SetComment( 'TranslateDXDYDZ from GEOM_Superv' )
21     TranslateDXDYDZ.Coords( 1051 , 118 )
22     ITranslateDXDYDZtheObject = TranslateDXDYDZ.GetInPort( 'theObject' )
23     ITranslateDXDYDZtheDX = TranslateDXDYDZ.GetInPort( 'theDX' )
24     ITranslateDXDYDZtheDY = TranslateDXDYDZ.GetInPort( 'theDY' )
25     ITranslateDXDYDZtheDZ = TranslateDXDYDZ.GetInPort( 'theDZ' )
26     ITranslateDXDYDZGate = TranslateDXDYDZ.GetInPort( 'Gate' )
27     OTranslateDXDYDZreturn = TranslateDXDYDZ.GetOutPort( 'return' )
28     OTranslateDXDYDZGate = TranslateDXDYDZ.GetOutPort( 'Gate' )
29     
30     MakeCopy = aNewDataFlow_1_4.FNode( 'GEOM_Superv' , 'GEOM_Superv' , 'MakeCopy' )
31     MakeCopy.SetName( 'MakeCopy' )
32     MakeCopy.SetAuthor( '' )
33     MakeCopy.SetContainer( 'localhost/FactoryServer' )
34     MakeCopy.SetComment( 'MakeCopy from GEOM_Superv' )
35     MakeCopy.Coords( 656 , 101 )
36     IMakeCopytheOriginal = MakeCopy.GetInPort( 'theOriginal' )
37     IMakeCopyGate = MakeCopy.GetInPort( 'Gate' )
38     OMakeCopyreturn = MakeCopy.GetOutPort( 'return' )
39     OMakeCopyGate = MakeCopy.GetOutPort( 'Gate' )
40     
41     MakeBox = aNewDataFlow_1_4.FNode( 'GEOM_Superv' , 'GEOM_Superv' , 'MakeBox' )
42     MakeBox.SetName( 'MakeBox' )
43     MakeBox.SetAuthor( '' )
44     MakeBox.SetContainer( 'localhost/FactoryServer' )
45     MakeBox.SetComment( 'MakeBox from GEOM_Superv' )
46     MakeBox.Coords( 219 , 14 )
47     IMakeBoxtheX1 = MakeBox.GetInPort( 'theX1' )
48     IMakeBoxtheY1 = MakeBox.GetInPort( 'theY1' )
49     IMakeBoxtheZ1 = MakeBox.GetInPort( 'theZ1' )
50     IMakeBoxtheX2 = MakeBox.GetInPort( 'theX2' )
51     IMakeBoxtheY2 = MakeBox.GetInPort( 'theY2' )
52     IMakeBoxtheZ2 = MakeBox.GetInPort( 'theZ2' )
53     IMakeBoxGate = MakeBox.GetInPort( 'Gate' )
54     OMakeBoxreturn = MakeBox.GetOutPort( 'return' )
55     OMakeBoxGate = MakeBox.GetOutPort( 'Gate' )
56     
57     MakeCopy_1 = aNewDataFlow_1_4.FNode( 'GEOM_Superv' , 'GEOM_Superv' , 'MakeCopy' )
58     MakeCopy_1.SetName( 'MakeCopy_1' )
59     MakeCopy_1.SetAuthor( '' )
60     MakeCopy_1.SetContainer( 'localhost/FactoryServer' )
61     MakeCopy_1.SetComment( 'MakeCopy from GEOM_Superv' )
62     MakeCopy_1.Coords( 1286 , 14 )
63     IMakeCopy_1theOriginal = MakeCopy_1.GetInPort( 'theOriginal' )
64     IMakeCopy_1Gate = MakeCopy_1.GetInPort( 'Gate' )
65     OMakeCopy_1return = MakeCopy_1.GetOutPort( 'return' )
66     OMakeCopy_1Gate = MakeCopy_1.GetOutPort( 'Gate' )
67     
68     MakeFuse = aNewDataFlow_1_4.FNode( 'GEOM_Superv' , 'GEOM_Superv' , 'MakeFuse' )
69     MakeFuse.SetName( 'MakeFuse' )
70     MakeFuse.SetAuthor( '' )
71     MakeFuse.SetContainer( 'localhost/FactoryServer' )
72     MakeFuse.SetComment( 'MakeFuse from GEOM_Superv' )
73     MakeFuse.Coords( 1549 , 146 )
74     IMakeFusetheShape1 = MakeFuse.GetInPort( 'theShape1' )
75     IMakeFusetheShape2 = MakeFuse.GetInPort( 'theShape2' )
76     IMakeFuseGate = MakeFuse.GetInPort( 'Gate' )
77     OMakeFusereturn = MakeFuse.GetOutPort( 'return' )
78     OMakeFuseGate = MakeFuse.GetOutPort( 'Gate' )
79     
80     MakeSphere = aNewDataFlow_1_4.FNode( 'GEOM_Superv' , 'GEOM_Superv' , 'MakeSphere' )
81     MakeSphere.SetName( 'MakeSphere' )
82     MakeSphere.SetAuthor( '' )
83     MakeSphere.SetContainer( 'localhost/FactoryServer' )
84     MakeSphere.SetComment( 'MakeSphere from GEOM_Superv' )
85     MakeSphere.Coords( 1749 , 41 )
86     IMakeSpheretheX = MakeSphere.GetInPort( 'theX' )
87     IMakeSpheretheY = MakeSphere.GetInPort( 'theY' )
88     IMakeSpheretheZ = MakeSphere.GetInPort( 'theZ' )
89     IMakeSpheretheRadius = MakeSphere.GetInPort( 'theRadius' )
90     IMakeSphereGate = MakeSphere.GetInPort( 'Gate' )
91     OMakeSpherereturn = MakeSphere.GetOutPort( 'return' )
92     OMakeSphereGate = MakeSphere.GetOutPort( 'Gate' )
93     
94     MakeFuse_1 = aNewDataFlow_1_4.FNode( 'GEOM_Superv' , 'GEOM_Superv' , 'MakeFuse' )
95     MakeFuse_1.SetName( 'MakeFuse_1' )
96     MakeFuse_1.SetAuthor( '' )
97     MakeFuse_1.SetContainer( 'localhost/FactoryServer' )
98     MakeFuse_1.SetComment( 'MakeFuse from GEOM_Superv' )
99     MakeFuse_1.Coords( 2007 , 210 )
100     IMakeFuse_1theShape1 = MakeFuse_1.GetInPort( 'theShape1' )
101     IMakeFuse_1theShape2 = MakeFuse_1.GetInPort( 'theShape2' )
102     IMakeFuse_1Gate = MakeFuse_1.GetInPort( 'Gate' )
103     OMakeFuse_1return = MakeFuse_1.GetOutPort( 'return' )
104     OMakeFuse_1Gate = MakeFuse_1.GetOutPort( 'Gate' )
105     
106     SetStudyID = aNewDataFlow_1_4.FNode( 'GEOM_Superv' , 'GEOM_Superv' , 'SetStudyID' )
107     SetStudyID.SetName( 'SetStudyID' )
108     SetStudyID.SetAuthor( '' )
109     SetStudyID.SetContainer( 'localhost/FactoryServer' )
110     SetStudyID.SetComment( 'SetStudyID from GEOM_Superv' )
111     SetStudyID.Coords( 7 , 269 )
112     ISetStudyIDtheStudyID = SetStudyID.GetInPort( 'theStudyID' )
113     ISetStudyIDGate = SetStudyID.GetInPort( 'Gate' )
114     OSetStudyIDGate = SetStudyID.GetOutPort( 'Gate' )
115     
116     # Creation of Macro Nodes
117     aNewDataFlow_1_1_2 = DefaNewDataFlow_1_1_2()
118     Macro_aNewDataFlow_1 = aNewDataFlow_1_4.GraphMNode( aNewDataFlow_1_1_2 )
119     Macro_aNewDataFlow_1.SetCoupled( 'aNewDataFlow_1_1_2' )
120     Macro_aNewDataFlow_1.SetName( 'Macro_aNewDataFlow_1' )
121     Macro_aNewDataFlow_1.SetAuthor( '' )
122     Macro_aNewDataFlow_1.SetComment( 'Macro Node' )
123     Macro_aNewDataFlow_1.Coords( 718 , 263 )
124     IMacro_aNewDataFlow_1sum__a = Macro_aNewDataFlow_1.GetInPort( 'sum__a' )
125     IMacro_aNewDataFlow_1sum__b = Macro_aNewDataFlow_1.GetInPort( 'sum__b' )
126     IMacro_aNewDataFlow_1Gate = Macro_aNewDataFlow_1.GetInPort( 'Gate' )
127     OMacro_aNewDataFlow_1Mult__b = Macro_aNewDataFlow_1.GetOutPort( 'Mult__b' )
128     OMacro_aNewDataFlow_1Gate = Macro_aNewDataFlow_1.GetOutPort( 'Gate' )
129     
130     # Creation of Links
131     LMacro_aNewDataFlow_1Mult__bTranslateDXDYDZtheDY = aNewDataFlow_1_4.Link( OMacro_aNewDataFlow_1Mult__b , ITranslateDXDYDZtheDY )
132     
133     LTranslateDXDYDZreturnMakeFusetheShape1 = aNewDataFlow_1_4.Link( OTranslateDXDYDZreturn , IMakeFusetheShape1 )
134     
135     LTranslateDXDYDZGateMakeCopy_1Gate = aNewDataFlow_1_4.Link( OTranslateDXDYDZGate , IMakeCopy_1Gate )
136     
137     LMakeCopyreturnTranslateDXDYDZtheObject = aNewDataFlow_1_4.Link( OMakeCopyreturn , ITranslateDXDYDZtheObject )
138     
139     LMakeCopyGateTranslateDXDYDZGate = aNewDataFlow_1_4.Link( OMakeCopyGate , ITranslateDXDYDZGate )
140     
141     LMakeBoxreturnMakeCopytheOriginal = aNewDataFlow_1_4.Link( OMakeBoxreturn , IMakeCopytheOriginal )
142     
143     LMakeBoxreturnMakeCopy_1theOriginal = aNewDataFlow_1_4.Link( OMakeBoxreturn , IMakeCopy_1theOriginal )
144     
145     LMakeBoxGateMakeCopyGate = aNewDataFlow_1_4.Link( OMakeBoxGate , IMakeCopyGate )
146     
147     LMakeCopy_1returnMakeFusetheShape2 = aNewDataFlow_1_4.Link( OMakeCopy_1return , IMakeFusetheShape2 )
148     
149     LMakeCopy_1GateMakeFuseGate = aNewDataFlow_1_4.Link( OMakeCopy_1Gate , IMakeFuseGate )
150     
151     LMakeFusereturnMakeFuse_1theShape1 = aNewDataFlow_1_4.Link( OMakeFusereturn , IMakeFuse_1theShape1 )
152     
153     LMakeFuseGateMakeSphereGate = aNewDataFlow_1_4.Link( OMakeFuseGate , IMakeSphereGate )
154     
155     LMakeSpherereturnMakeFuse_1theShape2 = aNewDataFlow_1_4.Link( OMakeSpherereturn , IMakeFuse_1theShape2 )
156     
157     LMakeSphereGateMakeFuse_1Gate = aNewDataFlow_1_4.Link( OMakeSphereGate , IMakeFuse_1Gate )
158     
159     LSetStudyIDGateMakeBoxGate = aNewDataFlow_1_4.Link( OSetStudyIDGate , IMakeBoxGate )
160     
161     # Input datas
162     IMacro_aNewDataFlow_1sum__a.Input( 1 )
163     IMacro_aNewDataFlow_1sum__b.Input( 2 )
164     ITranslateDXDYDZtheDX.Input( 25 )
165     ITranslateDXDYDZtheDZ.Input( 25 )
166     IMakeBoxtheX1.Input( 0 )
167     IMakeBoxtheY1.Input( 0 )
168     IMakeBoxtheZ1.Input( 0 )
169     IMakeBoxtheX2.Input( 50 )
170     IMakeBoxtheY2.Input( 50 )
171     IMakeBoxtheZ2.Input( 50 )
172     IMakeSpheretheX.Input( 0 )
173     IMakeSpheretheY.Input( 0 )
174     IMakeSpheretheZ.Input( 0 )
175     IMakeSpheretheRadius.Input( 12 )
176     ISetStudyIDtheStudyID.Input( 12 )
177     
178     # Output Ports of the graph
179     #OMakeFuse_1return = MakeFuse_1.GetOutPort( 'return' )
180     return aNewDataFlow_1_4
181
182 # Graph creation of aNewDataFlow_1_1_2
183 def DefaNewDataFlow_1_1_2() :
184     aNewDataFlow_1_1_2 = Graph( 'aNewDataFlow_1_1_2' )
185     aNewDataFlow_1_1_2.SetCoupled( 'Macro_aNewDataFlow_1' )
186     aNewDataFlow_1_1_2.SetName( 'aNewDataFlow_1_1_2' )
187     aNewDataFlow_1_1_2.SetAuthor( '' )
188     aNewDataFlow_1_1_2.SetComment( '' )
189     aNewDataFlow_1_1_2.Coords( 0 , 0 )
190     
191     # Creation of Factory Nodes
192     
193     # Creation of InLine Nodes
194     PyMult = []
195     PyMult.append( 'def Mult(a): ' )
196     PyMult.append( '   b = a*3 ' )
197     PyMult.append( '   return b ' )
198     Mult = aNewDataFlow_1_1_2.INode( 'Mult' , PyMult )
199     Mult.SetName( 'Mult' )
200     Mult.SetAuthor( '' )
201     Mult.SetComment( 'Compute Node' )
202     Mult.Coords( 382 , 78 )
203     IMulta = Mult.InPort( 'a' , 'double' )
204     IMultGate = Mult.GetInPort( 'Gate' )
205     OMultb = Mult.OutPort( 'b' , 'double' )
206     OMultGate = Mult.GetOutPort( 'Gate' )
207     
208     Pysum = []
209     Pysum.append( 'def sum(a, b): ' )
210     Pysum.append( '   return a+b' )
211     sum = aNewDataFlow_1_1_2.INode( 'sum' , Pysum )
212     sum.SetName( 'sum' )
213     sum.SetAuthor( '' )
214     sum.SetComment( 'Compute Node' )
215     sum.Coords( 47 , 87 )
216     Isuma = sum.InPort( 'a' , 'double' )
217     Isumb = sum.InPort( 'b' , 'double' )
218     IsumGate = sum.GetInPort( 'Gate' )
219     Osums = sum.OutPort( 's' , 'double' )
220     OsumGate = sum.GetOutPort( 'Gate' )
221     
222     # Creation of Links
223     LsumsMulta = aNewDataFlow_1_1_2.Link( Osums , IMulta )
224     
225     # Input Ports of the graph
226     #Isuma = sum.GetInPort( 'a' )
227     #Isumb = sum.GetInPort( 'b' )
228     
229     # Output Ports of the graph
230     #OMultb = Mult.GetOutPort( 'b' )
231     return aNewDataFlow_1_1_2
232
233
234 aNewDataFlow_1_4 = DefaNewDataFlow_1_4()