X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FGLViewer%2FGLViewer_BaseDrawers.cxx;h=f675e769ef2a40f26e61f415396ca9a4db0d8bfb;hb=refs%2Fheads%2Fngr%2Fpython3_dev_pv5.4;hp=85f54061be2f82ee038399bbd751847a4847e239;hpb=4b914be3971471bcd67878b96fbdca12fbc2ac1d;p=modules%2Fgui.git diff --git a/src/GLViewer/GLViewer_BaseDrawers.cxx b/src/GLViewer/GLViewer_BaseDrawers.cxx index 85f54061b..f675e769e 100644 --- a/src/GLViewer/GLViewer_BaseDrawers.cxx +++ b/src/GLViewer/GLViewer_BaseDrawers.cxx @@ -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 +// #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 + +#if !defined(WIN32) && !defined(__APPLE__) #include #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::Iterator it; - QValueList::Iterator EndIt; - QValueList::Iterator anObjectIt = myObjects.begin(); - QValueList::Iterator anEndObjectIt = myObjects.end(); + QList::Iterator it; + QList::Iterator EndIt; + QList::Iterator anObjectIt = myObjects.begin(); + QList::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 aHNumbers, anUHNumbers, aSelNumbers, anUSelNumbers; + QList 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::Iterator aObjectIt = myObjects.begin(); - QValueList::Iterator aObjectEndIt = myObjects.end(); + QList::Iterator aObjectIt = myObjects.begin(); + QList::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::Iterator aObjectIt = myObjects.begin(); - QValueList::Iterator aObjectEndIt = myObjects.end(); + QList::Iterator aObjectIt = myObjects.begin(); + QList::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::Iterator aObjectIt = myObjects.begin(); - QValueList::Iterator aObjectEndIt = myObjects.end(); + QList::Iterator aObjectIt = myObjects.begin(); + QList::Iterator aObjectEndIt = myObjects.end(); for( ; aObjectIt != aObjectEndIt; aObjectIt++ ) (*aObjectIt)->compute(); }