1 // Copyright (C) 2005 OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D
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.salome-platform.org/ or email : webmaster.salome@opencascade.com
19 #ifndef PLOT2D_CURVE_H
20 #define PLOT2D_CURVE_H
23 #include <qvaluelist.h>
36 typedef QValueList<Plot2d_Point> pointList;
38 class PLOT2D_EXPORT Plot2d_Curve
41 enum MarkerType { None, Circle, Rectangle, Diamond,
42 DTriangle, UTriangle, LTriangle, RTriangle,
44 enum LineType { NoPen, Solid, Dash, Dot, DashDot, DashDotDot };
47 virtual ~Plot2d_Curve();
48 Plot2d_Curve( const Plot2d_Curve& curve );
49 Plot2d_Curve& operator= ( const Plot2d_Curve& curve );
51 virtual QString getTableTitle() const;
53 void setHorTitle( const QString& title );
54 QString getHorTitle() const;
55 void setVerTitle( const QString& title );
56 QString getVerTitle() const;
57 void setHorUnits( const QString& units );
58 QString getHorUnits() const;
59 void setVerUnits( const QString& units );
60 QString getVerUnits() const;
61 void addPoint(double theX, double theY, const QString& = QString::null );
62 void insertPoint(int thePos, double theX, double theY, const QString& = QString::null );
63 void deletePoint(int thePos);
64 void clearAllPoints();
65 pointList getPointList() const;
67 void setData( const double* hData, const double* vData, long size, const QStringList& = QStringList() );
68 double* horData() const;
69 double* verData() const;
71 void setText( const int, const QString& );
72 QString text( const int ) const;
77 void setAutoAssign( bool on );
78 bool isAutoAssign() const;
79 void setColor( const QColor& color );
80 QColor getColor() const;
81 void setMarker( MarkerType marker );
82 MarkerType getMarker() const;
83 void setLine( LineType line, const int lineWidth = 0 );
84 LineType getLine() const;
85 int getLineWidth() const;
86 void setYAxis(QwtPlot::Axis theYAxis);
87 QwtPlot::Axis getYAxis() const;
89 // Protection against QwtCurve::drawLines() bug in Qwt 0.4.x:
90 // it crashes if switched to X/Y logarithmic mode, when one or more points have
91 // non-positive X/Y coordinate
92 double getMinX() const;
93 double getMinY() const;
105 QwtPlot::Axis myYAxis;
110 typedef QPtrList<Plot2d_Curve> curveList;