Salome HOME
6df9d04feab929cbd8bc2f400a23c55be8aa990a
[samples/datafiles.git] / Superv / Python / GraphGeomEssaiGates_py.py
1 #  Copyright (C) 2007-2011  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.
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 # Generated python file of Graph GraphGeomEssai_1_1_1_1
23 #
24 from SuperV import *
25
26 # Graph creation of GraphGeomEssai_1_1_1_1
27 def DefGraphGeomEssai_1_1_1_1() :
28     GraphGeomEssai_1_1_1_1 = Graph( 'GraphGeomEssai_1_1_1_1' )
29     GraphGeomEssai_1_1_1_1.SetName( 'GraphGeomEssai_1_1_1_1' )
30     GraphGeomEssai_1_1_1_1.SetAuthor( '' )
31     GraphGeomEssai_1_1_1_1.SetComment( '' )
32     GraphGeomEssai_1_1_1_1.Coords( 0 , 0 )
33     
34     # Creation of Factory Nodes
35     
36     # Creation of InLine Nodes
37     Pygag = []
38     Pygag.append( 'from batchmode_geompy import *   ' )
39     Pygag.append( 'def gag():    ' )
40     Pygag.append( '    # This is a gag    ' )
41     Pygag.append( '    return 1 ' )
42     gag = GraphGeomEssai_1_1_1_1.INode( 'gag' , Pygag )
43     gag.SetName( 'gag' )
44     gag.SetAuthor( '' )
45     gag.SetComment( 'Compute Node' )
46     gag.Coords( 0 , 166 )
47     IgagGate = gag.GetInPort( 'Gate' )
48     OgagGate = gag.GetOutPort( 'Gate' )
49     
50     PyMakeSphere_1 = []
51     PyMakeSphere_1.append( 'def MakeSphere_1(x1,y1,z1,radius):    ' )
52     PyMakeSphere_1.append( '    apoint=MakeVertex(x1,y1,z1)  ' )
53     PyMakeSphere_1.append( '    shape=MakeSpherePntR(apoint,radius)  ' )
54     PyMakeSphere_1.append( '    return shape  ' )
55     MakeSphere_1 = GraphGeomEssai_1_1_1_1.INode( 'MakeSphere_1' , PyMakeSphere_1 )
56     MakeSphere_1.SetName( 'MakeSphere_1' )
57     MakeSphere_1.SetAuthor( '' )
58     MakeSphere_1.SetComment( 'Compute Node' )
59     MakeSphere_1.Coords( 181 , 86 )
60     IMakeSphere_1x1 = MakeSphere_1.InPort( 'x1' , 'double' )
61     IMakeSphere_1y1 = MakeSphere_1.InPort( 'y1' , 'double' )
62     IMakeSphere_1z1 = MakeSphere_1.InPort( 'z1' , 'double' )
63     IMakeSphere_1radius = MakeSphere_1.InPort( 'radius' , 'double' )
64     IMakeSphere_1Gate = MakeSphere_1.GetInPort( 'Gate' )
65     OMakeSphere_1shape = MakeSphere_1.OutPort( 'shape' , 'objref' )
66     OMakeSphere_1Gate = MakeSphere_1.GetOutPort( 'Gate' )
67     
68     PyMakeCopy_1 = []
69     PyMakeCopy_1.append( 'def MakeCopy_1(shape1):   ' )
70     PyMakeCopy_1.append( '    shape=MakeCopy(shape1)  ' )
71     PyMakeCopy_1.append( '    return shape  ' )
72     MakeCopy_1 = GraphGeomEssai_1_1_1_1.INode( 'MakeCopy_1' , PyMakeCopy_1 )
73     MakeCopy_1.SetName( 'MakeCopy_1' )
74     MakeCopy_1.SetAuthor( '' )
75     MakeCopy_1.SetComment( 'Compute Node' )
76     MakeCopy_1.Coords( 386 , 2 )
77     IMakeCopy_1shape1 = MakeCopy_1.InPort( 'shape1' , 'objref' )
78     IMakeCopy_1Gate = MakeCopy_1.GetInPort( 'Gate' )
79     OMakeCopy_1shape = MakeCopy_1.OutPort( 'shape' , 'objref' )
80     OMakeCopy_1Gate = MakeCopy_1.GetOutPort( 'Gate' )
81     
82     PyMakeCopy_2 = []
83     PyMakeCopy_2.append( 'def MakeCopy_2(shape1):   ' )
84     PyMakeCopy_2.append( '    shape=MakeCopy(shape1)  ' )
85     PyMakeCopy_2.append( '    return shape  ' )
86     MakeCopy_2 = GraphGeomEssai_1_1_1_1.INode( 'MakeCopy_2' , PyMakeCopy_2 )
87     MakeCopy_2.SetName( 'MakeCopy_2' )
88     MakeCopy_2.SetAuthor( '' )
89     MakeCopy_2.SetComment( 'Compute Node' )
90     MakeCopy_2.Coords( 388 , 181 )
91     IMakeCopy_2shape1 = MakeCopy_2.InPort( 'shape1' , 'objref' )
92     IMakeCopy_2Gate = MakeCopy_2.GetInPort( 'Gate' )
93     OMakeCopy_2shape = MakeCopy_2.OutPort( 'shape' , 'objref' )
94     OMakeCopy_2Gate = MakeCopy_2.GetOutPort( 'Gate' )
95     
96     PyMakeFuse_1 = []
97     PyMakeFuse_1.append( 'def MakeFuse_1(shape1,shape2):           ' )
98     PyMakeFuse_1.append( '    # fuse operation 3          ' )
99     PyMakeFuse_1.append( '    shape = MakeBoolean(shape1,shape2,3) ' )
100     PyMakeFuse_1.append( '    from SALOME_NamingServicePy import SALOME_NamingServicePy_i ' )
101     PyMakeFuse_1.append( '    myNamingService = SALOME_NamingServicePy_i(orb) ' )
102     PyMakeFuse_1.append( '    aSession = myNamingService.Resolve('/Kernel/Session') ' )
103     PyMakeFuse_1.append( '    aStudyId = aSession.GetActiveStudyId() ' )
104     PyMakeFuse_1.append( '    myStudyManager = myNamingService.Resolve('/myStudyManager') ' )
105     PyMakeFuse_1.append( '    aStudy = myStudyManager.GetStudyByID(aStudyId) ' )
106     PyMakeFuse_1.append( '    aSObject = geom.AddInStudy(aStudy, shape, "shape", None) ' )
107     PyMakeFuse_1.append( '    return shape ' )
108     MakeFuse_1 = GraphGeomEssai_1_1_1_1.INode( 'MakeFuse_1' , PyMakeFuse_1 )
109     MakeFuse_1.SetName( 'MakeFuse_1' )
110     MakeFuse_1.SetAuthor( '' )
111     MakeFuse_1.SetComment( 'Compute Node' )
112     MakeFuse_1.Coords( 779 , 161 )
113     IMakeFuse_1shape1 = MakeFuse_1.InPort( 'shape1' , 'objref' )
114     IMakeFuse_1shape2 = MakeFuse_1.InPort( 'shape2' , 'objref' )
115     IMakeFuse_1Gate = MakeFuse_1.GetInPort( 'Gate' )
116     OMakeFuse_1shape = MakeFuse_1.OutPort( 'shape' , 'objref' )
117     OMakeFuse_1Gate = MakeFuse_1.GetOutPort( 'Gate' )
118     
119     PyMakeTranslation_1 = []
120     PyMakeTranslation_1.append( 'def MakeTranslation_1(shape1,x1,y1,z1):   ' )
121     PyMakeTranslation_1.append( '    shape = MakeTranslation(shape1,x1,y1,z1)  ' )
122     PyMakeTranslation_1.append( '    return shape' )
123     MakeTranslation_1 = GraphGeomEssai_1_1_1_1.INode( 'MakeTranslation_1' , PyMakeTranslation_1 )
124     MakeTranslation_1.SetName( 'MakeTranslation_1' )
125     MakeTranslation_1.SetAuthor( '' )
126     MakeTranslation_1.SetComment( 'Compute Node' )
127     MakeTranslation_1.Coords( 580 , 2 )
128     IMakeTranslation_1shape1 = MakeTranslation_1.InPort( 'shape1' , 'objref' )
129     IMakeTranslation_1x1 = MakeTranslation_1.InPort( 'x1' , 'double' )
130     IMakeTranslation_1y1 = MakeTranslation_1.InPort( 'y1' , 'double' )
131     IMakeTranslation_1z1 = MakeTranslation_1.InPort( 'z1' , 'double' )
132     IMakeTranslation_1Gate = MakeTranslation_1.GetInPort( 'Gate' )
133     OMakeTranslation_1shape = MakeTranslation_1.OutPort( 'shape' , 'objref' )
134     OMakeTranslation_1Gate = MakeTranslation_1.GetOutPort( 'Gate' )
135     
136     # Creation of Links
137     LgagGateMakeSphere_1Gate = GraphGeomEssai_1_1_1_1.Link( OgagGate , IMakeSphere_1Gate )
138     
139     LMakeSphere_1shapeMakeCopy_1shape1 = GraphGeomEssai_1_1_1_1.Link( OMakeSphere_1shape , IMakeCopy_1shape1 )
140     
141     LMakeSphere_1shapeMakeCopy_2shape1 = GraphGeomEssai_1_1_1_1.Link( OMakeSphere_1shape , IMakeCopy_2shape1 )
142     
143     LMakeSphere_1GateMakeCopy_1Gate = GraphGeomEssai_1_1_1_1.Link( OMakeSphere_1Gate , IMakeCopy_1Gate )
144     
145     LMakeCopy_1shapeMakeTranslation_1shape1 = GraphGeomEssai_1_1_1_1.Link( OMakeCopy_1shape , IMakeTranslation_1shape1 )
146     
147     LMakeCopy_1GateMakeCopy_2Gate = GraphGeomEssai_1_1_1_1.Link( OMakeCopy_1Gate , IMakeCopy_2Gate )
148     LMakeCopy_1GateMakeCopy_2Gate.AddCoord( 1 , 369 , 276 )
149     LMakeCopy_1GateMakeCopy_2Gate.AddCoord( 2 , 560 , 97 )
150     
151     LMakeCopy_2shapeMakeFuse_1shape2 = GraphGeomEssai_1_1_1_1.Link( OMakeCopy_2shape , IMakeFuse_1shape2 )
152     
153     LMakeCopy_2GateMakeTranslation_1Gate = GraphGeomEssai_1_1_1_1.Link( OMakeCopy_2Gate , IMakeTranslation_1Gate )
154     
155     LMakeTranslation_1shapeMakeFuse_1shape1 = GraphGeomEssai_1_1_1_1.Link( OMakeTranslation_1shape , IMakeFuse_1shape1 )
156     
157     LMakeTranslation_1GateMakeFuse_1Gate = GraphGeomEssai_1_1_1_1.Link( OMakeTranslation_1Gate , IMakeFuse_1Gate )
158     
159     # Input datas
160     IMakeSphere_1x1.Input( 0 )
161     IMakeSphere_1y1.Input( 0 )
162     IMakeSphere_1z1.Input( 0 )
163     IMakeSphere_1radius.Input( 20 )
164     IMakeTranslation_1x1.Input( 10 )
165     IMakeTranslation_1y1.Input( 10 )
166     IMakeTranslation_1z1.Input( 10 )
167     
168     # Output Ports of the graph
169     #OMakeFuse_1shape = MakeFuse_1.GetOutPort( 'shape' )
170     return GraphGeomEssai_1_1_1_1
171
172
173 GraphGeomEssai_1_1_1_1 = DefGraphGeomEssai_1_1_1_1()