Skip to content
Snippets Groups Projects
Commit b63b08df authored by Otmane Lahlou's avatar Otmane Lahlou
Browse files

ENH : handle the output image pixel type choice in the QtWidgetOutputImageParameter

parent a6dbde69
No related branches found
No related tags found
No related merge requests found
......@@ -16,6 +16,7 @@
=========================================================================*/
#include "otbWrapperQtWidgetOutputImageParameter.h"
#include "otbWrapperTypes.h"
namespace otb
{
......@@ -49,6 +50,22 @@ void QtWidgetOutputImageParameter::DoCreateWidget()
connect( m_Input, SIGNAL(textChanged(const QString&)), GetModel(), SLOT(NotifyUpdate()) );
m_HLayout->addWidget(m_Input);
// Set the Output PixelType choice Combobox
m_ComboBox = new QComboBox;
m_ComboBox->setToolTip("Output Pixel Type");
m_ComboBox->addItem( "char");
m_ComboBox->addItem( "unsigned char");
m_ComboBox->addItem( "short");
m_ComboBox->addItem( "unsigned short");
m_ComboBox->addItem( "int");
m_ComboBox->addItem( "unsigned int");
m_ComboBox->addItem( "float");
m_ComboBox->addItem( "double");
m_ComboBox->setCurrentIndex(m_OutputImageParam->GetPixelType());
connect( m_ComboBox, SIGNAL(currentIndexChanged(int)), this, SLOT(SetPixelType(int)) );
connect( m_ComboBox, SIGNAL(currentIndexChanged(int)), GetModel(), SLOT(NotifyUpdate()) );
m_HLayout->addWidget(m_ComboBox);
// Set up input text edit
m_Button = new QPushButton;
m_Button->setText("...");
......@@ -86,5 +103,11 @@ void QtWidgetOutputImageParameter::SetFileName(const QString& value)
emit ParameterChanged(key);
}
void QtWidgetOutputImageParameter::SetPixelType(int pixelType)
{
m_OutputImageParam->SetPixelType(static_cast< ImagePixelType >(pixelType));
m_PixelType = pixelType;
}
}
}
......@@ -38,9 +38,13 @@ public:
QtWidgetOutputImageParameter(OutputImageParameter*, QtWidgetModel*);
virtual ~QtWidgetOutputImageParameter();
/** Get the PixelType*/
//itkGetMacro(PixelType, int);
protected slots:
void SetFileName( const QString& value );
void SelectFile();
void SetPixelType(int pixelType);
private:
QtWidgetOutputImageParameter(const QtWidgetOutputImageParameter&); //purposely not implemented
......@@ -56,6 +60,9 @@ private:
QHBoxLayout * m_HLayout;
QLineEdit* m_Input;
QPushButton * m_Button;
QComboBox* m_ComboBox;
int m_PixelType;
};
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment