Tracore
|
#include <Grid.h>
Public Member Functions | |
Grid (int width_count, int height_count, double width, double height) | |
Grid (int width_count, int height_count, int depth_count, double width, double height, double depth) | |
void | SetValue (core::ObjectDataPtr value, int x, int y, int z=0) |
void | SetValue (core::ObjectDataPtr value, double x, double y, double z=0) |
core::ObjectDataPtr | GetValue (int x, int y, int z=0) const |
core::ObjectDataPtr | GetValue (double x, double y, double z=0.0) const |
int | GetWidthCount () const |
int | GetHeightCount () const |
int | GetDepthCount () const |
double | GetWidth () const |
double | GetHeight () const |
double | GetDepth () const |
void | PositionToIndex (double x, double y, double z, int &xi, int &yi, int &zi) const |
void | Convolve2D (int vicinity, double *mask, double multiplier) |
void | Convolve2D (util::Filter2D &filter) |
void | Convolve3D (int vicinity, double *mask, double multiplier) |
Class for storing values in a three dimensional grid. Can also be used for two dimensions but has a bit overhead.
util::Grid::Grid | ( | int | width_count, |
int | height_count, | ||
double | width, | ||
double | height | ||
) |
Creates a new two dimensional grid.
width_count | The number of elements on the x axis |
height_count | The number of elements on the y axis |
width | The size of the whole grid on the x axis |
height | The size of the whole grid on the y axis |
util::Grid::Grid | ( | int | width_count, |
int | height_count, | ||
int | depth_count, | ||
double | width, | ||
double | height, | ||
double | depth | ||
) |
Creates a new three dimensional grid.
width_count | The number of elements on the x axis |
height_count | The number of elements on the y axis |
depth_count | The number of elements on the z axis |
width | The size of the whole grid on the x axis |
height | The size of the whole grid on the y axis |
depth | The size of the whole grid on the z axis |
void util::Grid::Convolve2D | ( | int | vicinity, |
double * | mask, | ||
double | multiplier | ||
) |
Performs a 2D convolution.
vicinity | The size of the mask around the center (a 3x3 mask has a vicinity of 1) |
mask | The mask/kernel to use for the convolution |
multiplier | The value is multiplied with the result at the end of the convolution |
void util::Grid::Convolve2D | ( | util::Filter2D & | filter | ) |
Performs a 2D convolution.
filter | The 2D filter to use |
void util::Grid::Convolve3D | ( | int | vicinity, |
double * | mask, | ||
double | multiplier | ||
) |
Performs a 3D convolution.
vicinity | The size of the mask around the center (a 3x3 mask has a vicinity of 1) |
mask | The mask/kernel to use for the convolution |
multiplier | The value is multiplied with the result at the end of the convolution |
double util::Grid::GetDepth | ( | ) | const |
Gets the size of the whole grid on the z axis.
int util::Grid::GetDepthCount | ( | ) | const |
Gets the number of elements on the z axis.
double util::Grid::GetHeight | ( | ) | const |
Gets the size of the whole grid on the y axis.
int util::Grid::GetHeightCount | ( | ) | const |
Gets the number of elements on the y axis.
core::ObjectDataPtr util::Grid::GetValue | ( | int | x, |
int | y, | ||
int | z = 0 |
||
) | const |
Gets the value in the grid cell with the given index.
x | The x axis index |
y | The y axis index |
z | The z axis index |
core::ObjectDataPtr util::Grid::GetValue | ( | double | x, |
double | y, | ||
double | z = 0.0 |
||
) | const |
Gets the value in the grid cell at the given position.
x | The x axis value |
y | The y axis value |
z | The z axis value |
double util::Grid::GetWidth | ( | ) | const |
Gets the size of the whole grid on the x axis.
int util::Grid::GetWidthCount | ( | ) | const |
Gets the number of elements on the x axis.
void util::Grid::PositionToIndex | ( | double | x, |
double | y, | ||
double | z, | ||
int & | xi, | ||
int & | yi, | ||
int & | zi | ||
) | const |
Converts a 3D position to an 3D index.
x | The x axis value |
y | The y axis value |
z | The z axis value |
xi | The x axis index |
yi | The y axis index |
zi | The z axis index |
void util::Grid::SetValue | ( | core::ObjectDataPtr | value, |
int | x, | ||
int | y, | ||
int | z = 0 |
||
) |
Sets a value in the grid cell with the given index.
value | The value to set |
x | The x axis index |
y | The y axis index |
z | The z axis index |
void util::Grid::SetValue | ( | core::ObjectDataPtr | value, |
double | x, | ||
double | y, | ||
double | z = 0 |
||
) |
Sets a value in the grid cell at the given position.
value | The value to set |
x | The x axis value |
y | The y axis value |
z | The z axis value |