20 double xMin,
double xMax,
double yMin,
double yMax )
22 const double y = sample.
value;
26 const bool isOffScreen = ( y < yMin ) || ( y > yMax )
27 || ( x1 < xMin && x2 < xMin ) || ( x1 > xMax && x2 > xMax );
33 double xMin,
double xMax,
double yMin,
double yMax )
35 const double x = sample.
value;
39 const bool isOffScreen = ( x < xMin ) || ( x > xMax )
40 || ( y1 < yMin && y2 < yMin ) || ( y1 > yMax && y2 > yMax );
57 pen.setCapStyle( Qt::FlatCap );
149 const QVector<QwtIntervalSample> &samples )
238 setPen( QPen( color, width, style ) );
301 if ( rect.isValid() &&
orientation() == Qt::Vertical )
302 rect.setRect( rect.y(), rect.x(), rect.height(), rect.width() );
322 const QRectF &canvasRect,
int from,
int to )
const 336 drawTube( painter, xMap, yMap, canvasRect, from, to );
348 xMap, yMap, canvasRect, from, to );
371 const QRectF &canvasRect,
int from,
int to )
const 377 const size_t size = to - from + 1;
378 QPolygonF polygon( 2 * size );
379 QPointF *points = polygon.data();
381 for ( uint
i = 0;
i < size;
i++ )
383 QPointF &minValue = points[
i];
384 QPointF &maxValue = points[2 * size - 1 -
i];
425 painter->setPen( QPen( Qt::NoPen ) );
432 canvasRect.adjusted( -m, -m, m, m ), polygon, true );
445 painter->setBrush( Qt::NoBrush );
449 qreal pw = qMax( qreal( 1.0 ), painter->pen().widthF() );
450 const QRectF clipRect = canvasRect.adjusted( -pw, -pw, pw, pw );
454 ::memcpy( p.data(), points, size *
sizeof( QPointF ) );
458 ::memcpy( p.data(), points + size, size *
sizeof( QPointF ) );
488 const QRectF &canvasRect,
int from,
int to )
const 493 pen.setCapStyle( Qt::FlatCap );
495 painter->setPen( pen );
496 painter->setBrush( symbol.
brush() );
500 const double xMin = tr.left();
501 const double xMax = tr.right();
502 const double yMin = tr.top();
503 const double yMax = tr.bottom();
507 for (
int i = from;
i <= to;
i++ )
520 QPointF( x, y1 ), QPointF( x, y2 ) );
532 QPointF( x1, y ), QPointF( x2, y ) );
553 int index,
const QSizeF &size )
const 557 if ( size.isEmpty() )
564 QPainter painter( &icon );
565 painter.setRenderHint( QPainter::Antialiasing,
570 QRectF r( 0, 0, size.width(), size.height() );
578 pen.setWidthF( pen.widthF() );
579 pen.setCapStyle( Qt::FlatCap );
581 painter.setPen( pen );
586 const double x = 0.5 * size.width();
589 QPointF( x, 0 ), QPointF( x, size.height() - 1.0 ) );
593 const double y = 0.5 * size.height();
596 QPointF( 0.0, y ), QPointF( size.width() - 1.0, y ) );
virtual void legendChanged()
virtual size_t dataSize() const
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()
TFSIMD_FORCE_INLINE const tfScalar & y() const
static QPolygonF clippedPolygonF(const QRectF &, const QPolygonF &, bool closePolygon=false)
void setRenderHint(RenderHint, bool on=true)
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()
bool testRenderHint(RenderHint) const
A sample of the types (x1-x2, y) or (x, y1-y2)
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.
virtual void drawSeries(QPainter *p, const QwtScaleMap &xMap, const QwtScaleMap &yMap, const QRectF &canvasRect, int from, int to) const
bool testPaintAttribute(PaintAttribute) const
A paint device for scalable graphics.
TFSIMD_FORCE_INLINE const tfScalar & x() const
virtual QRectF boundingRect() const
For QwtPlotIntervalCurve.
double invTransform(double p) const
QwtIntervalSample sample(int index) const
virtual void itemChanged()
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 &)
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 QwtGraphic legendIcon(int index, const QSizeF &) const
virtual QRectF boundingRect() const
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()
const QwtText & title() const
QwtInterval interval
Interval.
CurveStyle
Curve styles. The default setting is QwtPlotIntervalCurve::Tube.