1 // Copyright (C) 2007-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 #ifndef _MED_PRESENTATION_MANAGER_I_TXX_
21 #define _MED_PRESENTATION_MANAGER_I_TXX_
23 template<typename PresentationType, typename PresentationParameters>
24 MEDPresentation::TypeID
25 MEDPresentationManager_i::_makePresentation(PresentationParameters params)
27 // Replace = Remove then add
28 if (params.viewMode == MEDCALC::VIEW_MODE_REPLACE) {
29 MEDPresentation::TypeID currentPresentationId = _getActivePresentationId();
30 if (currentPresentationId > -1)
31 removePresentation(currentPresentationId);
34 // Create a new presentation instance
35 PresentationType* presentation = NULL;
37 presentation = new PresentationType(params); // on stack or on heap?? stack for now
39 catch (const std::exception& e) {
40 std::cerr << e.what() << std::endl;
44 MEDPresentation::TypeID newID = MEDPresentationManager_i::GenerateID();
45 _presentations.insert( std::pair<MEDPresentation::TypeID, MEDPresentation *>(newID, presentation) );
46 presentation->generatePipeline();
50 template<typename PresentationType, typename PresentationParameters>
52 MEDPresentationManager_i::_updatePresentation(MEDPresentation::TypeID presentationID, PresentationParameters params)
54 MEDPresentation* presentation = _getPresentation(presentationID);
56 std::cerr << "_updatePresentation(): presentation not found!!" << std::endl;
60 presentation->updatePipeline<PresentationType>(params);
63 #endif // _MED_PRESENTATION_MANAGER_I_TXX_