File indexing completed on 2023-10-03 06:50:25
0001 /************************************************************************************* 0002 * Copyright (C) 2007-2011 by Aleix Pol <aleixpol@kde.org> * 0003 * Copyright (C) 2010-2012 by Percy Camilo T. Aucahuasi <percy.camilo.ta@gmail.com> * 0004 * * 0005 * This program is free software; you can redistribute it and/or * 0006 * modify it under the terms of the GNU General Public License * 0007 * as published by the Free Software Foundation; either version 2 * 0008 * of the License, or (at your option) any later version. * 0009 * * 0010 * This program is distributed in the hope that it will be useful, * 0011 * but WITHOUT ANY WARRANTY; without even the implied warranty of * 0012 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 0013 * GNU General Public License for more details. * 0014 * * 0015 * You should have received a copy of the GNU General Public License * 0016 * along with this program; if not, write to the Free Software * 0017 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA * 0018 *************************************************************************************/ 0019 0020 #ifndef ANALITZAPLOT_PLANECURVE_H 0021 #define ANALITZAPLOT_PLANECURVE_H 0022 0023 #include "functiongraph.h" 0024 0025 #include <QMap> 0026 #include <QPoint> 0027 #include <QRectF> 0028 #include <QLineF> 0029 #include <QColor> 0030 0031 namespace Analitza 0032 { 0033 0034 /** 0035 * \class PlaneCurve 0036 * 0037 * \ingroup AnalitzaPlotModule 0038 * 0039 * \brief Represents a curve in 2D space. 0040 * 0041 * This class contains all necessary data that Plotter2D will use to draw the curve. 0042 */ 0043 0044 class ANALITZAPLOT_EXPORT PlaneCurve : public FunctionGraph 0045 { 0046 public: 0047 explicit PlaneCurve(AbstractFunctionGraph* g); 0048 ~PlaneCurve() override; 0049 0050 QVector<int> jumps() const; 0051 const QVector<QPointF> & points() const; 0052 void update(const QRectF& viewport); 0053 QPair<QPointF, QString> image(const QPointF &mousepos); // calculate the image of the curve based on the mouse postion 0054 QLineF tangent(const QPointF &mousepos);// calculate the tangent to the curve based on the mouse 0055 }; 0056 0057 } 0058 0059 #endif // ANALITZAPLOT_PLANECURVE_H