qwt_spline_parametrization.h
Go to the documentation of this file.
1 /******************************************************************************
2  * Qwt Widget Library
3  * Copyright (C) 1997 Josef Wilgen
4  * Copyright (C) 2002 Uwe Rathmann
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the Qwt License, Version 1.0
8  *****************************************************************************/
9 
10 #ifndef QWT_SPLINE_PARAMETRIZATION_H
11 #define QWT_SPLINE_PARAMETRIZATION_H
12 
13 #include "qwt_global.h"
14 #include "qwt_math.h"
15 
16 #include <qpoint.h>
17 
45 {
46  public:
48  enum Type
49  {
54  ParameterX,
55 
60  ParameterY,
61 
72  ParameterUniform,
73 
82  ParameterChordal,
83 
94  ParameterCentripetal,
95 
96 
105  ParameterManhattan
106  };
107 
109  virtual ~QwtSplineParametrization();
110 
111  int type() const;
112 
113  virtual double valueIncrement( const QPointF&, const QPointF& ) const;
114 
115  static double valueIncrementX( const QPointF&, const QPointF& );
116  static double valueIncrementY( const QPointF&, const QPointF& );
117  static double valueIncrementUniform( const QPointF&, const QPointF& );
118  static double valueIncrementChordal( const QPointF&, const QPointF& );
119  static double valueIncrementCentripetal( const QPointF&, const QPointF& );
120  static double valueIncrementManhattan( const QPointF&, const QPointF& );
121 
122  private:
123  const int m_type;
124 };
125 
135  const QPointF& point1, const QPointF& point2 )
136 {
137  return point2.x() - point1.x();
138 }
139 
149  const QPointF& point1, const QPointF& point2 )
150 {
151  return point2.y() - point1.y();
152 }
153 
163  const QPointF& point1, const QPointF& point2 )
164 {
165  Q_UNUSED( point1 )
166  Q_UNUSED( point2 )
167 
168  return 1.0;
169 }
170 
180  const QPointF& point1, const QPointF& point2 )
181 {
182  const double dx = point2.x() - point1.x();
183  const double dy = point2.y() - point1.y();
184 
185  return std::sqrt( dx * dx + dy * dy );
186 }
187 
197  const QPointF& point1, const QPointF& point2 )
198 {
199  return std::sqrt( valueIncrementChordal( point1, point2 ) );
200 }
201 
211  const QPointF& point1, const QPointF& point2 )
212 {
213  return qAbs( point2.x() - point1.x() ) + qAbs( point2.y() - point1.y() );
214 }
215 
216 #endif
QwtSplineParametrization::valueIncrementY
static double valueIncrementY(const QPointF &, const QPointF &)
Calculate the ParameterY value increment for 2 points.
Definition: qwt_spline_parametrization.h:148
QwtSplineParametrization::valueIncrementUniform
static double valueIncrementUniform(const QPointF &, const QPointF &)
Calculate the ParameterUniform value increment.
Definition: qwt_spline_parametrization.h:162
backward::ColorMode::type
type
Definition: backward.hpp:3600
QwtSplineParametrization::valueIncrementManhattan
static double valueIncrementManhattan(const QPointF &, const QPointF &)
Calculate the ParameterManhattan value increment for 2 points.
Definition: qwt_spline_parametrization.h:210
QwtSplineParametrization
Curve parametrization used for a spline interpolation.
Definition: qwt_spline_parametrization.h:44
qwt_global.h
QwtSplineParametrization::valueIncrementX
static double valueIncrementX(const QPointF &, const QPointF &)
Calculate the ParameterX value increment for 2 points.
Definition: qwt_spline_parametrization.h:134
QwtSplineParametrization::valueIncrementCentripetal
static double valueIncrementCentripetal(const QPointF &, const QPointF &)
Calculate the ParameterCentripetal value increment for 2 points.
Definition: qwt_spline_parametrization.h:196
qwt_math.h
QwtSplineParametrization::Type
Type
Parametrization type.
Definition: qwt_spline_parametrization.h:55
QwtSplineParametrization::valueIncrementChordal
static double valueIncrementChordal(const QPointF &, const QPointF &)
Calculate the ParameterChordal value increment for 2 points.
Definition: qwt_spline_parametrization.h:179
QWT_EXPORT
#define QWT_EXPORT
Definition: qwt_global.h:38


plotjuggler
Author(s): Davide Faconti
autogenerated on Mon Nov 11 2024 03:23:46