cgv
Loading...
Searching...
No Matches
cgv::render::rectangle_renderer Class Reference

renderer that supports plane rendering More...

#include <rectangle_renderer.h>

Inheritance diagram for cgv::render::rectangle_renderer:
cgv::render::surface_renderer cgv::render::group_renderer cgv::render::renderer

Public Member Functions

void set_y_view_angle (float y_view_angle)
 
void enable_attribute_array_manager (const context &ctx, attribute_array_manager &aam)
 call this before setting attribute arrays to manage attribute array in given manager
 
void disable_attribute_array_manager (const context &ctx, attribute_array_manager &aam)
 call this after last render/draw call to ensure that no other users of renderer change attribute arrays of given manager
 
bool init (context &ctx)
 call init() once before using renderer
 
void set_position_is_center (bool _position_is_center)
 set the flag of the render style, whether the position is interpreted as the box center
 
template<typename T >
void set_extent (const context &ctx, const cgv::math::fvec< T, 2U > &extent)
 specify a single extent for all boxes
 
template<typename T >
void set_extent_array (const context &ctx, const std::vector< cgv::math::fvec< T, 2U > > &extents)
 extent array specifies plane side lengths from origin to edge
 
template<typename T >
void set_extent_array (const context &ctx, const cgv::math::fvec< T, 2U > *extents, size_t nr_elements, unsigned stride_in_bytes=0)
 extent array specifies plane side lengths from origin to edge
 
void remove_extent_array (const context &ctx)
 remove the extent attribute
 
template<typename T >
void set_rectangle (const context &ctx, const cgv::media::axis_aligned_box< T, 2 > &box)
 specify a single rectangle without array. This sets position_is_center to false as well as position and extent array
 
template<typename T >
void set_rectangle_array (const context &ctx, const std::vector< cgv::media::axis_aligned_box< T, 2 > > &boxes)
 specify rectangle array directly. This sets position_is_center to false as well as position and extent array
 
template<typename T >
void set_rectangle_array (const context &ctx, const cgv::media::axis_aligned_box< T, 2 > *boxes, size_t count)
 specify ractangle array directly. This sets position_is_center to false as well as position and extent array
 
void set_textured_rectangle (const context &ctx, const textured_rectangle &tcr)
 specify rectangle without array. This sets position_is_center to false as well as position and extent array
 
void set_textured_rectangle_array (const context &ctx, const std::vector< textured_rectangle > &tc_rects)
 specify rectangle array directly. This sets position_is_center to false as well as position and extent array
 
void set_textured_rectangle_array (const context &ctx, const textured_rectangle *tc_rects, size_t count)
 specify ractangle array directly. This sets position_is_center to false as well as position and extent array
 
template<typename T >
void set_secondary_color (const context &ctx, const T &color)
 templated method to set the secondary color attribute from a single color of type T
 
template<typename T >
void set_secondary_color_array (const context &ctx, const std::vector< T > &colors)
 template method to set the secondary color attribute from a vector of colors of type T
 
template<typename T >
void set_secondary_color_array (const context &ctx, const T *colors, size_t nr_elements, unsigned stride_in_bytes=0)
 template method to set the secondary color attribute from a vector of colors of type T
 
void set_secondary_color_array (const context &ctx, type_descriptor element_type, const vertex_buffer &vbo, size_t offset_in_bytes, size_t nr_elements, unsigned stride_in_bytes=0)
 method to set the secondary color attribute from a vertex buffer object, the element type must be given as explicit template parameter
 
template<typename T >
void set_secondary_color_array (const context &ctx, const vertex_buffer &vbo, size_t offset_in_bytes, size_t nr_elements, unsigned stride_in_bytes=0)
 template method to set the secondary color attribute from a vertex buffer object, the element type must be given as explicit template parameter
 
void remove_secondary_color_array (const context &ctx)
 remove the secondary color attribute
 
template<typename T >
void set_border_color (const context &ctx, const T &color)
 templated method to set the border color attribute from a single color of type T
 
template<typename T >
void set_border_color_array (const context &ctx, const std::vector< T > &colors)
 template method to set the border color attribute from a vector of colors of type T
 
template<typename T >
void set_border_color_array (const context &ctx, const T *colors, size_t nr_elements, unsigned stride_in_bytes=0)
 template method to set the border color attribute from a vector of colors of type T
 
void set_border_color_array (const context &ctx, type_descriptor element_type, const vertex_buffer &vbo, size_t offset_in_bytes, size_t nr_elements, unsigned stride_in_bytes=0)
 method to set the border color attribute from a vertex buffer object, the element type must be given as explicit template parameter
 
template<typename T >
void set_border_color_array (const context &ctx, const vertex_buffer &vbo, size_t offset_in_bytes, size_t nr_elements, unsigned stride_in_bytes=0)
 template method to set the border color attribute from a vertex buffer object, the element type must be given as explicit template parameter
 
