MEDCALC::MEDPresentationManager_ptr presManager, int presId,
const std::string & presName, WidgetPresentationParameters * paramW):
MEDWidgetHelper(presController, presManager, presId, presName, paramW),
- _nbContours(-1)
+ _nbContours(-1),
+ _contourComponent(0)
{}
MEDWidgetHelperContour::~MEDWidgetHelperContour()
{
MEDWidgetHelper::loadParametersFromEngine();
_nbContours = _presManager->getPresentationIntProperty(_presId, MEDPresentationContour::PROP_NB_CONTOUR.c_str());
+ _contourComponent = _presManager->getPresentationIntProperty(_presId, MEDPresentationContour::PROB_CONTOUR_COMPONENT_ID.c_str());
+
}
void MEDWidgetHelperContour::updateWidget(bool connect)
// Contour presentation needs the number of contours
_paramWidget->setNbContour(_nbContours);
+ _paramWidget->setContourComponents(_allCompos, _contourComponent);
// Connect combo box changes
if (connect)
QObject::connect( this, SIGNAL(presentationUpdateSignal(const PresentationEvent *)),
_presController, SIGNAL(presentationSignal(const PresentationEvent *)) );
QObject::connect( _paramWidget, SIGNAL(spinBoxValueChanged(int)), this, SLOT(onNbContourChanged(int)) );
+ QObject::connect( _paramWidget, SIGNAL(comboContCompIndexChanged(int)), this, SLOT(onContourComponentTypeChanged(int)) );
}
+ if(_nbCompos == 1)
+ _paramWidget->hideContourComponent();
}
void MEDWidgetHelperContour::releaseWidget()
QObject::disconnect( this, SIGNAL(presentationUpdateSignal(const PresentationEvent *)),
_presController, SIGNAL(presentationSignal(const PresentationEvent *)) );
-// QObject::disconnect( _paramWidget, SIGNAL(comboCompoIndexChanged(int)), this, SLOT(onComponentChanged(int)) );
QObject::disconnect( _paramWidget, SIGNAL(spinBoxValueChanged(int)), this, SLOT(onNbContourChanged(int)) );
+ QObject::disconnect( _paramWidget, SIGNAL(comboContCompIndexChanged(int)), this, SLOT(onContourComponentTypeChanged(int)) );
}
void MEDWidgetHelperContour::onNbContourChanged(int nbContour)
emit presentationUpdateSignal(event); // --> PresentationController::processPresentationEvent
}
+void MEDWidgetHelperContour::onContourComponentTypeChanged(int index)
+{
+ STDLOG("MEDWidgetHelperContour::onContourComponentTypeChanged");
+ PresentationEvent* event = new PresentationEvent();
+ event->eventtype = PresentationEvent::EVENT_CHANGE_CONTOUR_COMPONENT;
+ event->presentationId = _presId;
+ event->anInteger = index;
+ event->aString = _paramWidget->getContourComponent();
+
+ emit presentationUpdateSignal(event); // --> PresentationController::processPresentationEvent
+}
\ No newline at end of file