src/GLViewer/GLViewer_Compass.h

Go to the documentation of this file.
00001 //  Copyright (C) 2005 OPEN CASCADE
00002 //
00003 //  This library is free software; you can redistribute it and/or
00004 //  modify it under the terms of the GNU Lesser General Public
00005 //  License as published by the Free Software Foundation; either
00006 //  version 2.1 of the License.
00007 //
00008 //  This library is distributed in the hope that it will be useful,
00009 //  but WITHOUT ANY WARRANTY; without even the implied warranty of
00010 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00011 //  Lesser General Public License for more details.
00012 //
00013 //  You should have received a copy of the GNU Lesser General Public
00014 //  License along with this library; if not, write to the Free Software
00015 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
00016 //
00017 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
00018 //
00019 //  Author : OPEN CASCADE
00020 //
00021 
00022 // File:      GLViewer_Compass.h
00023 // Created:   November, 2004
00024 
00025 #ifndef GLVIEWER_COMPASS_H
00026 #define GLVIEWER_COMPASS_H
00027 
00028 #include "GLViewer.h"
00029 
00030 #include <qcolor.h>
00031 
00032 #ifdef WNT
00033 #pragma warning( disable:4251 )
00034 #endif
00035 
00036 class GLViewer_TexFont;
00037 
00043 class GLVIEWER_API GLViewer_Compass
00044 {
00045 public:
00047   enum Position
00048   {
00049     TopLeft,
00050     TopRight,
00051     BottomLeft,
00052     BottomRight
00053   };
00054 
00056 
00065   GLViewer_Compass( const QColor& color = QColor ( 0, 255, 0 ), 
00066                    const int size = 60,
00067                    const Position pos = TopRight,
00068                    const int WidthTop = 20,
00069                    const int WidthBottom = 10,
00070                    const int HeightTop = 25,
00071                    const int HeightBottom = 7 );
00073   ~GLViewer_Compass();
00074 
00076   void              setCompass( const QColor& color, const int size, const Position pos );
00078   void              setVisible( const bool vis = true );
00080   bool              getVisible(){ return myIsVisible; };
00081   
00083   void              setSize( const int size );
00085   int               getSize(){ return mySize; }
00086   
00088   void              setPos( const Position pos ){ myPos = pos; }
00090   int               getPos(){ return myPos; }
00091   
00093   void              setColor( const QColor& color ){ myCol = color; }
00095   QColor            getColor(){ return myCol; }
00096 
00098   void              setArrowWidthTop( const int WidthTop );
00100   int               getArrowWidthTop(){ return myArrowWidthTop; }
00101   
00103   void              setArrowWidthBottom( const int WidthBot );
00105   int               getArrowWidthBottom(){return myArrowWidthBottom;};
00106 
00108   void              setArrowHeightTop( const int HeightTop );
00110   int               getArrowHeightTop(){return myArrowHeightTop;};
00111   
00113   void              setArrowHeightBottom( const int HeightBot );
00115   int               getArrowHeightBottom(){return myArrowHeightBottom;};        
00116   
00118   void              setFont( QFont theFont );
00120   GLViewer_TexFont* getFont();
00121 
00122 protected:
00124   QColor             myCol;
00126   int                mySize;
00128   int                myPos;
00130   bool               myIsVisible;
00132   int                myArrowWidthTop;
00134   int                myArrowWidthBottom;
00136   int                myArrowHeightTop;
00138   int                myArrowHeightBottom;
00140   GLViewer_TexFont*  myFont;
00142   bool               isGenereted;
00143 };
00144 
00145 #ifdef WNT
00146 #pragma warning ( default:4251 )
00147 #endif
00148 
00149 #endif