openModeller  Version 1.5.0
MapFormat.hh
Go to the documentation of this file.
1 
30 #ifndef _OM_MAPFORMATHH_
31 #define _OM_MAPFORMATHH_
32 
33 #include <string>
34 
36 #include <openmodeller/om_defs.hh>
37 
38 class Map;
39 
40 /****************************************************************/
41 /************************* MapFormat ****************************/
42 
47 class dllexp MapFormat
48 {
49 public:
50 
51  MapFormat();
52 
53  MapFormat(Coord xcel, Coord ycel, Coord xmin, Coord ymin,
54  Coord xmax, Coord ymax, Scalar noval, char const * proj);
55 
56  MapFormat( char const *filenameWithFormat );
57 
58  // Compiler generated copy constructor and copy assignment operator are fine for
59  // this class.
60 
61  ~MapFormat();
62 
63  void copyDefaults( const Map& map );
64 
65  // This is the output format constants.
66  enum { FloatingTiff = 0,
67  GreyTiff = 1,
68  GreyTiff100 = 2,
69  GreyBMP = 3,
70  FloatingHFA = 4, //erdas imagine floating point format
71  ByteHFA = 5, //erdas imagine single byte format (scaled 0-100)
72  ByteASC = 6, //Arc/Info ASCII Grid single byte format (scaled 0-100)
73  FloatingASC = 7 //Arc/Info ASCII Grid floating point format
74  };
75 
76  void unsetFormat() { format = FloatingTiff; }
77  void unsetXCel() { xcelIsSet = false; }
78  void unsetYCel() { ycelIsSet = false; }
79  void unsetXMin() { xminIsSet = false; }
80  void unsetYMin() { yminIsSet = false; }
81  void unsetXMax() { xmaxIsSet = false; }
82  void unsetYMax() { ymaxIsSet = false; }
83  void unsetNoDataValue() { novalIsSet = false; }
84  void unsetProjection() { projIsSet = false; }
85 
86  void setFormat( int format );
87  void setFormat( std::string format );
88  void setXCel( Coord xcel );
89  void setYCel( Coord ycel );
90  void setXMin( Coord xmin );
91  void setYMin( Coord ymin );
92  void setXMax( Coord xmax );
93  void setYMax( Coord ymax );
94  void setNoDataValue( Scalar noval );
95  void setProjection( const std::string& proj);
96 
97  int getFormat() const { return format; }
98  int getWidth() const;
99  int getHeight() const;
100  Coord getXCel() const;
101  Coord getYCel() const;
102  Coord getXMin() const;
103  Coord getYMin() const;
104  Coord getXMax() const;
105  Coord getYMax() const;
106  Scalar getNoDataValue() const;
107  std::string getProjection() const;
108 
109 private:
110  int format;
111 
113  bool xcelIsSet;
114 
116  bool ycelIsSet;
117 
119  bool xminIsSet;
120 
122  bool yminIsSet;
123 
125  bool xmaxIsSet;
126 
128  bool ymaxIsSet;
129 
132 
133  //TODO: Perhaps DataType is required, but need to figure out a way
134  // for the user to represent it.
135  //DataType dtype; /**< File data type. */
136 
137  std::string proj;
138  bool projIsSet;
139 
140 };
141 
142 
143 #endif
Coord ycel
Definition: MapFormat.hh:115
bool novalIsSet
Definition: MapFormat.hh:131
bool ymaxIsSet
Definition: MapFormat.hh:128
double Scalar
Type of map values.
Definition: om_defs.hh:39
bool xcelIsSet
Definition: MapFormat.hh:113
Coord xcel
Definition: MapFormat.hh:112
Coord ymax
Definition: MapFormat.hh:127
bool ycelIsSet
Definition: MapFormat.hh:116
void unsetYMax()
Definition: MapFormat.hh:82
void unsetYCel()
Definition: MapFormat.hh:78
void unsetFormat()
Definition: MapFormat.hh:76
int getFormat() const
Definition: MapFormat.hh:97
void unsetXMax()
Definition: MapFormat.hh:81
Coord xmax
Definition: MapFormat.hh:124
Coord xmin
Definition: MapFormat.hh:118
void unsetXMin()
Definition: MapFormat.hh:79
Definition: Map.hh:49
bool xminIsSet
Definition: MapFormat.hh:119
int format
Definition: MapFormat.hh:110
void unsetProjection()
Definition: MapFormat.hh:84
bool yminIsSet
Definition: MapFormat.hh:122
std::string proj
Definition: MapFormat.hh:137
void unsetXCel()
Definition: MapFormat.hh:77
void unsetYMin()
Definition: MapFormat.hh:80
double Coord
Type of map coordinates.
Definition: om_defs.hh:38
Scalar noval
Definition: MapFormat.hh:130
bool projIsSet
Definition: MapFormat.hh:138
void unsetNoDataValue()
Definition: MapFormat.hh:83
Coord ymin
Definition: MapFormat.hh:121
bool xmaxIsSet
Definition: MapFormat.hh:125