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

#include <ossimQuadProjection.h>

Inheritance diagram for ossimQuadProjection:
ossimProjection ossimObject ossimErrorStatusInterface ossimReferenced

Public Member Functions

 ossimQuadProjection ()
 
 ossimQuadProjection (const ossimQuadProjection &rhs)
 
 ossimQuadProjection (const ossimIrect &rect, const ossimGpt &ulg, const ossimGpt &urg, const ossimGpt &lrg, const ossimGpt &llg)
 
virtual ossimObjectdup () const
 
virtual ossimGpt origin () const
 
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 &heightAboveEllipsoid, ossimGpt &worldPt) const
 
virtual bool saveState (ossimKeywordlist &kwl, const char *prefix=0) const
 
virtual bool loadState (const ossimKeywordlist &kwl, const char *prefix=0)
 
virtual bool operator== (const ossimProjection &projection) 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 std::ostream & print (std::ostream &out) const
 Outputs theErrorStatus as an ossimErrorCode and an ossimString. More...
 
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 Member Functions

virtual ~ossimQuadProjection ()
 
void initializeGrids ()
 
ossimGpt extrapolate (const ossimDpt &imagePoint, const double &height) const
 
- Protected Member Functions inherited from ossimReferenced
virtual ~ossimReferenced ()
 

Protected Attributes

ossimIrect theInputRect
 
ossimGpt theUlg
 
ossimGpt theUrg
 
ossimGpt theLrg
 
ossimGpt theLlg
 
ossimDblGrid theLatGrid
 
ossimDblGrid theLonGrid
 
- Protected Attributes inherited from ossimErrorStatusInterface
ossimErrorCode theErrorStatus
 

Detailed Description

Definition at line 16 of file ossimQuadProjection.h.

Constructor & Destructor Documentation

◆ ossimQuadProjection() [1/3]

ossimQuadProjection::ossimQuadProjection ( )

◆ ossimQuadProjection() [2/3]

ossimQuadProjection::ossimQuadProjection ( const ossimQuadProjection rhs)

Definition at line 33 of file ossimQuadProjection.cpp.

◆ ossimQuadProjection() [3/3]

ossimQuadProjection::ossimQuadProjection ( const ossimIrect rect,
const ossimGpt ulg,
const ossimGpt urg,
const ossimGpt lrg,
const ossimGpt llg 
)

Definition at line 45 of file ossimQuadProjection.cpp.

References initializeGrids().

50  :theInputRect(rect),
51  theUlg(ulg),
52  theUrg(urg),
53  theLrg(lrg),
54  theLlg(llg)
55 {
57 }

◆ ~ossimQuadProjection()

ossimQuadProjection::~ossimQuadProjection ( )
protectedvirtual

Definition at line 59 of file ossimQuadProjection.cpp.

60 {
61 }

Member Function Documentation

◆ dup()

ossimObject * ossimQuadProjection::dup ( ) const
virtual

Implements ossimProjection.

Definition at line 63 of file ossimQuadProjection.cpp.

References ossimQuadProjection().

64 {
65  return new ossimQuadProjection(*this);
66 }

◆ extrapolate()

ossimGpt ossimQuadProjection::extrapolate ( const ossimDpt imagePoint,
const double &  height 
) const
protected

Definition at line 455 of file ossimQuadProjection.cpp.

References ossimDpt::hasNans(), ossimGpt::hgt, ossim::isnan(), ossimGpt::lat, ossimDpt::length(), lineSampleHeightToWorld(), lineSampleToWorld(), ossimGpt::lon, ossimIrect::midPoint(), ossim::nan(), and theInputRect.

Referenced by lineSampleHeightToWorld().

