]> Creatis software - cpPlugins.git/blobdiff - lib/cpPlugins/BaseObjects/Object.cxx
...
[cpPlugins.git] / lib / cpPlugins / BaseObjects / Object.cxx
index 89d7fe6a59c4c5a4a60d7ceb44a08c398dc56c8f..9fffab63e44e0c487623ccb68defbcd3aff5bcd3 100644 (file)
@@ -23,7 +23,7 @@ SetViewCoords( float x, float y )
 {
   this->m_ViewX = x;
   this->m_ViewY = y;
-  // WARNING: do not call "this->Modified( )" -> It could lead to a
+  // WARNING: do not call "this->Modified( )" -> It could lead to
   //          re-execution of all pipeline
 }
 
@@ -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 = i->GetMTime( );
-    return( itk::ModifiedTimeType( ( iTime > vTime )? iTime: vTime ) );
-  }
-  else
-    return( this->Superclass::GetMTime( ) );
+    auto vTime = v->GetMTime( );
+    rt = ( iTime < vTime )? vTime: iTime;
+
+  } // fi
+  return( ( lt < rt )? rt: lt );
 }
 
 // -------------------------------------------------------------------------