Performs arithmetic operation over raster data. More...
#include <ArithmeticOperations.h>
 
  
 | Classes | |
| class | ExecStackElement | 
| Execution stack element.  More... | |
| class | InputParameters | 
| ArithmeticOperations input parameters.  More... | |
| class | OutputParameters | 
| ArithmeticOperations output parameters.  More... | |
| Public Member Functions | |
| ArithmeticOperations () | |
| bool | execute (AlgorithmOutputParameters &outputParams) throw ( te::rp::Exception ) | 
| Executes the algorithm using the supplied parameters.  More... | |
| bool | initialize (const AlgorithmInputParameters &inputParams) throw ( te::rp::Exception ) | 
| Initialize the algorithm instance making it ready for execution.  More... | |
| bool | isInitialized () const | 
| Returns true if the algorithm instance is initialized and ready for execution.  More... | |
| void | reset () throw ( te::rp::Exception ) | 
| Clear all internal allocated objects and reset the algorithm to its initial state.  More... | |
| ~ArithmeticOperations () | |
| Protected Types | |
| typedef void(ArithmeticOperations::* | BinOpFuncPtrT) (const double &inputValue1, const double &inputValue2, double &outputValue) const | 
| Type definition for a operation function pointer.  More... | |
| typedef std::stack< ExecStackElement > | ExecStackT | 
| Execution stack type definition.  More... | |
| Protected Member Functions | |
| void | additionBinOp (const double &inputValue1, const double &inputValue2, double &outputValue) const | 
| Addition binary operator function.  More... | |
| bool | allocResultRaster (const te::rst::Grid &grid, std::auto_ptr< te::rst::Raster > &rasterPtr) const | 
| Allocate a new RAM memory raster.  More... | |
| void | divisionBinOp (const double &inputValue1, const double &inputValue2, double &outputValue) const | 
| Division binary operator function.  More... | |
| bool | execBinaryOperator (const std::string &token, ExecStackT &execStack, bool generateOutput) const | 
| Execute the given binary operator using the current given execution stack.  More... | |
| bool | execBinaryOperatorRasterXRaster (const te::rst::Raster &inRaster1, const unsigned int band1, const te::rst::Raster &inRaster2, const unsigned int band2, const BinOpFuncPtrT binOptFunctPtr, std::auto_ptr< te::rst::Raster > &outRasterPtr) const | 
| Execute the given binary operator using the given input rasters.  More... | |
| bool | execBinaryOperatorRasterXReal (const te::rst::Raster &inRaster, const unsigned int bandIdx, const double value, const BinOpFuncPtrT binOptFunctPtr, std::auto_ptr< te::rst::Raster > &outRasterPtr, const bool realNumberIsRigthtTerm) const | 
| Execute the given binary operator using the given input raster and a real number.  More... | |
| bool | execUnaryOperator (const std::string &token, ExecStackT &execStack, bool generateOutput) const | 
| Execute the given unary operator using the current given execution stack.  More... | |
| bool | executeString (const std::string &aStr, const std::vector< te::rst::Raster * > &inRasters, std::auto_ptr< te::rst::Raster > &outRaster, bool generateOutput, te::common::TaskProgress *const progressPtr) const | 
| Execute the automata parsing the given input string.  More... | |
| void | getTokensStrs (const std::string &inputStr, std::vector< std::string > &outTokens) const | 
| Split the input string into a vector of token strings.  More... | |
| void | inFix2PostFix (const std::vector< std::string > &input, std::vector< std::string > &output) const | 
| Convert the input tokens vector from the infix notation to postfix notation.  More... | |
| bool | isBinaryOperator (const std::string &inputToken) const | 
| Returns true if the given token is a binary operator.  More... | |
| bool | isOperator (const std::string &inputToken) const | 
| Returns true if the given token is an operator.  More... | |
| bool | isRasterBandToken (const std::string &token, unsigned int &rasterIdx, unsigned int &bandIdx) const | 
| Returns true if the given token is a raster data token.  More... | |
| bool | isRealNumberToken (const std::string &token, double &realValue) const | 
| Returns true if the given token is a real number.  More... | |
| bool | isUnaryOperator (const std::string &inputToken) const | 
| Returns true if the given token is a unary operator.  More... | |
| void | multiplicationBinOp (const double &inputValue1, const double &inputValue2, double &outputValue) const | 
| Multiplication binary operator function.  More... | |
| bool | op1HasGreaterOrEqualPrecedence (const std::string &operator1, const std::string &operator2) const | 
| Returns true if operator1 has greater of equal precedence over operator2.  More... | |
| void | printTokens (const std::vector< std::string > &input) const | 
| Print tokens to stout.  More... | |
| void | subtractionBinOp (const double &inputValue1, const double &inputValue2, double &outputValue) const | 
| Subtraction binary operator function.  More... | |
| Protected Attributes | |
| ArithmeticOperations::InputParameters | m_inputParameters | 
| Input execution parameters.  More... | |
| bool | m_isInitialized | 
| Tells if this instance is initialized.  More... | |
Performs arithmetic operation over raster data.
The expression (arithmetic stringIt) must be formed by a combination of the following elements, separated by spaces:
Operators: +, -, *, /
Real Numbers (negative numbers must follow the form "-1.0")
Raster bands: R0:1, R0:1, R1:0, .... (R0:1 is a reference to the first raster - with index 0 - from feeder, second band - with index 1).
Definition at line 66 of file ArithmeticOperations.h.
| 
 | protected | 
