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

#include <ossimLsrSpace.h>

Public Member Functions

 ossimLsrSpace ()
 
 ossimLsrSpace (const ossimLsrSpace &copy_this)
 
 ossimLsrSpace (const ossimEcefPoint &origin, const ossimEcefVector &x_dir_ecf_vec, const ossimEcefVector &y_dir_ecf_vec, const int z_not_provided_space_holder)
 
 ossimLsrSpace (const ossimEcefPoint &origin, const ossimEcefVector &x_dir_ecf_vec, const int y_not_provided_space_holder, const ossimEcefVector &z_dir_ecf_vec)
 
 ossimLsrSpace (const ossimEcefPoint &origin, const int x_not_provided_space_holder, const ossimEcefVector &y_dir_ecf_vec, const ossimEcefVector &z_dir_ecf_vec)
 
 ossimLsrSpace (const ossimGpt &origin, const double &y_azimuth=0)
 
 ossimLsrSpace (const ossimEcefPoint &origin, const NEWMAT::Matrix &lsrToEcfRot)
 
 ~ossimLsrSpace ()
 
bool operator== (const ossimLsrSpace &) const
 
bool operator!= (const ossimLsrSpace &that) const
 
const ossimLsrSpaceoperator= (const ossimLsrSpace &space)
 
const ossimEcefPointorigin () const
 
const NEWMAT::Matrix & lsrToEcefRotMatrix () const
 
NEWMAT::Matrix ecefToLsrRotMatrix () const
 
void print (ostream &stream=ossimNotify(ossimNotifyLevel_INFO)) const
 

Static Public Member Functions

static ostream & lsrSpaceErrorMessage (ostream &os=ossimNotify(ossimNotifyLevel_INFO))
 

Private Attributes

NEWMAT::Matrix theLsrToEcefRotMatrix
 
ossimEcefPoint theOrigin
 

Friends

ostream & operator<< (ostream &os, const ossimLsrSpace &instance)
 

Detailed Description

Definition at line 36 of file ossimLsrSpace.h.

Constructor & Destructor Documentation

◆ ossimLsrSpace() [1/7]

ossimLsrSpace::ossimLsrSpace ( )
inline

DEFAULT & COPY CONSTRUCTOR:

Definition at line 42 of file ossimLsrSpace.h.

42 {}

◆ ossimLsrSpace() [2/7]

ossimLsrSpace::ossimLsrSpace ( const ossimLsrSpace copy_this)
inline

Definition at line 44 of file ossimLsrSpace.h.

45  :
47  theOrigin(copy_this.theOrigin) {}
ossimEcefPoint theOrigin
NEWMAT::Matrix theLsrToEcefRotMatrix

◆ ossimLsrSpace() [3/7]

ossimLsrSpace::ossimLsrSpace ( const ossimEcefPoint origin,
const ossimEcefVector x_dir_ecf_vec,
const ossimEcefVector y_dir_ecf_vec,
const int  z_not_provided_space_holder 
)

CONSTRUCTORS: The following three constructors accept an ECEF origin and two of the three axes direction vectors. Note the use of the dummy "int" argument (not used) to hold the place of the unspecified axes.

Definition at line 31 of file ossimLsrSpace.cpp.

References ossimMatrix3x3::create(), ossimEcefVector::data(), theLsrToEcefRotMatrix, and ossimColumnVector3d::unit().

35  : theOrigin (origin)
36 {
37  //***
38  // Compute the remaining axis given first two:
39  //***
40  ossimColumnVector3d xdir (x_dir_ecf_vec.data().unit());
41  ossimColumnVector3d ydir (y_dir_ecf_vec.data().unit());
42  ossimColumnVector3d zdir (xdir.cross(ydir));
43 
44  //***
45  // Fill the rotation matrix:
46  //***
47  theLsrToEcefRotMatrix = ossimMatrix3x3::create(xdir[0], ydir[0], zdir[0],
48  xdir[1], ydir[1], zdir[1],
49  xdir[2], ydir[2], zdir[2]);
50 }
ossimColumnVector3d unit() const
static NEWMAT::Matrix create()
const ossimEcefPoint & origin() const
ossimEcefPoint theOrigin
const ossimColumnVector3d & data() const
NEWMAT::Matrix theLsrToEcefRotMatrix

◆ ossimLsrSpace() [4/7]

ossimLsrSpace::ossimLsrSpace ( const ossimEcefPoint origin,
const ossimEcefVector x_dir_ecf_vec,
const int  y_not_provided_space_holder,
const ossimEcefVector z_dir_ecf_vec 
)

Definition at line 59 of file ossimLsrSpace.cpp.

References ossimMatrix3x3::create(), ossimEcefVector::data(), theLsrToEcefRotMatrix, and ossimColumnVector3d::unit().

