// 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.
*
* <ul>
* <li><b>  RA</b>		<i>Right Ascension (double)</i></li> 
* <li><b>  DEC</b>		<i>Declination (double)</i></li>
* <li><b>  RAh</b>		<i>Right Ascension hours (int)</i></li>
* <li><b>  RAm</b>		<i>Right Ascension minutes (int)</i></li>
* <li><b>  RAs</b>		<i>Right Ascension seconds (double)</i></li>
* <li><b>  DE-</b>		<i>Declination Sign (string)</i></li>
* <li><b>  DEd</b>		<i>Declination degrees (int)</i></li>
* <li><b>  DEm</b>		<i>Declination minutes (int)</i></li>
* <li><b>  DEs</b>		<i>Declination seconds (double)</i></li>
* <li><b>  Vmag</b>		<i>Visual Magnitude (double)</i></li>
* </ul>
*/
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<Glib::ustring> name,  std::list<Glib::ustring> value);
		* \brief Get object information
		*/
		void get_info (std::list<Glib::ustring>& name,  std::list<Glib::ustring>& 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


syntax highlighted by Code2HTML, v. 0.9.1