A plot item, that represents a vector field. More...
#include <qwt_plot_vectorfield.h>
Classes | |
class | PrivateData |
Public Types | |
enum | IndicatorOrigin { OriginHead, OriginTail, OriginCenter } |
enum | MagnitudeMode { MagnitudeAsColor = 0x01, MagnitudeAsLength = 0x02 } |
enum | PaintAttribute { FilterVectors = 0x01 } |
Public Types inherited from QwtPlotItem | |
enum | ItemAttribute { Legend = 0x01, AutoScale = 0x02, Margins = 0x04 } |
Plot Item Attributes. More... | |
enum | ItemInterest { ScaleInterest = 0x01, LegendInterest = 0x02 } |
Plot Item Interests. More... | |
enum | RenderHint { RenderAntialiased = 0x1 } |
Render hints. More... | |
enum | RttiValues { Rtti_PlotItem = 0, Rtti_PlotGrid, Rtti_PlotScale, Rtti_PlotLegend, Rtti_PlotMarker, Rtti_PlotCurve, Rtti_PlotSpectroCurve, Rtti_PlotIntervalCurve, Rtti_PlotHistogram, Rtti_PlotSpectrogram, Rtti_PlotGraphic, Rtti_PlotTradingCurve, Rtti_PlotBarChart, Rtti_PlotMultiBarChart, Rtti_PlotShape, Rtti_PlotTextLabel, Rtti_PlotZone, Rtti_PlotVectorField, Rtti_PlotUserItem = 1000 } |
Runtime type information. More... | |
Public Member Functions | |
virtual double | arrowLength (double magnitude) const |
virtual QRectF | boundingRect () const QWT_OVERRIDE |
QBrush | brush () const |
const QwtColorMap * | colorMap () const |
virtual void | drawSeries (QPainter *, const QwtScaleMap &xMap, const QwtScaleMap &yMap, const QRectF &canvasRect, int from, int to) const QWT_OVERRIDE |
IndicatorOrigin | indicatorOrigin () const |
virtual QwtGraphic | legendIcon (int index, const QSizeF &) const QWT_OVERRIDE |
QwtInterval | magnitudeRange () const |
double | magnitudeScaleFactor () const |
double | maxArrowLength () const |
double | minArrowLength () const |
QPen | pen () const |
QwtPlotVectorField (const QString &title=QString()) | |
QwtPlotVectorField (const QwtText &title) | |
QSizeF | rasterSize () const |
virtual int | rtti () const QWT_OVERRIDE |
void | setBrush (const QBrush &) |
Assign a brush. More... | |
void | setColorMap (QwtColorMap *) |
void | setIndicatorOrigin (IndicatorOrigin) |
void | setMagnitudeMode (MagnitudeMode, bool on=true) |
void | setMagnitudeRange (const QwtInterval &) |
void | setMagnitudeScaleFactor (double factor) |
Set the magnitudeScaleFactor. More... | |
void | setMaxArrowLength (double) |
void | setMinArrowLength (double) |
void | setPaintAttribute (PaintAttribute, bool on=true) |
void | setPen (const QPen &) |
void | setRasterSize (const QSizeF &) |
void | setSamples (const QVector< QwtVectorFieldSample > &) |
void | setSamples (QwtVectorFieldData *) |
void | setSymbol (QwtVectorFieldSymbol *) |
const QwtVectorFieldSymbol * | symbol () const |
bool | testMagnitudeMode (MagnitudeMode) const |
bool | testPaintAttribute (PaintAttribute) const |
virtual | ~QwtPlotVectorField () |
Destructor. More... | |
Public Member Functions inherited from QwtPlotSeriesItem | |
virtual void | draw (QPainter *, const QwtScaleMap &xMap, const QwtScaleMap &yMap, const QRectF &canvasRect) const QWT_OVERRIDE |
Draw the complete series. More... | |
Qt::Orientation | orientation () const |
QwtPlotSeriesItem (const QString &title=QString()) | |
QwtPlotSeriesItem (const QwtText &title) | |
void | setOrientation (Qt::Orientation) |
virtual void | updateScaleDiv (const QwtScaleDiv &, const QwtScaleDiv &) QWT_OVERRIDE |
Update the item to changes of the axes scale division. More... | |
virtual | ~QwtPlotSeriesItem () |
Destructor. More... | |
Public Member Functions inherited from QwtPlotItem | |
void | attach (QwtPlot *plot) |
Attach the item to a plot. More... | |
void | detach () |
This method detaches a QwtPlotItem from any QwtPlot it has been associated with. More... | |
virtual void | getCanvasMarginHint (const QwtScaleMap &xMap, const QwtScaleMap &yMap, const QRectF &canvasRect, double &left, double &top, double &right, double &bottom) const |
Calculate a hint for the canvas margin. More... | |
void | hide () |
Hide the item. More... | |
bool | isVisible () const |
virtual void | itemChanged () |
virtual void | legendChanged () |
virtual QList< QwtLegendData > | legendData () const |
Return all information, that is needed to represent the item on the legend. More... | |
QSize | legendIconSize () const |
QRectF | paintRect (const QwtScaleMap &, const QwtScaleMap &) const |
Calculate the bounding paint rectangle of 2 maps. More... | |
QwtPlot * | plot () const |
Return attached plot. More... | |
QwtPlotItem () | |
QwtPlotItem (const QString &title) | |
QwtPlotItem (const QwtText &title) | |
uint | renderThreadCount () const |
QRectF | scaleRect (const QwtScaleMap &, const QwtScaleMap &) const |
Calculate the bounding scale rectangle of 2 maps. More... | |
void | setAxes (QwtAxisId xAxis, QwtAxisId yAxis) |
void | setItemAttribute (ItemAttribute, bool on=true) |
void | setItemInterest (ItemInterest, bool on=true) |
void | setLegendIconSize (const QSize &) |
void | setRenderHint (RenderHint, bool on=true) |
void | setRenderThreadCount (uint numThreads) |
void | setTitle (const QString &title) |
void | setTitle (const QwtText &title) |
virtual void | setVisible (bool) |
void | setXAxis (QwtAxisId) |
void | setYAxis (QwtAxisId) |
void | setZ (double z) |
Set the z value. More... | |
void | show () |
Show the item. More... | |
bool | testItemAttribute (ItemAttribute) const |
bool | testItemInterest (ItemInterest) const |
bool | testRenderHint (RenderHint) const |
const QwtText & | title () const |
virtual void | updateLegend (const QwtPlotItem *, const QList< QwtLegendData > &) |
Update the item to changes of the legend info. More... | |
QwtAxisId | xAxis () const |
Return xAxis. More... | |
QwtAxisId | yAxis () const |
Return yAxis. More... | |
double | z () const |
virtual | ~QwtPlotItem () |
Destroy the QwtPlotItem. More... | |
Public Member Functions inherited from QwtAbstractSeriesStore | |
virtual | ~QwtAbstractSeriesStore () |
Destructor. More... | |
Public Member Functions inherited from QwtSeriesStore< QwtVectorFieldSample > | |
QwtSeriesData< QwtVectorFieldSample > * | data () |
const QwtSeriesData< QwtVectorFieldSample > * | data () const |
virtual QRectF | dataRect () const QWT_OVERRIDE |
virtual size_t | dataSize () const QWT_OVERRIDE |
QwtSeriesStore () | |
Constructor The store contains no series. More... | |
QwtVectorFieldSample | sample (int index) const |
void | setData (QwtSeriesData< QwtVectorFieldSample > *series) |
virtual void | setRectOfInterest (const QRectF &rect) QWT_OVERRIDE |
QwtSeriesData< QwtVectorFieldSample > * | swapData (QwtSeriesData< QwtVectorFieldSample > *series) |
~QwtSeriesStore () | |
Destructor. More... | |
Protected Member Functions | |
virtual void | dataChanged () QWT_OVERRIDE |
dataChanged() indicates, that the series has been changed. More... | |
virtual void | drawSymbol (QPainter *, double x, double y, double vx, double vy) const |
virtual void | drawSymbols (QPainter *, const QwtScaleMap &xMap, const QwtScaleMap &yMap, const QRectF &canvasRect, int from, int to) const |
Protected Member Functions inherited from QwtPlotItem | |
QwtGraphic | defaultIcon (const QBrush &, const QSizeF &) const |
Return a default icon from a brush. More... | |
Protected Member Functions inherited from QwtAbstractSeriesStore | |
virtual QRectF | dataRect () const =0 |
virtual size_t | dataSize () const =0 |
Private Member Functions | |
void | init () |
Initialize data members. More... | |
Private Attributes | |
PrivateData * | m_data |
A plot item, that represents a vector field.
A vector field is a representation of a points with a given magnitude and direction as arrows. While the direction affects the direction of the arrow, the magnitude might be represented as a color or by the length of the arrow.
Definition at line 30 of file qwt_plot_vectorfield.h.
Depending on the origin the indicator symbol ( usually an arrow ) will be to the position of the corresponding sample.
Enumerator | |
---|---|
OriginHead | symbol points to the sample position |
OriginTail | The arrow starts at the sample position. |
OriginCenter | The arrow is centered at the sample position. |
Definition at line 39 of file qwt_plot_vectorfield.h.
Depending on the MagnitudeMode the magnitude component will have an impact on the attributes of the symbol/arrow.
Enumerator | |
---|---|
MagnitudeAsColor | The magnitude will be mapped to a color using a color map
|
MagnitudeAsLength | The magnitude will have an impact on the length of the arrow/symbol
|
Definition at line 75 of file qwt_plot_vectorfield.h.
Attributes to modify the rendering
Enumerator | |
---|---|
FilterVectors |
Definition at line 55 of file qwt_plot_vectorfield.h.
|
explicit |
Constructor
title | Title of the curve |
Definition at line 302 of file qwt_plot_vectorfield.cpp.
|
explicit |
Constructor
title | Title of the curve |
Definition at line 292 of file qwt_plot_vectorfield.cpp.
|
virtual |
Destructor.
Definition at line 309 of file qwt_plot_vectorfield.cpp.
|
virtual |
Computes length of the arrow in screen coordinate units based on its magnitude.
Default implementation simply scales the vector using the magnitudeScaleFactor() If the result is not null, the length is then bounded into the interval [ minArrowLength(), maxArrowLength() ].
Re-implement this function to provide special handling for zero/non-zero magnitude arrows, or impose minimum/maximum arrow length limits.
magnitude | Magnitude |
Definition at line 726 of file qwt_plot_vectorfield.cpp.
|
virtual |
Reimplemented from QwtPlotSeriesItem.
Definition at line 749 of file qwt_plot_vectorfield.cpp.
QBrush QwtPlotVectorField::brush | ( | ) | const |
Definition at line 379 of file qwt_plot_vectorfield.cpp.
const QwtColorMap * QwtPlotVectorField::colorMap | ( | ) | const |
Definition at line 590 of file qwt_plot_vectorfield.cpp.
|
protectedvirtual |
dataChanged() indicates, that the series has been changed.
Reimplemented from QwtPlotSeriesItem.
Definition at line 1034 of file qwt_plot_vectorfield.cpp.
|
virtual |
Draw a subset of the points
painter | Painter |
xMap | Maps x-values into pixel coordinates. |
yMap | Maps y-values into pixel coordinates. |
canvasRect | Contents rectangle of the canvas |
from | Index of the first sample to be painted |
to | Index of the last sample to be painted. If to < 0 the series will be painted to its last sample. |
Implements QwtPlotSeriesItem.
Definition at line 807 of file qwt_plot_vectorfield.cpp.
|
protectedvirtual |
Draw a arrow/symbols at a specific position
x, y, are paint device coordinates, while vx, vy are from the corresponding sample.
Definition at line 975 of file qwt_plot_vectorfield.cpp.
|
protectedvirtual |
Draw symbols
painter | Painter |
xMap | x map |
yMap | y map |
canvasRect | Contents rectangle of the canvas |
from | Index of the first sample to be painted |
to | Index of the last sample to be painted |
Definition at line 847 of file qwt_plot_vectorfield.cpp.
QwtPlotVectorField::IndicatorOrigin QwtPlotVectorField::indicatorOrigin | ( | ) | const |
Definition at line 401 of file qwt_plot_vectorfield.cpp.
|
private |
Initialize data members.
Definition at line 317 of file qwt_plot_vectorfield.cpp.
|
virtual |
index | Index of the legend entry ( ignored as there is only one ) |
size | Icon size |
Reimplemented from QwtPlotItem.
Definition at line 770 of file qwt_plot_vectorfield.cpp.
QwtInterval QwtPlotVectorField::magnitudeRange | ( | ) | const |
Definition at line 645 of file qwt_plot_vectorfield.cpp.
double QwtPlotVectorField::magnitudeScaleFactor | ( | ) | const |
The length of the arrow in screen coordinate units is calculated by scaling the magnitude by the magnitudeScaleFactor.
Default implementation simply scales the vector using the magnitudeScaleFactor property. Re-implement this function to provide special handling for zero/non-zero magnitude arrows, or impose minimum/maximum arrow length limits.
Definition at line 440 of file qwt_plot_vectorfield.cpp.
double QwtPlotVectorField::maxArrowLength | ( | ) | const |
Definition at line 705 of file qwt_plot_vectorfield.cpp.
double QwtPlotVectorField::minArrowLength | ( | ) | const |
Definition at line 675 of file qwt_plot_vectorfield.cpp.
QPen QwtPlotVectorField::pen | ( | ) | const |
Definition at line 351 of file qwt_plot_vectorfield.cpp.
QSizeF QwtPlotVectorField::rasterSize | ( | ) | const |
Definition at line 463 of file qwt_plot_vectorfield.cpp.
|
virtual |
Reimplemented from QwtPlotItem.
Definition at line 503 of file qwt_plot_vectorfield.cpp.
void QwtPlotVectorField::setBrush | ( | const QBrush & | brush | ) |
Assign a brush.
brush | New brush |
Definition at line 364 of file qwt_plot_vectorfield.cpp.
void QwtPlotVectorField::setColorMap | ( | QwtColorMap * | colorMap | ) |
Change the color map
The color map is used to map the magnitude of a sample into a color using a known range for the magnitudes.
colorMap | Color Map |
Definition at line 571 of file qwt_plot_vectorfield.cpp.
void QwtPlotVectorField::setIndicatorOrigin | ( | IndicatorOrigin | origin | ) |
Set the origin for the symbols/arrows
origin | Origin |
Definition at line 390 of file qwt_plot_vectorfield.cpp.
void QwtPlotVectorField::setMagnitudeMode | ( | MagnitudeMode | mode, |
bool | on = true |
||
) |
Specify a mode how to represent the magnitude a n arrow/symbol
mode | Mode |
on | On/Off |
Definition at line 602 of file qwt_plot_vectorfield.cpp.
void QwtPlotVectorField::setMagnitudeRange | ( | const QwtInterval & | magnitudeRange | ) |
Sets the min/max magnitudes to be used for color map lookups.
If invalid (min=max=0 or negative values), the range is determined from the current range of magnitudes in the vector samples.
Definition at line 632 of file qwt_plot_vectorfield.cpp.
void QwtPlotVectorField::setMagnitudeScaleFactor | ( | double | factor | ) |
Set the magnitudeScaleFactor.
The length of the arrow in screen coordinate units is calculated by scaling the magnitude by the magnitudeScaleFactor.
factor | Scale factor |
Definition at line 417 of file qwt_plot_vectorfield.cpp.
void QwtPlotVectorField::setMaxArrowLength | ( | double | length | ) |
Set a maximum for the arrow length
length | Maximum for the arrow length in pixels |
Definition at line 688 of file qwt_plot_vectorfield.cpp.
void QwtPlotVectorField::setMinArrowLength | ( | double | length | ) |
Set a minimum for the arrow length of non zero vectors
length | Minimum for the arrow length in pixels |
Definition at line 658 of file qwt_plot_vectorfield.cpp.
void QwtPlotVectorField::setPaintAttribute | ( | PaintAttribute | attribute, |
bool | on = true |
||
) |
Specify an attribute how to draw the curve
attribute | Paint attribute |
on | On/Off |
Definition at line 475 of file qwt_plot_vectorfield.cpp.
void QwtPlotVectorField::setPen | ( | const QPen & | pen | ) |
Assign a pen
pen | New pen |
Definition at line 336 of file qwt_plot_vectorfield.cpp.
void QwtPlotVectorField::setRasterSize | ( | const QSizeF & | size | ) |
Set the raster size used for filtering samples
Definition at line 450 of file qwt_plot_vectorfield.cpp.
void QwtPlotVectorField::setSamples | ( | const QVector< QwtVectorFieldSample > & | samples | ) |
Initialize data with an array of samples.
samples | Vector of points |
Definition at line 541 of file qwt_plot_vectorfield.cpp.
void QwtPlotVectorField::setSamples | ( | QwtVectorFieldData * | data | ) |
Assign a series of samples
setSamples() is just a wrapper for setData() without any additional value - beside that it is easier to find for the developer.
data | Data |
Definition at line 556 of file qwt_plot_vectorfield.cpp.
void QwtPlotVectorField::setSymbol | ( | QwtVectorFieldSymbol * | symbol | ) |
Sets a new arrow symbol (implementation of arrow drawing code).
symbol | Arrow symbol |
Definition at line 516 of file qwt_plot_vectorfield.cpp.
const QwtVectorFieldSymbol * QwtPlotVectorField::symbol | ( | ) | const |
Definition at line 532 of file qwt_plot_vectorfield.cpp.
bool QwtPlotVectorField::testMagnitudeMode | ( | MagnitudeMode | mode | ) | const |
Definition at line 619 of file qwt_plot_vectorfield.cpp.
bool QwtPlotVectorField::testPaintAttribute | ( | PaintAttribute | attribute | ) | const |
Definition at line 496 of file qwt_plot_vectorfield.cpp.
|
private |
Definition at line 162 of file qwt_plot_vectorfield.h.