mirror of
https://github.com/qgis/QGIS.git
synced 2025-10-05 00:09:32 -04:00
* require qwt >=6.2 (and fallback to internal 6.3 if system's qwt doesn't suffice) * debian doesn't have qwt for Qt6 and won't have it for trixie
76 lines
1.9 KiB
C++
76 lines
1.9 KiB
C++
/******************************************************************************
|
|
* 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"
|
|
|
|
/*!
|
|
Constructor
|
|
\param type Parametrization type
|
|
\sa type()
|
|
*/
|
|
QwtSplineParametrization::QwtSplineParametrization( int type )
|
|
: m_type( type )
|
|
{
|
|
}
|
|
|
|
//! Destructor
|
|
QwtSplineParametrization::~QwtSplineParametrization()
|
|
{
|
|
}
|
|
|
|
/*!
|
|
\brief Calculate the parameter value increment for 2 points
|
|
|
|
\param point1 First point
|
|
\param point2 Second point
|
|
|
|
\return Value increment
|
|
*/
|
|
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;
|
|
}
|
|
}
|
|
}
|
|
|
|
//! \return Parametrization type
|
|
int QwtSplineParametrization::type() const
|
|
{
|
|
return m_type;
|
|
}
|