Salome HOME
New item (FontItem), allowing to show information about font setting and to select...
[modules/gui.git] / src / GLViewer / GLViewer_AspectLine.h
1 // File:      GLViewer_AspectLine.h
2 // Created:   November, 2004
3 // Author:    OCC team
4 // Copyright (C) CEA 2004
5
6 #ifndef GLVIEWER_ASPECTLINE_H
7 #define GLVIEWER_ASPECTLINE_H
8
9 #include "GLViewer.h"
10
11 #include <qcolor.h>
12
13 #ifdef WNT
14 #pragma warning( disable:4251 )
15 #endif
16
17 /*! 
18  * Class GLViewer_AspectLine
19  * Substitution of Prs2d_AspectLine for OpenGL
20  */
21
22 class GLVIEWER_API GLViewer_AspectLine 
23 {
24 public:
25   //! A default constructor
26   /* Line is Non strip
27    * Normal color is white
28    * Highlight color is cyan
29    * Select color is red
30   */
31   GLViewer_AspectLine();
32   //! A conctructor by type and width of line
33   /*!
34    \param theType equals 0 for normal line and 1 for strip line
35    \param theWidth is a width of new line
36   */
37   GLViewer_AspectLine( int theType, float theWidth );
38
39   //! A destructor
40   ~GLViewer_AspectLine();
41   
42   //! A function for installing the line colors
43   /*!
44    \param nc is normal color
45    \param hc is highlight color
46    \param sc is select color
47   */
48   void                  setLineColors( QColor nc = Qt::black,
49                                        QColor hc = Qt::cyan,
50                                        QColor sc = Qt::red );
51   //! A function for installing the line width
52   int                   setLineWidth( const float theWidth );
53   //! A function for installing the line type
54   /*!
55    \param theType equals 0 for normal line and 1 for strip line
56   */
57   int                   setLineType( const int theType );
58
59   //! A function for getting line colors information
60   /*!
61    \param theNC is normal color
62    \param theHC is highlight color
63    \param theSC is select color
64   */
65   void                  getLineColors( QColor& theNC, QColor& theHC, QColor& theSC ) const;
66   //! A function for getting information about line width
67   float                 getLineWidth() const { return myLineWidth; };
68   //! A function for getting information about line type
69   int                   getLineType() const { return myLineType; };
70   
71   //! A function for coding object to the byte copy
72   /*!
73      A function is used for copy-past technollogy in copy method
74    */
75   QByteArray            getByteCopy() const;
76   
77   //! A function for decoding object from the byte copy
78   /*!
79      A function is used for copy-past technollogy in past method
80    */
81   static GLViewer_AspectLine* fromByteCopy( QByteArray );
82   
83 protected:
84   //! A normal color
85   QColor                myNColor;
86   //! A highlight color
87   QColor                myHColor;
88   //! A select color
89   QColor                mySColor;
90   //! A line width
91   float                 myLineWidth;
92   //! A line type
93   /*! equals 0 for normal line and 1 for strip line */
94   int                   myLineType;
95 };
96
97 #ifdef WNT
98 #pragma warning ( default:4251 )
99 #endif
100
101 #endif