Shadow.h
Go to the documentation of this file.
1 /*!
2 \file terralib/mnt/core/Shadow.h
3 
4 \brief This file contains a class to shadow image generation.
5 Adapted from SPRING
6 */
7 
8 #ifndef __TERRALIB_MNT_INTERNAL_SHADOW_H
9 #define __TERRALIB_MNT_INTERNAL_SHADOW_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  Shadow();
27  ~Shadow();
28 
29  void setInput(te::da::DataSourcePtr inDsrc,
30  std::string inDsetName,
31  const te::da::DataSetTypePtr& inDsetType);
32 
33  void setOutput(std::map<std::string, std::string> &dsinfo, std::string outRstDSType);
34 
35  void setParams(double azimuth, double elevation, double relief, double dummy,
36  double vmin, double vmax, double minval, double maxval,
37  unsigned int outputWidth, unsigned int outputHeight, double resxo, double resyo);
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  te::rst::Raster *getOutRst() { return m_out; }
45 
46  te::rst::Raster *GenerateImage(te::rst::Raster *raster);
47 
48  private:
49 
50  bool calcLocalGradient(te::rst::Raster* inputRaster, int line, int col, double vmin, double vmax, double& dx, double& dy, double *val);
51  void getRasterElementLine(te::rst::Raster* inputRaster, int line, std::vector< std::complex<double> > &val);
52 
53  protected:
54 
56  std::string m_inDsetName;
58  std::unique_ptr<te::da::DataSet> inDset;
59 
60  std::map<std::string, std::string> m_outDsinfo;
61  std::string m_outRstDSType;
63 
64  int m_srid; //!< Attribute with spatial reference information
65 
66  double m_azimuth;
67  double m_elevation;
68  double m_relief;
69  double m_vmin, m_vmax;
70  double m_minval;
71  double m_maxval;
72 
73  double m_dummy;
74  unsigned int m_outputWidth;
75  unsigned int m_outputHeight;
76 
77  double m_resxo, m_resyo;
78  };
79  }
80 }
81 #endif //__TERRALIB_MNT_INTERNAL_SMOOTH_H
te::rst::Raster * getOutRst()
Definition: Shadow.h:44
double m_relief
Definition: Shadow.h:68
boost::shared_ptr< DataSetType > DataSetTypePtr
Definition: DataSetType.h:653
std::map< std::string, std::string > m_outDsinfo
Definition: Shadow.h:60
te::da::DataSourcePtr m_inDsrc
Definition: Shadow.h:55
boost::shared_ptr< DataSource > DataSourcePtr
Definition: DataSource.h:1438
#define TEMNTEXPORT
You can use this macro in order to export/import classes and functions from this module.
Definition: Config.h:41
double m_azimuth
Definition: Shadow.h:66
double m_maxval
Definition: Shadow.h:71
double m_resyo
Definition: Shadow.h:77
void setSRID(int srid)
Definition: Shadow.h:40
std::string m_outRstDSType
Definition: Shadow.h:61
An abstract class for raster data strucutures.
Definition: Raster.h:71
int m_srid
Attribute with spatial reference information.
Definition: Shadow.h:64
double m_minval
Definition: Shadow.h:70
URI C++ Library.
double m_dummy
Definition: Shadow.h:73
double m_vmin
Definition: Shadow.h:69
std::unique_ptr< te::da::DataSet > inDset
Definition: Shadow.h:58
double m_elevation
Definition: Shadow.h:67
std::string m_inDsetName
Definition: Shadow.h:56
unsigned int m_outputWidth
Definition: Shadow.h:74
te::da::DataSetTypePtr m_inDsetType
Definition: Shadow.h:57
te::rst::Raster * m_out
Definition: Shadow.h:62
General enumerations.
unsigned int m_outputHeight
Definition: Shadow.h:75