QWT API (English) 7.0.1
Qt Widget Library for Technical Applications - English API Documentation
Loading...
Searching...
No Matches
Classes | Public Types | Public Member Functions | Protected Member Functions | List of all members
QwtPlotVectorField Class Reference

A plot item, that represents a vector field. More...

#include <qwt_plot_vectorfield.h>

Inheritance diagram for QwtPlotVectorField:
QwtPlotSeriesItem QwtSeriesStore< QwtVectorFieldSample > QwtPlotItem QwtAbstractSeriesStore QwtAbstractSeriesStore

Classes

class  PrivateData
 

Public Types

enum  IndicatorOrigin { OriginHead , OriginTail , OriginCenter }
 Indicator origin. More...
 
enum  PaintAttribute { FilterVectors = 0x01 }
 Paint attributes. More...
 
enum  MagnitudeMode { MagnitudeAsColor = 0x01 , MagnitudeAsLength = 0x02 }
 Magnitude mode. 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_PlotArrowMarker , Rtti_PlotBoxChart ,
  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
 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 QwtVectorFieldSymbolsymbol () 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 QwtColorMapcolorMap () 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())
 Constructor.
 
 QwtPlotSeriesItem (const QwtText &title)
 Constructor.
 
virtual ~QwtPlotSeriesItem ()
 Destructor .
 
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.
 
void attach (QwtPlot *plot)
 Attach the item to a plot.
 
void detach ()
 Detach the item from the plot.
 
QwtPlotplot () 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 QwtTexttitle () 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< QwtLegendDatalegendData () 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.
 

Detailed Description

A plot item, that represents a vector field.

Member Enumeration Documentation

◆ IndicatorOrigin

Indicator origin.

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.

◆ MagnitudeMode

Magnitude mode.

Enumerator
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()

◆ PaintAttribute

Paint attributes.

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().

See also
setRasterSize()

Constructor & Destructor Documentation

◆ QwtPlotVectorField() [1/2]

QwtPlotVectorField::QwtPlotVectorField ( const QString &  title = QString())
explicit

Constructor.

◆ QwtPlotVectorField() [2/2]

QwtPlotVectorField::QwtPlotVectorField ( const QwtText title)
explicit

Constructor.

◆ ~QwtPlotVectorField()

QwtPlotVectorField::~QwtPlotVectorField ( )
virtual

Destructor .

Member Function Documentation

◆ arrowLength()

double QwtPlotVectorField::arrowLength ( double  magnitude) const
virtual

Calculate the arrow length for a given magnitude.

◆ boundingRect()

QRectF QwtPlotVectorField::boundingRect ( ) const
overridevirtual

Get the bounding rectangle.

Reimplemented from QwtPlotSeriesItem.

◆ brush()

QBrush QwtPlotVectorField::brush ( ) const

Get the brush used to fill the symbol.

◆ colorMap()

const QwtColorMap * QwtPlotVectorField::colorMap ( ) const

Get the color map used for mapping intensity values to colors.

◆ dataChanged()

void QwtPlotVectorField::dataChanged ( )
overrideprotectedvirtual

dataChanged() indicates, that the series has been changed.

Reimplemented from QwtPlotSeriesItem.

◆ drawSeries()

void QwtPlotVectorField::drawSeries ( QPainter *  painter,
const QwtScaleMap xMap,
const QwtScaleMap yMap,
const QRectF &  canvasRect,
int  from,
int  to 
) const
overridevirtual

Draw a subset of the points.

Implements QwtPlotSeriesItem.

◆ drawSymbol()

void QwtPlotVectorField::drawSymbol ( QPainter *  painter,
double  x,
double  y,
double  vx,
double  vy 
) const
protectedvirtual

Draw a arrow/symbols at a specific position.

x, y, are paint device coordinates, while vx, vy are from the corresponding sample.

See also
setSymbol(), drawSeries()

◆ drawSymbols()

void QwtPlotVectorField::drawSymbols ( QPainter *  painter,
const QwtScaleMap xMap,
const QwtScaleMap yMap,
const QRectF &  canvasRect,
int  from,
int  to 
) const
protectedvirtual

Draw symbols.

