3 #include "line_renderer.h"
5 #include "gl/lib_begin.h"
9 class CGV_API box_wire_renderer;
48 void set_position_is_center(
bool _position_is_center);
55 void set_extent_array(
const context& ctx,
const std::vector<T>& extents) { has_extents =
true; set_attribute_array(ctx, ref_prog().get_attribute_location(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, ref_prog().get_attribute_location(ctx,
"extent"), extents, nr_elements, stride_in_bytes); }
62 set_composed_attribute_array(ctx, ref_prog().get_attribute_location(ctx,
"position"),
63 &boxes.front(), boxes.size(), boxes[0].get_min_pnt());
64 ref_composed_attribute_array(ctx, ref_prog().get_attribute_location(ctx,
"extent"),
65 ref_prog().get_attribute_location(ctx,
"position"), &boxes.front(), boxes.size(), boxes[0].get_max_pnt());
68 set_position_is_center(
false);
73 set_composed_attribute_array(ctx, ref_prog().get_attribute_location(ctx,
"position"),
74 boxes, count, boxes[0].get_min_pnt());
75 ref_composed_attribute_array(ctx, ref_prog().get_attribute_location(ctx,
"extent"),
76 ref_prog().get_attribute_location(ctx,
"position"), boxes, count, boxes[0].get_max_pnt());
79 set_position_is_center(
false);
83 void set_translation_array(
const context& ctx,
const std::vector<T>& translations) { has_translations =
true; set_attribute_array(ctx, ref_prog().get_attribute_location(ctx,
"translation"), translations); }
86 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, ref_prog().get_attribute_location(ctx,
"translation"), translations, nr_elements, stride_in_bytes); }
89 void set_rotation_array(
const context& ctx,
const std::vector<T>& rotations) { has_rotations =
true; set_attribute_array(ctx, ref_prog().get_attribute_location(ctx,
"rotation"), rotations); }
92 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, ref_prog().get_attribute_location(ctx,
"rotation"), rotations, nr_elements, stride_in_bytes); }
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);
99 struct CGV_API box_wire_render_style_reflect :
public box_wire_render_style
107 #include <cgv/config/lib_end.h>
base class for all render styles
Definition: renderer.h:16
vec3 default_extent
extent used in case extent array is not specified
Definition: box_wire_renderer.h:21
bool has_rotations
whether array with per box rotations has been specified
Definition: box_wire_renderer.h:36
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...
Definition: box_wire_renderer.h:58
bool has_translations
whether array with per box translations has been specified
Definition: box_wire_renderer.h:34
renderer that supports point splatting
Definition: line_renderer.h:62
attribute array manager used to upload arrays to gpu
Definition: renderer.h:21
vec3 relative_anchor
box anchor position relative to center that corresponds to the position attribute
Definition: box_wire_renderer.h:23
renderer that supports point splatting
Definition: box_wire_renderer.h:30
Definition: reflection_handler.h:63
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...
Definition: box_wire_renderer.h:92
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...
Definition: box_wire_renderer.h:61
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...
Definition: box_wire_renderer.h:86
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...
Definition: box_wire_renderer.h:83
Definition: line_renderer.h:13
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...
Definition: box_wire_renderer.h:89
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...
Definition: box_wire_renderer.h:72
this reflection traits implementation is used for external self_reflect implementations of instances ...
Definition: reflect_extern.h:28
box wires extend line render styles
Definition: box_wire_renderer.h:19
bool position_is_center
whether position is box center, if not it is lower left bottom corner
Definition: box_wire_renderer.h:38
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
Definition: box_wire_renderer.cxx:13
the cgv namespace
Definition: vr_calib.cxx:9
Definition: context.h:525
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...
Definition: box_wire_renderer.h:55