Environment.h

Go to the documentation of this file.
00001 
00002 
00008 /* \todo Add name strings and outputting of "turned-on" disturbances
00009 * \todo Add reference counter to ensure deletion when not used anymore.
00010 * \todo Add CreateIterator() function
00011 */
00013 
00014 #ifndef __ENVIRONMENT_H__
00015 #define __ENVIRONMENT_H__
00016 
00017 #include "Rotation.h"
00018 #include "Integrator.h"
00019 #include "Matrix.h"
00020 #include "Time.h"
00021 #include <set>
00022 #include <vector>
00023 
00024 using namespace std;
00025 
00026 namespace O_SESSAME {
00027 class CentralBody;
00028 
00030 
00045 typedef vector<void*> EnvFuncParamaterType;
00047 typedef Vector(*pt2EnvFunc)(const ssfTime &_currentTime, const OrbitState &_currentOrbitState, const AttitudeState &_currentAttitudeState, const EnvFuncParamaterType &_parameterList);
00048 
00106 class EnvFunction
00107 {
00108 public:
00109     EnvFunction(pt2EnvFunc _EnvFuncPtr);
00110 
00111     EnvFunction(pt2EnvFunc _EnvFuncPtr, const int & _numParameters);
00112 
00113     Vector Evaluate(const ssfTime &_currentTime, const OrbitState &_currentOrbitState, const AttitudeState &_currentAttitudeState);
00114 
00115     void AddParameter(void* _parameter, int _paramNumber = -1);
00116     
00117     void RemoveParameter(int _paramNumber = -1);
00118 
00119     void ChangeParameter(void* _parameter, int _paramNumber = -1);
00120 private:
00122     pt2EnvFunc m_EnvFuncPtr;
00124     int m_NumParameters;
00126     EnvFuncParamaterType m_EnvFuncParameters;
00127 
00128 };
00129 
00131 
00141 
00142 
00179 class Environment
00180 {
00181 public:
00182     Environment();
00183 
00184     virtual ~Environment();
00185 
00186     Vector GetTorques(const ssfTime& _currentTime, const OrbitState& _currentOrbitState, const AttitudeState& _currentAttitudeState);
00187 
00188     Vector GetForces(const ssfTime& _currentTime, const OrbitState& _currentOrbitState, const AttitudeState& _currentAttitudeState);
00189 
00190     void AddForceFunction(const EnvFunction &_forceFunc);
00191 
00192     void AddTorqueFunction(const EnvFunction &_torqueFunc);
00193 
00194     const Functor& GetForceFunction() const;
00195 
00196     const Functor& GetTorqueFunction() const;
00197     
00198     void SetCentralBody(CentralBody *_pCB);
00199 
00200     const CentralBody* GetCentralBody() const;
00201     
00202 private:
00204     vector<EnvFunction> m_ForceFunctions;
00206     vector<EnvFunction> m_TorqueFunctions;
00208     vector<EnvFunction>::iterator m_funcIterator;
00210     CentralBody *m_pCB;
00211     
00213     Vector m_CalculatedForces;
00215     Vector m_CalculatedTorques;
00217     ObjectFunctor<Environment> m_ForcesFunctor;
00219     ObjectFunctor<Environment> m_TorquesFunctor;
00220 
00221 
00222 };
00223 } // close namespace O_SESSAME
00224 #endif
00225 // Do not change the comments below - they will be added automatically by CVS
00226 /*****************************************************************************
00227 *       $Log: Environment.h,v $
00228 *       Revision 1.12  2003/06/12 18:06:35  nilspace
00229 *       .
00230 *       
00231 *       Revision 1.11  2003/06/10 14:48:03  nilspace
00232 *       Changed include CentralBody.h to look in CentralBody directory.
00233 *       
00234 *       Revision 1.10  2003/06/06 17:35:52  nilspace
00235 *       Moved to CentralBody directory.
00236 *       
00237 *       Revision 1.9  2003/05/22 21:04:16  nilspace
00238 *       Updated comments.
00239 *       
00240 *       Revision 1.8  2003/05/22 03:42:32  nilspace
00241 *       Moved documentation to the implementation file.
00242 *       
00243 *       Revision 1.7  2003/05/20 17:51:12  nilspace
00244 *       Updated comments.
00245 *       
00246 *       Revision 1.6  2003/05/13 18:59:16  nilspace
00247 *       Fixed some comments.
00248 *       
00249 *       Revision 1.5  2003/05/05 20:45:46  nilspace
00250 *       Changed the pass-by-address parameters to pass-by-reference.
00251 *       
00252 *       Revision 1.4  2003/05/02 16:16:28  nilspace
00253 *       Documented the API.
00254 *       
00255 *       Revision 1.3  2003/05/02 02:16:29  nilspace
00256 *       Documented the API.
00257 *       Added a GetTorquesFunction().
00258 *       
00259 *       Revision 1.2  2003/04/27 22:04:33  nilspace
00260 *       Created the namespace O_SESSAME.
00261 *       
00262 *       Revision 1.1  2003/04/08 22:37:22  nilspace
00263 *       Initial Submission.
00264 *       
00265 *
00266 ******************************************************************************/

Generated on Wed Aug 6 12:58:45 2003 for Open-Sessame Framework by doxygen1.3