Salome HOME
PAL10125 - by double click on reference original object becomes selected
[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_Compass
18  * Class implement representatiof of compass in one of corner in GLViewer.
19  * Compass it's a some round visual pointer rotated with view window and 
20  * located in fixed place (in one fixed corner)
21  */
22
23 class GLViewer_TexFont;
24
25 class GLVIEWER_API GLViewer_Compass
26 {
27 public:
28   //! Position of compass
29   enum Position
30   {
31     TopLeft,
32     TopRight,
33     BottomLeft,
34     BottomRight
35   };
36
37   //! A constructor
38   /*!
39   *\param color        - a color of compass
40   *\param size         - a diameter of compass
41   *\param pos          - a position
42   *\param WidthTop     - width of wide part of arrow
43   *\param WidthBottom  - width of base part of arrow
44   *\param HeightTop    - height of arrow header
45   *\param HeightBottom - height of arrow cut on bottom
46   */
47   GLViewer_Compass( const QColor& color = QColor ( 0, 255, 0 ), 
48                    const int size = 60,
49                    const Position pos = TopRight,
50                    const int WidthTop = 20,
51                    const int WidthBottom = 10,
52                    const int HeightTop = 25,
53                    const int HeightBottom = 7 );
54   //! A destructor
55   ~GLViewer_Compass();
56
57   //! A function installing main parameters of compass
58   void              setCompass( const QColor& color, const int size, const Position pos );
59   //! A function installing a visible status
60   void              setVisible( const bool vis = true );
61   //! Returns visible status
62   bool              getVisible(){ return myIsVisible; };
63   
64   //! A function installing diameter
65   void              setSize( const int size );
66   //! Returns diameter
67   int               getSize(){ return mySize; }
68   
69   //! A function installing position
70   void              setPos( const Position pos ){ myPos = pos; }
71   //! Returns position
72   int               getPos(){ return myPos; }
73   
74   //! A function installing color
75   void              setColor( const QColor& color ){ myCol = color; }
76   //! Returns color
77   QColor            getColor(){ return myCol; }
78
79   //! A function installing width of wide part of arrow
80   void              setArrowWidthTop( const int WidthTop );
81   //! Returns width of wide part of arrow
82   int               getArrowWidthTop(){ return myArrowWidthTop; }
83   
84   //! A function installing width of base part of arrow
85   void              setArrowWidthBottom( const int WidthBot );
86   //! Returns width of base part of arrow
87   int               getArrowWidthBottom(){return myArrowWidthBottom;};
88
89   //! A function installing height of arrow header
90   void              setArrowHeightTop( const int HeightTop );
91   //! Returns height of arrow header
92   int               getArrowHeightTop(){return myArrowHeightTop;};
93   
94   //! A function installing height of arrow cut on bottom
95   void              setArrowHeightBottom( const int HeightBot );
96   //! Returns height of arrow cut on bottom
97   int               getArrowHeightBottom(){return myArrowHeightBottom;};        
98   
99   //! A function installing
100   void              setFont( QFont theFont );
101   //! Returns
102   GLViewer_TexFont* getFont();
103
104 protected:
105   //! Compass color
106   QColor             myCol;
107   //! Compass diameter
108   int                mySize;
109   //! Compass position
110   int                myPos;
111   //! Compass invisible status
112   bool               myIsVisible;
113   //! Width of wide part of arrow
114   int                myArrowWidthTop;
115   //! Width of base part of arrow
116   int                myArrowWidthBottom;
117   //! Height of arrow header
118   int                myArrowHeightTop;
119   //! Height of arrow cut on bottom
120   int                myArrowHeightBottom;
121   //! Compass font
122   GLViewer_TexFont*  myFont;
123   //! Status of generated font
124   bool               isGenereted;
125 };
126
127 #ifdef WNT
128 #pragma warning ( default:4251 )
129 #endif
130
131 #endif