Salome HOME
Fix pb with Animation
[modules/visu.git] / src / VISU_I / VISU_CorbaMedConvertor.hxx
1 //  VISU OBJECT : interactive object for VISU entities implementation
2 //
3 //  Copyright (C) 2003  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. 
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.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org 
21 //
22 //
23 //
24 //  File   : VISU_CorbaMedConvertor.hxx
25 //  Author : Alexey PETROV
26 //  Module : VISU
27 //  $Header$
28 //  Copyright (C) 2003  CEA/DEN, EDF R&D
29
30 #ifndef VISU_CorbaMedConvertor_HeaderFile
31 #define VISU_CorbaMedConvertor_HeaderFile
32
33 #include "VISUConfig.hh"
34 #include "VISU_Convertor_impl.hxx"
35
36 #include <string>       
37
38 namespace VISU{
39
40   struct TCMesh: TMeshImpl{
41     SALOME_MED::MESH_var myMesh;
42   };
43   typedef shared_ptr<TCMesh> PCMesh;
44
45   struct TCMeshOnEntity: TMeshOnEntityImpl{
46     SALOME_MED::SUPPORT_var mySupport;
47     typedef std::pair<int,int> TIndexAndSize;
48     typedef std::map<int,TIndexAndSize> TCellsFirstIndex;
49     TCellsFirstIndex myCellsFirstIndex;
50   };
51   typedef shared_ptr<TCMeshOnEntity> PCMeshOnEntity;
52   
53   struct TCFamily: TFamilyImpl{
54     SALOME_MED::FAMILY_var myFamily;
55   };
56   typedef shared_ptr<TCFamily> PCFamily;
57   
58   struct TCGroup: TGroupImpl{
59     SALOME_MED::GROUP_var myGroup;
60   };
61   typedef shared_ptr<TCGroup> PCGroup;
62
63   struct TCField: TFieldImpl{
64   };
65   typedef shared_ptr<TCField> PCField;
66
67   struct TCValForTime: TValForTimeImpl{
68     SALOME_MED::FIELD_var myField;
69   };
70   typedef shared_ptr<TCValForTime> PCValForTime;
71
72 }
73
74
75 class VISU_MEDConvertor: public VISU_Convertor_impl{
76  protected:
77   SALOMEDS::SObject_var mySObject;
78   VISU_MEDConvertor() {};
79
80  public:
81   VISU_MEDConvertor(SALOMEDS::SObject_ptr theMedSObject) : mySObject(SALOMEDS::SObject::_duplicate(theMedSObject)) {}
82   virtual VISU_Convertor* Build();
83
84  protected:
85
86   VISU_Convertor* Build(SALOME_MED::MED_ptr theMED);
87   VISU_Convertor* Build(SALOMEDS::ChildIterator_ptr theTimeStampIterator);
88
89   virtual int LoadMeshOnEntity(VISU::PMeshOnEntityImpl theMeshOnEntity, 
90                                const std::string& theFamilyName = "");
91
92   virtual int LoadMeshOnGroup(VISU::PMeshImpl theMesh, 
93                               const VISU::TFamilyAndEntitySet& theFamilyAndEntitySet);
94
95   virtual int LoadFieldOnMesh(VISU::PMeshImpl theMesh, 
96                               VISU::PMeshOnEntityImpl theMeshOnEntity, 
97                               VISU::PFieldImpl theField, 
98                               VISU::PValForTimeImpl theValForTime);
99
100   int LoadPoints(VISU::PCMesh theMesh,
101                  const std::string& theFamilyName = "") ;
102
103   int LoadCellsOnEntity(VISU::PCMesh theMesh,
104                         VISU::PCMeshOnEntity theMeshOnEntity, 
105                         const std::string& theFamilyName = "");
106   
107   int LoadField(VISU::PCMesh theMesh,
108                 VISU::PCMeshOnEntity theMeshOnEntity,
109                 VISU::PField theField, 
110                 VISU::PCValForTime theValForTime);
111
112 };
113
114 class VISU_MEDFieldConvertor: public VISU_MEDConvertor{
115  protected:
116   SALOME_MED::FIELD_var myField;
117  public:
118   VISU_MEDFieldConvertor(SALOME_MED::FIELD_ptr theField) : 
119     myField(SALOME_MED::FIELD::_duplicate(theField)) 
120   {}
121   virtual VISU_Convertor* Build() ;
122 };
123
124 extern "C" {
125   VISU_Convertor* CreateMEDConvertor(SALOMEDS::SObject_ptr theMedSObject) ;
126   VISU_Convertor* CreateMEDFieldConvertor(SALOME_MED::FIELD_ptr theField) ;
127 }
128
129 #endif
130