# MI - Fimex: include/fimex/coordSys/CoordinateAxis.h Source File

- Main Page
- Related Pages
- Namespaces
- Classes
- Files
- Examples

# include/fimex/coordSys/CoordinateAxis.h

Go to the documentation of this file.

    00001 /*
    00002  * Fimex, CoordinateAxis.h
    00003  *
    00004  * (C) Copyright 2009, met.no
    00005  *
    00006  * Project Info:  https://wiki.met.no/fimex/start
    00007  *
    00008  * This library is free software; you can redistribute it and/or modify it
    00009  * under the terms of the GNU Lesser General Public License as published by
    00010  * the Free Software Foundation; either version 2.1 of the License, or
    00011  * (at your option) any later version.
    00012  *
    00013  * This library is distributed in the hope that it will be useful, but
    00014  * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
    00015  * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
    00016  * License for more details.
    00017  *
    00018  * You should have received a copy of the GNU Lesser General Public
    00019  * License along with this library; if not, write to the Free Software
    00020  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301,
    00021  * USA.
    00022  *
    00023  *  Created on: Mar 16, 2010
    00024  *      Author: Heiko Klein
    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 /* COORDINATEAXIS_H_ */