CppEphem
Public Member Functions | Private Member Functions | Private Attributes | List of all members
CEBody Class Reference

The CEBody class defines a celestial object. It should be used as the parent class for all classes which define a celestial object (planets, stars, etc...).

Definition at line 39 of file CEBody.h.

Public Member Functions

 CEBody ()
 Default constructor. More...
 
 CEBody (const CEBody &other, const std::string &name="")
 Copy constructor. More...
 
 CEBody (const CESkyCoord &coords, const std::string &name="")
 Copy constructor from a single set of coordinates. More...
 
 CEBody (const std::string &name, const CEAngle &xcoord, const CEAngle &ycoord, const CESkyCoordType &coord_type=CESkyCoordType::ICRS)
 Primary constructor. More...
 
virtual CESkyCoord GetCoordinates (const CEDate &date=CEDate::CurrentJD()) const
 Return the ICRS coordinates associated with this object. More...
 
std::string Name (void) const
 Get the name of this object. More...
 
virtual CESkyCoord ObservedCoords (const CEDate &date, const CEObserver &observer) const
 Computes the observed coordinates for this object based. More...
 
CEBodyoperator= (const CEBody &other)
 Overloaded assignment operator. More...
 
void SetName (const std::string &new_name)
 Set the name of this object. More...
 
virtual ~CEBody ()
 Destructor. More...
 
- Public Member Functions inherited from CESkyCoord
virtual CEAngle AngularSeparation (const CESkyCoord &coords) const
 Get the angular separation between the coordinates represented by this object and another coordinate object. More...
 
 CESkyCoord ()
 Default constructor. More...
 
 CESkyCoord (const CEAngle &xcoord, const CEAngle &ycoord, const CESkyCoordType &coord_type=CESkyCoordType::ICRS)
 Primary constructor. More...
 
 CESkyCoord (const CECoordinates &other)
 Copy constructor. More...
 
 CESkyCoord (const CESkyCoord &other)
 Copy constructor. More...
 
CESkyCoord ConvertTo (const CESkyCoordType &output_coord_type, const CEDate &date=CEDate(), const CEObserver &observer=CEObserver())
 Convert these coordinates to another coordinate system NOTE: If this object is not OBSERVED coordinates, only JD is needed. More...
 
CESkyCoord ConvertToCIRS (const CEDate &date=CEDate(), const CEObserver &observer=CEObserver())
 Convert this coordinate to CIRS coordinates. More...
 
CESkyCoord ConvertToEcliptic (const CEDate &date=CEDate(), const CEObserver &observer=CEObserver())
 Convert this coordinate to ECLIPTIC coordinates. More...
 
CESkyCoord ConvertToGalactic (const CEDate &date=CEDate(), const CEObserver &observer=CEObserver())
 Convert this coordinate to GALACTIC coordinates. More...
 
CESkyCoord ConvertToICRS (const CEDate &date=CEDate(), const CEObserver &observer=CEObserver())
 Convert this coordinate to ICRS coordinates. More...
 
CESkyCoord ConvertToObserved (const CEDate &date=CEDate(), const CEObserver &observer=CEObserver())
 Convert this coordinate to OBSERVED coordinates. More...
 
CESkyCoordType GetCoordSystem (void) const
 Return coordinate system. More...
 
CESkyCoordoperator= (const CESkyCoord &other)
 Overloaded '=' (assignment) operator. More...
 
std::string print (void) const
 Generate a message string that specifies the information about this coordinate. More...
 
virtual void SetCoordinates (const CEAngle &xcoord, const CEAngle &ycoord, const CESkyCoordType &coord_type=CESkyCoordType::ICRS) const
 Set the coordinates of this object. More...
 
virtual void SetCoordinates (const CESkyCoord &coords)
 Set the coordinates from another CESkyCoord object. More...
 
virtual CEAngle XCoord (const CEDate &jd=CppEphem::julian_date_J2000()) const
 Return x coordinate at given Julian date. More...
 
virtual CEAngle YCoord (const CEDate &jd=CppEphem::julian_date_J2000()) const
 Return y coordinate at given Julian date. More...
 
virtual ~CESkyCoord ()
 Destructor. More...
 

Private Member Functions

void copy_members (const CEBody &other)
 Copy all data members. More...
 
