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;
87 void set_normal_array(
const context& ctx,
const std::vector<T>& normals) { has_normals =
true; set_attribute_array(ctx, ref_prog().get_attribute_location(ctx,
"normal"), normals); }
90 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, ref_prog().get_attribute_location(ctx,
"normal"), normals, nr_elements, stride_in_bytes); }
93 void set_line_width(
const context& ctx,
const T& line_width) { has_line_widths =
true; ref_prog().set_attribute(ctx, ref_prog().get_attribute_location(ctx,
"line_width"), line_width); }
96 void set_line_width_array(
const context& ctx,
const std::vector<T>& line_widths) { has_line_widths =
true; set_attribute_array(ctx, ref_prog().get_attribute_location(ctx,
"line_width"), line_widths); }
99 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, ref_prog().get_attribute_location(ctx,
"line_width"), line_widths, nr_elements, stride_in_bytes); }
101 template <
typename T>
102 void set_depth_offset(
const context& ctx,
const T& depth_offset) { has_depth_offsets =
true; ref_prog().set_attribute(ctx, ref_prog().get_attribute_location(ctx,
"depth_offset"), depth_offset); }
104 template <
typename T>
105 void set_depth_offset_array(
const context& ctx,
const std::vector<T>& depth_offsets) { has_depth_offsets =
true; set_attribute_array(ctx, ref_prog().get_attribute_location(ctx,
"depth_offset"), depth_offsets); }
107 template <
typename T>
108 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, ref_prog().get_attribute_location(ctx,
"depth_offset"), depth_offsets, nr_elements, stride_in_bytes); }
110 void draw(
context& ctx,
size_t start,
size_t count,
111 bool use_strips =
false,
bool use_adjacency =
false, uint32_t strip_restart_index = -1);
114 extern CGV_API line_renderer& ref_line_renderer(context& ctx,
int ref_count_change = 0);
116 struct CGV_API line_render_style_reflect :
public line_render_style
124 #include <cgv/config/lib_end.h>
base class for all render styles
Definition: renderer.h:16
float default_line_width
default line width for case when "line_width" attribute is not set
Definition: line_renderer.h:23
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...
Definition: line_renderer.h:108
bool measure_line_width_in_pixel
whether to measure line width in pixels - otherwise in eye space relative to reference_line_width
Definition: line_renderer.h:46
Definition: group_renderer.h:15
float blend_width_in_pixel
blend with in pixels used for line smoothing
Definition: line_renderer.h:50
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...
Definition: line_renderer.h:96
void set_normal(const context &ctx, const cgv::math::fvec< T, 3 > &normal)
specify a single normal for all lines
Definition: line_renderer.h:84
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 ...
Definition: line_renderer.h:87
float reference_line_width
reference line width multiplied to line width if measure_line_width_in_pixel is false
Definition: line_renderer.h:48
renderer that supports point splatting
Definition: line_renderer.h:62
vec3 default_normal
default normal for case when "normal" attribute is not set
Definition: line_renderer.h:17
bool screen_aligned
whether to span line splat in screen aligned coordinate system
Definition: line_renderer.h:41
attribute array manager used to upload arrays to gpu
Definition: renderer.h:21
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...
Definition: line_renderer.h:99
float default_depth_offset
default depth offset for case when "depth_offset" attribute is not set
Definition: line_renderer.h:21
Definition: reflection_handler.h:63
float percentual_halo_width
halo width in percent of line width
Definition: line_renderer.h:39
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...
Definition: line_renderer.h:105
Definition: line_renderer.h:13
float halo_width_in_pixel
halo width in pixel
Definition: line_renderer.h:37
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 ...
Definition: line_renderer.h:90
rgba default_color
default color for case when "color" attribute is not set
Definition: line_renderer.h:19
rgba halo_color
halo color
Definition: line_renderer.h:35
this reflection traits implementation is used for external self_reflect implementations of instances ...
Definition: reflect_extern.h:28
void set_depth_offset(const context &ctx, const T &depth_offset)
specify a single depth_offset for all lines
Definition: line_renderer.h:102
float halo_color_strength
parameter in [0,1] to mix line color with halo color
Definition: line_renderer.h:55
the cgv namespace
Definition: vr_calib.cxx:9
void set_line_width(const context &ctx, const T &line_width)
specify a single line_width for all lines
Definition: line_renderer.h:93
Definition: context.h:525
abstract renderer class that provides functionality for grouping primitives
Definition: group_renderer.h:26