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_TexFont;
38 /*! Class GLViewer_Compass
39 * Class implement representatiof of compass in one of corner in GLViewer.
40 * Compass it's a some round visual pointer rotated with view window and
41 * located in fixed place (in one fixed corner)
43 class GLVIEWER_API GLViewer_Compass
46 //! Position of compass
57 *\param color - a color of compass
58 *\param size - a diameter of compass
59 *\param pos - a position
60 *\param WidthTop - width of wide part of arrow
61 *\param WidthBottom - width of base part of arrow
62 *\param HeightTop - height of arrow header
63 *\param HeightBottom - height of arrow cut on bottom
65 GLViewer_Compass( const QColor& color = QColor ( 0, 255, 0 ),
67 const Position pos = TopRight,
68 const int WidthTop = 20,
69 const int WidthBottom = 10,
70 const int HeightTop = 25,
71 const int HeightBottom = 7 );
75 //! A function installing main parameters of compass
76 void setCompass( const QColor& color, const int size, const Position pos );
77 //! A function installing a visible status
78 void setVisible( const bool vis = true );
79 //! Returns visible status
80 bool getVisible(){ return myIsVisible; };
82 //! A function installing diameter
83 void setSize( const int size );
85 int getSize(){ return mySize; }
87 //! A function installing position
88 void setPos( const Position pos ){ myPos = pos; }
90 int getPos(){ return myPos; }
92 //! A function installing color
93 void setColor( const QColor& color ){ myCol = color; }
95 QColor getColor(){ return myCol; }
97 //! A function installing width of wide part of arrow
98 void setArrowWidthTop( const int WidthTop );
99 //! Returns width of wide part of arrow
100 int getArrowWidthTop(){ return myArrowWidthTop; }
102 //! A function installing width of base part of arrow
103 void setArrowWidthBottom( const int WidthBot );
104 //! Returns width of base part of arrow
105 int getArrowWidthBottom(){return myArrowWidthBottom;};
107 //! A function installing height of arrow header
108 void setArrowHeightTop( const int HeightTop );
109 //! Returns height of arrow header
110 int getArrowHeightTop(){return myArrowHeightTop;};
112 //! A function installing height of arrow cut on bottom
113 void setArrowHeightBottom( const int HeightBot );
114 //! Returns height of arrow cut on bottom
115 int getArrowHeightBottom(){return myArrowHeightBottom;};
117 //! A function installing
118 void setFont( QFont theFont );
120 GLViewer_TexFont* getFont();
129 //! Compass invisible status
131 //! Width of wide part of arrow
133 //! Width of base part of arrow
134 int myArrowWidthBottom;
135 //! Height of arrow header
136 int myArrowHeightTop;
137 //! Height of arrow cut on bottom
138 int myArrowHeightBottom;
140 GLViewer_TexFont* myFont;
141 //! Status of generated font
146 #pragma warning ( default:4251 )