qskinny/src/controls/LevelingSensor/QskLevelingSensorSkinlet.cpp

488 lines
18 KiB
C++
Raw Normal View History

2023-07-10 13:54:53 +00:00
#include "QskLevelingSensorSkinlet.h"
#include "QskLevelingSensor.h"
#include "QskLevelingSensorNodes.h"
2023-07-20 10:01:16 +00:00
#include "QskLevelingSensorUtility.h"
2023-07-17 08:19:01 +00:00
#include "QskSGNodeUtility.h"
2023-07-10 13:54:53 +00:00
#include <QskArcMetrics.h>
#include <QskBoxBorderColors.h>
#include <QskBoxBorderMetrics.h>
#include <QskBoxNode.h>
#include <QskBoxShapeMetrics.h>
#include <QskGradient.h>
#include <QskGraphic.h>
#include <QskScaleEngine.h>
#include <QskScaleTickmarks.h>
#include <QskTextColors.h>
#include <QskTextNode.h>
#include <QskTextOptions.h>
#include <QskTickmarksNode.h>
#include <QFontMetrics>
#include <QSGClipNode>
#include <QSGFlatColorMaterial>
#include <QSGGeometryNode>
#include <qmath.h>
2023-07-20 10:01:16 +00:00
namespace
{
template< typename T >
struct State;
template<>
struct State< QskLevelingSensor >
{
qreal r1 = 0.0;
qreal r2 = 0.0;
qreal cX = 0.0;
qreal cY = 0.0;
qreal sX = 0.0;
qreal sY = 0.0;
qreal sZ = 0.0;
explicit State( const QskLevelingSensor* const sensor )
: r1( QskLevelingSensorSkinlet::innerRadius( sensor ) )
, r2( QskLevelingSensorSkinlet::outerRadius( sensor ) )
, cX( QskLevelingSensorSkinlet::center( sensor ).x() )
, cY( QskLevelingSensorSkinlet::center( sensor ).y() )
, sX( r1 / sensor->angle().x() )
, sY( r1 / sensor->angle().y() )
, sZ( r1 / sensor->angle().z() )
{
}
};
template<>
struct State< QskAspect::Subcontrol > : State< QskLevelingSensor >
{
qreal rX = 0.0;
qreal rY = 0.0;
qreal rZ = 0.0;
qreal tX = 0.0;
qreal tY = 0.0;
qreal tZ = 0.0;
State( const QskLevelingSensor* const sensor, QskAspect::Subcontrol subcontrol )
: State< QskLevelingSensor >( sensor )
, rX( sensor->subControlRotation( subcontrol ).x() )
, rY( sensor->subControlRotation( subcontrol ).y() )
, rZ( sensor->subControlRotation( subcontrol ).z() )
, tX( rY * sX )
, tY( rX * sY )
, tZ( 0.0 )
{
}
};
}
2023-07-17 09:14:43 +00:00
using Q = QskLevelingSensor;
using R = QskLevelingSensorSkinlet::NodeRole;
2023-07-10 13:54:53 +00:00
2023-07-17 08:03:33 +00:00
using namespace QskSGNode;
2023-07-10 13:54:53 +00:00
2023-07-20 10:01:16 +00:00
float QskLevelingSensorSkinlet::outerRadius( const QskSkinnable* const skinnable )
2023-07-10 13:54:53 +00:00
{
2023-07-20 10:01:16 +00:00
const auto* const sensor = static_cast< const Q* >( skinnable );
2023-07-10 13:54:53 +00:00
const auto contentsRect = sensor->contentsRect();
2023-07-20 10:01:16 +00:00
return 0.5f * qMin( contentsRect.width(), contentsRect.height() );
2023-07-10 13:54:53 +00:00
}
2023-07-20 10:01:16 +00:00
float QskLevelingSensorSkinlet::innerRadius( const QskSkinnable* const skinnable )
2023-07-10 13:54:53 +00:00
{
2023-07-20 10:01:16 +00:00
const auto scale = skinnable->strutSizeHint( Q::Horizon );
return outerRadius( skinnable ) * scale.width();
2023-07-10 13:54:53 +00:00
}
2023-07-20 10:01:16 +00:00
QPointF QskLevelingSensorSkinlet::center( const QskSkinnable* const skinnable )
2023-07-10 13:54:53 +00:00
{
2023-07-20 10:01:16 +00:00
const auto* const sensor = static_cast< const Q* >( skinnable );
2023-07-10 13:54:53 +00:00
return sensor->contentsRect().center();
}
2023-07-20 10:01:16 +00:00
QskLevelingSensorSkinlet::QskLevelingSensorSkinlet( QskSkin* skin )
: Inherited( skin )
2023-07-10 13:54:53 +00:00
{
2023-07-20 10:01:16 +00:00
setNodeRoles( {
2023-07-10 13:54:53 +00:00
OuterDisk,
Horizon,
HorizonClip,
TickmarksX,
TickmarksXLabels,
TickmarksY,
TickmarksYLabels,
TickmarksZ,
2023-07-20 10:01:16 +00:00
TickmarksZLabels,
} );
2023-07-10 13:54:53 +00:00
}
2023-07-20 10:01:16 +00:00
template< QskLevelingSensorSkinlet::NodeRole >
Q_REQUIRED_RESULT QRectF QskLevelingSensorSkinlet::subControlRect(
const QskLevelingSensor* const sensor, const QRectF& contentsRect ) const = delete;
2023-07-10 13:54:53 +00:00
template<>
2023-07-20 10:01:16 +00:00
Q_REQUIRED_RESULT QRectF QskLevelingSensorSkinlet::subControlRect< R::OuterDisk >(
const QskLevelingSensor* const sensor, const QRectF& contentsRect ) const
2023-07-10 13:54:53 +00:00
{
2023-07-20 10:01:16 +00:00
const auto radius = outerRadius( sensor );
const auto scale = sensor->strutSizeHint( Q::OuterDisk );
2023-07-10 13:54:53 +00:00
const auto width = 2 * radius * scale.width();
const auto height = width;
const auto x = contentsRect.center().x() - width / 2;
const auto y = contentsRect.center().y() - height / 2;
return { x, y, width, height };
}
template<>
2023-07-20 10:01:16 +00:00
Q_REQUIRED_RESULT QRectF QskLevelingSensorSkinlet::subControlRect< R::Horizon >(
const QskLevelingSensor* const sensor, const QRectF& contentsRect ) const
2023-07-10 13:54:53 +00:00
{
2023-07-20 10:01:16 +00:00
const auto scale = sensor->strutSizeHint( Q::Horizon );
const auto width = 2 * innerRadius( sensor ) * scale.width();
2023-07-10 13:54:53 +00:00
const auto height = width;
2023-07-20 10:01:16 +00:00
return { center( sensor ).x() - width / 2, center( sensor ).y() - height / 2, width, height };
2023-07-10 13:54:53 +00:00
}
2023-07-20 10:01:16 +00:00
QRectF QskLevelingSensorSkinlet::subControlRect( const QskSkinnable* skinnable,
const QRectF& contentsRect, QskAspect::Subcontrol subControl ) const
2023-07-10 13:54:53 +00:00
{
2023-07-20 10:01:16 +00:00
const auto* const sensor = static_cast< const Q* >( skinnable );
2023-07-10 13:54:53 +00:00
2023-07-20 10:01:16 +00:00
if ( subControl == Q::OuterDisk )
2023-07-10 13:54:53 +00:00
{
2023-07-20 10:01:16 +00:00
return subControlRect< OuterDisk >( sensor, contentsRect );
2023-07-10 13:54:53 +00:00
}
2023-07-20 10:01:16 +00:00
if ( subControl == Q::Horizon )
2023-07-10 13:54:53 +00:00
{
2023-07-20 10:01:16 +00:00
return subControlRect< Horizon >( sensor, contentsRect );
2023-07-10 13:54:53 +00:00
}
2023-07-20 10:01:16 +00:00
return Inherited::subControlRect( skinnable, contentsRect, subControl );
2023-07-10 13:54:53 +00:00
}
2023-07-20 10:01:16 +00:00
template< QskLevelingSensorSkinlet::NodeRole >
QSGNode* QskLevelingSensorSkinlet::updateSubNode( const QskLevelingSensor* const sensor,
const quint8 nodeRole, QSGNode* const node ) const = delete;
2023-07-10 13:54:53 +00:00
template<>
2023-07-20 10:01:16 +00:00
QSGNode* QskLevelingSensorSkinlet::updateSubNode< R::OuterDisk >(
const QskLevelingSensor* const sensor, const quint8 nodeRole, QSGNode* const node ) const
2023-07-10 13:54:53 +00:00
{
const auto subControl = Q::OuterDisk;
const auto contentsRect = sensor->contentsRect();
2023-07-20 10:01:16 +00:00
const auto boxRect = subControlRect< OuterDisk >( sensor, contentsRect );
2023-07-10 13:54:53 +00:00
const auto boxShapeMetrics = QskBoxShapeMetrics{ boxRect.width() / 2 };
2023-07-20 10:01:16 +00:00
const auto boxBorderMetrics = sensor->boxBorderMetricsHint( subControl );
const auto boxBorderColors = sensor->boxBorderColorsHint( subControl );
const auto boxGradient = sensor->gradientHint( subControl );
2023-07-10 13:54:53 +00:00
2023-07-20 10:01:16 +00:00
auto* const root = ensure< QSGTransformNode, par< 1, QskBoxNode > >::node( node );
auto* const bNode = static_cast< QskBoxNode* >( root->firstChild() );
2023-07-10 13:54:53 +00:00
2023-07-20 10:01:16 +00:00
const auto size = outerRadius( sensor ) * sensor->strutSizeHint( Q::OuterDisk ).width();
updateBoxNode( sensor, bNode, { 0, 0, 2 * size, 2 * size }, boxShapeMetrics, boxBorderMetrics,
boxBorderColors, boxGradient );
2023-07-10 13:54:53 +00:00
2023-07-20 10:01:16 +00:00
const auto cX = center( sensor ).x();
const auto cY = center( sensor ).y();
2023-07-17 08:03:33 +00:00
const auto rZ = 0.0;
2023-07-10 13:54:53 +00:00
2023-07-20 10:01:16 +00:00
const auto matrix = matrix_deg( 0.0, 0.0, 0.0, cX, cY, 0 ) *
matrix_deg( 0.0, 0.0, rZ, 0, 0, 0 ) *
matrix_deg( 0.0, 0.0, 0.0, -size, -size, 0 );
2023-07-10 13:54:53 +00:00
2023-07-20 10:01:16 +00:00
root->setMatrix( matrix );
2023-07-10 13:54:53 +00:00
return root;
}
template<>
2023-07-20 10:01:16 +00:00
QSGNode* QskLevelingSensorSkinlet::updateSubNode< R::Horizon >(
const QskLevelingSensor* const sensor, const quint8 nodeRole, QSGNode* const node ) const
2023-07-10 13:54:53 +00:00
{
const auto subControl = Q::Horizon;
2023-07-20 10:01:16 +00:00
const auto r1 = innerRadius( sensor );
const auto cX = center( sensor ).x();
const auto cY = center( sensor ).y();
const auto rX = sensor->subControlRotation( subControl ).x();
2023-07-17 08:03:33 +00:00
const auto rZ = 0.0;
2023-07-10 13:54:53 +00:00
const auto dY = 2 * sensor->angle().y();
2023-07-20 10:01:16 +00:00
const auto p = qBound( 0.0, 0.5 + ( -rX / dY ), 1.0 );
2023-07-10 13:54:53 +00:00
const auto shape = QskBoxShapeMetrics{ r1 };
2023-07-20 10:01:16 +00:00
const auto bmetrics = sensor->boxBorderMetricsHint( subControl );
const auto bcolors = sensor->boxBorderColorsHint( subControl );
auto gradient = sensor->gradientHint( Q::Horizon );
gradient.setDirection( QskGradient::Linear );
gradient.setLinearDirection( Qt::Vertical );
gradient.setStops( { { 0.0, gradient.startColor() }, { p, gradient.startColor() },
{ p, gradient.endColor() }, { 1.0, gradient.endColor() } } );
auto* const tNode = ensure< QSGTransformNode, par< 1, QskBoxNode > >::node( node );
auto* const boxNode = static_cast< QskBoxNode* >( tNode->firstChild() );
updateBoxNode( sensor, boxNode, { 0, 0, 2 * r1, 2 * r1 }, shape, bmetrics, bcolors, gradient );
const auto matrix = matrix_deg( 0, 0, 0, cX, cY, 0 ) * matrix_deg( 0, 0, rZ, 0, 0, 0 ) *
matrix_deg( 0, 0, 0, -r1, -r1, 0 );
tNode->setMatrix( matrix );
2023-07-10 13:54:53 +00:00
return tNode;
}
template<>
2023-07-20 10:01:16 +00:00
QSGNode* QskLevelingSensorSkinlet::updateSubNode< R::TickmarksX >(
const QskLevelingSensor* const sensor, const quint8 nodeRole, QSGNode* const node ) const
2023-07-10 13:54:53 +00:00
{
const auto subControl = Q::TickmarksX;
2023-07-20 10:01:16 +00:00
const auto color = sensor->color( subControl );
const auto scale = sensor->strutSizeHint( subControl );
const auto cX = center( sensor ).x();
const auto cY = center( sensor ).y();
2023-07-10 13:54:53 +00:00
2023-07-20 10:01:16 +00:00
const auto rotation = sensor->subControlRotation( subControl );
2023-07-10 13:54:53 +00:00
2023-07-20 10:01:16 +00:00
const auto r1 = innerRadius( sensor );
const auto r2 = outerRadius( sensor );
2023-07-10 13:54:53 +00:00
const auto r3 = r1 * scale.height();
const auto sX = r1 / sensor->angle().x();
const auto sY = r1 / sensor->angle().y();
2023-07-20 10:01:16 +00:00
const auto tX = static_cast< float >( rotation.y() * sX );
const auto tY = static_cast< float >( rotation.x() * sY );
2023-07-10 13:54:53 +00:00
2023-07-20 10:01:16 +00:00
auto* const clipping =
ensure< PolygonClipNode, par< 1, QSGTransformNode, par< 1, LinearTickmarksNode > > >::node(
node );
auto* const transform = static_cast< QSGTransformNode* >( clipping->firstChild() );
auto* const tickmarks = static_cast< LinearTickmarksNode* >( transform->firstChild() );
2023-07-10 13:54:53 +00:00
2023-07-20 10:01:16 +00:00
auto size = qvariant_cast< QVector3D >( sensor->effectiveSkinHint( subControl ) ) * r3;
2023-07-10 13:54:53 +00:00
2023-07-20 10:01:16 +00:00
clipping->setGeometryProperties( r1, cX, cY );
2023-07-10 13:54:53 +00:00
2023-07-20 10:01:16 +00:00
tickmarks->setMaterialProperties( color );
tickmarks->setGeometryProperties(
sensor->tickmarks( Qt::XAxis ), size, { sX, 0.0f }, { tX, tY } );
2023-07-10 13:54:53 +00:00
2023-07-20 10:01:16 +00:00
const auto matrix = matrix_deg( 0, 0, rotation.z(), cX, cY, 0 );
transform->setMatrix( matrix );
2023-07-10 13:54:53 +00:00
return clipping;
}
template<>
2023-07-20 10:01:16 +00:00
QSGNode* QskLevelingSensorSkinlet::updateSubNode< R::TickmarksY >(
const QskLevelingSensor* const sensor, const quint8 nodeRole, QSGNode* const node ) const
2023-07-10 13:54:53 +00:00
{
const auto subControl = Q::TickmarksY;
2023-07-20 10:01:16 +00:00
const State< QskAspect::Subcontrol > state( sensor, subControl );
const auto color = sensor->color( subControl );
const auto scale = sensor->strutSizeHint( subControl );
const auto r3 = state.r1 * scale.width();
const auto rotation = sensor->subControlRotation( subControl );
auto* const cNode =
ensure< PolygonClipNode, par< 1, QSGTransformNode, par< 1, LinearTickmarksNode > > >::node(
node );
auto* const tNode = static_cast< QSGTransformNode* >( cNode->firstChild() );
auto* const lNode = static_cast< LinearTickmarksNode* >( tNode->firstChild() );
auto size = qvariant_cast< QVector3D >( sensor->effectiveSkinHint( subControl ) ) * r3;
cNode->setGeometryProperties( state.r1, state.cX, state.cY );
const auto sY = static_cast< float >( state.r1 / sensor->angle().y() );
lNode->setMaterialProperties( color );
lNode->setGeometryProperties( sensor->tickmarks( Qt::YAxis ), size, { 0.0f, sY },
{ ( float ) state.tX, ( float ) state.tY } );
const auto matrix = matrix_deg( 0, 0, state.rZ, state.cX, state.cY );
tNode->setMatrix( matrix );
2023-07-10 13:54:53 +00:00
return cNode;
}
template<>
2023-07-20 10:01:16 +00:00
QSGNode* QskLevelingSensorSkinlet::updateSubNode< R::TickmarksZ >(
const QskLevelingSensor* const sensor, const quint8 nodeRole, QSGNode* const node ) const
2023-07-10 13:54:53 +00:00
{
const auto subControl = Q::TickmarksZ;
2023-07-20 10:01:16 +00:00
const auto color = sensor->color( subControl );
const auto scale = sensor->strutSizeHint( subControl );
const auto r1 = innerRadius( sensor );
const auto r2 = outerRadius( sensor );
const auto r3 =
qvariant_cast< QVector3D >( sensor->effectiveSkinHint( subControl ) ) * ( r2 - r1 ) +
QVector3D{ r1, r1, r1 };
auto* const transform = ensure< QSGTransformNode, par< 1, RadialTickmarksNode > >::node( node );
auto* const tickmarksNode = static_cast< RadialTickmarksNode* >( transform->firstChild() );
tickmarksNode->setMaterialProperties( color );
tickmarksNode->setGeometryProperties( sensor->tickmarks( Qt::ZAxis ), r1, r3 );
const auto rZ = sensor->subControlRotation( subControl ).z();
const auto tX = center( sensor ).x();
const auto tY = center( sensor ).y();
const auto matrix = matrix_deg( 0.0, 0.0, rZ, tX, tY );
transform->setMatrix( matrix );
2023-07-10 13:54:53 +00:00
return transform;
}
template<>
2023-07-20 10:01:16 +00:00
QSGNode* QskLevelingSensorSkinlet::updateSubNode< R::TickmarksXLabels >(
const QskLevelingSensor* const sensor, const quint8 nodeRole, QSGNode* const node ) const
2023-07-10 13:54:53 +00:00
{
const auto subControl = Q::TickmarksXLabels;
2023-07-20 10:01:16 +00:00
const auto r1 = innerRadius( sensor );
const auto r3 = static_cast< float >( r1 * sensor->strutSizeHint( Q::TickmarksX ).height() );
2023-07-10 13:54:53 +00:00
const auto sX = r1 / sensor->angle().x();
const auto sY = r1 / sensor->angle().y();
2023-07-20 10:01:16 +00:00
const auto rotation = sensor->subControlRotation( subControl );
const auto rZ = rotation.z();
const auto cX = center( sensor ).x();
const auto cY = center( sensor ).y();
const auto tX = rotation.y() * sX;
const auto tY = r3 + rotation.x() * sY;
auto* const cNode = ensure< PolygonClipNode,
par< 1, QSGTransformNode, par< 1, LinearTickmarksLabelsNode > > >::node( node );
auto* const tNode = static_cast< QSGTransformNode* >( cNode->firstChild() );
auto* const lNode = static_cast< LinearTickmarksLabelsNode* >( tNode->firstChild() );
tNode->setMatrix( matrix_deg( 0.0, 0.0, rZ, cX, cY ) );
cNode->setGeometryProperties( r1, center( sensor ).x(), center( sensor ).y() );
lNode->update(
sensor, subControl, sensor->tickmarkLabels( Qt::XAxis ), { sX, 0.0 }, { tX, tY } );
2023-07-10 13:54:53 +00:00
return cNode;
}
template<>
2023-07-20 10:01:16 +00:00
QSGNode* QskLevelingSensorSkinlet::updateSubNode< R::TickmarksYLabels >(
const QskLevelingSensor* const sensor, const quint8 nodeRole, QSGNode* const node ) const
2023-07-10 13:54:53 +00:00
{
const auto subControl = Q::TickmarksYLabels;
2023-07-20 10:01:16 +00:00
const auto r1 = innerRadius( sensor );
const auto r3 = static_cast< float >( r1 * sensor->strutSizeHint( Q::TickmarksY ).width() );
const auto cX = static_cast< float >( center( sensor ).x() );
const auto cY = static_cast< float >( center( sensor ).y() );
const auto scale = sensor->strutSizeHint( subControl );
const auto angles = sensor->angle();
const auto rotation = sensor->subControlRotation( subControl );
const auto sX = r1 / angles.x();
const auto sY = r1 / angles.y();
const auto tX = static_cast< float >( rotation.y() * sX );
const auto tY = static_cast< float >( rotation.x() * sY );
auto* const cNode = ensure< PolygonClipNode,
par< 1, QSGTransformNode, par< 1, LinearTickmarksLabelsNode > > >::node( node );
auto* const tNode = static_cast< QSGTransformNode* >( cNode->firstChild() );
auto* const lNode = static_cast< LinearTickmarksLabelsNode* >( tNode->firstChild() );
cNode->setGeometryProperties( r1, cX, cY );
tNode->setMatrix( matrix_deg( 0.0, 0.0, rotation.z(), cX, cY ) );
lNode->update( sensor, subControl, sensor->tickmarkLabels( Qt::YAxis ),
{ 0.0, r1 / sensor->angle().y() }, { r3 + tX, tY } );
2023-07-10 13:54:53 +00:00
return cNode;
}
template<>
2023-07-20 10:01:16 +00:00
QSGNode* QskLevelingSensorSkinlet::updateSubNode< R::TickmarksZLabels >(
const QskLevelingSensor* const sensor, const quint8 nodeRole, QSGNode* const node ) const
2023-07-10 13:54:53 +00:00
{
const auto subControl = Q::TickmarksZLabels;
2023-07-20 10:01:16 +00:00
auto* const tNode =
ensure< QSGTransformNode, par< 1, RadialTickmarksLabelsNode > >::node( node );
auto* const lNode = static_cast< RadialTickmarksLabelsNode* >( tNode->firstChild() );
const auto r1 = innerRadius( sensor );
const auto r3 = static_cast< float >( r1 * sensor->strutSizeHint( subControl ).width() );
const auto cX = static_cast< float >( center( sensor ).x() );
const auto cY = static_cast< float >( center( sensor ).y() );
const auto rZ = sensor->subControlRotation( subControl ).z();
lNode->update( sensor, subControl, sensor->tickmarkLabels( Qt::ZAxis ), { r3, r3 } );
tNode->setMatrix( matrix_deg( 0.0, 0.0, rZ, cX, cY ) );
2023-07-10 13:54:53 +00:00
return tNode;
}
template<>
2023-07-20 10:01:16 +00:00
QSGNode* QskLevelingSensorSkinlet::updateSubNode< R::HorizonClip >(
const QskLevelingSensor* const sensor, const quint8 nodeRole, QSGNode* const node ) const
2023-07-10 13:54:53 +00:00
{
2023-07-20 10:01:16 +00:00
const auto cX = center( sensor ).x();
const auto cY = center( sensor ).y();
const auto r1 = innerRadius( sensor );
2023-07-10 13:54:53 +00:00
2023-07-20 10:01:16 +00:00
auto* const clipNode = ensure< PolygonClipNode >::node( node );
clipNode->setGeometryProperties( r1, cX, cY );
2023-07-10 13:54:53 +00:00
return clipNode;
}
2023-07-17 09:14:43 +00:00
QSGNode* QskLevelingSensorSkinlet::updateSubNode(
2023-07-20 10:01:16 +00:00
const QskSkinnable* const skinnable, const quint8 nodeRole, QSGNode* const node ) const
2023-07-10 13:54:53 +00:00
{
2023-07-20 10:01:16 +00:00
const auto* const sensor = static_cast< const Q* >( skinnable );
2023-07-10 13:54:53 +00:00
2023-07-20 10:01:16 +00:00
const auto subControl = [ nodeRole, sensor ]() {
switch ( static_cast< R >( nodeRole ) )
2023-07-10 13:54:53 +00:00
{
2023-07-20 10:01:16 +00:00
case OuterDisk:
return Q::OuterDisk;
case Horizon:
return Q::Horizon;
case HorizonClip:
return Q::Horizon;
case TickmarksX:
return Q::TickmarksX;
case TickmarksXLabels:
return Q::TickmarksXLabels;
case TickmarksY:
return Q::TickmarksY;
case TickmarksYLabels:
return Q::TickmarksYLabels;
case TickmarksZ:
return Q::TickmarksZ;
case TickmarksZLabels:
return Q::TickmarksZLabels;
default:
return QskAspect::NoSubcontrol;
2023-07-10 13:54:53 +00:00
}
}();
2023-07-20 10:01:16 +00:00
if ( qvariant_cast< bool >( sensor->effectiveSkinHint( subControl | QskAspect::Option ) ) )
2023-07-10 13:54:53 +00:00
{
return nullptr;
}
2023-07-20 10:01:16 +00:00
switch ( static_cast< R >( nodeRole ) )
2023-07-10 13:54:53 +00:00
{
2023-07-20 10:01:16 +00:00
case OuterDisk:
return updateSubNode< OuterDisk >( sensor, nodeRole, node );
case Horizon:
return updateSubNode< Horizon >( sensor, nodeRole, node );
case HorizonClip:
return updateSubNode< HorizonClip >( sensor, nodeRole, node );
case TickmarksX:
return updateSubNode< TickmarksX >( sensor, nodeRole, node );
case TickmarksXLabels:
return updateSubNode< TickmarksXLabels >( sensor, nodeRole, node );
case TickmarksY:
return updateSubNode< TickmarksY >( sensor, nodeRole, node );
case TickmarksYLabels:
return updateSubNode< TickmarksYLabels >( sensor, nodeRole, node );
case TickmarksZ:
return updateSubNode< TickmarksZ >( sensor, nodeRole, node );
case TickmarksZLabels:
return updateSubNode< TickmarksZLabels >( sensor, nodeRole, node );
default:
return Inherited::updateSubNode( sensor, nodeRole, node );
2023-07-10 13:54:53 +00:00
}
}
#include "moc_QskLevelingSensorSkinlet.cpp"