Salome HOME
Issue "0021793: [CEA 625] Clipping : from coordinates or from bounding
[modules/gui.git] / src / OCCViewer / OCCViewer_ViewSketcher.h
index 367ece1042b3ffb142a7256685874911edc09e1b..261f8d54f86c3ca6fe48654b808d843564066fad 100755 (executable)
@@ -1,32 +1,40 @@
-// Copyright (C) 2005  OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
-// 
+// Copyright (C) 2007-2013  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 
+// 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 
+//
+// 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 
+// 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
 //
+
 #ifndef OCCVIEWER_VIEWSKETCHER_H
 #define OCCVIEWER_VIEWSKETCHER_H
 
 #include "OCCViewer.h"
 
-#include <qobject.h>
-#include <qcursor.h>
+#include <QObject>
+#include <QCursor>
+#include <QSize>
 
 class OCCViewer_ViewWindow;
+class QKeyEvent;
+class QMouseEvent;
+class QPolygon;
+
+class QtxRectRubberBand;
+class QtxPolyRubberBand;
 
-#ifdef WNT
+#ifdef WIN32
 #pragma warning ( disable:4251 )
 #endif
 
@@ -49,6 +57,7 @@ public:
   int                          type() const;
   int                          result() const;
   int                          buttonState() const;
+  bool                         isHasShift() const;
   void*                        data() const;
 
   void                         activate();
@@ -80,6 +89,7 @@ protected:
   QCursor                      mySavedCursor;
   QPoint                       myStart, myCurr;
   int                          myButtonState;
+  bool                         myHasShift;
 };
 
 /*!
@@ -98,6 +108,8 @@ protected:
   virtual void                 onSketch( SketchState );
   virtual void                 onActivate();
   virtual void                 onDeactivate();
+ private:
+  QtxRectRubberBand*           mypRectRB;
 };
 
 /*!
@@ -118,19 +130,21 @@ protected:
   virtual void                 onDeactivate();
 
 private:
-  bool                         isValid( const QPointArray*, const QPoint& ) const;
+  bool                         isValid( const QPolygon*, const QPoint& ) const;
   bool                         isIntersect( const QPoint&, const QPoint&,
                                             const QPoint&, const QPoint& ) const;
 
 private:
   bool                         myDbl;
   QSize                        myToler;
-  QPointArray*                 mypPoints;
+  QPolygon*                    mypPoints;
   int                          myAddButton;
   int                          myDelButton;
+  
+  QtxPolyRubberBand*           mypPolyRB;
 };
 
-#ifdef WNT
+#ifdef WIN32
 #pragma warning( default:4251 )
 #endif