29int main(
int argc,
char * argv[])
31 std::string output_path =
"tikz_scene_beamer_example.tex";
34 for (
int i = 1; i < argc; ++i)
36 const std::string arg = argv[i];
37 if (arg ==
"--handout")
43 std::ofstream
out(output_path);
46 std::cerr <<
"Cannot open output file: " << output_path <<
'\n';
54 const Polygon polygon = make_corridor();
55 const Point source(2, 16);
56 const Point target(22, 16);
73 "Tikz_Scene beamer export: portals=" +
74 std::to_string(shortest.
portals.size())),
79 opts.
frame_title = handout ?
"TikZ Scene (Handout)" :
"TikZ Scene (Beamer)";
88 std::cout <<
"Generated " << output_path <<
'\n'
89 <<
"Mode: " << (handout ?
"handout" :
"beamer") <<
'\n'
90 <<
"Portals: " << shortest.
portals.size() <<
'\n'
91 <<
"Compile with: pdflatex " << output_path <<
'\n';
size_t size_t int32_t * out
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.
Compute the shortest Euclidean path between two points inside a simple polygon.
Represents a text string positioned at a 2D point.
static constexpr int Layer_Overlay
High-level scene wrapper to compose objects and algorithm visualizations.
Tikz_Scene & put_cartesian_axis()
Tikz_Scene & add(const Geom &object)
void draw_handout(std::ostream &output, const Tikz_Beamer_Document_Options &options={}) const
void draw_beamer(std::ostream &output, const Tikz_Beamer_Document_Options &options={}) const
ShortestPathDebugResult visualize_shortest_path_with_portals(Args &&... args)
Tikz_Scene & set_point_radius_mm(const double radius_mm)
Main namespace for Aleph-w library functions.
Tikz_Style tikz_path_style(const std::string &color="red", const bool with_arrow=false)
Creates a style optimized for polyline paths.
Tikz_Style make_tikz_draw_style(const std::string &draw_color)
Create a basic draw style with a custom color.
Tikz_Style tikz_wire_style(const std::string &color="black", const bool dashed=false, const bool with_arrow=false)
Creates a style optimized for wireframe segments and polygons.
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.
Tikz_Style tikz_points_style(const std::string &color="black", const double opacity=-1.0)
Creates a style optimized for point clouds.
Result bundle for shortest-path + funnel portal visualization.
Array< FunnelPortal > portals
Options used by Tikz_Scene beamer/handout export helpers.
std::string frame_title
Frame title used by scene exports.
std::string class_options
beamer class options (for example aspectratio=169).
std::string frame_options
Frame options passed to \\begin{frame}[...].
High-level scene management for TikZ geometry visualization.