Aleph-w 3.0
A C++ Library for Data Structures and Algorithms
Loading...
Searching...
No Matches
Aleph::Tikz_Plane Class Reference

2D TikZ canvas storing geometry objects and emitting LaTeX output. More...

#include <tikzgeom.H>

Collaboration diagram for Aleph::Tikz_Plane:
[legend]

Classes

struct  Geom_Box
 
struct  Legend_Entry
 
struct  Mapping
 
struct  Styled_Object
 An object with its associated style, layer, and insertion order. More...
 

Public Types

using Object = std::variant< Point, Polar_Point, Segment, Triangle, Ellipse, RotatedEllipse, Text, Polygon, Regular_Polygon, Rectangle, LineEq, Tikz_Quadratic_Bezier, Tikz_Cubic_Bezier, Tikz_Polyline >
 Runtime set of supported objects.
 

Public Member Functions

 Tikz_Plane (const double &wide, const double &height, const double &xoffset=0.0, const double &yoffset=0.0)
 Construct a TikZ plane with fixed frame size.
 
const doubleget_wide () const
 Plane width in millimeters.
 
const doubleget_height () const
 Plane height in millimeters.
 
const doubleget_xoffset () const
 Horizontal scope offset in millimeters.
 
const doubleget_yoffset () const
 Vertical scope offset in millimeters.
 
const doubleget_point_radius_mm () const
 Radius used to draw point primitives (millimeters).
 
const doubleget_clip_padding_mm () const
 Clip expansion around the frame; <= 0 means auto (point radius).
 
size_t size () const
 Number of currently inserted objects.
 
const Tikz_Styleget_default_style () const
 Default style used by put(obj) and non-styled put_in_plane.
 
const Tikz_Styleget_axis_style () const
 Style used for Cartesian axes when enabled.
 
const Tikz_Styleget_grid_style () const
 Style used for coordinate grids when enabled.
 
void set_default_style (const Tikz_Style &style)
 Configure the default style for subsequent non-styled inserts.
 
void set_axis_style (const Tikz_Style &style)
 Configure the style used to draw Cartesian axes.
 
void set_grid_style (const Tikz_Style &style)
 Configure the style used to draw coordinate grids.
 
void set_point_radius_mm (const double &radius_mm)
 Configure point marker radius.
 
void set_clip_padding_mm (const double &padding_mm)
 Configure clip expansion around frame borders.
 
void put_cartesian_axis ()
 Enable Cartesian axes drawing (only when 0 lies in range).
 
void remove_cartesian_axis ()
 Disable Cartesian axes drawing.
 
void put_coordinate_grid (const double step_x=1.0, const double step_y=1.0, const bool draw_ticks=true)
 Enable coordinate grid/ticks with user step sizes.
 
void remove_coordinate_grid ()
 Disable coordinate grid rendering.
 
void enable_native_tikz_layers (const bool enabled=true)
 Enable native PGF layers (\pgfdeclarelayer).
 
void enable_auto_legend (const bool enabled=true)
 Enable auto-legend generation from style colors.
 
void add_legend_entry (const std::string &label, const Tikz_Style &style)
 Add a legend entry to be rendered in the top-left corner.
 
void clear_legend ()
 Remove user-provided legend entries.
 
void register_tikz_style (const std::string &name, const Tikz_Style &style)
 Register a reusable \tikzset style for the rendered picture.
 
void clear_tikz_styles ()
 Clear all registered \tikzset style definitions.
 
void clear ()
 Remove all inserted objects from the plane.
 
void put (const Object &obj)
 Insert an object with default style on default layer.
 
void put (const Object &obj, const Tikz_Style &style, const int layer)
 Insert an object with explicit style/layer.
 
void draw (std::ostream &output, const bool squarize=true) const
 Emit a complete tikzpicture with all inserted objects.
 

Static Public Attributes

static constexpr int Layer_Background = -100
 
static constexpr int Layer_Default = 0
 
static constexpr int Layer_Foreground = 100
 
static constexpr int Layer_Overlay = 1000
 

Private Member Functions

Geom_Box compute_box () const
 
double effective_clip_padding_mm () const
 
Mapping compute_mapping (const Geom_Box &box, const bool squarize) const
 
template<typename Out >
void draw_point (const Point &p, const Tikz_Style &style, Out &output, const Geom_Box &box, const Mapping &map) const
 
template<typename Out >
void draw_polyline (Out &output, const std::vector< Point > &vertices, const bool closed, const Tikz_Style &style, const Geom_Box &box, const Mapping &map) const
 
