|
QWT API (English) 7.3.0
Qt Widget Library for Technical Applications - English API Documentation
|
A class that encapsulates grid data and provides interpolation methods. More...
#include <qwt_grid_raster_data.h>
Classes | |
| class | PrivateData |
Public Types | |
| enum | ResampleMode { NearestNeighbour , BilinearInterpolation , BicubicInterpolation } |
| Resampling algorithm. More... | |
Public Types inherited from QwtRasterData | |
| enum | Attribute { WithoutGaps = 0x01 } |
| Raster data attributes. More... | |
| enum | ConrecFlag { IgnoreAllVerticesOnLevel = 0x01 , IgnoreOutOfRange = 0x02 } |
| Flags to modify the contour algorithm. More... | |
| using | ContourLines = QMap< double, QPolygonF > |
| Contour lines. | |
Public Member Functions | |
| QwtGridRasterData () | |
| Constructor. | |
| void | setResampleMode (ResampleMode mode) |
| Set the resample method. | |
| ResampleMode | resampleMode () const |
| Get the current resample method. | |
| virtual QwtInterval | interval (Qt::Axis axis) const override final |
| Return bounding interval for an axis. | |
| void | setValue (const QVector< double > &x, const QVector< double > &y, const QVector< QVector< double > > &v) |
| Set new x-axis, y-axis, and data matrix. | |
| virtual double | value (double x, double y) const override |
| Return the value at a raster position. | |
| virtual QRectF | pixelHint (const QRectF &) const override |
| Calculate the pixel hint. | |
| int | xSize () const |
| Return the size of x-axis. | |
| int | ySize () const |
| Return the size of y-axis. | |
| std::pair< int, int > | valueSize () const |
| Return the size of the value matrix. | |
| double | atValue (int xIndex, int yIndex) const |
| Return the value at specified position in the value matrix. | |
| double | atX (int xIndex) const |
| Return the x-axis value at specified index. | |
| double | atY (int yIndex) const |
| Return the y-axis value at specified index. | |
Public Member Functions inherited from QwtRasterData | |
| QwtRasterData () | |
| Constructor. | |
| virtual | ~QwtRasterData () |
| Destructor. | |
| void | setAttribute (Attribute, bool on=true) |
| Set an attribute. | |
| bool | testAttribute (Attribute) const |
| Test an attribute. | |
| virtual void | initRaster (const QRectF &, const QSize &raster) |
| Initialize the raster. | |
| virtual void | discardRaster () |
| Discard the raster. | |
| virtual ContourLines | contourLines (const QRectF &rect, const QSize &raster, const QList< double > &levels, ConrecFlags) const |
| Calculate contour lines. | |
A class that encapsulates grid data and provides interpolation methods.
This class inherits from QwtRasterData and is used to represent 2D grid data. It supports various interpolation methods such as nearest neighbor and bilinear interpolation.
Resampling algorithm.
The default setting is NearestNeighbour.
| QwtGridRasterData::QwtGridRasterData | ( | ) |
Constructor.
Destructor
| double QwtGridRasterData::atValue | ( | int | xIndex, |
| int | yIndex | ||
| ) | const |
Return the value at specified position in the value matrix.
| [in] | xIndex | X index. |
| [in] | yIndex | Y index. |
| double QwtGridRasterData::atX | ( | int | xIndex | ) | const |
Return the x-axis value at specified index.
| [in] | xIndex | X index. |
| double QwtGridRasterData::atY | ( | int | yIndex | ) | const |
Return the y-axis value at specified index.
| [in] | yIndex | Y index. |
|
finaloverridevirtual |
Return bounding interval for an axis.
| [in] | axis | Axis to query (X, Y, or Z) |
Implements QwtRasterData.
|
overridevirtual |
Calculate the pixel hint.
pixelHint() returns the geometry of a pixel that can be used to calculate the resolution and alignment of the plot item representing the data. For NearestNeighbour mode, returns the surrounding pixel. For other modes, returns an empty rectangle.
| [in] | area | Requested area (ignored) |
Reimplemented from QwtRasterData.
| QwtGridRasterData::ResampleMode QwtGridRasterData::resampleMode | ( | ) | const |
Get the current resample method.
| void QwtGridRasterData::setResampleMode | ( | QwtGridRasterData::ResampleMode | mode | ) |
Set the resample method.
Sets the resample method to be used when querying values.
| [in] | mode | The resample method to use. |
| void QwtGridRasterData::setValue | ( | const QVector< double > & | x, |
| const QVector< double > & | y, | ||
| const QVector< QVector< double > > & | v | ||
| ) |
Set new x-axis, y-axis, and data matrix.
The data matrix layout:
| [in] | x | The x-axis values |
| [in] | y | The y-axis values |
| [in] | v | The 2D data matrix |
|
overridevirtual |
Return the value at a raster position.
| [in] | x | X value in plot coordinates |
| [in] | y | Y value in plot coordinates |
Implements QwtRasterData.
| std::pair< int, int > QwtGridRasterData::valueSize | ( | ) | const |
Return the size of the value matrix.
| int QwtGridRasterData::xSize | ( | ) | const |
Return the size of x-axis.
| int QwtGridRasterData::ySize | ( | ) | const |
Return the size of y-axis.