forked from MapWindow/MapWinGIS
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlHeader.cpp
More file actions
139 lines (115 loc) · 2.35 KB
/
lHeader.cpp
File metadata and controls
139 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
#include "stdafx.h"
#include "lHeader.h"
//# include <fstream>
//# include <stdio.h>
//# include <io.h>
using namespace std;
//CONSTRUCTORS
lHeader::lHeader()
{ ncols = 0;
nrows = 0;
dx = 1.0;
dy = 1.0;
nodataValue = -1;
xllcenter = 0;
yllcenter = 0;
}
lHeader::lHeader( const lHeader & 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
lHeader::~lHeader()
{
}
//OPERATORS
lHeader lHeader::operator=( const lHeader & 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 lHeader::getNumberCols()
{ return ncols;
}
inline long lHeader::getNumberRows()
{ return nrows;
}
inline long lHeader::getNodataValue()
{ return nodataValue;
}
inline double lHeader::getDx()
{ return dx;
}
inline double lHeader::getDy()
{ return dy;
}
inline double lHeader::getXllcenter()
{ return xllcenter;
}
inline double lHeader::getYllcenter()
{ return yllcenter;
}
char * lHeader::getProjection()
{
if( projection.GetLength() > 0 )
{
return _strdup(projection);
}
else
return _strdup("");
}
char * lHeader::getNotes()
{
if( notes.GetLength() > 0 )
{
return _strdup(notes);
}
else
return _strdup("");
}
void lHeader::setNumberCols( long p_ncols )
{ ncols = p_ncols;
}
void lHeader::setNumberRows( long p_nrows )
{ nrows = p_nrows;
}
void lHeader::setNodataValue( long p_nodata_value )
{ nodataValue = p_nodata_value;
}
void lHeader::setDx( double p_dx )
{ if( p_dx > 0 )
dx = p_dx;
}
void lHeader::setDy( double p_dy )
{ if( p_dy > 0 )
dy = p_dy;
}
void lHeader::setXllcenter( double p_xllcenter )
{ xllcenter = p_xllcenter;
}
void lHeader::setYllcenter( double p_yllcenter )
{ yllcenter = p_yllcenter;
}
void lHeader::setProjection( const char * c_projection )
{ CString p_projection = c_projection;
projection = p_projection.Left( MAX_STRING_LENGTH );
}
void lHeader::setNotes( const char * c_notes )
{ CString p_notes = c_notes;
notes = p_notes.Left( MAX_STRING_LENGTH );
}