+// Copyright (C) 2007-2014 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"
+// Qt includes
+#include <QColor>
+
+
#ifndef WIN32
#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()
{
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;
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 )
}
}
+/*! 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 )
{
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;
}
}
-/***************************************************************************
-** 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;
}
}
+/*!
+ 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();
}