Salome HOME
updated copyright message
[modules/med.git] / src / MEDCalc / cmp / MED.hxx
1 // Copyright (C) 2015-2023  CEA, EDF
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
29 #include <map>
30 #include <string>
31
32 #include "MEDCALC.hxx"
33
34 class MEDCALC_EXPORT MED :
35   public POA_MED_ORB::MED_Gen,
36   public Engines_Component_i
37 {
38 public:
39   MED(CORBA::ORB_ptr orb,
40       PortableServer::POA_ptr poa,
41       PortableServer::ObjectId* contId,
42       const char* instanceName,
43       const char* interfaceName,
44           bool checkNS = true);
45   virtual ~MED();
46
47   MED_ORB::status addDatasourceToStudy(const MEDCALC::DatasourceHandler& datasourceHandler);
48
49   MED_ORB::status registerPresentationField(CORBA::Long fieldId,
50                                             const char* name,
51                                             const char* type,
52                                             const char* ico,
53                                             CORBA::Long presentationId);
54
55   MED_ORB::status registerPresentationMesh(CORBA::Long meshId,
56                                            const char* name,
57                                            const char* type,
58                                            const char* ico,
59                                            CORBA::Long presentationId);
60
61   MED_ORB::status unregisterPresentation(CORBA::Long presentationId);
62
63 //  // Caller owns the returned list, and is responsible for the list deletion.
64 //  MED_ORB::PresentationsList* getSiblingPresentations(CORBA::Long presentationId);
65
66   // Get all presentations registered in the study
67   MED_ORB::PresentationsList* getStudyPresentations();
68
69   char* getStudyPresentationEntry(CORBA::Long presentationId);
70
71   void cleanUp();
72
73   /*! Dump the study as a Python file */
74   virtual Engines::TMPFile* DumpPython(CORBA::Boolean isPublished,
75                                        CORBA::Boolean isMultiFile,
76                                        CORBA::Boolean& isValidScript);
77
78   // For tooltips
79   virtual CORBA::Boolean hasObjectInfo();
80   virtual char* getObjectInfo(const char* entry);
81
82   // Get Study
83   virtual SALOMEDS::Study_var getStudyServant() = 0;
84
85  private:
86   std::map<long, std::string> _fieldSeriesEntries;
87   std::map<long, std::string> _meshEntries;
88 };
89
90 #endif