X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;ds=inline;f=src%2FGLViewer%2FGLViewer_Compass.cxx;h=2a54f5d8c565fbe3738aa4f5f6bba07c558946ca;hb=e6450922454677530835b4769b0e0e3eb16ace51;hp=919641e7c277e0255c94638cf517357836e4cb08;hpb=28124bc2dd22481a5a915b2b96b835ef5323a6f6;p=modules%2Fgui.git diff --git a/src/GLViewer/GLViewer_Compass.cxx b/src/GLViewer/GLViewer_Compass.cxx index 919641e7c..2a54f5d8c 100644 --- a/src/GLViewer/GLViewer_Compass.cxx +++ b/src/GLViewer/GLViewer_Compass.cxx @@ -1,39 +1,42 @@ -// 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 ) @@ -52,19 +55,20 @@ GLViewer_Compass::GLViewer_Compass ( const QColor& color, const int size, const //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; @@ -72,29 +76,29 @@ void GLViewer_Compass::setCompass( const QColor& color, const int size, const Po 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 ) @@ -102,21 +106,21 @@ void GLViewer_Compass::setArrowWidthTop( const int WidthTop ) 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 ) @@ -124,10 +128,10 @@ void GLViewer_Compass::setArrowHeightTop( const int HeightTop ) 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) @@ -135,10 +139,9 @@ void GLViewer_Compass::setArrowHeightBottom( const int HeightBot ) myArrowHeightBottom=HeightBot; } -//======================================================================= -// Function: getFont -// Purpose : -//======================================================================= +/*! + \return font of compass +*/ GLViewer_TexFont* GLViewer_Compass::getFont() { if(!isGenereted) @@ -149,10 +152,10 @@ GLViewer_TexFont* GLViewer_Compass::getFont() return myFont; } -//======================================================================= -// Function: setFont -// Purpose : -//======================================================================= +/*! + Sets font of compass + \param theFont - new font +*/ void GLViewer_Compass::setFont( QFont theFont ) { delete myFont;