Salome HOME
0022763: [EDF] Shape processing
[samples/datafiles.git] / Superv / Python / Graphs.py
1 # Copyright (C) 2007-2015  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, or (at your option) any later version.
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
23 # Generated python file of Graph Graphs
24 #
25 from SuperV import *
26 # Graph creation 
27 Graphs = Graph( 'Graphs' )
28 Graphs.SetName( 'Graphs' )
29 Graphs.SetAuthor( '' )
30 Graphs.SetComment( '' )
31 Graphs.Coords( 0 , 0 )
32
33 # Creation of Factory Nodes
34
35 Add = Graphs.FNode( 'AddComponent' , 'AddComponent' , 'Add' )
36 Add.SetName( 'Add' )
37 Add.SetAuthor( '' )
38 Add.SetContainer( 'localhost/FactoryServer' )
39 Add.SetComment( 'Add from AddComponent' )
40 Add.Coords( 30 , 8 )
41
42 Sub = Graphs.FNode( 'SubComponent' , 'SubComponent' , 'Sub' )
43 Sub.SetName( 'Sub' )
44 Sub.SetAuthor( '' )
45 Sub.SetContainer( 'localhost/FactoryServer' )
46 Sub.SetComment( 'Sub from SubComponent' )
47 Sub.Coords( 241 , 38 )
48
49 Mul = Graphs.FNode( 'MulComponent' , 'MulComponent' , 'Mul' )
50 Mul.SetName( 'Mul' )
51 Mul.SetAuthor( '' )
52 Mul.SetContainer( 'localhost/FactoryServer' )
53 Mul.SetComment( 'Mul from MulComponent' )
54 Mul.Coords( 439 , 39 )
55
56 Div = Graphs.FNode( 'DivComponent' , 'DivComponent' , 'Div' )
57 Div.SetName( 'Div' )
58 Div.SetAuthor( '' )
59 Div.SetContainer( 'localhost/FactoryServer' )
60 Div.SetComment( 'Div from DivComponent' )
61 Div.Coords( 633 , 120 )
62
63 Add_1 = Graphs.FNode( 'AddComponent' , 'AddComponent' , 'Add' )
64 Add_1.SetName( 'Add_1' )
65 Add_1.SetAuthor( '' )
66 Add_1.SetContainer( 'localhost/FactoryServer' )
67 Add_1.SetComment( 'Add from AddComponent' )
68 Add_1.Coords( 13 , 297 )
69
70 Sub_1 = Graphs.FNode( 'SubComponent' , 'SubComponent' , 'Sub' )
71 Sub_1.SetName( 'Sub_1' )
72 Sub_1.SetAuthor( '' )
73 Sub_1.SetContainer( 'localhost/FactoryServer' )
74 Sub_1.SetComment( 'Sub from SubComponent' )
75 Sub_1.Coords( 235 , 217 )
76
77 Mul_1 = Graphs.FNode( 'MulComponent' , 'MulComponent' , 'Mul' )
78 Mul_1.SetName( 'Mul_1' )
79 Mul_1.SetAuthor( '' )
80 Mul_1.SetContainer( 'localhost/FactoryServer' )
81 Mul_1.SetComment( 'Mul from MulComponent' )
82 Mul_1.Coords( 423 , 375 )
83
84 Div_1 = Graphs.FNode( 'DivComponent' , 'DivComponent' , 'Div' )
85 Div_1.SetName( 'Div_1' )
86 Div_1.SetAuthor( '' )
87 Div_1.SetContainer( 'localhost/FactoryServer' )
88 Div_1.SetComment( 'Div from DivComponent' )
89 Div_1.Coords( 630 , 284 )
90
91 # Creation of Links
92 Addz = Add.Port( 'z' )
93 Subx = Graphs.Link( Addz , Sub.Port( 'x' ) )
94
95 Subz = Sub.Port( 'z' )
96 Divx = Graphs.Link( Subz , Div.Port( 'x' ) )
97 Divx.AddCoord( 1 , 426 , 201 )
98 Divx.AddCoord( 2 , 425 , 119 )
99
100 Mulx = Graphs.Link( Subz , Mul.Port( 'x' ) )
101
102 Mulz = Mul.Port( 'z' )
103 Divy = Graphs.Link( Mulz , Div.Port( 'y' ) )
104 Divy.AddCoord( 1 , 619 , 230 )
105 Divy.AddCoord( 2 , 620 , 120 )
106
107 Add_1FuncValue = Add_1.Port( 'FuncValue' )
108 Mul_1x = Graphs.Link( Add_1FuncValue , Mul_1.Port( 'x' ) )
109 Mul_1x.AddCoord( 1 , 396 , 455 )
110 Mul_1x.AddCoord( 2 , 395 , 378 )
111
112 Sub_1x = Graphs.Link( Add_1FuncValue , Sub_1.Port( 'x' ) )
113 Sub_1x.AddCoord( 1 , 215 , 297 )
114 Sub_1x.AddCoord( 2 , 215 , 378 )
115
116 Add_1z = Add_1.Port( 'z' )
117 Sub_1y = Graphs.Link( Add_1z , Sub_1.Port( 'y' ) )
118 Sub_1y.AddCoord( 1 , 197 , 327 )
119 Sub_1y.AddCoord( 2 , 196 , 406 )
120
121 Sub_1z = Sub_1.Port( 'z' )
122 Div_1x = Graphs.Link( Sub_1z , Div_1.Port( 'x' ) )
123 Div_1x.AddCoord( 1 , 604 , 364 )
124 Div_1x.AddCoord( 2 , 603 , 297 )
125
126 Mul_1z = Mul_1.Port( 'z' )
127 Div_1y = Graphs.Link( Mul_1z , Div_1.Port( 'y' ) )
128 Div_1y.AddCoord( 1 , 610 , 394 )
129 Div_1y.AddCoord( 2 , 610 , 455 )
130
131 # Creation of Input datas
132 Addx = Add.Input( 'x' , 3)
133 Addy = Add.Input( 'y' , 5)
134 Suby = Sub.Input( 'y' , 7)
135 Muly = Mul.Input( 'y' , 11)
136 Add_1x = Add_1.Input( 'x' , 1)
137 Add_1y = Add_1.Input( 'y' , 2)
138 Mul_1y = Mul_1.Input( 'y' , 4)
139
140 # Creation of Output variables
141 AddFuncValue = Add.Port( 'FuncValue' )
142 Divz = Div.Port( 'z' )
143 Div_1z = Div_1.Port( 'z' )
144
145 Graphs.Run()
146
147 Graphs.DoneW()
148
149 Graphs.State()
150
151 Graphs.PrintPorts()
152