cgv
Loading...
Searching...
No Matches
cgv::plot::plot_base Class Referenceabstract

base class for plot2d and plot3d, which can have several sub plots each More...

#include <plot_base.h>

Inheritance diagram for cgv::plot::plot_base:
cgv::render::drawable cgv::base::traverse_policy cgv::plot::plot2d cgv::plot::plot3d

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_configget_domain_config_ptr () const
 return const pointer to domain configuration
 
domain_configget_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 quatget_orientation () const
 get current orientation quaternion
 
const vec3get_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_configref_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
 
- Public Member Functions inherited from cgv::render::drawable
 drawable ()
 default construction
 
void hide ()
 hide the drawable
 
void show ()
 show the drawable
 
bool is_visible () const
 check whether the drawable is visible
 
contextget_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
 
viewfind_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
 
- Public Member Functions inherited from cgv::base::traverse_policy
 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_configdom_cfg_ptr
 pointer to currently used domain config
 
std::vector< plot_base_config * > configs
 store one configuration per sub plot
 
- Protected Attributes inherited from cgv::base::traverse_policy
TraversePolicy policy
 
bool active
 
int focus
 

tick render information management

cgv::render::viewview_ptr
 
std::vector< label_infotick_labels
 all tick labels
 
std::vector< label_infolegend_tick_labels
 
std::vector< tick_batch_infotick_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_infolegend_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_arrayattribute_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)
 

Detailed Description

base class for plot2d and plot3d, which can have several sub plots each

Definition at line 281 of file plot_base.h.

Constructor & Destructor Documentation

◆ plot_base()

Member Function Documentation

◆ add_sub_plot()

virtual unsigned cgv::plot::plot_base::add_sub_plot ( const std::string &  name)
pure virtual

add sub plot and return sub plot index

Implemented in cgv::plot::plot2d, and cgv::plot::plot3d.

◆ adjust_domain_axis_to_data()

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().

◆ 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().

◆ adjust_extent_to_domain_aspect_ratio()

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().

◆ adjust_tick_marks()

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().

◆ clear()

◆ create_bar_config_gui()

◆ create_base_config_gui()

◆ create_config_gui()

◆ create_gui()

◆ create_line_config_gui()

void cgv::plot::plot_base::create_line_config_gui ( cgv::base::base bp,
cgv::gui::provider p,
plot_base_config pbc 
)
virtual

◆ create_plot_gui()

◆ create_point_config_gui()

void cgv::plot::plot_base::create_point_config_gui ( cgv::base::base bp,
cgv::gui::provider p,
plot_base_config pbc 
)
virtual

◆ create_stick_config_gui()

void cgv::plot::plot_base::create_stick_config_gui ( cgv::base::base bp,
cgv::gui::provider p,
plot_base_config pbc 
)
virtual

◆ delete_sub_plot()

virtual void cgv::plot::plot_base::delete_sub_plot ( unsigned  i)
pure virtual

delete the i-th sub plot

Implemented in cgv::plot::plot2d, and cgv::plot::plot3d.

◆ determine_axis_extent_from_subplot()

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().

◆ disable_attributes()

void cgv::plot::plot_base::disable_attributes ( cgv::render::context ctx,
int  i 
)
protected

Definition at line 566 of file plot_base.cxx.

◆ draw_legend()

void cgv::plot::plot_base::draw_legend ( cgv::render::context ctx,
int  layer_idx = 0,
bool  is_first = true,
bool *  multi_axis_modes = 0 
)
protected

Definition at line 862 of file plot_base.cxx.

◆ draw_rectangles()

void cgv::plot::plot_base::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 
)
protected

Definition at line 223 of file plot_base.cxx.

◆ draw_sub_plot_samples()

void cgv::plot::plot_base::draw_sub_plot_samples ( int  count,
const plot_base_config spc,
bool  strip = false 
)
protected

Definition at line 237 of file plot_base.cxx.

◆ draw_tick_labels()

void cgv::plot::plot_base::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 
)
protected

Definition at line 812 of file plot_base.cxx.

◆ draw_title()

void cgv::plot::plot_base::draw_title ( cgv::render::context ctx,
vec2  pos,
float  depth,
int  si = -1 
)
protected

Definition at line 762 of file plot_base.cxx.

◆ enable_attributes() [1/2]

size_t cgv::plot::plot_base::enable_attributes ( cgv::render::context ctx,
int  i,
const std::vector< std::vector< vec2 > > &  samples 
)
protected

set vertex shader input attributes based on attribute source information

Definition at line 558 of file plot_base.cxx.

◆ enable_attributes() [2/2]

size_t cgv::plot::plot_base::enable_attributes ( cgv::render::context ctx,
int  i,
const std::vector< std::vector< vec3 > > &  samples 
)
protected

set vertex shader input attributes based on attribute source information

