FuncSketch
Loading...
Searching...
No Matches
func_sketch::plotter::PlotConfig Class Reference

Class of configurations of a plot. More...

#include <func_sketch/plotter/plot_config.h>

Collaboration diagram for func_sketch::plotter::PlotConfig:

Public Member Functions

 PlotConfig ()=default
 Constructor.
PlotConfigleft_margin (int value)
 Set the left margin of plots in pixels.
PlotConfigright_margin (int value)
 Set the right margin of plots in pixels.
PlotConfigtop_margin (int value)
 Set the top margin of plots in pixels.
PlotConfigbottom_margin (int value)
 Set the bottom margin of plots in pixels.
PlotConfigtick_label_font_size (int value)
 Set the font size of tick labels in pixels.
PlotConfigaxes_line_width (int value)
 Set the line width of axes in pixels.
PlotConfiggrid_line_width (int value)
 Set the line width of grid lines in pixels.
PlotConfigzero_line_width (int value)
 Set the line width of the grid line at zero in pixels.
PlotConfigcurve_line_width (int value)
 Set the line width of curves in pixels.
PlotConfigbackground_color (const RGBColor &value)
 Set the color of background.
PlotConfigaxes_color (const RGBColor &value)
 Set the color of axes.
PlotConfiggrid_color (const RGBColor &value)
 Set the color of grid lines.
PlotConfiginitial_num_sample_points (std::size_t value)
 Set the number of points to sample initially in adaptive sampling.
PlotConfigmax_num_sample_points (std::size_t value)
 Set the maximum number of points to sample in adaptive sampling.
PlotConfigmax_coordinate_change_rate (double value)
 Set the threshold of the change in coordinates of sample points relative to the plot range in adaptive sampling.
PlotConfigslope_change_threshold (double value)
 Set the threshold of the change in slope normalized by the plot range in adaptive sampling.
PlotConfigmin_param_change_rate (double value)
 Set the minimum rate of parameter change in adaptive sampling.
PlotConfignum_pixels_per_tick_in_x_axis (std::size_t value)
 Set the number of pixels per tick in the x-axis.
PlotConfignum_pixels_per_tick_in_y_axis (std::size_t value)
 Set the number of pixels per tick in the y-axis.
int left_margin () const noexcept
 Get the left margin of plots in pixels.
int right_margin () const noexcept
 Get the right margin of plots in pixels.
int top_margin () const noexcept
 Get the top margin of plots in pixels.
int bottom_margin () const noexcept
 Get the bottom margin of plots in pixels.
int tick_label_font_size () const noexcept
 Get the font size of tick labels in pixels.
int axes_line_width () const noexcept
 Get the line width of axes in pixels.
int grid_line_width () const noexcept
 Get the line width of grid lines in pixels.
int zero_line_width () const noexcept
 Get the line width of the grid line at zero in pixels.
int curve_line_width () const noexcept
 Get the line width of curves in pixels.
const RGBColorbackground_color () const noexcept
 Get the color of background.
const RGBColoraxes_color () const noexcept
 Get the color of axes.
const RGBColorgrid_color () const noexcept
 Get the color of grid lines.
std::size_t initial_num_sample_points () const noexcept
 Get the number of points to sample initially in adaptive sampling.
std::size_t max_num_sample_points () const noexcept
 Get the maximum number of points to sample in adaptive sampling.
double max_coordinate_change_rate () const noexcept
 Get the threshold of the change in coordinates of sample points relative to the plot range in adaptive sampling.
double slope_change_threshold () const noexcept
 Get the threshold of the change in slope normalized by the plot range in adaptive sampling.
double min_param_change_rate () const noexcept
 Get the minimum rate of parameter change in adaptive sampling.
std::size_t num_pixels_per_tick_in_x_axis () const noexcept
 Get the number of pixels per tick in the x-axis.
std::size_t num_pixels_per_tick_in_y_axis () const noexcept
 Get the number of pixels per tick in the y-axis.

Private Attributes

int left_margin_ {default_left_margin}
 Left margin of plots in pixels.
int right_margin_ {default_right_margin}
 Right margin of plots in pixels.
int top_margin_ {default_top_margin}
 Top margin of plots in pixels.
int bottom_margin_ {default_bottom_margin}
 Bottom margin of plots in pixels.
int tick_label_font_size_ {default_tick_label_font_size}
 Font size of tick labels in pixels.
int axes_line_width_ {default_axes_line_width}
 Line width of axes in pixels.
int grid_line_width_ {default_grid_line_width}
 Line width of grid lines in pixels.