template<typename Out >
void draw_segment (const Segment &s, const Tikz_Style &style, Out &output, const Geom_Box &box, const Mapping &map) const
 
template<typename Out >
void draw_triangle (const Triangle &t, const Tikz_Style &style, Out &output, const Geom_Box &box, const Mapping &map) const
 
template<typename Out >
void draw_ellipse (const Ellipse &e, const Tikz_Style &style, Out &output, const Geom_Box &box, const Mapping &map) const
 
template<typename Out >
void draw_polygon (const Polygon &poly, const Tikz_Style &style, Out &output, const Geom_Box &box, const Mapping &map) const
 
template<typename Out >
void draw_regular_polygon (const Regular_Polygon &poly, const Tikz_Style &style, Out &output, const Geom_Box &box, const Mapping &map) const
 
template<typename Out >
void draw_rectangle (const Rectangle &r, const Tikz_Style &style, Out &output, const Geom_Box &box, const Mapping &map) const
 
template<typename Out >
void draw_line_eq (const LineEq &l, const Tikz_Style &style, Out &output, const Geom_Box &box, const Mapping &map) const
 
template<typename Out >
void draw_coordinate_grid (Out &output, const Geom_Box &box, const Mapping &map) const
 
std::vector< Legend_Entrycollect_legend_entries () const
 
template<typename Out >
void draw_legend (Out &output) const
 
template<typename Out >
void draw_tikzset_styles (Out &output) const
 
template<typename Out >
void draw_cartesian_axis (Out &output, const Geom_Box &box, const Mapping &map) const
 
template<typename Out >
void draw_object (const Styled_Object &entry, Out &output, const Geom_Box &box, const Mapping &map) const
 

Static Private Member Functions

static std::string fmt_double (const double v)
 
static void append_option (std::string &opts, const std::string &opt)
 
static std::string draw_options (const Tikz_Style &style, const bool allow_fill=false)
 
static std::string point_options (const Tikz_Style &style)
 
static std::string text_options (const Tikz_Style &style)
 
static Geom_Number rotated_x_extent (const RotatedEllipse &e)
 
static Geom_Number rotated_y_extent (const RotatedEllipse &e)
 
static Geom_Box make_box (const Geom_Number &xmin, const Geom_Number &xmax, const Geom_Number &ymin, const Geom_Number &ymax)
 
static void merge_box (Geom_Box &dst, const Geom_Box &src)
 
static Geom_Box bbox_of (const Point &p)
 
static Geom_Box bbox_of (const Polar_Point &pp)
 
static Geom_Box bbox_of (const Segment &s)
 
static Geom_Box bbox_of (const Triangle &t)
 
static Geom_Box bbox_of (const Ellipse &e)
 
static Geom_Box bbox_of (const RotatedEllipse &e)
 
static Geom_Box bbox_of (const Text &t)
 
static Geom_Box bbox_of (const Polygon &poly)
 
static Geom_Box bbox_of (const Regular_Polygon &poly)
 
static Geom_Box bbox_of (const Rectangle &r)
 
static Geom_Box bbox_of (const LineEq &l)
 
static Geom_Box bbox_of (const Tikz_Quadratic_Bezier &b)
 
static Geom_Box bbox_of (const Tikz_Cubic_Bezier &b)
 
static Geom_Box bbox_of (const Tikz_Polyline &pl)
 
static std::string escape_latex (const std::string &text)
 
static double map_x (const Geom_Number &x, const Geom_Box &box, const Mapping &map)
 
static double map_y (const Geom_Number &y, const Geom_Box &box, const Mapping &map)
 
static std::pair< double, doublemap_point (const Point &p, const Geom_Box &box, const Mapping &map)
 
static double map_x_length (const Geom_Number &dx, const Mapping &map)
 
static double map_y_length (const Geom_Number &dy, const Mapping &map)
 
template<typename Out >
static void draw_rotated_ellipse (const RotatedEllipse &e, const Tikz_Style &style, Out &output, const Geom_Box &box, const Mapping &map)
 
template<typename Out >
static void draw_text (const Text &t, const Tikz_Style &style, Out &output, const Geom_Box &box, const Mapping &map)
 
template<typename Out >
static void draw_quadratic_bezier (const Tikz_Quadratic_Bezier &b, const Tikz_Style &style, Out &output, const Geom_Box &box, const Mapping &map)
 
