00001 /*************************************************************************** 00002 * Copyright (C) 2005 by Nicolas PASCAL * 00003 * nicolas.pascal@icare.univ-lille1.fr * 00004 * * 00005 * This program is free software; you can redistribute it and/or modify * 00006 * it under the terms of the GNU General Public License as published by * 00007 * the Free Software Foundation; either version 2 of the License, or * 00008 * (at your option) any later version. * 00009 * * 00010 * This program is distributed in the hope that it will be useful, * 00011 * but WITHOUT ANY WARRANTY; without even the implied warranty of * 00012 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 00013 * GNU General Public License for more details. * 00014 * * 00015 * You should have received a copy of the GNU General Public License * 00016 * along with this program; if not, write to the * 00017 * Free Software Foundation, Inc., * 00018 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * 00019 ***************************************************************************/ 00020 #ifndef METEOFILEDATA_H 00021 #define METEOFILEDATA_H 00022 00023 #include "filedata.h" 00024 00029 class MeteoFileData : virtual public FileData { 00030 protected: 00034 double delta_time; 00038 double delta_lat; 00042 double delta_lon; 00046 short nb_height_level; 00051 double* height_level; 00055 short nb_time_level; 00059 double* time_level; 00066 virtual bool check_filename( const std::string& filename ) const = 0; 00072 virtual void parse_filename( const std::string& filename ) = 0; 00073 protected: 00079 virtual const bool is_height_level_loaded() const ; 00086 virtual void load_height_level(){}; 00091 void free_height_level(); 00096 virtual const bool is_time_level_loaded() const ; 00103 virtual void load_time_level() = 0; 00107 void free_time_level(); 00108 public: 00114 MeteoFileData(const std::string &name, const std::string &mode="r"); 00118 virtual ~MeteoFileData(); 00123 const unsigned short get_nb_height_level(); 00128 const double* get_height_level(); 00134 const unsigned short get_nb_time_level() ; 00140 const double* get_time_level(); 00145 virtual double get_time_min() const ; 00150 virtual double get_time_max() const ; 00156 virtual const int get_lat_index( const float &lat) const; 00162 virtual const int get_lon_index( const float &lon) const; 00168 virtual const int get_time_index(const double &time) const; 00177 virtual const bool get_index(const float &lat, const float &lon, int *index) const; 00187 virtual const bool get_index(const float &lat, const float &lon, const double &time, int *index); 00192 short get_nb_time_level() const { return nb_time_level; }; 00197 double get_delta_time() const { return delta_time; } 00202 double get_delta_lat() const { return delta_lat; } 00207 double get_delta_lon() const { return delta_lon; } 00208 00209 }; 00210 00211 #endif