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

#include <ossimLsrVector.h>

Public Member Functions

 ossimLsrVector ()
 
 ossimLsrVector (const ossimLsrVector &copy_this)
 
 ossimLsrVector (const ossimColumnVector3d &assign_this, const ossimLsrSpace &space)
 
 ossimLsrVector (const double &x, const double &y, const double &z, const ossimLsrSpace &space)
 
 ossimLsrVector (const ossimEcefVector &convert_this, const ossimLsrSpace &)
 
 ossimLsrVector (const ossimLsrVector &convert_this, const ossimLsrSpace &)
 
const ossimLsrVectoroperator= (const ossimLsrVector &)
 
ossimLsrVector operator- () const
 
ossimLsrVector operator+ (const ossimLsrVector &) const
 
ossimLsrVector operator- (const ossimLsrVector &) const
 
ossimLsrPoint operator+ (const ossimLsrPoint &) const
 
ossimLsrVector operator* (const double &scalar) const
 
ossimLsrVector operator/ (const double &scalar) const
 
bool operator== (const ossimLsrVector &) const
 
bool operator!= (const ossimLsrVector &) const
 
 operator ossimEcefVector () const
 
double dot (const ossimLsrVector &) const
 
double angleTo (const ossimLsrVector &) const
 
ossimLsrVector cross (const ossimLsrVector &) const
 
ossimLsrVector unitVector () const
 
double magnitude () const
 
void normalize ()
 
double x () const
 
double & x ()
 
double y () const
 
double & y ()
 
double z () const
 
double & z ()
 
bool hasNans () const
 
void makeNan ()
 
ossimColumnVector3ddata ()
 
const ossimColumnVector3ddata () const
 
ossimLsrSpacelsrSpace ()
 
const ossimLsrSpacelsrSpace () const
 
std::ostream & print (ostream &stream) const
 

Protected Member Functions

void initialize (const ossimEcefVector &ecef_point)
 

Protected Attributes

ossimColumnVector3d theData
 
ossimLsrSpace theLsrSpace
 

Friends

std::ostream & operator<< (std::ostream &os, const ossimLsrVector &instance)
 

Detailed Description

Definition at line 36 of file ossimLsrVector.h.

Constructor & Destructor Documentation

◆ ossimLsrVector() [1/6]

ossimLsrVector::ossimLsrVector ( )
inline

CONSTRUCTORS:

Definition at line 42 of file ossimLsrVector.h.

Referenced by cross(), operator*(), operator+(), operator-(), operator/(), and unitVector().

43  : theData (0,0,0) {}
ossimColumnVector3d theData

◆ ossimLsrVector() [2/6]

ossimLsrVector::ossimLsrVector ( const ossimLsrVector copy_this)
inline

Definition at line 45 of file ossimLsrVector.h.

46  : theData(copy_this.theData), theLsrSpace(copy_this.theLsrSpace) {}
ossimLsrSpace theLsrSpace
ossimColumnVector3d theData

◆ ossimLsrVector() [3/6]

ossimLsrVector::ossimLsrVector ( const ossimColumnVector3d assign_this,
const ossimLsrSpace space 
)
inline

Definition at line 48 of file ossimLsrVector.h.

50  : theData(assign_this), theLsrSpace(space) {}
ossimLsrSpace theLsrSpace
ossimColumnVector3d theData

◆ ossimLsrVector() [4/6]

ossimLsrVector::ossimLsrVector ( const double &  x,
const double &  y,
const double &  z,
const ossimLsrSpace space 
)
inline

Definition at line 52 of file ossimLsrVector.h.

56  : theData(x,y,z), theLsrSpace(space) {}
double z() const
double x() const
ossimLsrSpace theLsrSpace
ossimColumnVector3d theData
double y() const

◆ ossimLsrVector() [5/6]

ossimLsrVector::ossimLsrVector ( const ossimEcefVector convert_this,
const ossimLsrSpace new_space 
)

