OSSIM - Open Source Software Image Map  Version 1.9.0 (20180803)
Public Member Functions | Protected Attributes | Friends | List of all members
ossimAffineProjection Class Reference

#include <ossimAffineProjection.h>

Inheritance diagram for ossimAffineProjection:
ossimProjection ossimObject ossimErrorStatusInterface ossimReferenced

Public Member Functions

 ossimAffineProjection ()
 
 ossimAffineProjection (ossimProjection *client)
 
 ossimAffineProjection (const ossimKeywordlist &geom_kwl, const char *prefix=NULL)
 
 ~ossimAffineProjection ()
 
virtual void worldToLineSample (const ossimGpt &worldPoint, ossimDpt &lineSampPt) const
 
virtual void lineSampleToWorld (const ossimDpt &lineSampPt, ossimGpt &worldPt) const
 
virtual void lineSampleHeightToWorld (const ossimDpt &lineSampPt, const double &hgtEllipsoid, ossimGpt &worldPt) const
 
virtual std::ostream & print (std::ostream &out) const
 
virtual bool saveState (ossimKeywordlist &kwl, const char *prefix=0) const
 
virtual bool loadState (const ossimKeywordlist &kwl, const char *prefix=0)
 
virtual ossimObjectdup () const
 
virtual ossimGpt origin () const
 
virtual bool operator== (const ossimProjection &) const
 
virtual ossimDpt getMetersPerPixel () const
 
virtual bool isAffectedByElevation () const
 Implementation of pure virtual ossimProjection::isAffectedByElevation method. More...
 
- Public Member Functions inherited from ossimProjection
 ossimProjection ()
 
virtual ~ossimProjection ()
 
virtual ossimDpt forward (const ossimGpt &wp) const
 
virtual ossimGpt inverse (const ossimDpt &pp) const
 
virtual void getRoundTripError (const ossimDpt &imagePoint, ossimDpt &errorResult) const
 
virtual void getRoundTripError (const ossimGpt &groundPoint, ossimDpt &errorResult) const
 
virtual void getGroundClipPoints (ossimGeoPolygon &gpts) const
 
virtual bool isEqualTo (const ossimObject &obj, ossimCompareType compareType=OSSIM_COMPARE_FULL) const
 
virtual bool operator!= (const ossimProjection &projection) const
 
- Public Member Functions inherited from ossimObject
 ossimObject ()
 
virtual ~ossimObject ()
 
virtual ossimString getShortName () const
 
virtual ossimString getLongName () const
 
virtual ossimString getDescription () const
 
virtual ossimString getClassName () const
 
virtual RTTItypeid getType () const
 
virtual bool canCastTo (ossimObject *obj) const
 
virtual bool canCastTo (const RTTItypeid &id) const
 
virtual bool canCastTo (const ossimString &parentClassName) const
 
virtual void accept (ossimVisitor &visitor)
 
- Public Member Functions inherited from ossimReferenced
 ossimReferenced ()
 
 ossimReferenced (const ossimReferenced &)
 
ossimReferencedoperator= (const ossimReferenced &)
 
void ref () const
 increment the reference count by one, indicating that this object has another pointer which is referencing it. More...
 
void unref () const
 decrement the reference count by one, indicating that a pointer to this object is referencing it. More...
 
void unref_nodelete () const
 decrement the reference count by one, indicating that a pointer to this object is referencing it. More...
 
int referenceCount () const
 
- Public Member Functions inherited from ossimErrorStatusInterface
 ossimErrorStatusInterface ()
 
virtual ~ossimErrorStatusInterface ()
 
virtual ossimErrorCode getErrorStatus () const
 
virtual ossimString getErrorStatusString () const
 
virtual void setErrorStatus (ossimErrorCode error_status) const
 
virtual void setErrorStatus () const
 
virtual void clearErrorStatus () const
 
bool hasError () const
 

Protected Attributes

ossimRefPtr< ossimProjectiontheClientProjection
 
ossimRefPtr< ossim2dTo2dTransformtheAffineTransform
 
- Protected Attributes inherited from ossimErrorStatusInterface
ossimErrorCode theErrorStatus
 

Friends

std::ostream & operator<< (std::ostream &os, const ossimAffineProjection &m)
 

Additional Inherited Members

- Protected Member Functions inherited from ossimReferenced
virtual ~ossimReferenced ()
 

Detailed Description


CLASS: ossimAffineProjection

Definition at line 27 of file ossimAffineProjection.h.

Constructor & Destructor Documentation

◆ ossimAffineProjection() [1/3]

ossimAffineProjection::ossimAffineProjection ( )

