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

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

# include/fimex/GridDefinition.h

Go to the documentation of this file.

    00001 /*
    00002  * Fimex, GridDefinition.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: Sep 10, 2009
    00024  *      Author: Heiko Klein
    00025  */
    00026
    00027 #ifndef GRIDDEFINITION_H_
    00028 #define GRIDDEFINITION_H_
    00029
    00030 #include "fimex/binaryConstants.h"
    00031 #include <string>
    00032 #include "boost/shared_ptr.hpp"
    00033
    00034 namespace MetNoFimex
    00035 {
    00036
    00037 // forward declaration
    00038 struct GridDefImpl;
    00039
    00040 class GridDefinition
    00041 {
    00042 public:
    00048     enum OrientationFlags {
    00049         ScanStartRight =    binary<010000000>::value,
    00050         ScanStartBottom =   binary<001000000>::value,
    00051         ScanIsVertical =    binary<000100000>::value,
    00053         ScanIsAlternating = binary<000010000>::value
    00054     };
    00055     // grib2 binary representations
    00056     enum Orientation {
    00057         LeftUpperHorizontal =             binary<000000000>::value,
    00058         RightUpperHorizontal =            binary<010000000>::value,
    00059         LeftLowerHorizontal =             binary<001000000>::value,
    00060         RightLowerHorizontal =            binary<011000000>::value,
    00061         LeftUpperVertical =               binary<000100000>::value,
    00062         RightUpperVertical =              binary<010100000>::value,
    00063         LeftLowerVertical =               binary<001100000>::value,
    00064         RightLowerVertical =              binary<011100000>::value,
    00065
    00066         LeftUpperHorizontalAlternating =  binary<000010000>::value,
    00067         RightUpperHorizontalAlternating = binary<010010000>::value,
    00068         LeftLowerHorizontalAlternating =  binary<001010000>::value,
    00069         RightLowerHorizontalAlternating = binary<011010000>::value,
    00070         LeftUpperVerticalAlternating =    binary<000110000>::value,
    00071         RightUpperVerticalAlternating =   binary<010110000>::value,
    00072         LeftLowerVerticalAlternating =    binary<001110000>::value,
    00073         RightLowerVerticalAlternating =   binary<011110000>::value,
    00074     };
    00075
    00076     GridDefinition();
    00077     GridDefinition(
    00078             std::string projDefinition,
    00079             size_t xSize,
    00080             size_t ySize,
    00081             double xIncr,
    00082             double yIncr,
    00083             double xStart,
    00084             double yStart,
    00085             Orientation orient);
    00086     virtual ~GridDefinition();
    00088     virtual std::string getProjDefinition() const;
    00089     virtual void setProjDefinition(std::string proj);
    00091     virtual size_t getXSize() const;
    00092     virtual void setXSize(size_t xSize);
    00094     virtual size_t getYSize() const;
    00095     virtual void setYSize(size_t ySize);
    00097     virtual double getXIncrement() const;
    00098     virtual void setXIncrement(double xIncr);
    00100     virtual double getYIncrement() const;
    00101     virtual void setYIncrement(double yIncr);
    00103     virtual double getXStart() const;
    00104     virtual void setXStart(double startX);
    00106     virtual double getYStart() const;
    00107     virtual void setYStart(double startY);
    00108     virtual Orientation getScanMode() const;
    00109     virtual void setScanMode(Orientation orient);
    00110
    00120     virtual bool comparableTo(const GridDefinition& rhs, double delta = 0.) const;
    00121 private:
    00122     boost::shared_ptr<GridDefImpl> gridDef;
    00123
    00124 };
    00125
    00126 }
    00127
    00128 #endif /* GRIDDEFINITION_H_ */