void free_members (void)
 Free all allocated data members. More...
 
void init_members (void)
 Initialize data members. More...
 

Private Attributes

std::string name_
 Name of this object. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from CESkyCoord
static CEAngle AngularSeparation (const CEAngle &xcoord_first, const CEAngle &ycoord_first, const CEAngle &xcoord_second, const CEAngle &ycoord_second)
 Get the angular separation between two sets of coordinates. More...
 
static CEAngle AngularSeparation (const CESkyCoord &coords1, const CESkyCoord &coords2)
 Get the angular separation between two coordinate objects. More...
 
static void CIRS2Ecliptic (const CESkyCoord &in_cirs, CESkyCoord *out_ecliptic, const CEDate &date=CEDate())
 Convert CIRS to ECLIPTIC coordinates. More...
 
static void CIRS2Galactic (const CESkyCoord &in_cirs, CESkyCoord *out_galactic, const CEDate &date=CEDate())
 Convert CIRS to Galactic coordinates. More...
 
static void CIRS2ICRS (const CESkyCoord &in_cirs, CESkyCoord *out_icrs, const CEDate &date=CEDate())
 Convert CIRS to ICRS coordinates. More...
 
static void CIRS2Observed (const CESkyCoord &in_cirs, CESkyCoord *out_observed, const CEDate &date, const CEObserver &observer, CESkyCoord *observed_cirs=nullptr, CEAngle *hour_angle=nullptr)
 CIRS -> Observed (or observer specific) coordinate conversion. More...
 
static void Ecliptic2CIRS (const CESkyCoord &in_ecliptic, CESkyCoord *out_cirs, const CEDate &date=CEDate())
 ECLIPTIC -> CIRS coordinate conversion. More...
 
static void Ecliptic2Galactic (const CESkyCoord &in_ecliptic, CESkyCoord *out_galactic, const CEDate &date=CEDate())
 ECLIPTIC -> GALACTIC coordinate conversion. More...
 
static void Ecliptic2ICRS (const CESkyCoord &in_ecliptic, CESkyCoord *out_icrs, const CEDate &date=CEDate())
 ECLIPTIC -> ICRS coordinate conversion. More...
 
static void Ecliptic2Observed (const CESkyCoord &in_ecliptic, CESkyCoord *out_observed, const CEDate &date, const CEObserver &observer)
 ECLIPTIC -> OBSERVED coordinate conversion. More...
 
static void Galactic2CIRS (const CESkyCoord &in_galactic, CESkyCoord *out_cirs, const CEDate &date=CEDate())
 GALACTIC -> CIRS coordinate conversion. More...
 
static void Galactic2Ecliptic (const CESkyCoord &in_galactic, CESkyCoord *out_ecliptic, const CEDate &date=CEDate())
 GALACTIC -> ECLIPTIC coordinate conversion. More...
 
static void Galactic2ICRS (const CESkyCoord &in_galactic, CESkyCoord *out_icrs)
 GALACTIC -> ICRS coordinate conversion. More...
 
static void Galactic2Observed (const CESkyCoord &in_galactic, CESkyCoord *out_observed, const CEDate &date, const CEObserver &observer, CESkyCoord *observed_galactic=nullptr, CEAngle *hour_angle=nullptr)
 GALACTIC -> OBSERVED coordinate conversion. More...
 
static void ICRS2CIRS (const CESkyCoord &in_icrs, CESkyCoord *out_cirs, const CEDate &date=CEDate())
 ICRS -> CIRS coordinate conversion. More...
 
static void ICRS2Ecliptic (const CESkyCoord &in_icrs, CESkyCoord *out_ecliptic, const CEDate &date=CEDate())
 ICRS -> ECLIPTIC coordinate conversion. More...
 
static void ICRS2Galactic (const CESkyCoord &in_icrs, CESkyCoord *out_galactic)
 ICRS -> GALACTIC coordinate conversion. More...
 
static void ICRS2Observed (const CESkyCoord &in_icrs, CESkyCoord *out_observed, const CEDate &date, const CEObserver &observer, CESkyCoord *observed_cirs=nullptr, CEAngle *hour_angle=nullptr)
 ICRS -> OBSERVED coordinate conversion. More...
 
