QwtPlotVectorField(3)
π NAME π
okay bestie, welcome to the QwtPlotVectorField(3) page from the Library Functions Manual β this is the plot-item-that-represents-a-vector-field situation, and it's lowkey iconic. QwtPlotVectorField β A plot item, that represents a vector field. Periodt. π
β¨ SYNOPSIS β¨
#include <qwt_plot_vectorfield.h>
Inherits QwtPlotSeriesItem, and QwtSeriesStore< QwtVectorFieldSample >.
π Public Types π
- enum
IndicatorOrigin{OriginHead,OriginTail,OriginCenter} - enum
PaintAttribute{FilterVectors = 0x01} - enum
MagnitudeMode{MagnitudeAsColor = 0x01,MagnitudeAsLength = 0x02} - typedef
QFlags< PaintAttribute > PaintAttributes - typedef
QFlags< MagnitudeMode > MagnitudeModes
π 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. - enum
ItemAttribute{Legend = 0x01,AutoScale = 0x02,Margins = 0x04} β Plot Item Attributes. - enum
ItemInterest{ScaleInterest = 0x01,LegendInterest = 0x02} β Plot Item Interests. - enum
RenderHint{RenderAntialiased = 0x1} β Render hints. - typedef
QFlags< ItemAttribute > ItemAttributes - typedef
QFlags< ItemInterest > ItemInterests - typedef
QFlags< RenderHint > RenderHints
πΈ Public Member Functions πΈ
QwtPlotVectorField (const QString &title=QString())QwtPlotVectorField (const QwtText &title)virtual ~QwtPlotVectorField ()β Destructor.void setPaintAttribute (PaintAttribute, bool on=true)bool testPaintAttribute (PaintAttribute) constvoid setMagnitudeMode (MagnitudeMode, bool on=true)bool testMagnitudeMode (MagnitudeMode) constvoid setSymbol (QwtVectorFieldSymbol *)const QwtVectorFieldSymbol * symbol () constvoid setPen (const QPen &)QPen pen () constvoid setBrush (const QBrush &)β Assign a brush.QBrush brush () constvoid setRasterSize (const QSizeF &)QSizeF rasterSize () constvoid setIndicatorOrigin (IndicatorOrigin)IndicatorOrigin indicatorOrigin () constvoid setSamples (const QVector< QwtVectorFieldSample > &)void setSamples (QwtVectorFieldData *)void setColorMap (QwtColorMap *)const QwtColorMap * colorMap () constvoid setMagnitudeRange (const QwtInterval &)QwtInterval magnitudeRange () constvoid setMinArrowLength (double)double minArrowLength () constvoid setMaxArrowLength (double)double maxArrowLength () constvirtual double arrowLength (double magnitude) constvirtual QRectF boundingRect () const overridevirtual void drawSeries (QPainter *, const QwtScaleMap &xMap, const QwtScaleMap &yMap, const QRectF &canvasRect, int from, int to) const overridevirtual int rtti () const overridevirtual QwtGraphic legendIcon (int index, const QSizeF &) const overridevoid setMagnitudeScaleFactor (double factor)β Set the magnitudeScaleFactor.double magnitudeScaleFactor () const
π¦ Public Member Functions inherited from QwtPlotSeriesItem π¦
QwtPlotSeriesItem (const QString &title=QString())QwtPlotSeriesItem (const QwtText &title)virtual ~QwtPlotSeriesItem ()β Destructor.void setOrientation (Qt::Orientation)Qt::Orientation orientation () constvirtual 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 item to changes of the axes scale division.
π Public Member Functions inherited from QwtPlotItem π
QwtPlotItem ()QwtPlotItem (const QString &title)QwtPlotItem (const QwtText &title)virtual ~QwtPlotItem ()β Destroy the QwtPlotItem.void attach (QwtPlot *plot)β Attach the item to a plot.void detach ()β This method detaches aQwtPlotItemfrom anyQwtPlotit has been associated with.QwtPlot * plot () constβ Return attached plot.void setTitle (const QString &title)void setTitle (const QwtText &title)const QwtText & title () constvoid setItemAttribute (ItemAttribute, bool on=true)bool testItemAttribute (ItemAttribute) constvoid setItemInterest (ItemInterest, bool on=true)bool testItemInterest (ItemInterest) constvoid setRenderHint (RenderHint, bool on=true)bool testRenderHint (RenderHint) constvoid setRenderThreadCount (uint numThreads)uint renderThreadCount () constvoid setLegendIconSize (const QSize &)QSize legendIconSize () constdouble z () constvoid setZ (double z)β Set the z value.void show ()β Show the item.void hide ()β Hide the item.virtual void setVisible (bool)bool isVisible () constvoid setAxes (QwtAxisId xAxis, QwtAxisId yAxis)void setXAxis (QwtAxisId)QwtAxisId xAxis () constβ Return xAxis.void setYAxis (QwtAxisId)QwtAxisId yAxis () constβ Return yAxis.virtual void itemChanged ()virtual void legendChanged ()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)QwtSeriesData< QwtVectorFieldSample > * data ()QwtVectorFieldSample sample (int index) constvirtual size_t dataSize () const overridevirtual QRectF dataRect () const overridevirtual void setRectOfInterest (const QRectF &rect) overrideQwtSeriesData< 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) constvirtual void drawSymbol (QPainter *, double x, double y, double vx, double vy) constvirtual void dataChanged () 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.
π Detailed Description π
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.
See also: QwtVectorFieldSymbol, QwtVectorFieldSample
Definition at line 30 of file qwt_plot_vectorfield.h.
π¦ Member Typedef Documentation π¦
typedef QFlags<MagnitudeMode > QwtPlotVectorField::MagnitudeModesβ An ORed combination ofMagnitudeModevalues.
Definition at line 90 of file qwt_plot_vectorfield.h.
typedef QFlags<PaintAttribute > QwtPlotVectorField::PaintAttributesβ An ORed combination ofPaintAttributevalues.
Definition at line 67 of file qwt_plot_vectorfield.h.
π Member Enumeration Documentation π
enum QwtPlotVectorField::IndicatorOriginβ Depending on the origin the indicator symbol ( usually an arrow ) will be to the position of the corresponding sample.OriginHeadβ symbol points to the sample positionOriginTailβ 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.
enum QwtPlotVectorField::MagnitudeModeβ Depending on theMagnitudeModethe magnitude component will have an impact on the attributes of the symbol/arrow.
See also: setMagnitudeMode()
MagnitudeAsColorβ The magnitude will be mapped to a color using a color map
See also: magnitudeRange(), colorMap()
MagnitudeAsLengthβ The magnitude will have an impact on the length of the arrow/symbol
See also: arrowLength(), magnitudeScaleFactor()
Definition at line 75 of file qwt_plot_vectorfield.h.
enum QwtPlotVectorField::PaintAttributeβ Attributes to modify the rendering
See also: setPaintAttribute(), testPaintAttribute()
Value from the synopsis, bestie: FilterVectors = 0x01.
Definition at line 55 of file qwt_plot_vectorfield.h.
π Constructor & Destructor Documentation π
QwtPlotVectorField::QwtPlotVectorField (const QString & title = QString())[explicit]β Constructor
Parameters:
titleβ Title of the curve
Definition at line 302 of file qwt_plot_vectorfield.cpp.
QwtPlotVectorField::QwtPlotVectorField (const QwtText & title)[explicit]β Constructor
Parameters:
titleβ Title of the curve
Definition at line 292 of file qwt_plot_vectorfield.cpp.
QwtPlotVectorField::~QwtPlotVectorField ()[virtual]β Destructor.
Definition at line 309 of file qwt_plot_vectorfield.cpp.
π Member Function Documentation π
double QwtPlotVectorField::arrowLength (double magnitude) const[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.
Parameters:
magnitudeβ Magnitude
Returns: Length of arrow to be drawn in dependence of vector magnitude.
See also: magnitudeScaleFactor, minArrowLength(), maxArrowLength()
Note: Has no effect when QwtPlotVectorField::MagnitudeAsLength is not enabled
Definition at line 726 of file qwt_plot_vectorfield.cpp.
QRectF QwtPlotVectorField::boundingRect () const[override],[virtual]
Returns: An invalid bounding rect: QRectF(1.0, 1.0, -2.0, -2.0)
Note β a width or height < 0.0 is ignored by the autoscaler, no cap. So don't come crying if your negative size does nothing, bestie π
Reimplemented from QwtPlotSeriesItem.
Definition at line 749 of file qwt_plot_vectorfield.cpp.
QBrush QwtPlotVectorField::brush () const
Returns the brush that fills the symbol π¨
See also: setBrush(), pen()
Definition at line 379 of file qwt_plot_vectorfield.cpp.
const QwtColorMap * QwtPlotVectorField::colorMap () const
Hands you back the Color Map used for mapping intensity values into colors π the whole glow-up of your field, honestly.
See also: setColorMap()
Definition at line 590 of file qwt_plot_vectorfield.cpp.
void QwtPlotVectorField::dataChanged () [override] [protected] [virtual]
Okay so dataChanged() is literally the "hey bestie something changed" signal β it indicates that the series has been changed. β¨
Reimplemented from QwtPlotSeriesItem.
Definition at line 1034 of file qwt_plot_vectorfield.cpp.
void QwtPlotVectorField::drawSeries (...) [override] [virtual]
Draw a subset of the points ποΈ the main character of this whole class, ngl.
void QwtPlotVectorField::drawSeries (QPainter * painter, const QwtScaleMap &
xMap, const QwtScaleMap & yMap, const QRectF & canvasRect, int from, int
to) const
Parameters:
- painter β the Painter, doing the actual drawing π
- 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.
void QwtPlotVectorField::drawSymbol (...) [protected] [virtual]
Draws an arrow/symbol at one specific position π―
void QwtPlotVectorField::drawSymbol (QPainter * painter, double x, double y,
double vx, double vy) const
Heads up: x, y, are paint device coordinates, while vx, vy are from the corresponding sample. Two different coordinate universes, don't mix them up fr π
See also: setSymbol(), drawSeries()
Definition at line 975 of file qwt_plot_vectorfield.cpp.
void QwtPlotVectorField::drawSymbols (...) [protected] [virtual]
Draw symbols β plural, the whole squad π«Ά
void QwtPlotVectorField::drawSymbols (QPainter * painter, const QwtScaleMap
& xMap, const QwtScaleMap & yMap, const QRectF & canvasRect, int from,
int to) const
Parameters:
- 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
See also: setSymbol(), drawSymbol(), drawSeries()
Definition at line 847 of file qwt_plot_vectorfield.cpp.
QwtPlotVectorField::IndicatorOrigin QwtPlotVectorField::indicatorOrigin () const
Returns the origin for the symbols/arrows π like, where does the arrow start from, the whole vibe check of direction.
Definition at line 401 of file qwt_plot_vectorfield.cpp.
QwtGraphic QwtPlotVectorField::legendIcon (...) const [override] [virtual]
Returns the icon representing the vector fields on the legend πΌοΈ the little glow-up in the legend box.
QwtGraphic QwtPlotVectorField::legendIcon (int index, const QSizeF & size)
const
Parameters:
- index β Index of the legend entry ( ignored as there is only one ) β yeah, only one entry, so
indexis just sitting there like π - size β Icon size
See also: QwtPlotItem::setLegendIconSize(), QwtPlotItem::legendData()
Reimplemented from QwtPlotItem.
Definition at line 770 of file qwt_plot_vectorfield.cpp.
QwtInterval QwtPlotVectorField::magnitudeRange () const
Returns the min/max magnitudes to be used for color map lookups π¨ literally the range that gets fed into the color map.
See also: setMagnitudeRange(), colorMap()
Definition at line 645 of file qwt_plot_vectorfield.cpp.
double QwtPlotVectorField::magnitudeScaleFactor () const
Returns 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. So go off, override it π
Returns: Length of arrow to be drawn in dependence of vector magnitude.
See also: magnitudeScaleFactor
Note: Has no effect when QwtPlotVectorField::MagnitudeAsLength is not enabled π¨ so flip that mode on first or this does absolutely nothing.
Definition at line 440 of file qwt_plot_vectorfield.cpp.
double QwtPlotVectorField::maxArrowLength () const
Returns the maximum for the arrow length π the ceiling, the limit, the "no bigger than this" energy.
See also: setMinArrowLength(), maxArrowLength(), arrowLength()
Note: Has no effect when QwtPlotVectorField::MagnitudeAsLength is not enabled π¨
Definition at line 705 of file qwt_plot_vectorfield.cpp.
double QwtPlotVectorField::minArrowLength () const
Returns the minimum for the arrow length of non zero vectors πβ¨ tiny but mighty.
See also: setMinArrowLength(), maxArrowLength(), arrowLength()
Note: Has no effect when QwtPlotVectorField::MagnitudeAsLength is not enabled π¨
Definition at line 675 of file qwt_plot_vectorfield.cpp.
QPen QwtPlotVectorField::pen () const
Returns the Pen used to draw the lines βοΈ
See also: setPen(), brush()
Definition at line 351 of file qwt_plot_vectorfield.cpp.
QSizeF QwtPlotVectorField::rasterSize () const
Returns the raster size used for filtering samples π²
See also: setRasterSize(), QwtPlotVectorField::FilterVectors
Definition at line 463 of file qwt_plot_vectorfield.cpp.
int QwtPlotVectorField::rtti () const [override] [virtual]
Returns QwtPlotItem::Rtti_PlotField π·οΈ that's the whole function, it just says who it is. iconic honestly.
Reimplemented from QwtPlotItem.
Definition at line 503 of file qwt_plot_vectorfield.cpp.
void QwtPlotVectorField::setBrush (const QBrush & brush)
Assign a brush ποΈ
Parameters:
- brush β New brush
See also: brush(), pen()
Note: the brush is ignored in MagnitudeAsColor mode π so don't wonder why your cute brush vanished.
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.
Parameters:
- colorMap β Color Map
See also: colorMap(), magnitudeRange()
Definition at line 571 of file qwt_plot_vectorfield.cpp.
void QwtPlotVectorField::setIndicatorOrigin (IndicatorOrigin origin)
Set the origin for the symbols/arrows π
Parameters:
- origin β Origin
See also: indicatorOrigin()
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 an arrow/symbol π§ (yes the original says "a n arrow/symbol", we're keeping that typo real and untouched, periodt π )
Parameters:
- mode β Mode
- on β On/Off
See also: testMagnitudeMode()
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. So it β¨auto-magicallyβ¨ figures itself out.
See also: magnitudeRange(), colorMap()
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. ππ«
Parameters:
- factor β Scale factor
See also: magnitudeScaleFactor(), arrowLength()
Note: Has no effect when QwtPlotVectorField::MagnitudeAsLength is not enabled π¨
Definition at line 417 of file qwt_plot_vectorfield.cpp.
void QwtPlotVectorField::setMaxArrowLength (double length)
Set a maximum for the arrow length π
Parameters:
- length β Maximum for the arrow length in pixels
See also: maxArrowLength(), setMinArrowLength(), arrowLength()
Note: Has no effect when QwtPlotVectorField::MagnitudeAsLength is not enabled π¨
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 π
Parameters:
- length β Minimum for the arrow length in pixels
See also: minArrowLength(), setMaxArrowLength(), arrowLength()
Note: Has no effect when QwtPlotVectorField::MagnitudeAsLength is not enabled π¨
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 ποΈ
Parameters:
- attribute β Paint attribute
- on β On/Off
See also: testPaintAttribute()
Definition at line 475 of file qwt_plot_vectorfield.cpp.
void QwtPlotVectorField::setPen (const QPen & pen)
Assign a pen βοΈ
Parameters:
- pen β New pen
See also: pen(), brush()
Note: the pen is ignored in MagnitudeAsColor mode π same deal as the brush.
Definition at line 336 of file qwt_plot_vectorfield.cpp.
void QwtPlotVectorField::setRasterSize (const QSizeF & size)
Set the raster size used for filtering samples π²
See also: rasterSize(), QwtPlotVectorField::FilterVectors
Definition at line 450 of file qwt_plot_vectorfield.cpp.
void QwtPlotVectorField::setSamples (const QVector< QwtVectorFieldSample > & samples)
Initialize data with an array of samples π¦β¨
Parameters:
- 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. (real "we made it findable" energy, love that for us π«Ά)
Parameters:
- data β Data
Warning: The item takes ownership of the data object, deleting it when its not used anymore. π So do not delete it yourself afterwards, bestie β double free is not the slay you think it is.
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) πΉβ¨
Parameters:
- symbol β Arrow symbol
See also: symbol(), drawSymbol()
Note: Ownership is transferred to QwtPlotVectorField. π you hand it over, it's theirs now.
Definition at line 516 of file qwt_plot_vectorfield.cpp.
const QwtVectorFieldSymbol * QwtPlotVectorField::symbol () const
Returns the arrow symbol πΉ
See also: setSymbol(), drawSymbol()
Definition at line 532 of file qwt_plot_vectorfield.cpp.
bool QwtPlotVectorField::testMagnitudeMode (MagnitudeMode mode) const
Returns True, when mode is enabled β
See also: MagnitudeMode, setMagnitudeMode()
Definition at line 619 of file qwt_plot_vectorfield.cpp.
bool QwtPlotVectorField::testPaintAttribute (PaintAttribute attribute) const
Returns True, when attribute is enabled β
See also: PaintAttribute, setPaintAttribute()
Definition at line 496 of file qwt_plot_vectorfield.cpp.
π«Ά AUTHOR π«Ά
okay so this page wasn't hand-written by some mysterious maintainer bestie β it was generated automatically by Doxygen for Qwt User's Guide from the source code. literally the docs built themselves from the code, no cap. so if something reads a little stiff, blame the generator, not a person π
and that's the whole page, bestie β you made it to the end πβ¨ iconic behavior. this little beauty of a manual page comes to you courtesy of Qwt User's Guide, spun up by Doxygen straight from the source code, and it's filed under QwtPlotVectorField(3) π go forth and draw some vector fields, you absolute main character π¦π
π¦ where this page comes from
- alpine 3.24: qwt-doc 6.3.0-r0 Β· custom
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms