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

storage class for tie point between ground and image based on ossimGpt More...

#include <ossimTieGpt.h>

Inheritance diagram for ossimTieGpt:
ossimReferenced ossimGpt

Public Member Functions

 ossimTieGpt ()
 
 ossimTieGpt (const ossimGpt &aPt, const ossimDpt &aTie, const ossim_float64 &aScore)
 
 ossimTieGpt (const ossimTieGpt &tpt)
 
 ~ossimTieGpt ()
 
const ossimTieGptoperator= (const ossimTieGpt &)
 
void setGroundPoint (const ossimGpt &mPt)
 
const ossimGptgetGroundPoint () const
 
ossimGptrefGroundPoint ()
 
void setImagePoint (const ossimDpt &sPt)
 
const ossimDptgetImagePoint () const
 
ossimDptrefImagePoint ()
 
void setScore (const ossim_float64 &s)
 
const ossim_float64getScore () const
 
ossim_float64refScore ()
 
void makeNan ()
 
bool hasNans () const
 
bool isNan () const
 
std::ostream & print (std::ostream &os) const
 text serialization More...
 
std::ostream & printTab (std::ostream &os) const
 
ossimRefPtr< ossimXmlNodeexportAsGmlNode (ossimString aGmlVersion="2.1.2") const
 GML feauture (XML) serialization. More...
 
bool importFromGmlNode (ossimRefPtr< ossimXmlNode > aGmlNode, ossimString aGmlVersion="2.1.2")
 
- 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 ossimGpt
 ossimGpt (const double alat=0, const double alon=0, const double ahgt=0, const ossimDatum *aDatum=ossimDatumFactory::instance() ->wgs84())
 Constructor. More...
 
 ossimGpt (const ossimGpt &src)
 Copy Constructor: More...
 
 ossimGpt (const ossimEcefPoint &aPt, const ossimDatum *aDatum=ossimDatumFactory::instance() ->wgs84())
 Constructor. More...
 
 ossimGpt (const ossimDpt3d &aPt)
 Argument aPt (x, y, z) is understood to represent (lon, lat, hgt) relative to WGS84 datum. More...
 
double latr () const
 latr(). More...
 
void latr (double radianValue)
 Returns the latitude in radian measure. More...
 
double lonr () const
 Returns the longitude in radian measure. More...
 
void lonr (double radianValue)
 Assumes the value being passed in is in radians. More...
 
double latd () const
 Will convert the radian measure to degrees. More...
 
void latd (double degreeValue)
 Assumes the passed in value is in degrees. More...
 
double lond () const
 Will convert the radian measure to degrees. More...
 
void lond (double degreeValue)
 Assumes the passed in value is in degrees. More...
 
double height () const
 
double heightMSL () const
 
void height (double height)
 Sets the "hgt" data member to height. More...
 
void heightMSL (double heightMSL)
 Sets the "hgt" data member to heightMsl adding any geiod offset. More...
 
void makeNan ()
 
bool isNan () const
 
bool hasNans () const
 
bool isLatNan () const
 
bool isLonNan () const
 
bool isLonLatNan () const
 
bool isLatLonNan () const
 
bool isHgtNan () const
 
std::ostream & print (std::ostream &os, ossim_uint32 precision=15) const
 
ossimString toString (ossim_uint32 precision=15) const
 
void toPoint (const std::string &s)
 Initializes this point from string. More...
 
const ossimDatumdatum () const
 datum(). More...
 
void datum (const ossimDatum *aDatum)
 Note: this will not do a shift. More...
 
void changeDatum (const ossimDatum *datum)
 This will actually perform a shift. More...
 
const ossimGptoperator= (const ossimGpt &aPt)
 
bool operator== (const ossimGpt &gpt) const
 
bool operator!= (const ossimGpt &gpt) const
 
void limitLonTo180 ()
 METHOD: limitLonTo180() Converts the lon data member to a value between -180 and +180: More...
 
void wrap ()
 Wrap method to maintain longitude between -180 and +180 and latitude between -90 and +90. More...
 
void clampLon (double low, double high)
 
void clampLat (double low, double high)
 
void clampHgt (double low, double high)
 
double distanceTo (const ossimGpt &arg_gpt) const
 METHOD: distanceTo(ossimGpt) Computes straight-line distance in meters between this and arg gpt: More...
 
double azimuthTo (const ossimGpt &arg_gpt) const
 METHOD: azimuthTo(ossimGpt) Computes the great-circle starting azimuth (i.e., at this gpt) to the argument gpt in degrees. More...
 
