OSSIM - Open Source Software Image Map  Version 1.9.0 (20180803)
ossimLsrRay.cpp
Go to the documentation of this file.
1 //*******************************************************************
2 //
3 // License: See top level LICENSE.txt file.
4 //
5 // DESCRIPTION:
6 // Class for representing rays 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 spaces.
10 //
11 // An LSR ray is defined as having an LSR origin point and an LSR unit
12 // direction vector radiating from the origin.
13 //
14 // SOFTWARE HISTORY:
15 //>
16 // 08Aug2001 Oscar Kramer (okramer@imagelinks.com)
17 // Initial coding.
18 //<
19 //*****************************************************************************
20 // $Log$
21 // Revision 1.8 2006/11/28 21:09:36 gpotts
22 // Fixing copyrights
23 //
24 // Revision 1.7 2006/06/13 19:10:52 dburken
25 // Global include path change.
26 //
27 // Revision 1.6 2004/04/08 15:25:30 gpotts
28 // *** empty log message ***
29 //
30 // Revision 1.5 2004/04/08 14:12:39 gpotts
31 // Fixe clog to ossimNotify
32 //
33 // Revision 1.4 2002/10/21 21:51:46 gpotts
34 // *** empty log message ***
35 //
36 // Revision 1.3 2002/10/21 21:51:26 gpotts
37 // *** empty log message ***
38 //
39 // Revision 1.2 2001/12/20 22:26:41 bpayne
40 // Added constructor accepting two ossimLsrPoint args
41 //
42 // Revision 1.1 2001/08/13 21:29:18 okramer
43 // Initial delivery of ECEF and LSR suite. (okramer@imagelinks.com)
44 //
45 
46 #include <ossim/base/ossimLsrRay.h>
47 
48 //*****************************************************************************
49 // CONSTRUCTOR: ossimLsrRay(ossimLsrPoint, ossimLsrVector)
50 //
51 // Constructs by transforming the given ray into the new space.
52 //
53 //*****************************************************************************
55  const ossimLsrVector& direction)
56  : theOrigin(origin),
57  theDirection(direction.unitVector())
58 {
59  if (origin.lsrSpace() != direction.lsrSpace() || hasNans())
60  {
61  ossimNotify(ossimNotifyLevel_FATAL) << "FATAL -- ossimLsrRay(ossimLsrPoint,ossimLsrVector) Constructor:"
62  << "\n The origin and direction LSR quantities do not share the"
63  << "\n same LSR space. Setting to NAN. Check the data for errors." << std::endl;
64 
66  origin.lsrSpace());
69  }
70 }
71 
72 //*****************************************************************************
73 // CONSTRUCTOR: ossimLsrRay(ossimLsrPoint, ossimLsrPoint)
74 //
75 // Constructs by transforming the given ray into the new space.
76 //
77 //*****************************************************************************
79  const ossimLsrPoint& towards)
80  : theOrigin(origin)
81 {
82  if ((origin.lsrSpace() != towards.lsrSpace())||
83  origin.hasNans()||
84  towards.hasNans() )
85  {
86  ossimNotify(ossimNotifyLevel_FATAL) << "ERROR -- ossimLsrRay(ossimLsrPoint,ossimLsrPoint) Constructor:"
87  << "\n The origin and direction LSR quantities do not share the"
88  << "\n same LSR space. Setting to NAN. Check the data for errors." << std::endl;
89 
91  origin.lsrSpace());
93  origin.lsrSpace());
94  }
95  else
96  {
97  theDirection = towards - origin;
99  }
100 }
bool hasNans() const
Definition: ossimLsrRay.h:80
ossimLsrVector theDirection
Definition: ossimLsrRay.h:117
double nan()
Method to return ieee floating point double precision NAN.
Definition: ossimCommon.h:135
ossimLsrSpace & lsrSpace()
bool hasNans() const
Definition: ossimLsrPoint.h:98
ossimLsrPoint theOrigin
Definition: ossimLsrRay.h:116
ossimLsrSpace & lsrSpace()
Definition: ossimLsrPoint.h:95
const ossimLsrPoint & origin() const
Definition: ossimLsrRay.h:69
const ossimLsrVector & direction() const
Definition: ossimLsrRay.h:70
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)