Remove angle related members and methods

This commit is contained in:
Michael Gregorius
2023-07-08 14:55:03 +02:00
parent 9a5896fab1
commit e1b3a4415c
2 changed files with 1 additions and 62 deletions

View File

@@ -66,8 +66,6 @@ public:
setUnit( _txt_after );
}
void setTotalAngle( float angle );
signals:
void sliderPressed();
void sliderReleased();
@@ -98,16 +96,7 @@ private:
void doConnections() override;
QLineF calculateLine( const QPointF & _mid, float _radius,
float _innerRadius = 1) const;
void setPosition( const QPoint & _p );
bool updateAngle();
int angleFromValue( float value, float minValue, float maxValue, float totalAngle ) const
{
return static_cast<int>( ( value - 0.5 * ( minValue + maxValue ) ) / ( maxValue - minValue ) * m_totalAngle ) % 360;
}
inline float pageSize() const
{
@@ -127,8 +116,6 @@ private:
float m_leftOver;
bool m_buttonPressed;
float m_totalAngle;
int m_angle;
QImage m_cache;
};

View File

@@ -65,8 +65,7 @@ FloatModelEditorBase::FloatModelEditorBase(QWidget * _parent, const QString & _n
m_tdRenderer(nullptr),
m_volumeKnob( false ),
m_volumeRatio( 100.0, 0.0, 1000000.0 ),
m_buttonPressed( false ),
m_angle( -10 )
m_buttonPressed( false )
{
initUi( _name );
}
@@ -88,53 +87,6 @@ void FloatModelEditorBase::initUi( const QString & _name )
void FloatModelEditorBase::setTotalAngle( float angle )
{
if( angle < 10.0 )
{
m_totalAngle = 10.0;
}
else
{
m_totalAngle = angle;
}
update();
}
QLineF FloatModelEditorBase::calculateLine( const QPointF & _mid, float _radius, float _innerRadius ) const
{
const float rarc = m_angle * F_PI / 180.0;
const float ca = cos( rarc );
const float sa = -sin( rarc );
return QLineF( _mid.x() - sa*_innerRadius, _mid.y() - ca*_innerRadius,
_mid.x() - sa*_radius, _mid.y() - ca*_radius );
}
bool FloatModelEditorBase::updateAngle()
{
int angle = 0;
if( model() && model()->maxValue() != model()->minValue() )
{
angle = angleFromValue( model()->inverseScaledValue( model()->value() ), model()->minValue(), model()->maxValue(), m_totalAngle );
}
if( qAbs( angle - m_angle ) > 0 )
{
m_angle = angle;
return true;
}
return false;
}
float FloatModelEditorBase::getValue( const QPoint & _p )
{
float value;