3#include "group_renderer.h"
4#include <cgv/media/color.h>
6#include "gl/lib_begin.h"
17 vec3 default_normal = { 0.0f, 0.0f, 1.0f };
19 rgba default_color = { 1.0f };
21 float default_depth_offset = 0.0f;
23 float default_line_width = 1.0f;
26 bool blend_lines =
false;
31 rgba halo_color = { 0.0f, 0.0f, 0.0f, 1.0f };
33 float halo_width_in_pixel = 0.0f;
35 float percentual_halo_width = 0.0f;
37 bool screen_aligned =
true;
42 bool measure_line_width_in_pixel =
true;
44 float reference_line_width = 0.001f;
46 float blend_width_in_pixel = 0.0f;
51 float halo_color_strength = 1.0f;
58 bool has_normals =
false;
59 bool has_line_widths =
false;
60 bool has_depth_offsets =
false;
67 bool enable(
context& ctx)
override;
69 bool disable(
context& ctx)
override;
75 bool init(
context& ctx)
override;
81 void set_normal_array(
const context& ctx,
const std::vector<T>& normals) { has_normals =
true; set_attribute_array(ctx,
"normal", normals); }
84 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); }
86 void remove_normal_array(
const context& ctx);
89 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); }
92 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); }
95 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); }
97 void remove_line_width_array(
const context& ctx);
100 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); }
102 template <
typename T>
103 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); }
105 template <
typename T>
106 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); }
108 void remove_depth_offset_array(
const context& ctx);
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)
override;
114 extern CGV_API line_renderer& ref_line_renderer(context& ctx,
int ref_count_change = 0);
124#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...
std::string get_default_prog_name() const override
return the default shader program name
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 ...
render_style * create_render_style() const override
create and return the default render style
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...
this reflection traits implementation is used for external self_reflect implementations of instances ...
render style used for group information
base class for all render styles