JSBSim Flight Dynamics Model 1.0 (23 February 2013)
An Open Source Flight Dynamics and Control Software Library in C++

FGGroundCallback.h

00001 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
00002 
00003  Header:       FGGroundCallback.h
00004  Author:       Mathias Froehlich
00005  Date started: 05/21/04
00006 
00007  ------ Copyright (C) 2004 Mathias Froehlich (Mathias.Froehlich@web.de) -------
00008 
00009  This program is free software; you can redistribute it and/or modify it under
00010  the terms of the GNU Lesser General Public License as published by the Free Software
00011  Foundation; either version 2 of the License, or (at your option) any later
00012  version.
00013 
00014  This program is distributed in the hope that it will be useful, but WITHOUT
00015  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
00016  FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public License for more
00017  details.
00018 
00019  You should have received a copy of the GNU Lesser General Public License along with
00020  this program; if not, write to the Free Software Foundation, Inc., 59 Temple
00021  Place - Suite 330, Boston, MA  02111-1307, USA.
00022 
00023  Further information about the GNU Lesser General Public License can also be found on
00024  the world wide web at http://www.gnu.org.
00025 
00026 HISTORY
00027 -------------------------------------------------------------------------------
00028 05/21/00   MF   Created
00029 
00030 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
00031 SENTRY
00032 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
00033 
00034 #ifndef FGGROUNDCALLBACK_H
00035 #define FGGROUNDCALLBACK_H
00036 
00037 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
00038 INCLUDES
00039 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
00040 
00041 #include "simgear/structure/SGReferenced.hxx"
00042 #include "simgear/structure/SGSharedPtr.hxx"
00043 
00044 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
00045 DEFINITIONS
00046 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
00047 
00048 #define ID_GROUNDCALLBACK "$Id: FGGroundCallback.h,v 1.16 2013/02/02 13:23:40 bcoconni Exp $"
00049 
00050 namespace JSBSim {
00051 
00052 class FGLocation;
00053 class FGColumnVector3;
00054 
00055 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
00056 CLASS DOCUMENTATION
00057 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
00058 
00068 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
00069 CLASS DECLARATION
00070 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
00071 
00072 class FGGroundCallback : public SGReferenced
00073 {
00074 public:
00075 
00076   FGGroundCallback() {}
00077   virtual ~FGGroundCallback() {}
00078 
00082   virtual double GetAltitude(const FGLocation& l) const = 0;
00083 
00094   virtual double GetAGLevel(double t, const FGLocation& location,
00095                             FGLocation& contact,
00096                             FGColumnVector3& normal, FGColumnVector3& v,
00097                             FGColumnVector3& w) const = 0;
00098 
00103   virtual double GetTerrainGeoCentRadius(double t, const FGLocation& location) const = 0;
00104 
00109   virtual double GetSeaLevelRadius(const FGLocation& location) const = 0;
00110 
00115   virtual void SetTerrainGeoCentRadius(double radius)  { }
00116 
00121   virtual void SetSeaLevelRadius(double radius) {  }
00122 
00123 };
00124 
00125 typedef SGSharedPtr<FGGroundCallback> FGGroundCallback_ptr;
00126 
00127 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
00128 // The default sphere earth implementation:
00129 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
00130 
00131 class FGDefaultGroundCallback : public FGGroundCallback
00132 {
00133 public:
00134 
00135    FGDefaultGroundCallback(double referenceRadius = 20925650.0);
00136 
00137    double GetAltitude(const FGLocation& l) const;
00138 
00139    double GetAGLevel(double t, const FGLocation& location,
00140                      FGLocation& contact,
00141                      FGColumnVector3& normal, FGColumnVector3& v,
00142                      FGColumnVector3& w) const;
00143 
00144    void SetTerrainGeoCentRadius(double radius)  {  mTerrainLevelRadius = radius;}
00145    double GetTerrainGeoCentRadius(double t, const FGLocation& location) const
00146    { return mTerrainLevelRadius; }
00147 
00148    void SetSeaLevelRadius(double radius) { mSeaLevelRadius = radius;   }
00149    double GetSeaLevelRadius(const FGLocation& location) const
00150    {return mSeaLevelRadius; }
00151 
00152 private:
00153 
00154    double mSeaLevelRadius;
00155    double mTerrainLevelRadius;
00156 };
00157 
00158 
00159 }
00160 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
00161 #endif