#include <vtkRenderWindow.h>
#include <vtkRenderWindowInteractor.h>
#include <cpExtensions/QT/SimpleMPRWidget.h>
+#include <cpExtensions/Interaction/SeedWidget.h>
// -------------------------------------------------------------------------
// This callback is responsible for changing update time
{ return( new SeedWidgetCallback ); }
virtual void Execute( vtkObject* caller, unsigned long id, void* data )
{
- /* TODO
- typedef cpPluginsWidgets::SeedWidget::TImageActor _TImageActor;
- auto actor = dynamic_cast< _TImageActor* >( caller );
- */
- /* TODO
- if( id == vtkCommand::InteractionEvent && actor != NULL )
- {
- int slice = actor->GetSliceNumber( );
- if( this->Data->ActualWidgetId != slice )
- {
- this->Data->Widgets[ this->Data->ActualWidgetId ]->EnabledOff( );
- this->Data->Widgets[ slice ]->EnabledOn( );
- this->Data->ActualWidgetId = slice;
- } // fi
- }
- else
- */
- // id == vtkCommand::CursorChangedEvent ||
- if( id == vtkCommand::PlacePointEvent )
+ if( id == vtkCommand::InteractionEvent )
{
- auto wdg = dynamic_cast< cpExtensions::Interaction::SeedWidget* >( caller );
+ std::cout << id << std::endl;
+ auto actor = dynamic_cast< SeedWidget::TImageActor* >( caller );
+ if( actor != NULL )
+ {
+ int slice = actor->GetSliceNumber( );
+
+ std::cout << slice << std::endl;
+
+ } // fi
+ /* TODO
+ typedef cpPluginsWidgets::SeedWidget::TImageActor _TImageActor;
+ */
+ /* TODO
+ if( this->Data->ActualWidgetId != slice )
+ {
+ this->Data->Widgets[ this->Data->ActualWidgetId ]->EnabledOff( );
+ this->Data->Widgets[ slice ]->EnabledOn( );
+ this->Data->ActualWidgetId = slice;
+ } // fi
+ }
+ else
+ */
+ }
+ else if( id == vtkCommand::PlacePointEvent )
+ {
+ // TODO: id == vtkCommand::CursorChangedEvent ||
+ auto wdg = dynamic_cast< SeedWidget::TWidget* >( caller );
if( wdg != NULL )
{
auto rep =
}
} // elihw
+
} // elihw
} // fi
if( all_props.size( ) == 1 )
{
this->m_Data[ *inIt ] =
- new TWidgetData( this, *( all_props.begin( ) ), *inIt, this->m_Command );
- }
+ new TWidgetData(
+ this, *( all_props.begin( ) ), *inIt, this->m_Command
+ );
+
+ } // fi
} // rof
}
)
{
auto cb = dynamic_cast< SeedWidgetCallback* >( cmd );
-/*
- auto cb = vtkSmartPointer< SeedWidgetCallback >::New( );
- cb->Widget = seedWidget;
- cb->Data = this;
- this->Command = cb;
actor->AddObserver( vtkCommand::InteractionEvent, cb );
-*/
+ /* TODO
+ auto cb = vtkSmartPointer< SeedWidgetCallback >::New( );
+ cb->Widget = seedWidget;
+ cb->Data = this;
+ this->Command = cb;
+ */
/* TODO
auto image = actor->GetImage( );
int ori = actor->GetOrientation( );
this->Placer = vtkSmartPointer< _TPlacer >::New( );
this->Handle = vtkSmartPointer< vtkPointHandleRepresentation3D >::New( );
this->Representation = vtkSmartPointer< vtkSeedRepresentation >::New( );
- this->Widget = vtkSmartPointer< _TWidget >::New( );
+ this->Widget = vtkSmartPointer< TWidget >::New( );
this->Placer->SetImageSlice( actor );
this->Handle->GetProperty( )->SetColor( 1, 0, 0 );
auto placer = vtkSmartPointer< _TPlacer >::New( );
auto handle = vtkSmartPointer< vtkPointHandleRepresentation3D >::New( );
auto rep = vtkSmartPointer< vtkSeedRepresentation >::New( );
- auto wdg = vtkSmartPointer< _TWidget >::New( );
+ auto wdg = vtkSmartPointer< TWidget >::New( );
placer->SetImageSlice( actor );
handle->GetProperty( )->SetColor( 1, 0, 0 );
#include <plugins/cpPluginsWidgets_Export.h>
#include <cpPlugins/BaseObjects/Widget.h>
-#include <cpExtensions/Interaction/SeedWidget.h>
#include <cpExtensions/Interaction/ImageSlicePointPlacer.h>
#include <cpExtensions/Visualization/WindowLevelImageActor.h>
#include <vtkImageSlice.h>
#include <vtkSmartPointer.h>
#include <map>
+// -------------------------------------------------------------------------
+namespace cpExtensions { namespace Interaction { class SeedWidget; } }
+
+// -------------------------------------------------------------------------
namespace cpPluginsWidgets
{
/**
cpPluginsObject( SeedWidget, cpPlugins::BaseObjects::Widget, Widgets );
public:
+ typedef cpExtensions::Interaction::SeedWidget TWidget;
typedef cpExtensions::Visualization::WindowLevelImageActor TImageActor;
public:
struct TWidgetData
{
- typedef cpExtensions::Interaction::SeedWidget _TWidget;
typedef cpExtensions::Interaction::ImageSlicePointPlacer _TPlacer;
- vtkSmartPointer< _TWidget > Widget;
+ vtkSmartPointer< TWidget > Widget;
vtkSmartPointer< _TPlacer > Placer;
vtkSmartPointer< vtkPointHandleRepresentation3D > Handle;
vtkSmartPointer< vtkSeedRepresentation > Representation;