Default Contructor:

Definition at line 32 of file ossimAffineProjection.cpp.

Referenced by dup().

33  :
35  theClientProjection (NULL),
36  theAffineTransform (NULL)
37 {
38 }
ossimRefPtr< ossim2dTo2dTransform > theAffineTransform
ossimRefPtr< ossimProjection > theClientProjection

◆ ossimAffineProjection() [2/3]

ossimAffineProjection::ossimAffineProjection ( ossimProjection client)

Primary constructor accepting pointer to the underlying client projection.

Definition at line 46 of file ossimAffineProjection.cpp.

47  :
49  theClientProjection (client),
50  theAffineTransform (NULL)
51 {
52 }
ossimRefPtr< ossim2dTo2dTransform > theAffineTransform
ossimRefPtr< ossimProjection > theClientProjection

◆ ossimAffineProjection() [3/3]

ossimAffineProjection::ossimAffineProjection ( const ossimKeywordlist geom_kwl,
const char *  prefix = NULL 
)

Constructor accepts OSSIM keywordlist geometry file.

Definition at line 57 of file ossimAffineProjection.cpp.

References ossimErrorStatusInterface::getErrorStatus(), ossimProjectionFactoryRegistry::instance(), ossim2dTo2dTransform::loadState(), ossimErrorCodes::OSSIM_ERROR, ossimErrorStatusInterface::setErrorStatus(), theAffineTransform, and theClientProjection.

59  :
61  theClientProjection (NULL),
62  theAffineTransform (NULL)
63 {
65  createProjection(geom_kwl, prefix);
66 
68  bool rtn_stat = theAffineTransform->loadState(geom_kwl, prefix);
69 
70  if (!theClientProjection ||
71  theClientProjection->getErrorStatus() || !rtn_stat)
73 }
virtual bool loadState(const ossimKeywordlist &kwl, const char *prefix=0)
ossimRefPtr< ossim2dTo2dTransform > theAffineTransform
static const ossimErrorCode OSSIM_ERROR
static ossimProjectionFactoryRegistry * instance()
virtual ossimErrorCode getErrorStatus() const
ossimRefPtr< ossimProjection > theClientProjection

◆ ~ossimAffineProjection()

ossimAffineProjection::~ossimAffineProjection ( )

Definition at line 78 of file ossimAffineProjection.cpp.

79 {
80 }

Member Function Documentation

◆ dup()

ossimObject * ossimAffineProjection::dup ( ) const
virtual

Returns pointer to a new instance, copy of this.

Implements ossimProjection.

Definition at line 242 of file ossimAffineProjection.cpp.

References ossimAffineProjection(), and saveState().

243 {
244  ossimKeywordlist kwl;
245  saveState(kwl);
246  ossimProjection* duped = new ossimAffineProjection(kwl);
247  return duped;
248 }
Represents serializable keyword/value map.
virtual bool saveState(ossimKeywordlist &kwl, const char *prefix=0) const

◆ getMetersPerPixel()

ossimDpt ossimAffineProjection::getMetersPerPixel ( ) const
virtual

ACCESS METHODS:

Implements ossimProjection.

Definition at line 263 of file ossimAffineProjection.cpp.

References ossimProjection::getMetersPerPixel(), ossim::nan(), theClientProjection, and ossimRefPtr< T >::valid().

264 {
267  return ossimDpt(ossim::nan(), ossim::nan());
268 }
bool valid() const
Definition: ossimRefPtr.h:75
double nan()
Method to return ieee floating point double precision NAN.
Definition: ossimCommon.h:135
virtual ossimDpt getMetersPerPixel() const =0
ossimRefPtr< ossimProjection > theClientProjection

◆ isAffectedByElevation()

virtual bool ossimAffineProjection::isAffectedByElevation ( ) const
inlinevirtual

Implementation of pure virtual ossimProjection::isAffectedByElevation method.

Returns
false.

Implements ossimProjection.

Definition at line 108 of file ossimAffineProjection.h.

108 { return false; }

◆ lineSampleHeightToWorld()

void ossimAffineProjection::lineSampleHeightToWorld ( const ossimDpt lineSampPt,
const double &  hgtEllipsoid,
ossimGpt worldPt 
) const
virtual

Performs the inverse projection from line, sample to ground, bypassing reference to elevation surface:

Implements ossimProjection.

Definition at line 129 of file ossimAffineProjection.cpp.