template<typename Out >
static void draw_cubic_bezier (const Tikz_Cubic_Bezier &b, const Tikz_Style &style, Out &output, const Geom_Box &box, const Mapping &map)
 
static const charlayer_name (const int layer)
 

Private Attributes

double wide_ = 0.0
 
double height_ = 0.0
 
double xoffset_ = 0.0
 
double yoffset_ = 0.0
 
bool with_cartesian_axis_ = false
 
bool with_coordinate_grid_ = false
 
bool with_grid_ticks_ = false
 
bool with_native_layers_ = false
 
bool with_auto_legend_ = false
 
double point_radius_mm_ = 1.0
 
double clip_padding_mm_ = -1.0
 
double grid_step_x_ = 1.0
 
double grid_step_y_ = 1.0
 
double tick_size_mm_ = 1.5
 
double legend_x_mm_ = 3.0
 
double legend_y_mm_ = 3.0
 
double legend_entry_step_mm_ = 5.0
 
Tikz_Style default_style_
 
Tikz_Style axis_style_
 
Tikz_Style grid_style_
 
std::vector< Legend_Entrylegend_entries_
 
std::map< std::string, Tikz_Styletikz_style_defs_
 
std::vector< Styled_Objectobjects_
 
size_t next_order_ = 0
 

Detailed Description

2D TikZ canvas storing geometry objects and emitting LaTeX output.

Tikz_Plane:

  1. Collects geometry objects inserted with put() / put_in_plane(...).
  2. Computes a global bounding box and maps it to the fixed frame.
  3. Emits a tikzpicture block using millimeter units.

The frame (wide, height) is fixed at construction time.

Definition at line 183 of file tikzgeom.H.

Member Typedef Documentation

◆ Object

Constructor & Destructor Documentation

◆ Tikz_Plane()

Aleph::Tikz_Plane::Tikz_Plane ( const double wide,
const double height,
const double xoffset = 0.0,
const double yoffset = 0.0 
)
inline

Construct a TikZ plane with fixed frame size.

Parameters
widePlane width in millimeters.
heightPlane height in millimeters.
xoffsetX shift (mm) applied to the internal drawing scope.
yoffsetY shift (mm) applied to the internal drawing scope.
Exceptions
std::domain_errorIf wide <= 0 or height <= 0.

Definition at line 1215 of file tikzgeom.H.

References ah_domain_error_if, Aleph::divide_and_conquer_partition_dp(), height_, and wide_.

Member Function Documentation

◆ add_legend_entry()

void Aleph::Tikz_Plane::add_legend_entry ( const std::string &  label,
const Tikz_Style style 
)
inline

Add a legend entry to be rendered in the top-left corner.

Definition at line 1334 of file tikzgeom.H.

References legend_entries_.

Referenced by Aleph::Tikz_Scene::add_legend_entry().

◆ append_option()

static void Aleph::Tikz_Plane::append_option ( std::string &  opts,
const std::string &  opt 
)
inlinestaticprivate

◆ bbox_of() [1/14]

◆ bbox_of() [2/14]

static Geom_Box Aleph::Tikz_Plane::bbox_of ( const LineEq l)
inlinestaticprivate

Definition at line 519 of file tikzgeom.H.

References Aleph::divide_and_conquer_partition_dp(), l, make_box(), y0(), and y1().

◆ bbox_of() [3/14]

static Geom_Box Aleph::Tikz_Plane::bbox_of ( const Point p)
inlinestaticprivate

◆ bbox_of() [4/14]

static Geom_Box Aleph::Tikz_Plane::bbox_of ( const Polar_Point pp)
inlinestaticprivate

Definition at line 451 of file tikzgeom.H.

References bbox_of(), and Aleph::divide_and_conquer_partition_dp().

◆ bbox_of() [5/14]

static Geom_Box Aleph::Tikz_Plane::bbox_of ( const Polygon poly)
inlinestaticprivate

◆ bbox_of() [6/14]

static Geom_Box Aleph::Tikz_Plane::bbox_of ( const Rectangle r)
inlinestaticprivate

Definition at line 514 of file tikzgeom.H.

References make_box(), and r.

◆ bbox_of() [7/14]

static Geom_Box Aleph::Tikz_Plane::bbox_of ( const Regular_Polygon poly)
inlinestaticprivate

◆ bbox_of() [8/14]

◆ bbox_of() [9/14]

◆ bbox_of() [10/14]

◆ bbox_of() [11/14]

◆ bbox_of() [12/14]

static Geom_Box Aleph::Tikz_Plane::bbox_of ( const Tikz_Polyline pl)
inlinestaticprivate

Definition at line 548 of file tikzgeom.H.

References bbox_of(), Aleph::divide_and_conquer_partition_dp(), and merge_box().

◆ bbox_of() [13/14]

◆ bbox_of() [14/14]

◆ clear()

void Aleph::Tikz_Plane::clear ( )
inline

Remove all inserted objects from the plane.

Definition at line 1359 of file tikzgeom.H.

References next_order_, and objects_.

Referenced by Aleph::Tikz_Scene::clear().

◆ clear_legend()

void Aleph::Tikz_Plane::clear_legend ( )
inline

Remove user-provided legend entries.

Definition at line 1340 of file tikzgeom.H.

References legend_entries_.

Referenced by Aleph::Tikz_Scene::clear_legend().

◆ clear_tikz_styles()

void Aleph::Tikz_Plane::clear_tikz_styles ( )
inline

Clear all registered \tikzset style definitions.

Definition at line 1353 of file tikzgeom.H.

References tikz_style_defs_.

◆ collect_legend_entries()

std::vector< Legend_Entry > Aleph::Tikz_Plane::collect_legend_entries ( ) const
inlineprivate

◆ compute_box()

Geom_Box Aleph::Tikz_Plane::compute_box ( ) const
inlineprivate

Definition at line 556 of file tikzgeom.H.

References bbox_of(), Aleph::divide_and_conquer_partition_dp(), merge_box(), and objects_.

Referenced by draw().

◆ compute_mapping()

◆ draw()

void Aleph::Tikz_Plane::draw ( std::ostream &  output,
const bool  squarize = true 
) const
inline

Emit a complete tikzpicture with all inserted objects.

Parameters
outputDestination stream.
squarizeWhen true, preserve aspect ratio (uniform scaling). When false, x/y scales are independent and fill the full frame.

Definition at line 1383 of file tikzgeom.H.

References compute_box(), compute_mapping(), Aleph::divide_and_conquer_partition_dp(), draw_cartesian_axis(), draw_coordinate_grid(), draw_legend(), draw_object(), draw_tikzset_styles(), effective_clip_padding_mm(), height_, layer_name(), objects_, output, squarize, wide_, with_native_layers_, xoffset_, and yoffset_.

Referenced by Aleph::Tikz_Scene::draw(), main(), main(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), and TEST().

◆ draw_cartesian_axis()

template<typename Out >
void Aleph::Tikz_Plane::draw_cartesian_axis ( Out output,
const Geom_Box box,
const Mapping map 
) const
inlineprivate

◆ draw_coordinate_grid()

◆ draw_cubic_bezier()

template<typename Out >
static void Aleph::Tikz_Plane::draw_cubic_bezier ( const Tikz_Cubic_Bezier b,
const Tikz_Style style,
Out output,
const Geom_Box box,
const Mapping map 
)
inlinestaticprivate

◆ draw_ellipse()

template<typename Out >
void Aleph::Tikz_Plane::draw_ellipse ( const Ellipse e,
const Tikz_Style style,
Out output,
const Geom_Box box,
const Mapping map 
) const
inlineprivate

◆ draw_legend()

template<typename Out >
void Aleph::Tikz_Plane::draw_legend ( Out output) const
inlineprivate

◆ draw_line_eq()

template<typename Out >
void Aleph::Tikz_Plane::draw_line_eq ( const LineEq l,
const Tikz_Style style,
Out output,
const Geom_Box box,
const Mapping map 
) const
inlineprivate

Definition at line 872 of file tikzgeom.H.

References Aleph::and, Aleph::divide_and_conquer_partition_dp(), draw_segment(), l, output, and y.

Referenced by draw_object().

◆ draw_object()

◆ draw_options()

◆ draw_point()

template<typename Out >
void Aleph::Tikz_Plane::draw_point ( const Point p,
const Tikz_Style style,
Out output,
const Geom_Box box,
const Mapping map 
) const
inlineprivate

◆ draw_polygon()

template<typename Out >
void Aleph::Tikz_Plane::draw_polygon ( const Polygon poly,
const Tikz_Style style,
Out output,
const Geom_Box box,
const Mapping map 
) const
inlineprivate

◆ draw_polyline()

template<typename Out >
void Aleph::Tikz_Plane::draw_polyline ( Out output,
const std::vector< Point > &  vertices,
const bool  closed,
const Tikz_Style style,
const Geom_Box box,
const Mapping map 
) const
inlineprivate

