-
Notifications
You must be signed in to change notification settings - Fork 143
Expand file tree
/
Copy pathfHeader.cpp
More file actions
140 lines (115 loc) · 2.35 KB
/
fHeader.cpp
File metadata and controls
140 lines (115 loc) · 2.35 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
#include "stdafx.h"
#include "fHeader.h"
//# include <fstream>
//# include <stdio.h>
//# include <io.h>
using namespace std;
//CONSTRUCTORS
fHeader::fHeader()
{ ncols = 0;
nrows = 0;
dx = 1.0;
dy = 1.0;
nodataValue = -1;
xllcenter = 0;
yllcenter = 0;
}
fHeader::fHeader( const fHeader & h )
{ ncols = h.ncols;
nrows = h.nrows;
dx = h.dx;
dy = h.dy;
nodataValue = h.nodataValue;
xllcenter = h.xllcenter;
yllcenter = h.yllcenter;
projection = h.projection;
notes = h.notes;
}
//Destructor
fHeader::~fHeader()
{
}
//OPERATORS
fHeader fHeader::operator=( const fHeader & h )
{ ncols = h.ncols;
nrows = h.nrows;
dx = h.dx;
dy = h.dy;
nodataValue = h.nodataValue;
xllcenter = h.xllcenter;
yllcenter = h.yllcenter;
projection = h.projection;
notes = h.notes;
return *this;
}
//DATA ACCESS MEMBERS
inline long fHeader::getNumberCols()
{ return ncols;
}
inline long fHeader::getNumberRows()
{ return nrows;
}
inline float fHeader::getNodataValue()
{ return nodataValue;
}
inline double fHeader::getDx()
{ return dx;
}
inline double fHeader::getDy()
{ return dy;
}
inline double fHeader::getXllcenter()
{ return xllcenter;
}
inline double fHeader::getYllcenter()
{ return yllcenter;
}
char * fHeader::getProjection()
{
if( projection.GetLength() > 0 )
{
return _strdup(projection);
}
else
return _strdup("");
}
char * fHeader::getNotes()
{
if( notes.GetLength() > 0 )
{
return _strdup(notes);
}
else
return _strdup("");
}
void fHeader::setNumberCols( long p_ncols )
{ ncols = p_ncols;
}
void fHeader::setNumberRows( long p_nrows )
{ nrows = p_nrows;
}
void fHeader::setNodataValue( float p_nodata_value )
{ nodataValue = p_nodata_value;
}
void fHeader::setDx( double p_dx )
{ if( p_dx > 0 )
dx = p_dx;
}
void fHeader::setDy( double p_dy )
{ if( p_dy > 0 )
dy = p_dy;
}
void fHeader::setXllcenter( double p_xllcenter )
{ xllcenter = p_xllcenter;
}
void fHeader::setYllcenter( double p_yllcenter )
{ yllcenter = p_yllcenter;
}
void fHeader::setProjection( const char * c_projection )
{ CString p_projection = c_projection;
projection = p_projection.Left( MAX_STRING_LENGTH );
}
void fHeader::setNotes( const char * c_notes )
{ CString p_notes = c_notes;
notes = p_notes.Left( MAX_STRING_LENGTH );
}