#include <vtkPropPicker.h>
#include <vtkSmartPointer.h>
+#include <cpPlugins/Extensions/cpPlugins_Extensions_Export.h>
+
/* TODO
#include <vtkInteractorStyleImage.h>
#include <vtkLineWidget2.h>
class vtkImageData;
*/
+// -------------------------------------------------------------------------
+#define cpPlugins_ImageInteractorStyle_ObserverMacro( e ) \
+ inline unsigned long Add##e##Observer( vtkCommand* observer ) \
+ { return( this->AddObserver( Self::e##Event, observer ) ); } \
+ inline void Remove##e##Observer( unsigned long tag ) \
+ { this->RemoveObserver( tag ); } \
+ inline void Remove##e##Observer( vtkCommand* observer ) \
+ { this->RemoveObserver( observer ); } \
+ inline void Remove##e##Observers( ) \
+ { this->RemoveObservers( Self::e##Event ); }
+
namespace cpPlugins
{
namespace Extensions
/**
*/
- class ImageInteractorStyle
+ class cpPlugins_Extensions_EXPORT ImageInteractorStyle
: public vtkInteractorStyleImage
{
public:
public:
vtkTypeMacro( ImageInteractorStyle, vtkInteractorStyleImage );
+ cpPlugins_ImageInteractorStyle_ObserverMacro( DoubleClick );
+ cpPlugins_ImageInteractorStyle_ObserverMacro( Cursor );
+ cpPlugins_ImageInteractorStyle_ObserverMacro( Radius );
+
public:
static Self* New( );
// New events
virtual void StartCursorMoving( );
virtual void EndCursorMoving( );
+ virtual void StartRadiusMoving( );
+ virtual void EndRadiusMoving( );
protected:
ImageInteractorStyle( );
void _RenderAssociateInteractors( );
bool _PickPosition( double pos[ 3 ] );
void _UpdateCursor( );
+ void _UpdateRadius( );
private:
// Purposely not implemented
std::vector< vtkRenderWindowInteractor* > AssociatedInteractors;
bool CursorMoving;
+ double Cursor[ 3 ];
+
+ bool RadiusMoving;
+ double Radius[ 3 ];
+ vtkSmartPointer< vtkPolyData > Circle;
+ vtkSmartPointer< vtkPolyDataMapper > CircleMapper;
+ vtkSmartPointer< vtkActor > CircleActor;
public:
- static const int SliceEvent;
+ static const int CursorEvent;
+ static const int RadiusEvent;
+ static const int DoubleClickEvent;
};
} // ecapseman