- /*
- typedef std::map< std::string, QWidget* > _TWidgets;
- _TWidgets widgets;
- TParameters::const_iterator pIt = parameters.begin( );
- for( ; pIt != parameters.end( ); ++pIt )
- {
- unsigned long pos = pIt->first.find_last_of( ":" );
- std::string v_name = pIt->first.substr( 0, pos );
- std::string v_type = pIt->first.substr( pos + 1 );
- QHBoxLayout* horizontalLayout = new QHBoxLayout( );
- QLabel* label = new QLabel( this->m_ActiveParameters );
- label->setText( QString( v_name.c_str( ) ) );
- horizontalLayout->addWidget( label );
- if( v_type == "real" )
- {
- QDoubleSpinBox* v_double = new QDoubleSpinBox( this->m_ActiveParameters );
- v_double->setDecimals( 3 );
- v_double->setMinimum( -( std::numeric_limits< double >::max( ) ) );
- v_double->setMaximum( std::numeric_limits< double >::max( ) );
- v_double->setValue( std::atof( pIt->second.c_str( ) ) );
- horizontalLayout->addWidget( v_double );
- widgets[ pIt->first ] = v_double;
- }
- else if( v_type == "atomic_real" )
- {
- if( v_name == "MeshType" )
- {
- QLabel* info = new QLabel( this->m_ActiveParameters );
- if( typeid( TScalar ) == typeid( float ) )
- info->setText( QString( "float" ) );
- else if( typeid( TScalar ) == typeid( double ) )
- info->setText( QString( "double" ) );
- horizontalLayout->addWidget( info );
- widgets[ pIt->first ] = info;
- } // fi
- } // fi
- verticalLayout.addLayout( horizontalLayout );
- } // rof
- gridLayout.addLayout( &verticalLayout, 0, 0, 1, 1 );
- // Buttons box
- QDialogButtonBox buttonBox( this->m_ActiveParameters );
- buttonBox.setOrientation( Qt::Horizontal );
- buttonBox.setStandardButtons(
- QDialogButtonBox::Cancel | QDialogButtonBox::Ok
- );
- gridLayout.addWidget( &buttonBox, 1, 0, 1, 1 );
- QObject::connect(
- &buttonBox, SIGNAL( accepted( ) ),
- this->m_ActiveParameters, SLOT( accept( ) )
- );
- QObject::connect(
- &buttonBox, SIGNAL( rejected( ) ),
- this->m_ActiveParameters, SLOT( reject( ) )
- );
- QMetaObject::connectSlotsByName( this->m_ActiveParameters );
-
- // Execute dialog
- if( dlg.exec( ) == QDialog::Accepted )
- {
- _TWidgets::const_iterator wIt = widgets.begin( );
- for( ; wIt != widgets.end( ); ++wIt )
- {
- unsigned long pos = wIt->first.find_last_of( ":" );
- std::string v_name = wIt->first.substr( 0, pos );
- std::string v_type = wIt->first.substr( pos + 1 );
- std::stringstream sstr;
- if( v_type == "real" )
- {
- QDoubleSpinBox* v_double =
- dynamic_cast< QDoubleSpinBox* >( wIt->second );
- if( v_double != NULL )
- sstr << v_double->value( );
- }
- else if( v_type == "atomic_real" )
- {
- if( v_name == "MeshType" )
+ return( false );
+}
+
+// -------------------------------------------------------------------------
+void MainWnd::
+_ExecuteDoubleClickPlugin( const double* pnt )
+{
+ if(
+ this->m_InputImage == NULL ||
+ this->m_SegmentedImage == NULL ||
+ this->m_ActivePlugin == NULL ||
+ this->m_ActiveParameters == NULL ||
+ this->m_ActivePluginType != Self::DoubleClickPluginType
+ )
+ return;
+
+ TParameters parameters = this->m_ActivePlugin->GetDefaultParameters( );
+
+ // Variable parameters
+ for(
+ TParameters::iterator pIt = parameters.begin( );
+ pIt != parameters.end( );
+ ++pIt
+ )
+ {
+ if( pIt->first != "Seed" )