]> Creatis software - FrontAlgorithms.git/blobdiff - lib/fpa/VTK/ImageMPR.cxx
CMake updated. Some other filters added.
[FrontAlgorithms.git] / lib / fpa / VTK / ImageMPR.cxx
index 1cc4b85f6947b1528e8bed346d46e2edba874ad3..c3084535a168884b67b53816337935974c2476a9 100644 (file)
@@ -221,6 +221,15 @@ SetSize( unsigned int w, unsigned int h )
   this->m_Window->SetSize( w, h );
 }
 
+// -------------------------------------------------------------------------
+void fpa::VTK::ImageMPR::
+SetWindowLevel( double w, double l )
+{
+  this->m_WidgetX->SetWindowLevel( w, l );
+  this->m_WidgetY->SetWindowLevel( w, l );
+  this->m_WidgetZ->SetWindowLevel( w, l );
+}
+
 // -------------------------------------------------------------------------
 void fpa::VTK::ImageMPR::
 AddPolyData( vtkPolyData* pd, double opacity )
@@ -235,7 +244,7 @@ AddPolyData( vtkPolyData* pd, double opacity )
   this->m_Actors[ i ]->SetMapper( this->m_Mappers[ i ] );
   this->m_Actors[ i ]->GetProperty( )->SetOpacity( opacity );
   this->m_Actors[ i ]->GetProperty( )->SetLineWidth( 3 );
-  this->m_Actors[ i ]->GetProperty( )->SetPointSize( 10 );
+  this->m_Actors[ i ]->GetProperty( )->SetPointSize( 5 );
   this->m_Renderer->AddActor( this->m_Actors[ i ] );
 }
 
@@ -255,7 +264,7 @@ AddPolyData( vtkPolyData* pd, double r, double g, double b, double opacity )
   this->m_Actors[ i ]->GetProperty( )->SetColor( r, g, b );
   this->m_Actors[ i ]->GetProperty( )->SetOpacity( opacity );
   this->m_Actors[ i ]->GetProperty( )->SetLineWidth( 3 );
-  this->m_Actors[ i ]->GetProperty( )->SetPointSize( 10 );
+  this->m_Actors[ i ]->GetProperty( )->SetPointSize( 5 );
   this->m_Renderer->AddActor( this->m_Actors[ i ] );
 }
 
@@ -298,6 +307,21 @@ GetSeed( int n, double* s ) const
   hRep->GetWorldPosition( s );
 }
 
+// -------------------------------------------------------------------------
+unsigned int fpa::VTK::ImageMPR::
+AddSeed( const double& x, const double& y, const double& z ) const
+{
+  double pos[ 3 ] = { x, y, z };
+
+  int hnd_id = this->m_SeedRepresentation->CreateHandle( pos );
+  vtkHandleWidget* hnd = this->m_SeedWidget->CreateNewHandle( );
+  vtkHandleWidget::ComputeWorldToDisplay( this->m_Renderer, x, y, z, pos );
+  this->m_SeedRepresentation->SetSeedDisplayPosition( hnd_id, pos );
+  hnd->SetEnabled( 1 );
+
+  return( this->GetNumberOfSeeds( ) - 1 );
+}
+
 // -------------------------------------------------------------------------
 vtkRenderWindow* fpa::VTK::ImageMPR::
 GetWindow( ) const