Definition at line 562 of file plot_base.cxx.

◆ ensure_font_names()

◆ extract_legend_tick_rectangles_and_tick_labels()

void cgv::plot::plot_base::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 
)
protected

Definition at line 723 of file plot_base.cxx.

◆ extract_tick_rectangles_and_tick_labels()

bool cgv::plot::plot_base::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 
)
protected

Definition at line 622 of file plot_base.cxx.

◆ get_axis_direction()

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.

◆ get_center()

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.

◆ get_corner()

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().

◆ get_dim()

◆ get_domain()

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().

◆ get_domain3()

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().

◆ get_domain_config_ptr() [1/2]

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.

◆ get_domain_config_ptr() [2/2]

◆ get_extent()

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().

◆ get_nr_sub_plots()

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().

◆ get_orientation()

const quat & cgv::plot::plot_base::get_orientation ( ) const

get current orientation quaternion

Definition at line 1023 of file plot_base.cxx.

References orientation.

◆ get_origin()

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().

◆ include_axis_to_domain()

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().

◆ init()

◆ on_font_face_selection()

void cgv::plot::plot_base::on_font_face_selection ( )
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().

◆ on_font_selection()

void cgv::plot::plot_base::on_font_selection ( )
protected

◆ on_legend_axis_change()

void cgv::plot::plot_base::on_legend_axis_change ( cgv::gui::provider p,
cgv::gui::control< int > &  ctrl 
)
protected

Definition at line 316 of file plot_base.cxx.

◆ place_center()

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.

◆ place_corner()

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().

◆ place_origin()

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().

◆ prepare_extents()

void cgv::plot::plot_base::prepare_extents ( )
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().

◆ ref_sub_plot_config()

plot_base_config & cgv::plot::plot_base::ref_sub_plot_config ( unsigned  i)

◆ set_domain()

void cgv::plot::plot_base::set_domain ( const box2 dom)

◆ set_domain3()

void cgv::plot::plot_base::set_domain3 ( const box3 dom)

◆ set_domain_config_ptr()

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.

◆ set_extent()

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().

◆ set_extent_scaling()

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().

◆ set_height()

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().

◆ set_label_font()

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 = "" 
)

◆ set_mapping_uniforms()

◆ set_orientation()

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.

◆ set_plot_uniforms()

◆ set_samples_out_of_date()

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.

◆ set_sub_plot_attribute() [1/3]

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.

◆ set_sub_plot_attribute() [2/3]

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.

◆ set_sub_plot_attribute() [3/3]

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().

◆ set_sub_plot_colors()

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().

◆ set_view_ptr()

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.

◆ set_width()

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_to_world()

vec3 cgv::plot::plot_base::transform_to_world ( const vecn pnt_attr) const
protected

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().

◆ update_ref_color()

void cgv::plot::plot_base::update_ref_color ( unsigned  i,
cgv::gui::provider p 
)
protected

Definition at line 1417 of file plot_base.cxx.

◆ update_ref_color_index()

void cgv::plot::plot_base::update_ref_color_index ( unsigned  i,
cgv::gui::provider p 
)
protected

Definition at line 1429 of file plot_base.cxx.

◆ update_ref_opacity()

void cgv::plot::plot_base::update_ref_opacity ( unsigned  i,
cgv::gui::provider p 
)
protected

Definition at line 1393 of file plot_base.cxx.

◆ update_ref_opacity_index()

void cgv::plot::plot_base::update_ref_opacity_index ( unsigned  i,
cgv::gui::provider p 
)
protected

Definition at line 1405 of file plot_base.cxx.

◆ update_ref_size()

void cgv::plot::plot_base::update_ref_size ( unsigned  i,
cgv::gui::provider p 
)
protected

Definition at line 1441 of file plot_base.cxx.

◆ update_ref_size_index()

void cgv::plot::plot_base::update_ref_size_index ( unsigned  i,
cgv::gui::provider p 
)
protected

Definition at line 1451 of file plot_base.cxx.

◆ update_samples_out_of_date_flag()

void cgv::plot::plot_base::update_samples_out_of_date_flag ( )
protected

Definition at line 570 of file plot_base.cxx.

◆ world_space_from_plot_space()

vec3 cgv::plot::plot_base::world_space_from_plot_space ( const vecn pnt_plot) const
protected

Definition at line 256 of file plot_base.cxx.

Member Data Documentation

◆ aab_legend

cgv::render::attribute_array_binding cgv::plot::plot_base::aab_legend
protected

manage attributes for legend drawing

Definition at line 427 of file plot_base.h.

Referenced by clear(), and init().

◆ aam_legend

cgv::render::attribute_array_manager cgv::plot::plot_base::aam_legend
protected

Definition at line 450 of file plot_base.h.

◆ aam_legend_ticks

