NMPB08 Shared Libraries
MingW/RailwayEmissionNMPB08.h
Go to the documentation of this file.
00001 #ifndef _RAILWAY_EMISSION_NMPB_INCLUDED_
00002 #define _RAILWAY_EMISSION_NMPB_INCLUDED_
00003 
00004 // --------------------------------------------------------------------------------------
00044 // --------------------------------------------------------------------------------------
00045 
00050 #ifndef _COMPILE_NMPB
00051         #ifdef _WIN32 
00052                 #define _COMPILE_NMPB extern "C" __declspec(dllexport)
00053         #else
00054                 #define _COMPILE_NMPB extern "C"
00055         #endif 
00056 #endif
00057 
00058 // --------------------------------------------------------------------------------------
00062 enum NPMP08_RailwayEmission_Error
00063 {
00064         ERROR_XML_PARSER     = 1, 
00065         ERROR_XML_SCHEMA     = 2, 
00066         ERROR_OPEN_FILE      = 3, 
00067         ERROR_INVALID_ID     = 4,  
00068         ERROR_INVALID_HEIGHT = 5   
00069 } ;
00070 
00071 // --------------------------------------------------------------------------------------
00075 enum NMPB_RailwayEmission_HorizontalDirectivity
00076 {
00077         HDIR_OMNI = 0, 
00078         HDIR_NMPB = 1  
00079 } ;
00080 
00081 // --------------------------------------------------------------------------------------
00085 enum NMPB_RailwayEmission_VerticalDirectivity
00086 {
00087         VDIR_OMNI = 0, 
00088         VDIR_NMPB = 1, 
00089         VDIR_HEMI = 2  
00090 } ;
00091 
00092 // --------------------------------------------------------------------------------------
00103 enum NMPB_RailwayEmission_Options
00104 {
00105         OPTION_TRACE_DEBUG                 = 1, 
00106         OPTION_NO_DIRECTIVITY      = 2, 
00107         OPTION_MODIFY_HEIGHTS      = 4,  
00108         OPTION_DEYGOUT_DIFFRACTION = 8 
00109 } ;
00110 
00111 // --------------------------------------------------------------------------------------
00126 typedef double NMPB_RailCorrectionType ;
00127 
00128 const NMPB_RailCorrectionType  RAIL_LONG_TRAVERSES_BETON  = 0.0 ;
00129 const NMPB_RailCorrectionType  RAIL_LONG_TRAVERSES_AUTRE  = 3.0 ;
00130 const NMPB_RailCorrectionType  RAIL_COURT_TRAVERSES_BETON = 3.0 ;
00131 const NMPB_RailCorrectionType  RAIL_COURT_TRAVERSES_AUTRE = 6.0 ;
00132 const NMPB_RailCorrectionType  RAIL_ZONE_APPAREILS_VOIE   = 6.0 ;
00133 
00134 // --------------------------------------------------------------------------------------
00139 struct RailwayEquivalentSource
00140 {
00141         double   height ; 
00142         bool     has_Lw ; 
00143         double*  Lw_dir ; 
00144 } ;
00145 
00146 // --------------------------------------------------------------------------------------
00156 struct RailwayEmission
00157 {
00158         unsigned int                            nbFreq ;        
00159         double*                                         freq ;          
00160         double                                          sin_h ;         
00161         double                                          sin_v ;         
00162         unsigned int                            nbSources ;     
00163         RailwayEquivalentSource*        source ;        
00164 } ;
00165 
00166 // --------------------------------------------------------------------------------------
00173 struct RailwayTrafficComponent
00174 {
00175         char*   id ;      
00176         double  number ;  
00177         double  speed ;   
00178 } ;
00179 
00185 // --------------------------------------------------------------------------------------
00190 struct RailwayTraffic
00191 {
00192         double                                          nbHours ;        
00193         NMPB_RailCorrectionType     railCorrection ; 
00194         unsigned int                            nbComponents ;   
00195         unsigned int                            maxComponents ;  
00196         RailwayTrafficComponent*        component ;      
00197 } ;
00198 
00199 // --------------------------------------------------------------------------------------
00203 struct ScreenBodyInteraction
00204 {
00205         int              maxInteractions ;  
00206         double   dS ;                           
00207         double   hS ;                           
00208         double   dR ;                           
00209         double   hR ;                           
00210         double*  alpha ;                        
00211 } ;
00212 
00213 // --------------------------------------------------------------------------------------
00223 _COMPILE_NMPB int NMPB08_LoadRailwayDatabase (const char* filename, bool log_stdout = false) ; 
00224 
00225 // --------------------------------------------------------------------------------------
00235 _COMPILE_NMPB int NMPB08_DumpRailwayDatabase (const char* filename = 0) ;
00236 
00237 // --------------------------------------------------------------------------------------
00242 enum NMPB_RailwayEmission_Entities
00243 {
00244         ENTITY_UNIT     = 1, 
00245         ENTITY_TRAIN    = 2, 
00246         ENTITY_PARTIAL  = 4, 
00247         ENTITY_TRAFFIC  = ENTITY_TRAIN | ENTITY_UNIT, 
00248         ENTITY_ALL      = ENTITY_TRAIN | ENTITY_UNIT | ENTITY_PARTIAL 
00249 } ;
00250 
00251 // --------------------------------------------------------------------------------------
00255 struct RailwayEntity
00256 {
00257         unsigned int            type ;    
00258         const char*                     id ;      
00259         const char*                     name ;    
00260         const char*                     image ;   
00261         double                          length ;  
00262         double                          vmax ;    
00263 } ;
00264 
00265 // --------------------------------------------------------------------------------------
00269 typedef bool (*EnumRailwayEntities) (RailwayEntity const& info, void* userdata) ;
00270 
00271 // --------------------------------------------------------------------------------------
00281 _COMPILE_NMPB int NMPB08_EnumRailwayDatabase (EnumRailwayEntities enumProc, 
00282                                                                                           unsigned int include_types = ENTITY_TRAFFIC,
00283                                                                                           void* userdata = 0) ;
00284 
00285 // --------------------------------------------------------------------------------------
00294 _COMPILE_NMPB void* NMPB08_CreateRailwayTraffic (double nb_hours) ;
00295 
00296 // --------------------------------------------------------------------------------------
00304 _COMPILE_NMPB int NMPB08_ClearRailwayTraffic (void* id) ;
00305 
00306 // --------------------------------------------------------------------------------------
00320 _COMPILE_NMPB int NMPB08_AddRailwayTraffic (void* id, const char* unit_or_train, double number, double speed) ;
00321 
00322 // --------------------------------------------------------------------------------------
00334 _COMPILE_NMPB unsigned int NMPB08_SetRailwayOptions (void* id, unsigned int option, bool on_off) ;
00335 
00336 // --------------------------------------------------------------------------------------
00346 _COMPILE_NMPB unsigned int NMPB08_GetRailwayOptions (void* id, unsigned int option) ;
00347 
00348 // --------------------------------------------------------------------------------------
00359 _COMPILE_NMPB unsigned int NMPB08_SetRailCorrection (void* id, NMPB_RailCorrectionType corr) ;
00360 
00361 // --------------------------------------------------------------------------------------
00370 _COMPILE_NMPB NMPB_RailCorrectionType NMPB08_GetRailCorrection (void* id) ;
00371 
00372 // --------------------------------------------------------------------------------------
00393 _COMPILE_NMPB RailwayEmission const* NMPB08_GetRailwayEmission (void* id, ScreenBodyInteraction* screenBodyInteraction = 0) ;
00394 
00395 // --------------------------------------------------------------------------------------
00412 _COMPILE_NMPB int NMPB08_SetRailwayEmissionAngles (void* id, double sin_h, double sin_v) ;
00413 
00414 // --------------------------------------------------------------------------------------
00423 _COMPILE_NMPB int NMPB08_DeleteRailwayTraffic (void* id) ;
00424 
00425 // --------------------------------------------------------------------------------------
00430 struct RailwayElementarySource
00431 {
00432         const char*                     id ;  
00433         double                     pos ;  
00434         double                  height ;  
00435         double                    vref ;  
00436         double                   slope ;  
00437         int                     hdir_model ;  
00438         int                     vdir_model ;  
00439         double const*       Lw ;  
00440 } ;
00441 
00442 // --------------------------------------------------------------------------------------
00447 typedef bool (*EnumRailwaySources) (RailwayElementarySource const& info, void* userdata) ;
00448 
00449 // --------------------------------------------------------------------------------------
00459 _COMPILE_NMPB int NMPB08_EnumRailwaySources (EnumRailwaySources enumProc,
00460                                                                                          const char* name,
00461                                                                                          void* userdata) ;
00462 
00463 #endif
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Defines