]> Creatis software - cpPlugins.git/commitdiff
...
authorLeonardo Flórez-Valencia <florez-l@javeriana.edu.co>
Wed, 8 Feb 2017 20:57:06 +0000 (15:57 -0500)
committerLeonardo Flórez-Valencia <florez-l@javeriana.edu.co>
Wed, 8 Feb 2017 20:57:06 +0000 (15:57 -0500)
cmake/cpPluginsConfig.cmake.in
lib/cpInstances/DataObjects/Simple3DCurve.cxx
lib/cpInstances/DataObjects/Simple3DCurve.h
lib/cpPlugins/Interface/Workspace.cxx
lib/cpPlugins/Interface/Workspace.h
plugins/ITKSliceFilters/CPRImageFilter.cxx
plugins/cpExtensions/PolyLineParametricPathToSimple3DCurve.cxx

index 2a2315e5cdb2ebce064f15bfdaad02f48a9cc84c..0a65b42efeabb07bdecf7cfd486411f432caae69 100644 (file)
@@ -31,6 +31,7 @@ SET(
   )
 IF(USE_QT4)
   LIST(APPEND _all_libs cpBaseQtApplication)
+  LIST(APPEND _all_libs cp_QCustomPlot)
 ENDIF(USE_QT4)
 SET(cpPlugins_Libraries ${_all_libs} CACHE STRING "cpPlugins base libraries")
 MARK_AS_ADVANCED(FORCE cpPlugins_Libraries)
index 10165f7b9eb3c9720a69cc6f9298d6e78404778c..659efff9e603f6fc1709a1836c445061c7ce4b40 100644 (file)
@@ -3,27 +3,27 @@
 #include <cpExtensions/Visualization/Simple3DCurveToPolyData.h>
 
 // -------------------------------------------------------------------------
-void cpInstances::Simple3DCurve::
+void cpInstances::DataObjects::Simple3DCurve::
 SetVTK( vtkObjectBase* o )
 {
   // Do nothing
 }
 
 // -------------------------------------------------------------------------
-cpInstances::Simple3DCurve::
+cpInstances::DataObjects::Simple3DCurve::
 Simple3DCurve( )
   : Superclass( )
 {
 }
 
 // -------------------------------------------------------------------------
-cpInstances::Simple3DCurve::
+cpInstances::DataObjects::Simple3DCurve::
 ~Simple3DCurve( )
 {
 }
 
 // -------------------------------------------------------------------------
