|
QWT 7.0.1
|
A plot item, that represents a vector field. More...
#include <qwt_plot_vectorfield.h>
Classes | |
| class | PrivateData |
Public Types | |
| enum | IndicatorOrigin { OriginHead , OriginTail , OriginCenter } |
| Depending on the origin the indicator symbol ( usually an arrow ) will be to the position of the corresponding sample. More... | |
| enum | PaintAttribute { FilterVectors = 0x01 } |
| Attributes to modify the rendering. More... | |
| enum | MagnitudeMode { MagnitudeAsColor = 0x01 , MagnitudeAsLength = 0x02 } |
| Depending on the MagnitudeMode the magnitude component will have an impact on the attributes of the symbol/arrow. More... | |
Public Types inherited from QwtPlotItem | |
| 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... | |
| 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... | |
Public Member Functions | |
| QwtPlotVectorField (const QString &title=QString()) | |
| Constructor. | |
| QwtPlotVectorField (const QwtText &title) | |
| Constructor. | |
| virtual | ~QwtPlotVectorField () |
| Destructor. | |
| void | setPaintAttribute (PaintAttribute, bool on=true) |
| Specify an attribute how to draw the curve. | |
| bool | testPaintAttribute (PaintAttribute) const |
| void | setMagnitudeMode (MagnitudeMode, bool on=true) |
| Specify a mode how to represent the magnitude a n arrow/symbol. | |
| bool | testMagnitudeMode (MagnitudeMode) const |
| void | setSymbol (QwtVectorFieldSymbol *) |
| Sets a new arrow symbol (implementation of arrow drawing code). | |
| const QwtVectorFieldSymbol * | symbol () const |
| void | setPen (const QPen &) |
| Assign a pen. | |
| QPen | pen () const |
| void | setBrush (const QBrush &) |
| Assign a brush. | |
| QBrush | brush () const |
| void | setRasterSize (const QSizeF &) |
| Set the raster size used for filtering samples. | |
| QSizeF | rasterSize () const |
| void | setIndicatorOrigin (IndicatorOrigin) |
| Set the origin for the symbols/arrows. | |
| IndicatorOrigin | indicatorOrigin () const |
| 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 |
| void | setMagnitudeRange (const QwtInterval &) |
| Sets the min/max magnitudes to be used for color map lookups. | |
| QwtInterval | magnitudeRange () const |
| void | setMinArrowLength (double) |
| Set a minimum for the arrow length of non zero vectors. | |
| double | minArrowLength () const |
| void | setMaxArrowLength (double) |
| Set a maximum for the arrow length. | |
| double | maxArrowLength () const |
| virtual double | arrowLength (double magnitude) const |
| Computes length of the arrow in screen coordinate units based on its magnitude. | |
| virtual QRectF | boundingRect () const QWT_OVERRIDE |
| virtual void | drawSeries (QPainter *, const QwtScaleMap &xMap, const QwtScaleMap &yMap, const QRectF &canvasRect, int from, int to) const QWT_OVERRIDE |
| Draw a subset of the points. | |
| virtual int | rtti () const QWT_OVERRIDE |
| virtual QwtGraphic | legendIcon (int index, const QSizeF &) const QWT_OVERRIDE |
| void | setMagnitudeScaleFactor (double factor) |
| Set the magnitudeScaleFactor. | |
| double | magnitudeScaleFactor () const |
Public Member Functions inherited from QwtPlotSeriesItem | |
| QwtPlotSeriesItem (const QString &title=QString()) | |
| Constructor. | |
| QwtPlotSeriesItem (const QwtText &title) | |
| Constructor. | |
| virtual | ~QwtPlotSeriesItem () |
| Destructor. | |
| void | setOrientation (Qt::Orientation) |
| Set the orientation of the item. | |
| Qt::Orientation | orientation () const |
| virtual void | draw (QPainter *, const QwtScaleMap &xMap, const QwtScaleMap &yMap, const QRectF &canvasRect) const QWT_OVERRIDE |
| Draw the complete series. | |
| virtual void | updateScaleDiv (const QwtScaleDiv &, const QwtScaleDiv &) QWT_OVERRIDE |
| Update the item to changes of the axes scale division. | |
Public Member Functions inherited from QwtPlotItem | |
| QwtPlotItem () | |
| Constructor. | |
| QwtPlotItem (const QString &title) | |
| Constructor. | |
| QwtPlotItem (const QwtText &title) | |
| Constructor. | |
| virtual | ~QwtPlotItem () |
| Destroy the QwtPlotItem. | |
| void | attach (QwtPlot *plot) |
| Attach the item to a plot. | |
| void | detach () |
| This method detaches a QwtPlotItem from any QwtPlot it has been associated with. | |
| QwtPlot * | plot () const |
| Return attached plot. | |
| void | setTitle (const QString &title) |
| Set a new title. | |
| void | setTitle (const QwtText &title) |
| Set a new title. | |
| const QwtText & | title () const |
| void | setItemAttribute (ItemAttribute, bool on=true) |
| Toggle an item attribute. | |
| bool | testItemAttribute (ItemAttribute) const |
| Test an item attribute. | |
| void | setItemInterest (ItemInterest, bool on=true) |
| Toggle an item interest. | |
| bool | testItemInterest (ItemInterest) const |
| Test an item interest. | |
| void | setRenderHint (RenderHint, bool on=true) |
| Toggle an render hint. | |
| bool | testRenderHint (RenderHint) const |
| Test a render hint. | |
| void | setRenderThreadCount (uint numThreads) |
| On multi core systems rendering of certain plot item ( f.e QwtPlotRasterItem ) can be done in parallel in several threads. | |
| uint | renderThreadCount () const |
| void | setLegendIconSize (const QSize &) |
| Set the size of the legend icon. | |
| QSize | legendIconSize () const |
| double | z () const |
| Plot items are painted in increasing z-order. | |
| void | setZ (double z) |
| Set the z value. | |
| void | show () |
| Show the item. | |
| void | hide () |
| Hide the item. | |
| virtual void | setVisible (bool) |
| Show/Hide the item. | |
| bool | isVisible () const |
| void | setAxes (QwtAxisId xAxis, QwtAxisId yAxis) |
| Set X and Y axis. | |
| void | setXAxis (QwtAxisId) |
| Set the X axis. | |
| QwtAxisId | xAxis () const |
| Return xAxis. | |
| void | setYAxis (QwtAxisId) |
| Set the Y axis. | |
| QwtAxisId | yAxis () const |
| Return yAxis. | |
| virtual void | itemChanged () |
| Update the legend and call QwtPlot::autoRefresh() for the parent plot. | |
| virtual void | legendChanged () |
| Update the legend of the parent plot. | |
| 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. | |
| virtual void | updateLegend (const QwtPlotItem *, const QList< QwtLegendData > &) |
| Update the item to changes of the legend info. | |
| QRectF | scaleRect (const QwtScaleMap &, const QwtScaleMap &) const |
| Calculate the bounding scale rectangle of 2 maps. | |
| QRectF | paintRect (const QwtScaleMap &, const QwtScaleMap &) const |
| Calculate the bounding paint rectangle of 2 maps. | |
| virtual QList< QwtLegendData > | legendData () const |
| Return all information, that is needed to represent the item on the legend. | |
Public Member Functions inherited from QwtAbstractSeriesStore | |
| virtual | ~QwtAbstractSeriesStore () |
| Destructor. | |
Public Member Functions inherited from QwtSeriesStore< QwtVectorFieldSample > | |
| QwtSeriesStore () | |
| Constructor The store contains no series. | |
| ~QwtSeriesStore () | |
| Destructor. | |
| void | setData (QwtSeriesData< QwtVectorFieldSample > *series) |
| Assign a series of samples. | |
| QwtSeriesData< QwtVectorFieldSample > * | data () |
| const QwtSeriesData< QwtVectorFieldSample > * | data () const |
| QwtVectorFieldSample | sample (size_t index) const |
| virtual size_t | dataSize () const QWT_OVERRIDE |
| virtual QRectF | dataRect () const QWT_OVERRIDE |
| virtual void | setRectOfInterest (const QRectF &rect) QWT_OVERRIDE |
| Set a the "rect of interest" for the series. | |
| QwtSeriesData< QwtVectorFieldSample > * | swapData (QwtSeriesData< QwtVectorFieldSample > *series) |
| Replace a series without deleting the previous one. | |
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 () QWT_OVERRIDE |
| dataChanged() indicates, that the series has been changed. | |
Protected Member Functions inherited from QwtPlotItem | |
| QwtGraphic | defaultIcon (const QBrush &, const QSizeF &) const |
| Return a default icon from a brush. | |
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.
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.
|
Attributes to modify the rendering.
|
explicit |
Constructor.
| title | Title of the curve |
|
explicit |
Constructor.
| title | Title of the curve |
|
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 |
|
virtual |
Reimplemented from QwtPlotSeriesItem.
| QBrush QwtPlotVectorField::brush | ( | ) | const |
| const QwtColorMap * QwtPlotVectorField::colorMap | ( | ) | const |
|
protectedvirtual |
dataChanged() indicates, that the series has been changed.
Reimplemented from QwtPlotSeriesItem.
|
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.
|
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 |
|
virtual |
| index | Index of the legend entry ( ignored as there is only one ) |
| size | Icon size |
Reimplemented from QwtPlotItem.
| QwtInterval QwtPlotVectorField::magnitudeRange | ( | ) | const |
| 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.
| double QwtPlotVectorField::maxArrowLength | ( | ) | const |
| double QwtPlotVectorField::minArrowLength | ( | ) | const |
| QSizeF QwtPlotVectorField::rasterSize | ( | ) | const |
|
virtual |
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.
| colorMap | Color Map |
| void QwtPlotVectorField::setIndicatorOrigin | ( | IndicatorOrigin | origin | ) |
| 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 |
| 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.
| 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 |
| void QwtPlotVectorField::setMaxArrowLength | ( | double | length | ) |
Set a maximum for the arrow length.
| length | Maximum for the arrow length in pixels |
| void QwtPlotVectorField::setMinArrowLength | ( | double | length | ) |
Set a minimum for the arrow length of non zero vectors.
| length | Minimum for the arrow length in pixels |
| void QwtPlotVectorField::setPaintAttribute | ( | PaintAttribute | attribute, |
| bool | on = true |
||
| ) |
Specify an attribute how to draw the curve.
| attribute | Paint attribute |
| on | On/Off |
| void QwtPlotVectorField::setPen | ( | const QPen & | pen | ) |
| void QwtPlotVectorField::setRasterSize | ( | const QSizeF & | size | ) |
Set the raster size used for filtering samples.
| void QwtPlotVectorField::setSamples | ( | const QVector< QwtVectorFieldSample > & | samples | ) |
Initialize data with an array of samples.
| 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.
| data | Data |
| void QwtPlotVectorField::setSymbol | ( | QwtVectorFieldSymbol * | symbol | ) |
Sets a new arrow symbol (implementation of arrow drawing code).
| symbol | Arrow symbol |
| const QwtVectorFieldSymbol * QwtPlotVectorField::symbol | ( | ) | const |
| bool QwtPlotVectorField::testMagnitudeMode | ( | MagnitudeMode | mode | ) | const |
| bool QwtPlotVectorField::testPaintAttribute | ( | PaintAttribute | attribute | ) | const |