Public Member Functions | |
grid () | |
empty constructor More... | |
grid (unsigned int Nu, unsigned int Nv) | |
direct constructor with size More... | |
void | resize (unsigned int Nu, unsigned int Nv) |
resize the grid More... | |
unsigned int | size_u () const |
return the size in u direction More... | |
unsigned int | size_v () const |
return the size in v direction More... | |
const vec3 & | operator() (unsigned int ku, unsigned int kv) const |
Accessor to the value (ku,kv) More... | |
vec3 & | operator() (unsigned int ku, unsigned int kv) |
Accessor to the value (ku,kv) More... | |
patch4 | get_patch (unsigned int k_patch_u, unsigned int k_patch_v) const |
get a 4x4 patch More... | |
void | build_meshgrid () |
build Matlab meshgrid style from 1 to size More... | |
void | build_sphere () |
build spherical distribution More... | |
grid & | operator*= (float s) |
scale the grid homogeneously by a scalar More... | |
grid & | operator+= (const vec3 &t) |
translate the grid More... | |
grid & | operator-= (const vec3 &t) |
translate the grid More... | |
grid | operator- () const |
negation positions of the grid More... | |
void | add_back_u () |
add a line of grid in the u direction at the end More... | |
void | add_front_u () |
add a line of grid in the u direction at the beginning More... | |
void | add_back_v () |
add a line of grid in the v direction at the end More... | |
void | add_front_v () |
add a line of grid in the v direction at the beginning More... | |
void | suppress_back_u () |
suppress a line of grid in the u direction at the end More... | |
void | suppress_front_u () |
suppress a line of grid in the u direction at the beginning More... | |
void | suppress_back_v () |
suppress a line of grid in the v direction at the end More... | |
void | suppress_front_v () |
suppress a line of grid in the v direction at the beginning More... | |
void | duplicate_boundary () |
duplicate positions at the boundaries More... | |
void | write (const std::string &filename) |
Write grid into a file. More... | |
Static Public Member Functions | |
static grid | read (const std::string &filename) |
Read grid from a file. More... | |
Private Member Functions | |
void | assert_size (unsigned int ku, unsigned int kv) const |
ensure (ku,kv) is coherent with the size of the grid More... | |
Private Attributes | |
unsigned int | internal_size_u |
internal size u More... | |
unsigned int | internal_size_v |
internal size v More... | |
std::vector< vec3 > | internal_data |
Internal storage under the form: ku+Nu*kv. More... | |
Friends | |
grid | operator* (float s, const grid &g) |
scale the grid homogeneously by a scalar More... | |
grid | operator* (const grid &g, float s) |
scale the grid homogeneously by a scalar More... | |
grid | operator+ (const grid &g, const vec3 &t) |
translate the grid More... | |
grid | operator+ (const vec3 &t, const grid &g) |
translate the grid More... | |
grid | operator- (const grid &g, const vec3 &t) |
translate the grid More... | |
grid | operator- (const vec3 &t, const grid &g) |
translate the grid More... | |
cpe::grid::grid | ( | ) |
empty constructor
cpe::grid::grid | ( | unsigned int | Nu, |
unsigned int | Nv | ||
) |
direct constructor with size
References internal_data.
void cpe::grid::add_back_u | ( | ) |
add a line of grid in the u direction at the end
References internal_size_u, and internal_size_v.
void cpe::grid::add_back_v | ( | ) |
add a line of grid in the v direction at the end
References internal_size_u, and internal_size_v.
void cpe::grid::add_front_u | ( | ) |
add a line of grid in the u direction at the beginning
References internal_size_u, and internal_size_v.
void cpe::grid::add_front_v | ( | ) |
add a line of grid in the v direction at the beginning
References internal_size_u, and internal_size_v.
|
private |
ensure (ku,kv) is coherent with the size of the grid
References internal_size_u, internal_size_v, and cpe::string_converter::to_string().
Referenced by get_patch(), and operator()().
void cpe::grid::build_meshgrid | ( | ) |
build Matlab meshgrid style from 1 to size
References internal_data, internal_size_u, internal_size_v, cpe::vec3::x(), and cpe::vec3::y().
void cpe::grid::build_sphere | ( | ) |
build spherical distribution
References internal_size_u, and internal_size_v.
void cpe::grid::duplicate_boundary | ( | ) |
duplicate positions at the boundaries
References internal_size_u, and internal_size_v.
patch4 cpe::grid::get_patch | ( | unsigned int | k_patch_u, |
unsigned int | k_patch_v | ||
) | const |
get a 4x4 patch
References assert_size(), internal_data, and internal_size_u.
const vec3 & cpe::grid::operator() | ( | unsigned int | ku, |
unsigned int | kv | ||
) | const |
Accessor to the value (ku,kv)
References assert_size(), internal_data, and internal_size_u.
vec3 & cpe::grid::operator() | ( | unsigned int | ku, |
unsigned int | kv | ||
) |
Accessor to the value (ku,kv)
References assert_size(), internal_data, and internal_size_u.
grid & cpe::grid::operator*= | ( | float | s | ) |
scale the grid homogeneously by a scalar
References internal_data.
translate the grid
References internal_data.
grid cpe::grid::operator- | ( | ) | const |
negation positions of the grid
translate the grid
References internal_data.
|
static |
Read grid from a file.
void cpe::grid::resize | ( | unsigned int | Nu, |
unsigned int | Nv | ||
) |
resize the grid
References internal_data, internal_size_u, and internal_size_v.
unsigned int cpe::grid::size_u | ( | ) | const |
return the size in u direction
References internal_size_u.
Referenced by cpe::opengl_drawer::draw(), and cpe::opengl_drawer::draw_sphere().
unsigned int cpe::grid::size_v | ( | ) | const |
return the size in v direction
References internal_size_v.
Referenced by cpe::opengl_drawer::draw(), and cpe::opengl_drawer::draw_sphere().
void cpe::grid::suppress_back_u | ( | ) |
suppress a line of grid in the u direction at the end
References internal_size_u, and internal_size_v.
void cpe::grid::suppress_back_v | ( | ) |
suppress a line of grid in the v direction at the end
References internal_size_u, and internal_size_v.
void cpe::grid::suppress_front_u | ( | ) |
suppress a line of grid in the u direction at the beginning
References internal_size_u, and internal_size_v.
void cpe::grid::suppress_front_v | ( | ) |
suppress a line of grid in the v direction at the beginning
References internal_size_u, and internal_size_v.
void cpe::grid::write | ( | const std::string & | filename | ) |
Write grid into a file.
References internal_data, internal_size_u, internal_size_v, cpe::vec3::x(), cpe::vec3::y(), and cpe::vec3::z().
|
private |
Internal storage under the form: ku+Nu*kv.
Referenced by build_meshgrid(), get_patch(), grid(), operator()(), operator*=(), operator+=(), operator-=(), resize(), and write().
|
private |
internal size u
Referenced by add_back_u(), add_back_v(), add_front_u(), add_front_v(), assert_size(), build_meshgrid(), build_sphere(), duplicate_boundary(), get_patch(), operator()(), resize(), size_u(), suppress_back_u(), suppress_back_v(), suppress_front_u(), suppress_front_v(), and write().
|
private |
internal size v
Referenced by add_back_u(), add_back_v(), add_front_u(), add_front_v(), assert_size(), build_meshgrid(), build_sphere(), duplicate_boundary(), resize(), size_v(), suppress_back_u(), suppress_back_v(), suppress_front_u(), suppress_front_v(), and write().