#ifdef cpExtensions_QT4
#include <cpExtensions/Visualization/ImageOutlineActor.h>
+#include <cpExtensions/Visualization/MeshActor.h>
#include <cpExtensions/Visualization/WindowLevelImageActor.h>
#include <vtkImageData.h>
#include <vtkPlane.h>
+#include <vtkPolyData.h>
/* TODO
#include <cpExtensions/Visualization/MPR3DActors.h>
#include <cpExtensions/Visualization/LUTImageActor.h>
#include <vtkActor.h>
- #include <vtkPolyData.h>
*/
// -------------------------------------------------------------------------
cpExtensions::QT::MPR3DWidget::
~MPR3DWidget( )
{
+ for( auto a = this->m_Actors.begin( ); a != this->m_Actors.end( ); ++a )
+ delete *a;
+ this->m_Actors.clear( );
}
// -------------------------------------------------------------------------
} // rof
}
+// -------------------------------------------------------------------------
+void cpExtensions::QT::MPR3DWidget::
+Add( vtkDataSet* data, const std::string& name )
+{
+ auto image = dynamic_cast< vtkImageData* >( data );
+ auto pdata = dynamic_cast< vtkPolyData* >( data );
+ if( image != NULL )
+ {
+ /* TODO
+ if( this->m_ImageName != "" )
+ {
+ }
+ else
+ this->SetImage( image, name );
+ */
+ }
+ else if( pdata != NULL )
+ {
+ TActor* actor = new TActor( );
+ actor->SetMesh( pdata );
+ this->m_Actors.push_back( actor );
+ this->AddViewProp( actor->GetActor( ), name );
+ this->Render( );
+ if( this->m_ImageName == "" )
+ this->ResetCamera( );
+
+ } // fi
+}
+
// -------------------------------------------------------------------------
cpExtensions::QT::MPR3DWidget::
TWLActor* cpExtensions::QT::MPR3DWidget::
this->Render( );
}
-// -------------------------------------------------------------------------
-void cpExtensions::QT::MPR3DWidget::
-Add( vtkDataSet* data, const std::string& name )
-{
- auto image = dynamic_cast< vtkImageData* >( data );
- auto pdata = dynamic_cast< vtkPolyData* >( data );
- if( image != NULL )
- {
- if( this->m_ImageName != "" )
- {
- }
- else
- this->SetImage( image, name );
- }
- else if( pdata != NULL )
- {
- this->AddViewProp( this->m_Actors->AddMesh( pdata ), name );
- this->Render( );
- if( this->m_ImageName == "" )
- this->ResetCamera( );
-
- } // fi
-
- return;
-
- auto image = dynamic_cast< vtkImageData* >( data );
- auto pdata = dynamic_cast< vtkPolyData* >( data );
- if( image != NULL )
- {
- this->m_Actors->AddLUTImage( image );
- vtkSmartPointer< vtkPropCollection > coll =
- vtkSmartPointer< vtkPropCollection >::New( );
- coll->AddItem( this->m_Actors->GetLUTImageActor( 0 ) );
- coll->AddItem( this->m_Actors->GetLUTImageActor( 1 ) );
- coll->AddItem( this->m_Actors->GetLUTImageActor( 2 ) );
- this->AddViewProps( coll, name );
- this->Render( );
- }
- else if( pdata != NULL )
- {
-
- } // fi
-}
-
// -------------------------------------------------------------------------
void cpExtensions::QT::MPR3DWidget::
SetSliceNumber( int orientation, int slice )