]> Creatis software - cpPlugins.git/commitdiff
...
authorLeonardo Florez-Valencia <florez-l@javeriana.edu.co>
Thu, 19 Nov 2015 00:06:47 +0000 (19:06 -0500)
committerLeonardo Florez-Valencia <florez-l@javeriana.edu.co>
Thu, 19 Nov 2015 00:06:47 +0000 (19:06 -0500)
appli/ImageMPR/ImageMPR.cxx
lib/cpExtensions/Algorithms/SpatialObjectMaskImageFilter.h [new file with mode: 0644]
lib/cpExtensions/Algorithms/SpatialObjectMaskImageFilter.hxx [new file with mode: 0644]
lib/cpExtensions/DataStructures/InfinitePlaneSpatialObject.h [new file with mode: 0644]
lib/cpExtensions/DataStructures/InfinitePlaneSpatialObject.hxx [new file with mode: 0644]
lib/cpPlugins/Plugins/BasicFilters/CMakeLists.txt
lib/cpPlugins/Plugins/BasicFilters/MacheteFilter.cxx
lib/cpPlugins/Plugins/BasicFilters/MacheteFilter.h

index ce1f2fc769c7f39232d3902adbb18353cb367936..cf6a1f6b7934f353350ee9ee89f47c200e765157 100644 (file)
@@ -75,6 +75,7 @@ UpdateActualFilter( )
     return;
 
   // Show outputs
+#error ACA VOY
   for( auto oIt = outputs.begin( ); oIt != outputs.end( ); ++oIt )
     std::cout << *oIt << std::endl;
   
