QWT API (中文) 7.3.0
Qt绘图库 - 中文API文档
载入中...
搜索中...
未找到
| Public 类型 | Public 成员函数 | Protected 成员函数 | 所有成员列表
QwtPlotVectorField类 参考

A plot item, that represents a vector field 更多...

#include <qwt_plot_vectorfield.h>

类 QwtPlotVectorField 继承关系图:
QwtPlotSeriesItem QwtSeriesStore< QwtVectorFieldSample > QwtPlotItem QwtAbstractSeriesStore QwtAbstractSeriesStore

class  PrivateData
 

Public 类型

enum  IndicatorOrigin { OriginHead , OriginTail , OriginCenter }
 Indicator origin 更多...
 
enum  PaintAttribute { FilterVectors = 0x01 }
 Paint attributes 更多...
 
enum  MagnitudeMode { MagnitudeAsColor = 0x01 , MagnitudeAsLength = 0x02 }
 Magnitude mode 更多...
 
- Public 类型 继承自 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 更多...
 
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 更多...
 

Public 成员函数

 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 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 成员函数 继承自 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 成员函数 继承自 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
 
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 成员函数 继承自 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 成员函数

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 成员函数 继承自 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.

参见
QwtVectorFieldSymbol, QwtVectorFieldSample

成员枚举类型说明

◆ IndicatorOrigin

Indicator origin

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 position

OriginTail 

The arrow starts at the sample position

OriginCenter 

The arrow is centered at the sample position

◆ MagnitudeMode

Magnitude mode

Depending on the MagnitudeMode the magnitude component will have an impact on the attributes of the symbol/arrow.

参见
setMagnitudeMode()
枚举值
MagnitudeAsColor 

The magnitude will be mapped to a color using a color map

参见
magnitudeRange(), colorMap()
MagnitudeAsLength 

The magnitude will have an impact on the length of the arrow/symbol

参见
arrowLength(), magnitudeScaleFactor()

◆ PaintAttribute

Paint attributes

Attributes to modify the rendering

参见
setPaintAttribute(), testPaintAttribute()
枚举值
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().

参见
setRasterSize()

构造及析构函数说明

◆ QwtPlotVectorField()

QwtPlotVectorField::QwtPlotVectorField ( const QwtText title)
explicit

Constructor

参数
[in]titleTitle of the curve

Constructor

参数
[in]titleTitle of the curve

Destructor

成员函数说明

◆ arrowLength()

double QwtPlotVectorField::arrowLength ( double  magnitude) const
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]magnitudeMagnitude
返回
Length of arrow to be drawn in dependence of vector magnitude.
注解
Has no effect when QwtPlotVectorField::MagnitudeAsLength is not enabled
参见
magnitudeScaleFactor, minArrowLength(), maxArrowLength()

◆ boundingRect()

QRectF QwtPlotVectorField::boundingRect ( ) const
overridevirtual

Get the bounding rectangle

返回
Bounding rectangle of all samples

重载 QwtPlotSeriesItem .

◆ brush()

QBrush QwtPlotVectorField::brush ( ) const

Get the brush used to fill the symbol

返回
Brush used for filling
参见
setBrush(), pen()

◆ colorMap()

const QwtColorMap * QwtPlotVectorField::colorMap ( ) const

Get the color map used for mapping intensity values to colors

返回
Color Map
参见
setColorMap()

◆ dataChanged()

void QwtPlotVectorField::dataChanged ( )
overrideprotectedvirtual

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

重载 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

参数
[in]painterPainter
[in]xMapMaps x-values into pixel coordinates.
[in]yMapMaps y-values into pixel coordinates.
[in]canvasRectContents rectangle of the canvas
[in]fromIndex of the first sample to be painted
[in]toIndex of the last sample to be painted. If to < 0 the series will be painted to its last sample.

实现了 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.

参见
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

参数
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
参见
setSymbol(), drawSymbol(), drawSeries()

◆ indicatorOrigin()

QwtPlotVectorField::IndicatorOrigin QwtPlotVectorField::indicatorOrigin ( ) const

Get the origin for the symbols/arrows

返回
Origin position
参见
setIndicatorOrigin()

◆ legendIcon()

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

Get the icon representing the vector fields on the legend

参数
[in]indexIndex of the legend entry ( ignored as there is only one )
[in]sizeIcon size
返回
Legend icon
参见
QwtPlotItem::setLegendIconSize(), QwtPlotItem::legendData()

重载 QwtPlotItem .

◆ magnitudeRange()

QwtInterval QwtPlotVectorField::magnitudeRange ( ) const

Get the magnitude range for color map lookups

返回
Magnitude range
参见
setMagnitudeRange(), colorMap()

◆ magnitudeScaleFactor()

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.

返回
Scale factor
注解
Has no effect when QwtPlotVectorField::MagnitudeAsLength is not enabled
参见
setMagnitudeScaleFactor()

◆ maxArrowLength()

