cgv
|
A base class for storing render data usable with the box_renderer and box_wire_renderer. More...
#include <box_render_data_base.h>
Public Member Functions | |
void | clear () |
void | add_extent (const vec3 &extent) |
void | add_translation (const vec3 &translation) |
void | add_rotation (const quat &rotation) |
void | add (const vec3 &position, const vec3 &extent) |
void | add (const vec3 &position, const vec3 &extent, const quat &rotation) |
void | add (const vec3 &position, const vec3 &extent, const ColorType &color) |
void | add (const vec3 &translation, const quat &rotation) |
void | fill_extents (const vec3 &extent) |
void | fill_translations (const vec3 &translation) |
void | fill_rotations (const quat &rotation) |
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< vec3 > | extents |
array of extents | |
std::vector< vec3 > | translations |
array of translations | |
std::vector< quat > | rotations |
array of rotations | |
![]() | |
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, RendererType &r) override |
See render_data_base::transfer. | |
![]() | |
virtual RendererType & | ref_renderer_singleton (context &ctx, int ref_count_change=0)=0 |
Manage the singleton of the used renderer. | |
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. | |
A base class for storing render data usable with the box_renderer and box_wire_renderer.
See render_data_base.
RendererType | The type of the used renderer. Must be derived from cgv::render::renderer. |
renderStyleType | The type of the used render style. Must be supported by RendererType. |
ColorType | The type used to represent colors. Must be cgv::render::rgb or cgv::render::rgba. |
Definition at line 13 of file box_render_data_base.h.
|
inline |
Definition at line 362 of file render_data_base.h.
|
inline |
Definition at line 60 of file box_render_data_base.h.
|
inline |
Definition at line 71 of file box_render_data_base.h.
|
inline |
Definition at line 65 of file box_render_data_base.h.
|
inline |
Definition at line 76 of file box_render_data_base.h.
|
inline |
Definition at line 45 of file box_render_data_base.h.
|
inline |
Definition at line 53 of file box_render_data_base.h.
|
inline |
Definition at line 49 of file box_render_data_base.h.
|
inline |
Definition at line 38 of file box_render_data_base.h.
|
inline |
Definition at line 81 of file box_render_data_base.h.
|
inline |
Definition at line 89 of file box_render_data_base.h.
|
inline |
Definition at line 85 of file box_render_data_base.h.
|
inlineoverrideprotectedvirtual |
See render_data_base::transfer.
Reimplemented from cgv::render::render_data_base< RendererType, RenderStyleType, ColorType >.
Definition at line 20 of file box_render_data_base.h.
References cgv::render::box_render_data_base< RendererType, RenderStyleType, ColorType >::extents, cgv::render::box_render_data_base< RendererType, RenderStyleType, ColorType >::rotations, cgv::render::render_data_base< RendererType, RenderStyleType, ColorType >::transfer(), and cgv::render::box_render_data_base< RendererType, RenderStyleType, ColorType >::translations.
std::vector<vec3> cgv::render::box_render_data_base< RendererType, RenderStyleType, ColorType >::extents |
array of extents
Definition at line 32 of file box_render_data_base.h.
Referenced by cgv::render::box_render_data_base< RendererType, RenderStyleType, ColorType >::transfer().
std::vector<quat> cgv::render::box_render_data_base< RendererType, RenderStyleType, ColorType >::rotations |
array of rotations
Definition at line 36 of file box_render_data_base.h.
Referenced by cgv::render::box_render_data_base< RendererType, RenderStyleType, ColorType >::transfer().
std::vector<vec3> cgv::render::box_render_data_base< RendererType, RenderStyleType, ColorType >::translations |
array of translations
Definition at line 34 of file box_render_data_base.h.
Referenced by cgv::render::box_render_data_base< RendererType, RenderStyleType, ColorType >::transfer().