]> Creatis software - cpPlugins.git/blobdiff - lib/cpPlugins/Plugins/BasicFilters/MacheteFilter.cxx
...
[cpPlugins.git] / lib / cpPlugins / Plugins / BasicFilters / MacheteFilter.cxx
index 8116e211ff32895d1e5f6cf2a860de75381fede9..71b3af481495376306fb099683b047d7897e9858 100644 (file)
@@ -1,8 +1,5 @@
 #include "MacheteFilter.h"
 
-#include <cpPlugins/Interface/BaseApplication.h>
-#include <cpPlugins/Interface/Plugins.h>
-
 #include <cpPlugins/Interface/DataObject.h>
 #include <cpPlugins/Interface/Image.h>
 #include <cpPlugins/Interface/Mesh.h>
@@ -72,27 +69,33 @@ accept( )
   wdg->GetCenter( center );
   wdg->GetNormal( normal );
 
-  this->m_Filter->GetParameters( )->SetPoint( "PlaneCenter", 3, center );
-  this->m_Filter->GetParameters( )->SetVector( "PlaneNormal", 3, normal );
+  /* TODO
+     this->m_Filter->GetParameters( )->SetPoint( "PlaneCenter", 3, center );
+     this->m_Filter->GetParameters( )->SetVector( "PlaneNormal", 3, normal );
+  */
 
   // Update filter
-  auto plugins = this->m_Filter->GetPlugins( );
-  if( plugins != NULL )
-  {
-    auto app = plugins->GetApplication( );
-    if( app != NULL )
-      app->UpdateActualFilter( );
-
-  } // fi
+  /* TODO
+     auto plugins = this->m_Filter->GetPlugins( );
+     if( plugins != NULL )
+     {
+     auto app = plugins->GetApplication( );
+     if( app != NULL )
+     app->UpdateActualFilter( );
+
+     } // fi
+  */
 }
 
 // -------------------------------------------------------------------------
 void cpPlugins::BasicFilters::MacheteFilter_Dialog::
 reject( )
 {
+  /*
   auto plugins = this->m_Filter->GetPlugins( );
   if( plugins != NULL )
     plugins->DeactivateFilter( );
+  */
   this->Superclass::reject( );
 }
 
@@ -109,6 +112,7 @@ ExecConfigurationDialog( QWidget* parent )
 
   // Choose a valid 3D interactor
   vtkRenderWindowInteractor* iren = NULL;
+  /* TODO
   auto iIt = this->m_Interactors.begin( );
   for( ; iIt != this->m_Interactors.end( ) && iren == NULL; ++iIt )
   {
@@ -120,9 +124,10 @@ ExecConfigurationDialog( QWidget* parent )
       iren = *iIt;
     
   } // rof
+  */
   if( iren == NULL )
-    return( Self::DialogResult_Cancel );
-
+    return( false );
+  
   // Get bounding box
   double bbox[ 6 ];
   cpPlugins::Interface::Image* image =
@@ -143,7 +148,7 @@ ExecConfigurationDialog( QWidget* parent )
 
   } // fi
   if( !input_found )
-    return( Self::DialogResult_Cancel );
+    return( false );
 
   // Create plane widget
   if( this->m_PlaneWidget != NULL )
@@ -179,9 +184,9 @@ ExecConfigurationDialog( QWidget* parent )
   this->m_Dialog = new MacheteFilter_Dialog( NULL, this );
   this->m_Dialog->show( );
 
-  return( Self::DialogResult_Modal );
+  return( true );
 #else // cpPlugins_Interface_QT4
-  return( Self::DialogResult_Cancel );
+  return( false );
 #endif // cpPlugins_Interface_QT4
 }
 
@@ -192,11 +197,13 @@ MacheteFilter( )
     m_PlaneWidget( NULL )
 {
   this->_AddInput( "Input" );
-  this->_MakeOutput< cpPlugins::Interface::DataObject >( "PositiveOutput" );
-  this->_MakeOutput< cpPlugins::Interface::DataObject >( "NegativeOutput" );
+  this->_AddOutput< cpPlugins::Interface::DataObject >( "PositiveOutput" );
+  this->_AddOutput< cpPlugins::Interface::DataObject >( "NegativeOutput" );
 
+  /*
   this->m_Parameters->ConfigureAsPoint( "PlaneCenter" );
   this->m_Parameters->ConfigureAsVector( "PlaneNormal" );
+  */
 }
 
 // -------------------------------------------------------------------------
@@ -260,12 +267,16 @@ _RealImage( itk::DataObject* dobj )
 
   I* image = dynamic_cast< I* >( dobj );
 
+  /*
   _TPoint c = this->m_Parameters->GetPoint< _TPoint >(
     "PlaneCenter", I::ImageDimension
     );
   _TVector n = this->m_Parameters->GetVector< _TVector >(
     "PlaneNormal", I::ImageDimension
     );
+  */
+  _TPoint c;
+  _TVector n;
 
   typename _TPlane::Pointer plane = _TPlane::New( );
   plane->SetCenter( c );
@@ -286,7 +297,7 @@ _RealImage( itk::DataObject* dobj )
   _TImage* pos_out = this->GetOutput< _TImage >( "PositiveOutput" );
   if( pos_out == NULL )
   {
-    this->_MakeOutput< _TImage >( "PositiveOutput" );
+    this->_AddOutput< _TImage >( "PositiveOutput" );
     pos_out = this->GetOutput< _TImage >( "PositiveOutput" );
     pos_out->SetName( pos_name );
 
@@ -294,7 +305,7 @@ _RealImage( itk::DataObject* dobj )
   _TImage* neg_out = this->GetOutput< _TImage >( "NegativeOutput" );
   if( neg_out == NULL )
   {
-    this->_MakeOutput< _TImage >( "NegativeOutput" );
+    this->_AddOutput< _TImage >( "NegativeOutput" );
     neg_out = this->GetOutput< _TImage >( "NegativeOutput" );
     neg_out->SetName( neg_name );