Vous avez reçu un message "Your GitLab account has been locked ..." ? Pas d'inquiétude : lisez cet article https://docs.gricad-pages.univ-grenoble-alpes.fr/help/unlock/

Commit 52fffada authored by Tiffet Théophile's avatar Tiffet Théophile
Browse files

Moved the modification from trigger to getWidget so that Action.h does not need any modification.

parent 697276ce
...@@ -73,11 +73,8 @@ ManualThreshold::~ManualThreshold() { ...@@ -73,11 +73,8 @@ ManualThreshold::~ManualThreshold() {
// do not delete the widget has it might have been used in the ActionViewer (i.e. the ownership might have been taken by the stacked widget) // do not delete the widget has it might have been used in the ActionViewer (i.e. the ownership might have been taken by the stacked widget)
} }
// --------------- trigger ------------------- // --------------- getWidget -------------------
Action::ApplyStatus ManualThreshold::trigger(QWidget* parent) { QWidget* ManualThreshold::getWidget() {
if (Action::trigger(parent) == ERROR)
return ERROR;
// Computing the maximum and the minimum possible value for the image // Computing the maximum and the minimum possible value for the image
double min = 0; double min = 0;
double max = 0; double max = 0;
...@@ -101,10 +98,8 @@ Action::ApplyStatus ManualThreshold::trigger(QWidget* parent) { ...@@ -101,10 +98,8 @@ Action::ApplyStatus ManualThreshold::trigger(QWidget* parent) {
highThresholdProperty->setAttribute("maximum", max); highThresholdProperty->setAttribute("maximum", max);
highThresholdProperty->setAttribute("singleStep", (max - min) / 255); highThresholdProperty->setAttribute("singleStep", (max - min) / 255);
addParameter(highThresholdProperty); addParameter(highThresholdProperty);
// Updating the widget // Call the parent method
if (actionWidget) return Action::getWidget();
dynamic_cast<camitk::ActionWidget*>(actionWidget)->update();
return SUCCESS;
} }
// --------------- apply ------------------- // --------------- apply -------------------
......
...@@ -46,13 +46,9 @@ public: ...@@ -46,13 +46,9 @@ public:
/// Default Destructor /// Default Destructor
virtual ~ManualThreshold(); virtual ~ManualThreshold();
virtual QWidget* getWidget();
public slots: public slots:
/**
* This method triggers the action.
* The parent widget is used if the action is embedded, see class description for more information about the algorithm.
* This method cannot be redefined in inherited class.
*/
virtual ApplyStatus trigger(QWidget* parent = nullptr);
/** this method is automatically called when the action is triggered. /** this method is automatically called when the action is triggered.
* Use getTargets() QList to get the list of component to use. * Use getTargets() QList to get the list of component to use.
* \note getTargets() is automatically filtered so that it only contains compatible components, * \note getTargets() is automatically filtered so that it only contains compatible components,
......
...@@ -241,7 +241,7 @@ public slots: ...@@ -241,7 +241,7 @@ public slots:
* The parent widget is used if the action is embedded, see class description for more information about the algorithm. * The parent widget is used if the action is embedded, see class description for more information about the algorithm.
* This method cannot be redefined in inherited class. * This method cannot be redefined in inherited class.
*/ */
virtual ApplyStatus trigger(QWidget* parent = nullptr); ApplyStatus trigger(QWidget* parent = nullptr);
/** /**
* This method is called when the action has to be applied on the target list (get the target lists using getTargets()) * This method is called when the action has to be applied on the target list (get the target lists using getTargets())
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment