3#include "group_renderer.h"
4#include <cgv/media/color.h>
6#include "gl/lib_begin.h"
29 mutable GLboolean is_blend;
30 mutable GLint blend_src, blend_dst;
66 bool has_depth_offsets;
89 void set_normal_array(
const context& ctx,
const std::vector<T>& normals) { has_normals =
true; set_attribute_array(ctx,
"normal", normals); }
92 void set_normal_array(
const context& ctx,
const T* normals,
size_t nr_elements,
unsigned stride_in_bytes = 0) { has_normals =
true; set_attribute_array(ctx,
"normal", normals, nr_elements, stride_in_bytes); }
94 void remove_normal_array(
const context& ctx);
97 void set_line_width(
const context& ctx,
const T& line_width) { has_line_widths =
true; ref_prog().set_attribute(ctx, get_prog_attribute_location(ctx,
"line_width"), line_width); }
100 void set_line_width_array(
const context& ctx,
const std::vector<T>& line_widths) { has_line_widths =
true; set_attribute_array(ctx,
"line_width", line_widths); }
102 template <
typename T>
103 void set_line_width_array(
const context& ctx,
const T* line_widths,
size_t nr_elements,
unsigned stride_in_bytes = 0) { has_line_widths =
true; set_attribute_array(ctx,
"line_width", line_widths, nr_elements, stride_in_bytes); }
105 void remove_line_width_array(
const context& ctx);
107 template <
typename T>
108 void set_depth_offset(
const context& ctx,
const T& depth_offset) { has_depth_offsets =
true; ref_prog().set_attribute(ctx, get_prog_attribute_location(ctx,
"depth_offset"), depth_offset); }
110 template <
typename T>
111 void set_depth_offset_array(
const context& ctx,
const std::vector<T>& depth_offsets) { has_depth_offsets =
true; set_attribute_array(ctx,
"depth_offset", depth_offsets); }
113 template <
typename T>
114 void set_depth_offset_array(
const context& ctx,
const T* depth_offsets,
size_t nr_elements,
unsigned stride_in_bytes = 0) { has_depth_offsets =
true; set_attribute_array(ctx,
"depth_offset", depth_offsets, nr_elements, stride_in_bytes); }
116 void remove_depth_offset_array(
const context& ctx);
118 void draw(
context& ctx,
size_t start,
size_t count,
119 bool use_strips =
false,
bool use_adjacency =
false, uint32_t strip_restart_index = -1);
122 extern CGV_API line_renderer& ref_line_renderer(context& ctx,
int ref_count_change = 0);
132#include <cgv/config/lib_end.h>
the self reflection handler is passed to the virtual self_reflect() method of cgv::base::base.
attribute array manager used to upload arrays to gpu
base class for all drawables, which is independent of the used rendering API.
abstract renderer class that provides functionality for grouping primitives
renderer that supports point splatting
void set_depth_offset_array(const context &ctx, const T *depth_offsets, size_t nr_elements, unsigned stride_in_bytes=0)
depth_offset array specifies box extends in case of position_is_center=true, otherwise the maximum po...
void set_normal_array(const context &ctx, const std::vector< T > &normals)
templated method to set the normal attribute from a vector of normals of type T, which should have 3 ...
void set_normal(const context &ctx, const cgv::math::fvec< T, 3 > &normal)
specify a single normal for all lines
void set_line_width_array(const context &ctx, const T *line_widths, size_t nr_elements, unsigned stride_in_bytes=0)
line_width array specifies box extends in case of position_is_center=true, otherwise the maximum poin...
void set_line_width(const context &ctx, const T &line_width)
specify a single line_width for all lines
void set_depth_offset(const context &ctx, const T &depth_offset)
specify a single depth_offset for all lines
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 ...
void set_depth_offset_array(const context &ctx, const std::vector< T > &depth_offsets)
depth_offset array specifies box extends in case of position_is_center=true, otherwise the maximum po...
void set_line_width_array(const context &ctx, const std::vector< T > &line_widths)
line_width array specifies box extends in case of position_is_center=true, otherwise the maximum poin...
a shader program combines several shader code fragments to a complete definition of the shading pipel...
std::map< std::string, std::string > shader_define_map
typedef for shader define map data structure
this reflection traits implementation is used for external self_reflect implementations of instances ...
render style used for group information
rgba halo_color
halo color
float blend_width_in_pixel
blend with in pixels used for line smoothing
float default_depth_offset
default depth offset for case when "depth_offset" attribute is not set
float default_line_width
default line width for case when "line_width" attribute is not set
vec3 default_normal
default normal for case when "normal" attribute is not set
float halo_width_in_pixel
halo width in pixel
bool measure_line_width_in_pixel
whether to measure line width in pixels - otherwise in eye space relative to reference_line_width
float reference_line_width
reference line width multiplied to line width if measure_line_width_in_pixel is false
bool screen_aligned
whether to span line splat in screen aligned coordinate system
float halo_color_strength
parameter in [0,1] to mix line color with halo color
float percentual_halo_width
halo width in percent of line width
rgba default_color
default color for case when "color" attribute is not set
base class for all render styles