Go to the documentation of this file.
26 #ifndef __TERRALIB_VP_INTERNAL_ABSCTRACTOPERATION_H
27 #define __TERRALIB_VP_INTERNAL_ABSCTRACTOPERATION_H
31 #include "../common/AbstractFactory.h"
32 #include "../geometry/Enums.h"
48 struct AbstractOperationImpl;
51 class OperationReport;
55 OP_NOT_STARTED, OP_SUCCESS, OP_CANCELLED,
OP_ERROR
82 virtual bool isValid(std::string& errorMessage);
162 AbstractOperationCapabilities(
const std::string& operationName, std::size_t numberOfInputs, std::size_t numberOfOutputs,
const std::string& dataHandlerName,
bool snapGeometries,
bool allowCoordinateSubdivision);
231 virtual std::vector<te::vp::FeatureSet>
execute(
const std::vector<te::vp::FeatureSet>& vecInput);
269 virtual std::unique_ptr<te::vp::AbstractOperationCapabilities>
getCapabilities()
const;
292 virtual std::vector<te::vp::FeatureSet>
executeImpl(
const std::vector<te::vp::FeatureSet>& vecInput) = 0;
323 #endif // __TERRALIB_VP_INTERNAL_ABSCTRACTOPERATION_H
void abort()
Returns TRUE if the operation has been aborted. FALSE otherwise.
bool getAllowCoordinateSubdivision() const
Creates the parameters for this operation. If the concrete operation has specific parameters,...
This class defines the interface of abstract factories without initializing parameters.
virtual void initialize()
std::size_t m_numberOfOutputs
The number of outputs of the operation.
AbstractOperationCapabilities(const std::string &operationName, std::size_t numberOfInputs, std::size_t numberOfOutputs, const std::string &dataHandlerName, bool snapGeometries, bool allowCoordinateSubdivision)
Destructor.
OperationFactory(const std::string &factoryKey)
Constructor.
AbstractParameters()
Default constructor.
bool m_aborted
Becames true if the abort function is called. Concrete classes must check for this value from time to...
void setMaxCoordinates(std::size_t maxCoordinates)
Returns the current state of the geometry subdivision.
const std::string & getDataHandlerName() const
Checks if the geometries must be snapped to each other before the operation is executed.
bool m_swapInput
This is very usefull for operations between 2 dataSets. If TRUE, the input will be swapped....
Abstract factory used to create Operations.
Abstract class used to define the input/ ouptut parameters for TerraAmazon Operations.
std::size_t getMaxCoordinates() const
Sets the input to be swapped. This is very usefull for operations between 2 dataSets....
bool m_snapGeometries
If TRUE, the geometries will be snapped before the operation is executed. Default is TRUE.
const std::vector< te::da::DataAccess * > & getOutputDataAccessVector() const
Sets the input dataAccess vector.
void addOutputDataAccess(te::da::DataAccess *dataAccess)
Adds an output data access to the params. Note that if the dataSet does not exist,...
void setOperationResult(OperationResult result)
virtual std::vector< te::vp::FeatureSet > executeImpl(const std::vector< te::vp::FeatureSet > &vecInput)=0
std::vector< te::da::DataAccess * > m_outputDataVector
Vector with output dataAccess.
std::size_t getNumberOfInputs() const
Returns the number of outputs of the operation.
virtual ~AbstractOperationCapabilities()
Returns the number of inputs of the operation.
void addInputDataAccess(te::da::DataAccess *dataAccess)
Adds an input data access to the params.
Class used as a report logger for Operations.
virtual bool initializeOutput()
Function that effectivelly executes the operation. It must be implemented by the concrete classes.
void setSwapInput(bool swap)
Returns TRUE if the input must be swaped. FALSE otherwise.
te::gm::GeomType getOutputGeometryType() const
Aborts the execution of the operation.
Class used to centralize and control access to data in terralib. It aims to create a high-level inter...
#define TEVPEXPORT
You can use this macro in order to export/import classes and functions from this module.
std::vector< te::da::DataAccess * > m_inputDataVector
Vector with input dataAccess.
std::size_t getNumberOfOutputs() const
Returns the name of the operation.
std::string m_dataHandlerName
TRUE if the operation supports the subdivision of the geometries. FALSE otherwise.
virtual te::da::DataSetType * createBasicOutputDataSetType(const std::string &dataSetName, int srid, te::gm::GeomType geometryType, const std::string &geometryColumnName) const
< Creates the basic dataSetType for the output containing all the columns that are required
void setInputDataAccessVector(const std::vector< te::da::DataAccess * > &vecDataAccess)
Sets the output dataAccess vector.
virtual std::vector< te::vp::FeatureSet > execute(const std::vector< te::vp::FeatureSet > &vecInput)
It executes the operation.
std::string m_operationName
The name of the operation.
virtual std::unique_ptr< te::vp::AbstractOperationCapabilities > getCapabilities() const
Makes all the necessaries adaptations to the input dataAccess to avoid duplicate column names.
const std::string & getName() const
Returns TRUE if the operation supports the subdivision of the geometries. FALSE otherwise.
virtual const te::da::DataSetType * getDataSetType(std::size_t outputIndex)
Gets the dataSetType of the 'outputIndex-th' output.
AbstractOperation(const std::string &operationName)
Default constructor.
void setParameters(AbstractParameters *params)
Gets the operation current parameters.
bool handleOutputPropertyNamesChanges(const te::da::DataSetType *baseOutputDataSetType, const te::da::DataSetType *actualOutputDataSetType)
virtual bool initializeInput()
Initializes the operation output.
OperationResult m_operationResult
Stores the result of the operation.
AbstractParameters * getParameters() const
Gets the operation report.
virtual void reportSpecificParams(OperationReport *report)
It reports each specific parameter used in the operation.
void setOutputDataAccessVector(const std::vector< te::da::DataAccess * > &vecDataAccess)
Enables or disables geometry subdivision.
const std::vector< te::da::DataAccess * > & getInputDataAccessVector() const
Returns the output dataAccess vector.
std::size_t m_maxCoordinates
If higher than 0, geometries will be subdivided until all the parts have less vertexes that this valu...
virtual ~OperationFactory()
virtual ~AbstractParameters()=default
Virtual destructor.
Abstract class used to define the capabilities of the operation, inclusing number of inputs and outpu...
AbstractOperationImpl * m_impl
Holds all the attributes of the class.
bool getSnapGeometries() const
Checks if the operation has the capability to handle geometry coordinate subdivision.
virtual ~AbstractOperation()
Virtual destructor.
bool getSwapInput() const
Gets the result of the operation.
OperationResult getOperationResult() const
Sets the result of the operation.
A feature is a composition of a geometry and its attributes.
Proxy configuration file for TerraView (see terraview_config.h).
std::size_t m_numberOfInputs
The number of inputs of the operation.
bool isAborted() const
Get the capabilities of the operation. Basically, operation will have 2 inputs, 1 output,...
virtual void addOutputColumns(te::da::DataSetType *outputDataSetType)
Initializes the operation input.
void reportParams(OperationReport *report)
It reports each parameter used in the operation.
A class that models the description of a dataset.
virtual te::vp::Feature * createOutputFeature(std::size_t outputIndex)
It creates the output feature based on the given output dataaccess index.
GeomType
Each enumerated type is compatible with a Well-known Binary (WKB) type code.
Abstract class used to define an operation.
const std::string & getName() const
Gets the output geometry type.
bool m_allowCoordinateSubdivision
TRUE if the operation has the capability to handle geometry coordinate subdivision.
OperationReport * getReport() const
Gets the operation name.
bool m_snapGeometries
TRUE if the geometries must be snapped to each other before the operation is executed....
virtual std::unique_ptr< AbstractParameters > createParameters() const
virtual bool isValid(std::string &errorMessage)
It checks the parameters for the operation.