+// Copyright (C) 2007-2023 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
-
-/***************************************************************************
-** Class: GLViewer_Viewer
-** Descr: Viewer for QAD-based application
-** Module: QAD
-** Created: UI team, 05.09.00
-****************************************************************************/
+//
#ifndef GLVIEWER_VIEWER_H
#define GLVIEWER_VIEWER_H
+#include "GLViewer.h"
#include "GLViewer_Defs.h"
-#include "GLViewer_ViewFrame.h"
#include <SUIT_ViewModel.h>
-#include <qlist.h>
-#include <qcursor.h>
-#include <qobject.h>
-#include <qpixmap.h>
+#include <QCursor>
+#include <QObject>
+
+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_API GLViewer_Viewer: public SUIT_ViewModel
{
Q_OBJECT
virtual QString getType() const { return Type(); }
static QString Type() { return "GLViewer_ViewModel"; }
- virtual void contextMenuPopup( QPopupMenu* );
+ virtual void contextMenuPopup( QMenu* );
public:
void setSelectionMode( SelectionMode );
GLViewer_ViewTransformer* myTransformer; /* transform manipulator */
};
-/****************************************************************
-** Class: GLViewer_ViewTransformer
-**
-*****************************************************************/
class GLVIEWER_API GLViewer_ViewTransformer : public QObject
{
public:
virtual void onTransform( TransformState );
void initTransform( bool );
+ void drawRect(const QRect& theRect);
+ void endDrawRect();
+
protected:
static int panBtn;
static int zoomBtn;
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:
enum SketchState { Debut, EnTrain, Fin };
virtual void onSketch( SketchState );
+ void drawRect(const QRect& theRect);
+ void endDrawRect();
+
protected:
static int sketchBtn;
GLViewer_Viewer* myViewer;
QCursor mySavedCursor;
QPoint myStart, myCurr;
int myButtonState;
+
+ QRubberBand* myRectBand; //!< selection rectangle rubber band
};
-#ifdef WNT
+#ifdef WIN32
#pragma warning ( default:4251 )
#endif