00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027 #ifndef COORDINATEAXIS_H_
00028 #define COORDINATEAXIS_H_
00029
00030 #include "fimex/CDMVariable.h"
00031
00032 namespace MetNoFimex
00033 {
00038 class CoordinateAxis: public CDMVariable
00039 {
00040 public:
00041 enum AxisType {
00042 Undefined = 0,
00043 GeoX,
00044 GeoY,
00045 GeoZ,
00046 Time,
00047 Lon,
00048 Lat,
00049 Pressure,
00050 Height,
00051 };
00052 static std::string type2string(AxisType type) {
00053 switch (type) {
00054 case GeoX: return "GeoX";
00055 case GeoY: return "GeoY";
00056 case GeoZ: return "GeoZ";
00057 case Time: return "Time";
00058 case Lon: return "Lon";
00059 case Lat: return "Lat";
00060 case Pressure: return "Pressure";
00061 case Height: return "Height";
00062 default: return "Undefined";
00063 }
00064 }
00065 explicit CoordinateAxis(const CDMVariable& var) : CDMVariable(var) {}
00066 virtual ~CoordinateAxis() {}
00067
00068 bool operator<(const CoordinateAxis& ca) {return this->getName() < ca.getName();}
00069
00070 AxisType getAxisType() const {return type_;}
00071 std::string getAxisTypeStr() const {return type2string(type_);}
00072 void setAxisType(AxisType t) {type_ = t;}
00073 bool isAxisType(AxisType t) const {return t == type_;}
00078 bool isExplicit() const {return explicit_;}
00079 void setExplicit(bool isExplicit) {explicit_ = isExplicit;}
00080
00081 private:
00082 bool explicit_;
00083 AxisType type_;
00084
00085 };
00086
00087 std::ostream& operator<<(std::ostream& out, CoordinateAxis ca);
00088 std::ostream& operator<<(std::ostream& out, CoordinateAxis::AxisType t);
00089
00090 }
00091
00092
00093 #endif