kwave  18.07.70
Curve.h
Go to the documentation of this file.
1 /***************************************************************************
2  Curve.h - curve consisting of points
3  -------------------
4  begin : Jan 20 2001
5  copyright : (C) 2001 by Thomas Eschenbacher
6  email : Thomas Eschenbacher <thomas.eschenbacher@gmx.de>
7  ***************************************************************************/
8 
9 /***************************************************************************
10  * *
11  * This program is free software; you can redistribute it and/or modify *
12  * it under the terms of the GNU General Public License as published by *
13  * the Free Software Foundation; either version 2 of the License, or *
14  * (at your option) any later version. *
15  * *
16  ***************************************************************************/
17 
18 #ifndef CURVE_H
19 #define CURVE_H
20 
21 #include "config.h"
22 
23 #include <QtGlobal>
24 #include <QList>
25 #include <QListIterator>
26 #include <QMutableListIterator>
27 #include <QObject>
28 #include <QPointF>
29 #include <QString>
30 #include <QVector>
31 #include <QtGlobal>
32 
33 #include "libkwave/Interpolation.h"
34 
35 namespace Kwave
36 {
37  class Q_DECL_EXPORT Curve: public QList<QPointF>
38  {
39  public:
40 
42  typedef QListIterator<QPointF> ConstIterator;
43 
45  typedef QMutableListIterator<QPointF> Iterator;
46 
48  typedef QPointF Point;
49 
51  static QPointF NoPoint;
52 
56  Curve();
57 
62  explicit Curve(const QString &command);
63 
65  virtual ~Curve();
66 
68  void firstHalf();
69 
71  void secondHalf();
72 
79  void deletePoint(Point p, bool check);
80 
84  void deleteSecondPoint();
85 
89  void HFlip();
90 
94  void VFlip();
95 
101  void scaleFit(unsigned int range = 1024);
102 
109  void insert(double x, double y);
110 
119  Point findPoint(double x, double y, double tol = .05);
120 
126  void fromCommand(const QString &command);
127 
132  QString getCommand();
133 
137  Kwave::interpolation_t interpolationType();
138 
143  void setInterpolationType(Kwave::interpolation_t type);
144 
146  Kwave::Interpolation &interpolation();
147 
155  QVector<double> interpolation(unsigned int points);
156 
157  protected:
158 
160  void sort();
161 
162  private:
163 
166 
167  };
168 }
169 
170 #endif /* CURVE_H */
171 
172 //***************************************************************************
173 //***************************************************************************
QPointF Point
Definition: Curve.h:48
Definition: App.h:33
static QPointF NoPoint
Definition: Curve.h:51
interpolation_t
Definition: Interpolation.h:34
QMutableListIterator< QPointF > Iterator
Definition: Curve.h:45
QListIterator< QPointF > ConstIterator
Definition: Curve.h:42
Kwave::Interpolation m_interpolation
Definition: Curve.h:165