cgv
|
base class for plot2d and plot3d, which can have several sub plots each More...
#include <plot_base.h>
Classes | |
struct | label_info |
render information stored per label More... | |
struct | tick_batch_info |
Public Member Functions | |
management of domain configuration | |
void | set_label_font (float font_size, cgv::media::font::FontFaceAttributes ffa=cgv::media::font::FFA_REGULAR, const std::string &font_name="") |
configure the label font | |
const domain_config * | get_domain_config_ptr () const |
return const pointer to domain configuration | |
domain_config * | get_domain_config_ptr () |
return pointer to domain configuration | |
void | set_domain_config_ptr (domain_config *_new_ptr) |
set the domain configuration to an external configuration in order to synch several plots, if set to null, the internal domain config is used again | |
configure domain to world transform | |
const box2 | get_domain () const |
return 2d domain shown in plot | |
const box3 | get_domain3 () const |
return 3d domain shown in plot | |
void | set_domain (const box2 &dom) |
set the domain for 2d plots | |
void | set_domain3 (const box3 &dom) |
set the domain for 3d plots | |
void | set_extent (const vecn &new_extent) |
set the plot extend in 2D coordinates | |
vecn | get_extent () const |
query the plot extend in 2D coordinates | |
void | set_extent_scaling (float x_scale, float y_scale, float z_scale=0) |
set extent_scaling values for all axes | |
void | set_width (float new_width, bool constrained=true) |
set the plot width to given value and if constrained == true the height, such that the aspect ration is the same as the aspect ratio of the domain | |
void | set_height (float new_height, bool constrained=true) |
set the plot height to given value and if constrained == true the width, such that the aspect ration is the same as the aspect ratio of the domain | |
void | set_orientation (const quat &_orientation) |
set new orientation quaternion | |
void | place_origin (const vec3 &new_origin_location) |
place the origin of the plot in 3D to the given location | |
void | place_center (const vec3 &new_center_location) |
place the plot extent center in 3D to the given location (this might can change the current origin location) | |
void | place_corner (unsigned corner_index, const vec3 &new_corner_location) |
place a corner (0 .. lower left, 1 .. lower right, 2 .. upper left, 3 .. upper right) to a given 3D location ((this might can change the current origin / center location) | |
vec3 | get_origin () const |
return the current origin in 3D coordinates | |
const quat & | get_orientation () const |
get current orientation quaternion | |
const vec3 & | get_center () const |
return the current plot center in 3D coordinates | |
vec3 | get_corner (unsigned i) const |
return the i-th plot corner in 3D coordinates | |
const vec3 | get_axis_direction (unsigned ai) const |
return true world direction of x, y or z axis | |
helper functions to adjust axes | |
bool | determine_axis_extent_from_subplot (unsigned ai, unsigned i, float &sample_min, float &sample_max) |
adjust the domain with respect to ai th axis to the i-th subplot | |
void | adjust_domain_axis_to_data (unsigned ai, bool adjust_min=true, bool adjust_max=true, bool only_visible=true) |
adjust the domain with respect to ai th axis to the visible or all data depending on last parameter | |
void | adjust_domain_to_data (bool only_visible=true) |
adjust selected axes of domain to the visible or all data depending on last parameter | |
void | include_axis_to_domain (unsigned ai) |
extend domain such that given axis is included | |
void | adjust_tick_marks (unsigned max_nr_secondary_ticks=20, bool adjust_to_attribute_ranges=true) |
adjust tick marks of all axes based on maximum number of secondary ticks and domain min and max in coordinate of axis | |
void | adjust_extent_to_domain_aspect_ratio (int preserve_ai=0) |
adjust the extent such that it has same aspect ration as domain | |
management of sub plots | |
unsigned | get_nr_sub_plots () const |
return current number of sub plots | |
virtual unsigned | add_sub_plot (const std::string &name)=0 |
add sub plot and return sub plot index | |
virtual void | delete_sub_plot (unsigned i)=0 |
delete the i-th sub plot | |
plot_base_config & | ref_sub_plot_config (unsigned i) |
return a reference to the plot base configuration of the i-th plot | |
void | set_samples_out_of_date (unsigned i) |
notify plot that samples of given subplot are out of date | |
void | set_sub_plot_colors (unsigned i, const rgb &base_color) |
set the colors for all plot features of the i-th sub plot as variation of the given color | |
void | set_sub_plot_attribute (unsigned i, unsigned ai, int subplot_index, size_t aj) |
define a sub plot attribute ai from coordinate aj of the i-th internal sample container | |
void | set_sub_plot_attribute (unsigned i, unsigned ai, const float *_pointer, size_t count, size_t stride) |
define a sub plot attribute from an external pointer | |
void | set_sub_plot_attribute (unsigned i, unsigned ai, const cgv::render::vertex_buffer *_vbo_ptr, size_t _offset, size_t _count, size_t _stride) |
define a sub plot attribute from a vbo (attribute must be stored in float type in vbo) | |
bool | init (cgv::render::context &ctx) |
build legend prog and create aab | |
void | clear (cgv::render::context &ctx) |
destruct shader programs | |
![]() | |
drawable () | |
default construction | |
void | hide () |
hide the drawable | |
void | show () |
show the drawable | |
bool | is_visible () const |
check whether the drawable is visible | |
context * | get_context () const |
access the current context. The context will be available latestly in the init method but not in the contructor. | |
void | set_context (context *_ctx) |
set the current focus context, this should only be called by the context itself | |
view * | find_view_as_node (size_t view_idx=0) const |
convenience function to find the view control in the current hierarchy | |
bool | get_world_location (int x, int y, const view &V, dvec3 &world_location, double *window_z_ptr=0) const |
use given view together with depth buffer of context in order to compute the world location of the point at mouse pointer location (x,y) | |
void | post_redraw () |
posts a redraw event to the current context if one is available | |
void | force_redraw () |
forces a redraw right now. This cannot be called from init, init_frame, draw, finish_draw, finish_frame and clear | |
virtual void | resize (unsigned int w, unsigned int h) |
callback to announce resizing of the output window | |
virtual void | init_frame (context &) |
this method is called in one pass over all drawables before the draw method | |
virtual void | draw (context &) |
overload to draw the content of this drawable | |
virtual void | finish_draw (context &) |
this method is called when the current drawable is left in a tree traversal that calls the draw method | |
virtual void | finish_frame (context &) |
this method is called in one pass over all drawables after drawing | |
virtual void | after_finish (context &) |
this method is called in one pass over all drawables after finish frame | |
![]() | |
traverse_policy (int _policy=TP_ALL+TP_STOP_ON_SUCCESS, bool _active=true, int _focus=-1) | |
construct default traverse policy that visits everything | |
int | get_policy () const |
return the policy without the stop on success flag | |
bool | stop_on_success () const |
return whether to stop on success | |
bool | stop_on_failure () const |
return whether to stop on failure | |
void | set_policy (int _policy) |
set a new policy, always add stop on success flag if needed | |
int | get_focused_child () const |
return the focused child or -1 if none is focused | |
void | set_focused_child (int _focused_child) |
set the focused child | |
bool | get_active () const |
return whether the current node is active | |
void | set_active (bool _active) |
set the active flag of the current node | |
Public Attributes | |
legend | |
LegendComponent | legend_components |
whether to show legend | |
vec3 | legend_location |
center location of legend in domain coordinates | |
vec2 | legend_extent |
width of legend | |
int | legend_axis |
coordinate direction along which to draw legend | |
rgba | legend_color |
color and opacity of legend | |
Protected Attributes | |
configuration parameters of plot | |
unsigned | dim |
dimension of plot | |
unsigned | nr_attributes |
number of additional attributes | |
domain_config | dom_cfg |
domain configuration | |
domain_config * | dom_cfg_ptr |
pointer to currently used domain config | |
std::vector< plot_base_config * > | configs |
store one configuration per sub plot | |
![]() | |
TraversePolicy | policy |
bool | active |
int | focus |
tick render information management | |
cgv::render::view * | view_ptr |
std::vector< label_info > | tick_labels |
all tick labels | |
std::vector< label_info > | legend_tick_labels |
std::vector< tick_batch_info > | tick_batches |
twice number of axis pairs with index of first tick label and number of tick labels for primary and secondary ticks | |
std::vector< tick_batch_info > | legend_tick_batches |
float | layer_depth |
depth offset of a single layer | |
placement of plot | |
quat | orientation |
orientiation quaternion mapping from domain to world coordinates | |
vec3 | center_location |
center location of domain in world coordinates | |
vec3 | world_space_from_plot_space (const vecn &pnt_plot) const |
vec3 | transform_to_world (const vecn &pnt_attr) const |
transform from attribute space to world space | |
visual attribute mapping | |
cgv::media::font::font_ptr | label_font |
store pointer to label font | |
cgv::media::font::font_face_ptr | label_font_face |
store pointer to label font face | |
cgv::media::font::font_ptr | title_font |
store pointer to title font | |
cgv::media::font::font_face_ptr | title_font_face |
store pointer to title font face | |
cgv::render::vertex_buffer | vbo_legend |
vbo for legend drawing | |
cgv::render::attribute_array_binding | aab_legend |
manage attributes for legend drawing | |
std::vector< attribute_source_array > | attribute_source_arrays |
attribute sources | |
vec3 | extent |
extents used for drawing current | |
cgv::render::rectangle_render_style | rrs |
render style of rectangles | |
cgv::render::rectangle_render_style | font_rrs |
cgv::render::attribute_array_manager | aam_legend |
cgv::render::attribute_array_manager | aam_legend_ticks |
cgv::render::attribute_array_manager | aam_title |
ivec4 | out_of_range_mode |
handling of values that are out of range | |
int | color_mapping [MAX_NR_COLOR_MAPPINGS] |
index of attribute mapped to primary and secondary color | |
cgv::media::ColorScale | color_scale_index [MAX_NR_COLOR_MAPPINGS] |
color scale indices of primary and secondary color mapping | |
float | color_scale_gamma [MAX_NR_COLOR_MAPPINGS] |
gamma adjustments for primary and secondary color mapping | |
float | window_zero_position [MAX_NR_COLOR_MAPPINGS] |
window space position of zero for primary and secondary color mapping | |
int | opacity_mapping [MAX_NR_OPACITY_MAPPINGS] |
index of attribute mapped to primary and secondary opacity | |
float | opacity_gamma [MAX_NR_OPACITY_MAPPINGS] |
gamma adjustments for primary and secondary opacity mapping | |
bool | opacity_is_bipolar [MAX_NR_OPACITY_MAPPINGS] |
flag whether opacity mapping is bipolar for primary and secondary opacity mapping | |
float | opacity_window_zero_position [MAX_NR_OPACITY_MAPPINGS] |
window space position of zero for primary and secondary opacity mapping | |
float | opacity_min [MAX_NR_OPACITY_MAPPINGS] |
minimum opacity value for primary and secondary opacity mapping | |
float | opacity_max [MAX_NR_OPACITY_MAPPINGS] |
maximum opacity value for primary and secondary opacity mapping | |
int | size_mapping [MAX_NR_SIZE_MAPPINGS] |
index of attribute mapped to size | |
float | size_gamma [MAX_NR_SIZE_MAPPINGS] |
and independent gamma adjustments | |
float | size_min [MAX_NR_SIZE_MAPPINGS] |
min and max of mapped size | |
float | size_max [MAX_NR_SIZE_MAPPINGS] |
static const unsigned | MAX_NR_COLOR_MAPPINGS = 2 |
define maximum number of color mappings | |
static const unsigned | MAX_NR_OPACITY_MAPPINGS = 2 |
define maximum number of opacity mappings | |
static const unsigned | MAX_NR_SIZE_MAPPINGS = 2 |
define maximum number of size mappings | |
plot_base (unsigned dim, unsigned nr_attributes=0) | |
construct from plot dimension and number of additional attributes with default parameters | |
unsigned | get_dim () const |
return nr dimensions of plot | |
void | set_view_ptr (cgv::render::view *_view_ptr) |
set the view ptr | |
void | on_legend_axis_change (cgv::gui::provider &p, cgv::gui::control< int > &ctrl) |
void | on_font_selection () |
callback to change fonts | |
void | on_font_face_selection () |
callback to change font face | |
void | prepare_extents () |
prepare extents for drawing | |
void | set_plot_uniforms (cgv::render::context &ctx, cgv::render::shader_program &prog) |
set the uniforms for plot configurations | |
void | set_mapping_uniforms (cgv::render::context &ctx, cgv::render::shader_program &prog) |
set the uniforms for defining the mappings to visual variables | |
void | draw_rectangles (cgv::render::context &ctx, cgv::render::attribute_array_manager &aam, std::vector< box2 > &R, std::vector< rgb > &C, std::vector< float > &D, size_t offset=0) |
void | draw_tick_labels (cgv::render::context &ctx, cgv::render::attribute_array_manager &aam_ticks, std::vector< label_info > &tick_labels, std::vector< tick_batch_info > &tick_batches, float depth) |
size_t | enable_attributes (cgv::render::context &ctx, int i, const std::vector< std::vector< vec2 > > &samples) |
set vertex shader input attributes based on attribute source information | |
size_t | enable_attributes (cgv::render::context &ctx, int i, const std::vector< std::vector< vec3 > > &samples) |
set vertex shader input attributes based on attribute source information | |
void | disable_attributes (cgv::render::context &ctx, int i) |
void | update_samples_out_of_date_flag () |
virtual bool | compute_sample_coordinate_interval (int i, int ai, float &samples_min, float &samples_max)=0 |
void | draw_sub_plot_samples (int count, const plot_base_config &spc, bool strip=false) |
void | draw_title (cgv::render::context &ctx, vec2 pos, float depth, int si=-1) |
void | draw_legend (cgv::render::context &ctx, int layer_idx=0, bool is_first=true, bool *multi_axis_modes=0) |
bool | extract_tick_rectangles_and_tick_labels (std::vector< box2 > &R, std::vector< rgb > &C, std::vector< float > &D, std::vector< label_info > &tick_labels, int ai, int ci, int ti, float he, float z_plot, float plot_scale=1.0f, vec2 plot_offset=vec2(0.0f, 0.0f), float d=0.0f, bool multi_axis=true) |
void | extract_legend_tick_rectangles_and_tick_labels (std::vector< box2 > &R, std::vector< rgb > &C, std::vector< float > &D, std::vector< label_info > &tick_labels, std::vector< tick_batch_info > &tick_batches, float d, bool clear_cache=false, bool is_first=true, bool *multi_axis_modes=0) |
font name handling | |
static std::vector< const char * > | font_names |
store a vector with all fonts on the system | |
static std::string | font_name_enum_def |
concatenate font names to enum definition for dropdown control | |
void | ensure_font_names () |
ensure that font names have been enumerate | |
gui support | |
virtual void | create_plot_gui (cgv::base::base *bp, cgv::gui::provider &p) |
create the gui for the plot without gui for sub plots | |
virtual void | create_base_config_gui (cgv::base::base *bp, cgv::gui::provider &p, unsigned i) |
create the gui for base subplot settings | |
virtual void | create_point_config_gui (cgv::base::base *bp, cgv::gui::provider &p, plot_base_config &pbc) |
create the gui for a point subplot | |
virtual void | create_line_config_gui (cgv::base::base *bp, cgv::gui::provider &p, plot_base_config &pbc) |
create the gui for a line subplot | |
virtual void | create_stick_config_gui (cgv::base::base *bp, cgv::gui::provider &p, plot_base_config &pbc) |
create the gui for a stick subplot | |
virtual void | create_bar_config_gui (cgv::base::base *bp, cgv::gui::provider &p, plot_base_config &pbc) |
create the gui for a bar subplot | |
virtual void | create_config_gui (cgv::base::base *bp, cgv::gui::provider &p, unsigned i) |
create the gui for a subplot configuration | |
virtual void | create_gui (cgv::base::base *bp, cgv::gui::provider &p) |
create a gui for the plot with gui for all configs | |
void | update_ref_opacity (unsigned i, cgv::gui::provider &p) |
void | update_ref_opacity_index (unsigned i, cgv::gui::provider &p) |
void | update_ref_size (unsigned i, cgv::gui::provider &p) |
void | update_ref_size_index (unsigned i, cgv::gui::provider &p) |
void | update_ref_color (unsigned i, cgv::gui::provider &p) |
void | update_ref_color_index (unsigned i, cgv::gui::provider &p) |
base class for plot2d and plot3d, which can have several sub plots each
Definition at line 281 of file plot_base.h.
cgv::plot::plot_base::plot_base | ( | unsigned | dim, |
unsigned | nr_attributes = 0 |
||
) |
construct from plot dimension and number of additional attributes with default parameters
Definition at line 576 of file plot_base.cxx.
References center_location, color_mapping, color_scale_gamma, color_scale_index, dim, dom_cfg, dom_cfg_ptr, cgv::render::surface_render_style::illumination_mode, layer_depth, legend_axis, legend_color, legend_components, legend_extent, legend_location, cgv::render::surface_render_style::map_color_to_material, MAX_NR_COLOR_MAPPINGS, MAX_NR_OPACITY_MAPPINGS, MAX_NR_SIZE_MAPPINGS, nr_attributes, opacity_gamma, opacity_is_bipolar, opacity_mapping, opacity_max, opacity_min, opacity_window_zero_position, orientation, out_of_range_mode, rrs, size_gamma, size_mapping, size_min, and window_zero_position.
|
pure virtual |
add sub plot and return sub plot index
Implemented in cgv::plot::plot2d, and cgv::plot::plot3d.
void cgv::plot::plot_base::adjust_domain_axis_to_data | ( | unsigned | ai, |
bool | adjust_min = true , |
||
bool | adjust_max = true , |
||
bool | only_visible = true |
||
) |
adjust the domain with respect to ai
th axis to the visible or all data depending on last parameter
Definition at line 1092 of file plot_base.cxx.
References cgv::plot::domain_config::axis_configs, configs, determine_axis_extent_from_subplot(), get_domain_config_ptr(), and ref_sub_plot_config().
Referenced by adjust_domain_to_data().
void cgv::plot::plot_base::adjust_domain_to_data | ( | bool | only_visible = true | ) |
adjust selected axes of domain to the visible or all data depending on last parameter
Definition at line 1158 of file plot_base.cxx.
References adjust_domain_axis_to_data(), and get_domain_config_ptr().
void cgv::plot::plot_base::adjust_extent_to_domain_aspect_ratio | ( | int | preserve_ai = 0 | ) |
adjust the extent such that it has same aspect ration as domain
Definition at line 1137 of file plot_base.cxx.
References cgv::plot::domain_config::axis_configs, get_dim(), and get_domain_config_ptr().
void cgv::plot::plot_base::adjust_tick_marks | ( | unsigned | max_nr_secondary_ticks = 20 , |
bool | adjust_to_attribute_ranges = true |
||
) |
adjust tick marks of all axes based on maximum number of secondary ticks and domain min and max in coordinate of axis
Definition at line 1128 of file plot_base.cxx.
References cgv::plot::domain_config::axis_configs, get_dim(), and get_domain_config_ptr().
|
virtual |
destruct shader programs
Reimplemented from cgv::render::drawable.
Definition at line 1247 of file plot_base.cxx.
References aab_legend, attribute_source_arrays, cgv::render::attribute_array_binding::destruct(), cgv::render::shader_program::destruct(), cgv::render::vertex_buffer::destruct(), get_nr_sub_plots(), cgv::render::ref_rectangle_renderer(), and vbo_legend.
Referenced by cgv::plot::plot3d::clear().
|
virtual |
create the gui for a bar subplot
Reimplemented in cgv::plot::plot2d, and cgv::plot::plot3d.
Definition at line 1533 of file plot_base.cxx.
References cgv::gui::provider::add_member_control(), cgv::plot::plot_base_config::bar_color, cgv::plot::plot_base_config::bar_coordinate_index, cgv::plot::plot_base_config::bar_outline_color, cgv::plot::plot_base_config::bar_outline_width, cgv::plot::plot_base_config::bar_percentual_width, and get_dim().
Referenced by cgv::plot::plot3d::create_bar_config_gui(), and create_config_gui().
|
virtual |
create the gui for base subplot settings
Definition at line 1461 of file plot_base.cxx.
References cgv::gui::provider::add_gui(), cgv::gui::provider::add_member_control(), cgv::gui::provider::align(), attribute_source_arrays, cgv::plot::plot_base_config::begin_sample, cgv::plot::plot_base_config::end_sample, cgv::plot::plot_base_config::name, cgv::plot::plot_base_config::ref_color, cgv::plot::plot_base_config::ref_opacity, cgv::plot::plot_base_config::ref_size, ref_sub_plot_config(), and cgv::plot::plot_base_config::sub_plot_influence.
Referenced by create_config_gui().
|
virtual |
create the gui for a subplot configuration
Reimplemented in cgv::plot::plot2d, and cgv::plot::plot3d.
Definition at line 1543 of file plot_base.cxx.
References cgv::gui::provider::add_member_control(), cgv::gui::provider::align(), cgv::gui::provider::begin_tree_node(), create_bar_config_gui(), create_base_config_gui(), create_line_config_gui(), create_point_config_gui(), create_stick_config_gui(), cgv::gui::provider::end_tree_node(), ref_sub_plot_config(), cgv::render::drawable::show(), cgv::plot::plot_base_config::show_bars, cgv::plot::plot_base_config::show_lines, cgv::plot::plot_base_config::show_plot, cgv::plot::plot_base_config::show_points, and cgv::plot::plot_base_config::show_sticks.
Referenced by cgv::plot::plot3d::create_config_gui(), and create_gui().
|
virtual |
create a gui for the plot with gui for all configs
Reimplemented in cgv::plot::plot2d, and cgv::plot::plot3d.
Definition at line 1586 of file plot_base.cxx.
References cgv::gui::provider::add_decorator(), cgv::gui::provider::add_member_control(), cgv::gui::provider::align(), cgv::gui::provider::begin_tree_node(), create_config_gui(), create_plot_gui(), cgv::gui::provider::end_tree_node(), get_nr_sub_plots(), cgv::plot::plot_base_config::name, cgv::plot::plot_base_config::ref_color, ref_sub_plot_config(), cgv::render::drawable::show(), and cgv::plot::plot_base_config::show_plot.
Referenced by cgv::plot::plot3d::create_gui().
|
virtual |
create the gui for a line subplot
Reimplemented in cgv::plot::plot3d.
Definition at line 1518 of file plot_base.cxx.
References cgv::plot::plot_base_config::line_color, cgv::plot::plot_base_config::line_halo_color, cgv::plot::plot_base_config::line_halo_width, and cgv::plot::plot_base_config::line_width.
Referenced by create_config_gui(), and cgv::plot::plot3d::create_line_config_gui().
|
virtual |
create the gui for the plot without gui for sub plots
Definition at line 1262 of file plot_base.cxx.
References cgv::gui::provider::add_gui(), cgv::gui::provider::add_member_control(), cgv::gui::provider::align(), cgv::plot::domain_config::axis_configs, cgv::gui::provider::begin_tree_node(), center_location, color_mapping, color_scale_gamma, color_scale_index, dim, cgv::gui::provider::end_tree_node(), ensure_font_names(), cgv::gui::provider::find_control(), font_name_enum_def, get_dim(), get_domain_config_ptr(), layer_depth, legend_axis, legend_color, legend_components, legend_extent, legend_location, MAX_NR_COLOR_MAPPINGS, MAX_NR_OPACITY_MAPPINGS, MAX_NR_SIZE_MAPPINGS, nr_attributes, on_font_face_selection(), on_font_selection(), opacity_gamma, opacity_is_bipolar, opacity_mapping, opacity_max, opacity_min, opacity_window_zero_position, orientation, out_of_range_mode, rrs, cgv::render::drawable::show(), cgv::plot::domain_config::show_sub_plot_names, cgv::plot::domain_config::show_title, size_gamma, size_mapping, size_min, cgv::plot::domain_config::title, cgv::plot::domain_config::title_font_index, cgv::plot::domain_config::title_font_size, cgv::plot::domain_config::title_pos, and window_zero_position.
Referenced by create_gui().
|
virtual |
create the gui for a point subplot
Reimplemented in cgv::plot::plot2d.
Definition at line 1511 of file plot_base.cxx.
References cgv::plot::plot_base_config::point_color, cgv::plot::plot_base_config::point_halo_color, cgv::plot::plot_base_config::point_halo_width, and cgv::plot::plot_base_config::point_size.
Referenced by create_config_gui().
|
virtual |
create the gui for a stick subplot
Reimplemented in cgv::plot::plot2d.
Definition at line 1525 of file plot_base.cxx.
References cgv::gui::provider::add_member_control(), get_dim(), cgv::plot::plot_base_config::stick_base_window, cgv::plot::plot_base_config::stick_color, cgv::plot::plot_base_config::stick_coordinate_index, and cgv::plot::plot_base_config::stick_width.
Referenced by create_config_gui().
|
pure virtual |
delete the i-th sub plot
Implemented in cgv::plot::plot2d, and cgv::plot::plot3d.
bool cgv::plot::plot_base::determine_axis_extent_from_subplot | ( | unsigned | ai, |
unsigned | i, | ||
float & | sample_min, | ||
float & | sample_max | ||
) |
adjust the domain with respect to ai
th axis to the i-th subplot
Definition at line 1047 of file plot_base.cxx.
References attribute_source_arrays.
Referenced by adjust_domain_axis_to_data().
|
protected |
Definition at line 566 of file plot_base.cxx.
|
protected |
Definition at line 862 of file plot_base.cxx.
|
protected |
Definition at line 223 of file plot_base.cxx.
|
protected |
Definition at line 237 of file plot_base.cxx.
|
protected |
Definition at line 812 of file plot_base.cxx.
|
protected |
Definition at line 762 of file plot_base.cxx.
|
protected |
set vertex shader input attributes based on attribute source information
Definition at line 558 of file plot_base.cxx.
|
protected |
set vertex shader input attributes based on attribute source information
Definition at line 562 of file plot_base.cxx.
void cgv::plot::plot_base::ensure_font_names | ( | ) |
ensure that font names have been enumerate
Definition at line 275 of file plot_base.cxx.
References cgv::media::font::default_font(), cgv::media::font::enumerate_font_names(), font_name_enum_def, font_names, get_domain_config_ptr(), label_font, cgv::plot::domain_config::label_font_index, on_font_selection(), title_font, and cgv::plot::domain_config::title_font_index.
Referenced by create_plot_gui(), and init().
|
protected |
Definition at line 723 of file plot_base.cxx.
|
protected |
Definition at line 622 of file plot_base.cxx.
const vec3 cgv::plot::plot_base::get_axis_direction | ( | unsigned | ai | ) | const |
return true world direction of x, y or z axis
Definition at line 1040 of file plot_base.cxx.
References cgv::math::quaternion< T >::apply(), and orientation.
const vec3 & cgv::plot::plot_base::get_center | ( | ) | const |
return the current plot center in 3D coordinates
Definition at line 1027 of file plot_base.cxx.
References center_location.
vec3 cgv::plot::plot_base::get_corner | ( | unsigned | i | ) | const |
return the i-th plot corner in 3D coordinates
Definition at line 1031 of file plot_base.cxx.
References cgv::media::axis_aligned_box< T, N >::get_corner(), get_dim(), get_domain3(), and transform_to_world().
Referenced by place_corner().
|
inline |
return nr dimensions of plot
Definition at line 488 of file plot_base.h.
Referenced by adjust_extent_to_domain_aspect_ratio(), adjust_tick_marks(), create_bar_config_gui(), create_plot_gui(), create_stick_config_gui(), get_corner(), get_domain3(), get_extent(), include_axis_to_domain(), prepare_extents(), set_domain3(), set_extent(), set_extent_scaling(), and set_sub_plot_attribute().
const box2 cgv::plot::plot_base::get_domain | ( | ) | const |
return 2d domain shown in plot
Definition at line 933 of file plot_base.cxx.
References cgv::plot::domain_config::axis_configs, and get_domain_config_ptr().
const box3 cgv::plot::plot_base::get_domain3 | ( | ) | const |
return 3d domain shown in plot
Definition at line 939 of file plot_base.cxx.
References cgv::plot::domain_config::axis_configs, get_dim(), and get_domain_config_ptr().
Referenced by get_corner(), and get_origin().
domain_config * cgv::plot::plot_base::get_domain_config_ptr | ( | ) |
return pointer to domain configuration
Definition at line 1184 of file plot_base.cxx.
References dom_cfg_ptr.
const domain_config * cgv::plot::plot_base::get_domain_config_ptr | ( | ) | const |
return const pointer to domain configuration
Definition at line 1180 of file plot_base.cxx.
References dom_cfg_ptr.
Referenced by adjust_domain_axis_to_data(), adjust_domain_to_data(), adjust_extent_to_domain_aspect_ratio(), adjust_tick_marks(), create_plot_gui(), cgv::plot::plot3d::draw(), ensure_font_names(), get_domain(), get_domain3(), get_extent(), include_axis_to_domain(), on_font_face_selection(), on_font_selection(), cgv::plot::plot2d::plot2d(), cgv::plot::plot3d::plot3d(), prepare_extents(), set_domain(), set_domain3(), set_extent(), set_extent_scaling(), set_height(), set_label_font(), set_plot_uniforms(), set_width(), and transform_to_world().
vecn cgv::plot::plot_base::get_extent | ( | ) | const |
query the plot extend in 2D coordinates
Definition at line 958 of file plot_base.cxx.
References cgv::plot::domain_config::axis_configs, extent, get_dim(), and get_domain_config_ptr().
unsigned cgv::plot::plot_base::get_nr_sub_plots | ( | ) | const |
return current number of sub plots
Definition at line 1195 of file plot_base.cxx.
References configs.
Referenced by cgv::plot::plot2d::add_sub_plot(), cgv::plot::plot3d::add_sub_plot(), clear(), and create_gui().
const quat & cgv::plot::plot_base::get_orientation | ( | ) | const |
get current orientation quaternion
Definition at line 1023 of file plot_base.cxx.
References orientation.
vec3 cgv::plot::plot_base::get_origin | ( | ) | const |
return the current origin in 3D coordinates
Definition at line 1019 of file plot_base.cxx.
References get_domain3(), and transform_to_world().
Referenced by place_origin().
void cgv::plot::plot_base::include_axis_to_domain | ( | unsigned | ai | ) |
extend domain such that given axis is included
Definition at line 1146 of file plot_base.cxx.
References cgv::plot::domain_config::axis_configs, get_dim(), and get_domain_config_ptr().
|
virtual |
build legend prog and create aab
Reimplemented from cgv::render::drawable.
Definition at line 1212 of file plot_base.cxx.
References aab_legend, cgv::render::shader_program::build_program(), cgv::render::attribute_array_binding::create(), cgv::render::vertex_buffer::create(), cgv::render::attribute_array_binding::enable_array(), ensure_font_names(), cgv::render::shader_program::get_attribute_location(), cgv::render::ref_rectangle_renderer(), cgv::render::attribute_array_binding::set_attribute_array(), and vbo_legend.
Referenced by cgv::plot::plot3d::init().
|
protected |
callback to change font face
Definition at line 335 of file plot_base.cxx.
References get_domain_config_ptr(), label_font, label_font_face, title_font, and title_font_face.
Referenced by create_plot_gui(), on_font_selection(), and set_label_font().
|
protected |
callback to change fonts
Definition at line 327 of file plot_base.cxx.
References cgv::media::font::find_font(), font_names, get_domain_config_ptr(), label_font, on_font_face_selection(), and title_font.
Referenced by create_plot_gui(), ensure_font_names(), and set_label_font().
|
protected |
Definition at line 316 of file plot_base.cxx.
void cgv::plot::plot_base::place_center | ( | const vec3 & | new_center_location | ) |
place the plot extent center in 3D to the given location (this might can change the current origin location)
Definition at line 1011 of file plot_base.cxx.
References center_location.
void cgv::plot::plot_base::place_corner | ( | unsigned | corner_index, |
const vec3 & | new_corner_location | ||
) |
place a corner (0 .. lower left, 1 .. lower right, 2 .. upper left, 3 .. upper right) to a given 3D location ((this might can change the current origin / center location)
Definition at line 1015 of file plot_base.cxx.
References center_location, and get_corner().
void cgv::plot::plot_base::place_origin | ( | const vec3 & | new_origin_location | ) |
place the origin of the plot in 3D to the given location
Definition at line 1007 of file plot_base.cxx.
References center_location, and get_origin().
|
protected |
prepare extents for drawing
Definition at line 343 of file plot_base.cxx.
References cgv::plot::domain_config::axis_configs, extent, get_dim(), and get_domain_config_ptr().
Referenced by cgv::plot::plot3d::draw().
plot_base_config & cgv::plot::plot_base::ref_sub_plot_config | ( | unsigned | i | ) |
return a reference to the plot base configuration of the i-th plot
Definition at line 1199 of file plot_base.cxx.
References configs.
Referenced by cgv::plot::plot2d::add_sub_plot(), cgv::plot::plot3d::add_sub_plot(), adjust_domain_axis_to_data(), create_base_config_gui(), create_config_gui(), create_gui(), cgv::plot::plot2d::ref_sub_plot2d_config(), cgv::plot::plot3d::ref_sub_plot3d_config(), and set_sub_plot_colors().
void cgv::plot::plot_base::set_domain | ( | const box2 & | dom | ) |
set the domain for 2d plots
Definition at line 945 of file plot_base.cxx.
References cgv::plot::domain_config::axis_configs, get_domain_config_ptr(), cgv::media::axis_aligned_box< T, N >::get_max_pnt(), and cgv::media::axis_aligned_box< T, N >::get_min_pnt().
void cgv::plot::plot_base::set_domain3 | ( | const box3 & | dom | ) |
set the domain for 3d plots
Definition at line 951 of file plot_base.cxx.
References cgv::plot::domain_config::axis_configs, get_dim(), get_domain_config_ptr(), cgv::media::axis_aligned_box< T, N >::get_max_pnt(), and cgv::media::axis_aligned_box< T, N >::get_min_pnt().
void cgv::plot::plot_base::set_domain_config_ptr | ( | domain_config * | _new_ptr | ) |
set the domain configuration to an external configuration in order to synch several plots, if set to null, the internal domain config is used again
Definition at line 1188 of file plot_base.cxx.
References dom_cfg, and dom_cfg_ptr.
void cgv::plot::plot_base::set_extent | ( | const vecn & | new_extent | ) |
set the plot extend in 2D coordinates
Definition at line 966 of file plot_base.cxx.
References cgv::plot::domain_config::axis_configs, extent, get_dim(), get_domain_config_ptr(), and cgv::math::vec< T >::size().
void cgv::plot::plot_base::set_extent_scaling | ( | float | x_scale, |
float | y_scale, | ||
float | z_scale = 0 |
||
) |
set extent_scaling values for all axes
for all axes with extent_scaling > 0 (axes values default to 0) ensure that world extents are in same ratio as extent_scaling values
Definition at line 974 of file plot_base.cxx.
References cgv::plot::domain_config::axis_configs, get_dim(), and get_domain_config_ptr().
void cgv::plot::plot_base::set_height | ( | float | new_height, |
bool | constrained = true |
||
) |
set the plot height to given value and if constrained == true the width, such that the aspect ration is the same as the aspect ratio of the domain
Definition at line 993 of file plot_base.cxx.
References cgv::plot::domain_config::axis_configs, and get_domain_config_ptr().
void cgv::plot::plot_base::set_label_font | ( | float | font_size, |
cgv::media::font::FontFaceAttributes | ffa = cgv::media::font::FFA_REGULAR , |
||
const std::string & | font_name = "" |
||
) |
configure the label font
Definition at line 1164 of file plot_base.cxx.
References font_names, get_domain_config_ptr(), cgv::plot::domain_config::label_ffa, cgv::plot::domain_config::label_font_index, cgv::plot::domain_config::label_font_size, on_font_face_selection(), and on_font_selection().
|
protected |
set the uniforms for defining the mappings to visual variables
Definition at line 395 of file plot_base.cxx.
References color_mapping, color_scale_gamma, color_scale_index, cgv::render::configure_color_scale(), cgv::render::shader_program::get_uniform_location(), MAX_NR_COLOR_MAPPINGS, MAX_NR_OPACITY_MAPPINGS, MAX_NR_SIZE_MAPPINGS, opacity_gamma, opacity_is_bipolar, opacity_mapping, opacity_max, opacity_min, opacity_window_zero_position, cgv::render::shader_program::set_uniform_array(), size_gamma, size_mapping, size_min, and window_zero_position.
void cgv::plot::plot_base::set_orientation | ( | const quat & | _orientation | ) |
set new orientation quaternion
Definition at line 1003 of file plot_base.cxx.
References orientation.
|
protected |
set the uniforms for plot configurations
Definition at line 374 of file plot_base.cxx.
References cgv::plot::domain_config::axis_configs, center_location, extent, get_domain_config_ptr(), orientation, out_of_range_mode, cgv::render::shader_program::set_uniform(), cgv::render::shader_program::set_uniform_array(), and cgv::math::fvec< T, N >::size().
void cgv::plot::plot_base::set_samples_out_of_date | ( | unsigned | i | ) |
notify plot that samples of given subplot are out of date
Definition at line 1203 of file plot_base.cxx.
References attribute_source_arrays.
void cgv::plot::plot_base::set_sub_plot_attribute | ( | unsigned | i, |
unsigned | ai, | ||
const cgv::render::vertex_buffer * | _vbo_ptr, | ||
size_t | _offset, | ||
size_t | _count, | ||
size_t | _stride | ||
) |
define a sub plot attribute from a vbo (attribute must be stored in float type in vbo)
Definition at line 439 of file plot_base.cxx.
References attribute_source_arrays.
void cgv::plot::plot_base::set_sub_plot_attribute | ( | unsigned | i, |
unsigned | ai, | ||
const float * | _pointer, | ||
size_t | count, | ||
size_t | stride | ||
) |
define a sub plot attribute from an external pointer
Definition at line 430 of file plot_base.cxx.
References attribute_source_arrays.
void cgv::plot::plot_base::set_sub_plot_attribute | ( | unsigned | i, |
unsigned | ai, | ||
int | subplot_index, | ||
size_t | aj | ||
) |
define a sub plot attribute ai from coordinate aj of the i-th internal sample container
Definition at line 421 of file plot_base.cxx.
References attribute_source_arrays, and get_dim().
void cgv::plot::plot_base::set_sub_plot_colors | ( | unsigned | i, |
const rgb & | base_color | ||
) |
set the colors for all plot features of the i-th sub plot as variation of the given color
Definition at line 1207 of file plot_base.cxx.
References ref_sub_plot_config(), and cgv::plot::plot_base_config::set_colors().
void cgv::plot::plot_base::set_view_ptr | ( | cgv::render::view * | _view_ptr | ) |
set the view ptr
Definition at line 617 of file plot_base.cxx.
void cgv::plot::plot_base::set_width | ( | float | new_width, |
bool | constrained = true |
||
) |
set the plot width to given value and if constrained == true the height, such that the aspect ration is the same as the aspect ratio of the domain
Definition at line 983 of file plot_base.cxx.
References cgv::plot::domain_config::axis_configs, and get_domain_config_ptr().
transform from attribute space to world space
Definition at line 261 of file plot_base.cxx.
References cgv::plot::domain_config::axis_configs, get_domain_config_ptr(), and cgv::math::vec< T >::size().
Referenced by get_corner(), and get_origin().
|
protected |
Definition at line 1417 of file plot_base.cxx.
|
protected |
Definition at line 1429 of file plot_base.cxx.
|
protected |
Definition at line 1393 of file plot_base.cxx.
|
protected |
Definition at line 1405 of file plot_base.cxx.
|
protected |
Definition at line 1441 of file plot_base.cxx.
|
protected |
Definition at line 1451 of file plot_base.cxx.
|
protected |
Definition at line 570 of file plot_base.cxx.
Definition at line 256 of file plot_base.cxx.
|
protected |
manage attributes for legend drawing
Definition at line 427 of file plot_base.h.
|
protected |
Definition at line 450 of file plot_base.h.
|
protected |
Definition at line 450 of file plot_base.h.
|
protected |
Definition at line 450 of file plot_base.h.
|
protected |
attribute sources
Definition at line 429 of file plot_base.h.
Referenced by cgv::plot::plot2d::add_sub_plot(), cgv::plot::plot3d::add_sub_plot(), clear(), create_base_config_gui(), determine_axis_extent_from_subplot(), set_samples_out_of_date(), set_sub_plot_attribute(), set_sub_plot_attribute(), and set_sub_plot_attribute().
|
protected |
center location of domain in world coordinates
Definition at line 356 of file plot_base.h.
Referenced by create_plot_gui(), cgv::plot::plot3d::draw(), get_center(), place_center(), place_corner(), place_origin(), plot_base(), and set_plot_uniforms().
int cgv::plot::plot_base::color_mapping[MAX_NR_COLOR_MAPPINGS] |
index of attribute mapped to primary and secondary color
Definition at line 383 of file plot_base.h.
Referenced by create_plot_gui(), plot_base(), and set_mapping_uniforms().
float cgv::plot::plot_base::color_scale_gamma[MAX_NR_COLOR_MAPPINGS] |
gamma adjustments for primary and secondary color mapping
Definition at line 387 of file plot_base.h.
Referenced by create_plot_gui(), plot_base(), and set_mapping_uniforms().
cgv::media::ColorScale cgv::plot::plot_base::color_scale_index[MAX_NR_COLOR_MAPPINGS] |
color scale indices of primary and secondary color mapping
Definition at line 385 of file plot_base.h.
Referenced by create_plot_gui(), plot_base(), and set_mapping_uniforms().
|
protected |
store one configuration per sub plot
Definition at line 348 of file plot_base.h.
Referenced by cgv::plot::plot2d::add_sub_plot(), cgv::plot::plot3d::add_sub_plot(), adjust_domain_axis_to_data(), cgv::plot::plot2d::delete_sub_plot(), cgv::plot::plot3d::delete_sub_plot(), get_nr_sub_plots(), and ref_sub_plot_config().
|
protected |
dimension of plot
Definition at line 340 of file plot_base.h.
Referenced by create_plot_gui(), and plot_base().
|
protected |
domain configuration
Definition at line 344 of file plot_base.h.
Referenced by plot_base(), and set_domain_config_ptr().
|
protected |
pointer to currently used domain config
Definition at line 346 of file plot_base.h.
Referenced by get_domain_config_ptr(), get_domain_config_ptr(), plot_base(), and set_domain_config_ptr().
|
protected |
extents used for drawing current
Definition at line 437 of file plot_base.h.
Referenced by get_extent(), prepare_extents(), set_extent(), and set_plot_uniforms().
|
staticprotected |
concatenate font names to enum definition for dropdown control
Definition at line 330 of file plot_base.h.
Referenced by create_plot_gui(), and ensure_font_names().
|
staticprotected |
store a vector with all fonts on the system
Definition at line 328 of file plot_base.h.
Referenced by ensure_font_names(), on_font_selection(), and set_label_font().
|
protected |
Definition at line 449 of file plot_base.h.
|
protected |
store pointer to label font
Definition at line 417 of file plot_base.h.
Referenced by ensure_font_names(), on_font_face_selection(), and on_font_selection().
|
protected |
store pointer to label font face
Definition at line 419 of file plot_base.h.
Referenced by on_font_face_selection().
|
protected |
depth offset of a single layer
Definition at line 323 of file plot_base.h.
Referenced by create_plot_gui(), and plot_base().
int cgv::plot::plot_base::legend_axis |
coordinate direction along which to draw legend
Definition at line 372 of file plot_base.h.
Referenced by create_plot_gui(), and plot_base().
rgba cgv::plot::plot_base::legend_color |
color and opacity of legend
Definition at line 374 of file plot_base.h.
Referenced by create_plot_gui(), and plot_base().
LegendComponent cgv::plot::plot_base::legend_components |
whether to show legend
Definition at line 366 of file plot_base.h.
Referenced by create_plot_gui(), cgv::plot::plot3d::draw(), and plot_base().
vec2 cgv::plot::plot_base::legend_extent |
width of legend
Definition at line 370 of file plot_base.h.
Referenced by create_plot_gui(), and plot_base().
vec3 cgv::plot::plot_base::legend_location |
center location of legend in domain coordinates
Definition at line 368 of file plot_base.h.
Referenced by create_plot_gui(), cgv::plot::plot3d::plot3d(), and plot_base().
|
protected |
Definition at line 321 of file plot_base.h.
|
protected |
Definition at line 319 of file plot_base.h.
|
static |
define maximum number of color mappings
Definition at line 381 of file plot_base.h.
Referenced by create_plot_gui(), plot_base(), and set_mapping_uniforms().
|
static |
define maximum number of opacity mappings
Definition at line 392 of file plot_base.h.
Referenced by create_plot_gui(), plot_base(), and set_mapping_uniforms().
|
static |
define maximum number of size mappings
Definition at line 407 of file plot_base.h.
Referenced by create_plot_gui(), plot_base(), and set_mapping_uniforms().
|
protected |
number of additional attributes
Definition at line 342 of file plot_base.h.
Referenced by create_plot_gui(), cgv::plot::plot2d::plot2d(), cgv::plot::plot3d::plot3d(), and plot_base().
float cgv::plot::plot_base::opacity_gamma[MAX_NR_OPACITY_MAPPINGS] |
gamma adjustments for primary and secondary opacity mapping
Definition at line 396 of file plot_base.h.
Referenced by create_plot_gui(), plot_base(), and set_mapping_uniforms().
bool cgv::plot::plot_base::opacity_is_bipolar[MAX_NR_OPACITY_MAPPINGS] |
flag whether opacity mapping is bipolar for primary and secondary opacity mapping
Definition at line 398 of file plot_base.h.
Referenced by create_plot_gui(), plot_base(), and set_mapping_uniforms().
int cgv::plot::plot_base::opacity_mapping[MAX_NR_OPACITY_MAPPINGS] |
index of attribute mapped to primary and secondary opacity
Definition at line 394 of file plot_base.h.
Referenced by create_plot_gui(), plot_base(), and set_mapping_uniforms().
float cgv::plot::plot_base::opacity_max[MAX_NR_OPACITY_MAPPINGS] |
maximum opacity value for primary and secondary opacity mapping
Definition at line 404 of file plot_base.h.
Referenced by create_plot_gui(), plot_base(), and set_mapping_uniforms().
float cgv::plot::plot_base::opacity_min[MAX_NR_OPACITY_MAPPINGS] |
minimum opacity value for primary and secondary opacity mapping
Definition at line 402 of file plot_base.h.
Referenced by create_plot_gui(), plot_base(), and set_mapping_uniforms().
float cgv::plot::plot_base::opacity_window_zero_position[MAX_NR_OPACITY_MAPPINGS] |
window space position of zero for primary and secondary opacity mapping
Definition at line 400 of file plot_base.h.
Referenced by create_plot_gui(), plot_base(), and set_mapping_uniforms().
|
protected |
orientiation quaternion mapping from domain to world coordinates
Definition at line 354 of file plot_base.h.
Referenced by create_plot_gui(), cgv::plot::plot3d::draw(), get_axis_direction(), get_orientation(), plot_base(), set_orientation(), and set_plot_uniforms().
ivec4 cgv::plot::plot_base::out_of_range_mode |
handling of values that are out of range
Definition at line 379 of file plot_base.h.
Referenced by create_plot_gui(), plot_base(), and set_plot_uniforms().
|
protected |
render style of rectangles
Definition at line 449 of file plot_base.h.
Referenced by create_plot_gui(), and plot_base().
float cgv::plot::plot_base::size_gamma[MAX_NR_SIZE_MAPPINGS] |
and independent gamma adjustments
Definition at line 411 of file plot_base.h.
Referenced by create_plot_gui(), plot_base(), and set_mapping_uniforms().
int cgv::plot::plot_base::size_mapping[MAX_NR_SIZE_MAPPINGS] |
index of attribute mapped to size
Definition at line 409 of file plot_base.h.
Referenced by create_plot_gui(), plot_base(), and set_mapping_uniforms().
float cgv::plot::plot_base::size_max[MAX_NR_SIZE_MAPPINGS] |
Definition at line 413 of file plot_base.h.
float cgv::plot::plot_base::size_min[MAX_NR_SIZE_MAPPINGS] |
min and max of mapped size
Definition at line 413 of file plot_base.h.
Referenced by create_plot_gui(), plot_base(), and set_mapping_uniforms().
|
protected |
twice number of axis pairs with index of first tick label and number of tick labels for primary and secondary ticks
Definition at line 321 of file plot_base.h.
|
protected |
all tick labels
Definition at line 319 of file plot_base.h.
|
protected |
store pointer to title font
Definition at line 421 of file plot_base.h.
Referenced by ensure_font_names(), on_font_face_selection(), and on_font_selection().
|
protected |
store pointer to title font face
Definition at line 423 of file plot_base.h.
Referenced by on_font_face_selection().
|
protected |
vbo for legend drawing
Definition at line 425 of file plot_base.h.
|
protected |
Definition at line 289 of file plot_base.h.
float cgv::plot::plot_base::window_zero_position[MAX_NR_COLOR_MAPPINGS] |
window space position of zero for primary and secondary color mapping
Definition at line 389 of file plot_base.h.
Referenced by create_plot_gui(), plot_base(), and set_mapping_uniforms().