-void cpInstances::Simple3DCurve::
+void cpInstances::DataObjects::Simple3DCurve::
 _UpdateVTK( ) const
 {
   auto i = const_cast< itk::LightObject* >( this->m_ITK.GetPointer( ) );
@@ -37,7 +37,7 @@ _UpdateVTK( ) const
 
 // -------------------------------------------------------------------------
 template< class _TCurve >
-void cpInstances::Simple3DCurve::
+void cpInstances::DataObjects::Simple3DCurve::
 _ITK_2_VTK( _TCurve* curve ) const
 {
   typedef
index e53df26cf2d6206e1e6f43cb6649aae5aef6145e..5ea0047bf8a7d9a0ae59c31f0f1b5aad8b9bac22 100644 (file)
@@ -1,5 +1,5 @@
-#ifndef __cpInstances__Simple3DCurve__h__
-#define __cpInstances__Simple3DCurve__h__
+#ifndef __cpInstances__DataObjects__Simple3DCurve__h__
+#define __cpInstances__DataObjects__Simple3DCurve__h__
 
 #include <cpInstances/cpPluginsDataObjects_Export.h>
 #include <cpPlugins/Pipeline/DataObject.h>
@@ -13,43 +13,47 @@ class vtkPolyDataAlgorithm;
 // -------------------------------------------------------------------------
 namespace cpInstances
 {
-  /**
-   */
-  class cpPluginsDataObjects_EXPORT Simple3DCurve
-    : public cpPlugins::Pipeline::DataObject
+  namespace DataObjects
   {
-  public:
-    typedef Simple3DCurve                      Self;
-    typedef cpPlugins::Pipeline::DataObject Superclass;
-    typedef itk::SmartPointer< Self >          Pointer;
-    typedef itk::SmartPointer< const Self >    ConstPointer;
-
-  public:
-    itkNewMacro( Self );
-    itkTypeMacro( Simple3DCurve, cpPlugins::Pipeline::DataObject );
-    cpPlugins_Id_Macro( Simple3DCurve, Object );
-    cpPlugins_Compatibility_Macro;
-
-  public:
-    virtual void SetVTK( vtkObjectBase* o ) cpPlugins_OVERRIDE;
-
-  protected:
-    Simple3DCurve( );
-    virtual ~Simple3DCurve( );
-
-    virtual void _UpdateVTK( ) const cpPlugins_OVERRIDE;
-
-    template< class _TCurve >
-    inline void _ITK_2_VTK( _TCurve* curve ) const;
-
-  private:
-    // Purposely not implemented
-    Simple3DCurve( const Self& );
-    Self& operator=( const Self& );
-
-  protected:
-    vtkSmartPointer< vtkPolyDataAlgorithm > m_ITKvVTK;
-  };
+    /**
+     */
+    class cpPluginsDataObjects_EXPORT Simple3DCurve
+      : public cpPlugins::Pipeline::DataObject
+    {
+    public:
+      typedef Simple3DCurve                      Self;
+      typedef cpPlugins::Pipeline::DataObject Superclass;
+      typedef itk::SmartPointer< Self >          Pointer;
+      typedef itk::SmartPointer< const Self >    ConstPointer;
+
+    public:
+      itkNewMacro( Self );
+      itkTypeMacro( Simple3DCurve, cpPlugins::Pipeline::DataObject );
+      cpPlugins_Id_Macro( Simple3DCurve, Object );
+      cpPlugins_Compatibility_Macro;
+
+    public:
+      virtual void SetVTK( vtkObjectBase* o ) cpPlugins_OVERRIDE;
+
+    protected:
+      Simple3DCurve( );
+      virtual ~Simple3DCurve( );
+
+      virtual void _UpdateVTK( ) const cpPlugins_OVERRIDE;
+
+      template< class _TCurve >
+      inline void _ITK_2_VTK( _TCurve* curve ) const;
+
+    private:
+      // Purposely not implemented
+      Simple3DCurve( const Self& );
+      Self& operator=( const Self& );
+
+    protected:
+      vtkSmartPointer< vtkPolyDataAlgorithm > m_ITKvVTK;
+    };
+
+  } // ecapseman
 
 } // ecapseman
 
index 3822969f30b977a5f53b52ecd6b6680961f31018..4fbcb2bbf3b154e11332f29b0a32cd7201630f95 100644 (file)
@@ -78,7 +78,10 @@ HasWidget( const std::string& name ) const
 // -------------------------------------------------------------------------
 cpPlugins::Interface::Workspace::
 TFilter* cpPlugins::Interface::Workspace::
-CreateFilter( const std::string& category, const std::string& filter )
+CreateFilter(
+  const std::string& category, const std::string& filter,
+  const std::string& name
+  )
 {
   typedef cpPlugins::Pipeline::Widget _TWidget;
 
@@ -86,11 +89,11 @@ CreateFilter( const std::string& category, const std::string& filter )
   if( o.IsNotNull( ) )
   {
     // Choose a name
-    std::string name = filter;
-    while( this->GetFilter( name ) != NULL )
-      name += std::string( "_" );
+    std::string real_name = name;
+    while( this->GetFilter( real_name ) != NULL )
+      real_name += std::string( "_" );
     o->SetPrintExecution( this->m_PrintExecution );
-    o->SetName( name );
+    o->SetName( real_name );
 
     // Interactors
     for(
@@ -101,12 +104,20 @@ CreateFilter( const std::string& category, const std::string& filter )
       o->AddInteractor( *i );
 
     // Finish association
-    this->m_Filters[ name ] = o;
+    this->m_Filters[ real_name ] = o;
 
   } // fi
   return( o.GetPointer( ) );
 }
 
+// -------------------------------------------------------------------------
+cpPlugins::Interface::Workspace::
+TFilter* cpPlugins::Interface::Workspace::
+CreateFilter( const std::string& category, const std::string& filter )
+{
+  return( this->CreateFilter( category, filter, filter ) );
+}
+
 // -------------------------------------------------------------------------
 bool cpPlugins::Interface::Workspace::
 RenameFilter( const std::string& old_name, const std::string& new_name )
index 745bd98224c17259d0bb290aee68ef128c0b567a..fd9847b20a81b58215082a795e32bf6d0a81d8bb 100644 (file)
@@ -57,6 +57,10 @@ namespace cpPlugins
       const TWidget* GetWidget( const std::string& name ) const;
       bool HasFilter( const std::string& name ) const;
       bool HasWidget( const std::string& name ) const;
+      TFilter* CreateFilter(
+        const std::string& category, const std::string& filter,
+        const std::string& name
+        );
       TFilter* CreateFilter(
         const std::string& category, const std::string& filter
         );
index 60de5f5a82630fbc8e3291e7c657be9b7c2b67c6..9e6b8a8c3b15c7df2744ccbcf692ce05dcfa9771 100644 (file)
@@ -13,7 +13,7 @@ CPRImageFilter( )
   : Superclass( )
 {
   typedef cpInstances::DataObjects::Image         _TImage;
-  typedef cpInstances::Simple3DCurve _TCurve;
+  typedef cpInstances::DataObjects::Simple3DCurve _TCurve;
   this->_ConfigureInput< _TImage >( "Image", true, false );
   this->_ConfigureInput< _TCurve >( "Curve", true, false );
   this->_ConfigureOutput< _TImage >( "Output" );
index 21760ce38823931f05726ed2925d7a95024dd2bb..7b2b853ebf2a4a538d00763f0aa0ab87afeb536c 100644 (file)
@@ -14,7 +14,7 @@ PolyLineParametricPathToSimple3DCurve( )
   this->_ConfigureInput< cpInstances::PolyLineParametricPath >(
     "Input", true, false
     );
-  this->_ConfigureOutput< cpInstances::Simple3DCurve >( "Output" );
+  this->_ConfigureOutput< cpInstances::DataObjects::Simple3DCurve >( "Output" );
   this->m_Parameters.ConfigureAsUint( "NumberOfSamples", 0 );
 }