1 # Copyright (C) 2005 OPEN CASCADE, CEA, EDF R&D, LEG
2 # PRINCIPIA R&D, EADS CCR, Lip6, BV, CEDRAT
3 # This library is free software; you can redistribute it and/or
4 # modify it under the terms of the GNU Lesser General Public
5 # License as published by the Free Software Foundation; either
6 # version 2.1 of the License.
8 # This library is distributed in the hope that it will be useful
9 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 # Lesser General Public License for more details.
13 # You should have received a copy of the GNU Lesser General Public
14 # License along with this library; if not, write to the Free Software
15 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
21 ## ne fonctionne pas ?
24 BASE = os.environ["MED_ROOT_DIR"] + '/share/salome/resources/med/'
26 fileName = BASE + 'pointe.med'
27 fileName = BASE + 'carre_en_quad4_seg2.med'
31 if (len(x) != len(y)):
33 for i in xrange(len(x)):
38 # MED Mesh read from a (local) file
40 from libMEDMEM_Swig import *
44 mdDriver = MED_MED_RDONLY_DRIVER(fileName, md)
47 mdDriver.readFileStruct()
50 mLocal = md.getMesh(md.getMeshName(0))
53 # MED Mesh received from a distant component (via CORBA)
55 from omniORB import CORBA
56 from LifeCycleCORBA import *
57 from libSALOME_Swig import *
58 from libMEDClient import *
60 orb = CORBA.ORB_init([''], CORBA.ORB_ID)
61 lcc = LifeCycleCORBA(orb)
63 C = lcc.FindOrLoadComponent("FactoryServerPy", "Compo1Py")
64 C.Initialise(fileName)
66 mDistant = C.Calcul1()
67 mDistantCopy = MESHClient(mDistant)
69 from libCompo2 import *
72 print "Local ", C2.Calcul(mLocal)
73 print "DistantCopy ", C2.Calcul(mDistantCopy)
77 print "Distant ", C2.Calcul(mDistant)
79 print "an exception has been received, it's the normal behaviour"
82 if (testDistant == 0):
83 raise RuntimeError, "no exception has been received, test failed"
87 print "All tests passed"