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/
19 #ifndef PLOT2D_CURVE_H
20 #define PLOT2D_CURVE_H
23 #include <qvaluelist.h>
35 typedef QValueList<Plot2d_Point> pointList;
37 class PLOT2D_EXPORT Plot2d_Curve
40 enum MarkerType { None, Circle, Rectangle, Diamond,
41 DTriangle, UTriangle, LTriangle, RTriangle,
43 enum LineType { NoPen, Solid, Dash, Dot, DashDot, DashDotDot };
46 virtual ~Plot2d_Curve();
47 Plot2d_Curve( const Plot2d_Curve& curve );
48 Plot2d_Curve& operator= ( const Plot2d_Curve& curve );
50 virtual QString getTableTitle() const;
52 void setHorTitle( const QString& title );
53 QString getHorTitle() const;
54 void setVerTitle( const QString& title );
55 QString getVerTitle() const;
56 void setHorUnits( const QString& units );
57 QString getHorUnits() const;
58 void setVerUnits( const QString& units );
59 QString getVerUnits() const;
60 void addPoint(double theX, double theY);
61 void insertPoint(int thePos, double theX, double theY);
62 void deletePoint(int thePos);
63 void clearAllPoints();
64 pointList getPointList() const;
66 void setData( const double* hData, const double* vData, long size );
67 double* horData() const;
68 double* verData() const;
73 void setAutoAssign( bool on );
74 bool isAutoAssign() const;
75 void setColor( const QColor& color );
76 QColor getColor() const;
77 void setMarker( MarkerType marker );
78 MarkerType getMarker() const;
79 void setLine( LineType line, const int lineWidth = 0 );
80 LineType getLine() const;
81 int getLineWidth() const;
82 void setYAxis(QwtPlot::Axis theYAxis);
83 QwtPlot::Axis getYAxis() const;
85 // Protection against QwtCurve::drawLines() bug in Qwt 0.4.x:
86 // it crashes if switched to X/Y logarithmic mode, when one or more points have
87 // non-positive X/Y coordinate
88 double getMinX() const;
89 double getMinY() const;
101 QwtPlot::Axis myYAxis;
106 typedef QPtrList<Plot2d_Curve> curveList;