ossimDpt metersPerDegree () const
 
ossimString toDmsString () const
 
bool isEqualTo (const ossimGpt &rhs, ossimCompareType compareType=OSSIM_COMPARE_FULL) const
 

Public Attributes

ossimDpt tie
 Public data members. More...
 
ossim_float64 score
 
- Public Attributes inherited from ossimGpt
ossim_float64 lat
 
ossim_float64 lon
 
ossim_float64 hgt
 Height in meters above the ellipsiod. More...
 

Friends

OSSIMDLLEXPORT std::ostream & operator<< (std::ostream &os, const ossimTieGpt &pt)
 
OSSIMDLLEXPORT std::istream & operator>> (std::istream &is, ossimTieGpt &pt)
 Method to input the formatted string of the "operator<<". More...
 

Additional Inherited Members

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

Detailed Description

storage class for tie point between ground and image based on ossimGpt

NOTES accuracy is not stored here (need to derive object if need a per-point accuracy) GML storage is WGS84 only, it stores above ellipsoid height (m)

TODO : -support other datum (easy) / ground projection (big change in OSSIM) -unify with ossimTDpt

Definition at line 24 of file ossimTieGpt.h.

Constructor & Destructor Documentation

◆ ossimTieGpt() [1/3]

ossimTieGpt::ossimTieGpt ( )
inline

Definition at line 30 of file ossimTieGpt.h.

30  :
32  ossimGpt(),
33  tie(),
34  score(0.0)
35  {}
ossimDpt tie
Public data members.
Definition: ossimTieGpt.h:108
ossim_float64 score
Definition: ossimTieGpt.h:109
ossimGpt(const double alat=0, const double alon=0, const double ahgt=0, const ossimDatum *aDatum=ossimDatumFactory::instance() ->wgs84())
Constructor.
Definition: ossimGpt.h:37

◆ ossimTieGpt() [2/3]

ossimTieGpt::ossimTieGpt ( const ossimGpt aPt,
const ossimDpt aTie,
const ossim_float64 aScore 
)
inline

Definition at line 37 of file ossimTieGpt.h.

37  :
39  ossimGpt(aPt),
40  tie(aTie),
41  score(aScore)
42  {}
ossimDpt tie
Public data members.
Definition: ossimTieGpt.h:108
ossim_float64 score
Definition: ossimTieGpt.h:109
ossimGpt(const double alat=0, const double alon=0, const double ahgt=0, const ossimDatum *aDatum=ossimDatumFactory::instance() ->wgs84())
Constructor.
Definition: ossimGpt.h:37

◆ ossimTieGpt() [3/3]

ossimTieGpt::ossimTieGpt ( const ossimTieGpt tpt)
inline

Definition at line 44 of file ossimTieGpt.h.

44  :
45  ossimReferenced(tpt),
46  ossimGpt(tpt),
47  tie(tpt.tie),
48  score(tpt.score)
49  {}
ossimDpt tie
Public data members.
Definition: ossimTieGpt.h:108
ossim_float64 score
Definition: ossimTieGpt.h:109
ossimGpt(const double alat=0, const double alon=0, const double ahgt=0, const ossimDatum *aDatum=ossimDatumFactory::instance() ->wgs84())
Constructor.
Definition: ossimGpt.h:37

◆ ~ossimTieGpt()

ossimTieGpt::~ossimTieGpt ( )
inline

Definition at line 50 of file ossimTieGpt.h.

50 {}

Member Function Documentation

◆ exportAsGmlNode()

ossimRefPtr< ossimXmlNode > ossimTieGpt::exportAsGmlNode ( ossimString  aGmlVersion = "2.1.2") const

GML feauture (XML) serialization.

Definition at line 111 of file ossimTieGpt.cpp.

References ossimXmlNode::addChildNode(), ossimXmlNode::addNode(), COORD_GML2, ossimGpt::datum(), GROUND_GML2, ossimDpt::hasNans(), ossimGpt::height(), IMAGE_GML2, ossimDatumFactory::instance(), ossimGpt::isHgtNan(), ossimGpt::isLatNan(), ossimGpt::isLonNan(), ossimGpt::latd(), ossimGpt::lond(), ossimNotify(), ossimNotifyLevel_WARN, score, SCORE_GML2, ossimXmlNode::setTag(), tie, ossimString::toString(), ossimDpt::x, and ossimDpt::y.

112 {
114  // check datum to be WGS84
115  if ( !(datum()->operator==(*(ossimDatumFactory::instance()->wgs84()))) )
116  {
117  ossimNotify(ossimNotifyLevel_WARN) << "WARNING: ossimTieGpt::exportAsGmlNode datum must be WGS84\n";
118  return node;
119  }
120  // check nans in lon/lat and in tie
121  if (isLatNan() || isLonNan() || tie.hasNans())
122  {
123  ossimNotify(ossimNotifyLevel_WARN) << "WARNING: ossimTieGpt::exportAsGmlNode positions have nan\n";
124  return node;
125  }
126  if (aGmlVersion[static_cast<std::string::size_type>(0)] == '2')
127  {
128  node->setTag("SimpleTiePoint");
129  // note: no "fid" attribute (feature id")
130  //store Ground Point WGS84 + height above ellipsoid in meters
132  gcoord->addChildNode("X",ossimString::toString(lond()));
133  gcoord->addChildNode("Y",ossimString::toString(latd()));
134  if (!isHgtNan())
135  {
136  gcoord->addChildNode("Z",ossimString::toString(height())); //above ellipsoid
137  }
138 
139  // store image tie point
141  tcoord->addChildNode("X",ossimString::toString(tie.x));
142  tcoord->addChildNode("Y",ossimString::toString(tie.y));
143 
144  //store score (change name to confidence?)
145  node->addNode(SCORE_GML2,ossimString::toString(score));
146  } else {
147  ossimNotify(ossimNotifyLevel_WARN) << "WARNING: ossimTieGpt::exportAsGmlNode Unsupported GML version : " << aGmlVersion <<"\n";
148  }
149  return node;
150 }
const char * SCORE_GML2
double lond() const
Will convert the radian measure to degrees.
Definition: ossimGpt.h:97
bool isLonNan() const
Definition: ossimGpt.h:140
double y
Definition: ossimDpt.h:165
static ossimString toString(bool aValue)
Numeric to string methods.
const char * COORD_GML2
ossimDpt tie
Public data members.
Definition: ossimTieGpt.h:108
const char * IMAGE_GML2
ossimRefPtr< ossimXmlNode > addNode(const ossimString &relPath, const ossimString &text="")
double latd() const
Will convert the radian measure to degrees.
Definition: ossimGpt.h:87
bool isLatNan() const
Definition: ossimGpt.h:139
bool isHgtNan() const
Definition: ossimGpt.h:143
const ossimDatum * datum() const
datum().
Definition: ossimGpt.h:196
const char * GROUND_GML2
double height() const
Definition: ossimGpt.h:107
static ossimDatumFactory * instance()
bool hasNans() const
Definition: ossimDpt.h:67
double x
Definition: ossimDpt.h:164
ossim_float64 score
Definition: ossimTieGpt.h:109
void addChildNode(ossimRefPtr< ossimXmlNode > node)
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)

◆ getGroundPoint()

const ossimGpt& ossimTieGpt::getGroundPoint ( ) const
inline

Definition at line 55 of file ossimTieGpt.h.

55 { return *this; }

◆ getImagePoint()

const ossimDpt& ossimTieGpt::getImagePoint ( ) const
inline

Definition at line 59 of file ossimTieGpt.h.

59 { return tie; }
ossimDpt tie
Public data members.
Definition: ossimTieGpt.h:108

◆ getScore()

const ossim_float64& ossimTieGpt::getScore ( ) const
inline

Definition at line 63 of file ossimTieGpt.h.

63 { return score; }
ossim_float64 score
Definition: ossimTieGpt.h:109

◆ hasNans()

bool ossimTieGpt::hasNans ( ) const
inline

Definition at line 73 of file ossimTieGpt.h.

References ossimGpt::hasNans(), and ossim::isnan().

74  {
75  return (ossimGpt::hasNans() || tie.hasNans() || (ossim::isnan(score)));
76  }
ossimDpt tie
Public data members.
Definition: ossimTieGpt.h:108
bool hasNans() const
Definition: ossimDpt.h:67
bool hasNans() const
Definition: ossimGpt.h:135
ossim_float64 score
Definition: ossimTieGpt.h:109
bool isnan(const float &v)
isnan Test for floating point Not A Number (NAN) value.
Definition: ossimCommon.h:91

◆ importFromGmlNode()

