X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FGLViewer%2FGLViewer_Viewer.h;h=2793414782cf075cb862704e83d13ed062e8c30b;hb=797f7c8b3ebf8d8a1eabc9082f8bd79f6f7ea413;hp=ec64dc496d092d1bcd1103c24c7ae88749dbf3eb;hpb=1315eaf2d7e6a45d893dd74fd598798440a6ee0a;p=modules%2Fgui.git diff --git a/src/GLViewer/GLViewer_Viewer.h b/src/GLViewer/GLViewer_Viewer.h index ec64dc496..279341478 100644 --- a/src/GLViewer/GLViewer_Viewer.h +++ b/src/GLViewer/GLViewer_Viewer.h @@ -1,35 +1,61 @@ +// 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 +// +// 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 +// + +// Author : OPEN CASCADE // File: GLViewer_Viewer.h // Created: November, 2004 -// Author: OCC team -// Copyright (C) CEA 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 /*! - * Class GLViewer_Object - * Base Viewer for GLViewer - */ + \class GLViewer_Object + Base Viewer for GLViewer +*/ class GLVIEWER_API GLViewer_Viewer: public SUIT_ViewModel { Q_OBJECT @@ -49,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 ); @@ -109,10 +135,6 @@ protected: GLViewer_ViewTransformer* myTransformer; /* transform manipulator */ }; -/**************************************************************** -** Class: GLViewer_ViewTransformer -** -*****************************************************************/ class GLVIEWER_API GLViewer_ViewTransformer : public QObject { public: @@ -151,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; @@ -165,14 +190,11 @@ protected: bool mySavedMouseTrack; QPoint myStart, myCurr; int myButtonState; - QRect myDrawRect; int myMajorBtn; + + QRubberBand* myRectBand; //!< selection rectangle rubber band }; -/**************************************************************** -** Class: GLViewer_ViewSketcher -** -*****************************************************************/ class GLVIEWER_API GLViewer_ViewSketcher : public QObject { public: @@ -199,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; @@ -207,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