Salome HOME
Deleted Study parameter
[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 #ifdef WIN32
24 # if defined MEDENGINE_EXPORTS || defined MEDEngine_EXPORTS
25 #  define MEDENGINE_EXPORT __declspec( dllexport )
26 # else
27 #  define MEDENGINE_EXPORT __declspec( dllimport )
28 # endif
29 #else
30 # define MEDENGINE_EXPORT
31 #endif
32
33 #include <SALOMEconfig.h>
34 #include CORBA_SERVER_HEADER(MED_Gen)
35 #include CORBA_SERVER_HEADER(MEDDataManager)
36 #include CORBA_CLIENT_HEADER(SALOMEDS)
37 #include <SALOME_Component_i.hxx>
38
39 #include <map>
40 #include <string>
41
42 class MEDENGINE_EXPORT MED :
43   public POA_MED_ORB::MED_Gen,
44   public Engines_Component_i
45 {
46 public:
47   MED(CORBA::ORB_ptr orb,
48       PortableServer::POA_ptr poa,
49       PortableServer::ObjectId* contId,
50       const char* instanceName,
51       const char* interfaceName);
52   virtual ~MED();
53
54   MED_ORB::status addDatasourceToStudy(const MEDCALC::DatasourceHandler& datasourceHandler);
55
56   MED_ORB::status registerPresentationField(CORBA::Long fieldId,
57                                             const char* name,
58                                             const char* type,
59                                             const char* ico,
60                                             CORBA::Long presentationId);
61
62   MED_ORB::status registerPresentationMesh(CORBA::Long meshId,
63                                            const char* name,
64                                            const char* type,
65                                            const char* ico,
66                                            CORBA::Long presentationId);
67
68   MED_ORB::status unregisterPresentation(CORBA::Long presentationId);
69
70 //  // Caller owns the returned list, and is responsible for the list deletion.
71 //  MED_ORB::PresentationsList* getSiblingPresentations(CORBA::Long presentationId);
72
73   // Get all presentations registered in the study
74   MED_ORB::PresentationsList* getStudyPresentations();
75
76   char* getStudyPresentationEntry(CORBA::Long presentationId);
77
78   void cleanUp();
79
80   /*! Dump the study as a Python file */
81   virtual Engines::TMPFile* DumpPython(CORBA::Boolean isPublished,
82                                        CORBA::Boolean isMultiFile,
83                                        CORBA::Boolean& isValidScript);
84
85   // For tooltips
86   virtual CORBA::Boolean hasObjectInfo();
87   virtual char* getObjectInfo(const char* entry);
88
89  private:
90   std::map<long, std::string> _fieldSeriesEntries;
91   std::map<long, std::string> _meshEntries;
92 };
93
94 extern "C"
95 MEDENGINE_EXPORT
96 PortableServer::ObjectId* MEDEngine_factory( CORBA::ORB_ptr orb,
97                                              PortableServer::POA_ptr poa,
98                                              PortableServer::ObjectId* contId,
99                                              const char* instanceName,
100                                              const char* interfaceName );
101
102 #endif