Go to the documentation of this file.
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 );
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 );
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++ )
518 const double y1 = yMap.
transform(
s.interval.minValue() );
519 const double y2 = yMap.
transform(
s.interval.maxValue() );
522 QPointF(
x, y1 ), QPointF(
x, y2 ) );
530 const double x1 = xMap.
transform(
s.interval.minValue() );
531 const double x2 = xMap.
transform(
s.interval.maxValue() );
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 ) );
void setStyle(CurveStyle style)
QwtInterval interval
Interval.
virtual QRectF boundingRect() const QWT_OVERRIDE
double invTransform(double p) const
bool testPaintAttribute(PaintAttribute) const
QwtArraySeriesData< QwtIntervalSample > QwtIntervalSeriesData
Interface for iterating over an array of intervals.
QwtIntervalSample sample(int index) const
@ NoSymbol
No Style. The symbol cannot be drawn.
void setPen(const QColor &, qreal width=0.0, Qt::PenStyle=Qt::SolidLine)
virtual void legendChanged()
Base class for plot items representing a series of samples.
A paint device for scalable graphics.
static void drawPolyline(QPainter *, const QPolygonF &)
Wrapper for QPainter::drawPolyline()
Qt::Orientation orientation() const
void setSymbol(const QwtIntervalSymbol *)
void setBrush(const QBrush &)
void setRenderHint(RenderHint, bool on=true)
void setData(QwtSeriesData< QwtIntervalSample > *series)
@ Legend
The item is represented on the legend.
static bool roundingAlignment()
QwtPlotIntervalCurve::PaintAttributes paintAttributes
QwtPlotIntervalCurve(const QString &title=QString())
@ Rtti_PlotIntervalCurve
For QwtPlotIntervalCurve.
span_constexpr std::size_t size(span< T, Extent > const &spn)
void init()
Initialize internal members.
A class representing a text.
QwtPlotIntervalCurve represents a series of samples, where each value is associated with an interval ...
void setZ(double z)
Set the z value.
static bool qwtIsHSampleInside(const QwtIntervalSample &sample, double xMin, double xMax, double yMin, double yMax)
CurveStyle
Curve styles. The default setting is QwtPlotIntervalCurve::Tube.
A sample of the types (x1-x2, y) or (x, y1-y2)
QwtSeriesData< QwtIntervalSample > * data()
double transform(double s) const
virtual void itemChanged()
virtual int rtti() const QWT_OVERRIDE
virtual size_t dataSize() const QWT_OVERRIDE
const QBrush & brush() const
virtual void draw(QPainter *, Qt::Orientation, const QPointF &from, const QPointF &to) const
virtual void drawTube(QPainter *, const QwtScaleMap &xMap, const QwtScaleMap &yMap, const QRectF &canvasRect, int from, int to) const
const QBrush & brush() const
virtual void drawSymbols(QPainter *, const QwtIntervalSymbol &, const QwtScaleMap &xMap, const QwtScaleMap &yMap, const QRectF &canvasRect, int from, int to) const
const QwtIntervalSymbol * symbol
virtual QwtGraphic legendIcon(int index, const QSizeF &) const QWT_OVERRIDE
void setItemAttribute(ItemAttribute, bool on=true)
const QwtIntervalSymbol * symbol() const
void setSamples(const QVector< QwtIntervalSample > &)
virtual ~QwtPlotIntervalCurve()
Destructor.
static qreal effectivePenWidth(const QPen &)
QWT_EXPORT QPolygonF clippedPolygonF(const QRectF &, const QPolygonF &, bool closePolygon=false)
void setPaintAttribute(PaintAttribute, bool on=true)
virtual void drawSeries(QPainter *, const QwtScaleMap &xMap, const QwtScaleMap &yMap, const QRectF &canvasRect, int from, int to) const QWT_OVERRIDE
static bool qwtIsVSampleInside(const QwtIntervalSample &sample, double xMin, double xMax, double yMin, double yMax)
@ ClipSymbol
Check if a symbol is on the plot canvas before painting it.
static void drawPolygon(QPainter *, const QPolygonF &)
Wrapper for QPainter::drawPolygon()
virtual QRectF boundingRect() const QWT_OVERRIDE
A drawing primitive for displaying an interval like an error bar.
bool testRenderHint(RenderHint) const
QwtPlotIntervalCurve::CurveStyle style
@ RenderAntialiased
Enable antialiasing.
void setDefaultSize(const QSizeF &)
Set a default size.
plotjuggler
Author(s): Davide Faconti
autogenerated on Mon Nov 11 2024 03:23:46