X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FGLViewer%2FGLViewer_Compass.h;h=abdec0e01fe1682050fe4f9ebad372e0c59bb33e;hb=9df1d8c9a65355b6469fd87c02a89235d674fd9b;hp=0d03856f6149dc02a31cd13e8a8cff0177d4ce05;hpb=4b914be3971471bcd67878b96fbdca12fbc2ac1d;p=modules%2Fgui.git diff --git a/src/GLViewer/GLViewer_Compass.h b/src/GLViewer/GLViewer_Compass.h index 0d03856f6..abdec0e01 100644 --- a/src/GLViewer/GLViewer_Compass.h +++ b/src/GLViewer/GLViewer_Compass.h @@ -1,7 +1,26 @@ +// Copyright (C) 2005 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. +// +// 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.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// +// Author : OPEN CASCADE +// + // File: GLViewer_Compass.h // Created: November, 2004 -// Author: OCC team -// Copyright (C) CEA 2004 #ifndef GLVIEWER_COMPASS_H #define GLVIEWER_COMPASS_H @@ -14,69 +33,114 @@ #pragma warning( disable:4251 ) #endif +/*! Class GLViewer_Compass + * Class implement representatiof of compass in one of corner in GLViewer. + * Compass it's a some round visual pointer rotated with view window and + * located in fixed place (in one fixed corner) + */ + class GLViewer_TexFont; class GLVIEWER_API GLViewer_Compass { public: - enum Position { TopLeft, TopRight, BottomLeft, BottomRight }; - - GLViewer_Compass( const QColor& color = QColor ( 0, 255, 0 ), + //! Position of compass + enum Position + { + TopLeft, + TopRight, + BottomLeft, + BottomRight + }; + + //! A 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( const QColor& color = QColor ( 0, 255, 0 ), const int size = 60, const Position pos = TopRight, const int WidthTop = 20, const int WidthBottom = 10, const int HeightTop = 25, const int HeightBottom = 7 ); - ~GLViewer_Compass(); - - void setCompass( const QColor& color, const int size, const Position pos ) - {myCol=color;mySize=size;myPos=pos;}; - void setVisible( const bool vis = true ); - bool getVisible(){ return myIsVisible; }; - - void setSize( const int size ){mySize=size;}; - int getSize(){ return mySize; }; - - void setPos( const Position pos ){myPos=pos;}; - int getPos(){ return myPos; }; - - void setColor( const QColor& color ){myCol=color;}; - QColor getColor(){ return myCol; }; - - void setArrowWidthTop( const int WidthTop ){ if( WidthTopmySize ) return; - myArrowWidthTop=WidthTop; }; - int getArrowWidthTop(){return myArrowWidthTop;}; - - void setArrowWidthBottom( const int WidthBot ){ if( WidthBot>myArrowWidthTop || WidthBot<1 )return; - myArrowWidthBottom=WidthBot; }; - int getArrowWidthBottom(){return myArrowWidthBottom;}; - - void setArrowHeightTop( const int HeightTop ){ if( HeightTop>(2*mySize-myArrowHeightBottom ) || - HeightTop<1 )return; - myArrowHeightTop=HeightTop;}; - int getArrowHeightTop(){return myArrowHeightTop;}; - - void setArrowHeightBottom( const int HeightBot ){ if( HeightBot>( 2*mySize-myArrowHeightTop ) || - HeightBot<1)return; - myArrowHeightBottom=HeightBot;}; - int getArrowHeightBottom(){return myArrowHeightBottom;}; - - GLViewer_TexFont* getFont(); - void setFont( QFont theFont ); + //! A destructor + ~GLViewer_Compass(); + + //! A function installing main parameters of compass + void setCompass( const QColor& color, const int size, const Position pos ); + //! A function installing a visible status + void setVisible( const bool vis = true ); + //! Returns visible status + bool getVisible(){ return myIsVisible; }; + + //! A function installing diameter + void setSize( const int size ); + //! Returns diameter + int getSize(){ return mySize; } + + //! A function installing position + void setPos( const Position pos ){ myPos = pos; } + //! Returns position + int getPos(){ return myPos; } + + //! A function installing color + void setColor( const QColor& color ){ myCol = color; } + //! Returns color + QColor getColor(){ return myCol; } + + //! A function installing width of wide part of arrow + void setArrowWidthTop( const int WidthTop ); + //! Returns width of wide part of arrow + int getArrowWidthTop(){ return myArrowWidthTop; } + + //! A function installing width of base part of arrow + void setArrowWidthBottom( const int WidthBot ); + //! Returns width of base part of arrow + int getArrowWidthBottom(){return myArrowWidthBottom;}; + + //! A function installing height of arrow header + void setArrowHeightTop( const int HeightTop ); + //! Returns height of arrow header + int getArrowHeightTop(){return myArrowHeightTop;}; + + //! A function installing height of arrow cut on bottom + void setArrowHeightBottom( const int HeightBot ); + //! Returns height of arrow cut on bottom + int getArrowHeightBottom(){return myArrowHeightBottom;}; + + //! A function installing + void setFont( QFont theFont ); + //! Returns + GLViewer_TexFont* getFont(); protected: - QColor myCol; - int mySize; - int myPos; - bool myIsVisible; - int myArrowWidthTop; - int myArrowWidthBottom; - int myArrowHeightTop; - int myArrowHeightBottom; - GLViewer_TexFont* myFont; - bool isGenereted; + //! Compass color + QColor myCol; + //! Compass diameter + int mySize; + //! Compass position + int myPos; + //! Compass invisible status + bool myIsVisible; + //! Width of wide part of arrow + int myArrowWidthTop; + //! Width of base part of arrow + int myArrowWidthBottom; + //! Height of arrow header + int myArrowHeightTop; + //! Height of arrow cut on bottom + int myArrowHeightBottom; + //! Compass font + GLViewer_TexFont* myFont; + //! Status of generated font + bool isGenereted; }; #ifdef WNT