rename qsg namespace

This commit is contained in:
Vogel, Rick 2023-07-17 10:03:33 +02:00
parent 95f6a25094
commit ff39396e47
4 changed files with 7 additions and 18 deletions

View File

@ -3,7 +3,7 @@
#include <QSGNode> #include <QSGNode>
#include <type_traits> #include <type_traits>
namespace qsg namespace QskSGNode
{ {
using NodeType = QSGNode; using NodeType = QSGNode;

View File

@ -5,17 +5,6 @@
#include <QVector3D> #include <QVector3D>
#include <QskAspect.h> #include <QskAspect.h>
/// @brief This control can display the pitch, roll and yaw angles
/// @note x = pitch, y = yaw, z = roll
///
/// ^y+
/// |
/// |
/// |
/// +------------->x+
/// /
/// /
/// v z+
class QSK_EXPORT LevelingSensor : public QskControl class QSK_EXPORT LevelingSensor : public QskControl
{ {
Q_OBJECT Q_OBJECT
@ -52,7 +41,6 @@ public:
Q_REQUIRED_RESULT const TickmarksLabels& tickmarkLabels(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& angle() const noexcept;
private: private:
/// @brief The sensors rotation per axis: x := roll, y := pitch, z := yaw
QVector3D m_rotation; QVector3D m_rotation;
QVector3D m_angle = { 45,45,45 }; QVector3D m_angle = { 45,45,45 };
Tickmarks m_tickmarks[3]; Tickmarks m_tickmarks[3];

View File

@ -27,7 +27,7 @@
using Q = LevelingSensor; using Q = LevelingSensor;
using R = LevelingSensorSkinlet::NodeRole; using R = LevelingSensorSkinlet::NodeRole;
using namespace qsg; using namespace QskSGNode;
float LevelingSensorSkinlet::radius2(const QskSkinnable* const skinnable) float LevelingSensorSkinlet::radius2(const QskSkinnable* const skinnable)
{ {
@ -137,7 +137,7 @@ QSGNode* LevelingSensorSkinlet::updateSubNode<R::OuterDisk>(const LevelingSensor
const auto cX = center(sensor).x(); const auto cX = center(sensor).x();
const auto cY = center(sensor).y(); const auto cY = center(sensor).y();
const auto rZ = sensor->arcMetricsHint(subControl).startAngle(); const auto rZ = 0.0;
const auto matrix = const auto matrix =
matrix_deg(0.0, 0.0, 0.0, cX, cY, 0) * matrix_deg(0.0, 0.0, 0.0, cX, cY, 0) *
@ -157,7 +157,7 @@ QSGNode* LevelingSensorSkinlet::updateSubNode<R::Horizon>(const LevelingSensor*
const auto cX = center(sensor).x(); const auto cX = center(sensor).x();
const auto cY = center(sensor).y(); const auto cY = center(sensor).y();
const auto rX = sensor->rotation().x(); const auto rX = sensor->rotation().x();
const auto rZ = sensor->arcMetricsHint(subControl).startAngle(); const auto rZ = 0.0;
const auto dY = 2 * sensor->angle().y(); const auto dY = 2 * sensor->angle().y();
const auto p = qBound(0.0, 0.5 + (-rX / dY), 1.0); const auto p = qBound(0.0, 0.5 + (-rX / dY), 1.0);

View File

@ -4,6 +4,7 @@
#include <qmatrix4x4.h> #include <qmatrix4x4.h>
#include <QskScaleTickmarks.h> #include <QskScaleTickmarks.h>
#include <QskFunctions.h>
// create a homogenous transformation matrix // create a homogenous transformation matrix
inline Q_REQUIRED_RESULT QMatrix4x4 matrix_deg( inline Q_REQUIRED_RESULT QMatrix4x4 matrix_deg(
@ -51,7 +52,7 @@ inline bool compare_exchange(T& dst, const T& src)
template<> template<>
inline bool compare_exchange<float>(float& dst, const float& src) inline bool compare_exchange<float>(float& dst, const float& src)
{ {
if (!qFuzzyCompare(dst, src)) if (!qskFuzzyCompare (dst, src))
{ {
dst = src; dst = src;
return true; return true;
@ -62,7 +63,7 @@ inline bool compare_exchange<float>(float& dst, const float& src)
template<> template<>
inline bool compare_exchange<qreal>(qreal& dst, const qreal& src) inline bool compare_exchange<qreal>(qreal& dst, const qreal& src)
{ {
if (!qFuzzyCompare(dst, src)) if (!qskFuzzyCompare (dst, src))
{ {
dst = src; dst = src;
return true; return true;