41 scene.put_cartesian_axis();
42 scene.set_point_radius_mm(0.75);
50 const size_t step_index)
72 "Step " + std::to_string(step_index + 1) +
73 "/" + std::to_string(
trace.steps.size()) +
75 ", event=" + step_event(step)),
92 "Final shortest path with portals: path nodes=" +
93 std::to_string(debug.path.size())),
102int main(
int argc,
char * argv[])
104 const std::string output_path =
105 argc > 1 ? argv[1] :
"tikz_funnel_beamer_example.tex";
107 std::ofstream
out(output_path);
110 std::cerr <<
"Cannot open output file: " << output_path <<
'\n';
114 const Polygon polygon = make_funnel_polygon();
115 const Point source(2, 16);
116 const Point target(22, 16);
121 std::vector<Tikz_Scene> overlays;
122 overlays.reserve(trace.steps.size() + 1);
124 for (
size_t i = 0; i < trace.steps.size(); ++i)
125 overlays.push_back(render_trace_step_scene(polygon, source, target, trace, i));
127 overlays.push_back(render_final_scene(polygon, source, target));
132 opts.
frame_title =
"Shortest Path Funnel Trace (SSFA)";
136 std::cout <<
"Generated " << output_path <<
'\n'
137 <<
"Overlays: " << overlays.size() <<
'\n'
138 <<
"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.
void put_funnel_trace_step(Args &&... args)
Tikz_Scene & add(const Geom &object)
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.
ShortestPathDebugResult visualize_shortest_path_with_portals(Args &&... args)
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.
and
Check uniqueness with explicit hash + equality functors.
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.
FunnelTraceResult compute_shortest_path_funnel_trace(const Polygon &polygon, const Point &source, const Point &target)
Compute a full SSFA trace (portal-by-portal states).
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.
Aleph::Array< Frame > trace(const std::string_view input)
Record an actual online round trip, starting with the empty model.
Full trace for shortest-path funnel processing.
One SSFA (funnel) iteration snapshot.
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.