3 #include "surface_renderer.h"
5 #include "gl/lib_begin.h"
9 class CGV_API spline_tube_renderer;
17 struct CGV_API spline_tube_render_style :
public surface_render_style
24 spline_tube_render_style();
43 void set_eye_pos(
vec3 ep) { eye_pos = ep; }
55 template <
typename T =
float>
56 void set_radius_array(
const context& ctx,
const std::vector<T>& radii) { has_radii =
true; set_attribute_array(ctx, ref_prog().get_attribute_location(ctx,
"radius"), radii); }
58 template <
typename T =
float>
59 void set_radius_array(
const context& ctx,
const T* radii,
size_t nr_elements,
unsigned stride_in_bytes = 0) { has_radii =
true; set_attribute_array(ctx, ref_prog().get_attribute_location(ctx,
"radius"), radii, nr_elements, stride_in_bytes); }
61 template <
typename T =
float>
62 void set_tangent_array(
const context& ctx,
const std::vector<T>& tangents) { has_tangents =
true; set_attribute_array(ctx, ref_prog().get_attribute_location(ctx,
"tangent"), tangents); }
64 template <
typename T =
float>
65 void set_tangent_array(
const context& ctx,
const T* tangents,
size_t nr_elements,
unsigned stride_in_bytes = 0) { has_tangents =
true; set_attribute_array(ctx, ref_prog().get_attribute_location(ctx,
"tangent"), tangents, nr_elements, stride_in_bytes); }
67 bool validate_attributes(
const context& ctx)
const;
69 bool enable(context& ctx);
71 bool disable(context& ctx);
73 void draw(context& ctx,
size_t start,
size_t count,
74 bool use_strips =
false,
bool use_adjacency =
false, uint32_t strip_restart_index = -1);
77 struct CGV_API spline_tube_render_style_reflect :
public spline_tube_render_style
85 #include <cgv/config/lib_end.h>