X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=lib%2Ffpa%2FVTK%2FImageMPR.cxx;fp=lib%2Ffpa%2FVTK%2FImageMPR.cxx;h=c3084535a168884b67b53816337935974c2476a9;hb=015105c2f44abb80923a59adfb1a01713506744f;hp=1cc4b85f6947b1528e8bed346d46e2edba874ad3;hpb=a3e7c837b7425ae3b8b3d2f9f596c9ea9f1978f9;p=FrontAlgorithms.git diff --git a/lib/fpa/VTK/ImageMPR.cxx b/lib/fpa/VTK/ImageMPR.cxx index 1cc4b85..c308453 100644 --- a/lib/fpa/VTK/ImageMPR.cxx +++ b/lib/fpa/VTK/ImageMPR.cxx @@ -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