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