00001 ////////////////////////////////////////////////////////////////////////////////////////////////// 00002 /*! \file CentralBody.h 00003 * \brief Interface to the CentralBody encapsulation object. 00004 * \author $Author: jayhawk_hokie $ 00005 * \version $Revision: 1.2 $ 00006 * \date $Date: 2005/06/10 12:53:28 $ 00007 *////////////////////////////////////////////////////////////////////////////////////////////////// 00008 /* \todo Add reference counter to ensure deletion when not used anymore. 00009 * \todo finish implementation of the abstract and concrete central bodies. 00010 */ 00011 ////////////////////////////////////////////////////////////////////////////////////////////////// 00012 00013 #ifndef __O_SESSAME_CENTRALBODY_H__ 00014 #define __O_SESSAME_CENTRALBODY_H__ 00015 00016 #include <rotation/Rotation.h> 00017 #include <matrix/Matrix.h> 00018 #include <orbit/OrbitState.h> 00019 #include <utils/Time.h> 00020 #include <environment/CentralBody/Models/MagneticModel.h> 00021 00022 namespace O_SESSAME { 00023 00024 /*! \brief Abstract representation of a central body 00025 * \ingroup EnvironmentToolkit 00026 * 00027 * \detail The CentralBody class provides a common interface to the group of central body 00028 * objects (Planet, moon, asteroid, etc.) The central body group stores the pertinent 00029 * parameters that affect the operating environment of a spacecraft. This includes 00030 * the radius, mass, gravity field, atmosphere characteristics (if they is an atm), and 00031 * relationship to other central bodies (such as from the sun, or a moon to planet). 00032 * 00033 */ 00034 class CentralBody 00035 { 00036 public: 00037 /*! \brief Default Deconstructor */ 00038 virtual ~CentralBody() {}; 00039 00040 00041 // MAGNETIC MODEL 00042 void SetMagneticModel(MagneticModel* _pNewMagModel); 00043 00044 00045 // PHYSICAL PARAMETERS 00046 virtual inline double GetAvgRotationRate(); 00047 virtual inline double GetRadius(); 00048 virtual inline double GetGravitationalParameter() { return m_GravitationalParameter; } 00049 00050 /*! \brief calculate the vector from the central body to another central body */ 00051 Vector GetVector2Body(CentralBody*) const; 00052 00053 /*! \brief calculate the vector from the central body to a satellite */ 00054 Vector GetVector2Body(const OrbitState& _satOrbitState) const; 00055 00056 00057 /*! \brief Returns a pointer to the instance of the central body. */ 00058 CentralBody* operator= (CentralBody*); 00059 00060 /*! \brief decrease the number of references to the central body pointer */ 00061 void ReleaseReference(); 00062 00063 protected: 00064 /*! \brief Construct a central body object */ 00065 CentralBody(); 00066 00067 /*! \brief increase the number of references to the central body pointer */ 00068 void GetReference(); 00069 00070 00071 double m_Radius; /**< radius of the central body, [km] */ 00072 double m_Mass; /**< mass of the central body, [kg] */ 00073 double m_GravitationalParameter; /**< gravitational parameter, \f$\mu\f$ [km^3/(solar s)^2] */ 00074 00075 double m_AtmHeight; 00076 double m_AvgRotationRate; /**< average rotation rate of the central body, [rad/s] */ 00077 Vector m_GravitationalFieldConstants; 00078 00079 int m_ReferenceCount; 00080 MagneticModel* m_pMagneticFieldModel; 00081 MagneticFieldCoefficients m_MagFieldCoeffs; 00082 }; 00083 } // close namespace O_SESSAME 00084 00085 /** @defgroup EnvironmentModels Environment Models 00086 * @ingroup EnvironmentToolkit 00087 * Collection of models of the environment of a central body. 00088 * 00089 * Examples include magnetic field, atmosphere, radiation, etc. 00090 */ 00091 00092 #endif 00093 // Do not change the comments below - they will be added automatically by CVS 00094 /***************************************************************************** 00095 * $Log: CentralBody.h,v $ 00096 * Revision 1.2 2005/06/10 12:53:28 jayhawk_hokie 00097 * Changed header file format to make it easier to link to the spacecraft code by only having to specify dsacss/dep/spacecraft/src (ex. "file.h" changed to <dir/file.h> where dir is a folder in src). 00098 * 00099 * Revision 1.1.1.1 2005/04/26 17:40:56 cakinli 00100 * Adding OpenSESSAME to DSACSS distrib to capture fixed version. 00101 * 00102 * Revision 1.4 2003/10/18 21:37:28 rsharo 00103 * Removed "../utils" from all qmake project paths. Prepended "utils 00104 * /" to all #include directives for utils. Removed ".h" extensions from STL header 00105 * s and referenced STL components from "std::" namespace. Overall, changed to be 00106 * more portable. 00107 * 00108 * Revision 1.3 2003/06/12 17:57:41 nilspace 00109 * Added magnetic models. 00110 * 00111 * Revision 1.2 2003/06/09 15:20:39 nilspace 00112 * Changed CentralBody directory. 00113 * 00114 * Revision 1.1 2003/06/06 17:34:53 nilspace 00115 * Moved to CentralBody directory. 00116 * 00117 * Revision 1.7 2003/05/20 17:51:12 nilspace 00118 * Updated comments. 00119 * 00120 * Revision 1.6 2003/05/13 18:59:16 nilspace 00121 * Fixed some comments. 00122 * 00123 * Revision 1.5 2003/05/05 20:45:46 nilspace 00124 * Changed the pass-by-address parameters to pass-by-reference. 00125 * 00126 * Revision 1.4 2003/05/02 16:16:28 nilspace 00127 * Documented the API. 00128 * 00129 * Revision 1.3 2003/04/27 22:04:33 nilspace 00130 * Created the namespace O_SESSAME. 00131 * 00132 * Revision 1.2 2003/04/23 16:29:47 nilspace 00133 * Updated makefile directories. 00134 * 00135 * Revision 1.1 2003/04/08 22:35:11 nilspace 00136 * Initial Submission. 00137 * 00138 ******************************************************************************/