132 {
133  if (traceExec()) ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimAffineProjection::lineSampleHeightToWorld: Entering..." << std::endl;
134 
136  {
137  ossimDpt adjustedPt;
138  theAffineTransform->forward(lineSampPt, adjustedPt);
139  theClientProjection->lineSampleHeightToWorld(adjustedPt, hgt, worldPt);
140  }
141  else
142  {
143  worldPt.makeNan();
144  }
145 
146  if (traceExec()) ossimNotify(ossimNotifyLevel_DEBUG) << "dEBUG ossimAffineProjection::lineSampleHeightToWorld: Returning..." << std::endl;
147 }
ossimRefPtr< ossim2dTo2dTransform > theAffineTransform
virtual void forward(const ossimDpt &input, ossimDpt &output) const =0
bool valid() const
Definition: ossimRefPtr.h:75
void makeNan()
Definition: ossimGpt.h:130
virtual void lineSampleHeightToWorld(const ossimDpt &lineSampPt, const double &heightAboveEllipsoid, ossimGpt &worldPt) const =0
ossimRefPtr< ossimProjection > theClientProjection
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)

◆ lineSampleToWorld()

void ossimAffineProjection::lineSampleToWorld ( const ossimDpt lineSampPt,
ossimGpt worldPt 
) const
virtual

METHOD: lineSampleToWorld() Performs the inverse projection from line, sample to ground (world):

Implements ossimProjection.

Definition at line 106 of file ossimAffineProjection.cpp.

108 {
109  if (traceExec()) ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimAffineProjection::lineSampleToWorld: Entering..." << std::endl;
110 
112  {
113  ossimDpt adjustedPt;
114  theAffineTransform->forward(lineSampPt, adjustedPt);
115  theClientProjection->lineSampleToWorld(adjustedPt, worldPt);
116  }
117  else
118  {
119  worldPt.makeNan();
120  }
121 
122  if (traceExec()) ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimAffineProjection::lineSampleToWorld: Returning..." << std::endl;
123 }
ossimRefPtr< ossim2dTo2dTransform > theAffineTransform
virtual void forward(const ossimDpt &input, ossimDpt &output) const =0
bool valid() const
Definition: ossimRefPtr.h:75
void makeNan()
Definition: ossimGpt.h:130
virtual void lineSampleToWorld(const ossimDpt &lineSampPt, ossimGpt &worldPt) const =0
ossimRefPtr< ossimProjection > theClientProjection
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)

◆ loadState()

bool ossimAffineProjection::loadState ( const ossimKeywordlist kwl,
const char *  prefix = 0 
)
virtual

Method to the load (recreate) the state of the object from a keyword list. Return true if ok or false on error.

Reimplemented from ossimProjection.

Definition at line 197 of file ossimAffineProjection.cpp.

199 {
200  if (traceExec()) ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimAffineProjection::loadState: entering..." << std::endl;
201 
202  bool good_load;
203  int err_stat;
204 
205  if (!theClientProjection)
206  {
208  createProjection(kwl, prefix);
209  err_stat = theClientProjection->getErrorStatus();
210  if (err_stat != ossimErrorCodes::OSSIM_OK)
211  {
212  return false;
213  }
214  }
215  else
216  {
217  good_load = theClientProjection->loadState(kwl, prefix);
218  if (!good_load)
219  {
220  return false;
221  }
222  }
223 
224  if (!theAffineTransform)
225  {
227  }
228  good_load = theAffineTransform->loadState(kwl, prefix);
229  if (!good_load)
230  {
231  return false;
232  }
233  if (traceExec()) ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimAffineProjection::loadState: returning..." << std::endl;
234 
235  return true;
236 
237 }
virtual bool loadState(const ossimKeywordlist &kwl, const char *prefix=0)
ossimRefPtr< ossim2dTo2dTransform > theAffineTransform
static const ossimErrorCode OSSIM_OK
virtual bool loadState(const ossimKeywordlist &kwl, const char *prefix=0)
static ossimProjectionFactoryRegistry * instance()
virtual ossimErrorCode getErrorStatus() const
ossimRefPtr< ossimProjection > theClientProjection
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)

◆ operator==()

virtual bool ossimAffineProjection::operator== ( const ossimProjection ) const
inlinevirtual

Compares this instance with arg projection. NOT IMPLEMENTED.

Implements ossimProjection.

Definition at line 98 of file ossimAffineProjection.h.

99  { return false; }

◆ origin()

ossimGpt ossimAffineProjection::origin ( ) const
virtual

Returns projection's ground point origin. That is the GP corresponding to line=0, sample=0.

Implements ossimProjection.

Definition at line 253 of file ossimAffineProjection.cpp.

References ossimProjection::origin(), theClientProjection, and ossimRefPtr< T >::valid().

