#include <DTGrid3D.hpp>
Public Member Functions | |
DTGrid3D (char *, T, T) | |
DTGrid3D constructor. More... | |
~DTGrid3D () | |
DTGrid3D destructor. More... | |
T | accessxyz (int, int, int) |
Random access function. More... | |
bool | excl_accessxyz (int, int, int) |
T | access_fast (int, int, int) |
Random access function. More... | |
T * | getCell (T *, int, int, int) |
Random access to grid cells. More... | |
T * | getCell2 (T *, int, int, int) |
Random access to grid cells. (2nd version) More... | |
int | type_of_grid (void) |
Public Attributes | |
struct { | |
char * Title | |
int grdflag | |
int one | |
int idummy1 | |
int idummy2 | |
int idummy3 | |
int idummy4 | |
int idummy5 | |
float scale | |
float spacing | |
float dummy1 | |
float dummy2 | |
float dummy3 | |
float dummy4 | |
float dummy5 | |
float dummy6 | |
float dummy7 | |
struct dimensions { | |
int i | |
int j | |
int k | |
} dim | |
struct origin { | |
float x | |
float y | |
float z | |
} o | |
} | uhbd |
UHBD header information. More... | |
Protected Member Functions | |
void | getCellz (T *, int, int, int, typename ArrayPrs< K >::PairArray *) |
A random access function suited for excluded volume grids, based on the function. More... | |
void | getCellyz (T *, int, int, int, typename ArrayPrs< K >::PairArray *) |
Random access function for grid cells (y direction, DTGrid2D). More... | |
T | access_fast_z (int, typename ArrayPrs< K >::PairArray *) |
Random access function for DTGrid3D. More... | |
T | access_fast_yz (int, int, typename ArrayPrs< K >::PairArray *) |
Random access function for DTGrid2D. More... | |
Private Member Functions | |
void | set_value_list_3D (T *, int) |
DTGrid3D 'value' array setup. More... | |
void | set_zcoord_list (K *, int) |
zCoord array setup More... | |
void | set_ptr_list_3D (K *, int) |
acc (3D) array setup More... | |
void | set_gamma_values (T, T) |
Set the default gamma value. More... | |
void | set_projection2D (K *, K *, K *, K *, K *, K *, int, int, int, int, int, int) |
proj2D setup More... | |
void | set_uhbd_parameters (float, float, float, float, float, int, int, int) |
Reset pointers that temporarily store addresses for random access. More... | |
void | Reset_pointers_3D (void) |
void | test_format_dtgrid (char *) |
Determine the DT-Grid file format. More... | |
void | size_ds (unsigned int) |
Estimate the grid file size. More... | |
void | format_ascii (char *) |
Open and Read the ascii grid file. More... | |
void | format_binary (char *) |
Open and Read the binary grid file. More... | |
Private Attributes | |
ArrayReg< T > * | Value_List_3D |
ArrayPrs< K > * | Zcoord_List |
ArrayPtr< T, K > * | Ptr_List_3D |
DTGrid2D< T, K > * | proj2D |
int | Length_of_Value_List_3D |
int | Length_of_Zcoord_List |
int | Length_of_Ptr_List_3D |
T | gamma_i |
T | gamma_o |
int | iform |
grid file format: binary = 0; ascii = 1 More... | |
int | grid_type |
grid type: exclusion grid = 0; normal grid = 1 More... | |
T | scfct |
float | scale |
scaling factor More... | |
float | spacing |
struct { | |
int i | |
int j | |
int k | |
} | dimensions |
grid dimensions in x, y and z directions given by i, j and k, respectively More... | |
struct { | |
float x | |
float y | |
float z | |
} | origin |
hold the coordinates (in x, y and z) of the grid origin. More... | |
DTGrid3D< T, K >::DTGrid3D | ( | char * | file_name, |
T | scfct_i, | ||
T | gamma | ||
) |
DTGrid3D constructor.
file_name | input dt-grid file. |
scfct_i | scaling factor. |
gamma | user defined default value for grid points not stored in dt-grid. |
T DTGrid3D< T, K >::access_fast | ( | int | a, |
int | b, | ||
int | c | ||
) |
Random access function.
Faster (not significantly, though) implementation of random data access In SDA random cell access function is used. This function returns the data for a single grid point.
a | index x of the data value to be returned |
b | index y of the data value to be returned |
c | index z of the data value to be returned |
|
protected |
Random access function for DTGrid2D.
Check for the indices in 2D dt-grid. If the index b is found, call the random access function for the last index (c) in DTGrid3D.
b | index y of the data value to be returned |
c | index z of the data value to be returned |
coord2 | pointer to the index pair stored in yCoord array that list the indices to the first connected component in the 2D tubular grid. |
|
protected |
Random access function for DTGrid3D.
Check for the indices in 3D dt-grid. If the index c is found, return the value stored the 'value' array.
c | index z of the data value to be returned |
coord3 | pointer to the index pair stored in zCoord array that list the indices to the first connected component in the 3D tubular grid. |
T DTGrid3D< T, K >::accessxyz | ( | int | a, |
int | b, | ||
int | c | ||
) |
Random access function.
A different implementation of random data access function
a | index x of the data value to be returned |
b | index y of the data value to be returned |
c | index z of the data value to be returned |
bool DTGrid3D< T, K >::excl_accessxyz | ( | int | , |
int | , | ||
int | |||
) |
|
private |
Open and Read the ascii grid file.
file_ascii | name of the grid file. |
|
private |
Open and Read the binary grid file.
The header of a DT-Grid file is same as that of a UHBD file. Therefore the parameter definitions are identical.
file_binary | name of the grid file. |
T * DTGrid3D< T, K >::getCell | ( | T * | Cell, |
int | a, | ||
int | b, | ||
int | c | ||
) |
Random access to grid cells.
This function returns a cubic grid cell that contains the data stored in the grid point whose indices are input by the user, as well as the other 7 neighbor points that make up the 8 point grid cell. The given set of index: x, y and z defines the origin of the grid cell that is to be accessed. The other grid points are: {(x,y,z),(x,y,z+1),(x,y+1,z),(x,y+1,z+1),(x+1,y,z),(x+1,y+1,z),(x+1,y,z+1),(x+1,y+1,z+1)}
Cell | array to copy the values stored inside the grid cell that accessed randomly. |
a | index x of the origin of the data cell inside the complete grid to be returned. |
b | index y of the origin of the data cell inside the complete grid to be returned. |
c | index z of the origin of the data cell inside the complete grid to be returned. |
T * DTGrid3D< T, K >::getCell2 | ( | T * | Cell, |
int | a, | ||
int | b, | ||
int | c | ||
) |
Random access to grid cells. (2nd version)
This function assumes that there is only one connected component in DTGrid1D level. Structures, potential fields are usually one connected piece in 3D. So care should be taken when this function is used
Cell | array to copy the values stored inside the grid cell that accessed randomly. |
a | index x of the origin of the data cell inside the complete grid to be returned. |
b | index y of the origin of the data cell inside the complete grid to be returned. |
c | index z of the origin of the data cell inside the complete grid to be returned. |
|
protected |
Random access function for grid cells (y direction, DTGrid2D).
Call to this function returns the last function call (
Cell | array to copy the values stored inside the grid cell that accessed randomly. |
x | index of the grid cell point in x direction (0 or 1 for a 3dimensional cubic cell) |
b | index y of the origin of the data cell inside the complete grid to be returned. |
c | index z of the origin of the data cell inside the complete grid to be returned |
coord2 | pointer to the index pair stored in yCoord array that list the indices to the first connected component in the 2D tubular grid. |
Only b is inside the connected component
Only b+1 is inside the connected component
|
protected |
A random access function suited for excluded volume grids, based on the function.
This function is almost identical to 'accessxyz' except that it returns false instead of a user defined gamma_o value. Also, a pointer that holds an address into the value array is not required and therefore is not incremented. ('Value' array consists only of one member for excluded volume type of grid!)
a | index x of the data value to be returned |
b | index y of the data value to be returned |
c | index z of the data value to be returned Random access to grid cells in z direction. |
Call to this function fills the corresponding points in the cubic cell input by looking up the values from the actual grid.
Cell | array to copy the values stored inside the grid cell that accessed randomly. |
x | index of the grid cell point in x direction (0 or 1 for a 3dimensional cubic cell) |
y | index of the grid cell point in y direction (0 or 1 for a 3dimensional cubic cell) |
c | index z of the origin of the data cell inside the complete grid to be returned |
coord3 | pointer to the index pair stored in zCoord array that list the indices to the first connected component in the 3D tubular grid. |
|
private |
|
private |
Set the default gamma value.
Gamma is returned when a point to be accessed is determined to be outside the tubular grid.
g_i | value inside the closed region |
g_o | value outside the closed grid region |
|
private |
proj2D setup
Create an instance of a DTGrid2D class and set up this proj2D object that contain yCoord, acc (2D) and the 'value' (2D) arrays.
values1 | pointer to the 'value' array of the DTGrid2D. |
values2 | pointer to the yCoord array of the DTGrid2D. |
values3 | pointer to the acc array of the DTGrid2D. |
values4 | pointer (to be passed to DTGrid1D) to the 'value' array of the DTGrid1D. |
values5 | pointer (to be passed to DTGrid1D) to the xCoord array of the DTGrid1D. |
values6 | pointer (to be passed to DTGrid1D) to the acc array of the DTGrid1D. |
length1 | the length of the 'value' (2D) array. |
length2 | the length of the yCoord array. |
length3 | the length of the acc (2D) array. |
length4 | the length of the 'value' (1D) array. |
length5 | the length of the xcoord array. |
length6 | the length of the acc (1D) array. |
|
private |
acc (3D) array setup
Read and store the list of pointers to the first member of each of the connected components in an N-dimensional dt-grid.
values | a pointer to the array that stores the acc array indices. |
length | the length of the acc array. |
|
private |
Reset pointers that temporarily store addresses for random access.
The function is not required when the pointers are not used as global variables. Read and set the grid parameters.
These parameters are inherited from the UHBD file format and kept in DTGrid files.
sc | the scaling factor. |
sp | the uniform spacing value of the grid. |
ox | coordinate x of the origin. |
oy | coordinate y of the origin. |
oz | coordinate z of the origin. |
dimi | dimension of the grid in x direction. |
dimj | dimension of the grid in y direction. |
dimk | dimension of the grid in z direction. |
|
private |
DTGrid3D 'value' array setup.
Read the 3D 'value' array and store.
values | pointer to the array that stores the 'value' array. |
length | the length of the 'value' array. |
|
private |
zCoord array setup
Read and store the zCoord array that stores in minimum and maximum coordinates of the connected components in z direction.
values | a pointer that holds the zCoord array. |
length | the length of the zCoord array. |
|
private |
Estimate the grid file size.
val | size of file in bytes |
|
private |
Determine the DT-Grid file format.
This function opens and reads the dt-grid file in order to determine whether it is binary or ASCII.
Input | name of input dt-grid file. |
If binary, the first value stored is an integer, 160.
|
inline |
struct { ... } ::dimensions DTGrid3D< T, K >::dim |
struct { ... } DTGrid3D< T, K >::dimensions |
grid dimensions in x, y and z directions given by i, j and k, respectively
WARNING!!! definining the variables below in here instead of in functions is not parallel-safe! Private members for use inside accessxyz! Do not use outside this function!
float DTGrid3D< T, K >::dummy1 |
float DTGrid3D< T, K >::dummy2 |
float DTGrid3D< T, K >::dummy3 |
float DTGrid3D< T, K >::dummy4 |
float DTGrid3D< T, K >::dummy5 |
float DTGrid3D< T, K >::dummy6 |
float DTGrid3D< T, K >::dummy7 |
|
private |
|
private |
int DTGrid3D< T, K >::grdflag |
|
private |
grid type: exclusion grid = 0; normal grid = 1
int DTGrid3D< T, K >::i |
int DTGrid3D< T, K >::idummy1 |
int DTGrid3D< T, K >::idummy2 |
int DTGrid3D< T, K >::idummy3 |
int DTGrid3D< T, K >::idummy4 |
int DTGrid3D< T, K >::idummy5 |
|
private |
grid file format: binary = 0; ascii = 1
int DTGrid3D< T, K >::j |
int DTGrid3D< T, K >::k |
|
private |
|
private |
|
private |
int DTGrid3D< T, K >::one |
struct { ... } DTGrid3D< T, K >::origin |
hold the coordinates (in x, y and z) of the grid origin.
|
private |
scaling factor
|
private |
|
private |
char* DTGrid3D< T, K >::Title |
float DTGrid3D< T, K >::x |
float DTGrid3D< T, K >::y |
float DTGrid3D< T, K >::z |