openModeller  Version 1.4.0
MapFormat.hh
Go to the documentation of this file.
00001 
00030 #ifndef _OM_MAPFORMATHH_
00031 #define _OM_MAPFORMATHH_
00032 
00033 #include <string>
00034 
00035 #include <openmodeller/os_specific.hh>
00036 #include <openmodeller/om_defs.hh>
00037 
00038 class Map;
00039 
00040 /****************************************************************/
00041 /************************* MapFormat ****************************/
00042 
00047 class dllexp MapFormat
00048 {
00049 public:
00050 
00051   MapFormat();
00052 
00053   MapFormat(Coord xcel, Coord ycel, Coord xmin, Coord ymin,
00054       Coord xmax, Coord ymax, Scalar noval, char const * proj);
00055 
00056   MapFormat( char const *filenameWithFormat );
00057 
00058   // Compiler generated copy constructor and copy assignment operator are fine for
00059   // this class.
00060 
00061   ~MapFormat();
00062 
00063   void copyDefaults( const Map& map );
00064 
00065   // This is the output format constants.
00066   enum { FloatingTiff = 0,
00067          GreyTiff = 1,
00068          GreyTiff100 = 2,
00069          GreyBMP = 3,
00070          FloatingHFA = 4, //erdas imagine floating point format
00071          ByteHFA = 5, //erdas imagine single byte format (scaled 0-100)
00072          ByteASC = 6, //Arc/Info ASCII Grid single byte format (scaled 0-100)
00073          FloatingASC = 7 //Arc/Info ASCII Grid floating point format
00074   };
00075 
00076   void unsetFormat() { format = FloatingTiff; }
00077   void unsetXCel()  { xcelIsSet = false; }
00078   void unsetYCel() { ycelIsSet = false; }
00079   void unsetXMin() { xminIsSet = false; }
00080   void unsetYMin() { yminIsSet = false; }
00081   void unsetXMax() { xmaxIsSet = false; }
00082   void unsetYMax() { ymaxIsSet = false; }
00083   void unsetNoDataValue() { novalIsSet = false; }
00084   void unsetProjection() { projIsSet = false; }
00085 
00086   void setFormat( int format );
00087   void setFormat( std::string format );
00088   void setXCel( Coord xcel );
00089   void setYCel( Coord ycel );
00090   void setXMin( Coord xmin );
00091   void setYMin( Coord ymin );
00092   void setXMax( Coord xmax );
00093   void setYMax( Coord ymax );
00094   void setNoDataValue( Scalar noval );
00095   void setProjection( const std::string& proj);
00096 
00097   int getFormat() const { return format; }
00098   int getWidth() const; 
00099   int getHeight() const; 
00100   Coord getXCel() const;
00101   Coord getYCel() const;
00102   Coord getXMin() const;
00103   Coord getYMin() const;
00104   Coord getXMax() const;
00105   Coord getYMax() const;
00106   Scalar getNoDataValue() const;
00107   std::string getProjection() const;
00108 
00109 private:
00110   int format;
00111 
00112   Coord xcel;    
00113   bool xcelIsSet;
00114 
00115   Coord ycel;    
00116   bool ycelIsSet;
00117 
00118   Coord xmin;  
00119   bool xminIsSet;
00120 
00121   Coord ymin;  
00122   bool yminIsSet;
00123 
00124   Coord xmax;  
00125   bool xmaxIsSet;
00126 
00127   Coord ymax;  
00128   bool ymaxIsSet;
00129 
00130   Scalar noval; 
00131   bool novalIsSet;
00132 
00133   //TODO: Perhaps DataType is required, but need to figure out a way
00134   //       for the user to represent it.
00135   //DataType dtype; /**< File data type. */
00136 
00137   std::string proj;  
00138   bool projIsSet;
00139 
00140 };
00141 
00142 
00143 #endif