Go to the documentation of this file.
23 return map.isInverting() ? ( radius >
map.s1() ) : ( radius <
map.s1() );
31 i1 = qBound( 0, i1,
size - 1 );
32 i2 = qBound( 0, i2,
size - 1 );
37 return ( i2 - i1 + 1 );
48 pen = QPen( Qt::black );
278 const QPointF& pole,
double radius,
279 const QRectF& canvasRect )
const
282 Q_UNUSED( canvasRect );
284 draw( painter, azimuthMap, radialMap, pole, 0, -1 );
301 const QPointF& pole,
int from,
int to )
const
315 azimuthMap, radialMap, pole, from, to );
323 azimuthMap, radialMap, pole, from, to );
343 const QPointF& pole,
int from,
int to )
const
348 drawLines( painter, azimuthMap, radialMap, pole, from, to );
369 const QPointF& pole,
int from,
int to )
const
371 int size = to - from + 1;
379 QPolygonF points(
size );
380 for (
int j = from; j <= to; j++ )
383 points[j - from] = QPointF( point.
azimuth(), point.
radius() );
388 polyline.resize( points.size() );
390 QPointF* polylineData = polyline.data();
391 QPointF* pointsData = points.data();
393 for (
int i = 0; i < points.size(); i++ )
405 polyline.resize(
size );
406 QPointF* polylineData = polyline.data();
408 for (
int i = from; i <= to; i++ )
419 polylineData[i - from] = pole;
425 if ( painter->hasClipping() )
427 clipRect = painter->clipRegion().boundingRect();
431 clipRect = painter->window();
432 if ( !clipRect.isEmpty() )
433 clipRect = painter->transform().inverted().mapRect( clipRect );
436 if ( !clipRect.isEmpty() )
438 double off = qCeil( qMax( qreal( 1.0 ), painter->pen().widthF() ) );
439 clipRect = clipRect.toRect().adjusted( -off, -off, off, off );
461 const QPointF& pole,
int from,
int to )
const
466 const int chunkSize = 500;
468 for (
int i = from; i <= to; i += chunkSize )
470 const int n = qMin( chunkSize, to - i + 1 );
473 for (
int j = 0; j < n; j++ )
490 if ( points.size() > 0 )
514 const QSizeF&
size )
const
518 if (
size.isEmpty() )
525 QPainter painter( &graphic );
526 painter.setRenderHint( QPainter::Antialiasing,
543 if ( brush.style() != Qt::NoBrush )
545 QRectF r( 0, 0,
size.width(),
size.height() );
546 painter.fillRect( r, brush );
552 if (
pen() != Qt::NoPen )
555 pn.setCapStyle( Qt::FlatCap );
557 painter.setPen( pn );
559 const double y = 0.5 *
size.height();
568 QRectF r( 0, 0,
size.width(),
size.height() );
590 return QwtInterval( boundingRect.left(), boundingRect.right() );
593 return QwtInterval( boundingRect.top(), boundingRect.bottom() );
void setData(QwtSeriesData< QwtPointPolar > *data)
QwtPolarCurve()
Constructor.
@ RenderAntialiased
Enable antialiasing.
void setItemAttribute(ItemAttribute, bool on=true)
void drawLines(QPainter *, const QwtScaleMap &azimuthMap, const QwtScaleMap &radialMap, const QPointF &pole, int from, int to) const
QwtPolarCurve::LegendAttributes legendAttributes
QwtPointPolar sample(int i) const
@ Legend
The item is represented on the legend.
void drawSymbols(QPainter *, const QPolygonF &) const
Draw symbols at the specified points.
static bool qwtInsidePole(const QwtScaleMap &map, double radius)
A paint device for scalable graphics.
static void drawPolyline(QPainter *, const QPolygonF &)
Wrapper for QPainter::drawPolyline()
void setRenderHint(RenderHint, bool on=true)
@ LegendShowSymbol
If the curve has a valid symbol it is painted.
LegendAttribute
Attributes how to represent the curve on the legend.
@ Rtti_PolarCurve
For QwtPolarCurve.
QPoint qwtPolar2Pos(const QPoint &pole, double radius, double angle)
void setStyle(CurveStyle style)
static int qwtVerifyRange(int size, int &i1, int &i2)
virtual void drawSymbols(QPainter *, const QwtSymbol &, const QwtScaleMap &azimuthMap, const QwtScaleMap &radialMap, const QPointF &pole, int from, int to) const
QwtSeriesData< QwtPointPolar > * m_series
A point in polar coordinates.
void setZ(double z)
Set the z value.
virtual void draw(QPainter *p, const QwtScaleMap &azimuthMap, const QwtScaleMap &radialMap, const QPointF &pole, double radius, const QRectF &canvasRect) const QWT_OVERRIDE
@ NoSymbol
No Style. The symbol cannot be drawn.
span_constexpr std::size_t size(span< T, Extent > const &spn)
virtual int rtti() const QWT_OVERRIDE
A class representing an interval.
const QBrush & brush() const
A class representing a text.
double azimuth() const
Returns the azimuth.
virtual QPolygonF fitCurve(const QPolygonF &polygon) const =0
A class for drawing symbols.
virtual void itemChanged()
virtual QRectF boundingRect() const
Abstract base class for a curve fitter.
void drawSymbol(QPainter *, const QRectF &) const
Draw the symbol into a rectangle.
static void drawLine(QPainter *, qreal x1, qreal y1, qreal x2, qreal y2)
Wrapper for QPainter::drawLine()
@ NoCurve
Don't draw a curve. Note: This doesn't affect the symbols.
Base class for items on a polar plot.
void setRenderHint(RenderHint, bool on=true)
QWT_EXPORT void clipPolygonF(const QRectF &, QPolygonF &, bool closePolygon=false)
@ ScaleAzimuth
Azimuth scale.
void init()
Initialize data members.
double transform(double s) const
void setSymbol(QwtSymbol *)
Assign a symbol.
virtual ~QwtPolarCurve()
Destructor.
void setCurveFitter(QwtCurveFitter *)
Insert a curve fitter.
virtual void drawCurve(QPainter *, int style, const QwtScaleMap &azimuthMap, const QwtScaleMap &radialMap, const QPointF &pole, int from, int to) const
An item, that represents a series of points.
QwtCurveFitter * curveFitter
@ ScaleRadius
Radial scale.
QwtPolarCurve::CurveStyle style
virtual size_t size() const =0
virtual QwtGraphic legendIcon(int index, const QSizeF &) const QWT_OVERRIDE
double radius() const
Returns the radius.
void setLegendAttribute(LegendAttribute, bool on=true)
const QwtSeriesData< QwtPointPolar > * data() const
void setPen(const QPen &)
Assign a pen.
bool testRenderHint(RenderHint) const
const QwtSymbol * symbol() const
bool testLegendAttribute(LegendAttribute) const
Test if a legend attribute is enabled.
void setDefaultSize(const QSizeF &)
Set a default size.
QwtCurveFitter * curveFitter() const
virtual QwtInterval boundingInterval(int scaleId) const QWT_OVERRIDE
plotjuggler
Author(s): Davide Faconti
autogenerated on Mon Nov 11 2024 03:23:46