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