45 bool has_radii =
false;
46 bool has_group_radii =
false;
47 float y_view_angle = 45.0f;
58 void set_y_view_angle(
float y_view_angle);
60 template <
typename T =
float>
61 void set_radius(
const context& ctx,
const T& radius) { has_radii =
true; ref_prog().set_attribute(ctx, ref_prog().get_attribute_location(ctx,
"radius"), radius); }
63 template <
typename T =
float>
64 void set_radius_array(
const context& ctx,
const std::vector<T>& radii) { has_radii =
true; set_attribute_array(ctx,
"radius", radii); }
66 template <
typename T =
float>
67 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); }
69 void remove_radius_array(
const context& ctx);
71 template <
typename T =
float>
72 void set_group_radii(
const context& ctx,
const std::vector<T>& group_radii) { has_group_radii =
true; ref_prog().set_uniform_array(ctx,
"group_radii", group_radii); }
74 template <
typename T =
float>
76 ref_prog().set_attribute(ctx, ref_prog().get_attribute_location(ctx,
"position"), (
const cgv::math::fvec<T, 3>&)sphere);
77 ref_prog().set_attribute(ctx, ref_prog().get_attribute_location(ctx,
"radius"), sphere[3]);
82 template <
typename T =
float>
84 set_composed_attribute_array(ctx,
"position", &spheres.front(), spheres.size(),
reinterpret_cast<const cgv::math::fvec<T, 3>&
>(spheres.front()));
85 ref_composed_attribute_array(ctx,
"radius",
"position", &spheres.front(), spheres.size(), spheres[0][3]);
90 bool validate_attributes(
const context& ctx)
const override;
92 bool enable(
context& ctx)
override;
94 bool disable(
context& ctx)
override;
96 void draw(
context& ctx,
size_t start,
size_t count,
97 bool use_strips =
false,
bool use_adjacency =
false, uint32_t strip_restart_index = -1)
override;
base class for all drawables, which is independent of the used rendering API.