bool ossimTieGpt::importFromGmlNode ( ossimRefPtr< ossimXmlNode aGmlNode,
ossimString  aGmlVersion = "2.1.2" 
)

Definition at line 153 of file ossimTieGpt.cpp.

References COORD_GML2, ossimXmlNode::findFirstNode(), ossimXmlNode::getText(), GROUND_GML2, ossimGpt::height(), IMAGE_GML2, ossimGpt::latd(), ossimGpt::lond(), ossimDpt::makeNan(), makeNan(), ossimNotify(), ossimNotifyLevel_WARN, score, SCORE_GML2, tie, ossimRefPtr< T >::valid(), ossimDpt::x, and ossimDpt::y.

Referenced by ossimTieGptSet::importFromGmlNode().

154 {
155  //assuming datum is EPSG:4326 (aka WGS84)
156  //feature has to be a SimpleTiePoint feature
157  //TBD : add support for coord instead of coordinates
158  //TBD : more robust type checks (for X,Y,Z and score) - create extra protected function
159 
160  //clear data
161  makeNan();
162  tie.makeNan();
163  score = 0;
164 
165  if (aGmlVersion[static_cast<std::string::size_type>(0)] == '2')
166  {
167  //read ground point
170  if (gcoord.valid())
171  {
172  //read coord
173  ossimRefPtr<ossimXmlNode> gx = gcoord->findFirstNode("X");
174  if (gx.valid())
175  {
176  lond(ossimString(gx->getText()).toDouble());
177  } else {
178  ossimNotify(ossimNotifyLevel_WARN) << "WARNING: ossimTieGpt::importFromGmlNode no ground X found in coord\n";
179  return false;
180  }
181  ossimRefPtr<ossimXmlNode> gy = gcoord->findFirstNode("Y");
182  if (gy.valid())
183  {
184  latd(ossimString(gy->getText()).toDouble());
185  } else {
186  ossimNotify(ossimNotifyLevel_WARN) << "WARNING: ossimTieGpt::importFromGmlNode no ground Y found in coord\n";
187  return false;
188  }
189  ossimRefPtr<ossimXmlNode> gz = gcoord->findFirstNode("Z");
190  if (gz.valid())
191  {
192  height(ossimString(gz->getText()).toDouble());
193  } // no Z value is possible
194  }
195  else {
196  //try to read coordinates
197  //TBD
198  ossimNotify(ossimNotifyLevel_WARN) << "WARNING: ossimTieGpt::importFromGmlNode gml:coordinates not developed yet for ground\n";
199  return false;
200  }
201 
202  //read image point
205  if (icoord.valid())
206  {
207  //read coord
208  ossimRefPtr<ossimXmlNode> ix = icoord->findFirstNode("X");
209  if (ix.valid())
210  {
211  tie.x = ossimString(ix->getText()).toDouble();
212  } else {
213  ossimNotify(ossimNotifyLevel_WARN) << "WARNING: ossimTieGpt::importFromGmlNode no image X found in coord\n";
214  return false;
215  }
216  ossimRefPtr<ossimXmlNode> iy = icoord->findFirstNode("Y");
217  if (iy.valid())
218  {
219  tie.y = ossimString(iy->getText()).toDouble();
220  } else {
221  ossimNotify(ossimNotifyLevel_WARN) << "WARNING: ossimTieGpt::importFromGmlNode no image Y found in coord\n";
222  return false;
223  }
224  //don't read Z value (shouldn't be any)
225  }
226  else {
227  //try to read coordinates
228  //TBD
229  ossimNotify(ossimNotifyLevel_WARN) << "WARNING: ossimTieGpt::importFromGmlNode gml:coordinates not developed yet for image\n";
230  return false;
231  }
232 
233  //read score
235  if (scoren.valid())
236  {
237  score = ossimString(scoren->getText()).toDouble();
238  } else {
239  score = 0.0;
240  }
241  return true;
242  } else {
243  ossimNotify(ossimNotifyLevel_WARN) << "WARNING: ossimTieGpt::importFromGmlNode Unsupported GML version : " << aGmlVersion <<"\n";
244  return false;
245  }
246 }
const char * SCORE_GML2
double lond() const
Will convert the radian measure to degrees.
Definition: ossimGpt.h:97
bool valid() const
Definition: ossimRefPtr.h:75
void makeNan()
Definition: ossimTieGpt.h:66
double y
Definition: ossimDpt.h:165
const char * COORD_GML2
ossimDpt tie
Public data members.
Definition: ossimTieGpt.h:108
const char * IMAGE_GML2
const ossimRefPtr< ossimXmlNode > & findFirstNode(const ossimString &rel_xpath) const
double latd() const
Will convert the radian measure to degrees.
Definition: ossimGpt.h:87
const ossimString & getText() const
Definition: ossimXmlNode.h:92
const char * GROUND_GML2
double height() const
Definition: ossimGpt.h:107
double x
Definition: ossimDpt.h:164
ossim_float64 score
Definition: ossimTieGpt.h:109
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)
void makeNan()
Definition: ossimDpt.h:65

