Version: 6.3.1

src/Plot2d/Plot2d.h

Go to the documentation of this file.
00001 // Copyright (C) 2007-2011  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 // File   : Plot2d.h
00024 // Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
00025 //
00026 #ifndef PLOT2D_H
00027 #define PLOT2D_H
00028 
00029 #ifdef WIN32
00030 #  if defined PLOT2D_EXPORTS || defined Plot2d_EXPORTS
00031 #    define PLOT2D_EXPORT __declspec(dllexport)
00032 #  else
00033 #    define PLOT2D_EXPORT __declspec(dllimport)
00034 #  endif
00035 #else
00036 #  define PLOT2D_EXPORT
00037 #endif
00038 
00039 #include <qwt_symbol.h>
00040 #include <Qt>
00041 
00042 class QPainter;
00043 
00044 namespace Plot2d
00045 {
00046   typedef enum { None, 
00047                  Circle,  
00048                  Rectangle,
00049                  Diamond,
00050                  DTriangle,
00051                  UTriangle,
00052                  LTriangle,
00053                  RTriangle,
00054                  Cross,
00055                  XCross
00056   } MarkerType;
00057 
00058   typedef enum {
00059     NoPen,
00060     Solid, 
00061     Dash, 
00062     Dot, 
00063     DashDot, 
00064     DashDotDot
00065   } LineType;
00066 
00067   QwtSymbol::Style         plot2qwtMarker( MarkerType );
00068   MarkerType qwt2plotMarker( QwtSymbol::Style );
00069 
00070   Qt::PenStyle             plot2qwtLine( LineType );
00071   LineType                 qwt2plotLine( Qt::PenStyle );
00072 
00073   void                     drawLine( QPainter*, const QPoint&, const QPoint&, 
00074                                      Qt::PenStyle = Qt::SolidLine, 
00075                                      const QColor& = Qt::black, int = 0 );
00076   void                     drawLine( QPainter*, const QPoint&, const QPoint&, 
00077                                      LineType = Solid, 
00078                                      const QColor& = Qt::black, int = 0 );
00079   void                     drawLine( QPainter*, int, int, int, int,
00080                                      Qt::PenStyle = Qt::SolidLine, 
00081                                      const QColor& = Qt::black, int = 0 );
00082   void                     drawLine( QPainter*, int, int, int, int,
00083                                      LineType = Solid, 
00084                                      const QColor& = Qt::black, int = 0 );
00085 
00086   void                     drawMarker( QPainter*, const QPoint&, const QRect&,
00087                                        QwtSymbol::Style = QwtSymbol::Ellipse,
00088                                        const QColor& = Qt::black );
00089   void                     drawMarker( QPainter*, const QPoint&, const QRect&,
00090                                        MarkerType = Circle,
00091                                        const QColor& = Qt::black );
00092   void                     drawMarker( QPainter*, int, int, int, int,
00093                                        QwtSymbol::Style = QwtSymbol::Ellipse,
00094                                        const QColor& = Qt::black );
00095   void                     drawMarker( QPainter*, int, int, int, int,
00096                                        MarkerType = Circle,
00097                                        const QColor& = Qt::black );
00098 }
00099 
00100 #if defined WIN32
00101 #  pragma warning ( disable: 4251 )
00102 #endif
00103 
00104 #endif // PLOT2D_H
Copyright © 2007-2011 CEA/DEN, EDF R&D, OPEN CASCADE
Copyright © 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS