Salome HOME
Copyright update 2022
[modules/gui.git] / src / VTKViewer / VTKViewer_InteractorStyle.h
index a3e36e0976d54ba93f4a7a240225375dd63bfb0f..8bc79596514325e83cc29ca6f0a7fad64e0a0f79 100644 (file)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2022  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-//  This library is free software; you can redistribute it and/or
-//  modify it under the terms of the GNU Lesser General Public
-//  License as published by the Free Software Foundation; either
-//  version 2.1 of the License.
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
 //
-//  This library is distributed in the hope that it will be useful,
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-//  Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Lesser General Public License for more details.
 //
-//  You should have received a copy of the GNU Lesser General Public
-//  License along with this library; if not, write to the Free Software
-//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 //  SALOME VTKViewer : build VTK viewer into Salome desktop
 //  File   : VTKViewer_InteractorStyle.h
 //  Author : Christophe ATTANASIO
@@ -31,6 +32,7 @@
 
 class vtkCell;
 class vtkRenderWindowInteractor;
+class vtkTDxInteractorStyle;
 
 #include <QObject>
 #include <QCursor>
@@ -70,7 +72,7 @@ class VTKVIEWER_EXPORT VTKViewer_InteractorStyle : public QObject, public vtkInt
 {
  public:
   static VTKViewer_InteractorStyle *New();
-  vtkTypeMacro(VTKViewer_InteractorStyle, vtkInteractorStyle);
+  vtkTypeMacro(VTKViewer_InteractorStyle, vtkInteractorStyle)
 
   virtual void SetInteractor(vtkRenderWindowInteractor *theInteractor);
   void setViewWnd(VTKViewer_ViewWindow* theViewWnd);
@@ -78,7 +80,7 @@ class VTKVIEWER_EXPORT VTKViewer_InteractorStyle : public QObject, public vtkInt
 
   void setTriedron(VTKViewer_Trihedron* theTrihedron);
   void setPreselectionProp(const double& theRed = 0, const double& theGreen = 1,
-                          const double& theBlue = 1, const int& theWidth = 5);
+                           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);
@@ -91,14 +93,15 @@ class VTKVIEWER_EXPORT VTKViewer_InteractorStyle : public QObject, public vtkInt
 
   void OnSelectionModeChanged();
 
-  void  ViewFitAll();
+  void ViewFitAll();
+  void ViewFitSelection();
 
   void                     SetFilter( const Handle( VTKViewer_Filter)& );
   Handle(VTKViewer_Filter) GetFilter( const int );  
   bool                     IsFilterPresent( const int );
   void                     RemoveFilter( const int );
   bool                     IsValid( VTKViewer_Actor* theActor,
-                                    const int     theId,
+                                    const vtkIdType  theId,
                                     const bool    theIsNode = false );
 
   void                     IncrementalPan   ( const int incrX, const int incrY );
@@ -110,7 +113,7 @@ class VTKVIEWER_EXPORT VTKViewer_InteractorStyle : public QObject, public vtkInt
  protected:
   VTKViewer_InteractorStyle();
   ~VTKViewer_InteractorStyle();
-  VTKViewer_InteractorStyle(const VTKViewer_InteractorStyle&) {};
+  VTKViewer_InteractorStyle(const VTKViewer_InteractorStyle&): QObject(), vtkInteractorStyle() {};
   void operator=(const VTKViewer_InteractorStyle&) {};
 
   void RotateXY(int dx, int dy);
@@ -121,25 +124,25 @@ class VTKVIEWER_EXPORT VTKViewer_InteractorStyle : public QObject, public vtkInt
   void Place(const int theX, const int theY);
   void TranslateView(int toX, int toY, int fromX, int fromY);
   bool IsInRect(vtkActor* theActor, 
-               const int left, const int top, 
-               const int right, const int bottom);
+                const int left, const int top, 
+                const int right, const int bottom);
   bool IsInRect(vtkCell* theCell, 
-               const int left, const int top, 
-               const int right, const int bottom);
-  bool IsInRect(vtkFloatingPointType* thePoint, 
-               const int left, const int top, 
-               const int right, const int bottom);
+                const int left, const int top, 
+                const int right, const int bottom);
+  bool IsInRect(double* thePoint, 
+                const int left, const int top, 
+                const int right, const int bottom);
 
   int State;
-  vtkFloatingPointType MotionFactor;
-  vtkFloatingPointType RadianToDegree;                 // constant: for conv from deg to rad
+  double MotionFactor;
+  double RadianToDegree;                 // constant: for conv from deg to rad
   double myScale;
 
   VTKViewer_Actor *myPreViewActor, *myPreSelectionActor, *mySelectedActor;
 
-  int myElemId;
+  vtkIdType myElemId;
   int myEdgeId;
-  int myNodeId;
+  vtkIdType myNodeId;
 
  public:
   bool eventFilter(QObject* object, QEvent* event);
@@ -149,6 +152,7 @@ class VTKVIEWER_EXPORT VTKViewer_InteractorStyle : public QObject, public vtkInt
   void startRotate();
   void startFitArea();
   void startSpin();
+  void SetTDxStyle(vtkTDxInteractorStyle* /*tdxStyle*/) {}
   bool needsRedrawing();
 
  protected:
@@ -157,7 +161,7 @@ class VTKVIEWER_EXPORT VTKViewer_InteractorStyle : public QObject, public vtkInt
   virtual void onStartOperation();
   virtual void onFinishOperation();
   virtual void onOperation(QPoint mousePos);
-  virtual void onCursorMove(QPoint mousePos);
+  virtual void onCursorMove(QPoint /*mousePos*/);
   virtual void setCursor(const int operation);
 
   void drawRect();