+// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+// Author : OPEN CASCADE
// File: GLViewer_Compass.h
// Created: November, 2004
-// Author: OCC team
-// Copyright (C) CEA 2004
-
+//
#ifndef GLVIEWER_COMPASS_H
#define GLVIEWER_COMPASS_H
#include "GLViewer.h"
-#include <qcolor.h>
+#include <QColor>
+
+class QFont;
-#ifdef WNT
+#ifdef WIN32
#pragma warning( disable:4251 )
#endif
class GLViewer_TexFont;
+/*! Class GLViewer_Compass
+ * Class implement representatiof of compass in one of corner in GLViewer.
+ * Compass it's a some round visual pointer rotated with view window and
+ * located in fixed place (in one fixed corner)
+ */
class GLVIEWER_API GLViewer_Compass
{
public:
- enum Position { TopLeft, TopRight, BottomLeft, BottomRight };
-
- GLViewer_Compass( const QColor& color = QColor ( 0, 255, 0 ),
+ //! Position of compass
+ enum Position
+ {
+ TopLeft,
+ TopRight,
+ BottomLeft,
+ BottomRight
+ };
+
+ //! A constructor
+ /*!
+ *\param color - a color of compass
+ *\param size - a diameter of compass
+ *\param pos - a position
+ *\param WidthTop - width of wide part of arrow
+ *\param WidthBottom - width of base part of arrow
+ *\param HeightTop - height of arrow header
+ *\param HeightBottom - height of arrow cut on bottom
+ */
+ GLViewer_Compass( const QColor& color = QColor ( 0, 255, 0 ),
const int size = 60,
const Position pos = TopRight,
const int WidthTop = 20,
const int WidthBottom = 10,
const int HeightTop = 25,
const int HeightBottom = 7 );
- ~GLViewer_Compass();
-
- void setCompass( const QColor& color, const int size, const Position pos )
- {myCol=color;mySize=size;myPos=pos;};
- void setVisible( const bool vis = true );
- bool getVisible(){ return myIsVisible; };
-
- void setSize( const int size ){mySize=size;};
- int getSize(){ return mySize; };
-
- void setPos( const Position pos ){myPos=pos;};
- int getPos(){ return myPos; };
-
- void setColor( const QColor& color ){myCol=color;};
- QColor getColor(){ return myCol; };
-
- void setArrowWidthTop( const int WidthTop ){ if( WidthTop<myArrowWidthBottom ||
- WidthTop>mySize ) return;
- myArrowWidthTop=WidthTop; };
- int getArrowWidthTop(){return myArrowWidthTop;};
-
- void setArrowWidthBottom( const int WidthBot ){ if( WidthBot>myArrowWidthTop || WidthBot<1 )return;
- myArrowWidthBottom=WidthBot; };
- int getArrowWidthBottom(){return myArrowWidthBottom;};
-
- void setArrowHeightTop( const int HeightTop ){ if( HeightTop>(2*mySize-myArrowHeightBottom ) ||
- HeightTop<1 )return;
- myArrowHeightTop=HeightTop;};
- int getArrowHeightTop(){return myArrowHeightTop;};
-
- void setArrowHeightBottom( const int HeightBot ){ if( HeightBot>( 2*mySize-myArrowHeightTop ) ||
- HeightBot<1)return;
- myArrowHeightBottom=HeightBot;};
- int getArrowHeightBottom(){return myArrowHeightBottom;};
-
- GLViewer_TexFont* getFont();
- void setFont( QFont theFont );
+ //! A destructor
+ ~GLViewer_Compass();
+
+ //! A function installing main parameters of compass
+ void setCompass( const QColor& color, const int size, const Position pos );
+ //! A function installing a visible status
+ void setVisible( const bool vis = true );
+ //! Returns visible status
+ bool getVisible(){ return myIsVisible; };
+
+ //! A function installing diameter
+ void setSize( const int size );
+ //! Returns diameter
+ int getSize(){ return mySize; }
+
+ //! A function installing position
+ void setPos( const Position pos ){ myPos = pos; }
+ //! Returns position
+ int getPos(){ return myPos; }
+
+ //! A function installing color
+ void setColor( const QColor& color ){ myCol = color; }
+ //! Returns color
+ QColor getColor(){ return myCol; }
+
+ //! A function installing width of wide part of arrow
+ void setArrowWidthTop( const int WidthTop );
+ //! Returns width of wide part of arrow
+ int getArrowWidthTop(){ return myArrowWidthTop; }
+
+ //! A function installing width of base part of arrow
+ void setArrowWidthBottom( const int WidthBot );
+ //! Returns width of base part of arrow
+ int getArrowWidthBottom(){return myArrowWidthBottom;};
+
+ //! A function installing height of arrow header
+ void setArrowHeightTop( const int HeightTop );
+ //! Returns height of arrow header
+ int getArrowHeightTop(){return myArrowHeightTop;};
+
+ //! A function installing height of arrow cut on bottom
+ void setArrowHeightBottom( const int HeightBot );
+ //! Returns height of arrow cut on bottom
+ int getArrowHeightBottom(){return myArrowHeightBottom;};
+
+ //! A function installing
+ void setFont( QFont theFont );
+ //! Returns
+ GLViewer_TexFont* getFont();
protected:
- QColor myCol;
- int mySize;
- int myPos;
- bool myIsVisible;
- int myArrowWidthTop;
- int myArrowWidthBottom;
- int myArrowHeightTop;
- int myArrowHeightBottom;
- GLViewer_TexFont* myFont;
- bool isGenereted;
+ //! Compass color
+ QColor myCol;
+ //! Compass diameter
+ int mySize;
+ //! Compass position
+ int myPos;
+ //! Compass invisible status
+ bool myIsVisible;
+ //! Width of wide part of arrow
+ int myArrowWidthTop;
+ //! Width of base part of arrow
+ int myArrowWidthBottom;
+ //! Height of arrow header
+ int myArrowHeightTop;
+ //! Height of arrow cut on bottom
+ int myArrowHeightBottom;
+ //! Compass font
+ GLViewer_TexFont* myFont;
+ //! Status of generated font
+ bool isGenereted;
};
-#ifdef WNT
+#ifdef WIN32
#pragma warning ( default:4251 )
#endif