src/GLViewer/GLViewer_AspectLine.h

Go to the documentation of this file.
00001 //  Copyright (C) 2005 OPEN CASCADE
00002 //
00003 //  This library is free software; you can redistribute it and/or
00004 //  modify it under the terms of the GNU Lesser General Public
00005 //  License as published by the Free Software Foundation; either
00006 //  version 2.1 of the License.
00007 //
00008 //  This library is distributed in the hope that it will be useful,
00009 //  but WITHOUT ANY WARRANTY; without even the implied warranty of
00010 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00011 //  Lesser General Public License for more details.
00012 //
00013 //  You should have received a copy of the GNU Lesser General Public
00014 //  License along with this library; if not, write to the Free Software
00015 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
00016 //
00017 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
00018 //
00019 //  Author : OPEN CASCADE
00020 //
00021 
00022 // File:      GLViewer_AspectLine.h
00023 // Created:   November, 2004
00024 
00025 #ifndef GLVIEWER_ASPECTLINE_H
00026 #define GLVIEWER_ASPECTLINE_H
00027 
00028 #include "GLViewer.h"
00029 
00030 #include <qcolor.h>
00031 
00032 #ifdef WNT
00033 #pragma warning( disable:4251 )
00034 #endif
00035 
00041 class GLVIEWER_API GLViewer_AspectLine 
00042 {
00043 public:
00045   /* Line is Non strip
00046    * Normal color is white
00047    * Highlight color is cyan
00048    * Select color is red
00049   */
00050   GLViewer_AspectLine();
00052 
00056   GLViewer_AspectLine( int theType, float theWidth );
00057 
00059   ~GLViewer_AspectLine();
00060   
00062 
00067   void                  setLineColors( QColor nc = Qt::black,
00068                                        QColor hc = Qt::cyan,
00069                                        QColor sc = Qt::red );
00071   int                   setLineWidth( const float theWidth );
00073 
00076   int                   setLineType( const int theType );
00077 
00079 
00084   void                  getLineColors( QColor& theNC, QColor& theHC, QColor& theSC ) const;
00086   float                 getLineWidth() const { return myLineWidth; };
00088   int                   getLineType() const { return myLineType; };
00089   
00091 
00094   QByteArray            getByteCopy() const;
00095   
00097 
00100   static GLViewer_AspectLine* fromByteCopy( QByteArray );
00101   
00102 protected:
00104   QColor                myNColor;
00106   QColor                myHColor;
00108   QColor                mySColor;
00110   float                 myLineWidth;
00112 
00113   int                   myLineType;
00114 };
00115 
00116 #ifdef WNT
00117 #pragma warning ( default:4251 )
00118 #endif
00119 
00120 #endif