void remove_border_color_array (const context &ctx)
 remove the border color attribute
 
template<typename T >
void set_border_info (const context &ctx, const cgv::math::fvec< T, 3 > &border_info)
 specify a single border_info for all lines
 
template<typename T >
void set_border_info_array (const context &ctx, const std::vector< T > &border_infos)
 templated method to set the border_info attribute array from a vector of border_infos of type T, which should have 3 components
 
template<typename T >
void set_border_info_array (const context &ctx, const T *border_infos, size_t nr_elements, unsigned stride_in_bytes=0)
 templated method to set the border_info attribute from an array of border_infos of type T, which should have 3 components
 
void set_border_info_array (const context &ctx, type_descriptor element_type, const vertex_buffer &vbo, size_t offset_in_bytes, size_t nr_elements, unsigned stride_in_bytes=0)
 method to set the border_info attribute from a vertex buffer object, the element type must be given as explicit template parameter
 
template<typename T >
void set_border_info_array (const context &ctx, const vertex_buffer &vbo, size_t offset_in_bytes, size_t nr_elements, unsigned stride_in_bytes=0)
 template method to set the border_info attribute from a vertex buffer object, the element type must be given as explicit template parameter
 
void remove_border_info_array (const context &ctx)
 remove the border info attribute
 
template<typename T >
void set_depth_offset (const context &ctx, const T &depth_offset)
 specify a single depth_offset for all lines
 
template<typename T = float>
void set_depth_offset_array (const context &ctx, const std::vector< T > &depth_offsets)
 set per rectangle depth offsets
 
void remove_depth_offset_array (const context &ctx)
 remove the depth offset attribute
 
template<typename T >
void set_translation (const context &ctx, const T &translation)
 template method to set translation for all rectangles from a vector type T, which should have 3 components
 
template<typename T >
void set_translation_array (const context &ctx, const std::vector< T > &translations)
 template method to set the translations from a vector of vectors of type T, which should have 3 components
 
template<typename T >
void set_translation_array (const context &ctx, const T *translations, size_t nr_elements, unsigned stride)
 template method to set the translations from a vector of vectors of type T, which should have 3 components
 
void remove_translation_array (const context &ctx)
 remove the translation attribute
 
template<typename T >
void set_rotation (const context &ctx, const T &rotation)
 set single rotation for all rectangles from a quaternion of type T, which has 4 components
 
template<typename T >
void set_rotation_array (const context &ctx, const std::vector< T > &rotations)
 template method to set the rotation from a vector of quaternions of type T, which should have 4 components
 
template<typename T >
void set_rotation_array (const context &ctx, const T *rotations, size_t nr_elements, unsigned stride=0)
 template method to set the rotation from a vector of quaternions of type T, which should have 4 components
 
void remove_rotation_array (const context &ctx)
 remove the rotation attribute
 
bool validate_attributes (const context &ctx) const
 check additionally the group attributes
 
bool enable (context &ctx)
 overload to activate group style
 
bool disable (context &ctx)
 disable renderer
 
void draw (context &ctx, size_t start, size_t count, bool use_strips=false, bool use_adjacency=false, uint32_t strip_restart_index=-1)
 convenience function to render with default settings
 
- Public Member Functions inherited from cgv::render::surface_renderer
void enable_attribute_array_manager (const context &ctx, attribute_array_manager &aam)
 call this before setting attribute arrays to manage attribute array in given manager
 
void disable_attribute_array_manager (const context &ctx, attribute_array_manager &aam)
 call this after last render/draw call to ensure that no other users of renderer change attribute arrays of given manager
 
bool enable (context &ctx)
 overload to activate group style
 
bool disable (context &ctx)
 disable renderer
 
template<typename T >
void set_normal (const context &ctx, const cgv::math::fvec< T, 3 > &normal)
 specify a single normal for all lines
 
template<typename T >
void set_normal_array (const context &ctx, const std::vector< T > &normals)
 templated method to set the normal attribute array from a vector of normals of type T, which should have 3 components
 
template<typename T >
void set_normal_array (const context &ctx, const T *normals, size_t nr_elements, unsigned stride_in_bytes=0)
 templated method to set the normal attribute from an array of normals of type T, which should have 3 components
 
void set_normal_array (const context &ctx, type_descriptor element_type, const vertex_buffer &vbo, size_t offset_in_bytes, size_t nr_elements, unsigned stride_in_bytes=0)
 method to set the normal attribute from a vertex buffer object, the element type must be given as explicit template parameter
 
template<typename T >
void set_normal_array (const context &ctx, const vertex_buffer &vbo, size_t offset_in_bytes, size_t nr_elements, unsigned stride_in_bytes=0)
 template method to set the normal attribute from a vertex buffer object, the element type must be given as explicit template parameter
 
void remove_normal_array (const context &ctx)
 remove the normal attribute
 