Definition at line 27 of file ossimLsrVector.cpp.

References initialize().

29  : theLsrSpace (new_space)
30 {
31  initialize(convert_this);
32 }
void initialize(const ossimEcefVector &ecef_point)
ossimLsrSpace theLsrSpace

◆ ossimLsrVector() [6/6]

ossimLsrVector::ossimLsrVector ( const ossimLsrVector convert_this,
const ossimLsrSpace new_space 
)

Definition at line 41 of file ossimLsrVector.cpp.

References initialize().

43  : theLsrSpace (new_space)
44 {
45  initialize(ossimEcefVector(convert_this));
46 }
void initialize(const ossimEcefVector &ecef_point)
ossimLsrSpace theLsrSpace

Member Function Documentation

◆ angleTo()

double ossimLsrVector::angleTo ( const ossimLsrVector v) const

Definition at line 70 of file ossimLsrVector.cpp.

References ossim::acosd(), ossimColumnVector3d::dot(), hasNans(), ossimLsrSpace::lsrSpaceErrorMessage(), ossimColumnVector3d::magnitude(), ossim::nan(), theData, and theLsrSpace.

71 {
72  if(hasNans()||v.hasNans()||(theLsrSpace != v.theLsrSpace))
73  {
75  return ossim::nan();
76  }
77  double mag_product = theData.magnitude() * v.theData.magnitude();
78  return ossim::acosd(theData.dot(v.theData)/mag_product);
79 }
static ostream & lsrSpaceErrorMessage(ostream &os=ossimNotify(ossimNotifyLevel_INFO))
double dot(const ossimColumnVector3d &rhs) const
double nan()
Method to return ieee floating point double precision NAN.
Definition: ossimCommon.h:135
double acosd(double x)
Definition: ossimCommon.h:264
bool hasNans() const
ossimLsrSpace theLsrSpace
ossimColumnVector3d theData

◆ cross()

ossimLsrVector ossimLsrVector::cross ( const ossimLsrVector v) const

Definition at line 87 of file ossimLsrVector.cpp.

References ossimColumnVector3d::cross(), data(), hasNans(), ossimLsrSpace::lsrSpaceErrorMessage(), ossim::nan(), ossimLsrVector(), theData, and theLsrSpace.

88 {
89  if(hasNans()||v.hasNans()||(theLsrSpace != v.theLsrSpace))
90  {
93  theLsrSpace);
94  }
96 }
static ostream & lsrSpaceErrorMessage(ostream &os=ossimNotify(ossimNotifyLevel_INFO))
ossimColumnVector3d cross(const ossimColumnVector3d &rhs) const
double nan()
Method to return ieee floating point double precision NAN.
Definition: ossimCommon.h:135
ossimColumnVector3d & data()
bool hasNans() const
ossimLsrSpace theLsrSpace
ossimColumnVector3d theData

◆ data() [1/2]

ossimColumnVector3d& ossimLsrVector::data ( )
inline

Definition at line 116 of file ossimLsrVector.h.

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

116 { return theData; }
ossimColumnVector3d theData

◆ data() [2/2]

const ossimColumnVector3d& ossimLsrVector::data ( ) const
inline

Definition at line 117 of file ossimLsrVector.h.

117 { return theData; }
ossimColumnVector3d theData

◆ dot()

double ossimLsrVector::dot ( const ossimLsrVector v) const

Vector-related functions:

Definition at line 54 of file ossimLsrVector.cpp.

References data(), ossimColumnVector3d::dot(), hasNans(), ossimLsrSpace::lsrSpaceErrorMessage(), ossim::nan(), theData, and theLsrSpace.

