1 // Copyright (C) 2007-2016 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, or (at your option) any later version.
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
36 class PLOT2D_EXPORT Plot2d_AnalyticalCurve
44 ActAddInView = 0, //! Add curve in view
45 ActRemoveFromView, //! Remove curve from view
46 ActUpdateInView, //! Update curve in view
47 ActNothing //! Do nothing
58 Plot2d_AnalyticalCurve();
59 Plot2d_AnalyticalCurve( const Plot2d_AnalyticalCurve& );
60 Plot2d_AnalyticalCurve& operator= ( const Plot2d_AnalyticalCurve& );
62 virtual ~Plot2d_AnalyticalCurve();
64 virtual QwtPlotItem* plotItem();
65 virtual void autoFill( const QwtPlot* );
66 virtual void updatePlotItem();
67 virtual bool checkCurve( const QwtPlot* );
69 virtual void calculate();
71 long getData( double** , double** ) const;
73 void setSelected(const bool);
74 bool isSelected() const;
78 void setAutoAssign( bool );
79 bool isAutoAssign( ) const;
81 void setColor( const QColor& );
82 QColor getColor() const;
84 void setMarker( Plot2d::MarkerType );
85 Plot2d::MarkerType getMarker() const;
87 void setMarkerSize( const int );
88 int getMarkerSize() const;
90 void setLine( Plot2d::LineType );
91 Plot2d::LineType getLine() const;
93 void setLineWidth( const int );
94 int getLineWidth() const;
96 void setNbIntervals( const long );
97 long getNbIntervals() const;
99 void setRangeBegin( const double );
100 double getRangeBegin() const;
102 void setRangeEnd( const double );
103 double getRangeEnd() const;
105 void setExpression( const QString& );
106 QString getExpression() const;
108 void setName( const QString& );
109 QString getName() const;
111 void setActive(const bool);
112 bool isActive() const;
114 void setAction(const int);
115 int getAction() const;
123 Plot2d::MarkerType myMarker;
125 Plot2d::LineType myLine;
131 QString myExpression;
135 QwtPlotCurve* myCurve;
140 static int myNbCurves;
144 typedef QList<Plot2d_AnalyticalCurve*> AnalyticalCurveList;
146 class PLOT2D_EXPORT Plot2d_CurveContainer
149 virtual void addAnalyticalCurve( Plot2d_AnalyticalCurve* ) = 0;
150 virtual void removeAnalyticalCurve( Plot2d_AnalyticalCurve* ) = 0;
151 virtual void updateAnalyticalCurve( Plot2d_AnalyticalCurve*, bool = false ) = 0;
152 virtual void updateAnalyticalCurves() = 0;
153 virtual AnalyticalCurveList getAnalyticalCurves() const = 0;
156 #endif //PLOT2D_ANALYTICAL_CURVE_H