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

This class handles the referential point. More...

#include <RefPoint.h>

Public Member Functions

 RefPoint ()
 Constuctor. More...
 
 ~RefPoint ()
 Destructor. More...
 
 RefPoint (const RefPoint &rhs)
 Copy constructor. More...
 
RefPointoperator= (const RefPoint &rhs)
 Affectation operator. More...
 
void set_ephemeris (Ephemeris *ephemeris)
 
void set_distance (double distance)
 
void set_pix_line (double pix_line)
 
void set_pix_col (double pix_col)
 
Ephemerisget_ephemeris ()
 
double get_distance () const
 
double get_pix_line () const
 
double get_pix_col () const
 
RefPointClone ()
 
bool saveState (ossimKeywordlist &kwl, const char *prefix=0) const
 Method to save object state to a keyword list. More...
 
bool loadState (const ossimKeywordlist &kwl, const char *prefix=0)
 Method to the load (recreate) the state of the object from a keyword list. More...
 

Protected Attributes

Ephemeris_ephemeris
 
double _distance
 
double _pix_line
 
double _pix_col
 

Detailed Description

This class handles the referential point.

Definition at line 29 of file RefPoint.h.

Constructor & Destructor Documentation

◆ RefPoint() [1/2]

ossimplugins::RefPoint::RefPoint ( )

Constuctor.

Definition at line 26 of file RefPoint.cpp.

26  :
27  _ephemeris(0),
28  _distance(0.0),
29  _pix_line(0.0),
30  _pix_col(0.0)
31 {
32 }
Ephemeris * _ephemeris
Definition: RefPoint.h:80

◆ ~RefPoint()

ossimplugins::RefPoint::~RefPoint ( )

Destructor.

Definition at line 34 of file RefPoint.cpp.

References _ephemeris.

35 {
36  if(_ephemeris != 0)
37  {
38  delete _ephemeris;
39  }
40 }
Ephemeris * _ephemeris
Definition: RefPoint.h:80

◆ RefPoint() [2/2]

ossimplugins::RefPoint::RefPoint ( const RefPoint rhs)

Copy constructor.

Definition at line 42 of file RefPoint.cpp.

References _ephemeris, and ossimplugins::Ephemeris::Clone().

42  :
43  _distance(rhs._distance),
44  _pix_line(rhs._pix_line),
45  _pix_col(rhs._pix_col)
46 {
47  _ephemeris = rhs._ephemeris->Clone();
48 }
virtual Ephemeris * Clone()
This function creatse a copy of the current class.
Definition: Ephemeris.h:58
Ephemeris * _ephemeris
Definition: RefPoint.h:80

Member Function Documentation

◆ Clone()

RefPoint* ossimplugins::RefPoint::Clone ( )
inline

Definition at line 59 of file RefPoint.h.

Referenced by ossimplugins::ossimGeometricSarSensorModel::set_refPoint().

60  {
61  return new RefPoint(*this);
62  };
RefPoint()
Constuctor.
Definition: RefPoint.cpp:26

◆ get_distance()

double ossimplugins::RefPoint::get_distance ( ) const

◆ get_ephemeris()

Ephemeris * ossimplugins::RefPoint::get_ephemeris ( )

◆ get_pix_col()

double ossimplugins::RefPoint::get_pix_col ( ) const

◆ get_pix_line()

double ossimplugins::RefPoint::get_pix_line ( ) const

Definition at line 100 of file RefPoint.cpp.

References _pix_line.

Referenced by ossimplugins::ossimGeometricSarSensorModel::getTime().

101 {
102  return _pix_line;
103 }

◆ loadState()

bool ossimplugins::RefPoint::loadState ( const ossimKeywordlist kwl,
const char *  prefix = 0 
)

Method to the load (recreate) the state of the object from a keyword list.

Return true if ok or false on error.

Returns
true if load OK, false on error

Definition at line 137 of file RefPoint.cpp.

References _distance, _ephemeris, _pix_col, _pix_line, ossimKeywordlist::find(), ossimplugins::Ephemeris::loadState(), and ossimString::toDouble().

Referenced by ossimplugins::ossimGeometricSarSensorModel::loadState().

138 {
139  bool result = true;
140 
141  std::string pfx;
142  if (prefix)
143  {
144  pfx = prefix;
145  }
146  pfx += PREFIX;
147 
148 
149  if (!_ephemeris)
150  {
151  _ephemeris = new Ephemeris();
152  }
153 
154  result = _ephemeris->loadState(kwl, pfx.c_str());
155 
156  const char* lookup = 0;
157  ossimString s;
158  double d;
159 
160  lookup = kwl.find(pfx.c_str(), DISTANCE_KW);
161  if (lookup)
162  {
163  s = lookup;
164  d = s.toDouble();
165  _distance = d;
166  }
167  else
168  {
169  result = false;
170  }
171 
172  lookup = kwl.find(pfx.c_str(), LINE_KW);
173  if (lookup)
174  {
175  s = lookup;
176  d = s.toDouble();
177  _pix_line = d;
178  }
179  else
180  {
181  result = false;
182  }
183 
184  lookup = kwl.find(pfx.c_str(), COL_KW);
185  if (lookup)
186  {
187  s = lookup;
188  d = s.toDouble();
189  _pix_col = d;
190  }
191  else
192  {
193  result = false;
194  }
195 
196  return result;
197 }
const char * find(const char *key) const
bool loadState(const ossimKeywordlist &kwl, const char *prefix=0)
Method to the load (recreate) the state of the object from a keyword list.
Definition: Ephemeris.cpp:100
double toDouble() const
Ephemeris * _ephemeris
Definition: RefPoint.h:80

◆ operator=()

RefPoint & ossimplugins::RefPoint::operator= ( const RefPoint rhs)

Affectation operator.

Definition at line 50 of file RefPoint.cpp.

References _distance, _ephemeris, _pix_col, _pix_line, and ossimplugins::Ephemeris::Clone().

51 {
52  _distance = rhs._distance;
53  _pix_line = rhs._pix_line;
54  _pix_col = rhs._pix_col;
55  if(_ephemeris != 0)
56  {
57  delete _ephemeris;
58  _ephemeris = 0;
59  }
60  _ephemeris = rhs._ephemeris->Clone();
61 
62  return *this;
63 }
virtual Ephemeris * Clone()
This function creatse a copy of the current class.
Definition: Ephemeris.h:58
Ephemeris * _ephemeris
Definition: RefPoint.h:80

◆ saveState()

bool ossimplugins::RefPoint::saveState ( ossimKeywordlist kwl,
const char *  prefix = 0 
) const

Method to save object state to a keyword list.

Parameters
kwlKeyword list to save to.
prefixadded to keys when saved.
Returns
true on success, false on error.

Definition at line 110 of file RefPoint.cpp.

References _distance, _ephemeris, _pix_col, _pix_line, ossimKeywordlist::add(), and ossimplugins::Ephemeris::saveState().

Referenced by ossimplugins::ossimGeometricSarSensorModel::saveState().

111 {
112  bool result = true;
113 
114  std::string pfx;
115  if (prefix)
116  {
117  pfx = prefix;
118  }
119  pfx += PREFIX;
120 
121  if (_ephemeris)
122  {
123  result = _ephemeris->saveState(kwl, pfx.c_str());
124  }
125  else
126  {
127  result = false;
128  }
129 
130  kwl.add(pfx.c_str(), DISTANCE_KW, _distance);
131  kwl.add(pfx.c_str(), LINE_KW, _pix_line);
132  kwl.add(pfx.c_str(), COL_KW, _pix_col);
133 
134  return result;
135 }
bool saveState(ossimKeywordlist &kwl, const char *prefix=0) const
Method to save object state to a keyword list.
Definition: Ephemeris.cpp:78
void add(const char *prefix, const ossimKeywordlist &kwl, bool overwrite=true)
Ephemeris * _ephemeris
Definition: RefPoint.h:80

◆ set_distance()

void ossimplugins::RefPoint::set_distance ( double  distance)

◆ set_ephemeris()

void ossimplugins::RefPoint::set_ephemeris ( Ephemeris ephemeris)

◆ set_pix_col()

void ossimplugins::RefPoint::set_pix_col ( double  pix_col)

◆ set_pix_line()

void ossimplugins::RefPoint::set_pix_line ( double  pix_line)

Member Data Documentation

◆ _distance

double ossimplugins::RefPoint::_distance
protected

Definition at line 81 of file RefPoint.h.

Referenced by get_distance(), loadState(), operator=(), saveState(), and set_distance().

◆ _ephemeris

Ephemeris* ossimplugins::RefPoint::_ephemeris
protected

◆ _pix_col

double ossimplugins::RefPoint::_pix_col
protected

Definition at line 83 of file RefPoint.h.

Referenced by get_pix_col(), loadState(), operator=(), saveState(), and set_pix_col().

◆ _pix_line

double ossimplugins::RefPoint::_pix_line
protected

Definition at line 82 of file RefPoint.h.

Referenced by get_pix_line(), loadState(), operator=(), saveState(), and set_pix_line().


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