63  : theOrigin (origin)
64 {
65  //***
66  // Compute the remaining axis given first two:
67  //***
68  ossimColumnVector3d xdir (x_dir_ecf_vec.data().unit());
69  ossimColumnVector3d zdir (z_dir_ecf_vec.data().unit());
70  ossimColumnVector3d ydir (zdir.cross(xdir));
71 
72  //***
73  // Fill the rotation matrix:
74  //***
75  theLsrToEcefRotMatrix = ossimMatrix3x3::create(xdir[0], ydir[0], zdir[0],
76  xdir[1], ydir[1], zdir[1],
77  xdir[2], ydir[2], zdir[2]);
78 }
ossimColumnVector3d unit() const
static NEWMAT::Matrix create()
const ossimEcefPoint & origin() const
ossimEcefPoint theOrigin
const ossimColumnVector3d & data() const
NEWMAT::Matrix theLsrToEcefRotMatrix

◆ ossimLsrSpace() [5/7]

ossimLsrSpace::ossimLsrSpace ( const ossimEcefPoint origin,
const int  x_not_provided_space_holder,
const ossimEcefVector y_dir_ecf_vec,
const ossimEcefVector z_dir_ecf_vec 
)

Definition at line 87 of file ossimLsrSpace.cpp.

References ossimMatrix3x3::create(), ossimEcefVector::data(), theLsrToEcefRotMatrix, and ossimColumnVector3d::unit().

91  : theOrigin (origin)
92 {
93  //***
94  // Compute the remaining axis given first two:
95  //***
96  ossimColumnVector3d ydir (y_dir_ecf_vec.data().unit());
97  ossimColumnVector3d zdir (z_dir_ecf_vec.data().unit());
98  ossimColumnVector3d xdir (ydir.cross(zdir));
99 
100  //***
101  // Fill the rotation matrix:
102  //***
103  theLsrToEcefRotMatrix = ossimMatrix3x3::create(xdir[0], ydir[0], zdir[0],
104  xdir[1], ydir[1], zdir[1],
105  xdir[2], ydir[2], zdir[2]);
106 }
ossimColumnVector3d unit() const
static NEWMAT::Matrix create()
const ossimEcefPoint & origin() const
ossimEcefPoint theOrigin
const ossimColumnVector3d & data() const
NEWMAT::Matrix theLsrToEcefRotMatrix

◆ ossimLsrSpace() [6/7]

ossimLsrSpace::ossimLsrSpace ( const ossimGpt origin,
const double &  y_azimuth = 0 
)

CONSTRUCTOR: ossimLsrSpace(ossimGpt, y_azimuth) This constructor sets up a local coordinate system centered at the specified groundpoint, with the Z-axis normal to the ellipsoid and the Y-axis rotated clockwise from north by the y_azimuth. This angle defaults to 0, producing an East-North-Up (ENU) system.

Definition at line 117 of file ossimLsrSpace.cpp.

References abs, ossim::cosd(), ossimMatrix3x3::create(), ossimColumnVector3d::cross(), FLT_EPSILON, origin(), ossim::sind(), theLsrToEcefRotMatrix, and theOrigin.

119 {
120  //***
121  // Convert ground point origin to ECEF coordinates:
122  //***
124 
125  //***
126  // Establish the component vectors for ENU system::
127  //***
128  double sin_lat = ossim::sind(origin.lat);
129  double cos_lat = ossim::cosd(origin.lat);
130  double sin_lon = ossim::sind(origin.lon);
131  double cos_lon = ossim::cosd(origin.lon);
132 
133  ossimColumnVector3d E (-sin_lon,
134  cos_lon,
135  0.0);
136  ossimColumnVector3d N (-sin_lat*cos_lon,
137  -sin_lat*sin_lon,
138  cos_lat);
139  ossimColumnVector3d U (E.cross(N));
140 
141  //
142  // Fill rotation matrix with these components, rotated about the Z axis
143  // by the azimuth indicated:
144  //
145  if (std::abs(y_azimuth) > FLT_EPSILON)
146  {
147  double cos_azim = ossim::cosd(y_azimuth);
148  double sin_azim = ossim::sind(y_azimuth);
149  ossimColumnVector3d X (cos_azim*E - sin_azim*N);
150  ossimColumnVector3d Y (sin_azim*E + cos_azim*N);
151  ossimColumnVector3d Z (X.cross(Y));
152 
154  = ossimMatrix3x3::create(X[0], Y[0], Z[0],
155  X[1], Y[1], Z[1],
156  X[2], Y[2], Z[2]);
157  }
158  else
159  {
160  //***
161  // No azimuth rotation, so simplify:
162  //***
164  E[1], N[1], U[1],
165  E[2], N[2], U[2]);
166  }
167 }
double sind(double x)
Definition: ossimCommon.h:260
#define abs(a)
Definition: auxiliary.h:74
#define FLT_EPSILON
static NEWMAT::Matrix create()
double cosd(double x)
Definition: ossimCommon.h:259
const ossimEcefPoint & origin() const
ossimEcefPoint theOrigin
NEWMAT::Matrix theLsrToEcefRotMatrix

◆ ossimLsrSpace() [7/7]

ossimLsrSpace::ossimLsrSpace ( const ossimEcefPoint origin,
const NEWMAT::Matrix &  lsrToEcfRot 
)
inline

