2 .. _python_testMEDCouplingcorba1_solution:
4 Visualiser une instance de MEDCoupling dans ParaViS à travers CORBA
5 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
9 import MEDCoupling as mc
10 from MEDCouplingCorba import MEDCouplingUMeshServant
13 arr = mc.DataArrayDouble(11)
15 m = mc.MEDCouplingCMesh()
17 m = m.buildUnstructured()
19 # Making it available on the CORBA bus
20 ref_m = MEDCouplingUMeshServant._this(m)
22 orb = CORBA.ORB_init()
23 ior = orb.object_to_string(ref_m)
26 # Displaying it in ParaVis
29 print "About to import module 'pvsimple' ..."
30 import pvsimple as pvs
31 print "Module 'pvsimple' was imported!"
33 # From here, we use the standard ParaView API:
34 src1 = pvs.ParaMEDCorbaPluginSource()
35 src1.IORCorba = ior # This is where we need the CORBA reference of the object created