Loading...
Searching...
No Matches
qwt_spline_parametrization.cpp
/******************************************************************************
* Qwt Widget Library
* Copyright (C) 1997 Josef Wilgen
* Copyright (C) 2002 Uwe Rathmann
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the Qwt License, Version 1.0
*****************************************************************************/
#include "qwt_spline_parametrization.h"
QwtSplineParametrization::QwtSplineParametrization( int type )
: m_type( type )
{
}
QwtSplineParametrization::~QwtSplineParametrization()
{
}
double QwtSplineParametrization::valueIncrement(
const QPointF& point1, const QPointF& point2 ) const
{
switch( m_type )
{
case QwtSplineParametrization::ParameterX:
{
return valueIncrementX( point1, point2 );
}
case QwtSplineParametrization::ParameterY:
{
return valueIncrementY( point1, point2 );
}
case QwtSplineParametrization::ParameterCentripetal:
{
return valueIncrementCentripetal( point1, point2 );
}
case QwtSplineParametrization::ParameterChordal:
{
return valueIncrementChordal( point1, point2 );
}
case QwtSplineParametrization::ParameterManhattan:
{
return valueIncrementManhattan( point1, point2 );
}
case QwtSplineParametrization::ParameterUniform:
{
return valueIncrementUniform( point1, point2 );
}
default:
{
return 1;
}
}
}
int QwtSplineParametrization::type() const
{
return m_type;
}
QwtSplineParametrization::valueIncrementChordal
static double valueIncrementChordal(const QPointF &, const QPointF &)
Calculate the ParameterChordal value increment for 2 points.
Definition qwt_spline_parametrization.h:179
QwtSplineParametrization::valueIncrementCentripetal
static double valueIncrementCentripetal(const QPointF &, const QPointF &)
Calculate the ParameterCentripetal value increment for 2 points.
Definition qwt_spline_parametrization.h:196
QwtSplineParametrization::type
int type() const
Definition qwt_spline_parametrization.cpp:72
QwtSplineParametrization::QwtSplineParametrization
QwtSplineParametrization(int type)
Definition qwt_spline_parametrization.cpp:17
QwtSplineParametrization::valueIncrementX
static double valueIncrementX(const QPointF &, const QPointF &)
Calculate the ParameterX value increment for 2 points.
Definition qwt_spline_parametrization.h:134
QwtSplineParametrization::valueIncrementUniform
static double valueIncrementUniform(const QPointF &, const QPointF &)
Calculate the ParameterUniform value increment.
Definition qwt_spline_parametrization.h:162
QwtSplineParametrization::valueIncrement
virtual double valueIncrement(const QPointF &, const QPointF &) const
Calculate the parameter value increment for 2 points.
Definition qwt_spline_parametrization.cpp:35
QwtSplineParametrization::~QwtSplineParametrization
virtual ~QwtSplineParametrization()
Destructor.
Definition qwt_spline_parametrization.cpp:23
QwtSplineParametrization::ParameterY
@ ParameterY
Definition qwt_spline_parametrization.h:60
QwtSplineParametrization::ParameterCentripetal
@ ParameterCentripetal
Definition qwt_spline_parametrization.h:94
QwtSplineParametrization::ParameterX
@ ParameterX
Definition qwt_spline_parametrization.h:54
QwtSplineParametrization::ParameterManhattan
@ ParameterManhattan
Definition qwt_spline_parametrization.h:105
QwtSplineParametrization::ParameterUniform
@ ParameterUniform
Definition qwt_spline_parametrization.h:72
QwtSplineParametrization::ParameterChordal
@ ParameterChordal
Definition qwt_spline_parametrization.h:82
QwtSplineParametrization::valueIncrementManhattan
static double valueIncrementManhattan(const QPointF &, const QPointF &)
Calculate the ParameterManhattan value increment for 2 points.
Definition qwt_spline_parametrization.h:210
QwtSplineParametrization::valueIncrementY
static double valueIncrementY(const QPointF &, const QPointF &)
Calculate the ParameterY value increment for 2 points.
Definition qwt_spline_parametrization.h:148