cgv::render::attribute_array_manager cgv::plot::plot_base::aam_legend_ticks
protected

Definition at line 450 of file plot_base.h.

◆ aam_title

cgv::render::attribute_array_manager cgv::plot::plot_base::aam_title
protected

Definition at line 450 of file plot_base.h.

◆ attribute_source_arrays

◆ center_location

vec3 cgv::plot::plot_base::center_location
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().

◆ color_mapping

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().

◆ color_scale_gamma

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().

◆ color_scale_index

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().

◆ configs

◆ dim

unsigned cgv::plot::plot_base::dim
protected

dimension of plot

Definition at line 340 of file plot_base.h.

Referenced by create_plot_gui(), and plot_base().

◆ dom_cfg

domain_config cgv::plot::plot_base::dom_cfg
protected

domain configuration

Definition at line 344 of file plot_base.h.

Referenced by plot_base(), and set_domain_config_ptr().

◆ dom_cfg_ptr

domain_config* cgv::plot::plot_base::dom_cfg_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().

◆ extent

vec3 cgv::plot::plot_base::extent
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().

◆ font_name_enum_def

std::string cgv::plot::plot_base::font_name_enum_def
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().

◆ font_names

std::vector< const char * > cgv::plot::plot_base::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().

◆ font_rrs

cgv::render::rectangle_render_style cgv::plot::plot_base::font_rrs
protected

Definition at line 449 of file plot_base.h.

◆ label_font

cgv::media::font::font_ptr cgv::plot::plot_base::label_font
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().

◆ label_font_face

cgv::media::font::font_face_ptr cgv::plot::plot_base::label_font_face
protected

store pointer to label font face

Definition at line 419 of file plot_base.h.

Referenced by on_font_face_selection().

◆ layer_depth

float cgv::plot::plot_base::layer_depth
protected

depth offset of a single layer

Definition at line 323 of file plot_base.h.

Referenced by create_plot_gui(), and plot_base().

◆ legend_axis

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().

◆ legend_color

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().

◆ legend_components

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().

◆ legend_extent

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().

◆ legend_location

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().

◆ legend_tick_batches

std::vector<tick_batch_info> cgv::plot::plot_base::legend_tick_batches
protected

Definition at line 321 of file plot_base.h.

◆ legend_tick_labels

std::vector<label_info> cgv::plot::plot_base::legend_tick_labels
protected

Definition at line 319 of file plot_base.h.

◆ MAX_NR_COLOR_MAPPINGS

const unsigned cgv::plot::plot_base::MAX_NR_COLOR_MAPPINGS = 2
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().

◆ MAX_NR_OPACITY_MAPPINGS

const unsigned cgv::plot::plot_base::MAX_NR_OPACITY_MAPPINGS = 2
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().

◆ MAX_NR_SIZE_MAPPINGS

const unsigned cgv::plot::plot_base::MAX_NR_SIZE_MAPPINGS = 2
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().

◆ nr_attributes

unsigned cgv::plot::plot_base::nr_attributes
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().

◆ opacity_gamma

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().

◆ opacity_is_bipolar

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().

◆ opacity_mapping

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().

◆ opacity_max

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().

◆ opacity_min

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().

◆ opacity_window_zero_position

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().

◆ orientation

quat cgv::plot::plot_base::orientation
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().

◆ out_of_range_mode

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().

◆ rrs

cgv::render::rectangle_render_style cgv::plot::plot_base::rrs
protected

render style of rectangles

Definition at line 449 of file plot_base.h.

Referenced by create_plot_gui(), and plot_base().

◆ size_gamma

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().

◆ size_mapping

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().

◆ size_max

float cgv::plot::plot_base::size_max[MAX_NR_SIZE_MAPPINGS]

Definition at line 413 of file plot_base.h.

◆ size_min

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().

◆ tick_batches

std::vector<tick_batch_info> cgv::plot::plot_base::tick_batches
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.

◆ tick_labels

std::vector<label_info> cgv::plot::plot_base::tick_labels
protected

all tick labels

Definition at line 319 of file plot_base.h.

◆ title_font

cgv::media::font::font_ptr cgv::plot::plot_base::title_font
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().

◆ title_font_face

cgv::media::font::font_face_ptr cgv::plot::plot_base::title_font_face
protected

store pointer to title font face

Definition at line 423 of file plot_base.h.

Referenced by on_font_face_selection().

◆ vbo_legend

cgv::render::vertex_buffer cgv::plot::plot_base::vbo_legend
protected

vbo for legend drawing

Definition at line 425 of file plot_base.h.

Referenced by clear(), and init().

◆ view_ptr

cgv::render::view* cgv::plot::plot_base::view_ptr
protected

Definition at line 289 of file plot_base.h.

◆ window_zero_position

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().


The documentation for this class was generated from the following files: