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