cgv
|
coordinate type independent base class of simple mesh data structure that handles indices and colors. More...
#include <colored_model.h>
Public Member Functions | |
colored_model () | |
construct colored model | |
colored_model (const colored_model &cm) | |
copy constructur | |
colored_model (colored_model &&cm) | |
move constructur | |
colored_model & | operator= (const colored_model &cm) |
assignment operator | |
colored_model & | operator= (colored_model &&cm) |
move assignment operator | |
virtual | ~colored_model () |
destruct colored model | |
access to colors | |
bool | has_colors () const |
check whether colors have been allocated | |
void | set_color (size_t i, const void *col_ptr) |
set i-th color to color of type stored in storage | |
void | set_color (size_t i, const rgb &col) |
set i-th color from color of type rgb | |
void | set_color (size_t i, const rgb8 &col) |
set i-th color from color of type rgba | |
void | set_color (size_t i, const rgba &col) |
set i-th color from color of type rgb8 | |
void | set_color (size_t i, const rgba8 &col) |
set i-th color from color of type rgba8 | |
void | put_color (size_t i, void *col_ptr) const |
set color of type stored in storage to i-th color | |
void | put_color (size_t i, rgb &col) const |
set color of type rgb to i-th color | |
void | put_color (size_t i, rgba &col) const |
set color of type rgba to i-th color | |
void | put_color (size_t i, rgb8 &col) const |
set color of type rgb8 to i-th color | |
void | put_color (size_t i, rgba8 &col) const |
set color of type rgba8 to i-th color | |
size_t | get_nr_colors () const |
return number of allocated colors | |
void | resize_colors (size_t nr_colors) |
resize the color storage to given number of colors | |
size_t | get_color_size () const |
return the size of one allocated color in byte | |
ColorType | get_color_storage_type () const |
return storage type of colors, if no colors are allocated CT_RGBA8 is returned | |
const void * | get_color_data_ptr () const |
const void * | get_color_data_vector_ptr () const |
void * | ref_color_data_ptr () |
void * | ref_color_data_vector_ptr () |
void | ensure_colors (ColorType _color_type, size_t nr_colors=-1) |
ensure that colors are allocated and of given storage type | |
void | destruct_colors () |
destruct color storage | |
Protected Attributes | |
abst_color_storage * | color_storage_ptr |
pointer to color storage | |
coordinate type independent base class of simple mesh data structure that handles indices and colors.
Definition at line 11 of file colored_model.h.
cgv::media::colored_model::colored_model | ( | ) |
construct colored model
Definition at line 8 of file colored_model.cxx.
References color_storage_ptr.
cgv::media::colored_model::colored_model | ( | const colored_model & | cm | ) |
copy constructur
Definition at line 13 of file colored_model.cxx.
References cgv::media::abst_color_storage::clone(), and color_storage_ptr.
cgv::media::colored_model::colored_model | ( | colored_model && | cm | ) |
|
virtual |
destruct colored model
Definition at line 37 of file colored_model.cxx.
References color_storage_ptr.
void cgv::media::colored_model::destruct_colors | ( | ) |
destruct color storage
Definition at line 167 of file colored_model.cxx.
References color_storage_ptr.
void cgv::media::colored_model::ensure_colors | ( | ColorType | _color_type, |
size_t | nr_colors = -1 |
||
) |
ensure that colors are allocated and of given storage type
Only in case of new allocation, the second parameter is used to define the number of colors
Definition at line 140 of file colored_model.cxx.
References color_storage_ptr, cgv::media::abst_color_storage::get_color_type(), and cgv::media::abst_color_storage::resize().
Referenced by resize_colors().
const void * cgv::media::colored_model::get_color_data_ptr | ( | ) | const |
Definition at line 119 of file colored_model.cxx.
const void * cgv::media::colored_model::get_color_data_vector_ptr | ( | ) | const |
Definition at line 123 of file colored_model.cxx.
size_t cgv::media::colored_model::get_color_size | ( | ) | const |
return the size of one allocated color in byte
Definition at line 115 of file colored_model.cxx.
References color_storage_ptr, and cgv::media::abst_color_storage::get_color_size().
Referenced by cgv::media::mesh::simple_mesh_base::extract_vertex_attribute_buffer_base().
ColorType cgv::media::colored_model::get_color_storage_type | ( | ) | const |
return storage type of colors, if no colors are allocated CT_RGBA8 is returned
Definition at line 135 of file colored_model.cxx.
References color_storage_ptr, and cgv::media::abst_color_storage::get_color_type().
Referenced by cgv::render::mesh_render_info::construct_index_buffers().
size_t cgv::media::colored_model::get_nr_colors | ( | ) | const |
return number of allocated colors
Definition at line 102 of file colored_model.cxx.
References color_storage_ptr, and cgv::media::abst_color_storage::get_nr_colors().
Referenced by cgv::media::mesh::simple_mesh_obj_reader< T >::process_color().
bool cgv::media::colored_model::has_colors | ( | ) | const |
check whether colors have been allocated
Definition at line 45 of file colored_model.cxx.
References color_storage_ptr.
Referenced by cgv::render::mesh_render_info::construct(), cgv::media::mesh::simple_mesh_base::extract_vertex_attribute_buffer_base(), put_color(), put_color(), put_color(), put_color(), put_color(), set_color(), set_color(), set_color(), set_color(), and set_color().
colored_model & cgv::media::colored_model::operator= | ( | colored_model && | cm | ) |
move assignment operator
Definition at line 30 of file colored_model.cxx.
References color_storage_ptr.
colored_model & cgv::media::colored_model::operator= | ( | const colored_model & | cm | ) |
assignment operator
Definition at line 24 of file colored_model.cxx.
References cgv::media::abst_color_storage::clone(), and color_storage_ptr.
Referenced by cgv::media::mesh::simple_mesh_base::operator=(), and cgv::media::mesh::simple_mesh_base::operator=().
void cgv::media::colored_model::put_color | ( | size_t | i, |
rgb & | col | ||
) | const |
set color of type rgb to i-th color
Definition at line 76 of file colored_model.cxx.
References color_storage_ptr, has_colors(), and cgv::media::abst_color_storage::put_color().
void cgv::media::colored_model::put_color | ( | size_t | i, |
rgb8 & | col | ||
) | const |
set color of type rgb8 to i-th color
Definition at line 91 of file colored_model.cxx.
References color_storage_ptr, has_colors(), and cgv::media::abst_color_storage::put_color().
void cgv::media::colored_model::put_color | ( | size_t | i, |
rgba & | col | ||
) | const |
set color of type rgba to i-th color
Definition at line 86 of file colored_model.cxx.
References color_storage_ptr, has_colors(), and cgv::media::abst_color_storage::put_color().
void cgv::media::colored_model::put_color | ( | size_t | i, |
rgba8 & | col | ||
) | const |
set color of type rgba8 to i-th color
Definition at line 96 of file colored_model.cxx.
References color_storage_ptr, has_colors(), and cgv::media::abst_color_storage::put_color().
void cgv::media::colored_model::put_color | ( | size_t | i, |
void * | col_ptr | ||
) | const |
set color of type stored in storage to i-th color
Definition at line 81 of file colored_model.cxx.
References color_storage_ptr, has_colors(), and cgv::media::abst_color_storage::put_color().
void * cgv::media::colored_model::ref_color_data_ptr | ( | ) |
Definition at line 127 of file colored_model.cxx.
void * cgv::media::colored_model::ref_color_data_vector_ptr | ( | ) |
Definition at line 131 of file colored_model.cxx.
void cgv::media::colored_model::resize_colors | ( | size_t | nr_colors | ) |
resize the color storage to given number of colors
Definition at line 107 of file colored_model.cxx.
References color_storage_ptr, ensure_colors(), and cgv::media::abst_color_storage::resize().
Referenced by cgv::media::mesh::simple_mesh_obj_reader< T >::process_color().
void cgv::media::colored_model::set_color | ( | size_t | i, |
const rgb & | col | ||
) |
set i-th color from color of type rgb
Definition at line 55 of file colored_model.cxx.
References color_storage_ptr, has_colors(), and cgv::media::abst_color_storage::set_color().
void cgv::media::colored_model::set_color | ( | size_t | i, |
const rgb8 & | col | ||
) |
set i-th color from color of type rgba
Definition at line 65 of file colored_model.cxx.
References color_storage_ptr, has_colors(), and cgv::media::abst_color_storage::set_color().
void cgv::media::colored_model::set_color | ( | size_t | i, |
const rgba & | col | ||
) |
set i-th color from color of type rgb8
Definition at line 60 of file colored_model.cxx.
References color_storage_ptr, has_colors(), and cgv::media::abst_color_storage::set_color().
void cgv::media::colored_model::set_color | ( | size_t | i, |
const rgba8 & | col | ||
) |
set i-th color from color of type rgba8
Definition at line 70 of file colored_model.cxx.
References color_storage_ptr, has_colors(), and cgv::media::abst_color_storage::set_color().
void cgv::media::colored_model::set_color | ( | size_t | i, |
const void * | col_ptr | ||
) |
set i-th color to color of type stored in storage
Definition at line 50 of file colored_model.cxx.
References color_storage_ptr, has_colors(), and cgv::media::abst_color_storage::set_color().
Referenced by cgv::media::mesh::simple_mesh_obj_reader< T >::process_color().
|
protected |
pointer to color storage
Definition at line 15 of file colored_model.h.
Referenced by colored_model(), colored_model(), colored_model(), destruct_colors(), ensure_colors(), get_color_size(), get_color_storage_type(), get_nr_colors(), has_colors(), operator=(), operator=(), put_color(), put_color(), put_color(), put_color(), put_color(), resize_colors(), set_color(), set_color(), set_color(), set_color(), set_color(), and ~colored_model().