121 angle1 = qBound( -360.0, angle1, 360.0 );
122 angle2 = qBound( -360.0, angle2, 360.0 );
168 const QSizeF sz = label.
textSize( painter->font() );
172 ( radius + sz.width() / 2.0 ) * std::sin( arc );
174 ( radius + sz.height() / 2.0 ) * std::cos( arc );
176 const QRectF r( x - sz.width() / 2, y - sz.height() / 2,
177 sz.width(), sz.height() );
178 label.
draw( painter, r );
206 const double sinArc = std::sin( arc );
207 const double cosArc = std::cos( arc );
209 const double x1 = cx + radius * sinArc;
210 const double x2 = cx + ( radius + len ) * sinArc;
211 const double y1 = cy - radius * cosArc;
212 const double y2 = cy - ( radius + len ) * cosArc;
229 const int a1 = qRound(
qwtMinF( deg1, deg2 ) - 90 );
230 const int a2 = qRound(
qwtMaxF( deg1, deg2 ) - 90 );
236 painter->drawArc( QRectF( x, y, 2 * radius, 2 * radius ),
237 -a2 * 16, ( a2 - a1 + 1 ) * 16 );
263 for (
int i = 0; i < ticks.count(); i++ )
265 const double value = ticks[i];
279 const QSizeF sz = label.
textSize( font );
280 const double off = qMax( sz.width(), sz.height() );
282 double x = off * std::sin( arc );
283 double y = off * std::cos( arc );
285 const double dist = std::sqrt( x * x + y * y );
virtual void drawBackbone(QPainter *) const QWT_OVERRIDE
double tickLength(QwtScaleDiv::TickType) const
const QwtText & tickLabel(const QFont &, double value) const
Convert a value into its representing label and cache it.
QList< double > ticks(int tickType) const
static void drawLine(QPainter *, qreal x1, qreal y1, qreal x2, qreal y2)
Wrapper for QPainter::drawLine()
QWT_CONSTEXPR float qwtMaxF(float a, float b)
bool contains(double value) const
virtual ~QwtRoundScaleDraw()
Destructor.
A class representing a scale division.
double transform(double s) const
QWT_CONSTEXPR float qwtMinF(float a, float b)
virtual void drawLabel(QPainter *, double value) const QWT_OVERRIDE
void moveCenter(double x, double y)
Move the center of the scale draw, leaving the radius unchanged.
void draw(QPainter *painter, const QRectF &rect) const
double qwtRadians(double degrees)
Translate degrees into radians.
bool hasComponent(ScaleComponent) const
const QwtScaleDiv & scaleDiv() const
virtual QwtText label(double) const
Convert a value into its representing label.
void setPaintInterval(double p1, double p2)
Specify the borders of the paint device interval.
A class representing a text.
double minimumExtent() const
QwtRoundScaleDraw()
Constructor.
Backbone = the line where the ticks are located.
QPointF center() const
Get the center of the scale.
virtual double extent(const QFont &) const QWT_OVERRIDE
void setAngleRange(double angle1, double angle2)
Adjust the baseline circle segment for round scales.
virtual void drawTick(QPainter *, double value, double len) const QWT_OVERRIDE
const QwtScaleMap & scaleMap() const
void setRadius(double radius)
double maxTickLength() const
double spacing() const
Get the spacing.