#ifndef __CPEXTENSIONS__INTERACTION__IMAGEINTERACTORSTYLE__H__ #define __CPEXTENSIONS__INTERACTION__IMAGEINTERACTORSTYLE__H__ #include #include #include #include #include #include #include #include // Forward definitions class vtkImageActor; namespace cpExtensions { namespace Interaction { /** */ class cpExtensions_EXPORT ImageInteractorStyle : public BaseInteractorStyle { public: typedef ImageInteractorStyle Self; vtkTypeMacro( ImageInteractorStyle, BaseInteractorStyle ); // Callbacks types typedef Superclass::TMouseCommand TMouseCommand; typedef Superclass::TMouseWheelCommand TMouseWheelCommand; typedef Superclass::TKeyCommand TKeyCommand; typedef Superclass::TVoidCommand TVoidCommand; typedef Superclass::TMouseMoveCommand TMouseMoveCommand; typedef Superclass::TMouseClickCommand TMouseClickCommand; typedef Superclass::TMouseDoubleClickCommand TMouseDoubleClickCommand; typedef Superclass::TExposeCommand TExposeCommand; typedef Superclass::TConfigureCommand TConfigureCommand; 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( ); // Data for local picker virtual void AssociateImageActor( vtkImageActor* actor ); protected: ImageInteractorStyle( ); virtual ~ImageInteractorStyle( ); virtual bool _PickPosition( int idx[ 2 ], double pos[ 3 ] ); private: // Purposely not implemented ImageInteractorStyle( const Self& ); Self& operator=( const Self& ); protected: vtkSmartPointer< vtkPropPicker > m_PropPicker; }; } // ecapseman } // ecapseman #endif // __CPEXTENSIONS__INTERACTION__IMAGEINTERACTORSTYLE__H__ // eof - $RCSfile$