#include <vtkSmartPointer.h>
#include <QCursor>
+#include <QtxRubberBand.h>
#include <map>
#define VTK_INTERACTOR_STYLE_CAMERA_GLOBAL_PAN 7
#define VTK_INTERACTOR_STYLE_CAMERA_SELECT_ROTATION_POINT 8
+enum PolygonState { Disable, Start, InProcess, Finished, Closed, NotValid };
+
//! Introduce SALOME way of user interaction
/*!
This class defines SALOME way of user interaction for VTK viewer, as well,
//! To handle mouse wheel backward event (reimplemented from #vtkInteractorStyle)
virtual void OnMouseWheelBackward();
+ //! To handle mouse button double click event
+ virtual void OnMouseButtonDoubleClick();
+
//! To handle keyboard event (reimplemented from #vtkInteractorStyle)
virtual void OnChar();
SVTK_Selector* GetSelector();
- int CurrentState() const { return State; }
+ int CurrentState() const { return State; }
+ PolygonState GetPolygonState() const { return myPoligonState; }
+ void SetPolygonState( const PolygonState& thePolygonState )
+ { myPoligonState = thePolygonState; }
void SetAdvancedZoomingEnabled( const bool theState ) { myIsAdvancedZoomingEnabled = theState; }
bool IsAdvancedZoomingEnabled() const { return myIsAdvancedZoomingEnabled; }
void drawRect();
void endDrawRect();
+ void drawPolygon();
+ void endDrawPolygon();
protected:
QCursor myDefCursor;
vtkSmartPointer<SVTK_Actor> myHighlightSelectionPointActor;
vtkSmartPointer<vtkPointPicker> myPointPicker;
- double myBBCenter[3];
+ double myBBCenter[3];
bool myBBFirstCheck;
QRubberBand* myRectBand; //!< selection rectangle rubber band
+ QtxPolyRubberBand* myPolygonBand; //!< polygonal selection
+ QVector<QPoint> myPolygonPoints;
+ PolygonState myPoligonState;
bool myIsAdvancedZoomingEnabled;
};