457 {
458  //---
459  // If image point supplied has NaN components, return now with a NaN point.
460  // This prevents an infinite recursion between model worldToLineSample
461  // and this method:
462  //---
463  if (imagePoint.hasNans())
464  {
465  return ossimGpt(ossim::nan(), ossim::nan(), ossim::nan());
466  }
467 
468  //***
469  // Determine which edge is intersected by the radial, and establish
470  // intersection:
471  //***
472  ossimGpt gpt;
473  ossimDpt edgePt (imagePoint);
474  ossimDpt image_center (theInputRect.midPoint());
475  ossimDrect clipRect = theInputRect;
476  clipRect.clip(image_center, edgePt);
477 
478  //***
479  // Need edgePt relative to image center. Compute an epsilon perturbation in
480  // the direction of edgePt for later computing directional derivative,
481  // and back out the offset to origin:
482  //***
483  ossimDpt deltaPt (edgePt - image_center);
484  ossimDpt epsilon (deltaPt/deltaPt.length());
485  edgePt -= epsilon; // insure that we are inside the image
486  ossimDpt edgePt_prime (edgePt - epsilon); // epsilon=1pixel
487 
488  //***
489  // Establish ground point corresponding to edge point and edgePt+epsilon:
490  //***
491  ossimGpt edgeGP;
492  ossimGpt edgeGP_prime;
493 
494  if (ossim::isnan(height))
495  {
496  lineSampleToWorld(edgePt, edgeGP);
497  lineSampleToWorld(edgePt_prime, edgeGP_prime);
498  }
499  else
500  {
501  lineSampleHeightToWorld(edgePt, height, edgeGP);
502  lineSampleHeightToWorld(edgePt_prime, height, edgeGP_prime);
503  }
504 
505  //***
506  // Compute approximate directional derivatives of lat and lon along radial
507  // at the edge:
508  //***
509  double dpixel = (edgePt-edgePt_prime).length();
510  double dlat_drad = (edgeGP.lat - edgeGP_prime.lat)/dpixel;
511  double dlon_drad = (edgeGP.lon - edgeGP_prime.lon)/dpixel;
512 
513  //***
514  // Now extrapolate to image point of interest:
515  //***
516  double delta_pixel = (imagePoint - edgePt).length();
517 
518  gpt.lat = edgeGP.lat + dlat_drad*delta_pixel;
519  gpt.lon = edgeGP.lon + dlon_drad*delta_pixel;
520 // if (height == OSSIM_DBL_NAN)
521 // {
522 // gpt.hgt = theElevation->getHeightAboveMSL(gpt);
523 // }
524 // else
525  gpt.hgt = height;
526 
527  return gpt;
528 
529 }
double nan()
Method to return ieee floating point double precision NAN.
Definition: ossimCommon.h:135
ossim_float64 hgt
Height in meters above the ellipsiod.
Definition: ossimGpt.h:274
ossim_float64 lon
Definition: ossimGpt.h:266
ossimIpt midPoint() const
Definition: ossimIrect.h:750
bool hasNans() const
Definition: ossimDpt.h:67
virtual void lineSampleHeightToWorld(const ossimDpt &lineSampPt, const double &heightAboveEllipsoid, ossimGpt &worldPt) const
virtual void lineSampleToWorld(const ossimDpt &lineSampPt, ossimGpt &worldPt) const
ossim_float64 lat
Definition: ossimGpt.h:265
bool isnan(const float &v)
isnan Test for floating point Not A Number (NAN) value.
Definition: ossimCommon.h:91

◆ getMetersPerPixel()

ossimDpt ossimQuadProjection::getMetersPerPixel ( ) const
virtual

ACCESS METHODS:

Implements ossimProjection.

Definition at line 405 of file ossimQuadProjection.cpp.

References lineSampleToWorld(), ossimEcefVector::magnitude(), ossimIrect::midPoint(), theInputRect, and ossimDpt::x.

406 {
407  ossimGpt centerG;
408  ossimGpt rightG;
409  ossimGpt topG;
410 
414 
415  ossimEcefPoint centerP = centerG;
416  ossimEcefPoint rightP = rightG;
417  ossimEcefPoint topP = topG;
418 
419  ossimEcefVector horizontal = rightP-centerP;
420  ossimEcefVector vertical = topP-centerP;
421 
422  ossimDpt result(horizontal.magnitude(),
423  vertical.magnitude());
424 
425  result.x = (result.x + result.y)/2.0;
426  result.y = result.x;
427 
428 
429  return result;
430 }
double magnitude() const
ossimIpt midPoint() const
Definition: ossimIrect.h:750
virtual void lineSampleToWorld(const ossimDpt &lineSampPt, ossimGpt &worldPt) const
double x
Definition: ossimDpt.h:164

