|
QWT API (English) 7.3.0
Qt Widget Library for Technical Applications - English API Documentation
|
A plot item, that represents a vector field. More...
#include <qwt_plot_vectorfield.h>
Classes | |
| class | PrivateData |
Public Member Functions | |
| QwtPlotVectorField (const QString &title=QString()) | |
| QwtPlotVectorField (const QwtText &title) | |
| Constructor. | |
| void | setPaintAttribute (PaintAttribute, bool on=true) |
| Specify an attribute how to draw the curve. | |
| bool | testPaintAttribute (PaintAttribute) const |
| Test a paint attribute. | |
| void | setMagnitudeMode (MagnitudeMode, bool on=true) |
| Specify a mode how to represent the magnitude of an arrow/symbol. | |
| bool | testMagnitudeMode (MagnitudeMode) const |
| Test a magnitude mode. | |
| void | setSymbol (QwtVectorFieldSymbol *) |
| Set a new arrow symbol. | |
| const QwtVectorFieldSymbol * | symbol () const |
| Get the arrow symbol. | |
| void | setPen (const QPen &) |
| Assign a pen. | |
| QPen | pen () const |
| Get the pen used to draw the lines. | |
| void | setBrush (const QBrush &) |
| Assign a brush. | |
| QBrush | brush () const |
| Get the brush used to fill the symbol. | |
| void | setRasterSize (const QSizeF &) |
| Set the raster size used for filtering samples. | |
| QSizeF | rasterSize () const |
| Get the raster size used for filtering samples. | |
| void | setIndicatorOrigin (IndicatorOrigin) |
| Set the origin for the symbols/arrows. | |
| IndicatorOrigin | indicatorOrigin () const |
| Get the origin for the symbols/arrows. | |
| void | setSamples (const QVector< QwtVectorFieldSample > &) |
| Initialize data with an array of samples. | |
| void | setSamples (QwtVectorFieldData *) |
| Assign a series of samples. | |
| void | setColorMap (QwtColorMap *) |
| Change the color map. | |
| const QwtColorMap * | colorMap () const |
| Get the color map used for mapping intensity values to colors. | |
| void | setMagnitudeRange (const QwtInterval &) |
| Set the magnitude range for color map lookups. | |
| QwtInterval | magnitudeRange () const |
| Get the magnitude range for color map lookups. | |
| void | setMinArrowLength (double) |
| Set a minimum for the arrow length of non zero vectors. | |
| double | minArrowLength () const |
| Get the minimum for the arrow length of non zero vectors. | |
| void | setMaxArrowLength (double) |
| Set a maximum for the arrow length. | |
| double | maxArrowLength () const |
| Get the maximum for the arrow length. | |
| virtual double | arrowLength (double magnitude) const |
| Calculate the arrow length for a given magnitude. | |
| virtual QRectF | boundingRect () const override |
| Get the bounding rectangle. | |
| virtual void | drawSeries (QPainter *, const QwtScaleMap &xMap, const QwtScaleMap &yMap, const QRectF &canvasRect, int from, int to) const override |
| Draw a subset of the points. | |
| virtual int | rtti () const override |
| Get the runtime type information. | |
| virtual QwtGraphic | legendIcon (int index, const QSizeF &) const override |
| Get the icon representing the vector fields on the legend. | |
| void | setMagnitudeScaleFactor (double factor) |
| Set the magnitude scale factor. | |
| double | magnitudeScaleFactor () const |
| Get the scale factor used to calculate the arrow length from the magnitude. | |
Public Member Functions inherited from QwtPlotSeriesItem | |
| QwtPlotSeriesItem (const QString &title=QString()) | |
| QwtPlotSeriesItem (const QwtText &title) | |
| Constructor. | |
| void | setOrientation (Qt::Orientation) |
| Set the orientation of the item. | |
| Qt::Orientation | orientation () const |
| Get the orientation of the plot item. | |
| virtual void | draw (QPainter *, const QwtScaleMap &xMap, const QwtScaleMap &yMap, const QRectF &canvasRect) const override |
| Draw the complete series. | |
| virtual void | updateScaleDiv (const QwtScaleDiv &, const QwtScaleDiv &) override |
| Update the scale divisions. | |
Public Member Functions inherited from QwtPlotItem | |
| QwtPlotItem () | |
| Default constructor. | |
| QwtPlotItem (const QString &title) | |
| Constructor with title as QString. | |
| QwtPlotItem (const QwtText &title) | |
| Constructor with title as QwtText. | |
| virtual | ~QwtPlotItem () |
| Destructor. | |
| virtual void | attach (QwtPlot *plot) |
| Attach the item to a plot. | |
| void | detach () |
| Detach the item from the plot. | |
| QwtPlot * | plot () const |
| Get the plot the item is attached to. | |
| void | setTitle (const QString &title) |
| Set the title using a QString. | |
| void | setTitle (const QwtText &title) |
| Set the title using a QwtText. | |
| const QwtText & | title () const |
| Get the title. | |
| void | setItemAttribute (ItemAttribute, bool on=true) |
| Set an item attribute. | |
| bool | testItemAttribute (ItemAttribute) const |
| Test an item attribute. | |
| void | setItemInterest (ItemInterest, bool on=true) |
| Set an item interest. | |
| bool | testItemInterest (ItemInterest) const |
| Test an item interest. | |
| void | setRenderHint (RenderHint, bool on=true) |
| Set a render hint. | |
| bool | testRenderHint (RenderHint) const |
| Test a render hint. | |
| void | setRenderThreadCount (uint numThreads) |
| Set the number of render threads. | |
| uint | renderThreadCount () const |
| Get the number of render threads. | |
| void | setLegendIconSize (const QSize &) |
| Set the legend icon size. | |
| QSize | legendIconSize () const |
| Get the legend icon size. | |
| double | z () const |
| Get the z-value. | |
| void | setZ (double z) |
| Set the z-value. | |
| void | show () |
| Show the item. | |
| void | hide () |
| Hide the item. | |
| virtual void | setVisible (bool) |
| Set the visibility. | |
| bool | isVisible () const |
| Check if the item is visible. | |
| void | setAxes (QwtAxisId xAxis, QwtAxisId yAxis) |
| Set both axes. | |
| void | setXAxis (QwtAxisId) |
| Set the x-axis. | |
| QwtAxisId | xAxis () const |
| Get the x-axis. | |
| void | setYAxis (QwtAxisId) |
| Set the y-axis. | |
| QwtAxisId | yAxis () const |
| Get the y-axis. | |
| virtual void | itemChanged () |
| Notify the plot that the item has changed. | |
| virtual void | legendChanged () |
| Notify the item that the legend has changed. | |
| virtual void | getCanvasMarginHint (const QwtScaleMap &xMap, const QwtScaleMap &yMap, const QRectF &canvasRect, double &left, double &top, double &right, double &bottom) const |
| Get margin hints for the canvas. | |
| virtual void | updateLegend (const QwtPlotItem *, const QList< QwtLegendData > &) |
| Update the item with changes of the legend. | |
| QRectF | scaleRect (const QwtScaleMap &, const QwtScaleMap &) const |
| Calculate the scale rectangle. | |
| QRectF | paintRect (const QwtScaleMap &, const QwtScaleMap &) const |
| Calculate the paint rectangle. | |
| virtual QList< QwtLegendData > | legendData () const |
| Return legend data. | |
Public Member Functions inherited from QwtSeriesStore< QwtVectorFieldSample > | |
| void | setData (QwtSeriesData< QwtVectorFieldSample > *series) |
| QwtSeriesData< QwtVectorFieldSample > * | data () |
| const QwtSeriesData< QwtVectorFieldSample > * | data () const |
| QwtVectorFieldSample | sample (size_t index) const |
| virtual size_t | dataSize () const override |
| virtual QRectF | dataRect () const override |
| virtual void | setRectOfInterest (const QRectF &rect) override |
| Set a the "rectangle of interest" for the stored series. | |
| QwtSeriesData< QwtVectorFieldSample > * | swapData (QwtSeriesData< QwtVectorFieldSample > *series) |
Protected Member Functions | |
| virtual void | drawSymbols (QPainter *, const QwtScaleMap &xMap, const QwtScaleMap &yMap, const QRectF &canvasRect, int from, int to) const |
| Draw symbols. | |
| virtual void | drawSymbol (QPainter *, double x, double y, double vx, double vy) const |
| Draw a arrow/symbols at a specific position. | |
| virtual void | dataChanged () override |
| dataChanged() indicates, that the series has been changed. | |
Protected Member Functions inherited from QwtPlotItem | |
| QwtGraphic | defaultIcon (const QBrush &, const QSizeF &) const |
| Create a default icon. | |
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.
Indicator origin.
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. |
Magnitude mode.
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
|
Paint attributes.
Attributes to modify the rendering
| Enumerator | |
|---|---|
| FilterVectors | FilterVectors calculates an average sample from all samples that lie in the same cell of a grid that is determined by setting the rasterSize().
|
|
explicit |
Constructor.
| [in] | title | Title of the curve |
Constructor
| [in] | title | Title of the curve |
Destructor
|
virtual |
Calculate the arrow length for a given magnitude.
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.
| [in] | magnitude | Magnitude |
|
overridevirtual |
Get the bounding rectangle.
Reimplemented from QwtPlotSeriesItem.
| QBrush QwtPlotVectorField::brush | ( | ) | const |
| const QwtColorMap * QwtPlotVectorField::colorMap | ( | ) | const |
Get the color map used for mapping intensity values to colors.
|
overrideprotectedvirtual |
dataChanged() indicates, that the series has been changed.
Reimplemented from QwtPlotSeriesItem.
|
overridevirtual |
Draw a subset of the points.
| [in] | painter | Painter |
| [in] | xMap | Maps x-values into pixel coordinates. |
| [in] | yMap | Maps y-values into pixel coordinates. |
| [in] | canvasRect | Contents rectangle of the canvas |
| [in] | from | Index of the first sample to be painted |
| [in] | to | Index of the last sample to be painted. If to < 0 the series will be painted to its last sample. |
Implements QwtPlotSeriesItem.
|
protectedvirtual |
Draw a arrow/symbols at a specific position.
x, y, are paint device coordinates, while vx, vy are from the corresponding sample.
|
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 |
| QwtPlotVectorField::IndicatorOrigin QwtPlotVectorField::indicatorOrigin | ( | ) | const |
|
overridevirtual |
Get the icon representing the vector fields on the legend.
| [in] | index | Index of the legend entry ( ignored as there is only one ) |
| [in] | size | Icon size |
Reimplemented from QwtPlotItem.
| QwtInterval QwtPlotVectorField::magnitudeRange | ( | ) | const |
Get the magnitude range for color map lookups.
| double QwtPlotVectorField::magnitudeScaleFactor | ( | ) | const |
Get the scale factor used to calculate the arrow length from the magnitude.
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.
| double QwtPlotVectorField::maxArrowLength | ( | ) | const |
Get the maximum for the arrow length.
| double QwtPlotVectorField::minArrowLength | ( | ) | const |
Get the minimum for the arrow length of non zero vectors.
| QPen QwtPlotVectorField::pen | ( | ) | const |
| QSizeF QwtPlotVectorField::rasterSize | ( | ) | const |
Get the raster size used for filtering samples.
|
overridevirtual |
Get the runtime type information.
Reimplemented from QwtPlotItem.
| void QwtPlotVectorField::setBrush | ( | const QBrush & | brush | ) |
| 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.
| [in] | colorMap | Color Map |
| void QwtPlotVectorField::setIndicatorOrigin | ( | IndicatorOrigin | origin | ) |
Set the origin for the symbols/arrows.
| [in] | origin | Origin position |
| void QwtPlotVectorField::setMagnitudeMode | ( | MagnitudeMode | mode, |
| bool | on = true |
||
| ) |
Specify a mode how to represent the magnitude of an arrow/symbol.
| [in] | mode | Mode |
| [in] | on | On/Off |
| void QwtPlotVectorField::setMagnitudeRange | ( | const QwtInterval & | magnitudeRange | ) |
Set the magnitude range for color map lookups.
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.
| [in] | magnitudeRange | Magnitude range |
| void QwtPlotVectorField::setMagnitudeScaleFactor | ( | double | factor | ) |
Set the magnitude scale factor.
The length of the arrow in screen coordinate units is calculated by scaling the magnitude by the magnitudeScaleFactor.
| [in] | factor | Scale factor |
| void QwtPlotVectorField::setMaxArrowLength | ( | double | length | ) |
Set a maximum for the arrow length.
| [in] | length | Maximum for the arrow length in pixels |
| void QwtPlotVectorField::setMinArrowLength | ( | double | length | ) |
Set a minimum for the arrow length of non zero vectors.
| [in] | length | Minimum for the arrow length in pixels |
| void QwtPlotVectorField::setPaintAttribute | ( | PaintAttribute | attribute, |
| bool | on = true |
||
| ) |
Specify an attribute how to draw the curve.
| [in] | attribute | Paint attribute |
| [in] | on | On/Off |
| void QwtPlotVectorField::setPen | ( | const QPen & | pen | ) |
| void QwtPlotVectorField::setRasterSize | ( | const QSizeF & | size | ) |
Set the raster size used for filtering samples.
| [in] | size | Raster size |
| void QwtPlotVectorField::setSamples | ( | const QVector< QwtVectorFieldSample > & | samples | ) |
Initialize data with an array of samples.
| [in] | samples | Vector of points |
| 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.
| [in] | data | Data |
| void QwtPlotVectorField::setSymbol | ( | QwtVectorFieldSymbol * | symbol | ) |
Set a new arrow symbol.
Sets a new arrow symbol (implementation of arrow drawing code).
| [in] | symbol | Arrow symbol |
| const QwtVectorFieldSymbol * QwtPlotVectorField::symbol | ( | ) | const |
| bool QwtPlotVectorField::testMagnitudeMode | ( | MagnitudeMode | mode | ) | const |
| bool QwtPlotVectorField::testPaintAttribute | ( | PaintAttribute | attribute | ) | const |
Test a paint attribute.