]> SALOME platform Git repositories - modules/gui.git/blob - src/GLViewer/GLViewer_Compass.h
Salome HOME
new files added
[modules/gui.git] / src / GLViewer / GLViewer_Compass.h
1 // File:      GLViewer_Compass.h
2 // Created:   November, 2004
3 // Author:    OCC team
4 // Copyright (C) CEA 2004
5
6 #ifndef GLVIEWER_COMPASS_H
7 #define GLVIEWER_COMPASS_H
8
9 #include "GLViewer.h"
10
11 #include <qcolor.h>
12
13 #ifdef WNT
14 #pragma warning( disable:4251 )
15 #endif
16
17 class GLViewer_TexFont;
18
19 class GLVIEWER_API GLViewer_Compass
20 {
21 public:
22     enum Position { TopLeft, TopRight, BottomLeft, BottomRight };
23
24     GLViewer_Compass( const QColor& color = QColor ( 0, 255, 0 ), 
25                    const int size = 60,
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 );
31     ~GLViewer_Compass();
32
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; };
37
38     void        setSize( const int size ){mySize=size;};
39     int         getSize(){ return mySize; };
40
41     void        setPos( const Position pos ){myPos=pos;};
42     int         getPos(){ return myPos; };
43
44     void        setColor( const QColor& color ){myCol=color;};
45     QColor      getColor(){ return myCol; };
46
47     void        setArrowWidthTop( const int WidthTop ){ if( WidthTop<myArrowWidthBottom || 
48                                                             WidthTop>mySize ) return;
49                                                         myArrowWidthTop=WidthTop; };
50     int         getArrowWidthTop(){return myArrowWidthTop;};
51
52     void        setArrowWidthBottom( const int WidthBot ){ if( WidthBot>myArrowWidthTop || WidthBot<1 )return;
53                                                            myArrowWidthBottom=WidthBot; };
54     int         getArrowWidthBottom(){return myArrowWidthBottom;};
55
56     void        setArrowHeightTop( const int HeightTop ){ if( HeightTop>(2*mySize-myArrowHeightBottom ) ||
57                                                               HeightTop<1 )return;
58                                                           myArrowHeightTop=HeightTop;};
59     int         getArrowHeightTop(){return myArrowHeightTop;};
60
61     void        setArrowHeightBottom( const int HeightBot ){ if( HeightBot>( 2*mySize-myArrowHeightTop ) ||
62                                                                  HeightBot<1)return;
63                                                           myArrowHeightBottom=HeightBot;};
64     int         getArrowHeightBottom(){return myArrowHeightBottom;};        
65
66     GLViewer_TexFont* getFont();
67     void            setFont( QFont theFont );
68
69 protected:
70     QColor          myCol;
71     int             mySize;
72     int             myPos;
73     bool            myIsVisible;
74     int             myArrowWidthTop;
75     int             myArrowWidthBottom;
76     int             myArrowHeightTop;
77     int             myArrowHeightBottom;
78     GLViewer_TexFont*  myFont;
79     bool            isGenereted;
80 };
81
82 #ifdef WNT
83 #pragma warning ( default:4251 )
84 #endif
85
86 #endif