]> Creatis software - cpPlugins.git/commitdiff
...
authorLeonardo Florez <leonardo@iMac-de-Andrea.local>
Fri, 11 Nov 2016 02:08:45 +0000 (21:08 -0500)
committerLeonardo Florez <leonardo@iMac-de-Andrea.local>
Fri, 11 Nov 2016 02:08:45 +0000 (21:08 -0500)
appli/plugins/ExecutePipeline.cxx
lib/Instances/BaseObjects.i
lib/cpPlugins/BaseObjects/Object.cxx
lib/cpPlugins/BaseObjects/ProcessObject.cxx
lib/cpPlugins/BaseObjects/Widget.cxx
lib/cpPlugins/BaseObjects/Widget.h
plugins/Extensions/Extensions.i

index a842d8db759c8c26fb93371d9d5c470c0f1db0c6..623b74e02d90ed07f1dcc89a89bc4c5a391598b1 100644 (file)
@@ -1,4 +1,5 @@
 #include <iostream>
+#include <cpPlugins/Utility.h>
 #include <cpPlugins/Interface/Plugins.h>
 #include <cpPlugins/Interface/Workspace.h>
 
@@ -46,11 +47,54 @@ int main( int argc, char* argv[] )
     return( 1 );
 
   } // yrt
+    
+  // Read parameters
+  for( int i = 2; i < argc; ++i )
+  {
+    std::vector< std::string > tokens;
+    cpPlugins::Tokenize( tokens, argv[ i ], "@=" );
+    if( tokens.size( ) == 3 )
+    {
+      auto filter = workspace->GetFilter( tokens[ 1 ] );
+      if( filter != NULL )
+      {
+        auto params = filter->GetParameters( );
+        params->SetString( tokens[ 0 ], tokens[ 2 ], true );
+
+      } // fi
+
+    } // fi
+
+  } // rof
 
   // Execute filter
   workspace->PrintExecutionOn( );
-  workspace->Execute( );
+  try
+  {
+    workspace->Execute( );
+  }
+  catch( std::exception& err1 )
+  {
+    std::cerr << std::endl << "********************************" << std::endl;
+    std::cerr << "Error caught: " << err1.what( ) << std::endl;
+    std::cerr << "********************************" << std::endl;
+    return( 1 );
+  }
+  catch( itk::ExceptionObject& err2 )
+  {
+    std::cerr << std::endl << "********************************" << std::endl;
+    std::cerr << "Error caught: " << err2 << std::endl;
+    std::cerr << "********************************" << std::endl;
+    return( 1 );
+  }
+  catch( ... )
+  {
+    std::cerr << std::endl << "********************************" << std::endl;
+    std::cerr << "Unknown error caught." << std::endl;
+    std::cerr << "********************************" << std::endl;
+    return( 1 );
 
+  } // yrt
   return( 0 );
 }
 
index 8575d6662c1111e8ed0775fd692a391360568fa4..89533e7a5e665fb43f631ef28a4c52f5dfad92fd 100644 (file)
@@ -1,7 +1,7 @@
 header #define ITK_MANUAL_INSTANTIATION
 
 define arrays=Array2D;Array;#color_pixels#
-define fixed_dims=#process_dims#;8
+define fixed_dims=#visual_dims#;4;6;8
 
 tinclude itk#arrays#:h|hxx
 tinclude itkFixedArray:h|hxx
@@ -27,6 +27,8 @@ define my_vectors=FixedArray;Vector;Point
 
 minstances #_export_# std::ostream& itk::operator<< < #real_types#, #process_dims# >( std::ostream& a, itk::#my_vectors#< #real_types#, #process_dims# > const& b )
 
-*minstances void #_export_# itk::VariableLengthVector<  #real_types# >::SetSize< itk::VariableLengthVector< #real_types# >::AlwaysReallocate, itk::VariableLengthVector< #real_types# >::KeepOldValues >( unsigned int, itk::VariableLengthVector< #real_types# >::AlwaysReallocate, itk::VariableLengthVector< #real_types# >::KeepOldValues )
+minstances void #_export_# itk::VariableLengthVector<  #real_types# >::SetSize< itk::VariableLengthVector< #real_types# >::AlwaysReallocate, itk::VariableLengthVector< #real_types# >::KeepOldValues >( unsigned int, itk::VariableLengthVector< #real_types# >::AlwaysReallocate, itk::VariableLengthVector< #real_types# >::KeepOldValues )
+
+minstances void #_export_# itk::VariableLengthVector< #real_types# >::SetSize<itk::VariableLengthVector< #real_types# >::ShrinkToFit, itk::VariableLengthVector< #real_types# >::KeepOldValues>(unsigned int, itk::VariableLengthVector< #real_types# >::ShrinkToFit, itk::VariableLengthVector< #real_types# >::KeepOldValues)
 
 ** eof - $RCSfile$
