Salome HOME
Merge from V6_main_20120808 08Aug12
[samples/datafiles.git] / Superv / Python / NewGraphGeomEssai_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 aNewDataFlow_1_4_2_1
23 #
24 from SuperV import *
25
26 # Graph creation of aNewDataFlow_1_4_2_1
27 def DefaNewDataFlow_1_4_2_1() :
28     aNewDataFlow_1_4_2_1 = Graph( 'aNewDataFlow_1_4_2_1' )
29     aNewDataFlow_1_4_2_1.SetName( 'aNewDataFlow_1_4_2_1' )
30     aNewDataFlow_1_4_2_1.SetAuthor( '' )
31     aNewDataFlow_1_4_2_1.SetComment( '' )
32     aNewDataFlow_1_4_2_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 = aNewDataFlow_1_4_2_1.INode( 'gag' , Pygag )
43     gag.SetName( 'gag' )
44     gag.SetAuthor( '' )
45     gag.SetComment( 'Compute Node' )
46     gag.Coords( 0 , 123 )
47     IgagGate = gag.GetInPort( 'Gate' )
48     OgagGate = gag.GetOutPort( 'Gate' )
49     
50     PyMakeCopy_1 = []
51     PyMakeCopy_1.append( 'def MakeCopy_1(shape1):  ' )
52     PyMakeCopy_1.append( '    shape=MakeCopy(shape1) ' )
53     PyMakeCopy_1.append( '    return shape ' )
54     MakeCopy_1 = aNewDataFlow_1_4_2_1.INode( 'MakeCopy_1' , PyMakeCopy_1 )
55     MakeCopy_1.SetName( 'MakeCopy_1' )
56     MakeCopy_1.SetAuthor( '' )
57     MakeCopy_1.SetComment( 'Compute Node' )
58     MakeCopy_1.Coords( 385 , 3 )
59     IMakeCopy_1shape1 = MakeCopy_1.InPort( 'shape1' , 'objref' )
60     IMakeCopy_1Gate = MakeCopy_1.GetInPort( 'Gate' )
61     OMakeCopy_1shape = MakeCopy_1.OutPort( 'shape' , 'objref' )
62     OMakeCopy_1Gate = MakeCopy_1.GetOutPort( 'Gate' )
63     
64     PyMakeSphere_1 = []
65     PyMakeSphere_1.append( 'def MakeSphere_1(x1,y1,z1,radius):   ' )
66     PyMakeSphere_1.append( '    apoint=MakeVertex(x1,y1,z1) ' )
67     PyMakeSphere_1.append( '    shape=MakeSpherePntR(apoint,radius) ' )
68     PyMakeSphere_1.append( '    return shape ' )
69     MakeSphere_1 = aNewDataFlow_1_4_2_1.INode( 'MakeSphere_1' , PyMakeSphere_1 )
70     MakeSphere_1.SetName( 'MakeSphere_1' )
71     MakeSphere_1.SetAuthor( '' )
72     MakeSphere_1.SetComment( 'Compute Node' )
73     MakeSphere_1.Coords( 193 , 67 )
74     IMakeSphere_1x1 = MakeSphere_1.InPort( 'x1' , 'double' )
75     IMakeSphere_1y1 = MakeSphere_1.InPort( 'y1' , 'double' )
76     IMakeSphere_1z1 = MakeSphere_1.InPort( 'z1' , 'double' )
77     IMakeSphere_1radius = MakeSphere_1.InPort( 'radius' , 'double' )
78     IMakeSphere_1Gate = MakeSphere_1.GetInPort( 'Gate' )
79     OMakeSphere_1shape = MakeSphere_1.OutPort( 'shape' , 'objref' )
80     OMakeSphere_1Gate = MakeSphere_1.GetOutPort( 'Gate' )
81     
82     PyMakeTranslation_1 = []
83     PyMakeTranslation_1.append( 'def MakeTranslation_1(shape1,x1,y1,z1):   ' )
84     PyMakeTranslation_1.append( '    shape = MakeTranslation(shape1,x1,y1,z1)  ' )
85     PyMakeTranslation_1.append( '    return shape  ' )
86     MakeTranslation_1 = aNewDataFlow_1_4_2_1.INode( 'MakeTranslation_1' , PyMakeTranslation_1 )
87     MakeTranslation_1.SetName( 'MakeTranslation_1' )
88     MakeTranslation_1.SetAuthor( '' )
89     MakeTranslation_1.SetComment( 'Compute Node' )
90     MakeTranslation_1.Coords( 388 , 146 )
91     IMakeTranslation_1shape1 = MakeTranslation_1.InPort( 'shape1' , 'objref' )
92     IMakeTranslation_1x1 = MakeTranslation_1.InPort( 'x1' , 'double' )
93     IMakeTranslation_1y1 = MakeTranslation_1.InPort( 'y1' , 'double' )
94     IMakeTranslation_1z1 = MakeTranslation_1.InPort( 'z1' , 'double' )
95     IMakeTranslation_1Gate = MakeTranslation_1.GetInPort( 'Gate' )
96     OMakeTranslation_1shape = MakeTranslation_1.OutPort( 'shape' , 'objref' )
97     OMakeTranslation_1Gate = MakeTranslation_1.GetOutPort( 'Gate' )
98     
99     PyMakeFuse_1 = []
100     PyMakeFuse_1.append( 'def MakeFuse_1(shape1,shape2):           ' )
101     PyMakeFuse_1.append( '    # fuse operation 3          ' )
102     PyMakeFuse_1.append( '    shape = MakeBoolean(shape1,shape2,3) ' )
103     PyMakeFuse_1.append( '    from SALOME_NamingServicePy import SALOME_NamingServicePy_i ' )
104     PyMakeFuse_1.append( '    myNamingService = SALOME_NamingServicePy_i(orb) ' )
105     PyMakeFuse_1.append( '    aSession = myNamingService.Resolve('/Kernel/Session') ' )
106     PyMakeFuse_1.append( '    aStudyId = aSession.GetActiveStudyId() ' )
107     PyMakeFuse_1.append( '    myStudyManager = myNamingService.Resolve('/myStudyManager') ' )
108     PyMakeFuse_1.append( '    aStudy = myStudyManager.GetStudyByID(aStudyId) ' )
109     PyMakeFuse_1.append( '    aSObject = geom.AddInStudy(aStudy, shape, "shape", None) ' )
110     PyMakeFuse_1.append( '    return shape ' )
111     MakeFuse_1 = aNewDataFlow_1_4_2_1.INode( 'MakeFuse_1' , PyMakeFuse_1 )
112     MakeFuse_1.SetName( 'MakeFuse_1' )
113     MakeFuse_1.SetAuthor( '' )
114     MakeFuse_1.SetComment( 'Compute Node' )
115     MakeFuse_1.Coords( 618 , 64 )
116     IMakeFuse_1shape1 = MakeFuse_1.InPort( 'shape1' , 'objref' )
117     IMakeFuse_1shape2 = MakeFuse_1.InPort( 'shape2' , 'objref' )
118     IMakeFuse_1Gate = MakeFuse_1.GetInPort( 'Gate' )
119     OMakeFuse_1shape = MakeFuse_1.OutPort( 'shape' , 'objref' )
120     OMakeFuse_1Gate = MakeFuse_1.GetOutPort( 'Gate' )
121     
122     # Creation of Links
123     LgagGateMakeSphere_1Gate = aNewDataFlow_1_4_2_1.Link( OgagGate , IMakeSphere_1Gate )
124     
125     LMakeCopy_1shapeMakeFuse_1shape1 = aNewDataFlow_1_4_2_1.Link( OMakeCopy_1shape , IMakeFuse_1shape1 )
126     
127     LMakeSphere_1shapeMakeCopy_1shape1 = aNewDataFlow_1_4_2_1.Link( OMakeSphere_1shape , IMakeCopy_1shape1 )
128     
129     LMakeSphere_1shapeMakeTranslation_1shape1 = aNewDataFlow_1_4_2_1.Link( OMakeSphere_1shape , IMakeTranslation_1shape1 )
130     
131     LMakeTranslation_1shapeMakeFuse_1shape2 = aNewDataFlow_1_4_2_1.Link( OMakeTranslation_1shape , IMakeFuse_1shape2 )
132     
133     # Input datas
134     IMakeSphere_1x1.Input( 0 )
135     IMakeSphere_1y1.Input( 0 )
136     IMakeSphere_1z1.Input( 0 )
137     IMakeSphere_1radius.Input( 50 )
138     IMakeTranslation_1x1.Input( 80 )
139     IMakeTranslation_1y1.Input( 0 )
140     IMakeTranslation_1z1.Input( 0 )
141     
142     # Output Ports of the graph
143     #OMakeFuse_1shape = MakeFuse_1.GetOutPort( 'shape' )
144     return aNewDataFlow_1_4_2_1
145
146
147 aNewDataFlow_1_4_2_1 = DefaNewDataFlow_1_4_2_1()