Smooth.h
Go to the documentation of this file.
1 /*!
2 \file terralib/mnt/core/Smooth.h
3 
4 \brief This file contains a class to isolines smooth.
5 Adapted from SPRING
6 */
7 
8 #ifndef __TERRALIB_MNT_INTERNAL_SMOOTH_H
9 #define __TERRALIB_MNT_INTERNAL_SMOOTH_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  Smooth();
27  ~Smooth();
28 
29  void setInput(te::da::DataSourcePtr inDsrc,
30  std::string inDsetName,
31  std::auto_ptr<te::da::DataSetType> inDsetType);
32 
33  void setOutput(te::da::DataSourcePtr outDsrc, std::string dsname);
34 
35  void setParams(double factor, double max_dist, bool simpl);
36 
37  /*! Function used to set the Spatial Reference System ID */
38  void setSRID(int srid) { m_srid = srid; }
39 
40  bool run();
41 
42  private:
43  bool AdjustCatmullRom(te::gm::LineString &iso);
44 
45  bool middlePointWithSnap(te::gm::Coord2D &pfr, te::gm::Coord2D &pto, te::gm::Coord2D &pt0, te::gm::Coord2D &pt1, double d);
46 
47  protected:
48 
50  std::string m_inDsetName;
51  std::auto_ptr<te::da::DataSetType> m_inDsetType;
52 
54  std::string m_outDsetName;
55 
56  int m_srid; //!< Attribute with spatial reference information
57  double m_factor;
58  double m_maxdist;
60  };
61  }
62 }
63 #endif //__TERRALIB_MNT_INTERNAL_SMOOTH_H
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
std::string m_outDsetName
Definition: Smooth.h:54
bool m_simpl_out
Definition: Smooth.h:59
An utility struct for representing 2D coordinates.
Definition: Coord2D.h:40
te::da::DataSourcePtr m_outDsrc
Definition: Smooth.h:53
LineString is a curve with linear interpolation between points.
Definition: LineString.h:62
int m_srid
Attribute with spatial reference information.
Definition: Smooth.h:56
URI C++ Library.
double m_maxdist
Definition: Smooth.h:58
void setSRID(int srid)
Definition: Smooth.h:38
std::auto_ptr< te::da::DataSetType > m_inDsetType
Definition: Smooth.h:51
te::da::DataSourcePtr m_inDsrc
Definition: Smooth.h:49
double m_factor
Definition: Smooth.h:57
std::string m_inDsetName
Definition: Smooth.h:50
General enumerations.