CONSTRUCTOR: ossimLsrSpace(ossimEcefPt, NEWMAT::Matrix) This constructor sets up a local coordinate system centered at the specified ECF, with given LSR-to-ECF rotation.

Definition at line 84 of file ossimLsrSpace.h.

86  : theLsrToEcefRotMatrix (lsrToEcfRot), theOrigin (origin) {}
const ossimEcefPoint & origin() const
ossimEcefPoint theOrigin
NEWMAT::Matrix theLsrToEcefRotMatrix

◆ ~ossimLsrSpace()

ossimLsrSpace::~ossimLsrSpace ( )
inline

Definition at line 88 of file ossimLsrSpace.h.

88 {}

Member Function Documentation

◆ ecefToLsrRotMatrix()

NEWMAT::Matrix ossimLsrSpace::ecefToLsrRotMatrix ( ) const
inline

◆ lsrSpaceErrorMessage()

ostream & ossimLsrSpace::lsrSpaceErrorMessage ( ostream &  os = ossimNotify(ossimNotifyLevel_INFO))
static

METHOD: lsrSpaceErrorMessage() Convenience method accessible to all owners of an ossimLsrSpace for displaying an error message when LSR spaces do not match between objects. All operations between LSR objects must be in a common space.

Definition at line 201 of file ossimLsrSpace.cpp.

Referenced by ossimLsrVector::angleTo(), ossimLsrVector::cross(), ossimLsrVector::dot(), ossimLsrVector::operator+(), ossimLsrPoint::operator+(), ossimLsrPoint::operator-(), and ossimLsrVector::operator-().

202 {
203  os<<"ossimLsrSpace ERROR: An operation was attempted between two LSR \n"
204  <<" objects with differing LSR spaces. This is an illegal condition.\n"
205  <<" Please check the data and/or report the error to OSSIM development."
206  << std::endl;
207 
208  return os;
209 }

◆ lsrToEcefRotMatrix()

const NEWMAT::Matrix& ossimLsrSpace::lsrToEcefRotMatrix ( ) const
inline

◆ operator!=()

bool ossimLsrSpace::operator!= ( const ossimLsrSpace that) const
inline

Definition at line 95 of file ossimLsrSpace.h.

96  { return !(*this == that); }

◆ operator=()

const ossimLsrSpace & ossimLsrSpace::operator= ( const ossimLsrSpace space)

Definition at line 186 of file ossimLsrSpace.cpp.

References theLsrToEcefRotMatrix, and theOrigin.

187 {
188  theOrigin = space.theOrigin;
190  return *this;
191 }
ossimEcefPoint theOrigin
NEWMAT::Matrix theLsrToEcefRotMatrix

◆ operator==()

bool ossimLsrSpace::operator== ( const ossimLsrSpace that) const

OPERATORS:

Definition at line 172 of file ossimLsrSpace.cpp.

References origin(), theLsrToEcefRotMatrix, and theOrigin.

173 {
174  if (theOrigin != that.origin())
175  return false;
176 
178  return false;
179 
180  return true;
181 }
const ossimEcefPoint & origin() const
ossimEcefPoint theOrigin
NEWMAT::Matrix theLsrToEcefRotMatrix

◆ origin()

const ossimEcefPoint& ossimLsrSpace::origin ( ) const
inline

DATA ACCESS METHODS:

Definition at line 103 of file ossimLsrSpace.h.

Referenced by ossimLsrPoint::initialize(), operator==(), and ossimLsrSpace().

103 { return theOrigin; }
ossimEcefPoint theOrigin

◆ print()

void ossimLsrSpace::print ( ostream &  stream = ossimNotify(ossimNotifyLevel_INFO)) const

Debug Dump:

Definition at line 217 of file ossimLsrSpace.cpp.

References theLsrToEcefRotMatrix, and theOrigin.

218 {
219  stream << "(ossimLsrSpace)"
220  << "\n theOrigin = " << theOrigin
221  << "\n theLsrToEcefRotMatrix = \n" << theLsrToEcefRotMatrix << std::endl;
222 }
ossimEcefPoint theOrigin
NEWMAT::Matrix theLsrToEcefRotMatrix

Friends And Related Function Documentation

◆ operator<<

ostream& operator<< ( ostream &  os,
const ossimLsrSpace instance 
)
friend

Definition at line 122 of file ossimLsrSpace.h.

123  { instance.print(os); return os; }
void print(ostream &stream=ossimNotify(ossimNotifyLevel_INFO)) const

Member Data Documentation

◆ theLsrToEcefRotMatrix

NEWMAT::Matrix ossimLsrSpace::theLsrToEcefRotMatrix
private

Definition at line 126 of file ossimLsrSpace.h.

Referenced by operator=(), operator==(), ossimLsrSpace(), and print().

◆ theOrigin

ossimEcefPoint ossimLsrSpace::theOrigin
private

Definition at line 127 of file ossimLsrSpace.h.

Referenced by operator=(), operator==(), ossimLsrSpace(), and print().


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