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 = 1.0f;
21 };
22
24 class CGV_API normal_renderer : public line_renderer
25 {
26 protected:
28 float normal_scale = 1.0f;
30 std::string get_default_prog_name() const override { return "normal.glpr"; }
32 render_style* create_render_style() const override { return new normal_render_style(); }
33 bool validate_attributes(const context& ctx) const override;
34 public:
36 void set_normal_scale(float _normal_scale);
38 bool enable(context& ctx) override;
40 void draw(context& ctx, size_t start, size_t count,
41 bool use_strips = false, bool use_adjacency = false, uint32_t strip_restart_index = -1) override;
42 };
43
45 {
46 bool self_reflect(cgv::reflect::reflection_handler& rh);
47 };
49 }
50}
51
52#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:627
renderer that supports point splatting
renderer that supports rendering point normals
std::string get_default_prog_name() const override
return the default shader program name
render_style * create_render_style() const override
create and return the default render style
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