CARMA C++
Location.h
Go to the documentation of this file.
1 
11 #ifndef CARMA_SERVICES_LOCATION_H
12 #define CARMA_SERVICES_LOCATION_H
13 
14 #include "carma/services/Angle.h"
15 #include "carma/services/Length.h"
16 #include "carma/services/stringConstants.h"
17 
18 namespace carma {
19  namespace services {
20 
21  template <typename T> class Vector;
22 
32  class Location {
33  public:
37  Location();
38 
46  Location(const Angle& longitude, const Angle& latitude,
47  const Length& altitude);
48 
65  explicit Location(const std::string & observatory,
66  const std::string& position = REFERENCE);
67 
68  virtual ~Location() {}
69 
74  void setLatitude(Angle latitude);
75 
82  void setLatitude(double value, const std::string &units);
83 
88  void setLongitude(Angle longitude);
89 
96  void setLongitude(double value, const std::string &units);
97 
103  void setAltitude(Length altitude);
104 
112  void setAltitude(double value, const std::string &units);
113 
117  Angle getLatitude() const;
118 
122  Angle getLongitude() const;
123 
127  Length getAltitude() const;
128 
132  std::string getName() const;
133 
141 
142  private:
143  Angle longitude_;
144  Angle latitude_;
145  Length altitude_;
146  std::string name_;
147 
148  }; // end class Location
149 
153  std::ostream& operator<<(std::ostream& os,
154  const carma::services::Location& location);
155 
156  }
157 }
158 
159 #endif // CARMA_SERVICES_LOCATION_H
This class handles standard mathematical vector operations.
Definition: Location.h:21
Angle getLatitude() const
Representation of an angle, return values are always modulo 2PI radians.
Location()
default constructor, longitude = 0, latitude = 0, altitude = 0.
Representation of Length in any units.
void setAltitude(Length altitude)
Specify the altitude above sea level.
carma::services::Vector< double > vector()
the longitude, latitude and altitude (in that order!!!) as a carma:services::Vector.
void setLatitude(Angle latitude)
Specify the latitude.
Location specifies a location (observatory if you wish) on planet earth, as longitude, latitude, and altitude above sea-level.
Definition: Location.h:32
The Angle class can represent any angle in any units.
Definition: Angle.h:38
Angle getLongitude() const
Length getAltitude() const
void setLongitude(Angle longitude)
Specify the longitude.
std::ostream & operator<<(std::ostream &os, const carma::services::Angle &angle)
Define the &lt;&lt; operator to allow, e.g.
The Length class can represent a length in any units.
Definition: Length.h:36
std::string getName() const