X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2FGLViewer%2FGLViewer_Viewer.h;h=2793414782cf075cb862704e83d13ed062e8c30b;hb=b4b6774a2b1d624b591a3958c4bde0faec806d88;hp=fa6a36f35e9a6ac5bb287829e32d39ddbbdb8394;hpb=aa05f2a1b23a54321ea7248ae9ac3463652c734e;p=modules%2Fgui.git diff --git a/src/GLViewer/GLViewer_Viewer.h b/src/GLViewer/GLViewer_Viewer.h index fa6a36f35..279341478 100644 --- a/src/GLViewer/GLViewer_Viewer.h +++ b/src/GLViewer/GLViewer_Viewer.h @@ -1,47 +1,54 @@ -// Copyright (C) 2005 OPEN CASCADE +// Copyright (C) 2007-2016 CEA/DEN, EDF R&D, OPEN CASCADE // -// 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. +// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS // -// 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 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. // -// 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 +// 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. // -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// 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 // -// Author : OPEN CASCADE +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // +// Author : OPEN CASCADE // File: GLViewer_Viewer.h // Created: November, 2004 - +// #ifndef GLVIEWER_VIEWER_H #define GLVIEWER_VIEWER_H +#include "GLViewer.h" #include "GLViewer_Defs.h" -#include "GLViewer_ViewFrame.h" #include -#include -#include -#include -#include +#include +#include + +class QMouseEvent; +class QKeyEvent; +class QWheelEvent; +class QRect; +class QRubberBand; class GLViewer_Selector; class GLViewer_ViewSketcher; class GLViewer_ViewTransformer; +class GLViewer_ViewFrame; -class SUIT_Desktop; +//class SUIT_Desktop; class SUIT_ViewWindow; -#ifdef WNT +#ifdef WIN32 #pragma warning( disable:4251 ) #endif @@ -68,7 +75,7 @@ public: virtual QString getType() const { return Type(); } static QString Type() { return "GLViewer_ViewModel"; } - virtual void contextMenuPopup( QPopupMenu* ); + virtual void contextMenuPopup( QMenu* ); public: void setSelectionMode( SelectionMode ); @@ -166,6 +173,9 @@ protected: virtual void onTransform( TransformState ); void initTransform( bool ); + void drawRect(const QRect& theRect); + void endDrawRect(); + protected: static int panBtn; static int zoomBtn; @@ -180,8 +190,9 @@ protected: bool mySavedMouseTrack; QPoint myStart, myCurr; int myButtonState; - QRect myDrawRect; int myMajorBtn; + + QRubberBand* myRectBand; //!< selection rectangle rubber band }; class GLVIEWER_API GLViewer_ViewSketcher : public QObject @@ -210,6 +221,9 @@ protected: enum SketchState { Debut, EnTrain, Fin }; virtual void onSketch( SketchState ); + void drawRect(const QRect& theRect); + void endDrawRect(); + protected: static int sketchBtn; GLViewer_Viewer* myViewer; @@ -218,9 +232,11 @@ protected: QCursor mySavedCursor; QPoint myStart, myCurr; int myButtonState; + + QRubberBand* myRectBand; //!< selection rectangle rubber band }; -#ifdef WNT +#ifdef WIN32 #pragma warning ( default:4251 ) #endif