cpe::grid Class Reference
+ Collaboration diagram for cpe::grid:

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 vec3operator() (unsigned int ku, unsigned int kv) const
 Accessor to the value (ku,kv) More...
 
vec3operator() (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...
 
gridoperator*= (float s)
 scale the grid homogeneously by a scalar More...
 
gridoperator+= (const vec3 &t)
 translate the grid More...
 
gridoperator-= (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< vec3internal_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...
 

Constructor & Destructor Documentation

cpe::grid::grid ( )

empty constructor

cpe::grid::grid ( unsigned int  Nu,
unsigned int  Nv 
)

direct constructor with size

References internal_data.

Member Function Documentation

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.

void cpe::grid::assert_size ( unsigned int  ku,
unsigned int  kv 
) const
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()().

+ Here is the call graph for this function:

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().

+ Here is the call graph for this function:

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.

+ Here is the call graph for this function:

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.

+ Here is the call graph for this function:

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.

+ Here is the call graph for this function:

grid & cpe::grid::operator*= ( float  s)

scale the grid homogeneously by a scalar

References internal_data.

grid & cpe::grid::operator+= ( const vec3 t)

translate the grid

References internal_data.

grid cpe::grid::operator- ( ) const

negation positions of the grid

grid & cpe::grid::operator-= ( const vec3 t)

translate the grid

References internal_data.

grid cpe::grid::read ( const std::string &  filename)
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().

+ Here is the call graph for this function:

Friends And Related Function Documentation

grid operator* ( float  s,
const grid g 
)
friend

scale the grid homogeneously by a scalar

grid operator* ( const grid g,
float  s 
)
friend

scale the grid homogeneously by a scalar

grid operator+ ( const grid g,
const vec3 t 
)
friend

translate the grid

grid operator+ ( const vec3 t,
const grid g 
)
friend

translate the grid

grid operator- ( const grid g,
const vec3 t 
)
friend

translate the grid

grid operator- ( const vec3 t,
const grid g 
)
friend

translate the grid

Member Data Documentation

std::vector<vec3> cpe::grid::internal_data
private

Internal storage under the form: ku+Nu*kv.

Referenced by build_meshgrid(), get_patch(), grid(), operator()(), operator*=(), operator+=(), operator-=(), resize(), and write().


The documentation for this class was generated from the following files: