cgv
|
Render data for rectangle geometry with support for the rectangle_renderer. More...
#include <rectangle_render_data.h>
Public Member Functions | |
void | clear () |
void | add_secondary_color (const ColorType &color) |
void | add_border_color (const ColorType &color) |
void | add_extent (const vec2 &extent) |
void | add_translation (const vec3 &translation) |
void | add_rotation (const quat &rotation) |
void | add_texcoord (const vec4 &texcoord) |
void | add (const vec3 &position, const vec2 &extent) |
void | add (const vec3 &position, const vec4 &texcoord) |
void | add (const vec3 &position, const ColorType &color, const vec2 &extent) |
void | add (const vec3 &position, const vec2 &extent, const quat &rotation) |
void | add (const vec3 &translation, const quat &rotation) |
void | fill_secondary_colors (const ColorType &color) |
void | fill_border_colors (const ColorType &color) |
void | fill_extents (const vec2 &extent) |
void | fill_translations (const vec3 &translation) |
void | fill_rotations (const quat &rotation) |
void | fill_texcoords (const vec4 &texcoord) |
void | add (const vec3 &position, const ColorType &color) |
![]() | |
size_t | size () |
Return the number of stored positions. | |
bool | empty () const |
Return whether this render data is empty. | |
void | clear () |
Clear the stored data and set state out of date. | |
void | set_out_of_date () |
Notify the render data about state changes. | |
size_t | render_count () |
Return the number of vertices that will be rendered. | |
const attribute_array_manager & | ref_attribute_array_manager () const |
Constant access to the private attribute_array_manager. | |
bool | init (context &ctx) |
Initialize the attribute array manager. | |
void | destruct (context &ctx) |
Destruct the attribute array manager and decrease the reference count of the used renderer. | |
void | early_transfer (context &ctx, RendererType &r) |
Perform a transfer of the stored data to the attribute_array right now. | |
bool | enable (context &ctx, RendererType &r, const RenderStyleType &s) |
Enable the render data for rendering. | |
bool | disable (context &ctx, RendererType &r) |
Disable the renderer and attribute_array. | |
void | draw (context &ctx, renderer &r, unsigned offset=0, int count=-1) |
Draw the stored geometry using the given renderer. | |
void | render (context &ctx, unsigned offset=0, int count=-1) |
Render the stored geometry. | |
void | render (context &ctx, const RenderStyleType &s, unsigned offset=0, int count=-1) |
Render the stored geometry using the given style. | |
void | render (context &ctx, RendererType &r, unsigned offset=0, int count=-1) |
Render the stored geometry using the given renderer. | |
void | render (context &ctx, RendererType &r, const RenderStyleType &s, unsigned offset=0, int count=-1) |
Render the stored geometry using the given renderer and style. | |
void | add_index (const uint32_t index) |
void | add_position (const vec3 &position) |
void | add_color (const ColorType &color) |
void | add (const vec3 &position, const ColorType &color) |
void | fill_colors (const ColorType &color) |
Public Attributes | |
std::vector< ColorType > | secondary_colors |
array of secondary colors | |
std::vector< ColorType > | border_colors |
array of border colors | |
std::vector< vec2 > | extents |
array of extents | |
std::vector< vec3 > | translations |
array of translations | |
std::vector< quat > | rotations |
array of rotations | |
std::vector< vec4 > | texcoords |
array of texcoords | |
cgv::data::optional< ColorType > | const_secondary_color |
optional constant secondary color used for all elements | |
cgv::data::optional< ColorType > | const_border_color |
optional constant border color used for all elements | |
cgv::data::optional< vec2 > | const_extent |
optional constant extent used for all elements | |
cgv::data::optional< vec3 > | const_translation |
optional constant translation used for all elements | |
cgv::data::optional< quat > | const_rotation |
optional constant rotation used for all elements | |
cgv::data::optional< vec4 > | const_texcoord |
optional constant texcoord used for all elements | |
![]() | |
RenderStyleType | style |
the default render style | |
std::vector< uint32_t > | indices |
array of indices used for optional indexed rendering | |
std::vector< vec3 > | positions |
array of positions | |
std::vector< ColorType > | colors |
array of colors | |
cgv::data::optional< ColorType > | const_color |
optional constant color used for all elements | |
Protected Member Functions | |
bool | transfer (context &ctx, rectangle_renderer &r) override |
See render_data_base::transfer. | |
void | set_const_attributes (context &ctx, rectangle_renderer &r) override |
See render_data_base::set_const_attributes. | |
![]() | |
virtual bool | transfer (context &ctx, RendererType &r) |
Transfers the data stored in members to the attribute array. | |
virtual void | set_const_attributes (context &ctx, RendererType &r) |
Set constant vertex attributes if present. | |
template<typename T > | |
void | fill (std::vector< T > &vector, const T &value) |
Template for filling a member array to the size of the render data. | |
Render data for rectangle geometry with support for the rectangle_renderer.
See render_data_base.
ColorType | The type used to represent colors. Must be cgv::render::rgb or cgv::render::rgba. |
Definition at line 12 of file rectangle_render_data.h.
|
inline |
Definition at line 362 of file render_data_base.h.
|
inline |
Definition at line 127 of file rectangle_render_data.h.
|
inline |
Definition at line 117 of file rectangle_render_data.h.
|
inline |
Definition at line 132 of file rectangle_render_data.h.
|
inline |
Definition at line 122 of file rectangle_render_data.h.
|
inline |
Definition at line 138 of file rectangle_render_data.h.
|
inline |
Definition at line 94 of file rectangle_render_data.h.
|
inline |
Definition at line 98 of file rectangle_render_data.h.
|
inline |
Definition at line 106 of file rectangle_render_data.h.
|
inline |
Definition at line 90 of file rectangle_render_data.h.
|
inline |
Definition at line 110 of file rectangle_render_data.h.
|
inline |
Definition at line 102 of file rectangle_render_data.h.
|
inline |
Definition at line 80 of file rectangle_render_data.h.
|
inline |
Definition at line 147 of file rectangle_render_data.h.
|
inline |
Definition at line 151 of file rectangle_render_data.h.
|
inline |
Definition at line 159 of file rectangle_render_data.h.
|
inline |
Definition at line 143 of file rectangle_render_data.h.
|
inline |
Definition at line 163 of file rectangle_render_data.h.
|
inline |
Definition at line 155 of file rectangle_render_data.h.
|
inlineoverrideprotected |
See render_data_base::set_const_attributes.
Definition at line 37 of file rectangle_render_data.h.
References cgv::render::rectangle_render_data< ColorType >::border_colors, cgv::render::rectangle_render_data< ColorType >::const_border_color, cgv::render::rectangle_render_data< ColorType >::const_extent, cgv::render::rectangle_render_data< ColorType >::const_rotation, cgv::render::rectangle_render_data< ColorType >::const_secondary_color, cgv::render::rectangle_render_data< ColorType >::const_texcoord, cgv::render::rectangle_render_data< ColorType >::const_translation, cgv::render::rectangle_render_data< ColorType >::extents, cgv::render::rectangle_render_data< ColorType >::rotations, cgv::render::rectangle_render_data< ColorType >::secondary_colors, cgv::render::rectangle_renderer::set_border_color(), cgv::render::render_data_base< RendererType, RenderStyleType, ColorType >::set_const_attributes(), cgv::render::rectangle_renderer::set_extent(), cgv::render::rectangle_renderer::set_rotation(), cgv::render::rectangle_renderer::set_secondary_color(), cgv::render::surface_renderer::set_texcoord(), cgv::render::rectangle_renderer::set_translation(), cgv::render::rectangle_render_data< ColorType >::texcoords, and cgv::render::rectangle_render_data< ColorType >::translations.
|
inlineoverrideprotected |
See render_data_base::transfer.
Definition at line 23 of file rectangle_render_data.h.
References cgv::render::rectangle_render_data< ColorType >::border_colors, cgv::render::rectangle_render_data< ColorType >::extents, cgv::render::rectangle_render_data< ColorType >::rotations, cgv::render::rectangle_render_data< ColorType >::secondary_colors, cgv::render::rectangle_render_data< ColorType >::texcoords, cgv::render::render_data_base< RendererType, RenderStyleType, ColorType >::transfer(), and cgv::render::rectangle_render_data< ColorType >::translations.
std::vector<ColorType> cgv::render::rectangle_render_data< ColorType >::border_colors |
array of border colors
Definition at line 57 of file rectangle_render_data.h.
Referenced by cgv::render::rectangle_render_data< ColorType >::set_const_attributes(), and cgv::render::rectangle_render_data< ColorType >::transfer().
cgv::data::optional<ColorType> cgv::render::rectangle_render_data< ColorType >::const_border_color |
optional constant border color used for all elements
Definition at line 70 of file rectangle_render_data.h.
Referenced by cgv::render::rectangle_render_data< ColorType >::set_const_attributes().
cgv::data::optional<vec2> cgv::render::rectangle_render_data< ColorType >::const_extent |
optional constant extent used for all elements
Definition at line 72 of file rectangle_render_data.h.
Referenced by cgv::app::navigator::finish_draw(), and cgv::render::rectangle_render_data< ColorType >::set_const_attributes().
cgv::data::optional<quat> cgv::render::rectangle_render_data< ColorType >::const_rotation |
optional constant rotation used for all elements
Definition at line 76 of file rectangle_render_data.h.
Referenced by cgv::render::rectangle_render_data< ColorType >::set_const_attributes().
cgv::data::optional<ColorType> cgv::render::rectangle_render_data< ColorType >::const_secondary_color |
optional constant secondary color used for all elements
Definition at line 68 of file rectangle_render_data.h.
Referenced by cgv::render::rectangle_render_data< ColorType >::set_const_attributes().
cgv::data::optional<vec4> cgv::render::rectangle_render_data< ColorType >::const_texcoord |
optional constant texcoord used for all elements
Definition at line 78 of file rectangle_render_data.h.
Referenced by cgv::render::rectangle_render_data< ColorType >::set_const_attributes().
cgv::data::optional<vec3> cgv::render::rectangle_render_data< ColorType >::const_translation |
optional constant translation used for all elements
Definition at line 74 of file rectangle_render_data.h.
Referenced by cgv::render::rectangle_render_data< ColorType >::set_const_attributes().
std::vector<vec2> cgv::render::rectangle_render_data< ColorType >::extents |
array of extents
Definition at line 59 of file rectangle_render_data.h.
Referenced by cgv::render::rectangle_render_data< ColorType >::set_const_attributes(), and cgv::render::rectangle_render_data< ColorType >::transfer().
std::vector<quat> cgv::render::rectangle_render_data< ColorType >::rotations |
array of rotations
Definition at line 63 of file rectangle_render_data.h.
Referenced by cgv::render::rectangle_render_data< ColorType >::set_const_attributes(), and cgv::render::rectangle_render_data< ColorType >::transfer().
std::vector<ColorType> cgv::render::rectangle_render_data< ColorType >::secondary_colors |
array of secondary colors
Definition at line 55 of file rectangle_render_data.h.
Referenced by cgv::render::rectangle_render_data< ColorType >::set_const_attributes(), and cgv::render::rectangle_render_data< ColorType >::transfer().
std::vector<vec4> cgv::render::rectangle_render_data< ColorType >::texcoords |
array of texcoords
Definition at line 65 of file rectangle_render_data.h.
Referenced by cgv::render::rectangle_render_data< ColorType >::set_const_attributes(), and cgv::render::rectangle_render_data< ColorType >::transfer().
std::vector<vec3> cgv::render::rectangle_render_data< ColorType >::translations |
array of translations
Definition at line 61 of file rectangle_render_data.h.
Referenced by cgv::render::rectangle_render_data< ColorType >::set_const_attributes(), and cgv::render::rectangle_render_data< ColorType >::transfer().