template<typename T >
void set_texcoord (const context &ctx, const T &texcoord)
 templated method to set the texcoord attribute without array
 
template<typename T >
void set_texcoord_array (const context &ctx, const std::vector< T > &texcoords)
 templated method to set the texcoord attribute array from a vector of texcoords of type T
 
template<typename T >
void set_texcoord_array (const context &ctx, const T *texcoords, size_t nr_elements, unsigned stride_in_bytes=0)
 templated method to set the texcoord attribute from an array of texcoords of type T
 
void set_texcoord_array (const context &ctx, type_descriptor element_type, const vertex_buffer &vbo, size_t offset_in_bytes, size_t nr_elements, unsigned stride_in_bytes=0)
 template method to set the texcoord attribute from a vertex buffer object, the element type must be given as explicit template parameter
 
template<typename T >
void set_texcoord_array (const context &ctx, const vertex_buffer &vbo, size_t offset_in_bytes, size_t nr_elements, unsigned stride_in_bytes=0)
 template method to set the texcoord attribute from a vertex buffer object, the element type must be given as explicit template parameter
 
void remove_texcoord_array (const context &ctx)
 remove the texcoord attribute
 
- Public Member Functions inherited from cgv::render::group_renderer
void set_group_index_array (const context &ctx, const std::vector< unsigned > &group_indices)
 method to set the group index attribute
 
void set_group_index_array (const context &ctx, const unsigned *group_indices, size_t nr_elements)
 method to set the group index attribute
 
void set_group_index_array (const context &ctx, type_descriptor element_type, const vertex_buffer &vbo, size_t offset_in_bytes, size_t nr_elements, unsigned stride_in_bytes=0)
 method to set the group index attribute from a vertex buffer object, the element type must be given as explicit template parameter
 
template<typename T >
void set_group_index_array (const context &ctx, const vertex_buffer &vbo, size_t offset_in_bytes, size_t nr_elements, unsigned stride_in_bytes=0)
 template method to set the group index color attribute from a vertex buffer object, the element type must be given as explicit template parameter
 
void remove_group_index_array (const context &ctx)
 remove the group index attribute
 
template<typename T >
void set_group_colors (const context &ctx, const std::vector< T > &colors)
 template method to set the group colors from a vector of colors of type T
 
template<typename T >
void set_group_colors (const context &ctx, const T *colors, size_t nr_elements)
 template method to set the group colors from a vector of colors of type T
 
template<typename T >
void set_group_translations (const context &ctx, const std::vector< T > &group_translations)
 template method to set the group translations from a vector of vectors of type T, which should have 3 components
 
template<typename T >
void set_group_translations (const context &ctx, const T *group_translations, size_t nr_elements)
 template method to set the group translations from a vector of vectors of type T, which should have 3 components
 
template<typename T >
void set_group_rotations (const context &ctx, const std::vector< T > &group_rotations)
 template method to set the group rotation from a vector of quaternions of type T, which should have 4 components
 
template<typename T >
void set_group_rotations (const context &ctx, const T *group_rotations, size_t nr_elements)
 template method to set the group rotation from a vector of quaternions of type T, which should have 4 components
 
- Public Member Functions inherited from cgv::render::renderer
shader_define_mapref_defines ()
 access to shader define map to update defines not handled by render style
 
shader_programref_prog ()
 derived renderer classes have access to shader program
 
void set_prog (shader_program &one_shot_prog)
 set external shader program up to next call to disable() or render()
 
void draw_impl (context &ctx, PrimitiveType pt, size_t start, size_t count, bool use_strips=false, bool use_adjacency=false, uint32_t strip_restart_index=-1)
 default implementation of draw method with support for indexed rendering and different primitive types
 
void draw_impl_instanced (context &ctx, PrimitiveType type, size_t start, size_t count, size_t instance_count, bool use_strips=false, bool use_adjacency=false, uint32_t strip_restart_index=-1)
 default implementation of instanced draw method with support for indexed rendering and different primitive types
 
 renderer ()
 construct and init attribute tracking flags
 
virtual ~renderer ()
 destructor deletes default renderer style
 
void manage_singleton (context &ctx, const std::string &renderer_name, int &ref_count, int ref_count_change)
 used by derived classes to manage singletons
 
virtual void set_attribute_array_manager (const context &ctx, attribute_array_manager *_aam_ptr=0)
 this function is deprecated, please use enable_attribute_array_manager() and disable_attribute_manager() instead
 
void set_render_style (const render_style &rs)
 reference given render style
 
bool build_program (context &ctx, shader_program &prog, const render_style &rs)
 build shader program for specific render style
 
template<typename T >
void set_position (const context &ctx, const T &position)
 templated method to set the position attribute from a single position of type T
 
template<typename T >
void set_position_array (const context &ctx, const std::vector< T > &positions)
 templated method to set the position attribute from a vector of positions of type T
 
