1 // Copyright (C) 2005 OPEN CASCADE
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License.
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 // Lesser General Public License for more details.
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 // See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
19 // Author : OPEN CASCADE
22 // File: GLViewer_Compass.h
23 // Created: November, 2004
25 #ifndef GLVIEWER_COMPASS_H
26 #define GLVIEWER_COMPASS_H
33 #pragma warning( disable:4251 )
36 /*! Class GLViewer_Compass
37 * Class implement representatiof of compass in one of corner in GLViewer.
38 * Compass it's a some round visual pointer rotated with view window and
39 * located in fixed place (in one fixed corner)
42 class GLViewer_TexFont;
44 class GLVIEWER_API GLViewer_Compass
47 //! Position of compass
58 *\param color - a color of compass
59 *\param size - a diameter of compass
60 *\param pos - a position
61 *\param WidthTop - width of wide part of arrow
62 *\param WidthBottom - width of base part of arrow
63 *\param HeightTop - height of arrow header
64 *\param HeightBottom - height of arrow cut on bottom
66 GLViewer_Compass( const QColor& color = QColor ( 0, 255, 0 ),
68 const Position pos = TopRight,
69 const int WidthTop = 20,
70 const int WidthBottom = 10,
71 const int HeightTop = 25,
72 const int HeightBottom = 7 );
76 //! A function installing main parameters of compass
77 void setCompass( const QColor& color, const int size, const Position pos );
78 //! A function installing a visible status
79 void setVisible( const bool vis = true );
80 //! Returns visible status
81 bool getVisible(){ return myIsVisible; };
83 //! A function installing diameter
84 void setSize( const int size );
86 int getSize(){ return mySize; }
88 //! A function installing position
89 void setPos( const Position pos ){ myPos = pos; }
91 int getPos(){ return myPos; }
93 //! A function installing color
94 void setColor( const QColor& color ){ myCol = color; }
96 QColor getColor(){ return myCol; }
98 //! A function installing width of wide part of arrow
99 void setArrowWidthTop( const int WidthTop );
100 //! Returns width of wide part of arrow
101 int getArrowWidthTop(){ return myArrowWidthTop; }
103 //! A function installing width of base part of arrow
104 void setArrowWidthBottom( const int WidthBot );
105 //! Returns width of base part of arrow
106 int getArrowWidthBottom(){return myArrowWidthBottom;};
108 //! A function installing height of arrow header
109 void setArrowHeightTop( const int HeightTop );
110 //! Returns height of arrow header
111 int getArrowHeightTop(){return myArrowHeightTop;};
113 //! A function installing height of arrow cut on bottom
114 void setArrowHeightBottom( const int HeightBot );
115 //! Returns height of arrow cut on bottom
116 int getArrowHeightBottom(){return myArrowHeightBottom;};
118 //! A function installing
119 void setFont( QFont theFont );
121 GLViewer_TexFont* getFont();
130 //! Compass invisible status
132 //! Width of wide part of arrow
134 //! Width of base part of arrow
135 int myArrowWidthBottom;
136 //! Height of arrow header
137 int myArrowHeightTop;
138 //! Height of arrow cut on bottom
139 int myArrowHeightBottom;
141 GLViewer_TexFont* myFont;
142 //! Status of generated font
147 #pragma warning ( default:4251 )