QGIS API Documentation
3.8.0-Zanzibar (11aff65)
src
analysis
raster
qgsrastercalcnode.h
Go to the documentation of this file.
1
/***************************************************************************
2
qgsrastercalcnode.h
3
Node for raster calculator tree
4
--------------------
5
begin : 2010-10-23
6
copyright : (C) 20010 by Marco Hugentobler
7
email : marco dot hugentobler at sourcepole dot ch
8
***************************************************************************/
9
10
/***************************************************************************
11
* *
12
* This program is free software; you can redistribute it and/or modify *
13
* it under the terms of the GNU General Public License as published by *
14
* the Free Software Foundation; either version 2 of the License, or *
15
* (at your option) any later version. *
16
* *
17
***************************************************************************/
18
19
#ifndef QGSRASTERCALCNODE_H
20
#define QGSRASTERCALCNODE_H
21
22
#include <QMap>
23
#include "
qgis_sip.h
"
24
#include "
qgis.h
"
25
#include <QString>
26
#include "qgis_analysis.h"
27
28
class
QgsRasterBlock
;
29
class
QgsRasterMatrix
;
30
35
class
ANALYSIS_EXPORT
QgsRasterCalcNode
36
{
37
public
:
39
enum
Type
40
{
41
tOperator = 1,
42
tNumber
,
43
tRasterRef
,
44
tMatrix
45
};
46
48
enum
Operator
49
{
50
opPLUS
,
51
opMINUS
,
52
opMUL
,
53
opDIV
,
54
opPOW
,
55
opSQRT
,
56
opSIN
,
57
opCOS
,
58
opTAN
,
59
opASIN
,
60
opACOS
,
61
opATAN
,
62
opEQ
,
// =
63
opNE
,
64
opGT
,
// >
65
opLT
,
// <
66
opGE
,
// >=
67
opLE
,
// <=
68
opAND
,
69
opOR
,
70
opSIGN
,
// change sign
71
opLOG
,
72
opLOG10
,
73
opNONE
,
74
};
75
79
QgsRasterCalcNode
() =
default
;
80
81
QgsRasterCalcNode
(
double
number );
82
QgsRasterCalcNode
(
QgsRasterMatrix
*matrix );
83
QgsRasterCalcNode
(
Operator
op,
QgsRasterCalcNode
*left,
QgsRasterCalcNode
*right );
84
QgsRasterCalcNode
(
const
QString &rasterName );
85
~
QgsRasterCalcNode
();
86
88
QgsRasterCalcNode
(
const
QgsRasterCalcNode
&rh ) =
delete
;
90
QgsRasterCalcNode
&operator=(
const
QgsRasterCalcNode
&rh ) =
delete
;
91
92
Type
type
()
const
{
return
mType; }
93
94
//set left node
95
void
setLeft
(
QgsRasterCalcNode
*left ) {
delete
mLeft; mLeft = left; }
96
void
setRight
(
QgsRasterCalcNode
*right ) {
delete
mRight; mRight = right; }
97
107
bool
calculate( QMap<QString, QgsRasterBlock * > &rasterData,
QgsRasterMatrix
&result,
int
row = -1 )
const
SIP_SKIP
;
108
114
QString toString(
bool
cStyle =
false
)
const
;
115
120
QList<const QgsRasterCalcNode *> findNodes(
const
QgsRasterCalcNode::Type
type )
const
;
121
122
static
QgsRasterCalcNode
*parseRasterCalcString(
const
QString &str, QString &parserErrorMsg )
SIP_FACTORY
;
123
124
private
:
125
#ifdef SIP_RUN
126
QgsRasterCalcNode
(
const
QgsRasterCalcNode
&rh );
127
#endif
128
129
Type
mType = tNumber;
130
QgsRasterCalcNode
*mLeft =
nullptr
;
131
QgsRasterCalcNode
*mRight =
nullptr
;
132
double
mNumber = 0;
133
QString mRasterName;
134
QgsRasterMatrix
*mMatrix =
nullptr
;
135
Operator
mOperator = opNONE;
136
137
};
138
139
140
#endif // QGSRASTERCALCNODE_H
QgsRasterCalcNode::tNumber
Definition:
qgsrastercalcnode.h:42
QgsRasterCalcNode::opLT
Definition:
qgsrastercalcnode.h:65
QgsRasterCalcNode::opMINUS
Definition:
qgsrastercalcnode.h:51
QgsRasterCalcNode::opMUL
Definition:
qgsrastercalcnode.h:52
QgsRasterCalcNode::opAND
Definition:
qgsrastercalcnode.h:68
QgsRasterCalcNode::tRasterRef
Definition:
qgsrastercalcnode.h:43
QgsRasterCalcNode::opPLUS
Definition:
qgsrastercalcnode.h:50
QgsRasterCalcNode::opGE
Definition:
qgsrastercalcnode.h:66
QgsRasterCalcNode::type
Type type() const
Definition:
qgsrastercalcnode.h:92
QgsRasterCalcNode::opNE
Definition:
qgsrastercalcnode.h:63
QgsRasterCalcNode::opLOG
Definition:
qgsrastercalcnode.h:71
QgsRasterBlock
Raster data container.
Definition:
qgsrasterblock.h:36
SIP_SKIP
#define SIP_SKIP
Definition:
qgis_sip.h:119
QgsRasterCalcNode::opNONE
Definition:
qgsrastercalcnode.h:73
qgis_sip.h
QgsRasterCalcNode::opDIV
Definition:
qgsrastercalcnode.h:53
QgsRasterCalcNode::Type
Type
defines possible types of node
Definition:
qgsrastercalcnode.h:39
QgsRasterCalcNode::Operator
Operator
possible operators
Definition:
qgsrastercalcnode.h:48
QgsRasterCalcNode::opGT
=
Definition:
qgsrastercalcnode.h:64
QgsRasterCalcNode::opLOG10
Definition:
qgsrastercalcnode.h:72
QgsRasterCalcNode::opOR
Definition:
qgsrastercalcnode.h:69
SIP_FACTORY
#define SIP_FACTORY
Definition:
qgis_sip.h:69
QgsRasterCalcNode::opSIN
Definition:
qgsrastercalcnode.h:56
QgsRasterCalcNode::opSQRT
Definition:
qgsrastercalcnode.h:55
QgsRasterMatrix
Definition:
qgsrastermatrix.h:28
QgsRasterCalcNode
Definition:
qgsrastercalcnode.h:35
QgsRasterCalcNode::opPOW
Definition:
qgsrastercalcnode.h:54
QgsRasterCalcNode::opEQ
Definition:
qgsrastercalcnode.h:62
QgsRasterCalcNode::opASIN
Definition:
qgsrastercalcnode.h:59
QgsRasterCalcNode::opTAN
Definition:
qgsrastercalcnode.h:58
QgsRasterCalcNode::opLE
Definition:
qgsrastercalcnode.h:67
QgsRasterCalcNode::opSIGN
Definition:
qgsrastercalcnode.h:70
QgsRasterCalcNode::setLeft
void setLeft(QgsRasterCalcNode *left)
Definition:
qgsrastercalcnode.h:95
QgsRasterCalcNode::setRight
void setRight(QgsRasterCalcNode *right)
Definition:
qgsrastercalcnode.h:96
qgis.h
QgsRasterCalcNode::opCOS
Definition:
qgsrastercalcnode.h:57
QgsRasterCalcNode::opACOS
Definition:
qgsrastercalcnode.h:60
QgsRasterCalcNode::opATAN
Definition:
qgsrastercalcnode.h:61
Generated on Sat Jun 22 2019 09:24:07 for QGIS API Documentation by
1.8.13