// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2 of the License, or
// (at your option) any later version.
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
// Copyright 2003 Liam Girdwood
#ifndef _CASTOR_DEEP_OBJECT_HH
#define _CASTOR_DEEP_OBJECT_HH
#include "astro_object.hh"
namespace Castor
{
/*! \class DeepObject
* \brief Base class for deep sky objects in Nova.
*
* All deep sky objects in Nova are derived from this class.
*
*
* - RA Right Ascension (double)
* - DEC Declination (double)
* - RAh Right Ascension hours (int)
* - RAm Right Ascension minutes (int)
* - RAs Right Ascension seconds (double)
* - DE- Declination Sign (string)
* - DEd Declination degrees (int)
* - DEm Declination minutes (int)
* - DEs Declination seconds (double)
* - Vmag Visual Magnitude (double)
*
*/
class DeepObject : public AstroObject
{
public:
/*! \fn DeepObject()
* \brief Constructor
*/
DeepObject();
/*! \fn ~DeepObject()
* \brief Destructor
*/
~DeepObject();
// Methods from AstroObject
/*! \fn bool add_element (std::string& name, element_type type, std::string& value);
* \brief Add a data element.
*/
bool add_element (std::string& name, element_type type, std::string& value);
/*! \fn bool check_element (std::string& name);
* \brief Is object type known ?
*/
bool check_element (std::string& name);
/*! \fn void get_posn(double& ra, double& dec)
* \brief Get object Right Ascension
*/
void get_equ_posn(double JD, double& ra, double& dec);
/*! \fn double get_mag(double JD = 0)
* \brief Get object Magnitude
*/
double get_mag(double JD = 0);
/*! \fn void get_hrz_posn (double JD, ln_lnlat_posn* observer, ln_hrz_posn* posn);
* \brief Get object azimuth and Altitude
*/
void get_hrz_posn (double JD, ln_lnlat_posn* observer, ln_hrz_posn* posn);
/*! \fn void get_rst_time (double JD, ln_lnlat_posn* observer, ln_rst_time* time);
* \brief Get object Rise, Set ad Transit time
*/
void get_rst_time (double JD, ln_lnlat_posn* observer, ln_rst_time* time);
/*! \fn int save (std::ofstream* file);
* \brief Save object to file.
*/
int save (std::ofstream* file);
/*! \fn int load (std::ifstream* file);
* \brief Load object from file.
*/
int load (std::ifstream* file);
/*! \fn virtual int init();
* \brief Initialise object.
*/
int init();
/*! \fn virtual void get_info (std::list name, std::list value);
* \brief Get object information
*/
void get_info (std::list& name, std::list& value);
// Deep Object Methods
/*! \fn double get_distance_ly ();
* \brief Get the object distance (ly)
*/
double get_distance_ly ();
/*! \fn double get_distance_ps ();
* \brief Get the object distance (parsecs)
*/
double get_distance_ps ();
void render(double x, double y, double mag_max, Gnome::Canvas::Group& group, bool bright, double ppd = 0);
protected:
double m_ra; /*!< Object Right Ascension (degrees) */
double m_dec; /*!< Object Declination Degrees */
double m_mag; /*!< Object Magnitude */
double m_distance_ly; /*!< Object Distance (light years*/
private:
bool m_is_dec_negative; /*!< Is declination <0. Used in import and Add */
};
};
#endif