int zero_line_width_ {default_zero_line_width}
 Line width of the grid line at zero in pixels.
int curve_line_width_ {default_curve_line_width}
 Line width of curves in pixels.
RGBColor background_color_ {default_background_color}
 Color of background.
RGBColor axes_color_ {default_axes_color}
 Color of axes.
RGBColor grid_color_ {default_grid_color}
 Color of grid lines.
std::size_t initial_num_sample_points_ {default_initial_num_sample_points}
 Number of points to sample initially in adaptive sampling.
std::size_t max_num_sample_points_ {default_max_num_sample_points}
 Maximum number of points to sample in adaptive sampling.
double max_coordinate_change_rate_ {default_max_coordinate_change_rate}
double slope_change_threshold_ {default_slope_change_threshold}
double min_param_change_rate_ {default_min_param_change_rate}
 Minimum rate of parameter change in adaptive sampling.
std::size_t num_pixels_per_tick_in_x_axis_
 Number of pixels per tick in the x-axis.
std::size_t num_pixels_per_tick_in_y_axis_
 Number of pixels per tick in the y-axis.

Detailed Description

Class of configurations of a plot.

Definition at line 97 of file plot_config.h.

Member Function Documentation

◆ left_margin() [1/2]

PlotConfig & func_sketch::plotter::PlotConfig::left_margin ( int value)

Set the left margin of plots in pixels.

Parameters
[in]valueLeft margin of plots in pixels.
Returns
Reference to this object.

Definition at line 28 of file plot_config.cpp.

◆ right_margin() [1/2]

PlotConfig & func_sketch::plotter::PlotConfig::right_margin ( int value)

Set the right margin of plots in pixels.

Parameters
[in]valueRight margin of plots in pixels.
Returns
Reference to this object.

Definition at line 36 of file plot_config.cpp.

◆ top_margin() [1/2]

PlotConfig & func_sketch::plotter::PlotConfig::top_margin ( int value)

Set the top margin of plots in pixels.

Parameters
[in]valueTop margin of plots in pixels.
Returns
Reference to this object.

Definition at line 44 of file plot_config.cpp.

◆ bottom_margin() [1/2]

PlotConfig & func_sketch::plotter::PlotConfig::bottom_margin ( int value)

Set the bottom margin of plots in pixels.

Parameters
[in]valueBottom margin of plots in pixels.
Returns
Reference to this object.

Definition at line 52 of file plot_config.cpp.

◆ tick_label_font_size() [1/2]

PlotConfig & func_sketch::plotter::PlotConfig::tick_label_font_size ( int value)

Set the font size of tick labels in pixels.

Parameters
[in]valueFont size of tick labels in pixels.
Returns
Reference to this object.

Definition at line 60 of file plot_config.cpp.

◆ axes_line_width() [1/2]

PlotConfig & func_sketch::plotter::PlotConfig::axes_line_width ( int value)

Set the line width of axes in pixels.

Parameters
[in]valueLine width of axes in pixels.
Returns
Reference to this object.

Definition at line 69 of file plot_config.cpp.

◆ grid_line_width() [1/2]

PlotConfig & func_sketch::plotter::PlotConfig::grid_line_width ( int value)

Set the line width of grid lines in pixels.

Parameters
[in]valueLine width of grid lines in pixels.
Returns
Reference to this object.

Definition at line 77 of file plot_config.cpp.

◆ zero_line_width() [1/2]

PlotConfig & func_sketch::plotter::PlotConfig::zero_line_width ( int value)

Set the line width of the grid line at zero in pixels.

Parameters
[in]valueLine width of the grid line at zero in pixels.
Returns
Reference to this object.

Definition at line 85 of file plot_config.cpp.

◆ curve_line_width() [1/2]

PlotConfig & func_sketch::plotter::PlotConfig::curve_line_width ( int value)

Set the line width of curves in pixels.

Parameters
[in]valueLine width of curves in pixels.
Returns
Reference to this object.

Definition at line 93 of file plot_config.cpp.

◆ background_color() [1/2]

PlotConfig & func_sketch::plotter::PlotConfig::background_color ( const RGBColor & value)

Set the color of background.

Parameters
[in]valueColor of background.
Returns
Reference to this object.

Definition at line 101 of file plot_config.cpp.

◆ axes_color() [1/2]

PlotConfig & func_sketch::plotter::PlotConfig::axes_color ( const RGBColor & value)

Set the color of axes.

Parameters
[in]valueColor of axes.
Returns
Reference to this object.

