Création d'un compte pour un collaborateur extérieur au laboratoire depuis l'intranet ICube : https://intranet.icube.unistra.fr/fr/labs/member/profile

Commit cdbaacca authored by Frédéric Larue's avatar Frédéric Larue
Browse files

UIParamSet has now a generic function to get an uncasted UIParam by its id.

+ Intensive function renaming.
parent 414205c6
......@@ -330,7 +330,7 @@ bool GLViewer::addDisplayable( GenericUIData *m )
displayable->declareParameters( *params );
if( displayable->isAnimated() )
params->add( new UIParamAnimation() );
params->Add( new UIParamAnimation() );
params->updateChildrenLists( m );
......@@ -342,7 +342,7 @@ bool GLViewer::addDisplayable( GenericUIData *m )
if( displayable->isAnimated() )
{
UIParamAnimation *animCtrl = m->GetDisplayOptions()->getAnimationCtrl();
UIParamAnimation *animCtrl = m->GetDisplayOptions()->GetAnimationCtrl();
connect( animCtrl, SIGNAL(animationStartRequired()), displayable, SLOT(startAnimation()) );
connect( animCtrl, SIGNAL(animationPauseRequired()), displayable, SLOT(pauseAnimation()) );
connect( animCtrl, SIGNAL(animationStopRequired ()), displayable, SLOT(stopAnimation ()) );
......@@ -363,7 +363,7 @@ bool GLViewer::addDisplayable( GenericUIData *m )
*m->GetDisplayOptions()
);
if( !m->GetDisplayOptions()->empty() )
if( !m->GetDisplayOptions()->IsEmpty() )
{
m_DisplayOptionsLayout->addWidget( m->GetDisplayOptions() );
m->GetDisplayOptions()->show();
......@@ -586,7 +586,7 @@ GLViewer::DisplayableMap::iterator GLViewer::removeDisplayable_Internal( Display
disconnect( item->GetDisplayOptions(), SIGNAL(parameterUpdated(UIParam*)), this, SLOT(update()) );
disconnect( item->GetDisplayOptions(), SIGNAL(parameterUpdated(UIParam*)), dinfo.displayable, SLOT(updateParameter(UIParam*)) );
if( !item->GetDisplayOptions()->empty() )
if( !item->GetDisplayOptions()->IsEmpty() )
{
item->GetDisplayOptions()->hide();
m_DisplayOptionsLayout->removeWidget( item->GetDisplayOptions() );
......
......@@ -70,8 +70,8 @@ void AlgorithmSelector::populateTools( ToolInterface *plugin )
tool.param->hide();
tool.param->setMaximumWidth(360);
foreach( UIParamAction* act, tool.param->actions() )
connect( act->widget(), SIGNAL(clicked(bool)), this, SLOT(emitActionSignal()) );
foreach( UIParamAction* act, tool.param->GetActions() )
connect( act->GetWidget(), SIGNAL(clicked(bool)), this, SLOT(emitActionSignal()) );
m_ToolsByCategory[categoryId].push_back( tool );
m_ui->widgetToolGroupBoxes->layout()->addWidget( tool.param );
......@@ -198,7 +198,7 @@ void AlgorithmSelector::selectTool( int n )
}
}
if( !m_SelectedTool->param->empty() )
if( !m_SelectedTool->param->IsEmpty() )
{
m_SelectedToolParam = m_SelectedTool->param;
m_SelectedToolParam->show();
......@@ -227,9 +227,9 @@ void AlgorithmSelector::emitApplySignal()
void AlgorithmSelector::emitActionSignal()
{
m_ActionId = QString();
foreach( UIParamAction* act, m_SelectedTool->param->actions() )
if( act->widget() == (QPushButton*)sender() )
m_ActionId = act->id();
foreach( UIParamAction* act, m_SelectedTool->param->GetActions() )
if( act->GetWidget() == (QPushButton*)sender() )
m_ActionId = act->GetId();
if( !m_ActionId.isNull() )
emit askItemsToApplyToolOn();
......
......@@ -1001,12 +1001,12 @@ void UIMainWindow::launchExport( ExportInterface *exportPlugIn,
m_CurrentExportParams = new UIParamSet( "Export options", this );
exportPlugIn->parameters( id, *m_CurrentExportParams );
if( !m_CurrentExportParams->empty() )
if( !m_CurrentExportParams->IsEmpty() )
if( QGridLayout *l = dynamic_cast<QGridLayout*>(dlg.layout()) )
l->addWidget( m_CurrentExportParams, 1,4 );
foreach( UIParamAction* act, m_CurrentExportParams->actions() )
connect( act->widget(), SIGNAL(clicked(bool)), this, SLOT(execExportAction()) );
foreach( UIParamAction* act, m_CurrentExportParams->GetActions() )
connect( act->GetWidget(), SIGNAL(clicked(bool)), this, SLOT(execExportAction()) );
// Sorts all selected data wrt. their types.
......@@ -1158,9 +1158,9 @@ void UIMainWindow::execExportAction()
QString actionId;
foreach( UIParamAction* act, m_CurrentExportParams->actions() )
if( act->widget() == (QPushButton*)sender() )
actionId = act->id();
foreach( UIParamAction* act, m_CurrentExportParams->GetActions() )
if( act->GetWidget() == (QPushButton*)sender() )
actionId = act->GetId();
Context ctx;
......@@ -1294,7 +1294,7 @@ void UIMainWindow::importFiles(const QStringList& selectedFiles)
foreach( QString filename, files )
{
if( !params->empty() && !applyToAll )
if( !params->IsEmpty() && !applyToAll )
{
if( !dlg.exec() )
break;
......
......@@ -31,13 +31,13 @@ public:
virtual ~UIParam() {}
inline const QString& id() const { return m_Id; }
inline const QString& name() const { return m_Name; }
inline const QString& description() const { return m_Description; }
inline const QString& GetId() const { return m_Id; }
inline const QString& GetName() const { return m_Name; }
inline const QString& GetDescription() const { return m_Description; }
inline virtual void arrangeInLayout( QGridLayout *l, int line )
inline virtual void ArrangeInLayout( QGridLayout *l, int line )
{
m_Label = new QLabel( name()+':', l->parentWidget() );
m_Label = new QLabel( GetName()+':', l->parentWidget() );
m_Widget->setParent( l->parentWidget() );
if( !m_Description.isNull() && !m_Description.isEmpty() )
......@@ -50,7 +50,7 @@ public:
l->addWidget( m_Widget, line,1 );
}
virtual void connectModificationSignal() = 0;
virtual void ConnectModificationSignal() = 0;
inline void SetVisible( bool visible = true )
{
......
......@@ -21,16 +21,16 @@ public:
{
m_Widget = new QPushButton( name );
}
inline void arrangeInLayout( QGridLayout *l, int line )
inline void ArrangeInLayout( QGridLayout *l, int line )
{
if( !m_Description.isNull() && !m_Description.isEmpty() )
m_Widget->setToolTip( m_Description );
l->addWidget( m_Widget, line,0, 1,2 );
}
inline QPushButton* widget() { return (QPushButton*) m_Widget; }
void connectModificationSignal()
inline QPushButton* GetWidget() { return (QPushButton*) m_Widget; }
void ConnectModificationSignal()
{
QObject::connect( widget(), SIGNAL(clicked(bool)), this, SLOT(triggerParameterUpdate()) );
QObject::connect( GetWidget(), SIGNAL(clicked(bool)), this, SLOT(triggerParameterUpdate()) );
}
};
......
......@@ -21,14 +21,14 @@ class UIParamAnimation : public UIParam
public:
UIParamAnimation();
inline QComboBox* widget() { return (QComboBox*) m_Widget; }
inline QComboBox* GetWidget() { return (QComboBox*) m_Widget; }
inline void arrangeInLayout( QGridLayout *l, int line )
inline void ArrangeInLayout( QGridLayout *l, int line )
{
l->addWidget( m_Widget, line,0, 1,2 );
}
void connectModificationSignal()
void ConnectModificationSignal()
{
//QObject::connect( widget(), SIGNAL(currentIndexChanged(int)), this, SLOT(triggerParameterUpdate()) );
}
......
......@@ -23,12 +23,12 @@ public:
m_Widget = new QCheckBox( " " );
((QCheckBox*)m_Widget)->setChecked( value );
}
inline bool value() const { return ((QCheckBox*)m_Widget)->isChecked(); }
inline void setValue( bool value ) { ((QCheckBox*)m_Widget)->setChecked( value ); }
inline QCheckBox* widget() { return (QCheckBox*) m_Widget; }
void connectModificationSignal()
inline bool GetValue() const { return ((QCheckBox*)m_Widget)->isChecked(); }
inline void SetValue( bool value ) { ((QCheckBox*)m_Widget)->setChecked( value ); }
inline QCheckBox* GetWidget() { return (QCheckBox*) m_Widget; }
void ConnectModificationSignal()
{
QObject::connect( widget(), SIGNAL(stateChanged(int)), this, SLOT(triggerParameterUpdate()) );
QObject::connect( GetWidget(), SIGNAL(stateChanged(int)), this, SLOT(triggerParameterUpdate()) );
}
};
......
......@@ -26,12 +26,12 @@ public:
unsigned int minSize = 1,
unsigned int maxSize = 65536 );
inline unsigned int value() const { return (unsigned int) ((QSpinBox*) m_Widget)->value(); }
inline void setValue( const unsigned int value ) { ((QSpinBox*) m_Widget)->setValue( (int) value ); }
inline QSpinBox* widget() { return (QSpinBox*) m_Widget; }
void connectModificationSignal()
inline unsigned int GetValue() const { return (unsigned int) ((QSpinBox*) m_Widget)->value(); }
inline void SetValue( const unsigned int value ) { ((QSpinBox*) m_Widget)->setValue( (int) value ); }
inline QSpinBox* GetWidget() { return (QSpinBox*) m_Widget; }
void ConnectModificationSignal()
{
QObject::connect( widget(), SIGNAL(valueChanged(int)), this, SLOT(triggerParameterUpdate()) );
QObject::connect( GetWidget(), SIGNAL(valueChanged(int)), this, SLOT(triggerParameterUpdate()) );
}
public slots:
......
......@@ -29,10 +29,10 @@ public:
unsigned int minSize = 1,
unsigned int maxSize = 65536 );
inline QSize value() const { return QSize( m_SpinSizeX->value(), m_SpinSizeY->value() ); }
inline void setValue( const QSize &value ) { m_SpinSizeX->setValue( value.width() ); m_SpinSizeY->setValue( value.height() ); }
inline QWidget* widget() { return m_Widget; }
void connectModificationSignal()
inline QSize GetValue() const { return QSize( m_SpinSizeX->value(), m_SpinSizeY->value() ); }
inline void SetValue( const QSize &value ) { m_SpinSizeX->setValue( value.width() ); m_SpinSizeY->setValue( value.height() ); }
inline QWidget* GetWidget() { return m_Widget; }
void ConnectModificationSignal()
{
QObject::connect( m_SpinSizeX, SIGNAL(valueChanged(int)), this, SLOT(triggerParameterUpdate()) );
QObject::connect( m_SpinSizeY, SIGNAL(valueChanged(int)), this, SLOT(triggerParameterUpdate()) );
......
......@@ -20,63 +20,63 @@ UIParamChildren::UIParamChildren( const QString& id,
{
m_TypeFilters = typeFilter;
m_Widget = new QComboBox();
widget()->addItem( QString(), QVariant((qulonglong) 0) );
GetWidget()->addItem( QString(), QVariant((qulonglong) 0) );
}
void UIParamChildren::setValue( const QString& value )
void UIParamChildren::SetValue( const QString& value )
{
for( int i=0; i<widget()->count(); ++i )
if( widget()->itemText(i) == value )
for( int i=0; i<GetWidget()->count(); ++i )
if( GetWidget()->itemText(i) == value )
{
widget()->setCurrentIndex( i );
GetWidget()->setCurrentIndex( i );
break;
}
}
void UIParamChildren::update( const QList<GenericUIData*>& dataList, GenericUIData *current, int &currentNewIndex, bool recursive )
void UIParamChildren::Update( const QList<GenericUIData*>& dataList, GenericUIData *current, int &currentNewIndex, bool recursive )
{
for( auto d : dataList )
{
if( m_TypeFilters.empty() || m_TypeFilters.contains(d->GetTypeString()) )
{
if( d == current )
currentNewIndex = widget()->count();
widget()->addItem( d->GetFileName(), QVariant((qulonglong) d) );
currentNewIndex = GetWidget()->count();
GetWidget()->addItem( d->GetFileName(), QVariant((qulonglong) d) );
}
if( recursive )
update( d->GetChildren(), current, currentNewIndex, recursive );
Update( d->GetChildren(), current, currentNewIndex, recursive );
}
}
void UIParamChildren::setTypeFilters( const QStringList& typeFilters )
void UIParamChildren::SetTypeFilters( const QStringList& typeFilters )
{
m_TypeFilters = typeFilters;
for( int n=0; n<widget()->count(); )
for( int n=0; n<GetWidget()->count(); )
{
GenericUIData *d = (GenericUIData*) widget()->itemData(n).toULongLong();
GenericUIData *d = (GenericUIData*) GetWidget()->itemData(n).toULongLong();
if( d && m_TypeFilters.contains( d->GetTypeString() ) )
widget()->removeItem( n );
GetWidget()->removeItem( n );
else
++ n;
}
}
void UIParamChildren::update( GenericUIData *d )
void UIParamChildren::Update( GenericUIData *d )
{
GenericUIData *current = value();
GenericUIData *current = GetValue();
int currentNewIndex = 0;
widget()->clear();
widget()->addItem( QString(), QVariant((qulonglong) 0) );
update( d->GetChildren(), current, currentNewIndex, true );
GetWidget()->clear();
GetWidget()->addItem( QString(), QVariant((qulonglong) 0) );
Update( d->GetChildren(), current, currentNewIndex, true );
widget()->setCurrentIndex( currentNewIndex );
GetWidget()->setCurrentIndex( currentNewIndex );
}
......
......@@ -17,7 +17,7 @@ class UIParamChildren : public UIParam
{
QStringList m_TypeFilters;
void update( const QList<GenericUIData*>& dataList, GenericUIData *current, int &currentNewIndex, bool recursive );
void Update( const QList<GenericUIData*>& dataList, GenericUIData *current, int &currentNewIndex, bool recursive );
public:
UIParamChildren( const QString& id,
......@@ -25,15 +25,15 @@ public:
const QString& description,
const QStringList& typeFilter = QStringList() );
inline GenericUIData* value() const { return (GenericUIData*) ((QComboBox*)m_Widget)->currentData().toULongLong(); }
void setValue( const QString& value );
inline int data() const { return ((QComboBox*)m_Widget)->itemData( ((QComboBox*)m_Widget)->currentIndex() ).value<int>(); }
inline QComboBox* widget() { return (QComboBox*) m_Widget; }
void setTypeFilters( const QStringList& typeFilters );
void update( GenericUIData *d );
void connectModificationSignal()
inline GenericUIData* GetValue() const { return (GenericUIData*) ((QComboBox*)m_Widget)->currentData().toULongLong(); }
void SetValue( const QString& value );
inline int GetData() const { return ((QComboBox*)m_Widget)->itemData( ((QComboBox*)m_Widget)->currentIndex() ).value<int>(); }
inline QComboBox* GetWidget() { return (QComboBox*) m_Widget; }
void SetTypeFilters( const QStringList& typeFilters );
void Update( GenericUIData *d );
void ConnectModificationSignal()
{
QObject::connect( widget(), SIGNAL(currentIndexChanged(int)), this, SLOT(triggerParameterUpdate()) );
QObject::connect( GetWidget(), SIGNAL(currentIndexChanged(int)), this, SLOT(triggerParameterUpdate()) );
}
};
......
......@@ -48,7 +48,7 @@ UIParamChoice::UIParamChoice( const QString& id,
}
void UIParamChoice::arrangeInLayout( QGridLayout *l, int line )
void UIParamChoice::ArrangeInLayout( QGridLayout *l, int line )
{
if( !m_Description.isNull() && !m_Description.isEmpty() )
m_Widget->setToolTip( m_Description );
......@@ -56,7 +56,7 @@ void UIParamChoice::arrangeInLayout( QGridLayout *l, int line )
}
void UIParamChoice::setValue( const QString& value )
void UIParamChoice::SetValue( const QString& value )
{
auto foundButton = m_ButtonValueMapping.find( value );
if( foundButton != m_ButtonValueMapping.end() )
......
......@@ -28,12 +28,12 @@ public:
const QStringList& value = QStringList(),
const QList<int>& data = QList<int>() );
void arrangeInLayout( QGridLayout *l, int line );
inline QString value() const { return m_CurrentChoice->text(); }
void setValue( const QString& value );
inline int data() const { return m_ButtonDataMapping[m_CurrentChoice]; }
inline QWidget* widget() { return m_Widget; }
void connectModificationSignal()
void ArrangeInLayout( QGridLayout *l, int line );
inline QString GetValue() const { return m_CurrentChoice->text(); }
void SetValue( const QString& value );
inline int GetData() const { return m_ButtonDataMapping[m_CurrentChoice]; }
inline QWidget* GetWidget() { return m_Widget; }
void ConnectModificationSignal()
{
QObject::connect( this, SIGNAL(currentChoiceChanged()), this, SLOT(triggerParameterUpdate()) );
}
......
......@@ -27,10 +27,10 @@ public:
unsigned char green,
unsigned char blue );
inline QColor value() const { QColor c; c.setRgb( m_SpinChannels[0]->value(), m_SpinChannels[1]->value(), m_SpinChannels[2]->value() ); return c; }
inline void setValue( const QColor &c ) { m_SpinChannels[0]->setValue(c.red()); m_SpinChannels[1]->setValue(c.green()); m_SpinChannels[2]->setValue(c.blue()); }
inline QVector<QSpinBox*> widget() { return m_SpinChannels; }
void connectModificationSignal()
inline QColor GetValue() const { QColor c; c.setRgb( m_SpinChannels[0]->value(), m_SpinChannels[1]->value(), m_SpinChannels[2]->value() ); return c; }
inline void SetValue( const QColor &c ) { m_SpinChannels[0]->setValue(c.red()); m_SpinChannels[1]->setValue(c.green()); m_SpinChannels[2]->setValue(c.blue()); }
inline QVector<QSpinBox*> GetWidget() { return m_SpinChannels; }
void ConnectModificationSignal()
{
QObject::connect( m_SpinChannels[0], SIGNAL(valueChanged(int)), this, SLOT(triggerParameterUpdate()) );
QObject::connect( m_SpinChannels[1], SIGNAL(valueChanged(int)), this, SLOT(triggerParameterUpdate()) );
......
......@@ -30,12 +30,12 @@ public:
sb->setValue( value );
m_Widget = sb;
}
inline double value() const { return ((QDoubleSpinBox*)m_Widget)->value(); }
inline void setValue( double value ) { ((QDoubleSpinBox*)m_Widget)->setValue( value ); }
inline QDoubleSpinBox* widget() { return (QDoubleSpinBox*) m_Widget; }
void connectModificationSignal()
inline double GetValue() const { return ((QDoubleSpinBox*)m_Widget)->value(); }
inline void SetValue( double value ) { ((QDoubleSpinBox*)m_Widget)->setValue( value ); }
inline QDoubleSpinBox* GetWidget() { return (QDoubleSpinBox*) m_Widget; }
void ConnectModificationSignal()
{
QObject::connect( widget(), SIGNAL(valueChanged(double)), this, SLOT(triggerParameterUpdate()) );
QObject::connect( GetWidget(), SIGNAL(valueChanged(double)), this, SLOT(triggerParameterUpdate()) );
}
};
......
......@@ -30,12 +30,12 @@ public:
sb->setValue( value );
m_Widget = sb;
}
inline float value() const { return (float) ((QDoubleSpinBox*)m_Widget)->value(); }
inline void setValue( float value ) { ((QDoubleSpinBox*)m_Widget)->setValue( value ); }
inline QDoubleSpinBox* widget() { return (QDoubleSpinBox*) m_Widget; }
void connectModificationSignal()
inline float GetValue() const { return (float) ((QDoubleSpinBox*)m_Widget)->value(); }
inline void SetValue( float value ) { ((QDoubleSpinBox*)m_Widget)->setValue( value ); }
inline QDoubleSpinBox* GetWidget() { return (QDoubleSpinBox*) m_Widget; }
void ConnectModificationSignal()
{
QObject::connect( widget(), SIGNAL(valueChanged(double)), this, SLOT(triggerParameterUpdate()) );
QObject::connect( GetWidget(), SIGNAL(valueChanged(double)), this, SLOT(triggerParameterUpdate()) );
}
};
......
......@@ -54,14 +54,14 @@ public:
QObject::connect( buttons[4], SIGNAL(clicked()), m_FuncWidget, SLOT(setPower ()) );
QObject::connect( buttons[5], SIGNAL(clicked()), m_FuncWidget, SLOT(setGemanMcLure()) );
}
inline void value( QVector<float> &funcSamples ) const { m_FuncWidget->getFunction(funcSamples); }
//inline void setValue( float value ) { ((QDoubleSpinBox*)m_Widget)->setValue( value ); }
inline QWidget* widget() { return m_Widget; }
inline void arrangeInLayout( QGridLayout *l, int line )
inline void GetValue( QVector<float> &funcSamples ) const { m_FuncWidget->getFunction(funcSamples); }
//inline void SetValue( float value ) { ((QDoubleSpinBox*)m_Widget)->setValue( value ); }
inline QWidget* GetWidget() { return m_Widget; }
inline void ArrangeInLayout( QGridLayout *l, int line )
{
l->addWidget( m_Widget, line,0, 1,2 );
}
void connectModificationSignal()
void ConnectModificationSignal()
{
QObject::connect( m_FuncWidget, SIGNAL(functionModified()), this, SLOT(triggerParameterUpdate()) );
}
......
......@@ -29,12 +29,12 @@ public:
sb->setValue( value );
m_Widget = sb;
}
inline int value() const { return ((QSpinBox*)m_Widget)->value(); }
inline void setValue( int value ) { ((QSpinBox*)m_Widget)->setValue( value ); }
inline QSpinBox* widget() { return (QSpinBox*) m_Widget; }
void connectModificationSignal()
inline int GetValue() const { return ((QSpinBox*)m_Widget)->value(); }
inline void SetValue( int value ) { ((QSpinBox*)m_Widget)->setValue( value ); }
inline QSpinBox* GetWidget() { return (QSpinBox*) m_Widget; }
void ConnectModificationSignal()
{
QObject::connect( widget(), SIGNAL(valueChanged(int)), this, SLOT(triggerParameterUpdate()) );
QObject::connect( GetWidget(), SIGNAL(valueChanged(int)), this, SLOT(triggerParameterUpdate()) );
}
};
......
......@@ -31,12 +31,12 @@ UIParamList::UIParamList( const QString& id,
}
void UIParamList::setValue( const QString& value )
void UIParamList::SetValue( const QString& value )
{
for( int i=0; i<widget()->count(); ++i )
if( widget()->itemText(i) == value )
for( int i=0; i<GetWidget()->count(); ++i )
if( GetWidget()->itemText(i) == value )
{
widget()->setCurrentIndex( i );
GetWidget()->setCurrentIndex( i );
break;
}
}
......@@ -21,13 +21,13 @@ public:
const QStringList& value = QStringList(),
const QList<int>& data = QList<int>() );
inline QString value() const { return ((QComboBox*)m_Widget)->currentText(); }
void setValue( const QString& value );
inline int data() const { return ((QComboBox*)m_Widget)->itemData( ((QComboBox*)m_Widget)->currentIndex() ).value<int>(); }
inline QComboBox* widget() { return (QComboBox*) m_Widget; }
void connectModificationSignal()
inline QString GetValue() const { return ((QComboBox*)m_Widget)->currentText(); }
void SetValue( const QString& value );
inline int GetData() const { return ((QComboBox*)m_Widget)->itemData( ((QComboBox*)m_Widget)->currentIndex() ).value<int>(); }
inline QComboBox* GetWidget() { return (QComboBox*) m_Widget; }
void ConnectModificationSignal()
{
QObject::connect( widget(), SIGNAL(currentIndexChanged(int)), this, SLOT(triggerParameterUpdate()) );
QObject::connect( GetWidget(), SIGNAL(currentIndexChanged(int)), this, SLOT(triggerParameterUpdate()) );
}
};
......
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