Salome HOME
0022763: [EDF] Shape processing
[samples/datafiles.git] / Superv / Python / GraphEmbeddedComponentsCrash1.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 GraphEmbeddedComponentsCrash1
24 #
25 from SuperV import *
26
27 # Graph creation of GraphEmbeddedComponentsCrash1
28 def DefGraphEmbeddedComponentsCrash1() :
29     GraphEmbeddedComponentsCrash1 = Graph( 'GraphEmbeddedComponentsCrash1' )
30     GraphEmbeddedComponentsCrash1.SetName( 'GraphEmbeddedComponentsCrash1' )
31     GraphEmbeddedComponentsCrash1.SetAuthor( '' )
32     GraphEmbeddedComponentsCrash1.SetComment( '' )
33     GraphEmbeddedComponentsCrash1.Coords( 0 , 0 )
34     
35     # Creation of Factory Nodes
36     
37     Add = GraphEmbeddedComponentsCrash1.FNode( 'AddComponent' , 'AddComponent' , 'Add' )
38     Add.SetName( 'Add' )
39     Add.SetAuthor( '' )
40     Add.SetContainer( 'localhost/SuperVisionContainer' )
41     Add.SetComment( 'Add from AddComponent' )
42     Add.Coords( 1 , 152 )
43     IAddx = Add.GetInPort( 'x' )
44     IAddy = Add.GetInPort( 'y' )
45     IAddGate = Add.GetInPort( 'Gate' )
46     OAddFuncValue = Add.GetOutPort( 'FuncValue' )
47     OAddz = Add.GetOutPort( 'z' )
48     OAddGate = Add.GetOutPort( 'Gate' )
49     
50     Sub = GraphEmbeddedComponentsCrash1.FNode( 'SubComponent' , 'SubComponent' , 'Sub' )
51     Sub.SetName( 'Sub' )
52     Sub.SetAuthor( '' )
53     Sub.SetContainer( 'localhost/SuperVisionContainer' )
54     Sub.SetComment( 'Sub from SubComponent' )
55     Sub.Coords( 477 , 381 )
56     ISubx = Sub.GetInPort( 'x' )
57     ISuby = Sub.GetInPort( 'y' )
58     ISubGate = Sub.GetInPort( 'Gate' )
59     OSubz = Sub.GetOutPort( 'z' )
60     OSubGate = Sub.GetOutPort( 'Gate' )
61     
62     Mul = GraphEmbeddedComponentsCrash1.FNode( 'MulComponent' , 'MulComponent' , 'Mul' )
63     Mul.SetName( 'Mul' )
64     Mul.SetAuthor( '' )
65     Mul.SetContainer( 'localhost/SuperVisionContainer' )
66     Mul.SetComment( 'Mul from MulComponent' )
67     Mul.Coords( 480 , 152 )
68     IMulx = Mul.GetInPort( 'x' )
69     IMuly = Mul.GetInPort( 'y' )
70     IMulGate = Mul.GetInPort( 'Gate' )
71     OMulz = Mul.GetOutPort( 'z' )
72     OMulGate = Mul.GetOutPort( 'Gate' )
73     
74     Div = GraphEmbeddedComponentsCrash1.FNode( 'DivComponent' , 'DivComponent' , 'Div' )
75     Div.SetName( 'Div' )
76     Div.SetAuthor( '' )
77     Div.SetContainer( 'localhost/SuperVisionContainer' )
78     Div.SetComment( 'Div from DivComponent' )
79     Div.Coords( 714 , 136 )
80     IDivx = Div.GetInPort( 'x' )
81     IDivy = Div.GetInPort( 'y' )
82     IDivGate = Div.GetInPort( 'Gate' )
83     ODivz = Div.GetOutPort( 'z' )
84     ODivGate = Div.GetOutPort( 'Gate' )
85     
86     Addition = GraphEmbeddedComponentsCrash1.FNode( 'AddComponent' , 'AddComponent' , 'Addition' )
87     Addition.SetName( 'Addition' )
88     Addition.SetAuthor( '' )
89     Addition.SetContainer( 'localhost/SuperVisionContainer' )
90     Addition.SetComment( 'Addition from AddComponent' )
91     Addition.Coords( 0 , 0 )
92     IAdditionGate = Addition.GetInPort( 'Gate' )
93     OAdditionAdder = Addition.GetOutPort( 'Adder' )
94     OAdditionGate = Addition.GetOutPort( 'Gate' )
95     
96     Addition_1 = GraphEmbeddedComponentsCrash1.FNode( 'AddComponent' , 'AddComponent' , 'Addition' )
97     Addition_1.SetName( 'Addition_1' )
98     Addition_1.SetAuthor( '' )
99     Addition_1.SetContainer( 'localhost/SuperVisionContainer' )
100     Addition_1.SetComment( 'Addition from AddComponent' )
101     Addition_1.Coords( 4 , 327 )
102     IAddition_1Gate = Addition_1.GetInPort( 'Gate' )
103     OAddition_1Adder = Addition_1.GetOutPort( 'Adder' )
104     OAddition_1Gate = Addition_1.GetOutPort( 'Gate' )
105     
106     # Creation of Computing Nodes
107     AddAndCompare_ServiceinParameter = []
108     AddAndCompare_ServiceinParameter.append( SALOME_ModuleCatalog.ServicesParameter( 'Adder' , 'Adder' ) )
109     AddAndCompare_ServiceinParameter.append( SALOME_ModuleCatalog.ServicesParameter( 'double' , 'x' ) )
110     AddAndCompare_ServiceinParameter.append( SALOME_ModuleCatalog.ServicesParameter( 'double' , 'y' ) )
111     AddAndCompare_ServiceinParameter.append( SALOME_ModuleCatalog.ServicesParameter( 'Adder' , 'anOtherAdder' ) )
112     AddAndCompare_ServiceoutParameter = []
113     AddAndCompare_ServiceoutParameter.append( SALOME_ModuleCatalog.ServicesParameter( 'double' , 'FuncValue' ) )
114     AddAndCompare_ServiceoutParameter.append( SALOME_ModuleCatalog.ServicesParameter( 'double' , 'z' ) )
115     AddAndCompare_ServiceinStreamParameter = []
116     AddAndCompare_ServiceoutStreamParameter = []
117     AddAndCompare_Service = SALOME_ModuleCatalog.Service( 'AddAndCompare' , AddAndCompare_ServiceinParameter , AddAndCompare_ServiceoutParameter , AddAndCompare_ServiceinStreamParameter , AddAndCompare_ServiceoutStreamParameter , 0 , 0 )
118     AddAndCompare = GraphEmbeddedComponentsCrash1.CNode( AddAndCompare_Service )
119     AddAndCompare.SetName( 'AddAndCompare' )
120     AddAndCompare.SetAuthor( '' )
121     AddAndCompare.SetComment( 'Python function' )
122     AddAndCompare.Coords( 233 , 0 )
123     IAddAndCompareAdder = AddAndCompare.GetInPort( 'Adder' )
124     IAddAndComparex = AddAndCompare.GetInPort( 'x' )
125     IAddAndComparey = AddAndCompare.GetInPort( 'y' )
126     IAddAndCompareanOtherAdder = AddAndCompare.GetInPort( 'anOtherAdder' )
127     IAddAndCompareGate = AddAndCompare.GetInPort( 'Gate' )
128     OAddAndCompareFuncValue = AddAndCompare.GetOutPort( 'FuncValue' )
129     OAddAndComparez = AddAndCompare.GetOutPort( 'z' )
130     OAddAndCompareGate = AddAndCompare.GetOutPort( 'Gate' )
131     
132     # Creation of Links
133     LAddFuncValueMulx = GraphEmbeddedComponentsCrash1.Link( OAddFuncValue , IMulx )
134     
135     LAddFuncValueAddAndComparex = GraphEmbeddedComponentsCrash1.Link( OAddFuncValue , IAddAndComparex )
136     LAddFuncValueAddAndComparex.AddCoord( 1 , 195 , 108 )
137     LAddFuncValueAddAndComparex.AddCoord( 2 , 195 , 233 )
138     
139     LAddzSubx = GraphEmbeddedComponentsCrash1.Link( OAddz , ISubx )
140     LAddzSubx.AddCoord( 1 , 187 , 459 )
141     LAddzSubx.AddCoord( 2 , 186 , 262 )
142     
143     LAddzAddAndComparey = GraphEmbeddedComponentsCrash1.Link( OAddz , IAddAndComparey )
144     LAddzAddAndComparey.AddCoord( 1 , 187 , 139 )
145     LAddzAddAndComparey.AddCoord( 2 , 186 , 261 )
146     
147     LSubzDivx = GraphEmbeddedComponentsCrash1.Link( OSubz , IDivx )
148     LSubzDivx.AddCoord( 1 , 670 , 206 )
149     LSubzDivx.AddCoord( 2 , 680 , 447 )
150     
151     LMulzDivy = GraphEmbeddedComponentsCrash1.Link( OMulz , IDivy )
152     
153     LAdditionAdderAddAndCompareAdder = GraphEmbeddedComponentsCrash1.Link( OAdditionAdder , IAddAndCompareAdder )
154     
155     LAddition_1AdderAddAndCompareanOtherAdder = GraphEmbeddedComponentsCrash1.Link( OAddition_1Adder , IAddAndCompareanOtherAdder )
156     LAddition_1AdderAddAndCompareanOtherAdder.AddCoord( 1 , 215 , 168 )
157     LAddition_1AdderAddAndCompareanOtherAdder.AddCoord( 2 , 214 , 407 )
158     
159     # Input datas
160     IAddx.Input( 1 )
161     IAddy.Input( 2 )
162     ISuby.Input( 3 )
163     IMuly.Input( 4 )
164     
165     # Output Ports of the graph
166     #ODivz = Div.GetOutPort( 'z' )
167     #OAddAndCompareFuncValue = AddAndCompare.GetOutPort( 'FuncValue' )
168     #OAddAndComparez = AddAndCompare.GetOutPort( 'z' )
169     return GraphEmbeddedComponentsCrash1
170
171
172 GraphEmbeddedComponentsCrash1 = DefGraphEmbeddedComponentsCrash1()
173
174 GraphEmbeddedComponentsCrash1.Run()
175 GraphEmbeddedComponentsCrash1.DoneW()
176 GraphEmbeddedComponentsCrash1.PrintPorts()
177