Volume.h
Go to the documentation of this file.
1 /*!
2 \file terralib/mnt/core/Volume.h
3 
4 \brief This file contains a class to calculate volume.
5 Adapted from SPRING
6 */
7 
8 #ifndef __TERRALIB_MNT_INTERNAL_VOLUME_H
9 #define __TERRALIB_MNT_INTERNAL_VOLUME_H
10 
11 // Terralib Includes
12 #include "Config.h"
13 #include "Enums.h"
14 
15 #include "../../dataaccess/dataset/DataSet.h"
16 #include "../../dataaccess/dataset/DataSetType.h"
17 #include "../../dataaccess/datasource/DataSource.h"
18 
19 namespace te
20 {
21  namespace mnt
22  {
24  {
25  public:
26  Volume();
27  ~Volume();
28 
29  void setInput(te::da::DataSourcePtr inrstDsrc,
30  std::string inrstDsetName,
31  std::auto_ptr<te::da::DataSetType> inrstDsetType,
32  te::da::DataSourcePtr invecDsrc,
33  std::string invecDsetName,
34  std::auto_ptr<te::da::DataSetType> invecDsetType,
35  const te::da::ObjectIdSet* OidSet);
36 
37  void setParams(double quota, std::string &attr, double dummy);
38 
39  /*! Function used to set the Spatial Reference System ID */
40  void setSRID(int srid) { m_srid = srid; }
41 
42  bool run();
43 
44  void getResults(std::vector<std::string> &polyvec,
45  std::vector<std::string> &cortevec,
46  std::vector<std::string> &aterrovec,
47  std::vector<std::string> &areavec,
48  std::vector<std::string> &iquotavec);
49 
50  protected:
51 
52  // Find the polygon bounding box.
53  bool DefLC(te::gm::Polygon *pol, int& flin, int& llin, int& fcol, int& lcol);
54 
55  bool CVGrd(te::gm::Polygon *pol, int flin, int llin, int fcol, int lcol, std::string &polid);
56 
58  std::string m_inrstDsetName;
59  std::auto_ptr<te::da::DataSetType> m_inrstDsetType;
60 
62  std::string m_invecDsetName;
63  std::auto_ptr<te::da::DataSetType> m_invecDsetType;
64 
66 
67  std::auto_ptr<te::rst::Raster> m_raster;
68 
69  double m_quota;
70  std::string m_attr;
71  double m_dummy;
72 
73  int m_srid; //!< Attribute with spatial reference information
74 
75  std::vector<std::string> m_polyvec; //!< Attribute with structure to save results
76  std::vector<std::string> m_cortevec; //!< Attribute with structure to save results
77  std::vector<std::string> m_aterrovec; //!< Attribute with structure to save results
78  std::vector<std::string> m_areavec; //!< Attribute with structure to save results
79  std::vector<std::string> m_iquotavec; //!< Attribute with structure to save results
80 
81  };
82  }
83 }
84 #endif //__TERRALIB_MNT_INTERNAL_VOLUME_H
std::auto_ptr< te::rst::Raster > m_raster
Definition: Volume.h:67
boost::shared_ptr< DataSource > DataSourcePtr
Definition: DataSource.h:1438
double m_dummy
Definition: Volume.h:71
#define TEMNTEXPORT
You can use this macro in order to export/import classes and functions from this module.
Definition: Config.h:41
te::da::DataSourcePtr m_inrstDsrc
Definition: Volume.h:57
This class represents a set of unique ids created in the same context. i.e. from the same data set...
Definition: ObjectIdSet.h:55
te::da::DataSourcePtr m_invecDsrc
Definition: Volume.h:61
URI C++ Library.
int m_srid
Attribute with spatial reference information.
Definition: Volume.h:73
std::string m_attr
Definition: Volume.h:70
std::auto_ptr< te::da::DataSetType > m_invecDsetType
Definition: Volume.h:63
std::vector< std::string > m_polyvec
Attribute with structure to save results.
Definition: Volume.h:75
std::auto_ptr< te::da::DataSetType > m_inrstDsetType
Definition: Volume.h:59
void setSRID(int srid)
Definition: Volume.h:40
Polygon is a subclass of CurvePolygon whose rings are defined by linear rings.
Definition: Polygon.h:50
std::vector< std::string > m_aterrovec
Attribute with structure to save results.
Definition: Volume.h:77
std::vector< std::string > m_cortevec
Attribute with structure to save results.
Definition: Volume.h:76
const te::da::ObjectIdSet * m_OidSet
Definition: Volume.h:65
double m_quota
Definition: Volume.h:69
std::vector< std::string > m_areavec
Attribute with structure to save results.
Definition: Volume.h:78
std::vector< std::string > m_iquotavec
Attribute with structure to save results.
Definition: Volume.h:79
std::string m_invecDsetName
Definition: Volume.h:62
General enumerations.
std::string m_inrstDsetName
Definition: Volume.h:58