Salome HOME
Merge with OCC_development_01
[modules/visu.git] / src / VISU_I / VISU_CorbaMedConvertor.hxx
index 53bd83adfcca9e723b8668127928e4030369821b..6b7c94107ae077047bfd960a113b1fcc7ed26f90 100644 (file)
 
 #include <string>      
 
-extern "C"{
-#include <med.h>
-}  
+namespace VISU{
 
-namespace VISUMED{
-  struct TFamily{
-    SALOME_MED::FAMILY_var myFamily;
-  };
-  typedef std::map<std::string,TFamily> TFamilyMap;
-  
-  struct TField{
-    struct TValForTime{
-      SALOME_MED::FIELD_var myField;
-    };
-    typedef std::map<int,TValForTime> TValField;
-    TValField myValField;
+  struct TCMesh: TMeshImpl{
+    SALOME_MED::MESH_var myMesh;
   };
-  typedef std::map<std::string,TField> TFieldMap;
+  typedef shared_ptr<TCMesh> PCMesh;
 
-  struct TMeshOnEntity{
+  struct TCMeshOnEntity: TMeshOnEntityImpl{
     SALOME_MED::SUPPORT_var mySupport;
     typedef std::pair<int,int> TIndexAndSize;
     typedef std::map<int,TIndexAndSize> TCellsFirstIndex;
     TCellsFirstIndex myCellsFirstIndex;
-    TFamilyMap myFamilyMap;
-    TFieldMap myFieldMap;
   };
-  typedef std::map<VISU::TEntity,TMeshOnEntity> TMeshOnEntityMap;
+  typedef shared_ptr<TCMeshOnEntity> PCMeshOnEntity;
+  
+  struct TCFamily: TFamilyImpl{
+    SALOME_MED::FAMILY_var myFamily;
+  };
+  typedef shared_ptr<TCFamily> PCFamily;
   
-  struct TGroup{
+  struct TCGroup: TGroupImpl{
     SALOME_MED::GROUP_var myGroup;
   };
-  typedef std::map<std::string,TGroup> TGroupMap;
+  typedef shared_ptr<TCGroup> PCGroup;
 
-  struct TMesh{
-    SALOME_MED::MESH_var myMesh;
-    TMeshOnEntityMap myMeshOnEntityMap;
-    TGroupMap myGroupMap;
+  struct TCField: TFieldImpl{
+  };
+  typedef shared_ptr<TCField> PCField;
+
+  struct TCValForTime: TValForTimeImpl{
+    SALOME_MED::FIELD_var myField;
   };
-  typedef std::map<std::string,TMesh> TMeshMap;
+  typedef shared_ptr<TCValForTime> PCValForTime;
+
 }
 
 
 class VISU_MEDConvertor: public VISU_Convertor_impl{
  protected:
-  VISUMED::TMeshMap myMeshMap2;
   SALOMEDS::SObject_var mySObject;
   VISU_MEDConvertor() {};
 
@@ -93,23 +86,28 @@ class VISU_MEDConvertor: public VISU_Convertor_impl{
   VISU_Convertor* Build(SALOME_MED::MED_ptr theMED);
   VISU_Convertor* Build(SALOMEDS::ChildIterator_ptr theTimeStampIterator);
 
-  virtual int LoadMeshOnEntity(VISU::TMeshOnEntity& theMeshOnEntity, 
+  virtual int LoadMeshOnEntity(VISU::PMeshOnEntityImpl theMeshOnEntity, 
                               const std::string& theFamilyName = "");
 
-  virtual int LoadMeshOnGroup(VISU::TMesh& theMesh, 
+  virtual int LoadMeshOnGroup(VISU::PMeshImpl theMesh, 
                              const VISU::TFamilyAndEntitySet& theFamilyAndEntitySet);
 
-  virtual int LoadFieldOnMesh(VISU::TMesh& theMesh, 
-                             VISU::TMeshOnEntity& theMeshOnEntity, 
-                             VISU::TField& theField, 
-                             VISU::TField::TValForTime& theValForTime);
-
-  int LoadPoints(VISU::TMesh& theMesh, const std::string& theFamilyName = "") ;
+  virtual int LoadFieldOnMesh(VISU::PMeshImpl theMesh, 
+                             VISU::PMeshOnEntityImpl theMeshOnEntity, 
+                             VISU::PFieldImpl theField, 
+                             VISU::PValForTimeImpl theValForTime);
 
-  int LoadCellsOnEntity(VISU::TMeshOnEntity& theMeshOnEntity, const std::string& theFamilyName = "");
+  int LoadPoints(VISU::PCMesh theMesh,
+                const std::string& theFamilyName = "") ;
 
-  int LoadField(const VISU::TMeshOnEntity& theMeshOnEntity,
-               const VISU::TField& theField, VISU::TField::TValForTime& theValForTime);
+  int LoadCellsOnEntity(VISU::PCMesh theMesh,
+                       VISU::PCMeshOnEntity theMeshOnEntity, 
+                       const std::string& theFamilyName = "");
+  
+  int LoadField(VISU::PCMesh theMesh,
+               VISU::PCMeshOnEntity theMeshOnEntity,
+               VISU::PField theField, 
+               VISU::PCValForTime theValForTime);
 
 };
 
@@ -117,7 +115,9 @@ class VISU_MEDFieldConvertor: public VISU_MEDConvertor{
  protected:
   SALOME_MED::FIELD_var myField;
  public:
-  VISU_MEDFieldConvertor(SALOME_MED::FIELD_ptr theField) : myField(SALOME_MED::FIELD::_duplicate(theField)) {}
+  VISU_MEDFieldConvertor(SALOME_MED::FIELD_ptr theField) : 
+    myField(SALOME_MED::FIELD::_duplicate(theField)) 
+  {}
   virtual VISU_Convertor* Build() ;
 };