◆ initializeGrids()

void ossimQuadProjection::initializeGrids ( )
protected

Definition at line 432 of file ossimQuadProjection.cpp.

References ossimIrect::height(), ossimDblGrid::initialize(), ossimGpt::latd(), ossimGpt::lond(), ossim::nan(), ossimDblGrid::setNode(), ossimDblGrid::setNullValue(), theInputRect, theLatGrid, theLlg, theLonGrid, theLrg, theUlg, theUrg, ossimIrect::ul(), ossimIrect::width(), ossimIpt::x, and ossimIpt::y.

Referenced by loadState(), and ossimQuadProjection().

433 {
434  ossimIpt gridSize(2,2);
435 
436  ossimDpt spacing = ossimDpt((double)(theInputRect.width()-1)/(gridSize.x-1),
437  (double)(theInputRect.height()-1)/(gridSize.y-1));
438 
441  theLatGrid.initialize(gridSize, theInputRect.ul(), spacing);
442  theLonGrid.initialize(gridSize, theInputRect.ul(), spacing);
443 
444  theLatGrid.setNode(0,0, theUlg.latd());
445  theLatGrid.setNode(1,0, theUrg.latd());
446  theLatGrid.setNode(1,1, theLrg.latd());
447  theLatGrid.setNode(0,1, theLlg.latd());
448 
449  theLonGrid.setNode(0,0, theUlg.lond());
450  theLonGrid.setNode(1,0, theUrg.lond());
451  theLonGrid.setNode(1,1, theLrg.lond());
452  theLonGrid.setNode(0,1, theLlg.lond());
453 }
double lond() const
Will convert the radian measure to degrees.
Definition: ossimGpt.h:97
double nan()
Method to return ieee floating point double precision NAN.
Definition: ossimCommon.h:135
ossim_uint32 height() const
Definition: ossimIrect.h:487
void setNullValue(double value)
Definition: ossimDblGrid.h:183
const ossimIpt & ul() const
Definition: ossimIrect.h:274
void initialize(const ossimIpt &size, const ossimDpt &origin, const ossimDpt &spacing, double null_value=OSSIM_DEFAULT_NULL_PIX_DOUBLE)
double latd() const
Will convert the radian measure to degrees.
Definition: ossimGpt.h:87
ossim_uint32 width() const
Definition: ossimIrect.h:500
void setNode(const ossimIpt &p, const double &value)
Definition: ossimDblGrid.h:107

◆ isAffectedByElevation()

virtual bool ossimQuadProjection::isAffectedByElevation ( ) const
inlinevirtual

Implementation of pure virtual ossimProjection::isAffectedByElevation method.

Returns
false.

Implements ossimProjection.

Definition at line 62 of file ossimQuadProjection.h.

62 { return false; }

◆ lineSampleHeightToWorld()

void ossimQuadProjection::lineSampleHeightToWorld ( const ossimDpt lineSampPt,
const double &  heightAboveEllipsoid,
ossimGpt worldPt 
) const
virtual

METHOD: lineSampleHeightToWorld This is the pure virtual that projects the image point to the given elevation above ellipsoid, thereby bypassing reference to a DEM. Useful for projections that are sensitive to elevation (such as sensor models).

Implements ossimProjection.

Definition at line 107 of file ossimQuadProjection.cpp.

References ossimGpt::datum(), extrapolate(), ossimElevManager::getHeightAboveEllipsoid(), ossimIrect::hasNans(), ossimGpt::hgt, ossimElevManager::instance(), ossimGpt::isLatNan(), ossimGpt::isLonNan(), ossimGpt::lat, ossimGpt::lon, ossimGpt::makeNan(), ossimIrect::pointWithin(), theInputRect, theLatGrid, theLlg, theLonGrid, theLrg, theUlg, and theUrg.

Referenced by extrapolate(), and lineSampleToWorld().

