TINCalculateGrid.h
Go to the documentation of this file.
1 /*!
2 \file terralib/mnt/core/TINCalculateGrid.h
3 
4 \brief This file contains a class to calculate a grid from a TIN.
5 Adapted from SPRING
6 
7 */
8 
9 #ifndef __TERRALIB_MNT_INTERNAL_TINCALCULATEGRID_H
10 #define __TERRALIB_MNT_INTERNAL_TINCALCULATEGRID_H
11 
12 // Terralib Includes
13 #include "Config.h"
14 #include "Tin.h"
15 
16 #include "../../dataaccess/dataset/DataSet.h"
17 #include "../../dataaccess/dataset/DataSetType.h"
18 #include "../../dataaccess/datasource/DataSource.h"
19 
20 #include "../../raster/Raster.h"
21 
22 namespace te
23 {
24  namespace mnt
25  {
26 
27  /*!
28  \class TINCalculateGrid
29  \brief Class to calculate grid from TIN.
30 
31  \ingroup mnt
32 
33  */
34 
36  {
37  public:
40 
41  bool run();
42 
43  /*!
44  \brief It sets the Datasource that is being used to generate TIN.
45  \param inDsrc The datasource being used.
46  \param inDsetName datasource name
47  \param inDsetType input DataSetType
48  */
49  void setInput(te::da::DataSourcePtr inDsrc,
50  std::string inDsetName,
51  std::auto_ptr<te::da::DataSetType> inDsetType);
52 
53  /*!
54  \brief It sets the Datasource that is being used to save TIN.
55  */
56  void setOutput(std::map<std::string, std::string> &dsinfo);
57 
58  /*!
59  \brief It sets the parameters that is being used to save TIN.
60  \param resx, resy resolution X and Y.
61  \param gt interpolator
62  */
63  void setParams(double resx, double resy, Interpolator gt);
64 
65  protected:
66 
67  bool FillGridLinear(int32_t triid, te::gm::PointZ *p3da, int32_t flin, int32_t llin, int32_t fcol, int32_t lcol);
68 
69  /*!
70  \brief Method that fills the grid locations, inside a triangle, with a zvalue evaluated by a quintic polynomium
71  \param grid is a pointer to a grid object
72  \param triid is the triangle identification number
73  \param p3da is a pointer to a Point3d object, vector with 3D samples (not used in this method)
74  \param flin and llin are the first and the last lines (rows) of the grid
75  \param fcol and lcol are the first and the last columns of the grid
76  \param zvalue is the z value to be stored in the grid inside the triangle region
77  \return TRUE always
78  */
79  bool FillGridQuintic(int32_t triid, int32_t flin, int32_t llin, int32_t fcol, int32_t lcol, double *coef);
80 
82  std::string m_inDsetName;
83  std::auto_ptr<te::da::DataSetType> m_inDsetType;
84 
85  std::map<std::string, std::string> m_dsinfo;
86 
88  };
89  }
90 }
91 
92 #endif
boost::shared_ptr< DataSource > DataSourcePtr
Definition: DataSource.h:1435
#define TEMNTEXPORT
You can use this macro in order to export/import classes and functions from this module.
Definition: Config.h:41
Interpolator
Definition: Enums.h:54
A point with z-coordinate value.
Definition: PointZ.h:51
Class to calculate grid from TIN.
URI C++ Library.
std::map< std::string, std::string > m_dsinfo
std::auto_ptr< te::da::DataSetType > m_inDsetType
Class to define TIN strutures.
Definition: Tin.h:270
te::da::DataSourcePtr m_inDsrc
This file contains a class to define a TIN. Adapted from SPRING.