Back to index

salome-gui  6.5.0
GLViewer_Compass.h
Go to the documentation of this file.
00001 // Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
00002 //
00003 // Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
00004 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
00005 //
00006 // This library is free software; you can redistribute it and/or
00007 // modify it under the terms of the GNU Lesser General Public
00008 // License as published by the Free Software Foundation; either
00009 // version 2.1 of the License.
00010 //
00011 // This library is distributed in the hope that it will be useful,
00012 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00013 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00014 // Lesser General Public License for more details.
00015 //
00016 // You should have received a copy of the GNU Lesser General Public
00017 // License along with this library; if not, write to the Free Software
00018 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
00019 //
00020 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
00021 //
00022 
00023 //  Author : OPEN CASCADE
00024 // File:      GLViewer_Compass.h
00025 // Created:   November, 2004
00026 //
00027 #ifndef GLVIEWER_COMPASS_H
00028 #define GLVIEWER_COMPASS_H
00029 
00030 #include "GLViewer.h"
00031 
00032 #include <QColor>
00033 
00034 class QFont;
00035 
00036 #ifdef WIN32
00037 #pragma warning( disable:4251 )
00038 #endif
00039 
00040 class GLViewer_TexFont;
00041 
00047 class GLVIEWER_API GLViewer_Compass
00048 {
00049 public:
00051   enum Position
00052   {
00053     TopLeft,
00054     TopRight,
00055     BottomLeft,
00056     BottomRight
00057   };
00058 
00060 
00069   GLViewer_Compass( const QColor& color = QColor ( 0, 255, 0 ), 
00070                    const int size = 60,
00071                    const Position pos = TopRight,
00072                    const int WidthTop = 20,
00073                    const int WidthBottom = 10,
00074                    const int HeightTop = 25,
00075                    const int HeightBottom = 7 );
00077   ~GLViewer_Compass();
00078 
00080   void              setCompass( const QColor& color, const int size, const Position pos );
00082   void              setVisible( const bool vis = true );
00084   bool              getVisible(){ return myIsVisible; };
00085   
00087   void              setSize( const int size );
00089   int               getSize(){ return mySize; }
00090   
00092   void              setPos( const Position pos ){ myPos = pos; }
00094   int               getPos(){ return myPos; }
00095   
00097   void              setColor( const QColor& color ){ myCol = color; }
00099   QColor            getColor(){ return myCol; }
00100 
00102   void              setArrowWidthTop( const int WidthTop );
00104   int               getArrowWidthTop(){ return myArrowWidthTop; }
00105   
00107   void              setArrowWidthBottom( const int WidthBot );
00109   int               getArrowWidthBottom(){return myArrowWidthBottom;};
00110 
00112   void              setArrowHeightTop( const int HeightTop );
00114   int               getArrowHeightTop(){return myArrowHeightTop;};
00115   
00117   void              setArrowHeightBottom( const int HeightBot );
00119   int               getArrowHeightBottom(){return myArrowHeightBottom;};        
00120   
00122   void              setFont( QFont theFont );
00124   GLViewer_TexFont* getFont();
00125 
00126 protected:
00128   QColor             myCol;
00130   int                mySize;
00132   int                myPos;
00134   bool               myIsVisible;
00136   int                myArrowWidthTop;
00138   int                myArrowWidthBottom;
00140   int                myArrowHeightTop;
00142   int                myArrowHeightBottom;
00144   GLViewer_TexFont*  myFont;
00146   bool               isGenereted;
00147 };
00148 
00149 #ifdef WIN32
00150 #pragma warning ( default:4251 )
00151 #endif
00152 
00153 #endif