110 {
111  worldPt.makeNan();
112  worldPt.datum(theUlg.datum());
113 
114  if(theUlg.isLatNan()||
115  theUlg.isLonNan()||
116  theUrg.isLatNan()||
117  theUrg.isLonNan()||
118  theLrg.isLatNan()||
119  theLrg.isLonNan()||
120  theLlg.isLatNan()||
121  theLlg.isLonNan()||
123  {
124  return;
125  }
126 
127  if(!theInputRect.pointWithin(lineSampPt))
128  {
129  worldPt = extrapolate(lineSampPt,
130  heightAboveEllipsoid);
132  return;
133  }
134 
135  worldPt.lat = theLatGrid(lineSampPt);
136  worldPt.lon = theLonGrid(lineSampPt);
137  worldPt.hgt = heightAboveEllipsoid;
139 }
bool isLonNan() const
Definition: ossimGpt.h:140
void makeNan()
Definition: ossimGpt.h:130
ossim_float64 hgt
Height in meters above the ellipsiod.
Definition: ossimGpt.h:274
static ossimElevManager * instance()
METHOD: instance() Implements singelton pattern.
bool isLatNan() const
Definition: ossimGpt.h:139
const ossimDatum * datum() const
datum().
Definition: ossimGpt.h:196
ossim_float64 lon
Definition: ossimGpt.h:266
virtual double getHeightAboveEllipsoid(const ossimGpt &gpt)
bool hasNans() const
Definition: ossimIrect.h:337
ossim_float64 lat
Definition: ossimGpt.h:265
ossimGpt extrapolate(const ossimDpt &imagePoint, const double &height) const
bool pointWithin(const ossimIpt &pt) const
Definition: ossimIrect.h:729

◆ lineSampleToWorld()

void ossimQuadProjection::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 98 of file ossimQuadProjection.cpp.

References lineSampleHeightToWorld(), and ossim::nan().

Referenced by extrapolate(), and getMetersPerPixel().

100 {
101  lineSampleHeightToWorld(lineSampPt,
102  ossim::nan(),
103  worldPt);
104 
105 }
double nan()
Method to return ieee floating point double precision NAN.
Definition: ossimCommon.h:135
virtual void lineSampleHeightToWorld(const ossimDpt &lineSampPt, const double &heightAboveEllipsoid, ossimGpt &worldPt) const

◆ loadState()

bool ossimQuadProjection::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 269 of file ossimQuadProjection.cpp.

References ossimDatumFactory::create(), ossimGpt::datum(), ossimKeywordNames::DATUM_KW, ossimKeywordlist::find(), initializeGrids(), ossimDatumFactory::instance(), ossimGpt::latd(), ossimKeywordNames::LL_LAT_KW, ossimKeywordNames::LL_LON_KW, ossimProjection::loadState(), ossimGpt::lond(), ossimKeywordNames::LR_LAT_KW, ossimKeywordNames::LR_LON_KW, ossimIpt::makeNan(), ossimGpt::makeNan(), ossimIrect::makeNan(), ossim::nan(), theInputRect, theLlg, theLrg, theUlg, theUrg, ossimString::toDouble(), ossimString::toInt32(), ossimString::toUInt32(), ossimKeywordNames::UL_LAT_KW, ossimKeywordNames::UL_LON_KW, ossimKeywordNames::UL_X_KW, ossimKeywordNames::UL_Y_KW, ossimKeywordNames::UR_LAT_KW, ossimKeywordNames::UR_LON_KW, ossimIpt::x, and ossimIpt::y.

271 {
272  ossimProjection::loadState(kwl, prefix);
273  theUlg.makeNan();
274  theUrg.makeNan();
275  theLrg.makeNan();
276  theLlg.makeNan();
278 
279  ossimString ulLat = kwl.find(prefix, ossimKeywordNames::UL_LAT_KW);
280  ossimString ulLon = kwl.find(prefix, ossimKeywordNames::UL_LON_KW);
281  ossimString urLat = kwl.find(prefix, ossimKeywordNames::UR_LAT_KW);
282  ossimString urLon = kwl.find(prefix, ossimKeywordNames::UR_LON_KW);
283  ossimString lrLat = kwl.find(prefix, ossimKeywordNames::LR_LAT_KW);
284  ossimString lrLon = kwl.find(prefix, ossimKeywordNames::LR_LON_KW);
285  ossimString llLat = kwl.find(prefix, ossimKeywordNames::LL_LAT_KW);
286  ossimString llLon = kwl.find(prefix, ossimKeywordNames::LL_LON_KW);
287  ossimString datum = kwl.find(prefix, ossimKeywordNames::DATUM_KW);
288  ossimString ulX = kwl.find(prefix, ossimKeywordNames::UL_X_KW);
289  ossimString ulY = kwl.find(prefix, ossimKeywordNames::UL_Y_KW);
290  ossimString width = kwl.find(prefix, "width");
291  ossimString height = kwl.find(prefix, "height");
292 
293  if(ulLat == "nan")
294  {
296  }
297  else
298  {
299  theUlg.latd(ulLat.toDouble());
300  }
301  if(ulLon == "nan")
302  {
304  }
305  else
306  {
307  theUlg.lond(ulLon.toDouble());
308  }
309 
310  if(urLat == "nan")
311  {
313  }
314  else
315  {
316  theUrg.latd(urLat.toDouble());
317  }
318  if(urLon == "nan")
319  {
321  }
322  else
323  {
324  theUrg.lond(urLon.toDouble());
325  }
326 
327  if(lrLat == "nan")
328  {
330  }
331  else
332  {
333  theLrg.latd(lrLat.toDouble());
334  }
335  if(lrLon == "nan")
336  {
338  }
339  else
340  {
341  theLrg.lond(lrLon.toDouble());
342  }
343 
344  if(llLat == "nan")
345  {
347  }
348  else
349  {
350  theLlg.latd(llLat.toDouble());
351  }
352  if(llLon == "nan")
353  {
355  }
356  else
357  {
358  theLlg.lond(llLon.toDouble());
359  }
360 
361  ossimIpt ul;
362 
363  ul.makeNan();
364 
365  if((ulX != "nan") &&
366  (ulY != "nan"))
367  {
368  ul.x = ulX.toInt32();
369  ul.y = ulY.toInt32();
370  }
371  ossim_uint32 w = width.toUInt32();
372  ossim_uint32 h = height.toUInt32();
373  if(datum == "")
374  {
375  datum = "WGE";
376  }
377  const ossimDatum* datumPtr = ossimDatumFactory::instance()->create(datum);
378  theUlg.datum(datumPtr);
379  theUrg.datum(datumPtr);
380  theLrg.datum(datumPtr);
381  theLlg.datum(datumPtr);
382 
383  if(w&&h)
384  {
386  ul.y,
387  ul.x + w - 1,
388  ul.y + h - 1);
389  }
390  else
391  {
393  }
394 
395  initializeGrids();
396 
397  return true;
398 }
virtual const ossimDatum * create(const ossimString &code) const
create method
void makeNan()
Definition: ossimIpt.h:56
static const char * DATUM_KW
double lond() const
Will convert the radian measure to degrees.
Definition: ossimGpt.h:97
static const char * UL_LAT_KW
const char * find(const char *key) const
double nan()
Method to return ieee floating point double precision NAN.
Definition: ossimCommon.h:135
void makeNan()
Definition: ossimGpt.h:130
static const char * LR_LON_KW
ossim_uint32 toUInt32() const
double latd() const
Will convert the radian measure to degrees.
Definition: ossimGpt.h:87
const ossimDatum * datum() const
datum().
Definition: ossimGpt.h:196
ossim_int32 toInt32() const
virtual bool loadState(const ossimKeywordlist &kwl, const char *prefix=0)
static const char * LR_LAT_KW
static const char * UL_X_KW
static const char * LL_LON_KW
unsigned int ossim_uint32
double toDouble() const
static ossimDatumFactory * instance()
static const char * LL_LAT_KW
static const char * UL_Y_KW
ossim_int32 y
Definition: ossimIpt.h:142
void makeNan()
Definition: ossimIrect.h:329
static const char * UL_LON_KW
static const char * UR_LAT_KW
static const char * UR_LON_KW
ossim_int32 x
Definition: ossimIpt.h:141