Definition at line 106 of file plot_config.cpp.

◆ grid_color() [1/2]

PlotConfig & func_sketch::plotter::PlotConfig::grid_color ( const RGBColor & value)

Set the color of grid lines.

Parameters
[in]valueColor of grid lines.
Returns
Reference to this object.

Definition at line 111 of file plot_config.cpp.

◆ initial_num_sample_points() [1/2]

PlotConfig & func_sketch::plotter::PlotConfig::initial_num_sample_points ( std::size_t value)

Set the number of points to sample initially in adaptive sampling.

Parameters
[in]valueNumber of points to sample initially in adaptive sampling.
Returns
Reference to this object.

Definition at line 116 of file plot_config.cpp.

◆ max_num_sample_points() [1/2]

PlotConfig & func_sketch::plotter::PlotConfig::max_num_sample_points ( std::size_t value)

Set the maximum number of points to sample in adaptive sampling.

Parameters
[in]valueMaximum number of points to sample in adaptive sampling.
Returns
Reference to this object.
Note
This value should be larger than initial_num_sample_points. Otherwise, this configuration has no effect.
This value is limited to max_max_num_sample_points for safety limit of memory usage.

Definition at line 125 of file plot_config.cpp.

◆ max_coordinate_change_rate() [1/2]

PlotConfig & func_sketch::plotter::PlotConfig::max_coordinate_change_rate ( double value)

Set the threshold of the change in coordinates of sample points relative to the plot range in adaptive sampling.

Parameters
[in]valueThreshold of the change in coordinates of sample points relative to the plot range in adaptive sampling.
Returns
Reference to this object.

Definition at line 139 of file plot_config.cpp.

◆ slope_change_threshold() [1/2]

PlotConfig & func_sketch::plotter::PlotConfig::slope_change_threshold ( double value)

Set the threshold of the change in slope normalized by the plot range in adaptive sampling.

Parameters
[in]valueThreshold of the change in slope normalized by the plot range in adaptive sampling.
Returns
Reference to this object.

Definition at line 148 of file plot_config.cpp.

◆ min_param_change_rate() [1/2]

PlotConfig & func_sketch::plotter::PlotConfig::min_param_change_rate ( double value)

Set the minimum rate of parameter change in adaptive sampling.

Parameters
[in]valueMinimum rate of parameter change in adaptive sampling.
Returns
Reference to this object.
Note
This value is limited to min_min_param_change_rate for safety limit of memory usage.

Definition at line 157 of file plot_config.cpp.

◆ num_pixels_per_tick_in_x_axis() [1/2]

PlotConfig & func_sketch::plotter::PlotConfig::num_pixels_per_tick_in_x_axis ( std::size_t value)

Set the number of pixels per tick in the x-axis.

Parameters
[in]valueNumber of pixels per tick in the x-axis.
Returns
Reference to this object.

Definition at line 167 of file plot_config.cpp.

◆ num_pixels_per_tick_in_y_axis() [1/2]

PlotConfig & func_sketch::plotter::PlotConfig::num_pixels_per_tick_in_y_axis ( std::size_t value)

Set the number of pixels per tick in the y-axis.

Parameters
[in]valueNumber of pixels per tick in the y-axis.
Returns
Reference to this object.

Definition at line 176 of file plot_config.cpp.

◆ left_margin() [2/2]

int func_sketch::plotter::PlotConfig::left_margin ( ) const
nodiscardnoexcept

Get the left margin of plots in pixels.

Returns
Left margin of plots in pixels.

Definition at line 185 of file plot_config.cpp.

◆ right_margin() [2/2]

int func_sketch::plotter::PlotConfig::right_margin ( ) const
nodiscardnoexcept

Get the right margin of plots in pixels.

Returns
Right margin of plots in pixels.

Definition at line 187 of file plot_config.cpp.

◆ top_margin() [2/2]

int func_sketch::plotter::PlotConfig::top_margin ( ) const
nodiscardnoexcept

Get the top margin of plots in pixels.

Returns
Top margin of plots in pixels.

Definition at line 189 of file plot_config.cpp.

◆ bottom_margin() [2/2]

int func_sketch::plotter::PlotConfig::bottom_margin ( ) const
nodiscardnoexcept

Get the bottom margin of plots in pixels.

Returns
Bottom margin of plots in pixels.

Definition at line 191 of file plot_config.cpp.

◆ tick_label_font_size() [2/2]

int func_sketch::plotter::PlotConfig::tick_label_font_size ( ) const
nodiscardnoexcept

