-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathFlowDirection.h
49 lines (43 loc) · 872 Bytes
/
FlowDirection.h
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
#ifndef FLOWDIRCTION_HEAD_H
#define FLOWDIRCTION_HEAD_H
#include <stdio.h>
static const unsigned char NODATA = 0;
class FlowDirection
{
protected:
int width;
int height;
unsigned char* pDir;
public:
FlowDirection()
{
pDir = NULL;
}
~FlowDirection()
{
delete[] pDir;
}
int getWidth() const
{
return width;
}
int getHeight() const
{
return height;
}
bool Allocate();
void freeMem();
unsigned char asByte(int row, int col) const;
void Set_Value(int row,int col, unsigned char z);
bool is_NoData(int row, int col) const;
void Assign_NoData();
int Get_NY() const;
int Get_NX() const;
unsigned char* getData() const;
void SetHeight(int height) ;
void SetWidth(int width);
bool is_InGrid(int row, int col) const;
float getLength(unsigned int dir);
bool nextCell(unsigned int& row, unsigned int& col, unsigned char dir) const;
};
#endif