]> Creatis software - cpPlugins.git/blobdiff - lib/cpExtensions/Visualization/ImageSliceActors.cxx
Widget integration (step 3/6). WARNING: IT DOES NOT COMPILE YET
[cpPlugins.git] / lib / cpExtensions / Visualization / ImageSliceActors.cxx
index 31787e54fc66c9e7736ea37180e4adf19a2fa573..f945bd397eb6c6b885f61f5e234c2bdb44182c7e 100644 (file)
@@ -170,10 +170,17 @@ GetPlaneFunction( ) const
 void cpExtensions::Visualization::ImageSliceActors::
 AddActor( vtkAlgorithm* algorithm, vtkActor* actor )
 {
-  this->OtherActors.push_back( std::pair< vtkSmartPointer< vtkAlgorithm >, vtkSmartPointer< vtkActor > >( algorithm, actor ) );
+  this->OtherActors.push_back( TActorPair( algorithm, actor ) );
   this->AddItem( actor );
 }
 
+// -------------------------------------------------------------------------
+void cpExtensions::Visualization::ImageSliceActors::
+AddActor( vtkActor* actor )
+{
+  this->AddActor( NULL, actor );
+}
+
 // -------------------------------------------------------------------------
 void cpExtensions::Visualization::ImageSliceActors::
 SetInterpolate( bool v )
@@ -376,12 +383,19 @@ SetSliceNumber( const int& slice )
   // Prepare other actors to update
   for( unsigned int i = 0; i < this->OtherActors.size( ); ++i )
   {
-#error CLEAN UP CODING STYLE AND NULL POINTER CHECK
+    if( this->OtherActors[ i ].first.GetPointer( ) != NULL )
+    {
+      this->OtherActors[ i ].first->Modified( );
+      this->OtherActors[ i ].first->Update( );
+
+    } // fi
+
+    if( this->OtherActors[ i ].second.GetPointer( ) != NULL )
+    {
+      this->OtherActors[ i ].second->GetMapper( )->Modified( );
+      this->OtherActors[ i ].second->Modified( );
 
-    this->OtherActors[ i ].first->Modified( );
-    this->OtherActors[ i ].first->Update( );
-    this->OtherActors[ i ].second->GetMapper( )->Modified( );
-    this->OtherActors[ i ].second->Modified( );
+    } // fi
 
   } // rof