◆ isNan()

bool ossimTieGpt::isNan ( ) const
inline

Definition at line 78 of file ossimTieGpt.h.

References ossim::isnan(), and ossimGpt::isNan().

79  {
80  return (ossimGpt::isNan() && tie.isNan() && (ossim::isnan(score)));
81  }
ossimDpt tie
Public data members.
Definition: ossimTieGpt.h:108
bool isNan() const
Definition: ossimDpt.h:72
bool isNan() const
Definition: ossimGpt.h:131
ossim_float64 score
Definition: ossimTieGpt.h:109
bool isnan(const float &v)
isnan Test for floating point Not A Number (NAN) value.
Definition: ossimCommon.h:91

◆ makeNan()

void ossimTieGpt::makeNan ( )
inline

Definition at line 66 of file ossimTieGpt.h.

References ossimGpt::makeNan(), and ossim::nan().

Referenced by importFromGmlNode(), and operator>>().

67  {
69  tie.makeNan();
70  score=ossim::nan();
71  }
double nan()
Method to return ieee floating point double precision NAN.
Definition: ossimCommon.h:135
void makeNan()
Definition: ossimGpt.h:130
ossimDpt tie
Public data members.
Definition: ossimTieGpt.h:108
ossim_float64 score
Definition: ossimTieGpt.h:109
void makeNan()
Definition: ossimDpt.h:65

◆ operator=()

const ossimTieGpt & ossimTieGpt::operator= ( const ossimTieGpt pt)
inline

Definition at line 112 of file ossimTieGpt.h.

References ossimReferenced::operator=(), ossimGpt::operator=(), score, and tie.

113 {
114  if (this != &pt)
115  {
118  tie = pt.tie;
119  score = pt.score;
120  }
121 
122  return *this;
123 }
const ossimGpt & operator=(const ossimGpt &aPt)
Definition: ossimGpt.h:285
ossimDpt tie
Public data members.
Definition: ossimTieGpt.h:108
ossimReferenced & operator=(const ossimReferenced &)
ossim_float64 score
Definition: ossimTieGpt.h:109

◆ print()

std::ostream & ossimTieGpt::print ( std::ostream &  os) const

text serialization

Definition at line 11 of file ossimTieGpt.cpp.

References ossim::isnan(), score, and tie.

Referenced by operator<<().

12 {
13  os << "( ";
14  os << dynamic_cast<const ossimGpt&>(*this);
15  os << ", ";
16  os << tie;
17  os << ", ";
18  if (ossim::isnan(score) == false)
19  {
20  os << std::setiosflags(std::ios::fixed) << std::setprecision(15);
21  os << score;
22  } else {
23  os << "nan";
24  }
25  os << " )";
26 
27  return os;
28 }
ossimDpt tie
Public data members.
Definition: ossimTieGpt.h:108
ossim_float64 score
Definition: ossimTieGpt.h:109
bool isnan(const float &v)
isnan Test for floating point Not A Number (NAN) value.
Definition: ossimCommon.h:91

◆ printTab()

std::ostream & ossimTieGpt::printTab ( std::ostream &  os) const

Definition at line 30 of file ossimTieGpt.cpp.

References ossimGpt::height(), ossimGpt::latd(), ossimGpt::lond(), score, tie, ossimDpt::x, and ossimDpt::y.

31 {
32  os << std::setiosflags(std::ios::fixed) << std::setprecision(15);
33  os<< lond() ;
34  os<<"\t"<< latd();
35  os<<"\t"<< height();
36  os<<"\t"<< tie.x;
37  os<<"\t"<< tie.y;
38  os<<"\t"<< score;
39 
40  return os;
41 }
double lond() const
Will convert the radian measure to degrees.
Definition: ossimGpt.h:97
double y
Definition: ossimDpt.h:165
ossimDpt tie
Public data members.
Definition: ossimTieGpt.h:108
double latd() const
Will convert the radian measure to degrees.
Definition: ossimGpt.h:87
double height() const
Definition: ossimGpt.h:107
double x
Definition: ossimDpt.h:164
ossim_float64 score
Definition: ossimTieGpt.h:109

