qskinny/src/controls/QskLevelingSensor.h

45 lines
1.4 KiB
C
Raw Normal View History

2023-08-02 07:11:01 +00:00
#ifndef QSK_LEVELING_SENSOR_H
#define QSK_LEVELING_SENSOR_H
2023-07-10 13:54:53 +00:00
#include <QskControl.h>
2023-07-24 08:56:26 +00:00
#include <memory>
2023-07-10 13:54:53 +00:00
2023-07-24 08:56:26 +00:00
class QskScaleTickmarks;
2023-07-20 10:01:16 +00:00
2023-07-17 09:14:43 +00:00
class QSK_EXPORT QskLevelingSensor : public QskControl
2023-07-10 13:54:53 +00:00
{
Q_OBJECT
2023-07-24 08:56:26 +00:00
using Inherited = QskControl;
public:
QSK_SUBCONTROLS( OuterDisk, Horizon, TickmarksX, TickmarksXLabels, TickmarksY, TickmarksYLabels,
TickmarksZ, TickmarksZLabels )
using Tickmarks = QskScaleTickmarks;
using TickmarksLabels = QVector< QPair< qreal, QString > >;
2023-07-20 10:01:16 +00:00
2023-07-24 08:56:26 +00:00
explicit QskLevelingSensor( QQuickItem* parent = nullptr );
~QskLevelingSensor();
2023-07-20 10:01:16 +00:00
2023-07-24 08:56:26 +00:00
public Q_SLOTS:
void setTickmarks( Qt::Axis axis, Tickmarks tickmarks );
void setTickmarksLabels( Qt::Axis axis, TickmarksLabels labels );
2023-07-25 12:56:22 +00:00
void setAngle( const QVector3D& degrees );
void setSubControlRotation( QskAspect::Subcontrol subControl, const QVector3D& degrees );
2023-07-24 08:56:26 +00:00
Q_SIGNALS:
void anglesChanged( const QVector3D& degree );
2023-07-25 12:56:22 +00:00
void subControlRotationChanged( QskAspect::Subcontrol subControl, const QVector3D& degrees );
2023-07-24 08:56:26 +00:00
public:
Q_REQUIRED_RESULT const Tickmarks& tickmarks( Qt::Axis axis ) const;
Q_REQUIRED_RESULT const TickmarksLabels& tickmarkLabels( Qt::Axis axis ) const;
2023-07-25 12:56:22 +00:00
Q_REQUIRED_RESULT const QVector3D& angle() const;
Q_REQUIRED_RESULT const QVector3D& subControlRotation( QskAspect::Subcontrol subControl ) const;
2023-07-20 10:01:16 +00:00
2023-07-24 08:56:26 +00:00
private:
class PrivateData;
std::unique_ptr< PrivateData > m_data;
2023-08-02 07:11:01 +00:00
};
#endif