◆ draw_quadratic_bezier()

template<typename Out >
static void Aleph::Tikz_Plane::draw_quadratic_bezier ( const Tikz_Quadratic_Bezier b,
const Tikz_Style style,
Out output,
const Geom_Box box,
const Mapping map 
)
inlinestaticprivate

◆ draw_rectangle()

template<typename Out >
void Aleph::Tikz_Plane::draw_rectangle ( const Rectangle r,
const Tikz_Style style,
Out output,
const Geom_Box box,
const Mapping map 
) const
inlineprivate

Definition at line 860 of file tikzgeom.H.

References Aleph::divide_and_conquer_partition_dp(), draw_polyline(), output, and r.

Referenced by draw_object().

◆ draw_regular_polygon()

template<typename Out >
void Aleph::Tikz_Plane::draw_regular_polygon ( const Regular_Polygon poly,
const Tikz_Style style,
Out output,
const Geom_Box box,
const Mapping map 
) const
inlineprivate

◆ draw_rotated_ellipse()

◆ draw_segment()

template<typename Out >
void Aleph::Tikz_Plane::draw_segment ( const Segment s,
const Tikz_Style style,
Out output,
const Geom_Box box,
const Mapping map 
) const
inlineprivate

◆ draw_text()

template<typename Out >
static void Aleph::Tikz_Plane::draw_text ( const Text t,
const Tikz_Style style,
Out output,
const Geom_Box box,
const Mapping map 
)
inlinestaticprivate

◆ draw_tikzset_styles()

template<typename Out >
void Aleph::Tikz_Plane::draw_tikzset_styles ( Out output) const
inlineprivate

◆ draw_triangle()

template<typename Out >
void Aleph::Tikz_Plane::draw_triangle ( const Triangle t,
const Tikz_Style style,
Out output,
const Geom_Box box,
const Mapping map 
) const
inlineprivate

◆ effective_clip_padding_mm()

double Aleph::Tikz_Plane::effective_clip_padding_mm ( ) const
inlineprivate

Definition at line 568 of file tikzgeom.H.

References clip_padding_mm_, and point_radius_mm_.

Referenced by draw().

◆ enable_auto_legend()

void Aleph::Tikz_Plane::enable_auto_legend ( const bool  enabled = true)
inline

Enable auto-legend generation from style colors.

Definition at line 1328 of file tikzgeom.H.

References with_auto_legend_.

Referenced by Aleph::Tikz_Scene::enable_auto_legend(), and TEST().

◆ enable_native_tikz_layers()

void Aleph::Tikz_Plane::enable_native_tikz_layers ( const bool  enabled = true)
inline

Enable native PGF layers (\pgfdeclarelayer).

Definition at line 1322 of file tikzgeom.H.

References with_native_layers_.

Referenced by Aleph::Tikz_Scene::enable_native_tikz_layers(), and TEST().

◆ escape_latex()

static std::string Aleph::Tikz_Plane::escape_latex ( const std::string &  text)
inlinestaticprivate

Definition at line 573 of file tikzgeom.H.

References Aleph::divide_and_conquer_partition_dp().

Referenced by draw_legend(), and draw_text().

◆ fmt_double()

static std::string Aleph::Tikz_Plane::fmt_double ( const double  v)
inlinestaticprivate

Definition at line 276 of file tikzgeom.H.

References Aleph::and, and Aleph::divide_and_conquer_partition_dp().

Referenced by draw_options(), point_options(), and text_options().

◆ get_axis_style()

const Tikz_Style & Aleph::Tikz_Plane::get_axis_style ( ) const
inline

Style used for Cartesian axes when enabled.

Definition at line 1242 of file tikzgeom.H.

References axis_style_.

◆ get_clip_padding_mm()

const double & Aleph::Tikz_Plane::get_clip_padding_mm ( ) const
inline

Clip expansion around the frame; <= 0 means auto (point radius).

Definition at line 1234 of file tikzgeom.H.

References clip_padding_mm_.

◆ get_default_style()

const Tikz_Style & Aleph::Tikz_Plane::get_default_style ( ) const
inline

Default style used by put(obj) and non-styled put_in_plane.

Definition at line 1239 of file tikzgeom.H.

References default_style_.

◆ get_grid_style()

const Tikz_Style & Aleph::Tikz_Plane::get_grid_style ( ) const
inline

Style used for coordinate grids when enabled.

Definition at line 1244 of file tikzgeom.H.

References grid_style_.

◆ get_height()

