-// 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
class vtkCell;
class vtkRenderWindowInteractor;
+class vtkTDxInteractorStyle;
#include <QObject>
#include <QCursor>
{
public:
static VTKViewer_InteractorStyle *New();
- vtkTypeMacro(VTKViewer_InteractorStyle, vtkInteractorStyle);
+ vtkTypeMacro(VTKViewer_InteractorStyle, vtkInteractorStyle)
virtual void SetInteractor(vtkRenderWindowInteractor *theInteractor);
void setViewWnd(VTKViewer_ViewWindow* theViewWnd);
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);
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 );
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);
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);
void startRotate();
void startFitArea();
void startSpin();
+ void SetTDxStyle(vtkTDxInteractorStyle* /*tdxStyle*/) {}
bool needsRedrawing();
protected:
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();