-// SALOME VTKViewer : build VTK viewer into Salome desktop
+// Copyright (C) 2007-2016 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 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 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
-//
-// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
+// 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.
//
+// 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
+//
+
+// SALOME VTKViewer : build VTK viewer into Salome desktop
// File : VTKViewer_InteractorStyle.h
// Author : Christophe ATTANASIO
// Module : SALOME
-
+//
#ifndef __VTKViewer_InteractorStyle_h
#define __VTKViewer_InteractorStyle_h
class vtkCell;
class vtkRenderWindowInteractor;
+class vtkTDxInteractorStyle;
-#include <qobject.h>
-#include <qcursor.h>
+#include <QObject>
+#include <QCursor>
+
+class QRubberBand;
#include <map>
#define VTK_INTERACTOR_STYLE_CAMERA_SELECT 6
#define VTK_INTERACTOR_STYLE_CAMERA_GLOBAL_PAN 7
+#ifdef WIN32
+#pragma warning ( disable:4251 )
+#endif
+
/*! Description:\n
* This class must be supplied with a vtkRenderWindowInteractor wrapper or\n
* parent. This class should not normally be instantiated by application\n
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 );
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(float* 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;
- float MotionFactor;
- float 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;
void startRotate();
void startFitArea();
void startSpin();
+ void SetTDxStyle(vtkTDxInteractorStyle *tdxStyle) {}
bool needsRedrawing();
protected:
virtual void onCursorMove(QPoint mousePos);
virtual void setCursor(const int operation);
+ void drawRect();
+ void endDrawRect();
protected:
QCursor myDefCursor;
std::map<int, Handle(VTKViewer_Filter) > myFilters;
+ QRubberBand* myRectBand; //!< selection rectangle rubber band
+
/** @name members from old version*/
//@{
double DeltaElevation;
//@}
};
+#ifdef WIN32
+#pragma warning ( default:4251 )
+#endif
+
#endif