diff --git a/lib/cpExtensions/Algorithms/SpatialObjectMaskImageFilter.h b/lib/cpExtensions/Algorithms/SpatialObjectMaskImageFilter.h
new file mode 100644 (file)
index 0000000..f8fd354
--- /dev/null
@@ -0,0 +1,83 @@
+#ifndef __CPEXTENSIONS__ALGORITHMS__SPATIALOBJECTMASKIMAGEFILTER__H__
+#define __CPEXTENSIONS__ALGORITHMS__SPATIALOBJECTMASKIMAGEFILTER__H__
+
+#include <itkConceptChecking.h>
+#include <itkInPlaceImageFilter.h>
+#include <itkSpatialObject.h>
+
+namespace cpExtensions
+{
+  namespace Algorithms
+  {
+    /**
+     */
+    template< class I, class O = I >
+    class SpatialObjectMaskImageFilter
+      : public itk::InPlaceImageFilter< I, O >
+    {
+    public:
+      typedef SpatialObjectMaskImageFilter    Self;
+      typedef itk::InPlaceImageFilter< I, O > Superclass;
+      typedef itk::SmartPointer< Self >       Pointer;
+      typedef itk::SmartPointer< const Self > ConstPointer;
+
+      typedef I TInputImage;
+      typedef O TOutputImage;
+
+      itkStaticConstMacro( InputDimension, unsigned int, I::ImageDimension );
+      itkStaticConstMacro( OutputDimension, unsigned int, O::ImageDimension );
+
+#ifdef ITK_USE_CONCEPT_CHECKING
+      // Begin concept checking
+      itkConceptMacro(
+        SameDimensionCheck1,
+        ( itk::Concept::SameDimension< InputDimension, OutputDimension > )
+        );
+      // End concept checking
+#endif
+
+      typedef typename I::RegionType TRegion;
+      typedef typename O::PixelType  TOutPixel;
+      typedef itk::SpatialObject< InputDimension > TSpatialObject;
+
+    public:
+      itkNewMacro( Self );
+      itkTypeMacro( SpatialObjectMaskImageFilter, itk::InPlaceImageFilter );
+
+      itkGetObjectMacro( SpatialObject, TSpatialObject );
+      itkGetConstObjectMacro( SpatialObject, TSpatialObject );
+      itkGetConstMacro( OutsideValue, TOutPixel );
+
+      itkSetObjectMacro( SpatialObject, TSpatialObject );
+      itkSetMacro( OutsideValue, TOutPixel );
+
+    protected:
+      SpatialObjectMaskImageFilter( );
+      virtual ~SpatialObjectMaskImageFilter( );
+
+      virtual void GenerateOutputInformation( );
+      virtual void ThreadedGenerateData(
+        const TRegion& region, itk::ThreadIdType threadId
+        );
+
+    private:
+      // Purposely not implemented.
+      SpatialObjectMaskImageFilter( const Self& other );
+      Self& operator=( const Self& other );
+
+    protected:
+      typename TSpatialObject::Pointer m_SpatialObject;
+      TOutPixel m_OutsideValue;
+    };
+
+  } // ecapseman
+
+} // ecapseman
+
+#ifndef ITK_MANUAL_INSTANTIATION
+#include <cpExtensions/Algorithms/SpatialObjectMaskImageFilter.hxx>
+#endif // ITK_MANUAL_INSTANTIATION
+
+#endif // __CPEXTENSIONS__ALGORITHMS__SPATIALOBJECTMASKIMAGEFILTER__H__
+
+// eof - $RCSfile$
diff --git a/lib/cpExtensions/Algorithms/SpatialObjectMaskImageFilter.hxx b/lib/cpExtensions/Algorithms/SpatialObjectMaskImageFilter.hxx
new file mode 100644 (file)
index 0000000..2df9c6f
--- /dev/null
@@ -0,0 +1,91 @@
+#ifndef __CPEXTENSIONS__ALGORITHMS__SPATIALOBJECTMASKIMAGEFILTER__HXX__
+#define __CPEXTENSIONS__ALGORITHMS__SPATIALOBJECTMASKIMAGEFILTER__HXX__
+
+#include <itkImageScanlineIterator.h>
+#include <itkProgressReporter.h>
+
+// -------------------------------------------------------------------------
+template< class I, class O >
+cpExtensions::Algorithms::SpatialObjectMaskImageFilter< I, O >::
+SpatialObjectMaskImageFilter( )
+  : Superclass( )
+{
+  this->SetNumberOfRequiredInputs( 1 );
+  this->InPlaceOff( );
+}
+
+// -------------------------------------------------------------------------
+template< class I, class O >
+cpExtensions::Algorithms::SpatialObjectMaskImageFilter< I, O >::
+~SpatialObjectMaskImageFilter( )
+{
+}
+
+// -------------------------------------------------------------------------
+template< class I, class O >
+void cpExtensions::Algorithms::SpatialObjectMaskImageFilter< I, O >::
+GenerateOutputInformation( )
+{
+  const I* in =
+    dynamic_cast< const I* >( this->itk::ProcessObject::GetInput( 0 ) );
+  for( unsigned int idx = 0; idx < this->GetNumberOfOutputs( ); ++idx )
+  {
+    itk::DataObject* out = this->GetOutput( idx );
+    if( out )
+      out->CopyInformation( in );
+
+  } // rof
+}
+
+// -------------------------------------------------------------------------
+template< class I, class O >
+void cpExtensions::Algorithms::SpatialObjectMaskImageFilter< I, O >::
+ThreadedGenerateData( const TRegion& region, itk::ThreadIdType threadId )
+{
+  if( this->m_SpatialObject.IsNull( ) )
+  {
+    itkGenericExceptionMacro( << "No itk::SpatialObject given." );
+    return;
+
+  } // fi
+
+  // Get inputs
+  const I* in =
+    dynamic_cast< const I* >( this->itk::ProcessObject::GetInput( 0 ) );
+  O* out = this->GetOutput( 0 );
+  const auto size0 = region.GetSize( 0 );
+  if( size0 == 0 )
+    return;
+  const auto nLines = region.GetNumberOfPixels( ) / size0;
+
+  // Create iterators
+  itk::ImageScanlineConstIterator< I > iIt( in, region );
+  itk::ImageScanlineIterator< O > oIt( out, region );
+  itk::ProgressReporter progress( this, threadId, nLines );
+
+  // Main loop
+  typename TSpatialObject::PointType pnt;
+  while( !iIt.IsAtEnd( ) )
+  {
+    while( !iIt.IsAtEndOfLine( ) )
+    {
+      auto idx = iIt.GetIndex( );
+      in->TransformIndexToPhysicalPoint( idx, pnt );
+      if( this->m_SpatialObject->IsInside( pnt ) )
+        oIt.Set( TOutPixel( iIt.Get( ) ) );
+      else
+        oIt.Set( this->m_OutsideValue );
+      ++iIt;
+      ++oIt;
+
+    } // elihw
+    iIt.NextLine( );
+    oIt.NextLine( );
+    progress.CompletedPixel( );
+
+  } // elihw
+}
+
+#endif // __CPEXTENSIONS__ALGORITHMS__SPATIALOBJECTMASKIMAGEFILTER__HXX__
+
+// eof - $RCSfile$
diff --git a/lib/cpExtensions/DataStructures/InfinitePlaneSpatialObject.h b/lib/cpExtensions/DataStructures/InfinitePlaneSpatialObject.h
new file mode 100644 (file)
index 0000000..2f61766
--- /dev/null
@@ -0,0 +1,88 @@
+#ifndef __CPEXTENSIONS__DATASTRUCTURES__INFINITEPLANESPATIALOBJECT__H__
+#define __CPEXTENSIONS__DATASTRUCTURES__INFINITEPLANESPATIALOBJECT__H__
+
+#include <itkSpatialObject.h>
+
+namespace cpExtensions
+{
+  namespace DataStructures
+  {
+    /**
+     */
+    template< unsigned int D >
+    class InfinitePlaneSpatialObject
+      : public itk::SpatialObject< D >
+    {
+    public:
+      typedef InfinitePlaneSpatialObject      Self;
+      typedef itk::SpatialObject< D >         Superclass;
+      typedef itk::SmartPointer< Self >       Pointer;
+      typedef itk::SmartPointer< const Self > ConstPointer;
+
+      typedef double                               ScalarType;
+      typedef typename Superclass::PointType       PointType;
+      typedef typename Superclass::TransformType   TransformType;
+      typedef typename Superclass::BoundingBoxType BoundingBoxType;
+      typedef typename PointType::VectorType       VectorType;
+
+      itkStaticConstMacro( NumberOfDimension, unsigned int, D );
+
+    public:
+      itkNewMacro( Self );
+      itkTypeMacro( InfinitePlaneSpatialObject, itk::SpatialObject );
+
+      itkGetConstMacro( Center, PointType );
+      itkGetConstMacro( Normal, VectorType );
+
+    public:
+      template< class P >
+      void SetCenter( const P& p );
+
+      template< class N >
+      void SetNormal( const N& n );
+
+      virtual bool ValueAt(
+        const PointType& point, double& value,
+        unsigned int depth = 0, char* name = NULL
+        ) const;
+
+      virtual bool IsEvaluableAt(
+        const PointType& point,
+        unsigned int depth = 0, char* name = NULL
+        ) const;
+
+      virtual bool IsInside(
+        const PointType& point,
+        unsigned int depth, char* name
+        ) const;
+
+      virtual bool IsInside( const PointType& point ) const;
+
+      virtual bool ComputeLocalBoundingBox( ) const;
+
+    protected:
+      InfinitePlaneSpatialObject( );
+      virtual ~InfinitePlaneSpatialObject( );
+      virtual void PrintSelf( std::ostream& os, itk::Indent indent ) const;
+
+    private:
+      // Purposely not implemented.
+      InfinitePlaneSpatialObject( const Self& other );
+      Self& operator=( const Self& other );
+
+    protected:
+      PointType  m_Center;
+      VectorType m_Normal;
+    };
+
+  } // ecapseman
+
+} // ecapseman
+
+#ifndef ITK_MANUAL_INSTANTIATION
+#include <cpExtensions/DataStructures/InfinitePlaneSpatialObject.hxx>
+#endif // ITK_MANUAL_INSTANTIATION
+
+#endif // __CPEXTENSIONS__DATASTRUCTURES__INFINITEPLANESPATIALOBJECT__H__
+
+// eof - $RCSfile$
diff --git a/lib/cpExtensions/DataStructures/InfinitePlaneSpatialObject.hxx b/lib/cpExtensions/DataStructures/InfinitePlaneSpatialObject.hxx
new file mode 100644 (file)
index 0000000..fd68815
--- /dev/null
@@ -0,0 +1,109 @@
+#ifndef __CPEXTENSIONS__DATASTRUCTURES__INFINITEPLANESPATIALOBJECT__HXX__
+#define __CPEXTENSIONS__DATASTRUCTURES__INFINITEPLANESPATIALOBJECT__HXX__
+
+// -------------------------------------------------------------------------
+template< unsigned int D >
+template< class P >
+void cpExtensions::DataStructures::InfinitePlaneSpatialObject< D >::
+SetCenter( const P& p )
+{
+  for( unsigned int d = 0; d < D; ++d )
+    this->m_Center[ d ] = ScalarType( p[ d ] );
+  this->Modified( );
+}
+
+// -------------------------------------------------------------------------
+template< unsigned int D >
+template< class N >
+void cpExtensions::DataStructures::InfinitePlaneSpatialObject< D >::
+SetNormal( const N& n )
+{
+  for( unsigned int d = 0; d < D; ++d )
+    this->m_Normal[ d ] = ScalarType( n[ d ] );
+  ScalarType nn = this->m_Normal.GetNorm( );
+  if( nn > ScalarType( 0 ) )
+    this->m_Normal /= nn;
+  this->Modified( );
+}
+
+// -------------------------------------------------------------------------
+template< unsigned int D >
+bool cpExtensions::DataStructures::InfinitePlaneSpatialObject< D >::
+ValueAt(
+  const PointType& point, double& value, unsigned int depth, char* name
+  ) const
+{
+  value = this->m_Normal * ( point - this->m_Center );
+  return( value >= double( 0 ) );
+}
+
+// -------------------------------------------------------------------------
+template< unsigned int D >
+bool cpExtensions::DataStructures::InfinitePlaneSpatialObject< D >::
+IsEvaluableAt(
+  const PointType& point, unsigned int depth, char* name
+  ) const
+{
+  double value;
+  return( this->ValueAt( point, value, depth, name ) );
+}
+
+// -------------------------------------------------------------------------
+template< unsigned int D >
+bool cpExtensions::DataStructures::InfinitePlaneSpatialObject< D >::
+IsInside(
+  const PointType& point, unsigned int depth, char* name
+  ) const
+{
+  double value;
+  return( this->ValueAt( point, value, depth, name ) );
+}
+
+// -------------------------------------------------------------------------
+template< unsigned int D >
+bool cpExtensions::DataStructures::InfinitePlaneSpatialObject< D >::
+IsInside( const PointType& point ) const
+{
+  double value;
+  return( this->ValueAt( point, value, 0, NULL ) );
+}
+
+// -------------------------------------------------------------------------
+template< unsigned int D >
+bool cpExtensions::DataStructures::InfinitePlaneSpatialObject< D >::
+ComputeLocalBoundingBox( ) const
+{
+  return( false );
+}
+
+// -------------------------------------------------------------------------
+template< unsigned int D >
+cpExtensions::DataStructures::InfinitePlaneSpatialObject< D >::
+InfinitePlaneSpatialObject( )
+  : Superclass( )
+{
+  this->m_Center.Fill( ScalarType( 0 ) );
+  this->m_Normal.Fill( ScalarType( 0 ) );
+  this->m_Normal[ 0 ] = ScalarType( 1 );
+}
+
+// -------------------------------------------------------------------------
+template< unsigned int D >
+cpExtensions::DataStructures::InfinitePlaneSpatialObject< D >::
+~InfinitePlaneSpatialObject( )
+{
+}
+
+// -------------------------------------------------------------------------
+template< unsigned int D >
+void cpExtensions::DataStructures::InfinitePlaneSpatialObject< D >::
+PrintSelf( std::ostream& os, itk::Indent indent ) const
+{
+  this->Superclass::PrintSelf( os, indent );
+  os << indent << "Center: " << this->m_Center << std::endl;
+  os << indent << "Normal: " << this->m_Normal << std::endl;
+}
+
+#endif // __CPEXTENSIONS__DATASTRUCTURES__INFINITEPLANESPATIALOBJECT__HXX__
+
+// eof - $RCSfile$
index 361ba1018a212dff9ee8569d95cbaf5a4f4bdb6e..2482a0b2ba6cbb2f8c312d25bac9d95934eb75ed 100644 (file)
@@ -11,6 +11,27 @@ FILE(GLOB LIB_SOURCES_C   "*.c")
 FILE(GLOB LIB_SOURCES_CPP "*.cpp")
 FILE(GLOB LIB_SOURCES_CXX "*.cxx")
 