template<typename T >
void set_position_array (const context &ctx, const T *positions, size_t nr_elements, unsigned stride_in_bytes=0)
 templated method to set the position attribute from a vector of positions of type T
 
void set_position_array (const context &ctx, type_descriptor element_type, const vertex_buffer &vbo, size_t offset_in_bytes, size_t nr_elements, unsigned stride_in_bytes)
 method to set the position attribute from a vertex buffer object
 
template<typename T >
void set_position_array (const context &ctx, const vertex_buffer &vbo, size_t offset_in_bytes, size_t nr_elements, unsigned stride_in_bytes=0)
 template method to set the position attribute from a vertex buffer object, the element type must be given as explicit template parameter
 
void remove_position_array (const context &ctx)
 remove the position attribute
 
template<typename T >
void set_color (const context &ctx, const T &color)
 templated method to set the color attribute from a single color of type T
 
template<typename T >
void set_color_array (const context &ctx, const std::vector< T > &colors)
 template method to set the color attribute from a vector of colors of type T
 
template<typename T >
void set_color_array (const context &ctx, const T *colors, size_t nr_elements, unsigned stride_in_bytes=0)
 template method to set the color attribute from a vector of colors of type T
 
void set_color_array (const context &ctx, type_descriptor element_type, const vertex_buffer &vbo, size_t offset_in_bytes, size_t nr_elements, unsigned stride_in_bytes=0)
 method to set the color attribute from a vertex buffer object, the element type must be given as explicit template parameter
 
template<typename T >
void set_color_array (const context &ctx, const vertex_buffer &vbo, size_t offset_in_bytes, size_t nr_elements, unsigned stride_in_bytes=0)
 template method to set the color attribute from a vertex buffer object, the element type must be given as explicit template parameter
 
void remove_color_array (const context &ctx)
 remove the color attribute
 
template<typename T >
bool set_indices (const context &ctx, const std::vector< T > &indices, bool keep_on_cpu=false)
 Set the indices for indexed rendering from a vector.
 
template<typename T >
bool set_indices (const context &ctx, const T *indices, size_t nr_indices, bool keep_on_cpu=false)
 Set the indices for indexed rendering from an array given as a pointer.
 
template<typename T >
bool set_indices (const context &ctx, const vertex_buffer &vbo, size_t count)
 Set the indices for indexed rendering from a GPU buffer.
 
bool has_indices () const
 return whether indices have been defined
 
void remove_indices (const context &ctx)
 remove previously set indices
 
const vertex_bufferget_vertex_buffer_ptr (const context &ctx, const attribute_array_manager &aam, const std::string &attr_name)
 
const vertex_bufferget_index_buffer_ptr (const attribute_array_manager &aam)
 
bool validate_and_enable (context &ctx)
 validate attributes and if successful, enable renderer
 
virtual bool render (context &ctx, size_t start, size_t count, bool use_strips=false, bool use_adjacency=false, uint32_t strip_restart_index=-1)
 Convenience function that draws vertex or indexed element with this renderer.
 
virtual void clear (const context &ctx)
 the clear function destructs the shader program
 

Protected Member Functions

render_stylecreate_render_style () const
 overload to allow instantiation of rectangle_renderer
 
bool build_shader_program (context &ctx, shader_program &prog, const shader_define_map &defines)
 build rectangle program
 
- Protected Member Functions inherited from cgv::render::renderer
bool has_aam () const
 check for attribute array manager
 
bool has_attribute (const context &ctx, const std::string &name)
 check for attribute
 
const render_styleget_style_ptr () const
 access to render style
 
bool attributes_persist () const
 return whether attributes persist after a call to disable
 
virtual void update_defines (shader_define_map &defines)
 overload to update the shader defines based on the current render style; only called if internal shader program is used
 
template<typename T >
const T & get_style () const
 access to style
 
int get_prog_attribute_location (const context &ctx, const std::string &name, bool error_check=true)
 
template<typename T >
bool set_attribute_array (const context &ctx, const std::string &name, const T &array)
 
template<typename T >
bool set_attribute_array (const context &ctx, const std::string &name, const T *array_ptr, size_t nr_elements, unsigned stride)
 
bool set_attribute_array (const context &ctx, const std::string &name, type_descriptor element_type, const vertex_buffer &vbo, size_t offset_in_bytes, size_t nr_elements, unsigned stride_in_bytes)
 
template<typename C , typename T >
bool set_composed_attribute_array (const context &ctx, const std::string &name, const C *array_ptr, size_t nr_elements, const T &elem)
 in case that several attributes are stored interleaved, call this function for the first and ref_composed_attribute_array() for all others
 
template<typename C , typename T >
bool ref_composed_attribute_array (const context &ctx, const std::string &name, const std::string &name_ref, const C *array_ptr, size_t nr_elements, const T &elem)
 in case that several attributes are stored interleaved, call set_composed_attribute_array() for the first and this function for all others
 
