OSSIM - Open Source Software Image Map  Version 1.9.0 (20180803)
ossimLsrPoint.h
Go to the documentation of this file.
1 //*******************************************************************
2 //
3 // License: See top level LICENSE.txt file.
4 //
5 // DESCRIPTION:
6 // Class for representing points in some local space rectangular (LSR)
7 // coordinate system. This coordinate system is related to the ECEF system
8 // by the ossimLsrSpace member object. This class simplifies coordinate
9 // conversions between LSR and ECEF, and other LSR points.
10 //
11 // SOFTWARE HISTORY:
12 //>
13 // 08Aug2001 Oscar Kramer (okramer@imagelinks.com)
14 // Initial coding.
15 //<
16 //*****************************************************************************
17 // $Id: ossimLsrPoint.h 22197 2013-03-12 02:00:55Z dburken $
18 
19 #ifndef ossimLsrPoint_HEADER
20 #define ossimLsrPoint_HEADER
21 
24 #include <ossim/base/ossimNotify.h>
25 
26 class ossimGpt;
27 class ossimLsrVector;
28 
29 //*****************************************************************************
30 // CLASS: ossimLsrPoint
31 //
32 //*****************************************************************************
34 {
35 public:
40  : theData(0,0,0) {}
41 
42  ossimLsrPoint(const ossimLsrPoint& copy_this)
43  : theData(copy_this.theData), theLsrSpace(copy_this.theLsrSpace) {}
44 
45  ossimLsrPoint(const ossimColumnVector3d& assign_this,
46  const ossimLsrSpace& space)
47  : theData(assign_this), theLsrSpace(space) {}
48 
49  ossimLsrPoint(const double& x,
50  const double& y,
51  const double& z,
52  const ossimLsrSpace& space)
53  : theData(x, y, z), theLsrSpace(space) {}
54 
55  ossimLsrPoint(const ossimLsrPoint& convert_this,
56  const ossimLsrSpace&);
57 
58  ossimLsrPoint(const ossimGpt& convert_this,
59  const ossimLsrSpace&);
60 
61  ossimLsrPoint(const ossimEcefPoint& convert_this,
62  const ossimLsrSpace&);
63 
67  inline const ossimLsrPoint& operator= (const ossimLsrPoint&); //inline below
70  inline bool operator==(const ossimLsrPoint&) const;//inline below
71  inline bool operator!=(const ossimLsrPoint&) const;//inline below
72 
79  operator ossimEcefPoint() const; // inline below
80 
84  double x() const { return theData[0]; }
85  double& x() { return theData[0]; }
86  double y() const { return theData[1]; }
87  double& y() { return theData[1]; }
88  double z() const { return theData[2]; }
89  double& z() { return theData[2]; }
90 
91 
92  ossimColumnVector3d& data() { return theData; }
93  const ossimColumnVector3d& data() const { return theData; }
94 
95  ossimLsrSpace& lsrSpace() { return theLsrSpace; }
96  const ossimLsrSpace& lsrSpace() const { return theLsrSpace; }
97 
98  bool hasNans()const
99  {
100  return (ossim::isnan(theData[0])||
101  ossim::isnan(theData[1])||
102  ossim::isnan(theData[2]));
103  }
104 
105  void makeNan()
106  {
107  theData[0] = ossim::nan();
108  theData[1] = ossim::nan();
109  theData[2] = ossim::nan();
110  }
114  inline void print(ostream& stream = ossimNotify(ossimNotifyLevel_INFO)) const;
115 
116  friend ostream& operator<< (ostream& os , const ossimLsrPoint& instance)
117  { instance.print(os); return os; }
118 
119 protected:
125  void initialize(const ossimEcefPoint& ecef_point);
126 
129 
130 };
131 
132 //================== BEGIN DEFINITIONS FOR INLINE METHODS =====================
133 
134 //*****************************************************************************
135 // INLINE OPERATOR: ossimLsrPoint::operator=(ossimLsrPoint)
136 //*****************************************************************************
137 inline const ossimLsrPoint&
139 {
140  theData = p.theData;
142 
143  return *this;
144 }
145 
146 //*****************************************************************************
147 // INLINE OPERATOR: ossimLsrPoint::operator==(ossimLsrPoint)
148 //*****************************************************************************
149 inline bool ossimLsrPoint::operator==(const ossimLsrPoint& p) const
150 {
151  return ((theData == p.theData) && (theLsrSpace == p.theLsrSpace));
152 }
153 
154 //*****************************************************************************
155 // INLINE OPERATOR: ossimLsrPoint::operator!=(ossimLsrPoint)
156 //*****************************************************************************
157 inline bool ossimLsrPoint::operator!=(const ossimLsrPoint& p) const
158 {
159  return (!(*this == p));
160 }
161 
162 //*****************************************************************************
163 // INLINE OPERATOR: ossimLsrPoint::operator ossimEcefPoint()
164 //
165 // Looks like a constructor for an ossimEcefPoint but is an operation on this
166 // object. Returns the ossimEcefPoint equivalent.
167 //*****************************************************************************
168 inline ossimLsrPoint::operator ossimEcefPoint() const
169 {
170  return ossimEcefPoint(theLsrSpace.origin().data() +
171  theLsrSpace.lsrToEcefRotMatrix()*theData);
172 }
173 
174 //*****************************************************************************
175 // INLINE METHOD: ossimLsrPoint::print(ostream)
176 //
177 // Dumps contents for debug purposes.
178 //*****************************************************************************
179 inline void ossimLsrPoint::print(ostream& os) const
180 {
181  os << "(ossimLsrPoint)\n"
182  << " theData = " << theData
183  << "\n theLsrSpace = " << theLsrSpace;
184 }
185 
186 #endif
187 
188 
ossim_uint32 x
double z() const
Definition: ossimLsrPoint.h:88
ossimRationalNumber operator-(ossim_int32 i, ossimRationalNumber &r)
#define OSSIMDLLEXPORT
bool operator!=(const ossimRefPtr< _Tp1 > &__a, const ossimRefPtr< _Tp2 > &__b) noexcept
Definition: ossimRefPtr.h:111
ossimLsrPoint(const ossimColumnVector3d &assign_this, const ossimLsrSpace &space)
Definition: ossimLsrPoint.h:45
ossim_uint32 y
double & y()
Definition: ossimLsrPoint.h:87
const ossimLsrPoint & operator=(const ossimLsrPoint &)
double nan()
Method to return ieee floating point double precision NAN.
Definition: ossimCommon.h:135
ossimLsrPoint(const ossimLsrPoint &copy_this)
Definition: ossimLsrPoint.h:42
std::ostream & print(H5::H5File *file, std::ostream &out)
Print method.
Definition: ossimH5Util.cpp:41
const ossimColumnVector3d & data() const
Definition: ossimLsrPoint.h:93
const ossimLsrSpace & lsrSpace() const
Definition: ossimLsrPoint.h:96
ostream & operator<<(ostream &out, const ossimAxes &axes)
Definition: ossimAxes.h:88
bool operator!=(const ossimLsrPoint &) const
double & z()
Definition: ossimLsrPoint.h:89
double x() const
Definition: ossimLsrPoint.h:84
void print(ostream &stream=ossimNotify(ossimNotifyLevel_INFO)) const
ossimColumnVector3d & data()
Definition: ossimLsrPoint.h:92
bool operator==(const ossimRefPtr< _Tp1 > &__a, const ossimRefPtr< _Tp2 > &__b) noexcept
Definition: ossimRefPtr.h:101
bool hasNans() const
Definition: ossimLsrPoint.h:98
bool operator==(const ossimLsrPoint &) const
ossimLsrSpace theLsrSpace
ossimLsrPoint(const double &x, const double &y, const double &z, const ossimLsrSpace &space)
Definition: ossimLsrPoint.h:49
ossimLsrSpace & lsrSpace()
Definition: ossimLsrPoint.h:95
ossimColumnVector3d theData
double y() const
Definition: ossimLsrPoint.h:86
double & x()
Definition: ossimLsrPoint.h:85
ossimRationalNumber operator+(ossim_int32 i, ossimRationalNumber &r)
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)
std::basic_ostream< char > ostream
Base class for char output streams.
Definition: ossimIosFwd.h:23
bool isnan(const float &v)
isnan Test for floating point Not A Number (NAN) value.
Definition: ossimCommon.h:91