38 scene.put_cartesian_axis()
39 .set_point_radius_mm(0.70);
54 std::string
output_path =
"tikz_scene_overlays_example.tex";
57 for (
int i = 1; i <
argc; ++i)
59 const std::string
arg =
argv[i];
60 if (
arg ==
"--handout")
69 std::cerr <<
"Cannot open output file: " <<
output_path <<
'\n';
76 std::vector<Tikz_Scene> steps;
84 steps.push_back(
scene);
98 "Step 2/3: convex intersection, vertices=" + std::to_string(
inter.size()));
99 steps.push_back(
scene);
107 BooleanPolygonOperations::Op::UNION,
114 "Step 3/3: boolean union, components=" + std::to_string(
united.size()));
115 steps.push_back(
scene);
120 opts.frame_options =
"t";
121 opts.frame_title =
handout ?
"TikZ Scene Overlays (Handout)"
122 :
"TikZ Scene Overlays (Beamer)";
130 <<
"Mode: " << (
handout ?
"handout" :
"beamer") <<
'\n'
131 <<
"Overlays: " << steps.size() <<
'\n'
132 <<
"Compile with: pdflatex " <<
output_path <<
'\n';
Simple dynamic array with automatic resizing and functional operations.
Boolean operations on simple polygons (union, intersection, difference) using the Greiner-Hormann alg...
Basic exact intersection for closed convex polygons.
Represents a point with rectangular coordinates in a 2D plane.
A general (irregular) 2D polygon defined by a sequence of vertices.
void add_vertex(const Point &point)
Add a vertex to the polygon.
void close()
Close the polygon.
Represents a text string positioned at a 2D point.
static constexpr int Layer_Default
static constexpr int Layer_Overlay
High-level scene wrapper to compose objects and algorithm visualizations.
static void draw_handout_overlays(std::ostream &output, const std::vector< Tikz_Scene > &steps, const Tikz_Beamer_Document_Options &options={})
Export multiple scenes as handout overlays (forces beamer[handout]).
static void draw_beamer_overlays(std::ostream &output, const std::vector< Tikz_Scene > &steps, const Tikz_Beamer_Document_Options &options={})
Export multiple scenes as beamer overlays (\\only<k>{...}) in one frame.
Main namespace for Aleph-w library functions.
Divide_Conquer_DP_Result< Cost > divide_and_conquer_partition_dp(const size_t groups, const size_t n, Transition_Cost_Fn transition_cost, const Cost inf=dp_optimization_detail::default_inf< Cost >())
Optimize partition DP using divide-and-conquer optimization.
Tikz_Style make_tikz_draw_style(const std::string &draw_color)
Create a basic draw style with a custom color.
Tikz_Style tikz_area_style(const std::string &draw_color="black", const std::string &fill_color="gray!25", const double opacity=0.6)
Creates a style for drawing filled polygons.
Options used by Tikz_Scene beamer/handout export helpers.
std::string class_options
beamer class options (for example aspectratio=169).