static void Observed2CIRS (const CESkyCoord &in_observed, CESkyCoord *out_cirs, const CEDate &date, const CEObserver &observer)
 OBSERVED -> CIRS coordinate conversion. More...
 
static void Observed2Ecliptic (const CESkyCoord &in_observed, CESkyCoord *out_ecliptic, const CEDate &date, const CEObserver &observer)
 OBSERVED -> ECLIPTIC coordinate conversion. More...
 
static void Observed2Galactic (const CESkyCoord &in_observed, CESkyCoord *out_galactic, const CEDate &date, const CEObserver &observer)
 OBSERVED -> GALACTIC coordinate conversion. More...
 
static void Observed2ICRS (const CESkyCoord &in_observed, CESkyCoord *out_icrs, const CEDate &date, const CEObserver &observer)
 OBSERVED -> ICRS coordinate conversion. More...
 

#include <CEBody.h>

Inheritance diagram for CEBody:
Inheritance graph
[legend]
Collaboration diagram for CEBody:
Collaboration graph
[legend]

Constructor & Destructor Documentation

◆ CEBody() [1/4]

CEBody::CEBody ( )

Default constructor.

Definition at line 34 of file CEBody.cpp.

◆ CEBody() [2/4]

CEBody::CEBody ( const std::string &  name,
const CEAngle xcoord,
const CEAngle ycoord,
const CESkyCoordType coord_type = CESkyCoordType::ICRS 
)

Primary constructor.

Parameters
[in]nameName for this object
[in]xcoordX-coordinate
[in]ycoordY-coordinate
[in]angle_typeAngle type (either DEGREES or RADIANS)
[in]coord_typeCoordinate type (see CESkyCoordType)

Definition at line 48 of file CEBody.cpp.

◆ CEBody() [3/4]

CEBody::CEBody ( const CEBody other,
const std::string &  name = "" 
)

Copy constructor.

Parameters
[in]otherCEBody object to copy from
[in]nameNew object name

Definition at line 63 of file CEBody.cpp.

◆ CEBody() [4/4]

CEBody::CEBody ( const CESkyCoord coords,
const std::string &  name = "" 
)

Copy constructor from a single set of coordinates.

Parameters
[in]coordscoordinates object

Definition at line 78 of file CEBody.cpp.

◆ ~CEBody()

CEBody::~CEBody ( )
virtual

Destructor.

Definition at line 91 of file CEBody.cpp.

Member Function Documentation

◆ copy_members()

void CEBody::copy_members ( const CEBody other)
private

Copy all data members.

Definition at line 162 of file CEBody.cpp.

◆ free_members()

void CEBody::free_members ( void  )
private

Free all allocated data members.

Definition at line 145 of file CEBody.cpp.

◆ GetCoordinates()

CESkyCoord CEBody::GetCoordinates ( const CEDate date = CEDate::CurrentJD()) const
inlinevirtual

Return the ICRS coordinates associated with this object.

Parameters
[in]dateDate for the coordinates
Returns
Coordinates of this object in the ICRS frame

Note that the date information is useful for those objects that may be either planets or stars with proper motion.

Definition at line 121 of file CEBody.h.

◆ init_members()

void CEBody::init_members ( void  )
private

Initialize data members.

Definition at line 153 of file CEBody.cpp.

◆ Name()

std::string CEBody::Name ( void  ) const
inline

Get the name of this object.

Returns
the name of this object

Definition at line 95 of file CEBody.h.

◆ ObservedCoords()

CESkyCoord CEBody::ObservedCoords ( const CEDate date,
const CEObserver observer 
) const
virtual

Computes the observed coordinates for this object based.

Reimplemented in CEPlanet.

Definition at line 129 of file CEBody.cpp.

◆ operator=()

CEBody & CEBody::operator= ( const CEBody other)

Overloaded assignment operator.

Parameters
[in]otherCEBody object to be copied
Returns
Reference to this object post-copy

Definition at line 107 of file CEBody.cpp.

◆ SetName()

void CEBody::SetName ( const std::string &  new_name)
inline

Set the name of this object.

Parameters
[in]new_nameNew name of this object

Definition at line 106 of file CEBody.h.

Member Data Documentation

◆ name_

std::string CEBody::name_
private

Name of this object.

Definition at line 98 of file CEBody.h.


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