Salome HOME
Windows compatibility for V8_2_BR
[modules/med.git] / src / MEDCalc / cmp / MED.hxx
1 // Copyright (C) 2015-2016  CEA/DEN, EDF R&D
2 //
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, or (at your option) any later version.
7 //
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.
12 //
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
16 //
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
18 //
19
20 #ifndef _MED_HXX_
21 #define _MED_HXX_
22
23 #include <SALOMEconfig.h>
24 #include CORBA_SERVER_HEADER(MED_Gen)
25 #include CORBA_SERVER_HEADER(MEDDataManager)
26 #include CORBA_CLIENT_HEADER(SALOMEDS)
27 #include <SALOME_Component_i.hxx>
28 #include <SALOMEDS_Study.hxx>
29
30 #include <map>
31 #include <string>
32
33 #include "MEDCALC.hxx"
34
35 class MEDCALC_EXPORT MED :
36   public POA_MED_ORB::MED_Gen,
37   public Engines_Component_i
38 {
39 public:
40   MED(CORBA::ORB_ptr orb,
41       PortableServer::POA_ptr poa,
42       PortableServer::ObjectId* contId,
43       const char* instanceName,
44       const char* interfaceName);
45   virtual ~MED();
46
47   MED_ORB::status addDatasourceToStudy(SALOMEDS::Study_ptr study,
48                                        const MEDCALC::DatasourceHandler& datasourceHandler);
49
50   MED_ORB::status registerPresentationField(SALOMEDS::Study_ptr study,
51                                        CORBA::Long fieldId,
52                                        const char* name,
53                                        const char* type,
54                                        const char* ico,
55                                        CORBA::Long presentationId);
56
57   MED_ORB::status registerPresentationMesh(SALOMEDS::Study_ptr study,
58                                          CORBA::Long meshId,
59                                          const char* name,
60                                          const char* type,
61                                          const char* ico,
62                                          CORBA::Long presentationId);
63
64   MED_ORB::status unregisterPresentation(SALOMEDS::Study_ptr study,
65                                          CORBA::Long presentationId);
66
67 //  // Caller owns the returned list, and is responsible for the list deletion.
68 //  MED_ORB::PresentationsList* getSiblingPresentations(SALOMEDS::Study_ptr study,
69 //                                                      CORBA::Long presentationId);
70
71   // Get all presentations registered in the study
72   MED_ORB::PresentationsList* getStudyPresentations(SALOMEDS::Study_ptr study);
73
74   char* getStudyPresentationEntry(SALOMEDS::Study_ptr study, CORBA::Long presentationId);
75
76   void cleanUp();
77
78   /*! Dump the study as a Python file */
79   virtual Engines::TMPFile* DumpPython(CORBA::Object_ptr theStudy,
80                                        CORBA::Boolean isPublished,
81                                        CORBA::Boolean isMultiFile,
82                                        CORBA::Boolean& isValidScript);
83
84   // For tooltips
85   virtual CORBA::Boolean hasObjectInfo();
86   virtual char* getObjectInfo(CORBA::Long studyId, const char* entry);
87
88  private:
89   std::map<long, std::string> _fieldSeriesEntries;
90   std::map<long, std::string> _meshEntries;
91 };
92
93 extern "C"
94 MEDCALC_EXPORT
95 PortableServer::ObjectId* MEDEngine_factory( CORBA::ORB_ptr orb,
96                                              PortableServer::POA_ptr poa,
97                                              PortableServer::ObjectId* contId,
98                                              const char* instanceName,
99                                              const char* interfaceName );
100
101 #endif