double QwtPlotVectorField::maxArrowLength ( ) const

Get the maximum for the arrow length

返回
Maximum for the arrow length in pixels
注解
Has no effect when QwtPlotVectorField::MagnitudeAsLength is not enabled
参见
setMinArrowLength(), maxArrowLength(), arrowLength()

◆ minArrowLength()

double QwtPlotVectorField::minArrowLength ( ) const

Get the minimum for the arrow length of non zero vectors

返回
Minimum for the arrow length in pixels
注解
Has no effect when QwtPlotVectorField::MagnitudeAsLength is not enabled
参见
setMinArrowLength(), maxArrowLength(), arrowLength()

◆ pen()

QPen QwtPlotVectorField::pen ( ) const

Get the pen used to draw the lines

返回
Pen used for drawing
参见
setPen(), brush()

◆ rasterSize()

QSizeF QwtPlotVectorField::rasterSize ( ) const

Get the raster size used for filtering samples

返回
Raster size
参见
setRasterSize(), QwtPlotVectorField::FilterVectors

◆ rtti()

int QwtPlotVectorField::rtti ( ) const
overridevirtual

Get the runtime type information

返回
QwtPlotItem::Rtti_PlotVectorField

重载 QwtPlotItem .

◆ setBrush()

void QwtPlotVectorField::setBrush ( const QBrush &  brush)

Assign a brush

参数
[in]brushNew brush
注解
The brush is ignored in MagnitudeAsColor mode
参见
brush(), pen()

◆ setColorMap()

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]colorMapColor Map
参见
colorMap(), magnitudeRange()

◆ setIndicatorOrigin()

void QwtPlotVectorField::setIndicatorOrigin ( IndicatorOrigin  origin)

Set the origin for the symbols/arrows

参数
[in]originOrigin position
参见
indicatorOrigin()

◆ setMagnitudeMode()

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

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

参数
[in]modeMode
[in]onOn/Off
参见
testMagnitudeMode()

◆ setMagnitudeRange()

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]magnitudeRangeMagnitude range
参见
magnitudeRange(), colorMap()

◆ setMagnitudeScaleFactor()

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]factorScale factor
注解
Has no effect when QwtPlotVectorField::MagnitudeAsLength is not enabled
参见
magnitudeScaleFactor(), arrowLength()

◆ setMaxArrowLength()

void QwtPlotVectorField::setMaxArrowLength ( double  length)

Set a maximum for the arrow length

参数
[in]lengthMaximum for the arrow length in pixels
注解
Has no effect when QwtPlotVectorField::MagnitudeAsLength is not enabled
参见
maxArrowLength(), setMinArrowLength(), arrowLength()

◆ setMinArrowLength()

void QwtPlotVectorField::setMinArrowLength ( double  length)

Set a minimum for the arrow length of non zero vectors

参数
[in]lengthMinimum for the arrow length in pixels
注解
Has no effect when QwtPlotVectorField::MagnitudeAsLength is not enabled
参见
minArrowLength(), setMaxArrowLength(), arrowLength()

◆ setPaintAttribute()

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

Specify an attribute how to draw the curve

参数
[in]attributePaint attribute
[in]onOn/Off
参见
testPaintAttribute()

◆ setPen()

void QwtPlotVectorField::setPen ( const QPen &  pen)

Assign a pen

参数
[in]penNew pen
注解
The pen is ignored in MagnitudeAsColor mode
参见
pen(), brush()

◆ setRasterSize()

void QwtPlotVectorField::setRasterSize ( const QSizeF &  size)

Set the raster size used for filtering samples

参数
[in]sizeRaster size
参见
rasterSize(), QwtPlotVectorField::FilterVectors

◆ setSamples() [1/2]

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

Initialize data with an array of samples

参数
[in]samplesVector of points

◆ setSamples() [2/2]

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]dataData
警告
The item takes ownership of the data object, deleting it when its not used anymore.

◆ setSymbol()

void QwtPlotVectorField::setSymbol ( QwtVectorFieldSymbol symbol)

Set a new arrow symbol

Sets a new arrow symbol (implementation of arrow drawing code).

参数
[in]symbolArrow symbol
注解
Ownership is transferred to QwtPlotVectorField.
参见
symbol(), drawSymbol()

◆ symbol()

const QwtVectorFieldSymbol * QwtPlotVectorField::symbol ( ) const

Get the arrow symbol

返回
Arrow symbol
参见
setSymbol(), drawSymbol()

◆ testMagnitudeMode()

bool QwtPlotVectorField::testMagnitudeMode ( MagnitudeMode  mode) const

Test a magnitude mode

返回
True when mode is enabled
参见
MagnitudeMode, setMagnitudeMode()

◆ testPaintAttribute()

bool QwtPlotVectorField::testPaintAttribute ( PaintAttribute  attribute) const

Test a paint attribute

返回
True when attribute is enabled
参见
PaintAttribute, setPaintAttribute()

该类的文档由以下文件生成: