2011-12-16 23:38:28 +00:00
|
|
|
#ifndef OBSERVER_H_
|
|
|
|
#define OBSERVER_H_
|
|
|
|
|
|
|
|
#include "CoordGeodetic.h"
|
|
|
|
#include "Eci.h"
|
|
|
|
|
2012-10-11 18:52:51 +00:00
|
|
|
class DateTime;
|
|
|
|
class CoordTopographic;
|
|
|
|
|
2011-12-16 23:38:28 +00:00
|
|
|
class Observer
|
|
|
|
{
|
|
|
|
public:
|
2012-10-11 18:52:51 +00:00
|
|
|
/**
|
|
|
|
* Constructor
|
|
|
|
* @param[in] latitude observers latitude in degrees
|
|
|
|
* @param[in] longitude observers longitude in degrees
|
|
|
|
* @param[in] altitude observers altitude in kilometers
|
|
|
|
*/
|
|
|
|
Observer(const double latitude,
|
|
|
|
const double longitude,
|
|
|
|
const double altitude)
|
|
|
|
: m_geo(latitude, longitude, altitude),
|
|
|
|
m_eci(DateTime(), m_geo)
|
2011-12-16 23:38:28 +00:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2012-10-11 18:52:51 +00:00
|
|
|
/**
|
|
|
|
* Constructor
|
|
|
|
* @param[in] geo the observers position
|
|
|
|
*/
|
|
|
|
Observer(const CoordGeodetic &geo)
|
|
|
|
: m_geo(geo),
|
|
|
|
m_eci(DateTime(), geo)
|
2011-12-16 23:38:28 +00:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2012-10-11 18:52:51 +00:00
|
|
|
/**
|
|
|
|
* Destructor
|
|
|
|
*/
|
2011-12-16 23:38:28 +00:00
|
|
|
virtual ~Observer()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2012-10-11 18:52:51 +00:00
|
|
|
/**
|
|
|
|
* Set the observers location
|
|
|
|
* @param[in] geo the observers position
|
|
|
|
*/
|
|
|
|
void SetLocation(const CoordGeodetic& geo)
|
2011-12-16 23:38:28 +00:00
|
|
|
{
|
2012-10-11 18:52:51 +00:00
|
|
|
m_geo = geo;
|
|
|
|
m_eci.Update(m_eci.GetDateTime(), m_geo);
|
2011-12-16 23:38:28 +00:00
|
|
|
}
|
|
|
|
|
2012-10-11 18:52:51 +00:00
|
|
|
/**
|
|
|
|
* Get the observers location
|
|
|
|
* @returns the observers position
|
|
|
|
*/
|
2011-12-16 23:38:28 +00:00
|
|
|
CoordGeodetic GetLocation() const
|
|
|
|
{
|
2012-10-11 18:52:51 +00:00
|
|
|
return m_geo;
|
2011-12-16 23:38:28 +00:00
|
|
|
}
|
|
|
|
|
2012-10-11 18:52:51 +00:00
|
|
|
/**
|
|
|
|
* Get the look angle for the observers position to the object
|
|
|
|
* @param[in] eci the object to find the look angle to
|
|
|
|
* @returns the lookup angle
|
|
|
|
*/
|
2011-12-16 23:38:28 +00:00
|
|
|
CoordTopographic GetLookAngle(const Eci &eci);
|
|
|
|
|
|
|
|
private:
|
2012-10-11 18:52:51 +00:00
|
|
|
/**
|
|
|
|
* @param[in] dt the date to update the observers position for
|
|
|
|
*/
|
|
|
|
void Update(const DateTime &dt)
|
2011-12-16 23:38:28 +00:00
|
|
|
{
|
2012-10-11 18:52:51 +00:00
|
|
|
if (m_eci != dt)
|
2011-12-16 23:38:28 +00:00
|
|
|
{
|
2012-10-11 18:52:51 +00:00
|
|
|
m_eci.Update(dt, m_geo);
|
2011-12-16 23:38:28 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2012-10-11 18:52:51 +00:00
|
|
|
/** the observers position */
|
|
|
|
CoordGeodetic m_geo;
|
|
|
|
/** the observers Eci for a particular time */
|
|
|
|
Eci m_eci;
|
2011-12-16 23:38:28 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|