bool remove_attribute_array (const context &ctx, const std::string &name)
 

Protected Attributes

bool has_extents
 whether extent array has been specified
 
bool has_secondary_colors
 whether secondary color or color array was set
 
bool has_border_colors
 whether border color or color array was set
 
bool has_border_infos
 whether border info or info array was set
 
bool has_translations
 whether translation array has been specified
 
bool has_rotations
 whether rotation array has been specified
 
bool has_depth_offsets
 whether depth offset array has been specified
 
float y_view_angle
 
- Protected Attributes inherited from cgv::render::surface_renderer
bool has_normals
 
bool has_texcoords
 
bool cull_per_primitive
 
- Protected Attributes inherited from cgv::render::group_renderer
bool has_group_indices
 
bool has_group_colors
 
bool has_group_translations
 
bool has_group_rotations
 
- Protected Attributes inherited from cgv::render::renderer
bool has_colors
 track whether color attribute is defined
 
bool has_positions
 track whether position attribute is defined
 

Detailed Description

renderer that supports plane rendering

Definition at line 86 of file rectangle_renderer.h.

Constructor & Destructor Documentation

◆ rectangle_renderer()

cgv::render::rectangle_renderer::rectangle_renderer ( )

Definition at line 64 of file rectangle_renderer.cxx.

Member Function Documentation

◆ build_shader_program()

bool cgv::render::rectangle_renderer::build_shader_program ( context ctx,
shader_program prog,
const shader_define_map defines 
)
protectedvirtual

build rectangle program

Reimplemented from cgv::render::renderer.

Definition at line 165 of file rectangle_renderer.cxx.

References cgv::render::shader_program::build_program().

◆ create_render_style()

render_style * cgv::render::rectangle_renderer::create_render_style ( ) const
protectedvirtual

overload to allow instantiation of rectangle_renderer

Implements cgv::render::renderer.

Definition at line 44 of file rectangle_renderer.cxx.

◆ disable()

◆ disable_attribute_array_manager()

void cgv::render::rectangle_renderer::disable_attribute_array_manager ( const context ctx,
attribute_array_manager aam 
)
virtual

call this after last render/draw call to ensure that no other users of renderer change attribute arrays of given manager

Reimplemented from cgv::render::group_renderer.

Definition at line 143 of file rectangle_renderer.cxx.

References cgv::render::surface_renderer::disable_attribute_array_manager(), has_border_colors, has_border_infos, has_depth_offsets, has_extents, has_rotations, has_secondary_colors, and has_translations.

◆ draw()

void cgv::render::rectangle_renderer::draw ( context ctx,
size_t  start,
size_t  count,
bool  use_strips = false,
bool  use_adjacency = false,
uint32_t  strip_restart_index = -1 
)
virtual

convenience function to render with default settings

Reimplemented from cgv::render::renderer.

Definition at line 236 of file rectangle_renderer.cxx.

References cgv::render::renderer::draw_impl().

◆ enable()

◆ enable_attribute_array_manager()

void cgv::render::rectangle_renderer::enable_attribute_array_manager ( const context ctx,
attribute_array_manager aam 
)
virtual

◆ init()

bool cgv::render::rectangle_renderer::init ( context ctx)
virtual

call init() once before using renderer

creates default render style and builds shader program based on defines that can be configured with ref_defines() before calling init(). Reconfiguring defines after init() causes rebuild of shader program in enable() function.

Reimplemented from cgv::render::renderer.

Definition at line 169 of file rectangle_renderer.cxx.

References cgv::render::renderer::init().

Referenced by cgv::app::transformation_gizmo::init().

◆ remove_border_color_array()

void cgv::render::rectangle_renderer::remove_border_color_array ( const context ctx)

remove the border color attribute

Definition at line 104 of file rectangle_renderer.cxx.

References has_border_colors.

◆ remove_border_info_array()

void cgv::render::rectangle_renderer::remove_border_info_array ( const context ctx)

remove the border info attribute

Definition at line 108 of file rectangle_renderer.cxx.

References has_border_infos.

◆ remove_depth_offset_array()

void cgv::render::rectangle_renderer::remove_depth_offset_array ( const context ctx)

remove the depth offset attribute

Definition at line 112 of file rectangle_renderer.cxx.

References has_depth_offsets.

◆ remove_extent_array()

void cgv::render::rectangle_renderer::remove_extent_array ( const context ctx)

remove the extent attribute

Definition at line 96 of file rectangle_renderer.cxx.

References has_extents.

◆ remove_rotation_array()

void cgv::render::rectangle_renderer::remove_rotation_array ( const context ctx)

remove the rotation attribute

Definition at line 120 of file rectangle_renderer.cxx.

References has_rotations.

◆ remove_secondary_color_array()