55 {
56  if(hasNans()||v.hasNans()||(theLsrSpace != v.theLsrSpace))
57  {
59  return ossim::nan();
60  }
61  return theData.dot(v.data());
62 }
static ostream & lsrSpaceErrorMessage(ostream &os=ossimNotify(ossimNotifyLevel_INFO))
double dot(const ossimColumnVector3d &rhs) const
double nan()
Method to return ieee floating point double precision NAN.
Definition: ossimCommon.h:135
ossimColumnVector3d & data()
bool hasNans() const
ossimLsrSpace theLsrSpace
ossimColumnVector3d theData

◆ hasNans()

bool ossimLsrVector::hasNans ( ) const
inline

Definition at line 104 of file ossimLsrVector.h.

References ossim::isnan().

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

105  {
106  return (ossim::isnan(theData[0])||
107  ossim::isnan(theData[1])||
108  ossim::isnan(theData[2]));
109  }
ossimColumnVector3d theData
bool isnan(const float &v)
isnan Test for floating point Not A Number (NAN) value.
Definition: ossimCommon.h:91

◆ initialize()

void ossimLsrVector::initialize ( const ossimEcefVector ecef_point)
inlineprotected

METHOD: initialize(ossimEcefVector) Convenience method used by several constructors for initializing theData given an ECEF vector. Assumes theLsrSpace has been previously initialized

Definition at line 284 of file ossimLsrVector.h.

References ossimEcefVector::data(), ossimLsrSpace::ecefToLsrRotMatrix(), theData, and theLsrSpace.

Referenced by ossimLsrVector().

285 {
286  theData = theLsrSpace.ecefToLsrRotMatrix() * ecef_vector.data();
287 }
ossimLsrSpace theLsrSpace
NEWMAT::Matrix ecefToLsrRotMatrix() const
ossimColumnVector3d theData

◆ lsrSpace() [1/2]

ossimLsrSpace& ossimLsrVector::lsrSpace ( )
inline

Definition at line 119 of file ossimLsrVector.h.

Referenced by ossimLsrPoint::operator+(), and ossimLsrRay::ossimLsrRay().

119 { return theLsrSpace; }
ossimLsrSpace theLsrSpace

◆ lsrSpace() [2/2]

const ossimLsrSpace& ossimLsrVector::lsrSpace ( ) const
inline

Definition at line 120 of file ossimLsrVector.h.

120 { return theLsrSpace; }
ossimLsrSpace theLsrSpace

◆ magnitude()

double ossimLsrVector::magnitude ( ) const
inline

Definition at line 262 of file ossimLsrVector.h.

References hasNans(), ossimColumnVector3d::magnitude(), ossim::nan(), and theData.

263 {
264  if(hasNans()) return ossim::nan();
265  return theData.magnitude();
266 }
double nan()
Method to return ieee floating point double precision NAN.
Definition: ossimCommon.h:135
bool hasNans() const
ossimColumnVector3d theData

◆ makeNan()

void ossimLsrVector::makeNan ( )
inline

Definition at line 110 of file ossimLsrVector.h.

References ossim::nan().

111  {
112  theData[0] = ossim::nan();
113  theData[1] = ossim::nan();
114  theData[2] = ossim::nan();
115  }
double nan()
Method to return ieee floating point double precision NAN.
Definition: ossimCommon.h:135
ossimColumnVector3d theData

◆ normalize()

void ossimLsrVector::normalize ( )
inline

Definition at line 272 of file ossimLsrVector.h.

References ossimColumnVector3d::magnitude(), and theData.

Referenced by ossimLsrRay::ossimLsrRay().

273 {
275 }
ossimColumnVector3d theData

◆ operator ossimEcefVector()

ossimLsrVector::operator ossimEcefVector ( ) const
inline

CASTING OPERATOR: Used as: myEcefVector = ossimEcefVector(this) – looks like a constructor but is an operation on this object. ECEF knows nothing about LSR, so cannot provide an ossimEcefVector(ossimLsrVector) constructor.

Definition at line 243 of file ossimLsrVector.h.

244 {
246 }
const NEWMAT::Matrix & lsrToEcefRotMatrix() const
ossimLsrSpace theLsrSpace
ossimColumnVector3d theData

◆ operator!=()

bool ossimLsrVector::operator!= ( const ossimLsrVector v) const
inline

Definition at line 231 of file ossimLsrVector.h.

232 {
233  return (!(*this == v));
234 }

◆ operator*()

ossimLsrVector ossimLsrVector::operator* ( const double &  scalar) const
inline

Definition at line 207 of file ossimLsrVector.h.

References ossimLsrVector(), theData, and theLsrSpace.

208 {
209  return ossimLsrVector(theData*scalar, theLsrSpace);
210 }
ossimLsrSpace theLsrSpace
ossimColumnVector3d theData

◆ operator+() [1/2]

ossimLsrVector ossimLsrVector::operator+ ( const ossimLsrVector v) const
inline

Definition at line 167 of file ossimLsrVector.h.

References hasNans(), ossimLsrSpace::lsrSpaceErrorMessage(), ossim::nan(), ossimLsrVector(), theData, and theLsrSpace.

168 {
169  if ((theLsrSpace != v.theLsrSpace)||hasNans()||v.hasNans())
170  {
173  }
175 
176 }
static ostream & lsrSpaceErrorMessage(ostream &os=ossimNotify(ossimNotifyLevel_INFO))
double nan()
Method to return ieee floating point double precision NAN.
Definition: ossimCommon.h:135
bool hasNans() const
ossimLsrSpace theLsrSpace
ossimColumnVector3d theData

◆ operator+() [2/2]

ossimLsrPoint ossimLsrVector::operator+ ( const ossimLsrPoint p) const
inline

Definition at line 194 of file ossimLsrVector.h.

References ossimLsrPoint::data(), ossimLsrPoint::hasNans(), hasNans(), ossimLsrPoint::lsrSpace(), ossimLsrSpace::lsrSpaceErrorMessage(), ossim::nan(), theData, and theLsrSpace.

195 {
196  if ((theLsrSpace != p.lsrSpace())||hasNans()||p.hasNans())
197  {
200  }
201  return ossimLsrPoint(theData + p.data(), theLsrSpace);
202 }
static ostream & lsrSpaceErrorMessage(ostream &os=ossimNotify(ossimNotifyLevel_INFO))
double nan()
Method to return ieee floating point double precision NAN.
Definition: ossimCommon.h:135
bool hasNans() const
ossimColumnVector3d & data()
Definition: ossimLsrPoint.h:92
ossimLsrSpace theLsrSpace
bool hasNans() const
Definition: ossimLsrPoint.h:98
ossimColumnVector3d theData
ossimLsrSpace & lsrSpace()
Definition: ossimLsrPoint.h:95

◆ operator-() [1/2]

ossimLsrVector ossimLsrVector::operator- ( ) const
inline

Definition at line 159 of file ossimLsrVector.h.

References ossimLsrVector(), theData, and theLsrSpace.

160 {
162 }
ossimLsrSpace theLsrSpace
ossimColumnVector3d theData

◆ operator-() [2/2]

ossimLsrVector ossimLsrVector::operator- ( const ossimLsrVector v) const
inline

Definition at line 181 of file ossimLsrVector.h.

References data(), hasNans(), ossimLsrSpace::lsrSpaceErrorMessage(), ossim::nan(), ossimLsrVector(), theData, and theLsrSpace.

182 {
183  if ((theLsrSpace != v.theLsrSpace)||hasNans()||v.hasNans())
184  {
187  }
188  return ossimLsrVector(theData - v.data(), theLsrSpace);
189 }
static ostream & lsrSpaceErrorMessage(ostream &os=ossimNotify(ossimNotifyLevel_INFO))
double nan()
Method to return ieee floating point double precision NAN.
Definition: ossimCommon.h:135
ossimColumnVector3d & data()
bool hasNans() const
ossimLsrSpace theLsrSpace
ossimColumnVector3d theData