Parameters
painterPainter
xMapx map
yMapy map
canvasRectContents rectangle of the canvas
fromIndex of the first sample to be painted
toIndex of the last sample to be painted
See also
setSymbol(), drawSymbol(), drawSeries()

◆ indicatorOrigin()

QwtPlotVectorField::IndicatorOrigin QwtPlotVectorField::indicatorOrigin ( ) const

Get the origin for the symbols/arrows.

◆ legendIcon()

QwtGraphic QwtPlotVectorField::legendIcon ( int  index,
const QSizeF &  size 
) const
overridevirtual

Get the icon representing the vector fields on the legend.

Reimplemented from QwtPlotItem.

◆ magnitudeRange()

QwtInterval QwtPlotVectorField::magnitudeRange ( ) const

Get the magnitude range for color map lookups.

◆ magnitudeScaleFactor()

double QwtPlotVectorField::magnitudeScaleFactor ( ) const

Get the scale factor used to calculate the arrow length from the magnitude.

◆ maxArrowLength()

double QwtPlotVectorField::maxArrowLength ( ) const

Get the maximum for the arrow length.

◆ minArrowLength()

double QwtPlotVectorField::minArrowLength ( ) const

Get the minimum for the arrow length of non zero vectors.

◆ pen()

QPen QwtPlotVectorField::pen ( ) const

Get the pen used to draw the lines.

◆ rasterSize()

QSizeF QwtPlotVectorField::rasterSize ( ) const

Get the raster size used for filtering samples.

◆ rtti()

int QwtPlotVectorField::rtti ( ) const
overridevirtual

Get the runtime type information.

Reimplemented from QwtPlotItem.

◆ setBrush()

void QwtPlotVectorField::setBrush ( const QBrush &  brush)

Assign a brush.

◆ setColorMap()

void QwtPlotVectorField::setColorMap ( QwtColorMap colorMap)

Change the color map.

◆ setIndicatorOrigin()

void QwtPlotVectorField::setIndicatorOrigin ( IndicatorOrigin  origin)

Set the origin for the symbols/arrows.

◆ setMagnitudeMode()

void QwtPlotVectorField::setMagnitudeMode ( MagnitudeMode  mode,
bool  on = true 
)

Specify a mode how to represent the magnitude of an arrow/symbol.

◆ setMagnitudeRange()

void QwtPlotVectorField::setMagnitudeRange ( const QwtInterval magnitudeRange)

Set the magnitude range for color map lookups.

◆ setMagnitudeScaleFactor()

void QwtPlotVectorField::setMagnitudeScaleFactor ( double  factor)

Set the magnitude scale factor.

◆ setMaxArrowLength()

void QwtPlotVectorField::setMaxArrowLength ( double  length)

Set a maximum for the arrow length.

◆ setMinArrowLength()

void QwtPlotVectorField::setMinArrowLength ( double  length)

Set a minimum for the arrow length of non zero vectors.

◆ setPaintAttribute()

void QwtPlotVectorField::setPaintAttribute ( PaintAttribute  attribute,
bool  on = true 
)

Specify an attribute how to draw the curve.

◆ setPen()

void QwtPlotVectorField::setPen ( const QPen &  pen)

Assign a pen.

◆ setRasterSize()

void QwtPlotVectorField::setRasterSize ( const QSizeF &  size)

Set the raster size used for filtering samples.

◆ setSamples() [1/2]

void QwtPlotVectorField::setSamples ( const QVector< QwtVectorFieldSample > &  samples)

Initialize data with an array of samples.

◆ setSamples() [2/2]

void QwtPlotVectorField::setSamples ( QwtVectorFieldData data)

Assign a series of samples.

◆ setSymbol()

void QwtPlotVectorField::setSymbol ( QwtVectorFieldSymbol symbol)

Set a new arrow symbol.

◆ symbol()

const QwtVectorFieldSymbol * QwtPlotVectorField::symbol ( ) const

Get the arrow symbol.

◆ testMagnitudeMode()

bool QwtPlotVectorField::testMagnitudeMode ( MagnitudeMode  mode) const

Test a magnitude mode.

◆ testPaintAttribute()

bool QwtPlotVectorField::testPaintAttribute ( PaintAttribute  attribute) const

Test a paint attribute.


The documentation for this class was generated from the following files: