RSTGT.h
Go to the documentation of this file.
1 /* Copyright (C) 2008 National Institute For Space Research (INPE) - Brazil.
2 
3  This file is part of the TerraLib - a Framework for building GIS enabled applications.
4 
5  TerraLib is free software: you can redistribute it and/or modify
6  it under the terms of the GNU Lesser General Public License as published by
7  the Free Software Foundation, either version 3 of the License,
8  or (at your option) any later version.
9 
10  TerraLib is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  GNU Lesser General Public License for more details.
14 
15  You should have received a copy of the GNU Lesser General Public License
16  along with TerraLib. See COPYING. If not, write to
17  TerraLib Team at <terralib-team@terralib.org>.
18  */
19 
20 /*!
21  \file terralib/geometry/RSTGT.h
22 
23  \brief 2D Rotation/scale/translation (rigid body) Geometric transformation.
24 */
25 
26 #ifndef __TERRALIB_GEOMETRY_INTERNAL_RSTGT_H
27 #define __TERRALIB_GEOMETRY_INTERNAL_RSTGT_H
28 
29 // TerraLib
30 #include "Config.h"
32 
33 // Boost
34 #include <boost/concept_check.hpp>
35 #include <boost/numeric/ublas/matrix.hpp>
36 
37 namespace te
38 {
39  namespace gm
40  {
41  /*!
42  \class RSTGT
43 
44  \brief 2D Rotation/scale/translation(rigid body) Geometric transformation.
45 
46  \note The transformation parameters (inside GTParameters::m_directParameters) are disposed on the following form:
47 
48  \code
49  u = a.x - b.y + c
50  v = b.x + a.y + d
51 
52  - | u | = | a -b c | * | x |
53  - | v | | b a d | | y |
54  - | 1 | | 0 0 1 | | 1 |
55 
56  |u0| = |x0 -y0 1 0|.|a|
57  |v0| |y0 x0 0 1| |b|
58  |u1| |x1 -y12 1 0| |c|
59  |v1| |y1 y1 0 1| |d|
60  |..| |.............|
61  |..| |.............|
62 
63  GTParameters::m_directParameters = [ a b c d ]
64  \endcode
65  */
67  {
68  public:
69 
70  /*! \brief Default constructor. */
71  RSTGT();
72 
73  /*! \brief Destructor. */
74  ~RSTGT();
75 
76  const std::string& getName() const;
77 
78  bool isValid( const GTParameters& params ) const;
79 
80  void directMap( const GTParameters& params, const double& pt1X,
81  const double& pt1Y, double& pt2X, double& pt2Y ) const;
82 
83  void inverseMap( const GTParameters& params, const double& pt2X,
84  const double& pt2Y, double& pt1X, double& pt1Y ) const;
85 
86  unsigned int getMinRequiredTiePoints() const;
87 
88  GeometricTransformation* clone() const;
89 
90  protected:
91 
92  // Variables used by method computeParameters
93  mutable unsigned int m_computeParameters_index1;
94  mutable unsigned int m_computeParameters_index2;
95  mutable unsigned int m_computeParameters_tpIdx;
96  mutable unsigned int m_computeParameters_tiepointsSize;
97  mutable boost::numeric::ublas::matrix< double > m_computeParameters_A;
98  mutable boost::numeric::ublas::matrix< double > m_computeParameters_L;
99  mutable boost::numeric::ublas::matrix< double > m_computeParameters_At;
100  mutable boost::numeric::ublas::matrix< double > m_computeParameters_N;
101  mutable boost::numeric::ublas::matrix< double > m_computeParameters_U;
102  mutable boost::numeric::ublas::matrix< double > m_computeParameters_N_inv;
103  mutable boost::numeric::ublas::matrix< double > m_computeParameters_X;
104  mutable boost::numeric::ublas::matrix< double > m_computeParameters_XExpanded;
105  mutable boost::numeric::ublas::matrix< double > m_computeParameters_XExpandedInv;
106 
107  bool computeParameters( GTParameters& params ) const;
108  };
109 
110  } // end namespace gm
111 } // end namespace te
112 
113 #endif // __TERRALIB_GEOMETRY_INTERNAL_RSTGT_H
114 
unsigned int m_computeParameters_tpIdx
Definition: RSTGT.h:95
boost::numeric::ublas::matrix< double > m_computeParameters_N
Definition: RSTGT.h:100
2D Geometric transformation base class.
unsigned int m_computeParameters_tiepointsSize
Definition: RSTGT.h:96
boost::numeric::ublas::matrix< double > m_computeParameters_L
Definition: RSTGT.h:98
boost::numeric::ublas::matrix< double > m_computeParameters_U
Definition: RSTGT.h:101
2D Geometric transformation base class.
#define TEGEOMEXPORT
You can use this macro in order to export/import classes and functions from this module.
Definition: Config.h:76
2D Rotation/scale/translation(rigid body) Geometric transformation.
Definition: RSTGT.h:66
boost::numeric::ublas::matrix< double > m_computeParameters_A
Definition: RSTGT.h:97
URI C++ Library.
boost::numeric::ublas::matrix< double > m_computeParameters_XExpanded
Definition: RSTGT.h:104
boost::numeric::ublas::matrix< double > m_computeParameters_X
Definition: RSTGT.h:103
boost::numeric::ublas::matrix< double > m_computeParameters_N_inv
Definition: RSTGT.h:102
unsigned int m_computeParameters_index2
Definition: RSTGT.h:94
boost::numeric::ublas::matrix< double > m_computeParameters_XExpandedInv
Definition: RSTGT.h:105
2D Geometric transformation parameters.
Definition: GTParameters.h:50
Configuration flags for the Vector Geometry Model of TerraLib.
unsigned int m_computeParameters_index1
Definition: RSTGT.h:93
boost::numeric::ublas::matrix< double > m_computeParameters_At
Definition: RSTGT.h:99