/*! \brief Constructor Initializes a label map for multiples of 45 degrees */ QwtCompassScaleDraw::QwtCompassScaleDraw() { enableComponent( QwtAbstractScaleDraw::Backbone, false ); enableComponent( QwtAbstractScaleDraw::Ticks, false ); d_labelMap.insert( 0.0, QString::fromLatin1( "N" ) ); d_labelMap.insert( 45.0, QString::fromLatin1( "NE" ) ); d_labelMap.insert( 90.0, QString::fromLatin1( "E" ) ); d_labelMap.insert( 135.0, QString::fromLatin1( "SE" ) ); d_labelMap.insert( 180.0, QString::fromLatin1( "S" ) ); d_labelMap.insert( 225.0, QString::fromLatin1( "SW" ) ); d_labelMap.insert( 270.0, QString::fromLatin1( "W" ) ); d_labelMap.insert( 315.0, QString::fromLatin1( "NW" ) ); #if 0 d_labelMap.insert( 22.5, QString::fromLatin1( "NNE" ) ); d_labelMap.insert( 67.5, QString::fromLatin1( "NEE" ) ); d_labelMap.insert( 112.5, QString::fromLatin1( "SEE" ) ); d_labelMap.insert( 157.5, QString::fromLatin1( "SSE" ) ); d_labelMap.insert( 202.5, QString::fromLatin1( "SSW" ) ); d_labelMap.insert( 247.5, QString::fromLatin1( "SWW" ) ); d_labelMap.insert( 292.5, QString::fromLatin1( "NWW" ) ); d_labelMap.insert( 337.5, QString::fromLatin1( "NNW" ) ); #endif }
BarScaleDrawX() { enableComponent(QwtScaleDraw::Backbone, false); enableComponent(QwtScaleDraw::Ticks, false); setLabelAlignment(Qt::AlignLeft); setLabelRotation(-90.0); setSpacing(0); }
FrameScaleDraw (Qt::Orientation orientation, std::vector<QString> const & labels) : m_labels( labels ) { setTickLength(QwtScaleDiv::MinorTick, 0); setTickLength(QwtScaleDiv::MediumTick, 1); setTickLength(QwtScaleDiv::MajorTick, 2); enableComponent(QwtScaleDraw::Backbone, false); /*if (orientation == Qt::Vertical) setLabelRotation( -90.0 ); else setLabelRotation( -90.0 );*/ setLabelAlignment(Qt::AlignLeft | Qt::AlignVCenter); }
DistroScaleDraw( Qt::Orientation orientation, const QStringList &labels ): d_labels( labels ) { setTickLength( QwtScaleDiv::MinorTick, 0 ); setTickLength( QwtScaleDiv::MediumTick, 0 ); setTickLength( QwtScaleDiv::MajorTick, 2 ); enableComponent( QwtScaleDraw::Backbone, false ); if ( orientation == Qt::Vertical ) { setLabelRotation( -60.0 ); } else { setLabelRotation( -20.0 ); } setLabelAlignment( Qt::AlignLeft | Qt::AlignVCenter ); }
/*! \brief Constructor \param map Value to label map */ QwtCompassScaleDraw::QwtCompassScaleDraw( const QMap<double, QString> &map ): d_labelMap( map ) { enableComponent( QwtAbstractScaleDraw::Backbone, false ); enableComponent( QwtAbstractScaleDraw::Ticks, false ); }