+IF(USE_QT4)
+  SET(
+    LIB_QT_Headers
+    MacheteFilter.h
+    )
+  SET(
+    LIB_QT_Sources
+    MacheteFilter.cxx
+    )
+
+  QT4_WRAP_CPP(LIB_QT_Wrapped_MOC_Sources ${LIB_QT_Headers})
+
+  SET(
+    LIB_SOURCES_CXX
+    ${LIB_SOURCES_CXX}
+    ${LIB_QT_Sources}
+    ${LIB_QT_Wrapped_MOC_Sources}
+    )
+
+ENDIF(USE_QT4)
+
 ## =====================
 ## = Compilation rules =
 ## =====================
index 3eb60061e0f18d4ba7e0e8dcb19fc2e143361dd2..36bb0e8862e0498a60980d3ae9038b82b22f9c33 100644 (file)
 #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>
 
 #include <cpExtensions/Interaction/ImageInteractorStyle.h>
+#include <cpExtensions/DataStructures/InfinitePlaneSpatialObject.h>
+#include <cpExtensions/Algorithms/SpatialObjectMaskImageFilter.h>
 
 #include <itkPlaneSpatialObject.h>
 #include <itkPoint.h>
-#include <itkSpatialObjectToImageFilter.h>
 #include <itkVector.h>
 
 #include <vtkInteractorStyleSwitch.h>
 #include <vtkPlaneWidget.h>
 #include <vtkRenderWindowInteractor.h>
 
