#include <vector>
#include <vtkSmartPointer.h>
+#include <vtkImageActorPointPlacer.h>
#include <vtkPropPicker.h>
+#include <vtkPointHandleRepresentation3D.h>
+#include <vtkSeedRepresentation.h>
+#include <cpExtensions/Interaction/SeedWidget.h>
// Forward definitions
class vtkImageActor;
typedef Superclass::TEnterCommand TEnterCommand;
typedef Superclass::TLeaveCommand TLeaveCommand;
+ // Widgets
+ struct TSeedWidget
+ {
+ vtkSmartPointer< vtkImageActorPointPlacer > Placer;
+ vtkSmartPointer< vtkPointHandleRepresentation3D > Handle;
+ vtkSmartPointer< vtkSeedRepresentation > Representation;
+ vtkSmartPointer< TSeedWidget > Widget;
+
+ TSeedWidget( vtkRenderWindowInteractor* interactor, vtkImageActor* actor )
+ {
+ this->Placer = vtkSmartPointer< vtkImageActorPointPlacer >::New( );
+ this->Handle = vtkSmartPointer< vtkPointHandleRepresentation3D >::New( );
+ this->Representation = vtkSmartPointer< vtkSeedRepresentation >::New( );
+ this->Widget = vtkSmartPointer< TSeedWidget >::New( );
+
+ this->Placer->SetImageActor( actor );
+ this->Handle->GetProperty( )->SetColor( 1, 0, 0 );
+ this->Handle->SetPointPlacer( this->Placer );
+ this->Representation->SetHandleRepresentation( this->Handle );
+ this->Widget->SetRepresentation( this->Representation );
+ this->Widget->SetInteractor( interactor );
+ }
+
+ void On( )
+ {
+ this->Widget->On( );
+ }
+
+ void Off( )
+ {
+ this->Widget->Off( );
+ }
+#error ACA VOY
+ };
+
public:
static Self* New( );
const double& r, const double& g, const double& b
)
{
- std::cout
- << "BaseMPRWidget: "
- << image << " "
- << name << " "
- << parent << " "
- << r << " " << g << " " << b << std::endl;
- return( false );
+ // Update tree view
+ QTreeWidgetItem* new_item = this->_UpdateItem( name, parent );
+ if( new_item == NULL )
+ return( false );
+
+ // Associate new data
+ this->m_Images[ name ] = image;
+ this->m_Tree[ name ] = parent;
+
+ // Show image and return
+ this->m_MPRObjects->AddImage( image );
+ return( true );
}
// -------------------------------------------------------------------------