index e372c99747f1584e611479ea0efb9dd5014e5575..9fffab63e44e0c487623ccb68defbcd3aff5bcd3 100644 (file)
@@ -42,20 +42,23 @@ Modified( ) const
 itk::ModifiedTimeType cpPlugins::BaseObjects::Object::
 GetMTime( ) const
 {
+  itk::ModifiedTimeType lt = this->Superclass::GetMTime( );
   const itk::Object* i = this->GetITK< itk::Object >( );
   vtkObject* v = const_cast< vtkObject* >( this->GetVTK< vtkObject >( ) );
+
+  itk::ModifiedTimeType rt;
   if( i != NULL && v == NULL )
-    return( i->GetMTime( ) );
+    rt = i->GetMTime( );
   else if( i == NULL && v != NULL )
-    return( v->GetMTime( ) );
+    rt = v->GetMTime( );
   else if( i != NULL && v != NULL )
   {
     auto iTime = i->GetMTime( );
     auto vTime = v->GetMTime( );
-    return( itk::ModifiedTimeType( ( iTime < vTime )? vTime: iTime ) );
-  }
-  else
-    return( this->Superclass::GetMTime( ) );
+    rt = ( iTime < vTime )? vTime: iTime;
+
+  } // fi
+  return( ( lt < rt )? rt: lt );
 }
 
 // -------------------------------------------------------------------------
index f9845f734c5f680d12a271060dad2e596c452a51..ffe2cf5fe2a3ba827cd7e8959fc57599b86f4363 100644 (file)
@@ -200,6 +200,7 @@ Update( )
 
     auto t_start = cpPlugins_CHRONO;
     this->_GenerateData( );
+    this->Modified( );
     auto t_end = cpPlugins_CHRONO;
     this->m_LastExecutionSpan = long( t_end - t_start );
     this->m_LastExecutionTime = this->GetMTime( );
index fe842aa14ce26608b33960a3d955679cd4fa88ef..4d574904be2a9f5891015ffd3e8b3db3e365a761 100644 (file)
@@ -1,14 +1,5 @@
 #include <cpPlugins/BaseObjects/Widget.h>
 
-// -------------------------------------------------------------------------
-itk::ModifiedTimeType cpPlugins::BaseObjects::Widget::
-GetMTime( ) const
-{
-  // Let time only be managed by itk -> synch issues when data is
-  // represented by vtk
-  return( this->itk::Object::GetMTime( ) );
-}
-
 // -------------------------------------------------------------------------
 bool cpPlugins::BaseObjects::Widget::
 IsInteractive( )
index 83960e6387c3a3f198cb87f3c4246fd85643a5c3..17132cc4479572b2fb3708c78f1d4702a02dbb72 100644 (file)
@@ -24,8 +24,6 @@ namespace cpPlugins
       cpPlugins_Id_Macro( Widget, Object );
 
     public:
-      virtual itk::ModifiedTimeType GetMTime( ) const cpPlugins_OVERRIDE;
-
       virtual bool IsInteractive( ) cpPlugins_OVERRIDE;
 
       virtual void EnabledOn( );
index e1b9fc5e75869208789d626bc54e3a36be15bf77..d1876b04d7549e28ad182605b760d155734b24be 100644 (file)
@@ -5,6 +5,7 @@ tinclude cpExtensions/DataStructures/Skeleton:h|hxx
 tinclude cpExtensions/Algorithms/BezierCurveFunction:h|hxx
 
 cinclude cpExtensions/DataStructures/Graph.hxx
+cinclude itkVectorContainer.hxx
 
 instances cpExtensions::Algorithms::BezierCurveFunction< itk::Vector< #real_types#, #process_dims# > >
 instances cpExtensions::DataStructures::PolyLineParametricPath< #process_dims# >