]> git.mxchange.org Git - flightgear.git/blob - JSBsim/FGCoefficient.h
Added initial support for native SGI compilers.
[flightgear.git] / JSBsim / FGCoefficient.h
1 /*******************************************************************************
2
3  Header:       FGCoefficient.h
4  Author:       Jon Berndt
5  Date started: 12/28/98
6
7  ------------- Copyright (C) 1999  Jon S. Berndt (jsb@hal-pc.org) -------------
8
9  This program is free software; you can redistribute it and/or modify it under
10  the terms of the GNU General Public License as published by the Free Software
11  Foundation; either version 2 of the License, or (at your option) any later
12  version.
13
14  This program is distributed in the hope that it will be useful, but WITHOUT
15  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
16  FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
17  details.
18
19  You should have received a copy of the GNU General Public License along with
20  this program; if not, write to the Free Software Foundation, Inc., 59 Temple
21  Place - Suite 330, Boston, MA  02111-1307, USA.
22
23  Further information about the GNU General Public License can also be found on
24  the world wide web at http://www.gnu.org.
25
26 HISTORY
27 --------------------------------------------------------------------------------
28 12/28/98   JSB   Created
29
30 ********************************************************************************
31 SENTRY
32 *******************************************************************************/
33
34 #ifndef FGCOEFFICIENT_H
35 #define FGCOEFFICIENT_H
36
37 /*******************************************************************************
38 INCLUDES
39 *******************************************************************************/
40 #ifdef FGFS
41 #  include <Include/compiler.h>
42 #  include STL_STRING
43 #  ifdef FG_HAVE_STD_INCLUDES
44 #    include <fstream>
45 #  else
46 #    include <fstream.h>
47 #  endif
48    FG_USING_STD(string);
49 #  ifdef FG_HAVE_NATIVE_SGI_COMPILERS
50      FG_USING_NAMESPACE(std);
51 #  endif
52 #else
53 #  include <string>
54 #  include <fstream>
55 #endif
56
57 /*******************************************************************************
58 DEFINES
59 *******************************************************************************/
60 #define FG_QBAR         1
61 #define FG_WINGAREA     2
62 #define FG_WINGSPAN     4
63 #define FG_CBAR         8
64 #define FG_ALPHA       16
65 #define FG_ALPHADOT    32
66 #define FG_BETA        64
67 #define FG_BETADOT    128
68 #define FG_PITCHRATE  256
69 #define FG_ROLLRATE   512
70 #define FG_YAWRATE   1024
71 #define FG_ELEVATOR  2048
72 #define FG_AILERON   4096
73 #define FG_RUDDER    8192
74 #define FG_MACH     16384
75 #define FG_ALTITUDE 32768L
76
77 /*******************************************************************************
78 CLASS DECLARATION
79 *******************************************************************************/
80
81 class FGFDMExec;
82 class FGState;
83 class FGAtmosphere;
84 class FGFCS;
85 class FGAircraft;
86 class FGTranslation;
87 class FGRotation;
88 class FGPosition;
89 class FGAuxiliary;
90 class FGOutput;
91
92 class FGCoefficient
93 {
94 public:
95   FGCoefficient(FGFDMExec*);
96   FGCoefficient(FGFDMExec*, int, int);
97   FGCoefficient(FGFDMExec*, int);
98   FGCoefficient(FGFDMExec*, string);
99   ~FGCoefficient(void);
100
101   bool Allocate(int);
102   bool Allocate(int, int);
103
104   float Value(float, float);
105   float Value(float);
106   float Value(void);
107
108 protected:
109
110 private:
111   string filename;
112   string description;
113   string name;
114   string method;
115   float StaticValue;
116   float *Table2D;
117   float **Table3D;
118   float LookupR, LookupC;
119   long int mult_idx[10];
120   int rows, columns;
121   int type;
122   int multipliers;
123   int mult_count;
124
125   float GetCoeffVal(int);
126
127   FGFDMExec*      FDMExec;
128   FGState*        State;
129   FGAtmosphere*   Atmosphere;
130   FGFCS*          FCS;
131   FGAircraft*     Aircraft;
132   FGTranslation*  Translation;
133   FGRotation*     Rotation;
134   FGPosition*     Position;
135   FGAuxiliary*    Auxiliary;
136   FGOutput*       Output;
137 };
138
139 /******************************************************************************/
140 #endif