Salome HOME
Transaction management in operations modifed.
[modules/gui.git] / src / GLViewer / GLViewer_AspectLine.h
1 //  Copyright (C) 2005 OPEN CASCADE
2 //
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.
7 //
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.
12 //
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
16 //
17 //  See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
18 //
19 //  Author : OPEN CASCADE
20 //
21
22 // File:      GLViewer_AspectLine.h
23 // Created:   November, 2004
24
25 #ifndef GLVIEWER_ASPECTLINE_H
26 #define GLVIEWER_ASPECTLINE_H
27
28 #include "GLViewer.h"
29
30 #include <qcolor.h>
31
32 #ifdef WNT
33 #pragma warning( disable:4251 )
34 #endif
35
36 /*! 
37  * Class GLViewer_AspectLine
38  * Substitution of Prs2d_AspectLine for OpenGL
39  */
40
41 class GLVIEWER_API GLViewer_AspectLine 
42 {
43 public:
44   //! A default constructor
45   /* Line is Non strip
46    * Normal color is white
47    * Highlight color is cyan
48    * Select color is red
49   */
50   GLViewer_AspectLine();
51   //! A conctructor by type and width of line
52   /*!
53    \param theType equals 0 for normal line and 1 for strip line
54    \param theWidth is a width of new line
55   */
56   GLViewer_AspectLine( int theType, float theWidth );
57
58   //! A destructor
59   ~GLViewer_AspectLine();
60   
61   //! A function for installing the line colors
62   /*!
63    \param nc is normal color
64    \param hc is highlight color
65    \param sc is select color
66   */
67   void                  setLineColors( QColor nc = Qt::black,
68                                        QColor hc = Qt::cyan,
69                                        QColor sc = Qt::red );
70   //! A function for installing the line width
71   int                   setLineWidth( const float theWidth );
72   //! A function for installing the line type
73   /*!
74    \param theType equals 0 for normal line and 1 for strip line
75   */
76   int                   setLineType( const int theType );
77
78   //! A function for getting line colors information
79   /*!
80    \param theNC is normal color
81    \param theHC is highlight color
82    \param theSC is select color
83   */
84   void                  getLineColors( QColor& theNC, QColor& theHC, QColor& theSC ) const;
85   //! A function for getting information about line width
86   float                 getLineWidth() const { return myLineWidth; };
87   //! A function for getting information about line type
88   int                   getLineType() const { return myLineType; };
89   
90   //! A function for coding object to the byte copy
91   /*!
92      A function is used for copy-past technollogy in copy method
93    */
94   QByteArray            getByteCopy() const;
95   
96   //! A function for decoding object from the byte copy
97   /*!
98      A function is used for copy-past technollogy in past method
99    */
100   static GLViewer_AspectLine* fromByteCopy( QByteArray );
101   
102 protected:
103   //! A normal color
104   QColor                myNColor;
105   //! A highlight color
106   QColor                myHColor;
107   //! A select color
108   QColor                mySColor;
109   //! A line width
110   float                 myLineWidth;
111   //! A line type
112   /*! equals 0 for normal line and 1 for strip line */
113   int                   myLineType;
114 };
115
116 #ifdef WNT
117 #pragma warning ( default:4251 )
118 #endif
119
120 #endif