Salome HOME
Imported using TkCVS
[samples/datafiles.git] / Superv / Python / MacroWithGeom.py
1
2 # Generated python file of Graph aNewDataFlow
3
4 from SuperV import *
5
6 # Graph creation of aNewDataFlow
7 def DefaNewDataFlow() :
8     aNewDataFlow = Graph( 'aNewDataFlow' )
9     aNewDataFlow.SetName( 'aNewDataFlow' )
10     aNewDataFlow.SetAuthor( '' )
11     aNewDataFlow.SetComment( '' )
12     aNewDataFlow.Coords( 0 , 0 )
13     
14     # Creation of Factory Nodes
15     
16     TranslateDXDYDZ = aNewDataFlow.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( 735 , 14 )
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.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( 477 , 14 )
36     IMakeCopytheOriginal = MakeCopy.GetInPort( 'theOriginal' )
37     IMakeCopyGate = MakeCopy.GetInPort( 'Gate' )
38     OMakeCopyreturn = MakeCopy.GetOutPort( 'return' )
39     OMakeCopyGate = MakeCopy.GetOutPort( 'Gate' )
40     
41     MakeBox = aNewDataFlow.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.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( 482 , 306 )
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.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( 950 , 121 )
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.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( 227 , 409 )
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.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( 1217 , 389 )
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.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 = DefaNewDataFlow_1()
118     Macro_aNewDataFlow_1 = aNewDataFlow.GraphMNode( aNewDataFlow_1 )
119     Macro_aNewDataFlow_1.SetCoupled( 'aNewDataFlow_1' )
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( 480 , 145 )
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.Link( OMacro_aNewDataFlow_1Mult__b , ITranslateDXDYDZtheDY )
132     
133     LTranslateDXDYDZreturnMakeFusetheShape1 = aNewDataFlow.Link( OTranslateDXDYDZreturn , IMakeFusetheShape1 )
134     
135     LMakeCopyreturnTranslateDXDYDZtheObject = aNewDataFlow.Link( OMakeCopyreturn , ITranslateDXDYDZtheObject )
136     
137     LMakeBoxreturnMakeCopytheOriginal = aNewDataFlow.Link( OMakeBoxreturn , IMakeCopytheOriginal )
138     
139     LMakeBoxreturnMakeCopy_1theOriginal = aNewDataFlow.Link( OMakeBoxreturn , IMakeCopy_1theOriginal )
140     
141     LMakeCopy_1returnMakeFusetheShape2 = aNewDataFlow.Link( OMakeCopy_1return , IMakeFusetheShape2 )
142     
143     LMakeFusereturnMakeFuse_1theShape1 = aNewDataFlow.Link( OMakeFusereturn , IMakeFuse_1theShape1 )
144     
145     LMakeSpherereturnMakeFuse_1theShape2 = aNewDataFlow.Link( OMakeSpherereturn , IMakeFuse_1theShape2 )
146     
147     LSetStudyIDGateMakeBoxGate = aNewDataFlow.Link( OSetStudyIDGate , IMakeBoxGate )
148     
149     LSetStudyIDGateMakeSphereGate = aNewDataFlow.Link( OSetStudyIDGate , IMakeSphereGate )
150     
151     # Input datas
152     IMacro_aNewDataFlow_1sum__a.Input( 1 )
153     IMacro_aNewDataFlow_1sum__b.Input( 2 )
154     ITranslateDXDYDZtheDX.Input( 25 )
155     ITranslateDXDYDZtheDZ.Input( 25 )
156     IMakeBoxtheX1.Input( 0 )
157     IMakeBoxtheY1.Input( 0 )
158     IMakeBoxtheZ1.Input( 0 )
159     IMakeBoxtheX2.Input( 50 )
160     IMakeBoxtheY2.Input( 50 )
161     IMakeBoxtheZ2.Input( 50 )
162     IMakeSpheretheX.Input( 0 )
163     IMakeSpheretheY.Input( 0 )
164     IMakeSpheretheZ.Input( 0 )
165     IMakeSpheretheRadius.Input( 12 )
166     ISetStudyIDtheStudyID.Input( 1 )
167     
168     # Output Ports of the graph
169     #OMakeFuse_1return = MakeFuse_1.GetOutPort( 'return' )
170     return aNewDataFlow
171
172 # Graph creation of aNewDataFlow_1
173 def DefaNewDataFlow_1() :
174     aNewDataFlow_1 = Graph( 'aNewDataFlow_1' )
175     aNewDataFlow_1.SetCoupled( 'Macro_aNewDataFlow_1' )
176     aNewDataFlow_1.SetName( 'aNewDataFlow_1' )
177     aNewDataFlow_1.SetAuthor( '' )
178     aNewDataFlow_1.SetComment( '' )
179     aNewDataFlow_1.Coords( 0 , 0 )
180     
181     # Creation of Factory Nodes
182     
183     # Creation of InLine Nodes
184     PyMult = []
185     PyMult.append( 'def Mult(a): ' )
186     PyMult.append( '   b = a*3 ' )
187     PyMult.append( '   return b ' )
188     Mult = aNewDataFlow_1.INode( 'Mult' , PyMult )
189     Mult.SetName( 'Mult' )
190     Mult.SetAuthor( '' )
191     Mult.SetComment( 'Compute Node' )
192     Mult.Coords( 382 , 78 )
193     IMulta = Mult.InPort( 'a' , 'double' )
194     IMultGate = Mult.GetInPort( 'Gate' )
195     OMultb = Mult.OutPort( 'b' , 'double' )
196     OMultGate = Mult.GetOutPort( 'Gate' )
197     
198     Pysum = []
199     Pysum.append( 'def sum(a, b): ' )
200     Pysum.append( '   return a+b' )
201     sum = aNewDataFlow_1.INode( 'sum' , Pysum )
202     sum.SetName( 'sum' )
203     sum.SetAuthor( '' )
204     sum.SetComment( 'Compute Node' )
205     sum.Coords( 47 , 87 )
206     Isuma = sum.InPort( 'a' , 'double' )
207     Isumb = sum.InPort( 'b' , 'double' )
208     IsumGate = sum.GetInPort( 'Gate' )
209     Osums = sum.OutPort( 's' , 'double' )
210     OsumGate = sum.GetOutPort( 'Gate' )
211     
212     # Creation of Links
213     LsumsMulta = aNewDataFlow_1.Link( Osums , IMulta )
214     
215     # Input Ports of the graph
216     #Isuma = sum.GetInPort( 'a' )
217     #Isumb = sum.GetInPort( 'b' )
218     
219     # Output Ports of the graph
220     #OMultb = Mult.GetOutPort( 'b' )
221     return aNewDataFlow_1
222
223
224 aNewDataFlow = DefaNewDataFlow()