◆ operator==()

bool ossimQuadProjection::operator== ( const ossimProjection projection) const
virtual

OPERATOR: == Compares this instance with arg projection.

Implements ossimProjection.

Definition at line 400 of file ossimQuadProjection.cpp.

401 {
402  return false;
403 }

◆ origin()

ossimGpt ossimQuadProjection::origin ( ) const
virtual

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

Implements ossimProjection.

Definition at line 68 of file ossimQuadProjection.cpp.

References ossimGpt::datum(), ossimGpt::isLatNan(), ossimGpt::isLonNan(), ossimGpt::latd(), ossimGpt::lond(), ossimGpt::makeNan(), theLlg, theLrg, theUlg, and theUrg.

69 {
70  ossimGpt result;
71  result.makeNan();
72  if(theUlg.isLatNan()||
73  theUlg.isLonNan()||
74  theUrg.isLatNan()||
75  theUrg.isLonNan()||
76  theLrg.isLatNan()||
77  theLrg.isLonNan()||
78  theLlg.isLatNan()||
79  theLlg.isLonNan())
80  {
81  return result;
82  }
83 
84  result.latd( (theUlg.latd() + theUrg.latd() + theLrg.latd() + theLlg.latd())*.25);
85  result.lond( (theUlg.lond() + theUrg.lond() + theLrg.lond() + theLlg.lond())*.25);
86 
87  result.datum(theUlg.datum());
88 
89  return result;
90 }
double lond() const
Will convert the radian measure to degrees.
Definition: ossimGpt.h:97
bool isLonNan() const
Definition: ossimGpt.h:140
void makeNan()
Definition: ossimGpt.h:130
double latd() const
Will convert the radian measure to degrees.
Definition: ossimGpt.h:87
bool isLatNan() const
Definition: ossimGpt.h:139
const ossimDatum * datum() const
datum().
Definition: ossimGpt.h:196