+#ifdef cpPlugins_Interface_QT4
+#include <QDialogButtonBox>
+
+// -------------------------------------------------------------------------
+cpPlugins::BasicFilters::MacheteFilter_Dialog::
+MacheteFilter_Dialog(
+  QWidget* parent, MacheteFilter* filter, Qt::WindowFlags f
+  )
+  : QDialog( parent, f ),
+    m_Filter( filter )
+{
+  this->m_Title = new QLabel( this );
+  this->m_Title->setText( "Execute machete filter" );
+
+  this->m_MainLayout = new QGridLayout( this );
+  this->m_ToolsLayout = new QVBoxLayout( );
+  this->m_ToolsLayout->addWidget( this->m_Title );
+  this->m_MainLayout->addLayout( this->m_ToolsLayout, 0, 0, 1, 1 );
+
+  // Add buttons
+  QDialogButtonBox* bb = new QDialogButtonBox(
+    QDialogButtonBox::Cancel | QDialogButtonBox::Ok
+    );
+  QObject::connect( bb, SIGNAL( accepted( ) ), this, SLOT( accept( ) ) );
+  QObject::connect( bb, SIGNAL( rejected( ) ), this, SLOT( reject( ) ) );
+  this->m_ToolsLayout->addWidget( bb );
+}
+
+// -------------------------------------------------------------------------
+cpPlugins::BasicFilters::MacheteFilter_Dialog::
+~MacheteFilter_Dialog( )
+{
+  delete this->m_Title;
+  delete this->m_ToolsLayout;
+  delete this->m_MainLayout;
+}
+
+// -------------------------------------------------------------------------
+void cpPlugins::BasicFilters::MacheteFilter_Dialog::
+accept( )
+{
+  // Get interactive widget
+  if( this->m_Filter == NULL )
+    return;
+  vtkPlaneWidget* wdg = this->m_Filter->m_PlaneWidget;
+  if( wdg == NULL )
+    return;
+
+  // Get/Set plane parameters
+  double center[ 3 ], normal[ 3 ];
+  wdg->GetCenter( center );
+  wdg->GetNormal( normal );
+  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
+}
+
+// -------------------------------------------------------------------------
+void cpPlugins::BasicFilters::MacheteFilter_Dialog::
+reject( )
+{
+  std::cout << "reject" << std::endl;
+}
+#endif // cpPlugins_Interface_QT4
+
 // -------------------------------------------------------------------------
 cpPlugins::BasicFilters::MacheteFilter::
 DialogResult cpPlugins::BasicFilters::MacheteFilter::
 ExecConfigurationDialog( QWidget* parent )
 {
+#ifdef cpPlugins_Interface_QT4
+
   typedef cpExtensions::Interaction::ImageInteractorStyle _TImageStyle;
 
   // Choose a valid 3D interactor
@@ -91,7 +171,13 @@ ExecConfigurationDialog( QWidget* parent )
   this->m_PlaneWidget->PlaceWidget( );
   this->m_PlaneWidget->On( );
 
+  this->m_Dialog = new MacheteFilter_Dialog( NULL, this );
+  this->m_Dialog->show( );
+
   return( Self::DialogResult_Modal );
+#else // cpPlugins_Interface_QT4
+  return( Self::DialogResult_Cancel );
+#endif // cpPlugins_Interface_QT4
 }
 
 // -------------------------------------------------------------------------
@@ -156,32 +242,55 @@ _FromMesh( cpPlugins::Interface::Mesh* mesh )
   return( "" );
 }
 
-#include <itkImageFileWriter.h>
-
 // -------------------------------------------------------------------------
 template< class I >
 std::string cpPlugins::BasicFilters::MacheteFilter::
 _RealImage( itk::DataObject* dobj )
 {
-  typedef typename I::PixelType                         _TPixel;
-  typedef itk::PlaneSpatialObject< I::ImageDimension >  _TPlane;
-  typedef itk::SpatialObjectToImageFilter< _TPlane, I > _TMaskFilter;
+  typedef
+    cpExtensions::DataStructures::
+    InfinitePlaneSpatialObject< I::ImageDimension > _TPlane;
+  typedef
+    cpExtensions::Algorithms::
+    SpatialObjectMaskImageFilter< I > _TFilter;
+  typedef cpPlugins::Interface::DataObject _TDataObject;
+  typedef cpPlugins::Interface::Image      _TImage;
+  typedef typename _TPlane::PointType  _TPoint;
+  typedef typename _TPlane::VectorType _TVector;
+  typedef typename I::PixelType        _TPixel;
 
   I* image = dynamic_cast< I* >( dobj );
 
-  typename _TMaskFilter::Pointer mask = _TMaskFilter::New( );
-  mask->SetDirection( image->GetDirection( ) );
-  mask->SetOrigin( image->GetOrigin( ) );
-  mask->SetSize( image->GetRequestedRegion( ).GetSize( ) );
-  mask->SetSpacing( image->GetSpacing( ) );
-  mask->SetInsideValue( _TPixel( 1 ) );
-  mask->SetOutsideValue( _TPixel( 0 ) );
-
-  typename itk::ImageFileWriter< I >::Pointer w = 
-    itk::ImageFileWriter< I >::New( );
-  w->SetInput( mask->GetOutput( ) );
-  w->SetFileName( "mask.mhd" );
-  w->Update( );
+  _TPoint c = this->m_Parameters->GetPoint< _TPoint >(
+    "PlaneCenter", I::ImageDimension
+    );
+  _TVector n = this->m_Parameters->GetVector< _TVector >(
+    "PlaneNormal", I::ImageDimension
+    );
+
+  typename _TPlane::Pointer plane = _TPlane::New( );
+  plane->SetCenter( c );
+  plane->SetNormal( n );
+
+  // Configure filter
+  _TFilter* filter = this->_CreateITK< _TFilter >( );
+  filter->SetInput( image );
+  filter->SetSpatialObject( plane );
+  filter->SetOutsideValue( _TPixel( 0 ) );
+  filter->Update( );
+
+  // Connect output (and correct its type)
+  auto name = this->GetOutput< _TDataObject >( "Output" )->GetName( );
+  this->_MakeOutput< _TImage >( "Output" );
+  _TImage* out = this->GetOutput< _TImage >( "Output" );
+  if( out != NULL )
+  {
+    out->SetITK< I >( filter->GetOutput( ) );
+    out->SetName( name );
+    return( "" );
+  }
+  else
+    return( "MacheteFilter: output image not correctly created." );
 }
 
 // eof - $RCSfile$