Type definition for a operation function pointer.
Definition at line 203 of file ArithmeticOperations.h.
| 
 | protected | 
Execution stack type definition.
Definition at line 198 of file ArithmeticOperations.h.
| te::rp::ArithmeticOperations::ArithmeticOperations | ( | ) | 
| te::rp::ArithmeticOperations::~ArithmeticOperations | ( | ) | 
| 
 | inlineprotected | 
Addition binary operator function.
Definition at line 213 of file ArithmeticOperations.h.
| 
 | protected | 
Allocate a new RAM memory raster.
| grid | The output raster grid. | 
| rasterPtr | The output raster pointer. | 
| 
 | inlineprotected | 
Division binary operator function.
Definition at line 231 of file ArithmeticOperations.h.
| 
 | protected | 
Execute the given binary operator using the current given execution stack.
| token | Operator token. | 
| execStack | Execution stack. | 
| generateOutput | if true the execution will generate valid output data, if false only dummy stack elements will be generated. | 
| 
 | protected | 
Execute the given binary operator using the given input rasters.
| inRaster1 | Input raster 1. | 
| band1 | Input raster 1 band. | 
| inRaster2 | Input raster 2. | 
| band2 | Input raster 2 band. | 
| binOptFunctPtr | The binary operation function pointer. | 
| outRasterPtr | The generated output raster. | 
| 
 | protected | 
Execute the given binary operator using the given input raster and a real number.
| inRaster | Input raster. | 
| bandIdx | Input raster band. | 
| binOptFunctPtr | The binary operation function pointer. | 
| outRasterPtr | The generated output raster. | 
| realNumberIsRigthtTerm | true if the real number is the right term. | 
| 
 | protected | 
Execute the given unary operator using the current given execution stack.
| token | Operator token. | 
| execStack | Execution stack. | 
| generateOutput | if true the execution will generate valid output data, if false only dummy stack elements will be generated. | 
| 
 | virtual | ||||||||||||||
Executes the algorithm using the supplied parameters.
| outputParams | Output parameters. | 
Implements te::rp::Algorithm.
| 
 | protected | 
Execute the automata parsing the given input string.
| aStr | The input arithmetic expression string. | 
| inRasters | Input rasters pointers. | 
| outRaster | Output raster pointer (pre-initiated). | 
| generateOutput | If true, the output raster data will be generated, if false only the automata execution will be performed.. | 
| progressPtr | A pointer to a progress interface to be pulsed on each operation or a null pointer. | 
| 
 | protected | 
Split the input string into a vector of token strings.
| inputStr | The input string. | 
| outTokens | The generated output tokens vector. | 
| 
 | protected | 
Convert the input tokens vector from the infix notation to postfix notation.
| input | The input tokens vector. | 
| output | The output tokens vector. | 
| 
 | virtual | ||||||||||||||
Initialize the algorithm instance making it ready for execution.
| inputParams | Input parameters. | 
Implements te::rp::Algorithm.
| 
 | protected | 
Returns true if the given token is a binary operator.
| inputToken | Input token. | 
| 
 | virtual | 
Returns true if the algorithm instance is initialized and ready for execution.
Implements te::rp::Algorithm.
| 
 | protected | 
Returns true if the given token is an operator.
| inputToken | Input token. | 
| 
 | protected | 
Returns true if the given token is a raster data token.
| token | Input token. | 
| rasterIdx | The output converted raster index value. | 
| bandIdx | The output converted band index value. | 
| 
 | protected | 
Returns true if the given token is a real number.
| token | Input token. | 
| realValue | The output converted value. | 
| 
 | protected | 
Returns true if the given token is a unary operator.
| inputToken | Input token. | 
| 
 | inlineprotected | 
Multiplication binary operator function.
Definition at line 225 of file ArithmeticOperations.h.
| 
 | protected | 
Returns true if operator1 has greater of equal precedence over operator2.
| operator1 | Operator1 input token. | 
| operator2 | Operator2 input token. | 
| 
 | protected | 
Print tokens to stout.
| input | The input tokens vector. | 
| 
 | virtual | |||||||||||||
Clear all internal allocated objects and reset the algorithm to its initial state.
Implements te::rp::Algorithm.
| 
 | inlineprotected | 
Subtraction binary operator function.
Definition at line 219 of file ArithmeticOperations.h.
| 
 | protected | 
Input execution parameters.
Definition at line 206 of file ArithmeticOperations.h.
| 
 | protected | 
Tells if this instance is initialized.
Definition at line 208 of file ArithmeticOperations.h.