#include <vtkRenderWindowInteractor.h>
#include <cpExtensions/Visualization/BaseInteractorStyle.h>
+// -------------------------------------------------------------------------
+#define example_BaseInteractorStyle_Macro( x ) \
+ virtual void On##x( ) \
+ { std::cout << "On" << #x << "( )" << std::endl; }
+
+// -------------------------------------------------------------------------
+class example_BaseInteractorStyle
+ : public cpExtensions::Visualization::BaseInteractorStyle
+{
+public:
+ typedef example_BaseInteractorStyle Self;
+ vtkTypeMacro(
+ example_BaseInteractorStyle,
+ cpExtensions::Visualization::BaseInteractorStyle
+ );
+
+public:
+ static Self* New( )
+ { return( new Self ); }
+
+ // Possible events
+ example_BaseInteractorStyle_Macro( MouseMove );
+ example_BaseInteractorStyle_Macro( MouseWheelForward );
+ example_BaseInteractorStyle_Macro( MouseWheelBackward );
+ example_BaseInteractorStyle_Macro( LeftButtonDown );
+ example_BaseInteractorStyle_Macro( LeftButtonUp );
+ example_BaseInteractorStyle_Macro( LeftClick );
+ example_BaseInteractorStyle_Macro( LeftDoubleClick );
+ example_BaseInteractorStyle_Macro( MiddleButtonDown );
+ example_BaseInteractorStyle_Macro( MiddleButtonUp );
+ example_BaseInteractorStyle_Macro( MiddleClick );
+ example_BaseInteractorStyle_Macro( MiddleDoubleClick );
+ example_BaseInteractorStyle_Macro( RightButtonDown );
+ example_BaseInteractorStyle_Macro( RightButtonUp );
+ example_BaseInteractorStyle_Macro( RightClick );
+ example_BaseInteractorStyle_Macro( RightDoubleClick );
+ example_BaseInteractorStyle_Macro( Char );
+ example_BaseInteractorStyle_Macro( KeyDown );
+ example_BaseInteractorStyle_Macro( KeyUp );
+ example_BaseInteractorStyle_Macro( KeyPress );
+ example_BaseInteractorStyle_Macro( KeyRelease );
+ example_BaseInteractorStyle_Macro( Expose );
+ example_BaseInteractorStyle_Macro( Configure );
+ example_BaseInteractorStyle_Macro( Enter );
+ example_BaseInteractorStyle_Macro( Leave );
+
+protected:
+ example_BaseInteractorStyle( )
+ : Superclass( )
+ { }
+ virtual ~example_BaseInteractorStyle( )
+ { }
+
+private:
+ // Purposely not implemented
+ example_BaseInteractorStyle( const Self& );
+ Self& operator=( const Self& );
+};
+
+// -------------------------------------------------------------------------
int main( int argc, char* argv[] )
{
// Configure visualization objects
window->SetSize( 600, 600 );
// Set up interaction style
- typedef cpExtensions::Visualization::BaseInteractorStyle TInteractorStyle;
- vtkSmartPointer< TInteractorStyle > style =
- vtkSmartPointer< TInteractorStyle >::New( );
+ vtkSmartPointer< example_BaseInteractorStyle > style =
+ vtkSmartPointer< example_BaseInteractorStyle >::New( );
// Set up the interaction
vtkSmartPointer< vtkRenderWindowInteractor > interactor =