◆ refGroundPoint()

ossimGpt& ossimTieGpt::refGroundPoint ( )
inline

Definition at line 56 of file ossimTieGpt.h.

56 { return *this; }

◆ refImagePoint()

ossimDpt& ossimTieGpt::refImagePoint ( )
inline

Definition at line 60 of file ossimTieGpt.h.

60 { return tie; }
ossimDpt tie
Public data members.
Definition: ossimTieGpt.h:108

◆ refScore()

ossim_float64& ossimTieGpt::refScore ( )
inline

Definition at line 64 of file ossimTieGpt.h.

64 { return score; }
ossim_float64 score
Definition: ossimTieGpt.h:109

◆ setGroundPoint()

void ossimTieGpt::setGroundPoint ( const ossimGpt mPt)
inline

Definition at line 54 of file ossimTieGpt.h.

References ossimGpt::operator=().

54 { ossimGpt::operator=(mPt); }
const ossimGpt & operator=(const ossimGpt &aPt)
Definition: ossimGpt.h:285

◆ setImagePoint()

void ossimTieGpt::setImagePoint ( const ossimDpt sPt)
inline

Definition at line 58 of file ossimTieGpt.h.

58 { tie=sPt; }
ossimDpt tie
Public data members.
Definition: ossimTieGpt.h:108

◆ setScore()

void ossimTieGpt::setScore ( const ossim_float64 s)
inline

Definition at line 62 of file ossimTieGpt.h.

62 { score=s; }
ossim_float64 score
Definition: ossimTieGpt.h:109

Friends And Related Function Documentation

◆ operator<<

OSSIMDLLEXPORT std::ostream& operator<< ( std::ostream &  os,
const ossimTieGpt pt 
)
friend

Definition at line 43 of file ossimTieGpt.cpp.

44 {
45  return pt.print(os);
46 }
std::ostream & print(std::ostream &os) const
text serialization
Definition: ossimTieGpt.cpp:11

◆ operator>>

OSSIMDLLEXPORT std::istream& operator>> ( std::istream &  is,
ossimTieGpt pt 
)
friend

Method to input the formatted string of the "operator<<".

Expected format: ( ( ossimGpt ), ( ossimDpt ), 0.50000000000000 ) –*this-— , -—tie--—, —score-----—

Definition at line 48 of file ossimTieGpt.cpp.

49 {
50  //---
51  // Expected input format:
52  // ( (ossimDPt), (ossimDpt), score )
53  // score is real or nan
54  //---
55 
56  // Start with a nan point.
57  pt.makeNan();
58  // Check the stream.
59  if (!is) return is;
60 
61  ossimString tempString;
62 
63  // Gobble the "(".
64  is >> tempString;
65 
66  //get the first point
67  is>>dynamic_cast<ossimGpt&>(pt);
68 
69  // Eat the ",".
70  char c;
71  is.get(c);
72 
73  //get the second point
74  is>>pt.tie;
75 
76  // Eat the second ",".
77  is.get(c);
78 
79  // Get the score
80  const int SZ = 64; // real number buffer size
81  char tempChars[SZ];
82  is.get(tempChars, SZ, ',');
83  if (!is) return is;
84  tempChars[SZ-1] = '\0';
85  tempString = tempChars;
86  tempString.trim();
87  if (tempString == "nan")
88  {
89  pt.score = ossim::nan();
90  }
91  else
92  {
93  pt.score = tempString.toDouble();
94  }
95 
96  // Gobble the trailing ")".
97  is >> tempString;
98 
99  // Finished
100  return is;
101 }
double nan()
Method to return ieee floating point double precision NAN.
Definition: ossimCommon.h:135
void makeNan()
Definition: ossimTieGpt.h:66
ossimDpt tie
Public data members.
Definition: ossimTieGpt.h:108
ossim_float64 score
Definition: ossimTieGpt.h:109

Member Data Documentation

◆ score

ossim_float64 ossimTieGpt::score

◆ tie

ossimDpt ossimTieGpt::tie

Public data members.

Definition at line 108 of file ossimTieGpt.h.

Referenced by exportAsGmlNode(), importFromGmlNode(), operator=(), operator>>(), print(), and printTab().


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