22 double xMin,
double xMax,
double yMin,
double yMax )
24 const double y = sample.
value;
28 const bool isOffScreen = ( y < yMin ) || ( y > yMax )
29 || ( x1 < xMin && x2 < xMin ) || ( x1 > xMax && x2 > xMax );
35 double xMin,
double xMax,
double yMin,
double yMax )
37 const double x = sample.
value;
41 const bool isOffScreen = ( x < xMin ) || ( x > xMax )
42 || ( y1 < yMin && y2 < yMin ) || ( y1 > yMax && y2 > yMax );
59 pen.setCapStyle( Qt::FlatCap );
240 setPen( QPen( color, width, style ) );
304 rect.setRect( rect.y(), rect.x(), rect.height(), rect.width() );
324 const QRectF &canvasRect,
int from,
int to )
const 338 drawTube( painter, xMap, yMap, canvasRect, from, to );
350 xMap, yMap, canvasRect, from, to );
373 const QRectF &canvasRect,
int from,
int to )
const 379 const size_t size = to - from + 1;
380 QPolygonF polygon( 2 * size );
381 QPointF *points = polygon.data();
383 for ( uint i = 0; i < size; i++ )
385 QPointF &minValue = points[i];
386 QPointF &maxValue = points[2 * size - 1 - i];
427 painter->setPen( QPen( Qt::NoPen ) );
434 canvasRect.adjusted( -m, -m, m, m ), polygon, true );
447 painter->setBrush( Qt::NoBrush );
452 const QRectF clipRect = canvasRect.adjusted( -pw, -pw, pw, pw );
456 std::memcpy( p.data(), points, size *
sizeof( QPointF ) );
460 std::memcpy( p.data(), points + size, size *
sizeof( QPointF ) );
490 const QRectF &canvasRect,
int from,
int to )
const 495 pen.setCapStyle( Qt::FlatCap );
497 painter->setPen( pen );
498 painter->setBrush( symbol.
brush() );
502 const double xMin = tr.left();
503 const double xMax = tr.right();
504 const double yMin = tr.top();
505 const double yMax = tr.bottom();
509 for (
int i = from; i <= to; i++ )
522 QPointF( x, y1 ), QPointF( x, y2 ) );
534 QPointF( x1, y ), QPointF( x2, y ) );
555 int index,
const QSizeF &size )
const 559 if ( size.isEmpty() )
566 QPainter painter( &icon );
567 painter.setRenderHint( QPainter::Antialiasing,
572 QRectF r( 0, 0, size.width(), size.height() );
580 pen.setWidthF( pen.widthF() );
581 pen.setCapStyle( Qt::FlatCap );
583 painter.setPen( pen );
588 const double x = 0.5 * size.width();
591 QPointF( x, 0 ), QPointF( x, size.height() - 1.0 ) );
595 const double y = 0.5 * size.height();
598 QPointF( 0.0, y ), QPointF( size.width() - 1.0, y ) );
virtual void legendChanged()
Qt::Orientation orientation() const
virtual void drawSymbols(QPainter *, const QwtIntervalSymbol &, const QwtScaleMap &xMap, const QwtScaleMap &yMap, const QRectF &canvasRect, int from, int to) const
void setSamples(const QVector< QwtIntervalSample > &)
virtual ~QwtPlotIntervalCurve()
Destructor.
QwtPlotIntervalCurve(const QString &title=QString())
QwtPlotIntervalCurve::PaintAttributes paintAttributes
static bool qwtIsHSampleInside(const QwtIntervalSample &sample, double xMin, double xMax, double yMin, double yMax)
void setData(QwtSeriesData< QwtIntervalSample > *series)
void setPen(const QColor &, qreal width=0.0, Qt::PenStyle=Qt::SolidLine)
QwtSeriesData< QwtIntervalSample > * data()
static QPolygonF clippedPolygonF(const QRectF &, const QPolygonF &, bool closePolygon=false)
void setRenderHint(RenderHint, bool on=true)
static qreal effectivePenWidth(const QPen &)
void setDefaultSize(const QSizeF &)
Set a default size.
void setPaintAttribute(PaintAttribute, bool on=true)
The item is represented on the legend.
static bool qwtIsVSampleInside(const QwtIntervalSample &sample, double xMin, double xMax, double yMin, double yMax)
void setStyle(CurveStyle style)
const QBrush & brush() const
static void drawPolygon(QPainter *, const QPolygonF &)
Wrapper for QPainter::drawPolygon()
virtual void drawSeries(QPainter *, const QwtScaleMap &xMap, const QwtScaleMap &yMap, const QRectF &canvasRect, int from, int to) const QWT_OVERRIDE
bool testRenderHint(RenderHint) const
A sample of the types (x1-x2, y) or (x, y1-y2)
virtual int rtti() const QWT_OVERRIDE
const QBrush & brush() const
A class representing a text.
A drawing primitive for displaying an interval like an error bar.
virtual void drawTube(QPainter *, const QwtScaleMap &xMap, const QwtScaleMap &yMap, const QRectF &canvasRect, int from, int to) const
const QwtIntervalSymbol * symbol
void setZ(double z)
Set the z value.
bool testPaintAttribute(PaintAttribute) const
virtual QRectF boundingRect() const QWT_OVERRIDE
A paint device for scalable graphics.
For QwtPlotIntervalCurve.
double invTransform(double p) const
QwtIntervalSample sample(int index) const
virtual void itemChanged()
virtual QwtGraphic legendIcon(int index, const QSizeF &) const QWT_OVERRIDE
Interface for iterating over an array of intervals.
static void drawPolyline(QPainter *, const QPolygonF &)
Wrapper for QPainter::drawPolyline()
Check if a symbol is on the plot canvas before painting it.
void setBrush(const QBrush &)
virtual size_t dataSize() const QWT_OVERRIDE
QwtPlotIntervalCurve::CurveStyle style
void init()
Initialize internal members.
Base class for plot items representing a series of samples.
void setItemAttribute(ItemAttribute, bool on=true)
double transform(double s) const
void setSymbol(const QwtIntervalSymbol *)
virtual void draw(QPainter *, Qt::Orientation, const QPointF &from, const QPointF &to) const
QFlags< PaintAttribute > PaintAttributes
Paint attributes.
const QwtIntervalSymbol * symbol() const
No Style. The symbol cannot be drawn.
QwtPlotIntervalCurve represents a series of samples, where each value is associated with an interval ...
static bool roundingAlignment()
virtual QRectF boundingRect() const QWT_OVERRIDE
const QwtText & title() const
QwtInterval interval
Interval.
CurveStyle
Curve styles. The default setting is QwtPlotIntervalCurve::Tube.