const double & Aleph::Tikz_Plane::get_height ( ) const
inline

Plane height in millimeters.

Definition at line 1226 of file tikzgeom.H.

References height_.

Referenced by TEST().

◆ get_point_radius_mm()

const double & Aleph::Tikz_Plane::get_point_radius_mm ( ) const
inline

Radius used to draw point primitives (millimeters).

Definition at line 1232 of file tikzgeom.H.

References point_radius_mm_.

◆ get_wide()

const double & Aleph::Tikz_Plane::get_wide ( ) const
inline

Plane width in millimeters.

Definition at line 1224 of file tikzgeom.H.

References wide_.

Referenced by TEST().

◆ get_xoffset()

const double & Aleph::Tikz_Plane::get_xoffset ( ) const
inline

Horizontal scope offset in millimeters.

Definition at line 1228 of file tikzgeom.H.

References xoffset_.

Referenced by TEST().

◆ get_yoffset()

const double & Aleph::Tikz_Plane::get_yoffset ( ) const
inline

Vertical scope offset in millimeters.

Definition at line 1230 of file tikzgeom.H.

References yoffset_.

Referenced by TEST().

◆ layer_name()

static const char * Aleph::Tikz_Plane::layer_name ( const int  layer)
inlinestaticprivate

Definition at line 970 of file tikzgeom.H.

References Layer_Background, Layer_Foreground, and Layer_Overlay.

Referenced by draw().

◆ make_box()

static Geom_Box Aleph::Tikz_Plane::make_box ( const Geom_Number xmin,
const Geom_Number xmax,
const Geom_Number ymin,
const Geom_Number ymax 
)
inlinestaticprivate

◆ map_point()

static std::pair< double, double > Aleph::Tikz_Plane::map_point ( const Point p,
const Geom_Box box,
const Mapping map 
)
inlinestaticprivate

◆ map_x()

◆ map_x_length()

static double Aleph::Tikz_Plane::map_x_length ( const Geom_Number dx,
const Mapping map 
)
inlinestaticprivate

◆ map_y()

◆ map_y_length()

static double Aleph::Tikz_Plane::map_y_length ( const Geom_Number dy,
const Mapping map 
)
inlinestaticprivate

◆ merge_box()

◆ point_options()

◆ put() [1/2]

void Aleph::Tikz_Plane::put ( const Object obj)
inline

Insert an object with default style on default layer.

Definition at line 1366 of file tikzgeom.H.

References default_style_, Aleph::divide_and_conquer_partition_dp(), Layer_Default, and put().

Referenced by put(), Aleph::put_in_plane(), and Aleph::put_in_plane().

◆ put() [2/2]

void Aleph::Tikz_Plane::put ( const Object obj,
const Tikz_Style style,
const int  layer 
)
inline

Insert an object with explicit style/layer.

Definition at line 1372 of file tikzgeom.H.

References Aleph::divide_and_conquer_partition_dp(), next_order_, and objects_.

◆ put_cartesian_axis()

void Aleph::Tikz_Plane::put_cartesian_axis ( )
inline

Enable Cartesian axes drawing (only when 0 lies in range).

Definition at line 1291 of file tikzgeom.H.

References with_cartesian_axis_.

Referenced by main(), Aleph::Tikz_Scene::put_cartesian_axis(), TEST(), and TEST().

◆ put_coordinate_grid()

void Aleph::Tikz_Plane::put_coordinate_grid ( const double  step_x = 1.0,
const double  step_y = 1.0,
const bool  draw_ticks = true 
)
inline

Enable coordinate grid/ticks with user step sizes.

Definition at line 1303 of file tikzgeom.H.

References ah_domain_error_if, Aleph::divide_and_conquer_partition_dp(), grid_step_x_, grid_step_y_, with_coordinate_grid_, and with_grid_ticks_.

Referenced by Aleph::Tikz_Scene::put_coordinate_grid(), and TEST().

◆ register_tikz_style()

void Aleph::Tikz_Plane::register_tikz_style ( const std::string &  name,
const Tikz_Style style 
)
inline

Register a reusable \tikzset style for the rendered picture.

Definition at line 1346 of file tikzgeom.H.

References ah_domain_error_if, and tikz_style_defs_.

Referenced by Aleph::Tikz_Scene::register_tikz_style(), and TEST().

◆ remove_cartesian_axis()

void Aleph::Tikz_Plane::remove_cartesian_axis ( )
inline

Disable Cartesian axes drawing.

Definition at line 1297 of file tikzgeom.H.

