-// Copyright (C) 2005 OPEN CASCADE
+// Copyright (C) 2007-2016 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_Compass.cxx
// Created: November, 2004
-
-//================================================================
-// Class : GLViewer_Compass
-// Description : Class implement representatiof of compass in one of corner in GLViewer
-//================================================================
-
+//
#include "GLViewer_Compass.h"
#include "GLViewer_Drawer.h"
-//=======================================================================
-// Function: GLViewer_Compass
-// Purpose :
-//=======================================================================
+/*!
+ Constructor
+ \param color - a color of compass
+ \param size - a diameter of compass
+ \param pos - a position
+ \param WidthTop - width of wide part of arrow
+ \param WidthBottom - width of base part of arrow
+ \param HeightTop - height of arrow header
+ \param HeightBottom - height of arrow cut on bottom
+*/
GLViewer_Compass::GLViewer_Compass ( const QColor& color, const int size, const Position pos,
const int WidthTop, const int WidthBottom, const int HeightTop,
const int HeightBottom )
//myFont->generateTexture();
}
-//=======================================================================
-// Function: ~GLViewer_Compass
-// Purpose :
-//=======================================================================
+/*!
+ Destructor
+*/
GLViewer_Compass::~GLViewer_Compass()
{
delete myFont;
}
-//=======================================================================
-// Function: setCompass
-// Purpose :
-//=======================================================================
+/*!
+ Sets parameters of compass
+ \param color - a color of compass
+ \param size - a diameter of compass
+ \param pos - a position
+*/
void GLViewer_Compass::setCompass( const QColor& color, const int size, const Position pos )
{
myCol = color;
myPos = pos;
}
-//=======================================================================
-// Function: setVisible
-// Purpose :
-//=======================================================================
+/*!
+ Sets visibility of compass
+ \param vis - new visibility state
+*/
void GLViewer_Compass::setVisible( const bool vis )
{
myIsVisible = vis;
}
-//=======================================================================
-// Function: setSize
-// Purpose :
-//=======================================================================
+/*!
+ Sets size of compass
+ \param size - new size
+*/
void GLViewer_Compass::setSize( const int size )
{
if( size > 0 )
mySize=size;
}
-//=======================================================================
-// Function: setArrowWidthTop
-// Purpose :
-//=======================================================================
+/*!
+ Sets arrow width top
+ \param WidthTop - new arrow width top
+*/
void GLViewer_Compass::setArrowWidthTop( const int WidthTop )
{
if( WidthTop < myArrowWidthBottom || WidthTop > mySize )
myArrowWidthTop=WidthTop;
}
-//=======================================================================
-// Function: setArrowWidthBottom
-// Purpose :
-//=======================================================================
+/*!
+ Sets arrow width bottom
+ \param WidthBot - new arrow width bottom
+*/
void GLViewer_Compass::setArrowWidthBottom( const int WidthBot )
{
if( WidthBot > myArrowWidthTop || WidthBot < 1 )
- return;
+ return;
myArrowWidthBottom=WidthBot;
}
-//=======================================================================
-// Function: setArrowHeightTop
-// Purpose :
-//=======================================================================
+/*!
+ Sets arrow height top
+ \param HeightTop - new arrow height top
+*/
void GLViewer_Compass::setArrowHeightTop( const int HeightTop )
{
if( HeightTop > (2*mySize-myArrowHeightBottom ) || HeightTop < 1 )
myArrowHeightTop=HeightTop;
}
-//=======================================================================
-// Function: setArrowHeightBottom
-// Purpose :
-//=======================================================================
+/*!
+ Sets arrow height bottom
+ \param HeightBot - new arrow height bottom
+*/
void GLViewer_Compass::setArrowHeightBottom( const int HeightBot )
{
if( HeightBot > ( 2*mySize-myArrowHeightTop ) || HeightBot < 1)
myArrowHeightBottom=HeightBot;
}
-//=======================================================================
-// Function: getFont
-// Purpose :
-//=======================================================================
+/*!
+ \return font of compass
+*/
GLViewer_TexFont* GLViewer_Compass::getFont()
{
if(!isGenereted)
return myFont;
}
-//=======================================================================
-// Function: setFont
-// Purpose :
-//=======================================================================
+/*!
+ Sets font of compass
+ \param theFont - new font
+*/
void GLViewer_Compass::setFont( QFont theFont )
{
delete myFont;