Salome HOME
Update copyrights 2014.
[samples/datafiles.git] / Superv / Python / GraphLoopMemory.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 GraphLoopMemory_1
24 #
25 from SuperV import *
26
27 # Graph creation of GraphLoopMemory_1
28 def DefGraphLoopMemory_1() :
29     GraphLoopMemory_1 = Graph( 'GraphLoopMemory_1' )
30     GraphLoopMemory_1.SetName( 'GraphLoopMemory_1' )
31     GraphLoopMemory_1.SetAuthor( 'JR' )
32     GraphLoopMemory_1.SetComment( 'For solving of memory leaks' )
33     GraphLoopMemory_1.Coords( 0 , 0 )
34     
35     # Creation of Factory Nodes
36     
37     # Creation of Loop Nodes
38     PyInit = []
39     PyInit.append( 'def Init(Index,Min,Max,Incr) :    ' )
40     PyInit.append( '    if Min <= Max :    ' )
41     PyInit.append( '        Index = Min    ' )
42     PyInit.append( '    else :    ' )
43     PyInit.append( '        Index = Max    ' )
44     PyInit.append( '    return Index,Min,Max,Incr    ' )
45     PyMoreInit = []
46     PyMoreInit.append( 'def More(Index,Min,Max,Incr) :    ' )
47     PyMoreInit.append( '    if Index < Max :    ' )
48     PyMoreInit.append( '        DoLoop = 1    ' )
49     PyMoreInit.append( '    else :    ' )
50     PyMoreInit.append( '        DoLoop = 0    ' )
51     PyMoreInit.append( '    return DoLoop,Index,Min,Max,Incr    ' )
52     PyNextInit = []
53     PyNextInit.append( 'def Next(Index,Min,Max,Incr) :    ' )
54     PyNextInit.append( '    Index = Index + Incr    ' )
55     PyNextInit.append( '    return Index,Min,Max,Incr   ' )
56     Init,EndInit = GraphLoopMemory_1.LNode( 'Init' , PyInit , 'More' , PyMoreInit , 'Next' , PyNextInit )
57     EndInit.SetName( 'EndInit' )
58     EndInit.SetAuthor( '' )
59     EndInit.SetComment( 'Compute Node' )
60     EndInit.Coords( 366 , 262 )
61     PyEndInit = []
62     EndInit.SetPyFunction( '' , PyEndInit )
63     IInitDoLoop = Init.GetInPort( 'DoLoop' )
64     IInitIndex = Init.InPort( 'Index' , 'long' )
65     IInitMin = Init.InPort( 'Min' , 'long' )
66     IInitMax = Init.InPort( 'Max' , 'long' )
67     IInitIncr = Init.InPort( 'Incr' , 'long' )
68     IInitGate = Init.GetInPort( 'Gate' )
69     OInitDoLoop = Init.GetOutPort( 'DoLoop' )
70     OInitIndex = Init.GetOutPort( 'Index' )
71     OInitMin = Init.GetOutPort( 'Min' )
72     OInitMax = Init.GetOutPort( 'Max' )
73     OInitIncr = Init.GetOutPort( 'Incr' )
74     IEndInitDoLoop = EndInit.GetInPort( 'DoLoop' )
75     IEndInitIndex = EndInit.GetInPort( 'Index' )
76     IEndInitMin = EndInit.GetInPort( 'Min' )
77     IEndInitMax = EndInit.GetInPort( 'Max' )
78     IEndInitIncr = EndInit.GetInPort( 'Incr' )
79     IEndInitGate = EndInit.GetInPort( 'Gate' )
80     OEndInitDoLoop = EndInit.GetOutPort( 'DoLoop' )
81     OEndInitIndex = EndInit.GetOutPort( 'Index' )
82     OEndInitMin = EndInit.GetOutPort( 'Min' )
83     OEndInitMax = EndInit.GetOutPort( 'Max' )
84     OEndInitIncr = EndInit.GetOutPort( 'Incr' )
85     OEndInitGate = EndInit.GetOutPort( 'Gate' )
86     Init.SetName( 'Init' )
87     Init.SetAuthor( '' )
88     Init.SetComment( 'Compute Node' )
89     Init.Coords( 17 , 257 )
90     
91     # Creation of Links
92     LInitIndexEndInitIndex = GraphLoopMemory_1.Link( OInitIndex , IEndInitIndex )
93     
94     LInitMinEndInitMin = GraphLoopMemory_1.Link( OInitMin , IEndInitMin )
95     
96     LInitMaxEndInitMax = GraphLoopMemory_1.Link( OInitMax , IEndInitMax )
97     
98     LInitIncrEndInitIncr = GraphLoopMemory_1.Link( OInitIncr , IEndInitIncr )
99     
100     # Input datas
101     IInitIndex.Input( 0 )
102     IInitMin.Input( 5 )
103     IInitMax.Input( 100000 )
104     IInitIncr.Input( 1 )
105     
106     # Output Ports of the graph
107     #OEndInitIndex = EndInit.GetOutPort( 'Index' )
108     #OEndInitMin = EndInit.GetOutPort( 'Min' )
109     #OEndInitMax = EndInit.GetOutPort( 'Max' )
110     #OEndInitIncr = EndInit.GetOutPort( 'Incr' )
111     return GraphLoopMemory_1
112
113
114 GraphLoopMemory_1 = DefGraphLoopMemory_1()