Get the font size of tick labels in pixels.

Returns
Font size of tick labels in pixels.

Definition at line 193 of file plot_config.cpp.

◆ axes_line_width() [2/2]

int func_sketch::plotter::PlotConfig::axes_line_width ( ) const
nodiscardnoexcept

Get the line width of axes in pixels.

Returns
Line width of axes in pixels.

Definition at line 197 of file plot_config.cpp.

◆ grid_line_width() [2/2]

int func_sketch::plotter::PlotConfig::grid_line_width ( ) const
nodiscardnoexcept

Get the line width of grid lines in pixels.

Returns
Line width of grid lines in pixels.

Definition at line 199 of file plot_config.cpp.

◆ zero_line_width() [2/2]

int func_sketch::plotter::PlotConfig::zero_line_width ( ) const
nodiscardnoexcept

Get the line width of the grid line at zero in pixels.

Returns
Line width of the grid line at zero in pixels.

Definition at line 201 of file plot_config.cpp.

◆ curve_line_width() [2/2]

int func_sketch::plotter::PlotConfig::curve_line_width ( ) const
nodiscardnoexcept

Get the line width of curves in pixels.

Returns
Line width of curves in pixels.

Definition at line 203 of file plot_config.cpp.

◆ background_color() [2/2]

const RGBColor & func_sketch::plotter::PlotConfig::background_color ( ) const
nodiscardnoexcept

Get the color of background.

Returns
Color of background.

Definition at line 205 of file plot_config.cpp.

◆ axes_color() [2/2]

const RGBColor & func_sketch::plotter::PlotConfig::axes_color ( ) const
nodiscardnoexcept

Get the color of axes.

Returns
Color of axes.

Definition at line 209 of file plot_config.cpp.

◆ grid_color() [2/2]

const RGBColor & func_sketch::plotter::PlotConfig::grid_color ( ) const
nodiscardnoexcept

Get the color of grid lines.

Returns
Color of grid lines.

Definition at line 211 of file plot_config.cpp.

◆ initial_num_sample_points() [2/2]

std::size_t func_sketch::plotter::PlotConfig::initial_num_sample_points ( ) const
nodiscardnoexcept

Get the number of points to sample initially in adaptive sampling.

Returns
Number of points to sample initially in adaptive sampling.

Definition at line 213 of file plot_config.cpp.

◆ max_num_sample_points() [2/2]

std::size_t func_sketch::plotter::PlotConfig::max_num_sample_points ( ) const
nodiscardnoexcept

Get the maximum number of points to sample in adaptive sampling.

Returns
Maximum number of points to sample in adaptive sampling.

Definition at line 217 of file plot_config.cpp.

◆ max_coordinate_change_rate() [2/2]

double func_sketch::plotter::PlotConfig::max_coordinate_change_rate ( ) const
nodiscardnoexcept

Get the threshold of the change in coordinates of sample points relative to the plot range in adaptive sampling.

Returns
Threshold of the change in coordinates of sample points relative to the plot range in adaptive sampling.

Definition at line 221 of file plot_config.cpp.

◆ slope_change_threshold() [2/2]

double func_sketch::plotter::PlotConfig::slope_change_threshold ( ) const
nodiscardnoexcept

Get the threshold of the change in slope normalized by the plot range in adaptive sampling.

Returns
Threshold of the change in slope normalized by the plot range in adaptive sampling.

Definition at line 225 of file plot_config.cpp.

◆ min_param_change_rate() [2/2]

double func_sketch::plotter::PlotConfig::min_param_change_rate ( ) const
nodiscardnoexcept

Get the minimum rate of parameter change in adaptive sampling.

Returns
Minimum rate of parameter change in adaptive sampling.

Definition at line 229 of file plot_config.cpp.

◆ num_pixels_per_tick_in_x_axis() [2/2]

std::size_t func_sketch::plotter::PlotConfig::num_pixels_per_tick_in_x_axis ( ) const
nodiscardnoexcept

Get the number of pixels per tick in the x-axis.

Returns
Number of pixels per tick in the x-axis.

Definition at line 233 of file plot_config.cpp.

◆ num_pixels_per_tick_in_y_axis() [2/2]

std::size_t func_sketch::plotter::PlotConfig::num_pixels_per_tick_in_y_axis ( ) const
nodiscardnoexcept

Get the number of pixels per tick in the y-axis.

Returns
Number of pixels per tick in the y-axis.

Definition at line 237 of file plot_config.cpp.