◆ saveState()

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

METHODS: saveState, loadState Fulfills ossimObject base-class pure virtuals.

Reimplemented from ossimProjection.

Definition at line 141 of file ossimQuadProjection.cpp.

References ossimKeywordlist::add(), ossimDatum::code(), ossimGpt::datum(), ossimKeywordNames::DATUM_KW, ossimIrect::hasNans(), ossimIrect::height(), ossimGpt::isLatNan(), ossimGpt::isLonNan(), ossimGpt::latd(), ossimKeywordNames::LL_LAT_KW, ossimKeywordNames::LL_LON_KW, ossimGpt::lond(), ossimKeywordNames::LR_LAT_KW, ossimKeywordNames::LR_LON_KW, ossimProjection::saveState(), theInputRect, theLlg, theLrg, theUlg, theUrg, ossimIrect::ul(), ossimKeywordNames::UL_LAT_KW, ossimKeywordNames::UL_LON_KW, ossimKeywordNames::UL_X_KW, ossimKeywordNames::UL_Y_KW, ossimKeywordNames::UR_LAT_KW, ossimKeywordNames::UR_LON_KW, ossimIrect::width(), ossimIpt::x, and ossimIpt::y.

143 {
144  ossimProjection::saveState(kwl, prefix);
145  kwl.add(prefix,
147  theUlg.datum()->code(),
148  true);
149 
150  if(theInputRect.hasNans())
151  {
152  kwl.add(prefix,
154  "nan",
155  true);
156  kwl.add(prefix,
158  "nan",
159  true);
160  kwl.add(prefix,
161  "width",
162  0,
163  true);
164  kwl.add(prefix,
165  "height",
166  0,
167  true);
168  }
169  else
170  {
171  kwl.add(prefix,
173  theInputRect.ul().x,
174  true);
175  kwl.add(prefix,
177  theInputRect.ul().y,
178  true);
179  kwl.add(prefix,
180  "width",
182  true);
183  kwl.add(prefix,
184  "height",
186  true);
187  }
188 
189  if(theUlg.isLatNan()||
190  theUlg.isLonNan()||
191  theUrg.isLatNan()||
192  theUrg.isLonNan()||
193  theLrg.isLatNan()||
194  theLrg.isLonNan()||
195  theLlg.isLatNan()||
196  theLlg.isLonNan())
197  {
198  kwl.add(prefix,
200  "nan",
201  true);
202  kwl.add(prefix,
204  "nan",
205  true);
206  kwl.add(prefix,
208  "nan",
209  true);
210  kwl.add(prefix,
212  "nan",
213  true);
214  kwl.add(prefix,
216  "nan",
217  true);
218  kwl.add(prefix,
220  "nan",
221  true);
222  kwl.add(prefix,
224  "nan",
225  true);
226  kwl.add(prefix,
228  "nan",
229  true);
230  }
231  else
232  {
233  kwl.add(prefix,
235  theUlg.latd(),
236  true);
237  kwl.add(prefix,
239  theUlg.lond(),
240  true);
241  kwl.add(prefix,
243  theUrg.latd(),
244  true);
245  kwl.add(prefix,
247  theUrg.lond(),
248  true);
249  kwl.add(prefix,
251  theLrg.latd(),
252  true);
253  kwl.add(prefix,
255  theLrg.lond(),
256  true);
257  kwl.add(prefix,
259  theLlg.latd(),
260  true);
261  kwl.add(prefix,
263  theLlg.lond(),
264  true);
265  }
266  return true;
267 }
static const char * DATUM_KW
double lond() const
Will convert the radian measure to degrees.
Definition: ossimGpt.h:97
bool isLonNan() const
Definition: ossimGpt.h:140
static const char * UL_LAT_KW
ossim_uint32 height() const
Definition: ossimIrect.h:487
virtual const ossimString & code() const
Definition: ossimDatum.h:57
const ossimIpt & ul() const
Definition: ossimIrect.h:274
static const char * LR_LON_KW
double latd() const
Will convert the radian measure to degrees.
Definition: ossimGpt.h:87
bool isLatNan() const
Definition: ossimGpt.h:139
const ossimDatum * datum() const
datum().
Definition: ossimGpt.h:196
void add(const char *prefix, const ossimKeywordlist &kwl, bool overwrite=true)
static const char * LR_LAT_KW
static const char * UL_X_KW
static const char * LL_LON_KW
static const char * LL_LAT_KW
static const char * UL_Y_KW
ossim_uint32 width() const
Definition: ossimIrect.h:500
ossim_int32 y
Definition: ossimIpt.h:142
static const char * UL_LON_KW
static const char * UR_LAT_KW
static const char * UR_LON_KW
virtual bool saveState(ossimKeywordlist &kwl, const char *prefix=0) const
bool hasNans() const
Definition: ossimIrect.h:337
ossim_int32 x
Definition: ossimIpt.h:141

◆ worldToLineSample()

void ossimQuadProjection::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 92 of file ossimQuadProjection.cpp.

References ossimProjection::worldToLineSample().

94 {
95  ossimProjection::worldToLineSample(worldPoint, lineSampPt);
96 }
virtual void worldToLineSample(const ossimGpt &worldPoint, ossimDpt &lineSampPt) const =0

Member Data Documentation

◆ theInputRect

ossimIrect ossimQuadProjection::theInputRect
protected

◆ theLatGrid

ossimDblGrid ossimQuadProjection::theLatGrid
protected

Definition at line 73 of file ossimQuadProjection.h.

Referenced by initializeGrids(), and lineSampleHeightToWorld().

◆ theLlg

ossimGpt ossimQuadProjection::theLlg
protected

◆ theLonGrid

ossimDblGrid ossimQuadProjection::theLonGrid
protected

Definition at line 74 of file ossimQuadProjection.h.

Referenced by initializeGrids(), and lineSampleHeightToWorld().

◆ theLrg

ossimGpt ossimQuadProjection::theLrg
protected

◆ theUlg

ossimGpt ossimQuadProjection::theUlg
protected

◆ theUrg

ossimGpt ossimQuadProjection::theUrg
protected

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