void cgv::render::rectangle_renderer::remove_secondary_color_array ( const context ctx)

remove the secondary color attribute

Definition at line 100 of file rectangle_renderer.cxx.

References has_secondary_colors.

◆ remove_translation_array()

void cgv::render::rectangle_renderer::remove_translation_array ( const context ctx)

remove the translation attribute

Definition at line 116 of file rectangle_renderer.cxx.

References has_translations.

◆ set_border_color()

template<typename T >
void cgv::render::rectangle_renderer::set_border_color ( const context ctx,
const T &  color 
)
inline

templated method to set the border color attribute from a single color of type T

Definition at line 200 of file rectangle_renderer.h.

Referenced by cgv::render::rectangle_render_data< ColorType >::set_const_attributes().

◆ set_border_color_array() [1/4]

template<typename T >
void cgv::render::rectangle_renderer::set_border_color_array ( const context ctx,
const std::vector< T > &  colors 
)
inline

template method to set the border color attribute from a vector of colors of type T

Definition at line 203 of file rectangle_renderer.h.

◆ set_border_color_array() [2/4]

template<typename T >
void cgv::render::rectangle_renderer::set_border_color_array ( const context ctx,
const T *  colors,
size_t  nr_elements,
unsigned  stride_in_bytes = 0 
)
inline

template method to set the border color attribute from a vector of colors of type T

Definition at line 206 of file rectangle_renderer.h.

◆ set_border_color_array() [3/4]

template<typename T >
void cgv::render::rectangle_renderer::set_border_color_array ( const context ctx,
const vertex_buffer vbo,
size_t  offset_in_bytes,
size_t  nr_elements,
unsigned  stride_in_bytes = 0 
)
inline

template method to set the border color attribute from a vertex buffer object, the element type must be given as explicit template parameter

Definition at line 211 of file rectangle_renderer.h.

References set_border_color_array().

Referenced by set_border_color_array().

◆ set_border_color_array() [4/4]

void cgv::render::rectangle_renderer::set_border_color_array ( const context ctx,
type_descriptor  element_type,
const vertex_buffer vbo,
size_t  offset_in_bytes,
size_t  nr_elements,
unsigned  stride_in_bytes = 0 
)

method to set the border color attribute from a vertex buffer object, the element type must be given as explicit template parameter

Definition at line 86 of file rectangle_renderer.cxx.

References has_border_colors.

◆ set_border_info()

template<typename T >
void cgv::render::rectangle_renderer::set_border_info ( const context ctx,
const cgv::math::fvec< T, 3 > &  border_info 
)
inline

specify a single border_info for all lines

Definition at line 216 of file rectangle_renderer.h.

◆ set_border_info_array() [1/3]

template<typename T >
void cgv::render::rectangle_renderer::set_border_info_array ( const context ctx,
const std::vector< T > &  border_infos 
)
inline

templated method to set the border_info attribute array from a vector of border_infos of type T, which should have 3 components

Definition at line 219 of file rectangle_renderer.h.

◆ set_border_info_array() [2/3]

template<typename T >
void cgv::render::rectangle_renderer::set_border_info_array ( const context ctx,
const T *  border_infos,
size_t  nr_elements,
unsigned  stride_in_bytes = 0 
)
inline

templated method to set the border_info attribute from an array of border_infos of type T, which should have 3 components

Definition at line 222 of file rectangle_renderer.h.

◆ set_border_info_array() [3/3]

template<typename T >
void cgv::render::rectangle_renderer::set_border_info_array ( const context ctx,
const vertex_buffer vbo,
size_t  offset_in_bytes,
size_t  nr_elements,
unsigned  stride_in_bytes = 0 
)
inline

template method to set the border_info attribute from a vertex buffer object, the element type must be given as explicit template parameter

Definition at line 227 of file rectangle_renderer.h.

References set_border_info_array().

Referenced by set_border_info_array().

◆ set_depth_offset()

template<typename T >
void cgv::render::rectangle_renderer::set_depth_offset ( const context ctx,
const T &  depth_offset 
)
inline

specify a single depth_offset for all lines

Definition at line 233 of file rectangle_renderer.h.

◆ set_depth_offset_array()

template<typename T = float>
void cgv::render::rectangle_renderer::set_depth_offset_array ( const context ctx,
const std::vector< T > &  depth_offsets 
)
inline

set per rectangle depth offsets

Definition at line 236 of file rectangle_renderer.h.

◆ set_extent()

template<typename T >
void cgv::render::rectangle_renderer::set_extent ( const context ctx,
const cgv::math::fvec< T, 2U > &  extent 
)
inline

specify a single extent for all boxes

Definition at line 123 of file rectangle_renderer.h.

Referenced by cgv::render::rectangle_render_data< ColorType >::set_const_attributes().

◆ set_extent_array() [1/2]

