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