3#include "line_renderer.h"
5#include "gl/lib_begin.h"
30 bool has_extents =
false;
47 void set_position_is_center(
bool _position_is_center);
49 bool enable(
context& ctx)
override;
52 void set_extent(
const context& ctx,
const T& extent) { has_extents =
true;
ref_prog().set_attribute(ctx, get_prog_attribute_location(ctx,
"extent"), extent); }
55 void set_extent_array(
const context& ctx,
const std::vector<T>& extents) { has_extents =
true; set_attribute_array(ctx,
"extent", extents); }
58 void set_extent_array(
const context& ctx,
const T* extents,
size_t nr_elements,
unsigned stride_in_bytes = 0) { has_extents =
true; set_attribute_array(ctx,
"extent", extents, nr_elements, stride_in_bytes); }
60 void remove_extent_array(
const context& ctx);
91 void set_translation_array(
const context& ctx,
const T* translations,
size_t nr_elements,
unsigned stride_in_bytes = 0) {
has_translations =
true; set_attribute_array(ctx,
"translation", translations, nr_elements, stride_in_bytes); }
93 void remove_translation_array(
const context& ctx);
99 void set_rotation_array(
const context& ctx,
const T* rotations,
size_t nr_elements,
unsigned stride_in_bytes = 0) {
has_rotations =
true; set_attribute_array(ctx,
"rotation", rotations, nr_elements, stride_in_bytes); }
101 void remove_rotation_array(
const context& ctx);
103 bool disable(
context& ctx)
override;
105 void draw(
context& ctx,
size_t start,
size_t count,
106 bool use_strips =
false,
bool use_adjacency =
false, uint32_t strip_restart_index = -1)
override;
116#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
renderer that supports point splatting
void set_position_is_center(bool _position_is_center)
set the flag, whether the position is interpreted as the box center
void set_extent_array(const context &ctx, const T *extents, size_t nr_elements, unsigned stride_in_bytes=0)
extent array specifies box extends in case of position_is_center=true, otherwise the maximum point of...
void set_rotation_array(const context &ctx, const std::vector< T > &rotations)
template method to set the rotation from a vector of quaternions of type T, which should have 4 compo...
bool has_translations
whether array with per box translations has been specified
void set_translation_array(const context &ctx, const std::vector< T > &translations)
template method to set the translations from a vector of vectors of type T, which should have 3 compo...
render_style * create_render_style() const override
create and return the default render style
void set_box(const context &ctx, const cgv::media::axis_aligned_box< T, 3 > &box)
specify a single box. This sets position_is_center to false as well as position and extent attributes
void set_box_array(const context &ctx, const std::vector< cgv::media::axis_aligned_box< T, 3 > > &boxes)
specify box array directly. This sets position_is_center to false as well as position and extent arra...
void set_box_array(const context &ctx, const cgv::media::axis_aligned_box< T, 3 > *boxes, size_t count)
specify box array directly. This sets position_is_center to false as well as position and extent arra...
void set_extent(const context &ctx, const T &extent)
specify a single extent for all boxes
bool has_rotations
whether array with per box rotations has been specified
void set_translation_array(const context &ctx, const T *translations, size_t nr_elements, unsigned stride_in_bytes=0)
template method to set the translations from a vector of vectors of type T, which should have 3 compo...
void set_rotation_array(const context &ctx, const T *rotations, size_t nr_elements, unsigned stride_in_bytes=0)
template method to set the rotation from a vector of quaternions of type T, which should have 4 compo...
bool position_is_center
whether position is box center, if not it is lower left bottom corner
std::string get_default_prog_name() const override
return the default shader program name
void set_extent_array(const context &ctx, const std::vector< T > &extents)
extent array specifies box extends in case of position_is_center=true, otherwise the maximum point of...
base class for all drawables, which is independent of the used rendering API.
renderer that supports point splatting
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...
shader_program & ref_prog()
derived renderer classes have access to shader program
bool has_positions
track whether position attribute is defined
void set_position(const context &ctx, const T &position)
templated method to set the position attribute from a single position of type T
namespace for api independent GPU programming
box_wire_renderer & ref_box_wire_renderer(context &ctx, int ref_count_change)
reference to a singleton box_wire renderer that can be 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 ...
box wires extend line render styles
vec3 default_extent
extent used in case extent array is not specified; defaults to (1,1,1)
vec3 relative_anchor
box anchor position relative to center that corresponds to the position attribute; defaults to (0,...
base class for all render styles