Salome HOME
Qt 5 migration: correction of bugs
[modules/gui.git] / src / OCCViewer / OCCViewer_ViewPort.h
index 48e4dccb0033f1ae317093d7d4694a2e7fbbe95e..ae7b9e6505aabc32a163e50f65cd81e0c1dfc7b0 100755 (executable)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2015  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-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.
+// 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 #ifndef OCCVIEWER_VIEWPORT_H
 #define OCCVIEWER_VIEWPORT_H
 
@@ -55,65 +56,67 @@ public:
   virtual ~OCCViewer_ViewPort();
 
 public:
-  void                          setSketchingEnabled( bool );
+  void                           setSketchingEnabled( bool );
   bool                           isSketchingEnabled() const;
-  void                          setTransformEnabled( bool );
+  void                           setTransformEnabled( bool );
   bool                           isTransformEnabled() const;
 
   virtual QColor                 backgroundColor() const;
   virtual void                   setBackgroundColor( const QColor& );
 
-  void                          redrawPainters();
+  void                           redrawPainters();
 
   virtual void                   onUpdate();
 
+  virtual QPaintEngine*          paintEngine() const;
+
 protected:
-//     enum ViewType { Type2D, Type3D };
-  void                          selectVisualId();
+//      enum ViewType { Type2D, Type3D };
+  void                           selectVisualId();
 
 // EVENTS
   virtual void                   paintEvent( QPaintEvent *);
-  virtual void                  mouseMoveEvent( QMouseEvent *);
-  virtual void                  mouseReleaseEvent( QMouseEvent *);
-  virtual void                  mousePressEvent( QMouseEvent *);
-  virtual void                  mouseDoubleClickEvent( QMouseEvent *);
+  virtual void                   mouseMoveEvent( QMouseEvent *);
+  virtual void                   mouseReleaseEvent( QMouseEvent *);
+  virtual void                   mousePressEvent( QMouseEvent *);
+  virtual void                   mouseDoubleClickEvent( QMouseEvent *);
   virtual void                   keyPressEvent( QKeyEvent *);
   virtual void                   keyReleaseEvent( QKeyEvent *);
 
 // TO BE REDEFINED
-  virtual void                  reset() = 0;
-  virtual void                  pan( int, int ) = 0;
-  virtual void                  setCenter( int, int ) = 0;
-  virtual void                  fitRect( const QRect& ) = 0;
-  virtual void                  zoom( int, int, int, int ) = 0;
-  virtual void                  fitAll( bool keepScale = false, bool withZ = true, bool upd = true ) = 0;
+  virtual void                   reset() = 0;
+  virtual void                   pan( int, int ) = 0;
+  virtual void                   setCenter( int, int ) = 0;
+  virtual void                   fitRect( const QRect& ) = 0;
+  virtual void                   zoom( int, int, int, int ) = 0;
+  virtual void                   fitAll( bool keepScale = false, bool withZ = true, bool upd = true ) = 0;
 
-// POPUP
-//  void                             onCreatePopup( QPopupMenu* );
-//  void                             onDestroyPopup( QPopupMenu* );
+public slots:
+  virtual bool                   synchronize( OCCViewer_ViewPort* );
 
 protected slots:
-  virtual void                  onChangeBgColor();
+  virtual void                   onChangeBackground();
 
 signals:
-  void                          vpKeyEvent( QKeyEvent* );
-  void                          vpMouseEvent( QMouseEvent* );
-  void                          vpDrawExternal( QPainter* );
+  void                           vpKeyEvent( QKeyEvent* );
+  void                           vpMouseEvent( QMouseEvent* );
+  void                           vpDrawExternal( QPainter* );
   void                           vpChangeBGColor( QColor );
+  void                           vpTransformed( OCCViewer_ViewPort* );
 
 private:
-  void                          initialize();
-  void                          cleanup();
+  void                           initialize();
+  void                           cleanup();
 
 protected:
   Handle(Aspect_Window)          myWindow;
-  bool                          myEnableSketching;
-  bool                          myEnableTransform;
-  bool                          myPaintersRedrawing; /* set to draw externally */
+  bool                           myEnableSketching;
+  bool                           myEnableTransform;
+  bool                           myPaintersRedrawing; /* set to draw externally */
   QList<QtxAction*>              myPopupActions;
-
+  
 private:
-  static int                    nCounter; /* objects counter */
+  static int                     nCounter; /* objects counter */
 };
 
 #ifdef WIN32