Back to index

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