CppEphem
CEBody.h
Go to the documentation of this file.
1 /***************************************************************************
2  * CEBody.h: CppEphem *
3  * ----------------------------------------------------------------------- *
4  * Copyright © 2016 JCardenzana *
5  * ----------------------------------------------------------------------- *
6  * *
7  * This program is free software: you can redistribute it and/or modify *
8  * it under the terms of the GNU General Public License as published by *
9  * the Free Software Foundation, either version 3 of the License, or *
10  * (at your option) any later version. *
11  * *
12  * This program is distributed in the hope that it will be useful, *
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
15  * GNU General Public License for more details. *
16  * *
17  * You should have received a copy of the GNU General Public License *
18  * along with this program. If not, see <http://www.gnu.org/licenses/>. *
19  * *
20  ***************************************************************************/
21 
22 // ============================================================
23 // CEBody :
24 // This class is meant to serve as the base class for all
25 // astronomical object types (stars, planets, etc...). It
26 // implements the base coordinate storage objects and
27 // implements the methods necessary for coordinate conversions.
28 // ============================================================
29 
30 #ifndef CEBody_h
31 #define CEBody_h
32 
33 // STANDARD C++ HEADERS
34 #include <vector>
35 
36 // CPPEPHEM HEADERS
37 #include "CESkyCoord.h"
38 
39 class CEBody : public CESkyCoord {
40 public:
41  /************************************
42  * Basic constructors & destructors
43  ***********************************/
44 
45  CEBody() ;
46  CEBody(const std::string& name,
47  const CEAngle& xcoord,
48  const CEAngle& ycoord,
49  const CESkyCoordType& coord_type=CESkyCoordType::ICRS);
50  CEBody(const CEBody& other,
51  const std::string& name="");
52  CEBody(const CESkyCoord& coords,
53  const std::string& name="");
54  virtual ~CEBody();
55 
56  /************************************
57  * Overloaded operators
58  ***********************************/
59 
60  CEBody& operator=(const CEBody& other);
61 
62  /************************************
63  * Public methods
64  ***********************************/
65 
66  virtual CESkyCoord GetCoordinates(const CEDate& date=CEDate::CurrentJD()) const;
67  virtual CESkyCoord ObservedCoords(const CEDate& date,
68  const CEObserver& observer) const;
69  std::string Name(void) const;
70  void SetName(const std::string& new_name);
71 
72 private:
73 
74  /************************************
75  * Private methods
76  ***********************************/
77  void copy_members(const CEBody& other);
78  void free_members(void);
79  void init_members(void);
80 
81  // Proper motion variables for this object. These are used for
82  // correctly getting the objects coordinates at some date other
83  // than the date indicated in 'coords_'
84  std::string name_;
85 
86 };
87 
88 
89 /**********************************************************************/
94 inline
95 std::string CEBody::Name(void) const
96 {
97  return name_;
98 }
99 
100 /**********************************************************************/
105 inline
106 void CEBody::SetName(const std::string& new_name)
107 {
108  name_ = new_name;
109 }
110 
111 /**********************************************************************/
120 inline
122 {
123  return CESkyCoord(*this) ;
124 }
125 
126 #endif /* CEBody_h */
CESkyCoordType::ICRS
RA, Dec (referenced at the barycenter of the solarsystem)
CESkyCoordType
CESkyCoordType
The following enum specifies what coordinates this object represents.
Definition: CESkyCoord.h:39
CEDate
Definition: CEDate.h:43
CEBody::~CEBody
virtual ~CEBody()
Destructor.
Definition: CEBody.cpp:91
CESkyCoord
Definition: CESkyCoord.h:49
CEBody::init_members
void init_members(void)
Initialize data members.
Definition: CEBody.cpp:153
CEBody::GetCoordinates
virtual CESkyCoord GetCoordinates(const CEDate &date=CEDate::CurrentJD()) const
Return the ICRS coordinates associated with this object.
Definition: CEBody.h:121
CEBody::operator=
CEBody & operator=(const CEBody &other)
Overloaded assignment operator.
Definition: CEBody.cpp:107
CEBody::free_members
void free_members(void)
Free all allocated data members.
Definition: CEBody.cpp:145
CEBody::CEBody
CEBody()
Default constructor.
Definition: CEBody.cpp:34
CEAngle
Definition: CEAngle.h:38
CEBody::copy_members
void copy_members(const CEBody &other)
Copy all data members.
Definition: CEBody.cpp:162
CEBody::ObservedCoords
virtual CESkyCoord ObservedCoords(const CEDate &date, const CEObserver &observer) const
Computes the observed coordinates for this object based.
Definition: CEBody.cpp:129
CEBody::Name
std::string Name(void) const
Get the name of this object.
Definition: CEBody.h:95
CEBody::SetName
void SetName(const std::string &new_name)
Set the name of this object.
Definition: CEBody.h:106
CEDate::CurrentJD
static double CurrentJD()
Static method for getting the current Julian date.
Definition: CEDate.cpp:632
CESkyCoord::CESkyCoord
CESkyCoord()
Default constructor.
Definition: CESkyCoord.cpp:38
CEObserver
Definition: CEObserver.h:28
CEBody
Definition: CEBody.h:39
CESkyCoord.h
CEBody::name_
std::string name_
Name of this object.
Definition: CEBody.h:98