template<typename T >
void cgv::render::rectangle_renderer::set_extent_array ( const context ctx,
const cgv::math::fvec< T, 2U > *  extents,
size_t  nr_elements,
unsigned  stride_in_bytes = 0 
)
inline

extent array specifies plane side lengths from origin to edge

Definition at line 129 of file rectangle_renderer.h.

◆ set_extent_array() [2/2]

template<typename T >
void cgv::render::rectangle_renderer::set_extent_array ( const context ctx,
const std::vector< cgv::math::fvec< T, 2U > > &  extents 
)
inline

extent array specifies plane side lengths from origin to edge

Definition at line 126 of file rectangle_renderer.h.

◆ set_position_is_center()

void cgv::render::rectangle_renderer::set_position_is_center ( bool  _position_is_center)

set the flag of the render style, whether the position is interpreted as the box center

Definition at line 174 of file rectangle_renderer.cxx.

Referenced by set_textured_rectangle().

◆ set_rectangle()

template<typename T >
void cgv::render::rectangle_renderer::set_rectangle ( const context ctx,
const cgv::media::axis_aligned_box< T, 2 > &  box 
)
inline

specify a single rectangle without array. This sets position_is_center to false as well as position and extent array

Definition at line 134 of file rectangle_renderer.h.

References cgv::media::axis_aligned_box< T, N >::get_max_pnt(), and cgv::media::axis_aligned_box< T, N >::get_min_pnt().

◆ set_rectangle_array() [1/2]

template<typename T >
void cgv::render::rectangle_renderer::set_rectangle_array ( const context ctx,
const cgv::media::axis_aligned_box< T, 2 > *  boxes,
size_t  count 
)
inline

specify ractangle array directly. This sets position_is_center to false as well as position and extent array

Definition at line 152 of file rectangle_renderer.h.

◆ set_rectangle_array() [2/2]

template<typename T >
void cgv::render::rectangle_renderer::set_rectangle_array ( const context ctx,
const std::vector< cgv::media::axis_aligned_box< T, 2 > > &  boxes 
)
inline

specify rectangle array directly. This sets position_is_center to false as well as position and extent array

Definition at line 143 of file rectangle_renderer.h.

◆ set_rotation()

template<typename T >
void cgv::render::rectangle_renderer::set_rotation ( const context ctx,
const T &  rotation 
)
inline

set single rotation for all rectangles from a quaternion of type T, which has 4 components

Definition at line 252 of file rectangle_renderer.h.

Referenced by cgv::render::rectangle_render_data< ColorType >::set_const_attributes().

◆ set_rotation_array() [1/2]

template<typename T >
void cgv::render::rectangle_renderer::set_rotation_array ( const context ctx,
const std::vector< T > &  rotations 
)
inline

template method to set the rotation from a vector of quaternions of type T, which should have 4 components

Definition at line 255 of file rectangle_renderer.h.

◆ set_rotation_array() [2/2]

template<typename T >
void cgv::render::rectangle_renderer::set_rotation_array ( const context ctx,
const T *  rotations,
size_t  nr_elements,
unsigned  stride = 0 
)
inline

template method to set the rotation from a vector of quaternions of type T, which should have 4 components

Definition at line 258 of file rectangle_renderer.h.

◆ set_secondary_color()

template<typename T >
void cgv::render::rectangle_renderer::set_secondary_color ( const context ctx,
const T &  color 
)
inline

templated method to set the secondary color attribute from a single color of type T

Definition at line 183 of file rectangle_renderer.h.

Referenced by cgv::render::rectangle_render_data< ColorType >::set_const_attributes().

◆ set_secondary_color_array() [1/4]

template<typename T >
void cgv::render::rectangle_renderer::set_secondary_color_array ( const context ctx,
const std::vector< T > &  colors 
)
inline

template method to set the secondary color attribute from a vector of colors of type T

Definition at line 186 of file rectangle_renderer.h.

◆ set_secondary_color_array() [2/4]

template<typename T >
void cgv::render::rectangle_renderer::set_secondary_color_array ( const context ctx,
const T *  colors,
size_t  nr_elements,
unsigned  stride_in_bytes = 0 
)
inline

template method to set the secondary color attribute from a vector of colors of type T

Definition at line 189 of file rectangle_renderer.h.

◆ set_secondary_color_array() [3/4]

template<typename T >
void cgv::render::rectangle_renderer::set_secondary_color_array ( const context ctx,
const vertex_buffer vbo,
size_t  offset_in_bytes,
size_t  nr_elements,
unsigned  stride_in_bytes = 0 
)
inline

template method to set the secondary color attribute from a vertex buffer object, the element type must be given as explicit template parameter

Definition at line 194 of file rectangle_renderer.h.

References set_secondary_color_array().

Referenced by set_secondary_color_array().

◆ set_secondary_color_array() [4/4]

