NMPB08 Shared Libraries
SousCalculs/GroundEffect.h
Go to the documentation of this file.
00001 
00008 #ifndef GROUND_EFFECT_H
00009 #define GROUND_EFFECT_H
00010 
00011 #include "../PathStructures.h"
00012 
00013 #ifndef _WIN32
00014 #define  MeanPlane              _Local_PROPAN8_MeanPlane_
00015 #define  GroundEffect   _Local_PROPAN8_GroundEffect_
00016 #endif
00017 
00018 
00019 namespace GroundEffectNMPB
00020 {
00024         typedef enum 
00025         { 
00026                 Asol = 1 , 
00027                 DeltaSol_SO = 2 ,  
00028                 DeltaSol_OR = 3
00029         } GroundCalculationType;
00030 
00037         class MeanPlane
00038         {
00039         public:
00043                 MeanPlane()
00044                 {
00045                         _dp = 0;
00046                         _zEqS = 0;
00047                         _zEqR = 0;
00048                         _Gpath = 0;
00049                         _aCoeff = 0;
00050                         _bCoeff = 0;
00051                 }
00052 
00058                 MeanPlane(vector<ProfilePointNMPB*> terrainItems);
00059 
00065                 double Get_dp()
00066                 {
00067                         return _dp;
00068                 }
00069                 
00075                 double Get_zEqSource()
00076                 {
00077                         return _zEqS;
00078                 }
00079 
00085                 double Get_zEqReceiver()
00086                 {
00087                         return _zEqR;
00088                 }
00089 
00095                 double Get_Gpath()
00096                 {
00097                         return _Gpath;
00098                 }
00099 
00105                 Position2D Get_sourceImage()
00106                 {
00107                         return _imageS;
00108                 }
00109                 
00115                 Position2D Get_receiverImage()
00116                 {
00117                         return _imageR;
00118                 }
00119 
00125                 double Get_aCoeff()
00126                 {
00127                         return _aCoeff;
00128                 }
00129 
00135                 double Get_bCoeff()
00136                 {
00137                         return _bCoeff;
00138                 }
00139 
00145                 double Get_Gsource()
00146                 {
00147                         if (_source != NULL)
00148                         {
00149                                 return _source->impedance;
00150                         }
00151 
00152                         return 0;
00153                 }
00154 
00155         protected:
00159                 ProfilePointNMPB* _source; 
00163                 ProfilePointNMPB* _receiver; 
00167                 vector<ProfilePointNMPB*> _terrainItems;
00171                 vector<Position2D> _pointsList;
00175                 double _aCoeff; 
00179                 double _bCoeff;
00183                 double _dp;
00187                 double _zEqS;
00191                 double _zEqR;
00195                 double _Gpath;
00199                 Position2D _imageS;
00203                 Position2D _imageR;
00204 
00211                 void FillLineCoefficients();
00212 
00220                 Position2D MeanPlaneProjection(Position2D const* point);
00221 
00228                 void FillData();
00229 
00233                 void CalculateData()
00234                 {
00235                         FillLineCoefficients();
00236                         FillData();
00237                 }
00238         };
00239 
00240 
00247         class GroundEffect
00248     {
00249     public:
00250                 
00254                 GroundEffect()
00255                 {
00256                         _dp = 0;
00257                         _zEqS = 0;
00258                         _zEqR = 0;
00259                         _zEqS_f = 0;
00260                         _zEqR_f = 0;
00261                         _freq = 0;
00262                         _Gpath = 0;
00263                         _Gsource = 0;
00264                         _correctedGpath = 0;
00265                         _groundCalculationType = Asol;
00266                         _kFreq = 0;
00267                         _cfH = 0; 
00268                         _cfF = 0;
00269                          _AsolH = 0;
00270                         _AsolF = 0;
00271                 }
00272 
00293                 GroundEffect(double dp, double zEqS, double zEqR, double Gpath, double Gsource, double freq, GroundCalculationType groundCalculationType)
00294                 {
00295                         _dp = dp;
00296                         _zEqS = zEqS;
00297                         _zEqR = zEqR;
00298                         _zEqS_f = 0;
00299                         _zEqR_f = 0;
00300                         _freq = freq;
00301                         _Gpath = Gpath;
00302                         _Gsource = Gsource;
00303                         _correctedGpath = 0;
00304                         _groundCalculationType = groundCalculationType;
00305                         _kFreq = 0;
00306                         _cfH = 0; 
00307                         _cfF = 0;
00308                         _AsolH = 0;
00309                         _AsolF = 0;
00310 
00311                         // Calculates values used to get attenuation :
00312                         CorrectedGroundCoeffCalculation();
00313                         CfCalculation();
00314                         KfreqCalculation();
00315                 }
00316 
00325         double AttenuationCalculationH();
00326 
00337                 double AttenuationCalculationF();
00338 
00344                 double get_AsolH()
00345                 {
00346                         return _AsolH;
00347                 }
00353                 double get_AsolF()
00354                 {
00355                         return _AsolF;
00356                 }
00357 
00363                 double Get_zEqSource()
00364                 {
00365                         return _zEqS;
00366                 }
00367 
00373                 double Get_zEqReceiver()
00374                 {
00375                         return _zEqR;
00376                 }
00377 
00383                 double Get_zEqSource_f()
00384                 {
00385                         return _zEqS_f;
00386                 }
00387 
00393                 double Get_zEqReceiver_f()
00394                 {
00395                         return _zEqR_f;
00396                 }
00397 
00403                 double get_EquivalentGpath()
00404                 {
00405                         return _correctedGpath;
00406                 }
00407 
00408         protected:
00412                 double _dp;
00416                 double _zEqS;
00420                 double _zEqR;
00424                 double _zEqS_f;
00428                 double _zEqR_f;
00432                 double _freq;
00436                 double _Gpath;
00440                 double _Gsource;
00444                 double _correctedGpath;
00448                 GroundCalculationType _groundCalculationType;
00449                 
00453                 double _kFreq;
00457                 double _cfH, _cfF;
00458  
00462                 double _AsolH;
00466                 double _AsolF;
00467 
00468 
00476                 void CorrectedGroundCoeffCalculation();
00487                 double WparamCalculation(double Gw);
00496                 void CfCalculation();
00504                 void KfreqCalculation();
00505 
00522                 double AttenuationCalculation(double z1, double z2, double cf);
00523 
00524         };
00525 }
00526 
00527 #endif
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Defines