3#include "group_renderer.h"
5#include "gl/lib_begin.h"
9 class CGV_API slab_renderer;
15 extern CGV_API slab_renderer&
ref_slab_renderer(context& ctx,
int ref_count_change = 0);
35 int tf_source_channel;
80 void set_position_is_center(
bool _position_is_center);
85 void set_extent(
const context& ctx,
const T& extent) { has_extents =
true; ref_prog().set_attribute(ctx, get_prog_attribute_location(ctx,
"extent"), extent); }
88 void set_extent_array(
const context& ctx,
const std::vector<T>& extents) { has_extents =
true; set_attribute_array(ctx,
"extent", extents); }
91 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); }
95 set_composed_attribute_array(ctx,
"position", &box.front(), box.size(), box[0].get_min_pnt());
96 ref_composed_attribute_array(ctx,
"extent",
"position", &box.front(), box.size(), box[0].get_max_pnt());
99 set_position_is_center(
false);
102 template <
typename T>
104 set_composed_attribute_array(ctx,
"position", box, count, box[0].get_min_pnt());
105 ref_composed_attribute_array(ctx,
"extent",
"position", box, count, box[0].get_max_pnt());
106 has_positions =
true;
108 set_position_is_center(
false);
111 template <
typename T>
112 void set_translation_array(
const context& ctx,
const std::vector<T>& translations) { has_translations =
true; set_attribute_array(ctx,
"translation", translations); }
114 template <
typename T>
115 void set_translation_array(
const context& ctx,
const T* translations,
size_t nr_elements,
unsigned stride) { has_translations =
true; set_attribute_array(ctx,
"translation", translations, nr_elements, stride); }
117 template <
typename T>
118 void set_rotation_array(
const context& ctx,
const std::vector<T>& rotations) { has_rotations =
true; set_attribute_array(ctx,
"rotation", rotations); }
120 template <
typename T>
121 void set_rotation_array(
const context& ctx,
const T* rotations,
size_t nr_elements,
unsigned stride) { has_rotations =
true; set_attribute_array(ctx,
"rotation", rotations, nr_elements, stride); }
123 template <
typename T>
124 void set_texture_index_array(
const context& ctx,
const std::vector<T>& texture_indices) { has_texture_indices =
true; set_attribute_array(ctx,
"texture_index", texture_indices); }
126 template <
typename T>
127 void set_texture_index_array(
const context& ctx,
const T* texture_indices,
size_t nr_elements,
unsigned stride_in_bytes = 0) { has_texture_indices =
true; set_attribute_array(ctx,
"texture_index", texture_indices, nr_elements, stride_in_bytes); }
129 bool validate_attributes(
const context& ctx)
const;
133 void draw(
context& ctx,
size_t start,
size_t count,
134 bool use_strips =
false,
bool use_adjacency =
false, uint32_t strip_restart_index = -1);
145#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
base class for all drawables, which is independent of the used rendering API.
abstract renderer class that provides functionality for grouping primitives
a shader program combines several shader code fragments to a complete definition of the shading pipel...
renderer that supports point splatting
void set_translation_array(const context &ctx, const T *translations, size_t nr_elements, unsigned stride)
template method to set the translations from a vector of vectors of type T, which should have 3 compo...
bool has_extents
store whether extent array has been specified
void set_texture_index_array(const context &ctx, const std::vector< T > &texture_indices)
extent array specifies slab extends in case of position_is_center=true, otherwise the maximum point o...
bool has_texture_indices
whether array with per slab texture index has been specified
void set_box_array(const context &ctx, const std::vector< cgv::media::axis_aligned_box< T, 3 > > &box)
specify box array directly. This sets position_is_center to false as well as position and extent arra...
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...
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 slab translations has been specified
void set_extent(const context &ctx, const T &extent)
specify a single extent for all slabs
bool position_is_center
whether position is slab center, if not it is lower left bottom corner
void set_box_array(const context &ctx, const cgv::media::axis_aligned_box< T, 3 > *box, size_t count)
specify box array directly. This sets position_is_center to false as well as position and extent arra...
void set_extent_array(const context &ctx, const std::vector< T > &extents)
extent array specifies slab extends in case of position_is_center=true, otherwise the maximum point o...
void set_texture_index_array(const context &ctx, const T *texture_indices, size_t nr_elements, unsigned stride_in_bytes=0)
extent array specifies slab extends in case of position_is_center=true, otherwise the maximum point o...
void set_extent_array(const context &ctx, const T *extents, size_t nr_elements, unsigned stride_in_bytes=0)
extent array specifies slab extends in case of position_is_center=true, otherwise the maximum point o...
bool has_rotations
whether array with per slab rotations has been specified
void set_rotation_array(const context &ctx, const T *rotations, size_t nr_elements, unsigned stride)
template method to set the rotation from a vector of quaternions of type T, which should have 4 compo...
std::map< std::string, std::string > shader_define_map
typedef for shader define map data structure
slab_renderer & ref_slab_renderer(context &ctx, int ref_count_change)
reference to a singleton slab renderer that is shared among drawables
this reflection traits implementation is used for external self_reflect implementations of instances ...
render style used for group information
base class for all render styles
float falloff_mix
overall influence of the falloff
float opacity
multiplied to the input opacity value during rendering to change the overall opacity of the slabs
float falloff_strength
strength of the opacity falloff in the slabs normal direction
int tf_tex_unit
unit used to access the volume transfer function texture, initialized to 1, must be a 1d texture
float step_size
constant step size for volume ray integration over all slabs
int tex_idx_offset
used to offset the texture index of each slab when specified
float scale
compensates for the overall slab scale
int tex_unit
unit used to access the slab texture values, initialized to 0, must point to a 2d texture array
bool use_transfer_function
whether to use a transfer function or interpret the luminance as alpha, initialized to false
float thickness_scale
multiplied to the thickness, initialized to 1
int tex_idx_stride
multiplied to the texture index of each slab