cgv
Loading...
Searching...
No Matches
plot3d.h
1
#pragma once
2
3
#include "plot_base.h"
4
#include <cgv/render/shader_program.h>
5
#include <libs/cgv_gl/box_renderer.h>
6
#include <cgv_gl/cone_renderer.h>
7
8
#include "lib_begin.h"
9
10
namespace
cgv
{
11
namespace
plot {
12
14
enum
PlotFaceIllumination
15
{
16
PFI_NONE,
17
PFI_PER_FACE,
18
PFI_PER_VERTEX
19
};
20
22
struct
CGV_API
plot3d_config
:
public
plot_base_config
23
{
25
bool
show_line_orientation
;
27
mapped_size
bar_percentual_depth
;
29
unsigned
samples_per_row
;
31
bool
show_surface
;
33
bool
wireframe
;
35
rgb
surface_color
;
37
PlotFaceIllumination
face_illumination
;
39
void
set_colors(
const
rgb
& base_color);
41
plot3d_config
(
const
std::string& _name);
42
};
43
45
class
CGV_API
plot3d
:
public
plot_base
46
{
47
cgv::render::shader_program
tick_label_prog;
48
cgv::render::shader_program
sphere_prog;
49
cgv::render::shader_program
box_prog;
50
cgv::render::shader_program
wirebox_prog;
51
cgv::render::shader_program
stick_prog;
52
cgv::render::shader_program
tube_prog;
53
//cgv::render::shader_program surface_prog;
54
cgv::render::box_render_style
brs;
55
cgv::render::cone_render_style
rcrs;
56
cgv::render::attribute_array_manager
aam_domain;
57
58
bool
compute_sample_coordinate_interval(
int
i,
int
ai,
float
& samples_min,
float
& samples_max);
59
void
draw_domain(
cgv::render::context
& ctx);
60
void
draw_ticks(
cgv::render::context
& ctx);
61
void
draw_sub_plots(
cgv::render::context
& ctx);
62
protected
:
63
std::vector<std::vector<vec3> > samples;
65
void
compute_tick_render_information();
66
public
:
68
plot3d
(
unsigned
nr_attributes = 0);
72
unsigned
add_sub_plot(
const
std::string& name);
74
void
set_samples_per_row(
unsigned
i,
unsigned
N);
76
unsigned
get_samples_per_row(
unsigned
i)
const
;
78
void
delete_sub_plot(
unsigned
i);
80
plot3d_config
& ref_sub_plot3d_config(
unsigned
i = 0);
82
std::vector<vec3>& ref_sub_plot_samples(
unsigned
i = 0);
84
86
void
create_line_config_gui(
cgv::base::base
* bp,
cgv::gui::provider
& p,
plot_base_config
& pbc);
88
void
create_bar_config_gui(
cgv::base::base
* bp,
cgv::gui::provider
& p,
plot_base_config
& pbc);
89
void
create_config_gui(
cgv::base::base
* bp,
cgv::gui::provider
& p,
unsigned
i);
90
bool
init(
cgv::render::context
& ctx);
91
void
draw(
cgv::render::context
& ctx);
92
void
clear(
cgv::render::context
& ctx);
93
void
create_gui(
cgv::base::base
* bp,
cgv::gui::provider
& p);
94
};
95
96
}
97
}
98
#include <cgv/config/lib_end.h>
cgv::base::base
base class for all classes that can be registered with support for dynamic properties (see also secti...
Definition
base.h:75
cgv::gui::provider
derive from this class to provide a gui to the current viewer
Definition
provider.h:64
cgv::media::color< float, cgv::media::RGB >
cgv::plot::plot3d
The plot3d class draws 2d plots with potentially several sub plots of different plot configuration.
Definition
plot3d.h:46
cgv::plot::plot_base
base class for plot2d and plot3d, which can have several sub plots each
Definition
plot_base.h:282
cgv::render::attribute_array_manager
attribute array manager used to upload arrays to gpu
Definition
attribute_array_manager.h:14
cgv::render::context
base class for all drawables, which is independent of the used rendering API.
Definition
context.h:621
cgv::render::shader_program
a shader program combines several shader code fragments to a complete definition of the shading pipel...
Definition
shader_program.h:28
cgv
the cgv namespace
Definition
print.h:11
cgv::plot::mapped_size
Definition
plot_base.h:96
cgv::plot::plot3d_config
extend common plot configuration with parameters specific to 2d plot
Definition
plot3d.h:23
cgv::plot::plot3d_config::surface_color
rgb surface_color
color of faces
Definition
plot3d.h:35
cgv::plot::plot3d_config::face_illumination
PlotFaceIllumination face_illumination
how to illuminate the surface
Definition
plot3d.h:37
cgv::plot::plot3d_config::samples_per_row
unsigned samples_per_row
if samples per row > 0, the samples are interpreted as regular grid
Definition
plot3d.h:29
cgv::plot::plot3d_config::bar_percentual_depth
mapped_size bar_percentual_depth
provide second dimension of bar extend
Definition
plot3d.h:27
cgv::plot::plot3d_config::wireframe
bool wireframe
whether to turn on wireframe
Definition
plot3d.h:33
cgv::plot::plot3d_config::show_line_orientation
bool show_line_orientation
whether to illustrate line orientation
Definition
plot3d.h:25
cgv::plot::plot3d_config::show_surface
bool show_surface
whether to show faces
Definition
plot3d.h:31
cgv::plot::plot_base_config
plot independent configuration parameters of one sub plot in a 2d or 3d plot
Definition
plot_base.h:130
cgv::render::box_render_style
boxes use surface render styles
Definition
box_renderer.h:19
cgv::render::cone_render_style
Definition
cone_renderer.h:19
libs
plot
plot3d.h
Generated by
1.9.8