]> SALOME platform Git repositories - modules/visu.git/commitdiff
Salome HOME
Load MED component if the study contains MED component data.
authormzn <mzn@opencascade.com>
Mon, 23 Oct 2006 12:38:58 +0000 (12:38 +0000)
committermzn <mzn@opencascade.com>
Mon, 23 Oct 2006 12:38:58 +0000 (12:38 +0000)
src/VISU_I/Makefile.in
src/VISU_I/VISU_Gen_i.cc

index 41b9c67e5df289959da881e30d2926f6ce2b67d0..a786b8da15d1d0938320b9c47bf900baa61ba7ee 100644 (file)
@@ -61,6 +61,7 @@ LIB_MOC = \
        VISU_TimeAnimation.h
 
 LIB_SERVER_IDL = \
+       MED_Gen.idl \
        MED.idl \
        VISU_Gen.idl \
        SALOME_Component.idl \
index 0070b91253f30db1cd851275418cdea5dfe20bab..8dcc584c518d0bdbc157287dab0091b0d1d8a39f 100644 (file)
@@ -68,6 +68,7 @@
 #include <omnithread.h>
 #include CORBA_SERVER_HEADER(SALOME_Session)
 #include CORBA_SERVER_HEADER(SALOME_ModuleCatalog)
+#include CORBA_SERVER_HEADER(MED_Gen)
 
 // QT Includes
 #include <qstring.h>
@@ -609,6 +610,20 @@ namespace VISU
       myStudyDocument = SALOMEDS::Study::_duplicate(theStudy);
 
       ProcessVoidEvent(new TEvent(aStudyName));
+
+      // Load MED component if necessary
+      if(!myStudyDocument->FindComponent("MED")->_is_nil())
+       {
+         SALOME_LifeCycleCORBA aLCC(SalomeApp_Application::namingService());
+         Engines::Component_var aComponent = aLCC.FindOrLoad_Component("FactoryServer","MED");
+         SALOME_MED::MED_Gen_var aMedEngine = SALOME_MED::MED_Gen::_narrow(aComponent);
+         
+         if(!CORBA::is_nil(aMedEngine))
+           {
+             SALOMEDS::StudyBuilder_var aStudyBuilder = myStudyDocument->NewBuilder();
+             aStudyBuilder->LoadWith( myStudyDocument->FindComponent( "MED" ), aMedEngine );
+           }
+       }
     } else {
       INFOS("CORBA::is_nil(theStudy)");
     }