Salome HOME
Python3 porting: analytical curves in the Plot2D Viewer.
[modules/gui.git] / src / GLViewer / GLViewer_Viewer2d.h
index 289d1e141b040a291e4739836e1a6558be15a6f6..9cafb3bdca1209b2881c9364d73703e93fce3e36 100644 (file)
@@ -1,36 +1,54 @@
+// 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_Viewer2d.h
 // Created:   November, 2004
-// Author:    OCC team
-// Copyright (C) CEA 2004
-
-/***************************************************************************
-**  Class:   GLViewer_Viewer2d
-**  Descr:   OpenGL Viewer 2D
-**  Module:  GLViewer
-**  Created: UI team, 04.09.04
-****************************************************************************/
+//
 #ifndef GLVIEWER_VIEWER2D_H
 #define GLVIEWER_VIEWER2D_H
 
-#ifdef WNT
+#ifdef WIN32
 #include <windows.h>
 #endif
 
-#include <qmap.h>
-#include <qrect.h>
+class QRect;
+class QFile;
 
 #include "GLViewer_Viewer.h"
-#include "GLViewer_Object.h"
-#include "GLViewer_ViewFrame.h"
-#include "GLViewer_Drawer.h"
 
 #include <TColStd_SequenceOfInteger.hxx>
 
+#ifdef __APPLE__
+#include <OpenGL/gl.h>
+#else
 #include <GL/gl.h>
+#endif
 
 class GLViewer_Object;
+class GLViewer_ViewFrame;
+class GLViewer_Drawer;
 class GLViewer_Context;
-class GLViewer_Selector2d;
+class GLViewer_Rect;
 //class GLViewer_Sketcher;
 
 class SUIT_Desktop;
@@ -45,14 +63,15 @@ const double Sizes[2*5] = {
     /* A5 */ 148.5, 210.0
 };
 
-#ifdef WNT
+#ifdef WIN32
 #pragma warning( disable:4251 )
 #endif
 
-/*! 
- * Class GLViewer_Object
- * 2D viewer for GLViewer
- */
+/*!
+  \class GLViewer_Viewer2d
+  OpenGL Viewer 2D
+*/
+
 class GLVIEWER_API GLViewer_Viewer2d : public GLViewer_Viewer
 {
   Q_OBJECT
@@ -101,12 +120,12 @@ public:
   virtual SUIT_ViewWindow*  createView( SUIT_Desktop* );
   
   //! Adds item for change background color
-  void                 addPopupItems( QPopupMenu* );
+  void                 addPopupItems( QMenu* );
 
   //void                activateGLSketching( int );
 
   //! Returns all drawers
-  const QValueList<GLViewer_Drawer*>& getDrawers() const { return myDrawers; }
+  const QList<GLViewer_Drawer*>& getDrawers() const { return myDrawers; }
   
   //! Returns context
   GLViewer_Context*    getGLContext() const { return myGLContext; }
@@ -124,7 +143,7 @@ public:
   /* \param onlyUpdate is passed to method activateAllDrawersdrawers*/
   void                 updateDrawers( GLboolean onlyUpdate, GLfloat scX = 0.0, GLfloat scY = 0.0 );
   //! Activates drawers for objects from list \param theObjects only
-  void                 activateDrawers( QValueList<GLViewer_Object*>& theObjects, bool onlyUpdate, GLboolean swap = GL_FALSE );
+  void                 activateDrawers( QList<GLViewer_Object*>& theObjects, bool onlyUpdate, GLboolean swap = GL_FALSE );
   //! Activates drawer for \param theObject
   void                 activateDrawer( GLViewer_Object* theObject, bool onlyUpdate, GLboolean swap = GL_FALSE );
   //! Updates all drawers with new scale factor
@@ -150,7 +169,7 @@ public:
    * output paper size \param aPType, with margins in mm
   */
   virtual bool         translateTo( VectorFileType aType, QString FileName, PaperType aPType, 
-                                  double mmLeft, double mmRight, double mmTop, double mmBottom );
+                                   double mmLeft, double mmRight, double mmTop, double mmBottom );
     
   //bool                 isSketchingActive();
   //int                  getSketchingType();
@@ -161,6 +180,11 @@ public:
   //! Repaints view \param theView. If \param theView = NULL repaints all views.
   void                 repaintView( GLViewer_ViewFrame* theView = NULL, bool makeCurrent = false );
 
+signals:
+  //! Signal needs for optimum recompute of zoom depending objects
+  //! Warning: use recompute without update viewer
+  void                 wheelZoomChange( bool );
+
 public slots:
   //void                 onSketchDelObject();
   //void                 onSketchUndoLast();
@@ -205,15 +229,11 @@ protected:
   //! Current context 
   GLViewer_Context*             myGLContext;
   //! Map of active drawers
-  QValueList<GLViewer_Drawer*>  myDrawers;
+  QList<GLViewer_Drawer*>  myDrawers;
   
   //GLViewer_Sketcher*   myGLSketcher;
 };
 
-/****************************************************************
-**  Class: GLViewer_View2dTransformer
-**
-*****************************************************************/
 class GLVIEWER_API GLViewer_View2dTransformer : public GLViewer_ViewTransformer
 {
 public:
@@ -232,7 +252,7 @@ protected:
   static  int          rotateBtn;
 };
 
-#ifdef WNT
+#ifdef WIN32
 #pragma warning ( default:4251 )
 #endif