Salome HOME
add new files for mesh
[samples/datafiles.git] / Superv / Python / GraphInLinesUnValid.py
1 # Copyright (C) 2007-2014  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 GraphInLinesUnValid
24 #
25 from SuperV import *
26 # Graph creation 
27 GraphInLinesUnValid = Graph( 'GraphInLinesUnValid' )
28 GraphInLinesUnValid.SetName( 'GraphInLinesUnValid' )
29 GraphInLinesUnValid.SetAuthor( '' )
30 GraphInLinesUnValid.SetComment( '' )
31 GraphInLinesUnValid.Coords( 0 , 0 )
32
33 # Creation of Factory Nodes
34
35 # Creation of InLine Nodes
36 PyAdd = []
37 PyAdd.append( 'def Add(a,b) :  ' )
38 PyAdd.append( '    return a+b  ' )
39 PyAdd.append( '' )
40 Add = GraphInLinesUnValid.INode( 'Add' , PyAdd )
41 Add.InPort( 'a' , 'long' )
42 Add.InPort( 'b' , 'long' )
43 Add.OutPort( 'f' , 'long' )
44 Add.SetName( 'Add' )
45 Add.SetAuthor( '' )
46 Add.SetComment( 'Python function' )
47 Add.Coords( 257 , 13 )
48
49 PySub = []
50 PySub.append( 'def Sub(a,b) : ' )
51 PySub.append( '    return a-b ' )
52 PySub.append( '' )
53 Sub = GraphInLinesUnValid.INode( 'Sub' , PySub )
54 Sub.InPort( 'a' , 'long' )
55 Sub.InPort( 'b' , 'long' )
56 Sub.OutPort( 'f' , 'long' )
57 Sub.SetName( 'Sub' )
58 Sub.SetAuthor( '' )
59 Sub.SetComment( 'Python function' )
60 Sub.Coords( 20 , 152 )
61
62 PyMul = []
63 PyMul.append( 'def Mul(a,b) : ' )
64 PyMul.append( '    return a*b ' )
65 Mul = GraphInLinesUnValid.INode( 'Mul' , PyMul )
66 Mul.InPort( 'a' , 'long' )
67 Mul.InPort( 'b' , 'long' )
68 Mul.OutPort( 'Result' , 'long' )
69 Mul.SetName( 'Mul' )
70 Mul.SetAuthor( '' )
71 Mul.SetComment( 'Python function' )
72 Mul.Coords( 469 , 125 )
73
74 # Creation of Links
75 Addf = Add.Port( 'f' )
76 Mula = GraphInLinesUnValid.Link( Addf , Mul.Port( 'a' ) )
77 Mula.AddCoord( 1 , 451 , 205 )
78 Mula.AddCoord( 2 , 450 , 93 )
79
80 Subf = Sub.Port( 'f' )
81 Mulb = GraphInLinesUnValid.Link( Subf , Mul.Port( 'b' ) )
82
83 Addb = GraphInLinesUnValid.Link( Subf , Add.Port( 'b' ) )
84 Addb.AddCoord( 1 , 235 , 122 )
85 Addb.AddCoord( 2 , 236 , 232 )
86
87 MulResult = Mul.Port( 'Result' )
88 Adda = GraphInLinesUnValid.Link( MulResult , Add.Port( 'a' ) )
89 Adda.AddCoord( 1 , 8 , 92 )
90 Adda.AddCoord( 2 , 7 , 332 )
91 Adda.AddCoord( 3 , 645 , 334 )
92 Adda.AddCoord( 4 , 645 , 204 )
93
94 statexec = GraphInLinesUnValid.IsExecutable()
95 if statexec != 0 :
96     print "ERROR : GraphInLinesUnValid should not be executable"
97 else :
98     print "Ok : GraphInLinesUnValid is not executable"
99
100 # Creation of Output variables
101 statrun = GraphInLinesUnValid.Run()
102 if statrun != 0 :
103     print "ERROR : GraphInLinesUnValid should not run"
104 else :
105     print "Ok : GraphInLinesUnValid does not run"
106
107
108