Salome HOME
Updated copyright comment
[modules/med.git] / src / MEDCalc / cmp / MEDPresentationManager_i.hxx
1 // Copyright (C) 2007-2024  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_PRESENTATION_MANAGER_I_HXX_
21 #define _MED_PRESENTATION_MANAGER_I_HXX_
22
23 #include <SALOMEconfig.h>
24 #include CORBA_SERVER_HEADER(MEDDataManager)
25 #include CORBA_SERVER_HEADER(MEDPresentationManager)
26 #include "SALOME_GenericObj_i.hh"
27
28 #include "MEDDataManager_i.hxx"
29 #include "MEDPresentation.hxx"
30 #include "MEDCALC.hxx"
31
32 #include <vector>
33 #include <string>
34
35 class MEDPresentationManager_i: public POA_MEDCALC::MEDPresentationManager,
36                                                public SALOME::GenericObj_i
37 {
38  public:
39
40   MEDCALC_EXPORT static MEDPresentationManager_i* getInstance();
41
42   MEDCALC_EXPORT MEDPresentation::TypeID makeMeshView(const MEDCALC::MeshViewParameters&, const MEDCALC::ViewModeType);
43   MEDCALC_EXPORT MEDPresentation::TypeID makeScalarMap(const MEDCALC::ScalarMapParameters&, const MEDCALC::ViewModeType);
44   MEDCALC_EXPORT MEDPresentation::TypeID makeContour(const MEDCALC::ContourParameters&, const MEDCALC::ViewModeType);
45   MEDCALC_EXPORT MEDPresentation::TypeID makeVectorField(const MEDCALC::VectorFieldParameters&, const MEDCALC::ViewModeType);
46   MEDCALC_EXPORT MEDPresentation::TypeID makeSlices(const MEDCALC::SlicesParameters&, const MEDCALC::ViewModeType);
47   MEDCALC_EXPORT MEDPresentation::TypeID makeDeflectionShape(const MEDCALC::DeflectionShapeParameters&, const MEDCALC::ViewModeType);
48   MEDCALC_EXPORT MEDPresentation::TypeID makePointSprite(const MEDCALC::PointSpriteParameters&, const MEDCALC::ViewModeType);
49   MEDCALC_EXPORT MEDPresentation::TypeID makePlot3D(const MEDCALC::Plot3DParameters&, const MEDCALC::ViewModeType);
50   MEDCALC_EXPORT MEDPresentation::TypeID makeStreamLines(const MEDCALC::StreamLinesParameters&, const MEDCALC::ViewModeType);
51   MEDCALC_EXPORT MEDPresentation::TypeID makeCutSegment(const MEDCALC::CutSegmentParameters&, const MEDCALC::ViewModeType);
52
53   MEDCALC_EXPORT void setPresentationStringProperty(MEDPresentation::TypeID presentationID, const char* propName, const char* propValue);
54   MEDCALC_EXPORT char* getPresentationStringProperty(MEDPresentation::TypeID presentationID, const char* propName);
55
56   MEDCALC_EXPORT void setPresentationIntProperty(MEDPresentation::TypeID presentationID, const char* propName, const CORBA::Long propValue);
57   MEDCALC_EXPORT CORBA::Long getPresentationIntProperty(MEDPresentation::TypeID presentationID, const char* propName);
58
59   MEDCALC_EXPORT void setPresentationDoubleProperty(MEDPresentation::TypeID presentationID, const char* propName, const CORBA::Double propValue);
60   MEDCALC_EXPORT CORBA::Double getPresentationDoubleProperty(MEDPresentation::TypeID presentationID, const char* propName);
61
62   MEDCALC_EXPORT MEDCALC::MeshViewParameters   getMeshViewParameters(MEDPresentation::TypeID presentationID);
63   MEDCALC_EXPORT MEDCALC::ScalarMapParameters* getScalarMapParameters(MEDPresentation::TypeID presentationID);
64   MEDCALC_EXPORT MEDCALC::ContourParameters*    getContourParameters(MEDPresentation::TypeID presentationID);
65   MEDCALC_EXPORT MEDCALC::SlicesParameters*    getSlicesParameters(MEDPresentation::TypeID presentationID);
66   MEDCALC_EXPORT MEDCALC::VectorFieldParameters*     getVectorFieldParameters(MEDPresentation::TypeID presentationID);
67   MEDCALC_EXPORT MEDCALC::PointSpriteParameters*    getPointSpriteParameters(MEDPresentation::TypeID presentationID);
68   MEDCALC_EXPORT MEDCALC::Plot3DParameters*         getPlot3DParameters(MEDPresentation::TypeID presentationID);
69   MEDCALC_EXPORT MEDCALC::DeflectionShapeParameters*     getDeflectionShapeParameters(MEDPresentation::TypeID presentationID);
70   MEDCALC_EXPORT MEDCALC::StreamLinesParameters*     getStreamLinesParameters(MEDPresentation::TypeID presentationID);
71   MEDCALC_EXPORT MEDCALC::CutSegmentParameters*     getCutSegmentParameters(MEDPresentation::TypeID presentationID);
72
73   MEDCALC_EXPORT void updateMeshView(MEDPresentation::TypeID, const MEDCALC::MeshViewParameters&);
74   MEDCALC_EXPORT void updateScalarMap(MEDPresentation::TypeID, const MEDCALC::ScalarMapParameters&);
75   MEDCALC_EXPORT void updateContour(MEDPresentation::TypeID, const MEDCALC::ContourParameters&);
76   MEDCALC_EXPORT void updateVectorField(MEDPresentation::TypeID, const MEDCALC::VectorFieldParameters&);
77   MEDCALC_EXPORT void updateSlices(MEDPresentation::TypeID, const MEDCALC::SlicesParameters&);
78   MEDCALC_EXPORT void updateDeflectionShape(MEDPresentation::TypeID, const MEDCALC::DeflectionShapeParameters&);
79   MEDCALC_EXPORT void updatePointSprite(MEDPresentation::TypeID, const MEDCALC::PointSpriteParameters&);
80   MEDCALC_EXPORT void updatePlot3D(MEDPresentation::TypeID, const MEDCALC::Plot3DParameters&);
81   MEDCALC_EXPORT void updateStreamLines(MEDPresentation::TypeID, const MEDCALC::StreamLinesParameters&);
82   MEDCALC_EXPORT void updateCutSegment(MEDPresentation::TypeID, const MEDCALC::CutSegmentParameters&);
83
84   MEDCALC_EXPORT CORBA::Boolean removePresentation(MEDPresentation::TypeID);
85   MEDCALC_EXPORT CORBA::Boolean activateView(MEDPresentation::TypeID);
86   MEDCALC_EXPORT CORBA::Long getActiveViewPythonId();
87 //  MEDCALC_EXPORT MEDCALC::ViewModeType getPresentationViewMode(MEDPresentation::TypeID);
88   MEDCALC_EXPORT char * getParavisDump(MEDPresentation::TypeID presentationID);
89   MEDCALC_EXPORT MEDCALC::PresentationsList* getAllPresentations();
90   MEDCALC_EXPORT void cleanUp();
91   MEDCALC_EXPORT MEDCALC::PresentationVisibility stateInActiveView(MEDPresentation::TypeID presentationID);
92
93  private:
94   MEDPresentationManager_i();
95   virtual ~MEDPresentationManager_i();
96
97   static MEDPresentation::TypeID GenerateID();
98
99   // Create a new presentation instance and return its unique ID
100   template<typename PresentationType, typename PresentationParameters>
101   MEDPresentation::TypeID _makePresentation(const PresentationParameters params, MEDCALC::ViewModeType viewMode);
102
103   // Update presentation
104   template<typename PresentationType, typename PresentationParameters>
105   void _updatePresentation(MEDPresentation::TypeID presentationID, const PresentationParameters params);
106
107   // Get presentation parameters
108   template<typename PresentationType, typename PresentationParameters>
109   void _getParameters(MEDPresentation::TypeID presentationID, PresentationParameters & params) const;
110
111   MEDPresentation* _getPresentation(MEDPresentation::TypeID) const;
112
113  private :
114
115   // The MEDPresentationManager is a singleton, whose instance can be obtained
116   // using the getInstance static method.
117   static MEDPresentationManager_i* _instance;
118
119   // Owns a list of MEDPresentation objects
120   std::map<MEDPresentation::TypeID, MEDPresentation*> _presentations;
121
122   long _activeViewPythonId;
123 };
124
125 #include "MEDPresentationManager_i.txx"
126
127 #endif // _MED_PRESENTATION_MANAGER_I_HXX_