+ Parameters::Type pt = this->m_Parameters->GetType( *nIt );
+
+ QWidget* w_input = NULL;
+ if( pt == Parameters::String )
+ {
+ QLineEdit* v_string = new QLineEdit( this );
+ v_string->setText( "Enter some text!!!" );
+ w_input = v_string;
+ }
+ else if( pt == Parameters::Bool )
+ {
+ QCheckBox* v_bool = new QCheckBox( this );
+ v_bool->setText( "[ON/OFF]" );
+ v_bool->setChecked( this->m_Parameters->GetBool( *nIt ) );
+ w_input = v_bool;
+ }
+ else if( pt == Parameters::Uint )
+ {
+ QSpinBox* v_uint = new QSpinBox( this );
+ v_uint->setMinimum( 0 );
+ v_uint->setMaximum( std::numeric_limits< int >::max( ) );
+ v_uint->setValue( this->m_Parameters->GetUint( *nIt ) );
+ w_input = v_uint;
+ }
+ else if( pt == Parameters::Int )
+ {
+ QSpinBox* v_int = new QSpinBox( this );
+ v_int->setMinimum( -std::numeric_limits< int >::max( ) );
+ v_int->setMaximum( std::numeric_limits< int >::max( ) );
+ v_int->setValue( this->m_Parameters->GetInt( *nIt ) );
+ w_input = v_int;
+ }
+ else if( pt == Parameters::Real )
+ {
+ QDoubleSpinBox* v_double = new QDoubleSpinBox( this );
+ v_double->setDecimals( 3 );
+ v_double->setMinimum( -std::numeric_limits< double >::max( ) );
+ v_double->setMaximum( std::numeric_limits< double >::max( ) );
+ v_double->setValue( this->m_Parameters->GetReal( *nIt ) );
+ w_input = v_double;
+ }
+ else if(
+ pt == Parameters::StringList ||
+ pt == Parameters::IntList ||
+ pt == Parameters::UintList ||
+ pt == Parameters::RealList
+ )
+ {
+ cpPlugins::Interface::ParametersListWidget* l_double =
+ new cpPlugins::Interface::ParametersListWidget( *nIt, this );
+ w_input = l_double;
+ }
+ else if( pt == Parameters::Point || pt == Parameters::Index )
+ {
+ if( this->m_Interactor != NULL )
+ {
+ // Create a point widget and its representation
+ vtkSmartPointer< vtkPointHandleRepresentation3D > handle =
+ vtkSmartPointer< vtkPointHandleRepresentation3D >::New( );
+ handle->GetProperty( )->SetColor( 1, 0, 0 );
+ vtkSmartPointer< vtkSeedRepresentation > rep =
+ vtkSmartPointer< vtkSeedRepresentation >::New( );
+ rep->SetHandleRepresentation( handle );
+
+ cpExtensions::Interaction::SeedWidget* widget =
+ cpExtensions::Interaction::SeedWidget::New( );
+ widget->SetInteractor( this->m_Interactor );
+ widget->SetRepresentation( rep );
+ widget->On( );
+
+ this->m_Widgets.push_back( widget );
+ this->m_IsModal = false;
+
+ } // fi
+
+ } // fi
+
+ // Ok, a representation was created
+ if( w_input != NULL )
+ {
+ w_input->setObjectName( QString( nIt->c_str( ) ) );
+
+ QHBoxLayout* new_layout = new QHBoxLayout( );
+ QLabel* label = new QLabel( this );
+ label->setText( QString( nIt->c_str( ) ) );
+ new_layout->addWidget( label );
+ new_layout->addWidget( w_input );
+ this->m_ToolsLayout->addLayout( new_layout );
+
+ } // fi
+
+ } // rof
+ return( this->m_IsModal );
+}
+
+// -------------------------------------------------------------------------
+void cpPlugins::Interface::ParametersQtDialog::
+setTitle( const std::string& title )
+{
+ this->m_Title->setText( title.c_str( ) );
+}
+
+// -------------------------------------------------------------------------
+int cpPlugins::Interface::ParametersQtDialog::
+exec( )
+{
+ if( !this->m_IsModal )
+ return( 0 );
+
+ // Add buttons
+ QDialogButtonBox* bb = new QDialogButtonBox(
+ QDialogButtonBox::Ok | QDialogButtonBox::Cancel
+ );
+ QObject::connect( bb, SIGNAL( accepted( ) ), this, SLOT( accept( ) ) );
+ QObject::connect( bb, SIGNAL( rejected( ) ), this, SLOT( reject( ) ) );
+ this->m_ToolsLayout->addWidget( bb );
+
+ return( this->QDialog::exec( ) );
+}
+
+// -------------------------------------------------------------------------
+void cpPlugins::Interface::ParametersQtDialog::
+show( )
+{
+ if( this->m_IsModal )
+ return;
+
+ this->QDialog::show( );
+}
+
+// -------------------------------------------------------------------------
+void cpPlugins::Interface::ParametersQtDialog::
+syncParameters( )
+{
+ std::cout << "TODO: SyncParameters" << std::endl;
+}
+
+
+
+
+
+
+
+