#define __VTKViewer_InteractorStyleSALOME_h
#include <vtkInteractorStyle.h>
+
+class vtkCell;
+class vtkRenderWindowInteractor;
+
#include <qobject.h>
#include <qcursor.h>
-#include "SALOME_Actor.h"
+#include "VTKViewer_Filter.h"
+
+class SALOME_Actor;
+class SALOME_CubeAxesActor2D;
+class VTKViewer_Actor;
class VTKViewer_Trihedron;
+class VTKViewer_ViewFrame;
+class VTKViewer_RenderWindowInteractor;
#define VTK_INTERACTOR_STYLE_CAMERA_NONE 0
#define VTK_INTERACTOR_STYLE_CAMERA_ROTATE 1
// parent. This class should not normally be instantiated by application
// programmers.
static VTKViewer_InteractorStyleSALOME *New();
+ vtkTypeMacro(VTKViewer_InteractorStyleSALOME, vtkInteractorStyle);
- void setTriedron(VTKViewer_Trihedron* theTrihedron);
+ virtual void SetInteractor(vtkRenderWindowInteractor *theInteractor);
+ void setViewFrame(VTKViewer_ViewFrame* theViewFrame);
+ void setGUIWindow(QWidget* theWindow);
- vtkTypeMacro(VTKViewer_InteractorStyleSALOME, vtkObject);
- void PrintSelf(ostream& os, vtkIndent indent);
+ void setTriedron(VTKViewer_Trihedron* theTrihedron);
+ void setCubeAxes(SALOME_CubeAxesActor2D* theCubeAxes);
+
+ void setPreselectionProp(const double& theRed = 0, const double& theGreen = 1,
+ const double& theBlue = 1, const int& theWidth = 5);
// Generic event bindings must be overridden in subclasses
void OnMouseMove (int ctrl, int shift, int x, int y);
void OnRightButtonDown(int ctrl, int shift, int x, int y);
void OnRightButtonUp (int ctrl, int shift, int x, int y);
+ void OnSelectionModeChanged();
+
void ViewFitAll();
+ void SetFilter( const Handle(VTKViewer_Filter)& );
+ Handle(VTKViewer_Filter) GetFilter( const int );
+ bool IsFilterPresent( const int );
+ void RemoveFilter( const int );
+ bool IsValid( SALOME_Actor* theActor,
+ const int theId,
+ const bool theIsNode = false );
+
+ void IncrementalPan ( const int incrX, const int incrY );
+ void IncrementalZoom ( const int incr );
+ void IncrementalRotate( const int incrX, const int incrY );
+
protected:
VTKViewer_InteractorStyleSALOME();
~VTKViewer_InteractorStyleSALOME();
float RadianToDegree; // constant: for conv from deg to rad
double myScale;
- SALOME_Actor* preview;
+ SALOME_Actor* myPreViewActor;
+
+ VTKViewer_Actor* myPreSelectionActor;
+ SALOME_Actor* mySelectedActor;
+ int myElemId;
+ int myEdgeId;
+ int myNodeId;
-public:
+ public:
bool eventFilter(QObject* object, QEvent* event);
- void ControlLblSize(double aOldScale, double aNewScale);
void startZoom();
void startPan();
void startGlobalPan();
void startFitArea();
void startSpin();
bool needsRedrawing();
- QWidget* getGUIWindow() {return myGUIWindow;}
- void setGUIWindow(QWidget* theWin) { myGUIWindow = theWin;}
-protected:
+ protected:
void loadCursors();
void startOperation(int operation);
void onStartOperation();
void onCursorMove(QPoint mousePos);
void setCursor(const int operation);
-protected:
- QCursor myDefCursor;
- QCursor myPanCursor;
- QCursor myZoomCursor;
- QCursor myRotateCursor;
- QCursor mySpinCursor;
- QCursor myHandCursor;
- QCursor myGlobalPanCursor;
- QPoint myPoint;
- QPoint myOtherPoint;
- bool myCursorState;
- bool myShiftState;
- int ForcedState;
- VTKViewer_Trihedron* m_Trihedron;
-
- QWidget* myGUIWindow;
+
+ protected:
+ QCursor myDefCursor;
+ QCursor myPanCursor;
+ QCursor myZoomCursor;
+ QCursor myRotateCursor;
+ QCursor mySpinCursor;
+ QCursor myHandCursor;
+ QCursor myGlobalPanCursor;
+ QPoint myPoint;
+ QPoint myOtherPoint;
+ bool myCursorState;
+ bool myShiftState;
+ int ForcedState;
+
+ VTKViewer_RenderWindowInteractor* m_Interactor;
+ VTKViewer_ViewFrame* m_ViewFrame;
+ VTKViewer_Trihedron* m_Trihedron;
+ SALOME_CubeAxesActor2D* m_CubeAxes;
+ QWidget* myGUIWindow;
+
+ std::map<int, Handle(VTKViewer_Filter)> myFilters;
// members from old version
- double DeltaElevation;
- double DeltaAzimuth;
- int LastPos[2];
+ double DeltaElevation;
+ double DeltaAzimuth;
+ int LastPos[2];
};
#endif