3#include "surface_renderer.h"
5#include "gl/lib_begin.h"
9 class CGV_API arrow_renderer;
15 extern CGV_API arrow_renderer&
ref_arrow_renderer(context& ctx,
int ref_count_change = 0);
22 AHLM_RELATIVE_TO_RADIUS = 1,
23 AHLM_RELATIVE_TO_LENGTH = 2,
24 AHLM_MINIMUM_OF_RADIUS_AND_LENGTH = 3
33 float radius_lower_bound = 0.00001f;
35 float radius_relative_to_length = 0.1f;
37 float head_radius_scale = 2.0f;
41 float head_length_relative_to_radius = 2.0f;
43 float head_length_relative_to_length = 0.3f;
45 float length_scale = 1.0f;
47 float color_scale = 1.0f;
49 bool normalize_length =
false;
51 float relative_location_of_position = 0.0f;
53 float length_eps = 0.000001f;
61 bool has_directions =
false;
62 bool position_is_center =
false;
63 bool direction_is_end_point =
false;
77 void set_direction_array(
const context& ctx,
const std::vector<T>& directions) { has_directions =
true; direction_is_end_point =
false; set_attribute_array(ctx,
"direction", directions); }
80 void set_direction_array(
const context& ctx,
const T* directions,
size_t nr_elements,
unsigned stride_in_bytes = 0) { has_directions =
true; direction_is_end_point =
false; set_attribute_array(ctx,
"direction", directions, nr_elements, stride_in_bytes); }
82 void remove_direction_array(
const context& ctx);
85 void set_end_point_array(
const context& ctx,
const std::vector<T>& end_points) { has_directions =
true; direction_is_end_point =
true; set_attribute_array(ctx,
"direction", end_points); }
88 void set_end_point_array(
const context& ctx,
const T* end_points,
size_t nr_elements,
unsigned stride_in_bytes = 0) { has_directions =
true; direction_is_end_point =
true; set_attribute_array(ctx,
"direction", end_points, nr_elements, stride_in_bytes); }
90 void remove_end_point_array(
const context& ctx);
92 bool validate_attributes(
const context& ctx)
const override;
94 bool enable(
context& ctx)
override;
96 bool disable(
context& ctx)
override;
98 void draw(
context& ctx,
size_t start,
size_t count,
99 bool use_strips =
false,
bool use_adjacency =
false, uint32_t strip_restart_index = -1)
override;
109#include <cgv/config/lib_end.h>
the self reflection handler is passed to the virtual self_reflect() method of cgv::base::base.
renderer that supports point splatting
render_style * create_render_style() const override
create and return the default render style
void set_direction_array(const context &ctx, const T *directions, size_t nr_elements, unsigned stride_in_bytes=0)
templated method to set the direction attribute from an array of directions of type T,...
void set_end_point_array(const context &ctx, const T *end_points, size_t nr_elements, unsigned stride_in_bytes=0)
templated method to set the end_point attribute from an array of end_points of type T,...
void set_direction_array(const context &ctx, const std::vector< T > &directions)
templated method to set the direction attribute from a vector of directions of type T,...
void set_end_point_array(const context &ctx, const std::vector< T > &end_points)
templated method to set the end_point attribute from a vector of end_points of type T,...
std::string get_default_prog_name() const override
return the default shader program name
attribute array manager used to upload arrays to gpu
base class for all drawables, which is independent of the used rendering API.
Stores preprocessor options used for conditionally compiling shader programs.
a shader program combines several shader code fragments to a complete definition of the shading pipel...
base classes for renderers that support surface rendering
arrow_renderer & ref_arrow_renderer(context &ctx, int ref_count_change)
reference to a singleton surfel renderer that can be shared among drawables
ArrowHeadLengthMode
different modes to compute the head length of an arrow
this reflection traits implementation is used for external self_reflect implementations of instances ...
base class for all render styles