Member Data Documentation

◆ left_margin_

int func_sketch::plotter::PlotConfig::left_margin_ {default_left_margin}
private

Left margin of plots in pixels.

Definition at line 414 of file plot_config.h.

◆ right_margin_

int func_sketch::plotter::PlotConfig::right_margin_ {default_right_margin}
private

Right margin of plots in pixels.

Definition at line 417 of file plot_config.h.

◆ top_margin_

int func_sketch::plotter::PlotConfig::top_margin_ {default_top_margin}
private

Top margin of plots in pixels.

Definition at line 420 of file plot_config.h.

◆ bottom_margin_

int func_sketch::plotter::PlotConfig::bottom_margin_ {default_bottom_margin}
private

Bottom margin of plots in pixels.

Definition at line 423 of file plot_config.h.

◆ tick_label_font_size_

int func_sketch::plotter::PlotConfig::tick_label_font_size_ {default_tick_label_font_size}
private

Font size of tick labels in pixels.

Definition at line 426 of file plot_config.h.

◆ axes_line_width_

int func_sketch::plotter::PlotConfig::axes_line_width_ {default_axes_line_width}
private

Line width of axes in pixels.

Definition at line 429 of file plot_config.h.

◆ grid_line_width_

int func_sketch::plotter::PlotConfig::grid_line_width_ {default_grid_line_width}
private

Line width of grid lines in pixels.

Definition at line 432 of file plot_config.h.

◆ zero_line_width_

int func_sketch::plotter::PlotConfig::zero_line_width_ {default_zero_line_width}
private

Line width of the grid line at zero in pixels.

Definition at line 435 of file plot_config.h.

◆ curve_line_width_

int func_sketch::plotter::PlotConfig::curve_line_width_ {default_curve_line_width}
private

Line width of curves in pixels.

Definition at line 438 of file plot_config.h.

◆ background_color_

RGBColor func_sketch::plotter::PlotConfig::background_color_ {default_background_color}
private

Color of background.

Definition at line 441 of file plot_config.h.

◆ axes_color_

RGBColor func_sketch::plotter::PlotConfig::axes_color_ {default_axes_color}
private

Color of axes.

Definition at line 444 of file plot_config.h.

◆ grid_color_

RGBColor func_sketch::plotter::PlotConfig::grid_color_ {default_grid_color}
private

Color of grid lines.

Definition at line 447 of file plot_config.h.

◆ initial_num_sample_points_

std::size_t func_sketch::plotter::PlotConfig::initial_num_sample_points_ {default_initial_num_sample_points}
private

Number of points to sample initially in adaptive sampling.

Definition at line 450 of file plot_config.h.

◆ max_num_sample_points_

std::size_t func_sketch::plotter::PlotConfig::max_num_sample_points_ {default_max_num_sample_points}
private

Maximum number of points to sample in adaptive sampling.

Definition at line 453 of file plot_config.h.

◆ max_coordinate_change_rate_

double func_sketch::plotter::PlotConfig::max_coordinate_change_rate_ {default_max_coordinate_change_rate}
private

Threshold of the change in coordinates of sample points relative to the plot range in adaptive sampling.

Definition at line 457 of file plot_config.h.

◆ slope_change_threshold_

double func_sketch::plotter::PlotConfig::slope_change_threshold_ {default_slope_change_threshold}
private

Threshold of the change in slope normalized by the plot range in adaptive sampling.

Definition at line 461 of file plot_config.h.

◆ min_param_change_rate_

double func_sketch::plotter::PlotConfig::min_param_change_rate_ {default_min_param_change_rate}
private

Minimum rate of parameter change in adaptive sampling.

Definition at line 464 of file plot_config.h.

◆ num_pixels_per_tick_in_x_axis_

std::size_t func_sketch::plotter::PlotConfig::num_pixels_per_tick_in_x_axis_
private
Initial value:
{
constexpr std::size_t default_num_pixels_per_tick_in_x_axis
Default number of pixels per tick in the x-axis.
Definition plot_config.h:89

Number of pixels per tick in the x-axis.

Definition at line 467 of file plot_config.h.

◆ num_pixels_per_tick_in_y_axis_

std::size_t func_sketch::plotter::PlotConfig::num_pixels_per_tick_in_y_axis_
private
Initial value:
{
constexpr std::size_t default_num_pixels_per_tick_in_y_axis
Default number of pixels per tick in the y-axis.
Definition plot_config.h:92

Number of pixels per tick in the y-axis.

Definition at line 471 of file plot_config.h.


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