Commit 1bb0876c authored by Frédéric Larue's avatar Frédéric Larue

Set/GetParameters functions removed from ToolInterface. onUpdatingParameter...

Set/GetParameters functions removed from ToolInterface. onUpdatingParameter function modified accordingly to get access to the UIParamSet of the current tool.
parent d2ee2699
......@@ -69,7 +69,6 @@ void AlgorithmSelector::populateTools( ToolInterface *plugin )
tool.plugin = plugin;
tool.id = i;
tool.param = new UIParamSet( "Tool options", this );
plugin->setParameters( tool.param );
plugin->declareParameters( i, *tool.param );
tool.param->hide();
//tool.param->setMaximumWidth(360);
......
......@@ -124,7 +124,7 @@ public:
/** Recover parameters describing the display options of the current item. */
virtual void declareParameters( UIParamSet &params ) {}
/** Function called when the value of a parameter has changed. */
virtual void onUpdatingParameter( UIParam *p ) {}
virtual void onUpdatingParameter( UIParamSet &params, UIParam *p ) {}
/** Function that effectively performs the display. */
virtual void onDisplay( UIParamSet &params ) = 0;
/** Called when the viewport of the GL widget into which this object is displayed is resized. */
......@@ -172,7 +172,7 @@ signals:
public slots:
inline void setSelected( bool selected ) { m_IsSelected = selected; }
inline void updateParameter( UIParam* p ) { onUpdatingParameter(p); }
inline void updateParameter( UIParam* p ) { onUpdatingParameter(*p->Group(),p); }
inline void startAnimation() { m_IsAnimationPaused = false; emit registerAnimation(this); }
inline void pauseAnimation() { m_IsAnimationPaused = true; }
inline void stopAnimation() { m_IsAnimationPaused = false; emit unregisterAnimation(this); }
......
......@@ -25,17 +25,10 @@ class ToolInterface : public QObject
{
Q_OBJECT
UIParamSet *m_Parameters;
public:
inline ToolInterface() : QObject(), m_Parameters(NULL) {}
inline ToolInterface() : QObject() {}
virtual ~ToolInterface() {}
inline void setParameters( UIParamSet *params ) { m_Parameters = params; }
/** Recover the current state of the set of tool parameters. */
inline const UIParamSet& getParameters() const { return *m_Parameters; }
/** In the case of a plugin containing more than one tool, this function returns a list
* of numbers that makes it possible to identify each of them.
*/
......@@ -51,7 +44,7 @@ public:
/** Recover parameters describing options of the current tool. */
virtual void declareParameters( int id, UIParamSet &params ) = 0;
/** Function called when the value of a parameter has changed. */
virtual void onUpdatingParameter( UIParam *p ) {}
virtual void onUpdatingParameter( UIParamSet &params, UIParam *p ) {}
/** Core function that effectively performs the tool execution. Data to be processed are
* given to the function through the vector *items*. Each cell of this vector contains
* a list of BaseManageable, whose concrete type is the one given by the corresponding
......@@ -90,7 +83,7 @@ signals:
void notifyProgressValue( unsigned int n, int value );
public slots:
inline void updateParameter( UIParam* p ) { onUpdatingParameter(p); }
inline void updateParameter( UIParam* p ) { onUpdatingParameter(*p->Group(),p); }
};
......
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