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

#include <ossimEcefRay.h>

Public Member Functions

 ossimEcefRay ()
 
 ossimEcefRay (const ossimEcefRay &copy_this)
 
 ossimEcefRay (const ossimEcefPoint &origin, const ossimEcefVector &direction)
 
 ossimEcefRay (const ossimEcefPoint &from, const ossimEcefPoint &to)
 
 ossimEcefRay (const ossimGpt &from, const ossimGpt &to)
 
bool isNan () const
 
bool hasNans () const
 
void makeNan ()
 
const ossimEcefRayoperator= (const ossimEcefRay &r)
 
bool operator== (const ossimEcefRay &r) const
 
bool operator!= (const ossimEcefRay &r) const
 
const ossimEcefPointorigin () const
 
const ossimEcefVectordirection () const
 
void setOrigin (const ossimEcefPoint &orig)
 
void setDirection (const ossimEcefVector &d)
 
ossimEcefPoint extend (const double &t) const
 
ossimEcefRay reflectRay (const ossimEcefVector &normal) const
 
ossimEcefPoint intersectAboveEarthEllipsoid (const double &heightAboveEllipsoid, const ossimDatum *aDatum=ossimDatumFactory::instance() ->wgs84()) const
 
std::ostream & print (std::ostream &os=ossimNotify(ossimNotifyLevel_INFO)) const
 

Private Attributes

ossimEcefPoint theOrigin
 
ossimEcefVector theDirection
 

Friends

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

Detailed Description

Definition at line 35 of file ossimEcefRay.h.

Constructor & Destructor Documentation

◆ ossimEcefRay() [1/5]

ossimEcefRay::ossimEcefRay ( )
inline

CONSTRUCTORS:

Definition at line 41 of file ossimEcefRay.h.

Referenced by reflectRay().

41 {};

◆ ossimEcefRay() [2/5]

ossimEcefRay::ossimEcefRay ( const ossimEcefRay copy_this)
inline

Definition at line 43 of file ossimEcefRay.h.

44  : theOrigin(copy_this.theOrigin), theDirection(copy_this.theDirection) {}
ossimEcefVector theDirection
Definition: ossimEcefRay.h:115
ossimEcefPoint theOrigin
Definition: ossimEcefRay.h:114

◆ ossimEcefRay() [3/5]

ossimEcefRay::ossimEcefRay ( const ossimEcefPoint origin,
const ossimEcefVector direction 
)
inline

Definition at line 46 of file ossimEcefRay.h.

ossimEcefVector unitVector() const
const ossimEcefPoint & origin() const
Definition: ossimEcefRay.h:79
ossimEcefVector theDirection
Definition: ossimEcefRay.h:115
const ossimEcefVector & direction() const
Definition: ossimEcefRay.h:80
ossimEcefPoint theOrigin
Definition: ossimEcefRay.h:114

◆ ossimEcefRay() [4/5]

ossimEcefRay::ossimEcefRay ( const ossimEcefPoint from,
const ossimEcefPoint to 
)

Definition at line 50 of file ossimEcefRay.cpp.

References ossimEcefVector::normalize(), and theDirection.

52  : theOrigin(from)
53 {
54  ossimEcefVector ecef (to - from);
55  ecef.normalize();
56  theDirection = ecef;
57 }
ossimEcefVector theDirection
Definition: ossimEcefRay.h:115
ossimEcefPoint theOrigin
Definition: ossimEcefRay.h:114

◆ ossimEcefRay() [5/5]

ossimEcefRay::ossimEcefRay ( const ossimGpt from,
const ossimGpt to 
)

Definition at line 66 of file ossimEcefRay.cpp.

References ossimEcefVector::normalize(), and theDirection.

68  : theOrigin(from)
69 {
71  ecef.normalize();
72  theDirection = ecef;
73 }
ossimEcefVector theDirection
Definition: ossimEcefRay.h:115
ossimEcefPoint theOrigin
Definition: ossimEcefRay.h:114

Member Function Documentation

◆ direction()

const ossimEcefVector& ossimEcefRay::direction ( ) const
inline

Definition at line 80 of file ossimEcefRay.h.

80 { return theDirection; }
ossimEcefVector theDirection
Definition: ossimEcefRay.h:115

◆ extend()

ossimEcefPoint ossimEcefRay::extend ( const double &  t) const
inline

Extends the ray by distance t (meters) from the origin to the ECEF point returned.

Definition at line 152 of file ossimEcefRay.h.

References theDirection, and theOrigin.

153 {
154  return (theOrigin + theDirection*t);
155 }
ossimEcefVector theDirection
Definition: ossimEcefRay.h:115
ossimEcefPoint theOrigin
Definition: ossimEcefRay.h:114

◆ hasNans()

bool ossimEcefRay::hasNans ( ) const
inline

Definition at line 60 of file ossimEcefRay.h.

61  {
62  return theOrigin.isNan()||theDirection.isNan();
63  }
ossimEcefVector theDirection
Definition: ossimEcefRay.h:115
bool isNan() const
ossimEcefPoint theOrigin
Definition: ossimEcefRay.h:114
bool isNan() const

◆ intersectAboveEarthEllipsoid()

ossimEcefPoint ossimEcefRay::intersectAboveEarthEllipsoid ( const double &  heightAboveEllipsoid,
const ossimDatum aDatum = ossimDatumFactory::instance()->wgs84() 
) const

Intersects the ray with the given elevation above the earth ellipsoid.

Definition at line 82 of file ossimEcefRay.cpp.

References ossimDatum::ellipsoid(), ossimDatumFactory::instance(), ossimEcefPoint::makeNan(), ossimEllipsoid::nearestIntersection(), and ossimDatumFactory::wgs84().

Referenced by ossimAlphaSensor::lineSampleHeightToWorld(), ossimApplanixUtmModel::lineSampleHeightToWorld(), ossimPpjFrameSensor::lineSampleHeightToWorld(), ossimSpectraboticsRedEdgeModel::lineSampleHeightToWorld(), ossimApplanixEcefModel::lineSampleHeightToWorld(), ossimIpodSensor::lineSampleHeightToWorld(), ossimSkyBoxLearSensor::lineSampleHeightToWorld(), and ossimplugins::ossimFormosatModel::lineSampleHeightToWorld().

84 {
85  const ossimDatum* datum = argDatum;
86  if (!datum)
88 
89  //***
90  // Pass the call on to ellipsoid where intersection math is implemented:
91  //***
92  ossimEcefPoint solution;
93  bool intersected = datum->ellipsoid()->nearestIntersection
94  (*this, argHeight, solution);
95 
96  if (!intersected)
97  solution.makeNan();
98 
99  return solution;
100 }
virtual const ossimEllipsoid * ellipsoid() const
Definition: ossimDatum.h:60
static ossimDatumFactory * instance()
const ossimDatum * wgs84() const
bool nearestIntersection(const ossimEcefRay &ray, ossimEcefPoint &rtnPt) const

◆ isNan()

bool ossimEcefRay::isNan ( ) const
inline

Definition at line 56 of file ossimEcefRay.h.

57  {
58  return theOrigin.isNan()&&theDirection.isNan();
59  }
ossimEcefVector theDirection
Definition: ossimEcefRay.h:115
bool isNan() const
ossimEcefPoint theOrigin
Definition: ossimEcefRay.h:114
bool isNan() const

◆ makeNan()

void ossimEcefRay::makeNan ( )
inline

Definition at line 64 of file ossimEcefRay.h.

65  {
68  }
ossimEcefVector theDirection
Definition: ossimEcefRay.h:115
ossimEcefPoint theOrigin
Definition: ossimEcefRay.h:114

◆ operator!=()

bool ossimEcefRay::operator!= ( const ossimEcefRay r) const
inline

Definition at line 141 of file ossimEcefRay.h.

142 {
143  return !(*this == r);
144 }

◆ operator=()

const ossimEcefRay & ossimEcefRay::operator= ( const ossimEcefRay r)
inline

OPERATORS:

Definition at line 123 of file ossimEcefRay.h.

References theDirection, and theOrigin.

124 {
125  theOrigin = r.theOrigin;
127  return *this;
128 }
ossimEcefVector theDirection
Definition: ossimEcefRay.h:115
ossimEcefPoint theOrigin
Definition: ossimEcefRay.h:114

◆ operator==()

bool ossimEcefRay::operator== ( const ossimEcefRay r) const
inline

Definition at line 133 of file ossimEcefRay.h.

References theDirection, and theOrigin.

134 {
135  return ((theOrigin == r.theOrigin) && (theDirection == r.theDirection));
136 }
ossimEcefVector theDirection
Definition: ossimEcefRay.h:115
ossimEcefPoint theOrigin
Definition: ossimEcefRay.h:114

◆ origin()

const ossimEcefPoint& ossimEcefRay::origin ( ) const
inline

DATA ACCESS METHODS:

Definition at line 79 of file ossimEcefRay.h.

79 { return theOrigin; }
ossimEcefPoint theOrigin
Definition: ossimEcefRay.h:114

◆ print()

std::ostream & ossimEcefRay::print ( std::ostream &  os = ossimNotify(ossimNotifyLevel_INFO)) const

Debug Dump

Definition at line 102 of file ossimEcefRay.cpp.

References theDirection, and theOrigin.

Referenced by operator<<().

103 {
104  os << "(ossimEcefRay)\n"
105  << " theOrigin = " << theOrigin
106  << "\n theDirection = " << theDirection << std::endl;
107  return os;
108 }
ossimEcefVector theDirection
Definition: ossimEcefRay.h:115
ossimEcefPoint theOrigin
Definition: ossimEcefRay.h:114

◆ reflectRay()

ossimEcefRay ossimEcefRay::reflectRay ( const ossimEcefVector normal) const
inline

This method computes a ray with the same origin but a new direction corresponding to a reflection from some surface defined by its normal vector (assumed to be a unit vector):

Definition at line 165 of file ossimEcefRay.h.

References ossimEcefVector::dot(), ossimEcefRay(), theDirection, and theOrigin.

166 {
167  ossimEcefVector new_dir(theDirection - normal*2.0*normal.dot(theDirection));
168  return ossimEcefRay(theOrigin, new_dir);
169 }
double dot(const ossimEcefVector &) const
ossimEcefVector theDirection
Definition: ossimEcefRay.h:115
ossimEcefPoint theOrigin
Definition: ossimEcefRay.h:114

◆ setDirection()

void ossimEcefRay::setDirection ( const ossimEcefVector d)
inline

◆ setOrigin()

void ossimEcefRay::setOrigin ( const ossimEcefPoint orig)
inline

Friends And Related Function Documentation

◆ operator<<

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

Definition at line 110 of file ossimEcefRay.cpp.

112 {
113  return instance.print(os);
114 }
std::ostream & print(std::ostream &os=ossimNotify(ossimNotifyLevel_INFO)) const

Member Data Documentation

◆ theDirection

ossimEcefVector ossimEcefRay::theDirection
private

Definition at line 115 of file ossimEcefRay.h.

Referenced by extend(), operator=(), operator==(), ossimEcefRay(), print(), and reflectRay().

◆ theOrigin

ossimEcefPoint ossimEcefRay::theOrigin
private

Definition at line 114 of file ossimEcefRay.h.

Referenced by extend(), operator=(), operator==(), print(), and reflectRay().


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