1 // Copyright (C) 2011-2016 CEA/DEN, EDF R&D
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.
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.
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
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
20 #include "MEDPresentationManager_i.hxx"
21 #include "MEDFactoryClient.hxx"
24 #include "MEDPresentationScalarMap.hxx"
25 #include "MEDPresentationContour.hxx"
26 #include "MEDPresentationVectorField.hxx"
27 #include "MEDPresentationSlices.hxx"
28 #include "MEDPresentationDeflectionShape.hxx"
29 #include "MEDPresentationPointSprite.hxx"
33 MEDPresentationManager_i* MEDPresentationManager_i::_instance = NULL;
35 MEDPresentationManager_i*
36 MEDPresentationManager_i::getInstance() {
37 if ( _instance == NULL )
38 _instance = new MEDPresentationManager_i();
42 MEDPresentationManager_i::MEDPresentationManager_i()
46 MEDPresentationManager_i::~MEDPresentationManager_i()
49 std::vector<MEDPresentation*>::iterator itr = this->_presentations.begin();
50 for ( ; itr != this->_presentations.end(); ++itr) {
54 this->_presentations.clear();
58 MEDPresentation::TypeID
59 MEDPresentationManager_i::GenerateID()
61 static MEDPresentation::TypeID START_ID = -1;
67 MEDPresentationManager_i::setPresentationProperty(MEDPresentation::TypeID presentationID, const char * propName, const char * propValue)
69 if (_presentations.find(presentationID) != _presentations.end())
71 MEDPresentation * pres(_presentations[presentationID]);
72 pres->setProperty(propName, propValue);
76 std::cerr << "setPresentationProperty(): presentation not found!!" << std::endl;
81 MEDPresentationManager_i::getPresentationProperty(MEDPresentation::TypeID presentationID, const char* propName)
83 if (_presentations.find(presentationID) != _presentations.end()) {
84 MEDPresentation* pres = _presentations[presentationID];
85 return (char*) pres->getProperty(propName).c_str();
88 std::cerr << "getPresentationProperty(): presentation not found!!" << std::endl;
93 MEDPresentation::TypeID
94 MEDPresentationManager_i::makeScalarMap(const MEDCALC::ScalarMapParameters& params)
96 return _makePresentation<MEDPresentationScalarMap>(params);
99 MEDPresentation::TypeID
100 MEDPresentationManager_i::makeContour(const MEDCALC::ContourParameters& params)
102 return _makePresentation<MEDPresentationContour>(params);
105 MEDPresentation::TypeID
106 MEDPresentationManager_i::makeVectorField(const MEDCALC::VectorFieldParameters& params)
108 return _makePresentation<MEDPresentationVectorField>(params);
111 MEDPresentation::TypeID
112 MEDPresentationManager_i::makeSlices(const MEDCALC::SlicesParameters& params)
114 return _makePresentation<MEDPresentationSlices>(params);
117 MEDPresentation::TypeID
118 MEDPresentationManager_i::makeDeflectionShape(const MEDCALC::DeflectionShapeParameters& params)
120 return _makePresentation<MEDPresentationDeflectionShape>(params);
123 MEDPresentation::TypeID
124 MEDPresentationManager_i::makePointSprite(const MEDCALC::PointSpriteParameters& params)
126 return _makePresentation<MEDPresentationPointSprite>(params);