diff --git a/include/FloatModelEditorBase.h b/include/FloatModelEditorBase.h index 38ab1b51b..82361197b 100644 --- a/include/FloatModelEditorBase.h +++ b/include/FloatModelEditorBase.h @@ -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( ( 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; }; diff --git a/src/gui/widgets/FloatModelEditorBase.cpp b/src/gui/widgets/FloatModelEditorBase.cpp index 73a91a393..41fc31c4a 100644 --- a/src/gui/widgets/FloatModelEditorBase.cpp +++ b/src/gui/widgets/FloatModelEditorBase.cpp @@ -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;