1 // File: GLViewer_Compass.h
2 // Created: November, 2004
4 // Copyright (C) CEA 2004
6 #ifndef GLVIEWER_COMPASS_H
7 #define GLVIEWER_COMPASS_H
14 #pragma warning( disable:4251 )
17 class GLViewer_TexFont;
19 class GLVIEWER_API GLViewer_Compass
22 enum Position { TopLeft, TopRight, BottomLeft, BottomRight };
24 GLViewer_Compass( const QColor& color = QColor ( 0, 255, 0 ),
26 const Position pos = TopRight,
27 const int WidthTop = 20,
28 const int WidthBottom = 10,
29 const int HeightTop = 25,
30 const int HeightBottom = 7 );
33 void setCompass( const QColor& color, const int size, const Position pos )
34 {myCol=color;mySize=size;myPos=pos;};
35 void setVisible( const bool vis = true );
36 bool getVisible(){ return myIsVisible; };
38 void setSize( const int size ){mySize=size;};
39 int getSize(){ return mySize; };
41 void setPos( const Position pos ){myPos=pos;};
42 int getPos(){ return myPos; };
44 void setColor( const QColor& color ){myCol=color;};
45 QColor getColor(){ return myCol; };
47 void setArrowWidthTop( const int WidthTop ){ if( WidthTop<myArrowWidthBottom ||
48 WidthTop>mySize ) return;
49 myArrowWidthTop=WidthTop; };
50 int getArrowWidthTop(){return myArrowWidthTop;};
52 void setArrowWidthBottom( const int WidthBot ){ if( WidthBot>myArrowWidthTop || WidthBot<1 )return;
53 myArrowWidthBottom=WidthBot; };
54 int getArrowWidthBottom(){return myArrowWidthBottom;};
56 void setArrowHeightTop( const int HeightTop ){ if( HeightTop>(2*mySize-myArrowHeightBottom ) ||
58 myArrowHeightTop=HeightTop;};
59 int getArrowHeightTop(){return myArrowHeightTop;};
61 void setArrowHeightBottom( const int HeightBot ){ if( HeightBot>( 2*mySize-myArrowHeightTop ) ||
63 myArrowHeightBottom=HeightBot;};
64 int getArrowHeightBottom(){return myArrowHeightBottom;};
66 GLViewer_TexFont* getFont();
67 void setFont( QFont theFont );
75 int myArrowWidthBottom;
77 int myArrowHeightBottom;
78 GLViewer_TexFont* myFont;
83 #pragma warning ( default:4251 )