QwtPlotVectorField(3) | Qwt User's Guide | QwtPlotVectorField(3) |
NAME
QwtPlotVectorField - A plot item, that represents a vector field.
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 Member Functions
QwtPlotVectorField (const QString
&title=QString())
QwtPlotVectorField (const QwtText &title)
virtual ~QwtPlotVectorField ()
Destructor. void setPaintAttribute (PaintAttribute, bool
on=true)
bool testPaintAttribute (PaintAttribute) const
void setMagnitudeMode (MagnitudeMode, bool on=true)
bool testMagnitudeMode (MagnitudeMode) const
void setSymbol (QwtVectorFieldSymbol *)
const QwtVectorFieldSymbol * symbol () const
void setPen (const QPen &)
QPen pen () const
void setBrush (const QBrush &)
Assign a brush. QBrush brush () const
void setRasterSize (const QSizeF &)
QSizeF rasterSize () const
void setIndicatorOrigin (IndicatorOrigin)
IndicatorOrigin indicatorOrigin () const
void setSamples (const QVector< QwtVectorFieldSample
> &)
void setSamples (QwtVectorFieldData *)
void setColorMap (QwtColorMap *)
const QwtColorMap * colorMap () const
void setMagnitudeRange (const QwtInterval &)
QwtInterval magnitudeRange () const
void setMinArrowLength (double)
double minArrowLength () const
void setMaxArrowLength (double)
double maxArrowLength () const
virtual double arrowLength (double magnitude) const
virtual QRectF boundingRect () const override
virtual void drawSeries (QPainter *, const QwtScaleMap
&xMap, const QwtScaleMap &yMap, const QRectF &canvasRect,
int from, int to) const override
virtual int rtti () const override
virtual QwtGraphic legendIcon (int index, const QSizeF &)
const override
void setMagnitudeScaleFactor (double factor)
Set the magnitudeScaleFactor. double magnitudeScaleFactor () const
Protected Member Functions
virtual void drawSymbols (QPainter *, const
QwtScaleMap &xMap, const QwtScaleMap &yMap, const
QRectF &canvasRect, int from, int to) const
virtual void drawSymbol (QPainter *, double x, double y, double vx,
double vy) const
virtual void dataChanged () override
dataChanged() indicates, that the series has been changed.
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
Definition at line 30 of file qwt_plot_vectorfield.h.
Member Typedef Documentation
typedef QFlags<MagnitudeMode > QwtPlotVectorField::MagnitudeModes
An ORed combination of MagnitudeMode values.
Definition at line 90 of file qwt_plot_vectorfield.h.
typedef QFlags<PaintAttribute > QwtPlotVectorField::PaintAttributes
An ORed combination of PaintAttribute values.
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.
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.
enum QwtPlotVectorField::MagnitudeMode
Depending on the MagnitudeMode the magnitude component will have an impact on the attributes of the symbol/arrow.
See also
Enumerator
- MagnitudeAsColor
- The magnitude will be mapped to a color using a color map
See also
- MagnitudeAsLength
- The magnitude will have an impact on the length of the arrow/symbol
See also
Definition at line 75 of file qwt_plot_vectorfield.h.
enum QwtPlotVectorField::PaintAttribute
Attributes to modify the rendering
See also
Definition at line 55 of file qwt_plot_vectorfield.h.
Constructor & Destructor Documentation
QwtPlotVectorField::QwtPlotVectorField (const QString & title = QString()) [explicit]
Constructor
Parameters
Definition at line 302 of file qwt_plot_vectorfield.cpp.
QwtPlotVectorField::QwtPlotVectorField (const QwtText & title) [explicit]
Constructor
Parameters
Definition at line 292 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
Returns
See also
Note
Definition at line 726 of file qwt_plot_vectorfield.cpp.
QRectF QwtPlotVectorField::boundingRect () const [override], [virtual]
Returns
Note
Reimplemented from QwtPlotSeriesItem.
Definition at line 749 of file qwt_plot_vectorfield.cpp.
QBrush QwtPlotVectorField::brush () const
Returns
See also
Definition at line 379 of file qwt_plot_vectorfield.cpp.
const QwtColorMap * QwtPlotVectorField::colorMap () const
Returns
See also
Definition at line 590 of file qwt_plot_vectorfield.cpp.
void QwtPlotVectorField::drawSeries (QPainter * painter, const QwtScaleMap & xMap, const QwtScaleMap & yMap, const QRectF & canvasRect, int from, int to) const [override], [virtual]
Draw a subset of the points
Parameters
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 (QPainter * painter, double x, double y, double vx, double vy) const [protected], [virtual]
Draw a arrow/symbols at a specific position
x, y, are paint device coordinates, while vx, vy are from the corresponding sample.
See also
Definition at line 975 of file qwt_plot_vectorfield.cpp.
void QwtPlotVectorField::drawSymbols (QPainter * painter, const QwtScaleMap & xMap, const QwtScaleMap & yMap, const QRectF & canvasRect, int from, int to) const [protected], [virtual]
Draw symbols
Parameters
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
Definition at line 847 of file qwt_plot_vectorfield.cpp.
QwtPlotVectorField::IndicatorOrigin QwtPlotVectorField::indicatorOrigin () const
Returns
Definition at line 401 of file qwt_plot_vectorfield.cpp.
QwtGraphic QwtPlotVectorField::legendIcon (int index, const QSizeF & size) const [override], [virtual]
Returns
Parameters
size Icon size
See also
Reimplemented from QwtPlotItem.
Definition at line 770 of file qwt_plot_vectorfield.cpp.
QwtInterval QwtPlotVectorField::magnitudeRange () const
Returns
See also
Definition at line 645 of file qwt_plot_vectorfield.cpp.
double QwtPlotVectorField::magnitudeScaleFactor () const
Returns
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.
Returns
See also
Note
Definition at line 440 of file qwt_plot_vectorfield.cpp.
double QwtPlotVectorField::maxArrowLength () const
Returns
See also
Note
Definition at line 705 of file qwt_plot_vectorfield.cpp.
double QwtPlotVectorField::minArrowLength () const
Returns
See also
Note
Definition at line 675 of file qwt_plot_vectorfield.cpp.
QPen QwtPlotVectorField::pen () const
Returns
See also
Definition at line 351 of file qwt_plot_vectorfield.cpp.
QSizeF QwtPlotVectorField::rasterSize () const
Returns
See also
Definition at line 463 of file qwt_plot_vectorfield.cpp.
int QwtPlotVectorField::rtti () const [override], [virtual]
Returns
Reimplemented from QwtPlotItem.
Definition at line 503 of file qwt_plot_vectorfield.cpp.
void QwtPlotVectorField::setBrush (const QBrush & brush)
Assign a brush.
Parameters
See also
Note
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
See also
Definition at line 571 of file qwt_plot_vectorfield.cpp.
void QwtPlotVectorField::setIndicatorOrigin (IndicatorOrigin origin)
Set the origin for the symbols/arrows
Parameters
See also
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
Parameters
on On/Off
See also
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.
See also
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
See also
Note
Definition at line 417 of file qwt_plot_vectorfield.cpp.
void QwtPlotVectorField::setMaxArrowLength (double length)
Set a maximum for the arrow length
Parameters
See also
Note
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
See also
Note
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
on On/Off
See also
Definition at line 475 of file qwt_plot_vectorfield.cpp.
void QwtPlotVectorField::setPen (const QPen & pen)
Assign a pen
Parameters
See also
Note
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
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
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.
Parameters
Warning
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
See also
Note
Definition at line 516 of file qwt_plot_vectorfield.cpp.
const QwtVectorFieldSymbol * QwtPlotVectorField::symbol () const
Returns
See also
Definition at line 532 of file qwt_plot_vectorfield.cpp.
bool QwtPlotVectorField::testMagnitudeMode (MagnitudeMode mode) const
Returns
See also
Definition at line 619 of file qwt_plot_vectorfield.cpp.
bool QwtPlotVectorField::testPaintAttribute (PaintAttribute attribute) const
Returns
See also
Definition at line 496 of file qwt_plot_vectorfield.cpp.
Author
Generated automatically by Doxygen for Qwt User's Guide from the source code.
Sun Jul 18 2021 | Version 6.2.0 |