Aleph-w 3.0
A C++ Library for Data Structures and Algorithms
Loading...
Searching...
No Matches
tikzgeom.H File Reference

TikZ/LaTeX geometric drawing utilities. More...

#include <algorithm>
#include <array>
#include <cmath>
#include <cstddef>
#include <iomanip>
#include <map>
#include <ostream>
#include <sstream>
#include <string>
#include <unordered_set>
#include <type_traits>
#include <utility>
#include <variant>
#include <vector>
#include "line.H"
#include "point.H"
#include "polygon.H"
Include dependency graph for tikzgeom.H:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  Aleph::Tikz_Style
 Style descriptor for TikZ primitives. More...
 
struct  Aleph::Tikz_Quadratic_Bezier
 Represents a quadratic Bézier curve for native TikZ rendering. More...
 
struct  Aleph::Tikz_Cubic_Bezier
 Represents a cubic Bézier curve for native TikZ rendering. More...
 
struct  Aleph::Tikz_Polyline
 An open or closed polyline for TikZ rendering. More...
 
class  Aleph::Tikz_Plane
 2D TikZ canvas storing geometry objects and emitting LaTeX output. More...
 
struct  Aleph::Tikz_Plane::Geom_Box
 
struct  Aleph::Tikz_Plane::Mapping
 
struct  Aleph::Tikz_Plane::Styled_Object
 An object with its associated style, layer, and insertion order. More...
 
struct  Aleph::Tikz_Plane::Legend_Entry
 

Namespaces

namespace  Aleph
 Main namespace for Aleph-w library functions.
 

Functions

Tikz_Style Aleph::make_tikz_draw_style (const std::string &draw_color)
 Create a basic draw style with a custom color.
 
Tikz_Style Aleph::make_tikz_fill_style (const std::string &draw_color, const std::string &fill_color)
 Create a basic fill style with custom draw/fill colors.
 
template<typename Geom , typename = std::enable_if_t< std::is_constructible_v<Tikz_Plane::Object, std::decay_t<Geom>>>>
void Aleph::put_in_plane (Tikz_Plane &plane, const Geom &geom_obj)
 Insert any supported geometry type in a Tikz_Plane.
 
template<typename Geom , typename = std::enable_if_t< std::is_constructible_v<Tikz_Plane::Object, std::decay_t<Geom>>>>
void Aleph::put_in_plane (Tikz_Plane &plane, const Geom &geom_obj, const Tikz_Style &style, const int layer=Tikz_Plane::Layer_Default)
 Insert any supported geometry type with style/layer.
 
void Aleph::put_quadratic_bezier_in_plane (Tikz_Plane &plane, const Point &p0, const Point &p1, const Point &p2, const size_t subdivisions=64, const Tikz_Style &style={}, const int layer=Tikz_Plane::Layer_Default)
 Approximate and insert a quadratic Bézier as an open polyline.
 
void Aleph::put_cubic_bezier_in_plane (Tikz_Plane &plane, const Point &p0, const Point &p1, const Point &p2, const Point &p3, const size_t subdivisions=64, const Tikz_Style &style={}, const int layer=Tikz_Plane::Layer_Default)
 Approximate and insert a cubic Bézier as an open polyline.
 
void Aleph::put_quadratic_bezier_native_in_plane (Tikz_Plane &plane, const Point &p0, const Point &p1, const Point &p2, const Tikz_Style &style={}, const int layer=Tikz_Plane::Layer_Default)
 Insert a quadratic Bézier using native TikZ controls syntax.
 
void Aleph::put_cubic_bezier_native_in_plane (Tikz_Plane &plane, const Point &p0, const Point &p1, const Point &p2, const Point &p3, const Tikz_Style &style={}, const int layer=Tikz_Plane::Layer_Default)
 Insert a cubic Bézier using native TikZ controls syntax.
 
void Aleph::put_point_label_in_plane (Tikz_Plane &plane, const Point &point, const std::string &label, const std::string &placement="above", const Tikz_Style &style=make_tikz_draw_style("black"), const int layer=Tikz_Plane::Layer_Overlay)
 Insert a point label with configurable placement (above, etc.).
 

Detailed Description

TikZ/LaTeX geometric drawing utilities.

This module provides a PGF/TikZ backend to render geometry objects into a fixed-size plane. Its public API mirrors the EEPIC model (Eepic_Plane + put_in_plane) so existing workflows can migrate incrementally.

Typical usage:

Tikz_Plane plane(120, 80); // width/height in mm
put_in_plane(plane, Point(0, 0));
put_in_plane(plane, Segment(Point(0, 0), Point(10, 20)));
plane.draw(std::cout);
void put_in_plane(Eepic_Plane &plane, const Point &geom_obj)
Definition eepicgeom.C:43

Robustness notes:

  • Degenerate global ranges (all x equal or all y equal) are handled without division by zero.
  • Empty planes are valid and produce an empty clipped tikzpicture.

Definition in file tikzgeom.H.