1 // Copyright (C) 2016-2024 CEA, EDF
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 "MEDWidgetHelperStreamLines.hxx"
21 #include "MEDPresentationStreamLines.hxx" // from component side.
22 #include "PresentationController.hxx"
24 #include <Basics_Utils.hxx>
28 MEDWidgetHelperStreamLines::MEDWidgetHelperStreamLines(const PresentationController* presController,
29 MEDCALC::MEDPresentationManager_ptr presManager, int presId, const std::string & presName,
30 WidgetPresentationParameters * paramW):
31 MEDWidgetHelper(presController, presManager, presId, presName, paramW)
34 MEDWidgetHelperStreamLines::~MEDWidgetHelperStreamLines()
37 void MEDWidgetHelperStreamLines::loadParametersFromEngine()
39 MEDWidgetHelper::loadParametersFromEngine();
40 _intDirType = static_cast<MEDCALC::IntegrationDirType>(
41 _presManager->getPresentationIntProperty(_presId, MEDPresentationStreamLines::PROP_INTEGR_DIR_TYPE.c_str()));
44 void MEDWidgetHelperStreamLines::updateWidget(bool connect)
46 MEDWidgetHelper::updateWidget(connect);
48 _paramWidget->setIntegrationDir(_intDirType);
50 // Connect spin boxes changes
53 QObject::connect( _paramWidget, SIGNAL(comboIntegrDirIndexChanged(int)), this, SLOT(onIntegrDirTypeChanged(int)) );
57 void MEDWidgetHelperStreamLines::releaseWidget()
59 MEDWidgetHelper::releaseWidget();
61 QObject::disconnect( _paramWidget, SIGNAL(comboIntegrDirIndexChanged(int)), this, SLOT(onIntegrDirTypeChanged(int)) );
64 void MEDWidgetHelperStreamLines::onIntegrDirTypeChanged(int index)
66 STDLOG("MEDWidgetHelperStreamLines::onIntegrDirTypeChanged");
67 PresentationEvent* event = new PresentationEvent();
68 event->eventtype = PresentationEvent::EVENT_CHANGE_INTEGR_DIR;
69 event->presentationId = _presId;
70 event->anInteger = static_cast<int>(_paramWidget->getIntegrationDir());
72 emit presentationUpdateSignal(event); // --> PresentationController::processPresentationEvent