Salome HOME
Upgrade to paraview 5.4
[modules/gui.git] / src / GLViewer / GLViewer_BaseDrawers.cxx
index 85f54061be2f82ee038399bbd751847a4847e239..f675e769ef2a40f26e61f415396ca9a4db0d8bfb 100644 (file)
@@ -1,29 +1,49 @@
+// 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_BaseDrawers.cxx
 // Created:   November, 2004
-// Author:    OCC team
-// Copyright (C) CEA 2004
-
 //#include <GLViewerAfx.h>
+//
 #include "GLViewer_BaseDrawers.h"
 #include "GLViewer_Object.h"
 #include "GLViewer_Text.h"
 #include "GLViewer_AspectLine.h"
 #include "GLViewer_BaseObjects.h"
 
-#ifndef WIN32
+// Qt includes
+#include <QColor>
+
+#if !defined(WIN32) && !defined(__APPLE__)
 #include <GL/glx.h>
 #endif
 
-/***************************************************************************
-**  Class:   GLViewer_MarkerDrawer
-**  Descr:   Drawer for GLViewer_MarkerSet
-**  Module:  GLViewer
-**  Created: UI team, 03.10.01
-****************************************************************************/
-
 GLfloat sin_table[SEGMENTS];
 GLfloat cos_table[SEGMENTS];
 
+/*!
+  Default constructor
+*/
 GLViewer_MarkerDrawer::GLViewer_MarkerDrawer()
 : GLViewer_Drawer()
 {
@@ -37,16 +57,24 @@ GLViewer_MarkerDrawer::GLViewer_MarkerDrawer()
     myObjectType = "GLViewer_MarkerSet";
 }
 
+/*!
+  Destructor
+*/
 GLViewer_MarkerDrawer::~GLViewer_MarkerDrawer()
 {
 }
 
+/*! Draws object in GLViewer
+  \param xScale - current scale along X-direction
+  \param yScale - current scale along Y-direction
+  \param onlyUpdate - = true if only update highlight-select information
+*/
 void GLViewer_MarkerDrawer::create( float xScale, float yScale, bool onlyUpdate )
 {
-    QValueList<int>::Iterator it;
-    QValueList<int>::Iterator EndIt;
-    QValueList<GLViewer_Object*>::Iterator anObjectIt = myObjects.begin();
-    QValueList<GLViewer_Object*>::Iterator anEndObjectIt = myObjects.end();
+    QList<int>::Iterator it;
+    QList<int>::Iterator EndIt;
+    QList<GLViewer_Object*>::Iterator anObjectIt = myObjects.begin();
+    QList<GLViewer_Object*>::Iterator anEndObjectIt = myObjects.end();
 
     myXScale = xScale;
     myYScale = yScale;
@@ -66,7 +94,7 @@ void GLViewer_MarkerDrawer::create( float xScale, float yScale, bool onlyUpdate
         float* anYCoord = aMarkerSet->getYCoord();
         float aRadius = aMarkerSet->getMarkerSize();
 
-        QValueList<int> aHNumbers, anUHNumbers, aSelNumbers, anUSelNumbers;
+        QList<int> aHNumbers, anUHNumbers, aSelNumbers, anUSelNumbers;
         aMarkerSet->exportNumbers( aHNumbers, anUHNumbers, aSelNumbers, anUSelNumbers );
 
         if( onlyUpdate )
@@ -115,6 +143,13 @@ void GLViewer_MarkerDrawer::create( float xScale, float yScale, bool onlyUpdate
     }
 }
 
+/*! Draws marker
+  \param theXCoord - X position
+  \param theYCoord - Y position
+  \param theRadius - radius
+  \param theColor - color
+  \param theAspectLine - line aspect
+*/
 void GLViewer_MarkerDrawer::drawMarker( float& theXCoord, float& theYCoord,
                                      float& theRadius, QColor& theColor, GLViewer_AspectLine* theAspectLine )
 {
@@ -135,27 +170,32 @@ void GLViewer_MarkerDrawer::drawMarker( float& theXCoord, float& theYCoord,
     glEnd();
 }
 
-/***************************************************************************
-**  Class:   GLViewer_PolylineDrawer
-**  Descr:   Drawer for GLViewer_Polyline
-**  Module:  GLViewer
-**  Created: UI team, 03.10.01
-****************************************************************************/
 
+/*!
+  Default constructor
+*/
 GLViewer_PolylineDrawer::GLViewer_PolylineDrawer()
 :GLViewer_Drawer()
 {
     myObjectType = "GLViewer_Polyline";
 }
 
+/*!
+  Destructor
+*/
 GLViewer_PolylineDrawer::~GLViewer_PolylineDrawer()
 {
 }
 
+/*! Draws object in GLViewer
+  \param xScale - current scale along X-direction
+  \param yScale - current scale along Y-direction
+  \param onlyUpdate - = true if only update highlight-select information
+*/
 void GLViewer_PolylineDrawer::create( float xScale, float yScale, bool onlyUpdate )
 {
-    QValueList<GLViewer_Object*>::Iterator aObjectIt = myObjects.begin();
-    QValueList<GLViewer_Object*>::Iterator aObjectEndIt = myObjects.end();
+    QList<GLViewer_Object*>::Iterator aObjectIt = myObjects.begin();
+    QList<GLViewer_Object*>::Iterator aObjectEndIt = myObjects.end();
     
     myXScale = xScale;
     myYScale = yScale;
@@ -220,27 +260,31 @@ void GLViewer_PolylineDrawer::create( float xScale, float yScale, bool onlyUpdat
     }
 }
 
-/***************************************************************************
-**  Class:   GLViewer_TextDrawer
-**  Descr:   
-**  Module:  GLViewer
-**  Created: UI team, 27.02.04
-****************************************************************************/
-
+/*!
+  Default constructor
+*/
 GLViewer_TextDrawer::GLViewer_TextDrawer()
 : GLViewer_Drawer()
 {
     myObjectType = "GLViewer_TextObject";
 }
 
+/*!
+  Destructor
+*/
 GLViewer_TextDrawer::~GLViewer_TextDrawer()
 {
 }
 
+/*! Draws object in GLViewer
+  \param xScale - current scale along X-direction
+  \param yScale - current scale along Y-direction
+  \param onlyUpdate - = true if only update highlight-select information
+*/
 void GLViewer_TextDrawer::create( float xScale, float yScale, bool onlyUpdate )
 {
-    QValueList<GLViewer_Object*>::Iterator aObjectIt = myObjects.begin();
-    QValueList<GLViewer_Object*>::Iterator aObjectEndIt = myObjects.end();
+    QList<GLViewer_Object*>::Iterator aObjectIt = myObjects.begin();
+    QList<GLViewer_Object*>::Iterator aObjectEndIt = myObjects.end();
     
     myXScale = xScale;
     myYScale = yScale;
@@ -278,10 +322,13 @@ void GLViewer_TextDrawer::create( float xScale, float yScale, bool onlyUpdate )
     }
 }
 
+/*!
+  Updates objects after updating font
+*/
 void GLViewer_TextDrawer::updateObjects()
 {
-    QValueList<GLViewer_Object*>::Iterator aObjectIt = myObjects.begin();
-    QValueList<GLViewer_Object*>::Iterator aObjectEndIt = myObjects.end();
+    QList<GLViewer_Object*>::Iterator aObjectIt = myObjects.begin();
+    QList<GLViewer_Object*>::Iterator aObjectEndIt = myObjects.end();
     for( ; aObjectIt != aObjectEndIt; aObjectIt++ )
         (*aObjectIt)->compute();
 }