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_AspectLine.h
23 // Created: November, 2004
25 #ifndef GLVIEWER_ASPECTLINE_H
26 #define GLVIEWER_ASPECTLINE_H
33 #pragma warning( disable:4251 )
37 * Class GLViewer_AspectLine
38 * Substitution of Prs2d_AspectLine for OpenGL
41 class GLVIEWER_API GLViewer_AspectLine
44 //! A default constructor
46 * Normal color is white
47 * Highlight color is cyan
50 GLViewer_AspectLine();
51 //! A conctructor by type and width of line
53 \param theType equals 0 for normal line and 1 for strip line
54 \param theWidth is a width of new line
56 GLViewer_AspectLine( int theType, float theWidth );
59 ~GLViewer_AspectLine();
61 //! A function for installing the line colors
63 \param nc is normal color
64 \param hc is highlight color
65 \param sc is select color
67 void setLineColors( QColor nc = Qt::black,
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
74 \param theType equals 0 for normal line and 1 for strip line
76 int setLineType( const int theType );
78 //! A function for getting line colors information
80 \param theNC is normal color
81 \param theHC is highlight color
82 \param theSC is select color
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; };
90 //! A function for coding object to the byte copy
92 A function is used for copy-past technollogy in copy method
94 QByteArray getByteCopy() const;
96 //! A function for decoding object from the byte copy
98 A function is used for copy-past technollogy in past method
100 static GLViewer_AspectLine* fromByteCopy( QByteArray );
105 //! A highlight color
112 /*! equals 0 for normal line and 1 for strip line */
117 #pragma warning ( default:4251 )