void cgv::render::rectangle_renderer::set_secondary_color_array ( const context ctx,
type_descriptor  element_type,
const vertex_buffer vbo,
size_t  offset_in_bytes,
size_t  nr_elements,
unsigned  stride_in_bytes = 0 
)

method to set the secondary color attribute from a vertex buffer object, the element type must be given as explicit template parameter

Definition at line 81 of file rectangle_renderer.cxx.

References has_secondary_colors.

◆ set_textured_rectangle()

void cgv::render::rectangle_renderer::set_textured_rectangle ( const context ctx,
const textured_rectangle tcr 
)

◆ set_textured_rectangle_array() [1/2]

void cgv::render::rectangle_renderer::set_textured_rectangle_array ( const context ctx,
const std::vector< textured_rectangle > &  tc_rects 
)
inline

specify rectangle array directly. This sets position_is_center to false as well as position and extent array

Definition at line 162 of file rectangle_renderer.h.

◆ set_textured_rectangle_array() [2/2]

void cgv::render::rectangle_renderer::set_textured_rectangle_array ( const context ctx,
const textured_rectangle tc_rects,
size_t  count 
)
inline

specify ractangle array directly. This sets position_is_center to false as well as position and extent array

Definition at line 172 of file rectangle_renderer.h.

◆ set_translation()

template<typename T >
void cgv::render::rectangle_renderer::set_translation ( const context ctx,
const T &  translation 
)
inline

template method to set translation for all rectangles from a vector type T, which should have 3 components

Definition at line 241 of file rectangle_renderer.h.

Referenced by cgv::render::rectangle_render_data< ColorType >::set_const_attributes().

◆ set_translation_array() [1/2]

template<typename T >
void cgv::render::rectangle_renderer::set_translation_array ( const context ctx,
const std::vector< T > &  translations 
)
inline

template method to set the translations from a vector of vectors of type T, which should have 3 components

Definition at line 244 of file rectangle_renderer.h.

◆ set_translation_array() [2/2]

template<typename T >
void cgv::render::rectangle_renderer::set_translation_array ( const context ctx,
const T *  translations,
size_t  nr_elements,
unsigned  stride 
)
inline

template method to set the translations from a vector of vectors of type T, which should have 3 components

Definition at line 247 of file rectangle_renderer.h.

◆ set_y_view_angle()

void cgv::render::rectangle_renderer::set_y_view_angle ( float  y_view_angle)

Definition at line 76 of file rectangle_renderer.cxx.

◆ validate_attributes()

bool cgv::render::rectangle_renderer::validate_attributes ( const context ctx) const
virtual

check additionally the group attributes

Reimplemented from cgv::render::group_renderer.

Definition at line 178 of file rectangle_renderer.cxx.

References cgv::render::context::error(), has_extents, and cgv::render::group_renderer::validate_attributes().

Member Data Documentation

◆ has_border_colors

bool cgv::render::rectangle_renderer::has_border_colors
protected

whether border color or color array was set

Definition at line 94 of file rectangle_renderer.h.

Referenced by disable(), disable_attribute_array_manager(), enable(), enable_attribute_array_manager(), remove_border_color_array(), and set_border_color_array().

◆ has_border_infos

bool cgv::render::rectangle_renderer::has_border_infos
protected

whether border info or info array was set

Definition at line 96 of file rectangle_renderer.h.

Referenced by disable(), disable_attribute_array_manager(), enable(), enable_attribute_array_manager(), and remove_border_info_array().

◆ has_depth_offsets

bool cgv::render::rectangle_renderer::has_depth_offsets
protected

whether depth offset array has been specified

Definition at line 102 of file rectangle_renderer.h.

Referenced by disable(), disable_attribute_array_manager(), enable(), enable_attribute_array_manager(), and remove_depth_offset_array().

◆ has_extents

bool cgv::render::rectangle_renderer::has_extents
protected

◆ has_rotations

bool cgv::render::rectangle_renderer::has_rotations
protected

whether rotation array has been specified

Definition at line 100 of file rectangle_renderer.h.

Referenced by disable(), disable_attribute_array_manager(), enable(), enable_attribute_array_manager(), and remove_rotation_array().

◆ has_secondary_colors

bool cgv::render::rectangle_renderer::has_secondary_colors
protected

whether secondary color or color array was set

Definition at line 92 of file rectangle_renderer.h.

Referenced by disable(), disable_attribute_array_manager(), enable(), enable_attribute_array_manager(), remove_secondary_color_array(), and set_secondary_color_array().

◆ has_translations

bool cgv::render::rectangle_renderer::has_translations
protected

whether translation array has been specified

Definition at line 98 of file rectangle_renderer.h.

Referenced by disable(), disable_attribute_array_manager(), enable(), enable_attribute_array_manager(), and remove_translation_array().

◆ y_view_angle

float cgv::render::rectangle_renderer::y_view_angle
protected

Definition at line 103 of file rectangle_renderer.h.


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