cgv
Loading...
Searching...
No Matches
cgv::media::colored_model Class Reference

coordinate type independent base class of simple mesh data structure that handles indices and colors. More...

#include <colored_model.h>

Inheritance diagram for cgv::media::colored_model:
cgv::media::mesh::simple_mesh_base cgv::media::mesh::idx_type< T > cgv::media::mesh::simple_mesh< T > cgv::media::mesh::simple_mesh< float > cgv::media::mesh::simple_mesh< T > cgv::media::mesh::dynamic_mesh< float > cgv::media::mesh::dynamic_mesh< T > cgv::media::mesh::adaptive_skinned_mesh< T >

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

Detailed Description

coordinate type independent base class of simple mesh data structure that handles indices and colors.

Definition at line 11 of file colored_model.h.

Constructor & Destructor Documentation

◆ colored_model() [1/3]

cgv::media::colored_model::colored_model ( )

◆ colored_model() [2/3]

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(), color_storage_ptr, and colored_model().

◆ colored_model() [3/3]

cgv::media::colored_model::colored_model ( colored_model && cm)

move constructur

Definition at line 18 of file colored_model.cxx.

References color_storage_ptr, and colored_model().

◆ ~colored_model()

cgv::media::colored_model::~colored_model ( )
virtual

destruct colored model

Definition at line 37 of file colored_model.cxx.

References color_storage_ptr.

Member Function Documentation

◆ destruct_colors()

void cgv::media::colored_model::destruct_colors ( )

destruct color storage

Definition at line 167 of file colored_model.cxx.

References color_storage_ptr.

Referenced by cgv::media::mesh::simple_mesh< T >::clear().

◆ ensure_colors()

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.

Referenced by cgv::media::mesh::simple_mesh< T >::read(), and resize_colors().

◆ get_color_data_ptr()

const void * cgv::media::colored_model::get_color_data_ptr ( ) const

Definition at line 119 of file colored_model.cxx.

◆ get_color_data_vector_ptr()

const void * cgv::media::colored_model::get_color_data_vector_ptr ( ) const

Definition at line 123 of file colored_model.cxx.

◆ get_color_size()

size_t cgv::media::colored_model::get_color_size ( ) const

◆ get_color_storage_type()

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.

Referenced by cgv::render::mesh_render_info::construct_index_buffers().

◆ get_nr_colors()

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.

Referenced by cgv::media::mesh::simple_mesh< T >::extract_vertex_attribute_buffer().

◆ has_colors()

◆ operator=() [1/2]

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, and colored_model().

◆ operator=() [2/2]

colored_model & cgv::media::colored_model::operator= ( const colored_model & cm)

◆ put_color() [1/5]

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, and has_colors().

◆ put_color() [2/5]

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, and has_colors().

◆ put_color() [3/5]

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, and has_colors().

◆ put_color() [4/5]

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, and has_colors().

◆ put_color() [5/5]

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, and has_colors().

Referenced by cgv::media::mesh::simple_mesh< T >::extract_vertex_attribute_buffer().

◆ ref_color_data_ptr()

void * cgv::media::colored_model::ref_color_data_ptr ( )

Definition at line 127 of file colored_model.cxx.

◆ ref_color_data_vector_ptr()

void * cgv::media::colored_model::ref_color_data_vector_ptr ( )

Definition at line 131 of file colored_model.cxx.

◆ resize_colors()

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, and ensure_colors().

◆ set_color() [1/5]

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, and has_colors().

◆ set_color() [2/5]

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, and has_colors().

◆ set_color() [3/5]

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, and has_colors().

◆ set_color() [4/5]

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, and has_colors().

◆ set_color() [5/5]

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, and has_colors().

Member Data Documentation

◆ color_storage_ptr


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