-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathXYGRID.H
More file actions
26 lines (21 loc) · 729 Bytes
/
XYGRID.H
File metadata and controls
26 lines (21 loc) · 729 Bytes
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
#ifndef XYGRID_H
#define XYGRID_H
class xyGridClass
// Define a simple class to handle the definition of a rectangular grid
// representing a surface - this one rotated.
{
private:
struct point2d { int ix; int iy; } ;
point2d *zgrid; // z[i][j]
int nx, ny; // save actual size of the array.
public:
xyGridClass(int i,int j);
void New(int i, int j);
void set( int i, int j, int x, int y);
int x( int i, int j ) { return zgrid[j*nx+i].ix ;}
int y( int i, int j ) { return zgrid[j*nx+i].iy ;}
int xsize() { return nx; }
int ysize() { return ny; }
~xyGridClass() { delete[] zgrid;}
};
#endif