#include <DTGrid3Dex.hpp>
Public Member Functions | |
DTGrid3Dex (char *) | |
DTGrid3Dex constructor. More... | |
~DTGrid3Dex () | |
DTGrid3Dex destructor. More... | |
bool | accessxyz (int, int, int) |
Random access function. More... | |
bool * | getCell (bool *, int, int, int) |
Random access to grid cells. More... | |
bool * | getCell2 (bool *, int, int, int) |
Random access to grid cells. (2nd version) More... | |
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 (bool *, int, int, int, typename ArrayPrs< int >::PairArray *) |
Random access to grid cells in z direction. More... | |
void | getCellyz (bool *, int, int, int, typename ArrayPrs< int >::PairArray *) |
Random access function for grid cells (y direction, DTGrid2D). More... | |
Private Member Functions | |
void | set_zcoord_list (int *, int) |
zCoord array setup More... | |
void | set_projection2D (int *, int *, int *, int *, int *, int *, int, int, int, int, int, int) |
proj2D setup More... | |
void | set_uhbd_parameters (float, float, float, float, float, int, int, int) |
Read and set the grid parameters. 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< bool > * | Value_List_3D |
ArrayPrs< int > * | Zcoord_List |
ArrayPtr< bool, int > * | Ptr_List_3D |
DTGrid2D< bool, int > * | proj2D |
int | Length_of_Value_List_3D |
int | Length_of_Zcoord_List |
int | Length_of_Ptr_List_3D |
int | iform |
grid file format: binary = 0; ascii = 1 More... | |
int | grid_type |
grid type: exclusion grid = 0; normal grid = 1 More... | |
float | scale |
float | spacing |
not used for data scaling More... | |
struct { | |
int i | |
int j | |
int k | |
} | dimensions |
grid resolution More... | |
struct { | |
float x | |
float y | |
float z | |
} | origin |
hold the coordinates (in x, y and z) of the grid origin. More... | |
DTGrid3Dex::DTGrid3Dex | ( | char * | file_name | ) |
DTGrid3Dex constructor.
file_name | input dt-grid file. |
DTGrid3Dex::~DTGrid3Dex | ( | ) |
DTGrid3Dex destructor.
bool DTGrid3Dex::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 |
|
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. |
bool * DTGrid3Dex::getCell | ( | bool * | 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. |
bool * DTGrid3Dex::getCell2 | ( | bool * | 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. |
|
protected |
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 |
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 |
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 |
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. |
struct { ... } ::dimensions DTGrid3Dex::dim |
struct { ... } DTGrid3Dex::dimensions |
grid resolution
grid dimensions in x, y and z directions given by i, j and k, respectively
float DTGrid3Dex::dummy1 |
float DTGrid3Dex::dummy2 |
float DTGrid3Dex::dummy3 |
float DTGrid3Dex::dummy4 |
float DTGrid3Dex::dummy5 |
float DTGrid3Dex::dummy6 |
float DTGrid3Dex::dummy7 |
int DTGrid3Dex::grdflag |
|
private |
grid type: exclusion grid = 0; normal grid = 1
int DTGrid3Dex::i |
int DTGrid3Dex::idummy1 |
int DTGrid3Dex::idummy2 |
int DTGrid3Dex::idummy3 |
int DTGrid3Dex::idummy4 |
int DTGrid3Dex::idummy5 |
|
private |
grid file format: binary = 0; ascii = 1
int DTGrid3Dex::j |
int DTGrid3Dex::k |
|
private |
|
private |
|
private |
struct { ... } ::origin DTGrid3Dex::o |
int DTGrid3Dex::one |
struct { ... } DTGrid3Dex::origin |
hold the coordinates (in x, y and z) of the grid origin.
|
private |
|
private |
|
private |
|
private |
not used for data scaling
char* DTGrid3Dex::Title |
struct { ... } DTGrid3Dex::uhbd |
UHBD header information.
|
private |
float DTGrid3Dex::x |
float DTGrid3Dex::y |
float DTGrid3Dex::z |
|
private |