#pragma once #include #include class QskScaleTickmarks; class QSK_EXPORT QskLevelingSensor : public QskControl { Q_OBJECT using Inherited = QskControl; public: QSK_SUBCONTROLS( OuterDisk, Horizon, TickmarksX, TickmarksXLabels, TickmarksY, TickmarksYLabels, TickmarksZ, TickmarksZLabels ) using Tickmarks = QskScaleTickmarks; using TickmarksLabels = QVector< QPair< qreal, QString > >; explicit QskLevelingSensor( QQuickItem* parent = nullptr ); ~QskLevelingSensor(); public Q_SLOTS: void setTickmarks( Qt::Axis axis, Tickmarks tickmarks ); void setTickmarksLabels( Qt::Axis axis, TickmarksLabels labels ); void setAngle( const QVector3D& degree ); void setAngle( Qt::Axis axis, float degree ); void setSubControlRotation( QskAspect::Subcontrol subControl, const QVector3D& degree ); Q_SIGNALS: void anglesChanged( const QVector3D& degree ); void subControlRotationChanged( QskAspect::Subcontrol subControl, const QVector3D& degree ); public: Q_REQUIRED_RESULT const Tickmarks& tickmarks( Qt::Axis axis ) const; Q_REQUIRED_RESULT const TickmarksLabels& tickmarkLabels( Qt::Axis axis ) const; Q_REQUIRED_RESULT const QVector3D& angle() const noexcept; Q_REQUIRED_RESULT const QVector3D& subControlRotation( QskAspect::Subcontrol subControl ) const noexcept; private: class PrivateData; std::unique_ptr< PrivateData > m_data; };