index ad6669c844714b8a31bf2b6fc191a028c9d9b14f..ff781f1d41e146093b72a724c84f291f0d678085 100644 (file)
@@ -4,6 +4,15 @@
 #include <cpPlugins/BasicFilters/cpPluginsBasicFilters_Export.h>
 #include <cpPlugins/Interface/BaseProcessObjects.h>
 
+#include <cpPlugins/Interface/Config.h>
+
+#ifdef cpPlugins_Interface_QT4
+#include <QDialog>
+#include <QGridLayout>
+#include <QLabel>
+#include <QVBoxLayout>
+#endif // cpPlugins_Interface_QT4
+
 // Some forward declarations
 class vtkPlaneWidget;
 
@@ -19,11 +28,41 @@ namespace cpPlugins
 
   namespace BasicFilters
   {
+#ifdef cpPlugins_Interface_QT4
+    class MacheteFilter;
+
+    /**
+     */
+    class MacheteFilter_Dialog
+      : public QDialog
+    {
+      Q_OBJECT;
+
+    public:
+      MacheteFilter_Dialog(
+        QWidget* parent, MacheteFilter* filter, Qt::WindowFlags f = 0
+        );
+      virtual ~MacheteFilter_Dialog( );
+
+    public slots:
+      void accept( );
+      void reject( );
+
+    protected:
+      MacheteFilter* m_Filter;
+      QLabel* m_Title;
+      QGridLayout* m_MainLayout;
+      QVBoxLayout* m_ToolsLayout;
+    };
+#endif // cpPlugins_Interface_QT4
+
     /**
      */
     class cpPluginsBasicFilters_EXPORT MacheteFilter
       : public cpPlugins::Interface::FilterObject
     {
+      friend class MacheteFilter_Dialog;
+
     public:
       typedef MacheteFilter                      Self;
       typedef cpPlugins::Interface::FilterObject Superclass;
@@ -58,7 +97,10 @@ namespace cpPlugins
       Self& operator=( const Self& );
 
     protected:
-      vtkPlaneWidget* m_PlaneWidget;
+#ifdef cpPlugins_Interface_QT4
+      vtkPlaneWidget*       m_PlaneWidget;
+      MacheteFilter_Dialog* m_Dialog;
+#endif // cpPlugins_Interface_QT4
     };
 
     // ---------------------------------------------------------------------