◆ operator/()

ossimLsrVector ossimLsrVector::operator/ ( const double &  scalar) const
inline

Definition at line 215 of file ossimLsrVector.h.

References ossimLsrVector(), theData, and theLsrSpace.

216 {
217  return ossimLsrVector(theData/scalar, theLsrSpace);
218 }
ossimLsrSpace theLsrSpace
ossimColumnVector3d theData

◆ operator=()

const ossimLsrVector & ossimLsrVector::operator= ( const ossimLsrVector v)
inline

OPERATORS: (all methods inlined below)

Definition at line 148 of file ossimLsrVector.h.

References theData, and theLsrSpace.

149 {
150  theData = v.theData;
152 
153  return *this;
154 }
ossimLsrSpace theLsrSpace
ossimColumnVector3d theData

◆ operator==()

bool ossimLsrVector::operator== ( const ossimLsrVector v) const
inline

Definition at line 223 of file ossimLsrVector.h.

References theData, and theLsrSpace.

224 {
225  return ((theData == v.theData) && (theLsrSpace == v.theLsrSpace));
226 }
ossimLsrSpace theLsrSpace
ossimColumnVector3d theData

◆ print()

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

Debug Dump:

Definition at line 98 of file ossimLsrVector.cpp.

References theData, and theLsrSpace.

Referenced by operator<<().

99 {
100  os << "(ossimLsrVector)\n"
101  << " theData = " << theData
102  << "\n theLsrSpace = " << theLsrSpace;
103  return os;
104 }
ossimLsrSpace theLsrSpace
ossimColumnVector3d theData

◆ unitVector()

ossimLsrVector ossimLsrVector::unitVector ( ) const
inline

Definition at line 252 of file ossimLsrVector.h.

References hasNans(), ossimColumnVector3d::magnitude(), ossim::nan(), ossimLsrVector(), theData, and theLsrSpace.

253 {
255 
257 }
double nan()
Method to return ieee floating point double precision NAN.
Definition: ossimCommon.h:135
bool hasNans() const
ossimLsrSpace theLsrSpace
ossimColumnVector3d theData

◆ x() [1/2]

double ossimLsrVector::x ( ) const
inline

DATA ACCESS METHODS:

Definition at line 97 of file ossimLsrVector.h.

97 { return theData[0]; }
ossimColumnVector3d theData

◆ x() [2/2]

double& ossimLsrVector::x ( )
inline

Definition at line 98 of file ossimLsrVector.h.

98 { return theData[0]; }
ossimColumnVector3d theData

◆ y() [1/2]

double ossimLsrVector::y ( ) const
inline

Definition at line 99 of file ossimLsrVector.h.

99 { return theData[1]; }
ossimColumnVector3d theData

◆ y() [2/2]

double& ossimLsrVector::y ( )
inline

Definition at line 100 of file ossimLsrVector.h.

100 { return theData[1]; }
ossimColumnVector3d theData

◆ z() [1/2]

double ossimLsrVector::z ( ) const
inline

Definition at line 101 of file ossimLsrVector.h.

101 { return theData[2]; }
ossimColumnVector3d theData

◆ z() [2/2]

double& ossimLsrVector::z ( )
inline

Definition at line 102 of file ossimLsrVector.h.

102 { return theData[2]; }
ossimColumnVector3d theData

Friends And Related Function Documentation

◆ operator<<

std::ostream& operator<< ( std::ostream &  os,
const ossimLsrVector instance 
)
friend

Definition at line 106 of file ossimLsrVector.cpp.

108 {
109  return instance.print(os);
110 }
std::ostream & print(ostream &stream) const

Member Data Documentation

◆ theData

ossimColumnVector3d ossimLsrVector::theData
protected

◆ theLsrSpace

ossimLsrSpace ossimLsrVector::theLsrSpace
protected

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