Files Classes Functions Hierarchy
#include <meshrect.h>
Public Member Functions | |
| pt3 & | pij (uintc i, uintc j) |
| i is the x-axis, j is the y-axis. | |
| pt3 const & | pij (uintc i, uintc j) const |
| i is the x-axis, j is the y-axis. | |
| meshrect (uintc M_, uintc N_) | |
| Create a surface of points with uniform x and y values between and includeing [0.0,1.0]. | |
| ~meshrect () | |
| Cleanup. | |
| template<typename F > | |
| void | func (F &f) |
| Apply a function over the surface to calculate the z value. | |
| void | print () const |
| Print the mesh as a 2D array. | |
Public Attributes | |
| uintc | M |
| M partitions of X-axis. | |
| uintc | N |
| N partitions of Y-axis. | |
| pt3 * | mat |
| The points in the 2D matrix. | |
(x,y) defines the surface with height z.
Definition at line 14 of file meshrect.h.
Create a surface of points with uniform x and y values between and includeing [0.0,1.0].
Definition at line 7 of file meshrect.cpp.
References M, mat, N, and pij().
00008 : M(M_), N(N_) 00009 { 00010 mat = new pt3[M*N]; 00011 assert(mat!=0); 00012 00013 double const dx = 1.0/((double)M-1.0); 00014 double const dy = 1.0/((double)N-1.0); 00015 00016 for (uint j=0; j<N; ++j) 00017 { 00018 for (uint i=0; i<M; ++i) 00019 pij(i,j) = pt3(dx*i,dy*(N-1-j),0.0); 00020 } 00021 }
| meshrect::~meshrect | ( | ) |
Cleanup.
Definition at line 23 of file meshrect.cpp.
References mat.
00024 { 00025 delete[] mat; 00026 }
| void meshrect::func | ( | F & | f | ) | [inline] |
i is the x-axis, j is the y-axis.
Definition at line 28 of file meshrect.h.
Referenced by meshrect(), and print().
| void meshrect::print | ( | ) | const |
M partitions of X-axis.
Definition at line 19 of file meshrect.h.
Referenced by func(), meshrect(), and print().
The points in the 2D matrix.
Definition at line 25 of file meshrect.h.
Referenced by func(), meshrect(), pij(), and ~meshrect().
N partitions of Y-axis.
Definition at line 22 of file meshrect.h.
Referenced by func(), meshrect(), pij(), and print().
1.5.8