1 // Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
3 // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
6 // This library is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU Lesser General Public
8 // License as published by the Free Software Foundation; either
9 // version 2.1 of the License.
11 // This library is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 // Lesser General Public License for more details.
16 // You should have received a copy of the GNU Lesser General Public
17 // License along with this library; if not, write to the Free Software
18 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
22 // File : Plot2d_AnalyticalCurve.h
23 // Author : Roman NIKOLAEV, Open CASCADE S.A.S. (roman.nikolaev@opencascade.com)
25 #ifndef PLOT2D_ANALYTICAL_CURVE_H
26 #define PLOT2D_ANALYTICAL_CURVE_H
35 class PLOT2D_EXPORT Plot2d_AnalyticalCurve
43 ActAddInView = 0, //! Add curve in view
44 ActRemoveFromView, //! Remove curve from view
45 ActUpdateInView, //! Update curve in view
46 ActNothing //! Do nothing
57 Plot2d_AnalyticalCurve();
58 Plot2d_AnalyticalCurve( const Plot2d_AnalyticalCurve& );
59 Plot2d_AnalyticalCurve& operator= ( const Plot2d_AnalyticalCurve& );
61 virtual ~Plot2d_AnalyticalCurve();
63 virtual QwtPlotItem* plotItem();
64 virtual void autoFill( const QwtPlot* );
65 virtual void updatePlotItem();
66 virtual bool checkCurve( const QwtPlot* );
68 virtual void calculate();
70 long getData( double** , double** ) const;
72 void setSelected(const bool);
73 bool isSelected() const;
77 void setAutoAssign( bool );
78 bool isAutoAssign( ) const;
80 void setColor( const QColor& );
81 QColor getColor() const;
83 void setMarker( Plot2d::MarkerType );
84 Plot2d::MarkerType getMarker() const;
86 void setMarkerSize( const int );
87 int getMarkerSize() const;
89 void setLine( Plot2d::LineType );
90 Plot2d::LineType getLine() const;
92 void setLineWidth( const int );
93 int getLineWidth() const;
95 void setNbIntervals( const long );
96 long getNbIntervals() const;
98 void setRangeBegin( const double );
99 double getRangeBegin() const;
101 void setRangeEnd( const double );
102 double getRangeEnd() const;
104 void setExpression( const QString& );
105 QString getExpression() const;
107 void setName( const QString& );
108 QString getName() const;
110 void setActive(const bool);
111 bool isActive() const;
113 void setAction(const int);
114 int getAction() const;
122 Plot2d::MarkerType myMarker;
124 Plot2d::LineType myLine;
130 QString myExpression;
134 QwtPlotItem* myCurve;
139 static int myNbCurves;
143 typedef QList<Plot2d_AnalyticalCurve*> AnalyticalCurveList;
145 class PLOT2D_EXPORT Plot2d_CurveContainer
148 virtual void addAnalyticalCurve( Plot2d_AnalyticalCurve* ) = 0;
149 virtual void removeAnalyticalCurve( Plot2d_AnalyticalCurve* ) = 0;
150 virtual void updateAnalyticalCurve( Plot2d_AnalyticalCurve*, bool = false ) = 0;
151 virtual void updateAnalyticalCurves() = 0;
152 virtual AnalyticalCurveList getAnalyticalCurves() const = 0;
155 #endif //PLOT2D_ANALYTICAL_CURVE_H