cgv
Loading...
Searching...
No Matches
normal_renderer.h
1#pragma once
2
3#include "line_renderer.h"
4
5#include "gl/lib_begin.h"
6
7namespace cgv {
8 namespace render {
9 class CGV_API normal_renderer;
10
12
15 extern CGV_API normal_renderer& ref_normal_renderer(context& ctx, int ref_count_change = 0);
16
17
18 struct CGV_API normal_render_style : public line_render_style
19 {
20 float normal_length;
22 };
23
25 class CGV_API normal_renderer : public line_renderer
26 {
27 protected:
31 render_style* create_render_style() const;
33 bool build_shader_program(context& ctx, shader_program& prog, const shader_define_map& defines);
34 bool validate_attributes(const context& ctx) const;
35 public:
38 void set_normal_scale(float _normal_scale);
40 bool enable(context& ctx);
42 void draw(context& ctx, size_t start, size_t count,
43 bool use_strips = false, bool use_adjacency = false, uint32_t strip_restart_index = -1);
44 };
45
47 {
48 bool self_reflect(cgv::reflect::reflection_handler& rh);
49 };
51 }
52}
53
54#include <cgv/config/lib_end.h>
the self reflection handler is passed to the virtual self_reflect() method of cgv::base::base.
base class for all drawables, which is independent of the used rendering API.
Definition context.h:621
renderer that supports point splatting
renderer that supports rendering point normals
float normal_scale
scaling of normal length
a shader program combines several shader code fragments to a complete definition of the shading pipel...
std::map< std::string, std::string > shader_define_map
typedef for shader define map data structure
Definition shader_code.h:52
normal_renderer & ref_normal_renderer(context &ctx, int ref_count_change)
reference to a singleton normal renderer that can be shared among drawables
the cgv namespace
Definition print.h:11
this reflection traits implementation is used for external self_reflect implementations of instances ...
base class for all render styles
Definition renderer.h:16