254 {
256  return theClientProjection->origin();
257  return ossimGpt(0.0, 0.0, 0.0);
258 }
bool valid() const
Definition: ossimRefPtr.h:75
virtual ossimGpt origin() const =0
ossimRefPtr< ossimProjection > theClientProjection

◆ print()

std::ostream & ossimAffineProjection::print ( std::ostream &  out) const
virtual

Extends base-class implementation. Dumps contents of object to ostream.

Reimplemented from ossimProjection.

Definition at line 152 of file ossimAffineProjection.cpp.

References ossimProjection::print(), theAffineTransform, theClientProjection, and ossimRefPtr< T >::valid().

Referenced by operator<<().

153 {
154 
156  {
157  out <<
158  "ossimAffineProjection:\n"
159  " Member theClientProjection: ";
161  out << "\n Member theAffineTransform: "
162  << *theAffineTransform << std::endl;
163  }
164  else
165  {
166  out << "ossimAffineProjection -- Not initialized." << std::endl;
167  }
168  return out;
169 }
ossimRefPtr< ossim2dTo2dTransform > theAffineTransform
bool valid() const
Definition: ossimRefPtr.h:75
virtual std::ostream & print(std::ostream &out) const
Outputs theErrorStatus as an ossimErrorCode and an ossimString.
ossimRefPtr< ossimProjection > theClientProjection

◆ saveState()

bool ossimAffineProjection::saveState ( ossimKeywordlist kwl,
const char *  prefix = 0 
) const
virtual

Fulfills ossimObject base-class pure virtuals. Loads and saves geometry KWL files. Returns true if successful.

Reimplemented from ossimProjection.

Definition at line 179 of file ossimAffineProjection.cpp.

Referenced by dup().

181 {
182  if (traceExec()) ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimAffineProjection::saveState: entering..." << std::endl;
183 
185  {
186  theClientProjection->saveState(kwl, prefix);
187  theAffineTransform->saveState(kwl, prefix);
188  }
189 
190  if (traceExec()) ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimAffineProjection::saveState: returning..." << std::endl;
191  return true;
192 }
ossimRefPtr< ossim2dTo2dTransform > theAffineTransform
bool valid() const
Definition: ossimRefPtr.h:75
virtual bool saveState(ossimKeywordlist &kwl, const char *prefix=0) const
virtual bool saveState(ossimKeywordlist &kwl, const char *prefix=0) const
ossimRefPtr< ossimProjection > theClientProjection
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)

◆ worldToLineSample()

void ossimAffineProjection::worldToLineSample ( const ossimGpt worldPoint,
ossimDpt lineSampPt 
) const
virtual

METHOD: worldToLineSample() Performs the forward projection from ground point to line, sample.

Implements ossimProjection.

Definition at line 86 of file ossimAffineProjection.cpp.

88 {
89  if (traceExec()) ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimAffineProjection::worldToLineSample: Entering..." << std::endl;
90 
92  {
93  theClientProjection->worldToLineSample(worldPoint, lineSampPt);
94  theAffineTransform->inverse(lineSampPt);
95  }
96  else
97  lineSampPt.makeNan();
98 
99  if (traceExec()) ossimNotify(ossimNotifyLevel_DEBUG) << "DEBUG ossimAffineProjection::worldToLineSample: Returning..." << std::endl;
100 }
ossimRefPtr< ossim2dTo2dTransform > theAffineTransform
bool valid() const
Definition: ossimRefPtr.h:75
virtual void inverse(const ossimDpt &input, ossimDpt &output) const
virtual void worldToLineSample(const ossimGpt &worldPoint, ossimDpt &lineSampPt) const =0
ossimRefPtr< ossimProjection > theClientProjection
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)
void makeNan()
Definition: ossimDpt.h:65

Friends And Related Function Documentation

◆ operator<<

std::ostream& operator<< ( std::ostream &  os,
const ossimAffineProjection m 
)
friend

Definition at line 171 of file ossimAffineProjection.cpp.

172 {
173  return m.print(os);
174 }
virtual std::ostream & print(std::ostream &out) const

Member Data Documentation

◆ theAffineTransform

ossimRefPtr<ossim2dTo2dTransform> ossimAffineProjection::theAffineTransform
protected

Definition at line 116 of file ossimAffineProjection.h.

Referenced by ossimAffineProjection(), and print().

◆ theClientProjection

ossimRefPtr<ossimProjection> ossimAffineProjection::theClientProjection
protected

Data Members:

Definition at line 115 of file ossimAffineProjection.h.

Referenced by getMetersPerPixel(), origin(), ossimAffineProjection(), and print().


The documentation for this class was generated from the following files: