]> Creatis software - cpPlugins.git/commitdiff
debug finished
authorLeonardo Flórez-Valencia <leonardo.florez@gmail.com>
Thu, 1 Dec 2016 14:31:05 +0000 (09:31 -0500)
committerLeonardo Flórez-Valencia <leonardo.florez@gmail.com>
Thu, 1 Dec 2016 14:31:05 +0000 (09:31 -0500)
16 files changed:
appli/bash/CreateInstances.cxx
appli/bash/CreatePlugins.cxx
lib/cpBaseQtApplication/Pipeline/Block.h
lib/cpInstances/BoundingBox.h
lib/cpInstances/Image.cxx
lib/cpInstances/Image.h
lib/cpInstances/Mesh.h
lib/cpInstances/PolyLineParametricPath.h
lib/cpInstances/Simple3DCurve.h
lib/cpInstances/Skeleton.h
lib/cpPlugins/BaseObjects/DataObject.h
lib/cpPlugins/BaseObjects/ProcessObject.cxx
lib/cpPlugins/Config.h.in
lib/cpPlugins/Interface/Plugins.cxx
lib/cpPlugins/Interface/Workspace.cxx
lib/cpPlugins/Interface/Workspace.h

index b68c08770d2a037a718e02682209398bff9d5404..cf73c63eabb5d2fbe1dd21dd96ece49cf5e9874c 100644 (file)
@@ -22,7 +22,7 @@ int main( int argc, char* argv[] )
   std::string definitions_buffer;
   if( !( cpPlugins_bash::Read( definitions_buffer, definitions_filename ) ) )
   {
-    std::cout
+    std::cerr
       << argv[ 0 ]
       <<  ": Error reading definitions file \"" << definitions_filename
       << "\"" << std::endl;
index 218434770631b774b7b63926cf007fe3bd56a410..918f6f22dd9985438cee98c7085278955b6d8493 100644 (file)
@@ -23,7 +23,7 @@ int main( int argc, char* argv[] )
   std::string definitions_buffer;
   if( !( cpPlugins_bash::Read( definitions_buffer, definitions_filename ) ) )
   {
-    std::cout
+    std::cerr
       << argv[ 0 ]
       <<  ": Error reading definitions file \"" << definitions_filename
       << "\"" << std::endl;
index 73b31f8e11b9588d5f809d7b200930a0ff4b2a0b..14e59b32c3fe121b227407bae4e8954308a51bf5 100644 (file)
@@ -35,7 +35,7 @@ namespace cpBaseQtApplication
       public:\r
         typedef itk::SmartPointer< _TFilterObserver >       Pointer;\r
         typedef itk::SmartPointer< const _TFilterObserver > ConstPointer;\r
-        itkNewMacro( _TFilterObserver );\r
+        cpPluginsNewMacro( _TFilterObserver );\r
       public:\r
         void Execute( itk::Object* c, const itk::EventObject& e )\r
           { this->Execute( const_cast< const itk::Object* >( c ), e ); }\r
index c210b0ada0f1198c006fbce9487b1b2a85bc358d..8bb529c474af447a32e443bc22f47fbbbd7da3d1 100644 (file)
@@ -21,7 +21,7 @@ namespace cpInstances
     typedef itk::SmartPointer< const Self >    ConstPointer;
 
   public:
-    itkNewMacro( Self );
+    cpPluginsNewMacro( Self );
     itkTypeMacro( BoundingBox, DataObject );
     cpPlugins_Id_Macro( BoundingBox, Object );
     cpPlugins_Compatibility_Macro;
index 6cdae033097a11d8a9fbd177d2806043bae927f2..b34abeacdd503666fca464b0d18c2376a03dee2f 100644 (file)
@@ -147,13 +147,6 @@ _ITK_2_VTK_1( _TImage* image ) const
     f = nf.GetPointer( );
 
   } // fi
-
-  std::string name = "<noname>";
-  if( this->m_Source != NULL )
-    name = this->m_Source->GetName( );
-
-  std::cout << "HOLALALAL: " << name << " " << image << " " << f->GetInput( ) << std::endl;
-
   f->SetInput( image );
   f->Update( );
 
index bcffabecbf0ecb0d1f526f4e4ab20dd4ca4d22f9..2ca3df422fffd3aa56de1e97682178b10855492c 100644 (file)
@@ -22,7 +22,7 @@ namespace cpInstances
     typedef itk::SmartPointer< const Self >    ConstPointer;
 
   public:
-    itkNewMacro( Self );
+    cpPluginsNewMacro( Self );
     itkTypeMacro( Image, cpPlugins::BaseObjects::DataObject );
     cpPlugins_Id_Macro( Image, Object );
     cpPlugins_Compatibility_Macro;
index e40579b5a4ad1839965180f2095fc9a0d5017bf8..f516f788798b5284377a6b35300387cd031f6a17 100644 (file)
@@ -19,7 +19,7 @@ namespace cpInstances
     typedef itk::SmartPointer< const Self >    ConstPointer;
 
   public:
-    itkNewMacro( Self );
+    cpPluginsNewMacro( Self );
     itkTypeMacro( Mesh, DataObject );
     cpPlugins_Id_Macro( Mesh, Object );
     cpPlugins_Compatibility_Macro;
index c510d4c522320cee0b3e55d83207921902477cd8..4d1fed0862e47ad9a76acc01dce901a48a5f992f 100644 (file)
@@ -22,7 +22,7 @@ namespace cpInstances
     typedef itk::SmartPointer< const Self >    ConstPointer;
 
   public:
-    itkNewMacro( Self );
+    cpPluginsNewMacro( Self );
     itkTypeMacro( PolyLineParametricPath, cpPlugins::BaseObjects::DataObject );
     cpPlugins_Id_Macro( PolyLineParametricPath, Object );
     cpPlugins_Compatibility_Macro;
index cd2bad2555b416c97f78e9a3e504c8b9e7c41f5c..5056ae812109b2a43ca8c0fb4c76c96d470c43a5 100644 (file)
@@ -25,7 +25,7 @@ namespace cpInstances
     typedef itk::SmartPointer< const Self >    ConstPointer;
 
   public:
-    itkNewMacro( Self );
+    cpPluginsNewMacro( Self );
     itkTypeMacro( Simple3DCurve, cpPlugins::BaseObjects::DataObject );
     cpPlugins_Id_Macro( Simple3DCurve, Object );
     cpPlugins_Compatibility_Macro;
index faae87637559d0817ec5c07dc23e399dd6084d8e..b86aed04f1784a232f496dbc400586a246e6efa9 100644 (file)
@@ -22,7 +22,7 @@ namespace cpInstances
     typedef itk::SmartPointer< const Self >    ConstPointer;
 
   public:
-    itkNewMacro( Self );
+    cpPluginsNewMacro( Self );
     itkTypeMacro( Skeleton, cpPlugins::BaseObjects::DataObject );
     cpPlugins_Id_Macro( Skeleton, Object );
     cpPlugins_Compatibility_Macro;
index daf9ff55d3ca5fee95add997ad2189610120f761..acb8213c9749ba20589147f688fcca70d0c83129 100644 (file)
@@ -24,7 +24,7 @@ namespace cpPlugins
       typedef itk::SmartPointer< const Self > ConstPointer;
 
     public:
-      itkNewMacro( Self );
+      cpPluginsNewMacro( Self );
       itkTypeMacro( DataObject, Object );
       cpPlugins_Id_Macro( DataObject, Object );
 
index 0192ea61167b5c7de37242257d3782e9c451e766..35b95ff643525bf900a30ed4fe8313eea3fa646a 100644 (file)
@@ -206,7 +206,6 @@ Disconnect( )
 void cpPlugins::BaseObjects::ProcessObject::
 Modified( ) const
 {
-  std::cout << "Modified: " << this->m_Name << std::endl;
   this->Superclass::Modified( );
 
   cpPlugins::BaseObjects::Events::Modified evt;
index 1eb05a3552b35dfe7a2ad88af57ceb911c45138c..c58039cd24fe19e4ba59ea79904c922c9727c642 100644 (file)
  * =========================================================================
  */
 
+#define cpPluginsNewMacro( x )                                       \
+  static Pointer New( )                                              \
+  {                                                                  \
+    Pointer smartPtr = new x( );                                     \
+    smartPtr->UnRegister( );                                         \
+    return( smartPtr );                                              \
+  }                                                                  \
+  virtual itk::LightObject::Pointer                                  \
+  CreateAnother( ) const cpPlugins_OVERRIDE                          \
+  {                                                                  \
+    itk::LightObject::Pointer smartPtr;                              \
+    smartPtr = x::New( ).GetPointer( );                              \
+    return( smartPtr );                                              \
+  }                                                                  \
+  Pointer Clone( ) const                                             \
+  {                                                                  \
+    Pointer rval =                                                   \
+      dynamic_cast< x* >( this->InternalClone( ).GetPointer( ) );    \
+    return( rval );                                                  \
+  }
+
 #define cpPlugins_Id_Macro( _class, _category )                         \
   public:                                                               \
   virtual const char* GetClassName( ) const cpPlugins_OVERRIDE          \
   typedef itk::SmartPointer< Self >       Pointer;                      \
   typedef itk::SmartPointer< const Self > ConstPointer;                 \
   public:                                                               \
-  itkNewMacro( Self );                                                  \
+  cpPluginsNewMacro( Self );                                            \
   itkTypeMacro( _cls, _scls );                                          \
   public:                                                               \
   virtual const char* GetClassName( ) const cpPlugins_OVERRIDE          \
index 1543d314a25443d1ce8e7068b01bc990ea6d2099..9da2f70e9d31b54fa3233a41eff6fcb9af64250d 100644 (file)
@@ -123,76 +123,49 @@ cpPlugins::BaseObjects::ProcessObject::Pointer
 cpPlugins::Interface::Plugins::
 CreateFilter( const std::string& category, const std::string& name )
 {
-  std::cout << "1" << std::endl;
   typedef void* ( *_TCreator )( );
-  std::cout << "2" << std::endl;
   typedef cpPlugins::BaseObjects::ProcessObject::Pointer _TPtr;
-  std::cout << "3" << std::endl;
   _TPtr o = NULL;
-  std::cout << "4" << std::endl;
   auto cat = this->m_Filters.find( category );
-  std::cout << "5" << std::endl;
   if( cat != this->m_Filters.end( ) )
   {
-  std::cout << "6" << std::endl;
     auto nam = cat->second.find( name );
-  std::cout << "7" << std::endl;
     if( nam != cat->second.end( ) )
     {
-  std::cout << "8" << std::endl;
       void* l_hnd = nam->second.second.first;
-  std::cout << "9" << std::endl;
       void* f_hnd = nam->second.second.second;
-  std::cout << "10" << std::endl;
       if( l_hnd == NULL )
       {
-  std::cout << "11" << std::endl;
         l_hnd = cpPlugins::OS::DLLManager::LoadPlugins( nam->second.first );
-  std::cout << "12" << std::endl;
         nam->second.second.first = l_hnd;
-  std::cout << "13" << std::endl;
 
       } // fi
       if( f_hnd == NULL )
       {
-  std::cout << "14" << std::endl;
         f_hnd =
           cpPlugins::OS::DLLManager::LoadCreator( l_hnd, category, name );
-  std::cout << "15" << std::endl;
         nam->second.second.second = f_hnd;
-  std::cout << "16" << std::endl;
 
       } // fi
-  std::cout << "17" << std::endl;
       _TCreator creator = reinterpret_cast< _TCreator >( f_hnd );
-  std::cout << "18" << std::endl;
       if( creator != NULL )
       {
-        std::cout << "19 " << creator << " " << f_hnd << std::endl;
         void* a = creator( );
-  std::cout << "20" << std::endl;
-        std::cout << "20 " << creator << " " << a << std::endl;
-  std::cout << "21" << std::endl;
         o = reinterpret_cast< _TPtr* >( a )->GetPointer( );
-  std::cout << "22" << std::endl;
         o->SetName( name );
-  std::cout << "23" << std::endl;
         o->SetPluginName( nam->second.first );
-  std::cout << "24" << std::endl;
 
       } // fi
 
     } // fi
 
   } // fi
-  std::cout << "25" << std::endl;
   if( o.IsNull( ) )
     throw std::runtime_error(
       std::string( "Could not create a valid ProcessObject of type \"" ) +
       category + std::string( ":" ) +
       name + std::string( "\"" )
       );
-  std::cout << "26" << std::endl;
   return( o );
 }
 
index 8eca62080671d2108b9bb02ec3c3faf6335bd201..5b80a36bb9a19f392bf941be9a7c9fd4f7cd3d90 100644 (file)
@@ -1,35 +1,6 @@
 #include <cpPlugins/Interface/Workspace.h>
 #include <cpPlugins/BaseObjects/Widget.h>
 
-// -------------------------------------------------------------------------
-cpPlugins::Interface::Workspace::
-Pointer cpPlugins::Interface::Workspace::
-New( )
-{
-  Pointer smartPtr = new Self;
-  smartPtr->UnRegister( );
-  return( smartPtr );
-}
-
-// -------------------------------------------------------------------------
-itk::LightObject::Pointer cpPlugins::Interface::Workspace::
-CreateAnother( ) const
-{
-  itk::LightObject::Pointer smartPtr;
-  smartPtr = Self::New( ).GetPointer( );
-  return( smartPtr );
-}
-
-// -------------------------------------------------------------------------
-cpPlugins::Interface::Workspace::
-Pointer cpPlugins::Interface::Workspace::
-Clone( ) const
-{
-  Pointer rval =
-    dynamic_cast< Self* >( this->InternalClone( ).GetPointer( ) );
-  return( rval );
-}
-
 // -------------------------------------------------------------------------
 void cpPlugins::Interface::Workspace::
 Clear( )
index 7d76c05b13a4dbde315159d15aa677c965e2793f..2925a06485e354637d6ce03ab91c0c7e68d63ae2 100644 (file)
@@ -38,14 +38,10 @@ namespace cpPlugins
       */
 
     public:
+      cpPluginsNewMacro( Self );
       itkTypeMacro( Workspace, itk::Object );
 
     public:
-      // Factory methods
-      static Pointer New( );
-      virtual itk::LightObject::Pointer CreateAnother( ) const cpPlugins_OVERRIDE;
-      Pointer Clone( ) const;
-
       // Workspace IO
       void Load( const std::string& fname );
       void Save( const std::string& fname ) const;