3#include "surface_renderer.h"
5#include "gl/lib_begin.h"
47 template <
typename T =
float>
48 void set_radius_array(
const context& ctx,
const std::vector<T>& radii) { has_radii =
true; set_attribute_array(ctx,
"radius", radii); }
50 template <
typename T =
float>
51 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,
"radius", radii, nr_elements, stride_in_bytes); }
53 void remove_radius_array(
const context& ctx);
55 template <
typename T =
float>
56 void set_tangent_array(
const context& ctx,
const std::vector<T>& tangents) { has_tangents =
true; set_attribute_array(ctx,
"tangent", tangents); }
58 template <
typename T =
float>
59 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,
"tangent", tangents, nr_elements, stride_in_bytes); }
61 void remove_tangent_array(
const context& ctx);
63 template <
typename T =
float>
71 template <
typename T =
float>
79 bool validate_attributes(
const context& ctx)
const override;
81 bool enable(
context& ctx)
override;
83 bool disable(
context& ctx)
override;
85 void draw(
context& ctx,
size_t start,
size_t count,
86 bool use_strips =
false,
bool use_adjacency =
false, uint32_t strip_restart_index = -1)
override;
97#include <cgv/config/lib_end.h>
A vector with zero based index.
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.
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 f...
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_comp...
bool has_positions
track whether position attribute is defined
renderer that supports point splatting
render_style * create_render_style() const override
create and return the default render style
void set_sphere_array(const context &ctx, const std::vector< cgv::math::fvec< T, 4 > > &spheres)
use this function if you store spheres in vec4 with the 4th component the radius
bool has_tangents
whether tangents are specified
void set_eye_pos(vec3 ep)
set the eye position needed for rendering
bool has_radii
whether radii are specified
std::string get_default_prog_name() const override
return the default shader program name
vec3 eye_pos
the view eye position
void set_sphere_array(const context &ctx, const cgv::math::fvec< T, 4 > *spheres, size_t nr_elements)
use this function if you store spheres in vec4 with the 4th component the radius
base classes for renderers that support surface rendering
namespace for api independent GPU programming
spline_tube_renderer & ref_spline_tube_renderer(context &ctx, int ref_count_change)
reference to a singleton spline tube renderer that is shared among drawables
this header is dependency free
cgv::math::fvec< float, 3 > vec3
declare type of 3d single precision floating point vectors
this reflection traits implementation is used for external self_reflect implementations of instances ...
base class for all render styles
float radius
default tube radius, initialized to 1
float radius_scale
multiplied to the tube radius, initialized to 1