References with_cartesian_axis_.

Referenced by Aleph::Tikz_Scene::remove_cartesian_axis().

◆ remove_coordinate_grid()

void Aleph::Tikz_Plane::remove_coordinate_grid ( )
inline

Disable coordinate grid rendering.

Definition at line 1316 of file tikzgeom.H.

References with_coordinate_grid_.

Referenced by Aleph::Tikz_Scene::remove_coordinate_grid().

◆ rotated_x_extent()

◆ rotated_y_extent()

◆ set_axis_style()

void Aleph::Tikz_Plane::set_axis_style ( const Tikz_Style style)
inline

Configure the style used to draw Cartesian axes.

Parameters
styleThe new axis style.

Definition at line 1257 of file tikzgeom.H.

References axis_style_.

Referenced by Aleph::Tikz_Scene::set_axis_style().

◆ set_clip_padding_mm()

void Aleph::Tikz_Plane::set_clip_padding_mm ( const double padding_mm)
inline

Configure clip expansion around frame borders.

When <= 0, the plane uses point_radius_mm_ automatically.

Definition at line 1285 of file tikzgeom.H.

References clip_padding_mm_, and Aleph::divide_and_conquer_partition_dp().

Referenced by TEST().

◆ set_default_style()

void Aleph::Tikz_Plane::set_default_style ( const Tikz_Style style)
inline

Configure the default style for subsequent non-styled inserts.

Parameters
styleThe new default style.

Definition at line 1249 of file tikzgeom.H.

References default_style_.

Referenced by Aleph::Tikz_Scene::set_default_style().

◆ set_grid_style()

void Aleph::Tikz_Plane::set_grid_style ( const Tikz_Style style)
inline

Configure the style used to draw coordinate grids.

Parameters
styleThe new grid style.

Definition at line 1265 of file tikzgeom.H.

References grid_style_.

Referenced by Aleph::Tikz_Scene::set_grid_style().

◆ set_point_radius_mm()

void Aleph::Tikz_Plane::set_point_radius_mm ( const double radius_mm)
inline

Configure point marker radius.

Parameters
radius_mmCircle radius used for Point and degenerate fallbacks.
Exceptions
std::domain_errorIf radius_mm <= 0.

Definition at line 1275 of file tikzgeom.H.

References ah_domain_error_if, Aleph::divide_and_conquer_partition_dp(), and point_radius_mm_.

Referenced by main(), and Aleph::Tikz_Scene::set_point_radius_mm().

◆ size()

size_t Aleph::Tikz_Plane::size ( ) const
inline

Number of currently inserted objects.

Definition at line 1236 of file tikzgeom.H.

References objects_.

Referenced by TEST().

◆ text_options()

Member Data Documentation

◆ axis_style_

Tikz_Style Aleph::Tikz_Plane::axis_style_
private
Initial value:
= []()
{
Tikz_Style s;
s.draw_color = "gray";
s.with_arrow = true;
return s;
}()

Definition at line 247 of file tikzgeom.H.

Referenced by draw_cartesian_axis(), draw_coordinate_grid(), get_axis_style(), and set_axis_style().

◆ clip_padding_mm_

double Aleph::Tikz_Plane::clip_padding_mm_ = -1.0
private

Definition at line 238 of file tikzgeom.H.

Referenced by effective_clip_padding_mm(), get_clip_padding_mm(), and set_clip_padding_mm().

◆ default_style_

Tikz_Style Aleph::Tikz_Plane::default_style_
private

Definition at line 246 of file tikzgeom.H.

Referenced by get_default_style(), put(), and set_default_style().

◆ grid_step_x_

double Aleph::Tikz_Plane::grid_step_x_ = 1.0
private

Definition at line 239 of file tikzgeom.H.

Referenced by draw_coordinate_grid(), and put_coordinate_grid().

◆ grid_step_y_

double Aleph::Tikz_Plane::grid_step_y_ = 1.0
private

Definition at line 240 of file tikzgeom.H.

Referenced by draw_coordinate_grid(), and put_coordinate_grid().

◆ grid_style_

Tikz_Style Aleph::Tikz_Plane::grid_style_
private
Initial value:
= []()
{
Tikz_Style s;
s.draw_color = "gray!40";
s.dotted = true;
s.line_width_mm = 0.2;
return s;
}()

Definition at line 255 of file tikzgeom.H.

Referenced by draw_coordinate_grid(), get_grid_style(), and set_grid_style().

◆ height_

double Aleph::Tikz_Plane::height_ = 0.0
private

◆ Layer_Background

constexpr int Aleph::Tikz_Plane::Layer_Background = -100
staticconstexpr

Definition at line 186 of file tikzgeom.H.

Referenced by layer_name(), main(), and TEST().

◆ Layer_Default

constexpr int Aleph::Tikz_Plane::Layer_Default = 0
staticconstexpr

Definition at line 187 of file tikzgeom.H.

Referenced by main(), put(), and TEST().

◆ Layer_Foreground

constexpr int Aleph::Tikz_Plane::Layer_Foreground = 100
staticconstexpr

Definition at line 188 of file tikzgeom.H.

Referenced by layer_name(), main(), and TEST().

◆ Layer_Overlay

constexpr int Aleph::Tikz_Plane::Layer_Overlay = 1000
staticconstexpr

Definition at line 189 of file tikzgeom.H.

Referenced by layer_name(), main(), main(), and TEST().

◆ legend_entries_

std::vector<Legend_Entry> Aleph::Tikz_Plane::legend_entries_
private

Definition at line 270 of file tikzgeom.H.

Referenced by add_legend_entry(), clear_legend(), and collect_legend_entries().

◆ legend_entry_step_mm_

double Aleph::Tikz_Plane::legend_entry_step_mm_ = 5.0
private

Definition at line 244 of file tikzgeom.H.

Referenced by draw_legend().

◆ legend_x_mm_

double Aleph::Tikz_Plane::legend_x_mm_ = 3.0
private

Definition at line 242 of file tikzgeom.H.

Referenced by draw_legend().

◆ legend_y_mm_

double Aleph::Tikz_Plane::legend_y_mm_ = 3.0
private

Definition at line 243 of file tikzgeom.H.

Referenced by draw_legend().

◆ next_order_

size_t Aleph::Tikz_Plane::next_order_ = 0
private

Definition at line 274 of file tikzgeom.H.

Referenced by clear(), and put().

◆ objects_

std::vector<Styled_Object> Aleph::Tikz_Plane::objects_
private

Definition at line 273 of file tikzgeom.H.

Referenced by clear(), collect_legend_entries(), compute_box(), draw(), put(), and size().

◆ point_radius_mm_

double Aleph::Tikz_Plane::point_radius_mm_ = 1.0
private

◆ tick_size_mm_

double Aleph::Tikz_Plane::tick_size_mm_ = 1.5
private

Definition at line 241 of file tikzgeom.H.

Referenced by draw_coordinate_grid().

◆ tikz_style_defs_

std::map<std::string, Tikz_Style> Aleph::Tikz_Plane::tikz_style_defs_
private

Definition at line 271 of file tikzgeom.H.

Referenced by clear_tikz_styles(), draw_tikzset_styles(), and register_tikz_style().

◆ wide_

double Aleph::Tikz_Plane::wide_ = 0.0
private

◆ with_auto_legend_

bool Aleph::Tikz_Plane::with_auto_legend_ = false
private

Definition at line 236 of file tikzgeom.H.

Referenced by collect_legend_entries(), and enable_auto_legend().

◆ with_cartesian_axis_

bool Aleph::Tikz_Plane::with_cartesian_axis_ = false
private

Definition at line 232 of file tikzgeom.H.

Referenced by draw_cartesian_axis(), put_cartesian_axis(), and remove_cartesian_axis().

◆ with_coordinate_grid_

bool Aleph::Tikz_Plane::with_coordinate_grid_ = false
private

Definition at line 233 of file tikzgeom.H.

Referenced by draw_coordinate_grid(), put_coordinate_grid(), and remove_coordinate_grid().

◆ with_grid_ticks_

bool Aleph::Tikz_Plane::with_grid_ticks_ = false
private

Definition at line 234 of file tikzgeom.H.

Referenced by draw_coordinate_grid(), and put_coordinate_grid().

◆ with_native_layers_

bool Aleph::Tikz_Plane::with_native_layers_ = false
private

Definition at line 235 of file tikzgeom.H.

Referenced by draw(), and enable_native_tikz_layers().

◆ xoffset_

double Aleph::Tikz_Plane::xoffset_ = 0.0
private

Definition at line 229 of file tikzgeom.H.

Referenced by draw(), and get_xoffset().

◆ yoffset_

double Aleph::Tikz_Plane::yoffset_ = 0.0
private

Definition at line 230 of file tikzgeom.H.

Referenced by draw(), and get_yoffset().


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