Salome HOME
0022781: [CEA 1281] Preferences of colors and textures of clipping planes
[modules/gui.git] / src / GLViewer / GLViewer_Viewer2d.h
index 94a5bd254c31ccad656c48106548cca878bde591..3b6ba4b5b038e96b2bf16fe56b6bb67e553dae12 100644 (file)
@@ -1,55 +1,50 @@
-//  Copyright (C) 2005 OPEN CASCADE
+// Copyright (C) 2007-2014  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
-//  version 2.1 of the License.
+// Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-//  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 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.
 //
-//  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
+// 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.
 //
-//  See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
+// 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
 //
-//  Author : OPEN CASCADE
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
+//  Author : OPEN CASCADE
 // File:      GLViewer_Viewer2d.h
 // Created:   November, 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>
 
 #include <GL/gl.h>
 
 class GLViewer_Object;
+class GLViewer_ViewFrame;
+class GLViewer_Drawer;
 class GLViewer_Context;
-class GLViewer_Selector2d;
+class GLViewer_Rect;
 //class GLViewer_Sketcher;
 
 class SUIT_Desktop;
@@ -64,14 +59,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
@@ -120,12 +116,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; }
@@ -143,7 +139,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
@@ -169,7 +165,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();
@@ -180,6 +176,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();
@@ -224,15 +225,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:
@@ -251,7 +248,7 @@ protected:
   static  int          rotateBtn;
 };
 
-#ifdef WNT
+#ifdef WIN32
 #pragma warning ( default:4251 )
 #endif