2012-09-24 02:28:15 +02:00
|
|
|
class QgsRasterCalcNode
|
|
|
|
{
|
|
|
|
%TypeHeaderCode
|
|
|
|
#include <qgsrastercalcnode.h>
|
|
|
|
%End
|
|
|
|
public:
|
|
|
|
//! defines possible types of node
|
|
|
|
enum Type
|
|
|
|
{
|
2014-06-02 21:00:51 +02:00
|
|
|
tOperator,
|
2012-09-24 02:28:15 +02:00
|
|
|
tNumber,
|
2015-06-04 20:29:02 +10:00
|
|
|
tRasterRef,
|
|
|
|
tMatrix
|
2012-09-24 02:28:15 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
//! possible operators
|
|
|
|
enum Operator
|
|
|
|
{
|
|
|
|
opPLUS,
|
|
|
|
opMINUS,
|
|
|
|
opMUL,
|
|
|
|
opDIV,
|
|
|
|
opPOW,
|
|
|
|
opSQRT,
|
|
|
|
opSIN,
|
|
|
|
opCOS,
|
|
|
|
opTAN,
|
|
|
|
opASIN,
|
|
|
|
opACOS,
|
|
|
|
opATAN,
|
|
|
|
opEQ, // =
|
|
|
|
opNE, //!=
|
|
|
|
opGT, // >
|
|
|
|
opLT, // <
|
|
|
|
opGE, // >=
|
|
|
|
opLE, // <=
|
|
|
|
opAND,
|
|
|
|
opOR,
|
2015-02-23 21:48:04 +01:00
|
|
|
opSIGN, // change sign
|
|
|
|
opNONE,
|
2012-09-24 02:28:15 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
QgsRasterCalcNode();
|
|
|
|
QgsRasterCalcNode( double number );
|
2015-06-04 20:29:02 +10:00
|
|
|
QgsRasterCalcNode( QgsRasterMatrix* matrix );
|
2012-09-24 02:28:15 +02:00
|
|
|
QgsRasterCalcNode( Operator op, QgsRasterCalcNode* left, QgsRasterCalcNode* right );
|
|
|
|
QgsRasterCalcNode( const QString& rasterName );
|
|
|
|
~QgsRasterCalcNode();
|
|
|
|
|
|
|
|
Type type() const;
|
|
|
|
|
|
|
|
//set left node
|
|
|
|
void setLeft( QgsRasterCalcNode* left );
|
|
|
|
void setRight( QgsRasterCalcNode* right );
|
|
|
|
|
2015-07-29 11:52:14 +02:00
|
|
|
/** Calculates result (might be real matrix or single number)*/
|
2015-06-08 14:10:39 +10:00
|
|
|
// bool calculate( QMap<QString, QgsRasterCalculateInputMatrix*>& rasterData, QgsRasterMatrix& result ) const;
|
|
|
|
|
2015-07-29 11:52:14 +02:00
|
|
|
/** Calculates result of raster calculation (might be real matrix or single number).
|
2015-06-08 14:10:39 +10:00
|
|
|
* @param rasterData input raster data references, map of raster name to raster data block
|
|
|
|
* @param result destination raster matrix for calculation results
|
|
|
|
* @param row optional row number to calculate for calculating result by rows, or -1 to
|
|
|
|
* calculate entire result
|
|
|
|
* @note added in QGIS 2.10
|
|
|
|
* @note not available in Python bindings
|
|
|
|
*/
|
|
|
|
//bool calculate( QMap<QString, QgsRasterBlock* >& rasterData, QgsRasterMatrix& result, int row = -1 ) const;
|
|
|
|
|
2015-07-29 11:52:14 +02:00
|
|
|
/** @deprecated use method which accepts QgsRasterBlocks instead
|
2015-06-08 14:10:39 +10:00
|
|
|
*/
|
|
|
|
// bool calculate( QMap<QString, QgsRasterMatrix*>& rasterData, QgsRasterMatrix& result ) const /Deprecated/;
|
2012-09-24 02:28:15 +02:00
|
|
|
|
|
|
|
static QgsRasterCalcNode* parseRasterCalcString( const QString& str, QString& parserErrorMsg ) /Factory/;
|
|
|
|
};
|