OSSIM - Open Source Software Image Map  Version 1.9.0 (20180803)
ossimAffineTransform.h
Go to the documentation of this file.
1 //*******************************************************************
2 //
3 // License: See top level LICENSE.txt file.
4 //
5 // Author: Garrett Potts (gpotts@imagelinks.com)
6 //
7 //*************************************************************************
8 // $Id: ossimAffineTransform.h 15766 2009-10-20 12:37:09Z gpotts $
9 
10 #ifndef ossimAffineTransform_HEADER
11 #define ossimAffineTransform_HEADER
12 
14 #include <ossim/matrix/newmat.h>
15 
17 {
18 public:
21 
27  virtual const ossimAffineTransform& operator=(
28  const ossimAffineTransform& rhs);
29 
30  virtual ossimObject* dup()const
31  {
32  return new ossimAffineTransform(*this);
33  }
34  virtual void forward(const ossimDpt& input,
35  ossimDpt& output)const;
36  virtual void inverse(const ossimDpt& input,
37  ossimDpt& output)const;
38 
43  virtual ossimDpt getOrigin()const
44  {
45  return ossimDpt(0,0);
46  }
47 
48  bool saveState(ossimKeywordlist& kwl,
49  const char* prefix = 0)const;
50 
51  bool loadState(const ossimKeywordlist& kwl,
52  const char* prefix = 0);
53 
54  void setMatrix(double rotation,
55  const ossimDpt& scale,
56  const ossimDpt& translation);
57 
58  void setScale(const ossimDpt& scale)
59  {
60  theScale = scale;
61  computeMatrix();
62  }
63 
64  void setRotation(double rotation)
65  {
66  theRotation = rotation;
67  computeMatrix();
68  }
69 
70  void setTranslation(const ossimDpt& translation)
71  {
72  theTranslation = translation;
73  computeMatrix();
74  }
76  {
77  return theScale;
78  }
80  {
81  return theTranslation;
82  }
83  double getRotation()const
84  {
85  return theRotation;
86  }
87  void setIdentity();
88 
89  void setAffineEnabledFlag(bool flag)
90  {
91  theAffineEnabledFlag = flag;
92  }
93  virtual std::ostream& print(std::ostream& out) const;
94 
95 protected:
96  void computeMatrix();
97 
99  double theRotation;
102 
103  NEWMAT::Matrix theForwardXform;
104  NEWMAT::Matrix theInverseXform;
105 TYPE_DATA
106 };
107 
108 #endif
virtual ossimObject * dup() const
virtual bool loadState(const ossimKeywordlist &kwl, const char *prefix=0)
#define OSSIMDLLEXPORT
ossimDpt getTranslation() const
virtual void forward(const ossimDpt &input, ossimDpt &output) const =0
Represents serializable keyword/value map.
void setScale(const ossimDpt &scale)
virtual bool saveState(ossimKeywordlist &kwl, const char *prefix=0) const
virtual const ossim2dTo2dTransform & operator=(const ossim2dTo2dTransform &rhs)
void setRotation(double rotation)
NEWMAT::Matrix theInverseXform
virtual void inverse(const ossimDpt &input, ossimDpt &output) const
#define TYPE_DATA
Definition: ossimRtti.h:339
virtual ossimDpt getOrigin() const
void setTranslation(const ossimDpt &translation)
NEWMAT::Matrix theForwardXform
void setAffineEnabledFlag(bool flag)
ossimDpt getScale() const
virtual std::ostream & print(std::ostream &out) const
Generic print method.
std::basic_ostream< char > ostream
Base class for char output streams.
Definition: ossimIosFwd.h:23