30 if (
step.emitted_left)
return "emit-left";
31 if (
step.emitted_right)
return "emit-right";
32 if (
step.tightened_left
and step.tightened_right)
return "tighten-both";
33 if (
step.tightened_left)
return "tighten-left";
34 if (
step.tightened_right)
return "tighten-right";
41 scene.put_cartesian_axis();
42 scene.set_point_radius_mm(0.75);
54 scene.put_funnel_trace_step(
73 "/" + std::to_string(
trace.steps.size()) +
74 ", portal=" + std::to_string(
step.portal_index) +
88 const auto debug =
scene.visualize_shortest_path_with_portals(
92 "Final shortest path with portals: path nodes=" +
93 std::to_string(
debug.path.size())),
105 argc > 1 ?
argv[1] :
"tikz_funnel_beamer_example.tex";
110 std::cerr <<
"Cannot open output file: " <<
output_path <<
'\n';
115 const Point source(2, 16);
116 const Point target(22, 16);
124 for (
size_t i = 0; i <
trace.steps.size(); ++i)
131 opts.frame_options =
"t";
132 opts.frame_title =
"Shortest Path Funnel Trace (SSFA)";
137 <<
"Overlays: " <<
overlays.size() <<
'\n'
138 <<
"Compile with: pdflatex " <<
output_path <<
'\n';
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.
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.
and
Check uniqueness with explicit hash + equality functors.
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 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.
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.
Full trace for shortest-path funnel processing.
One SSFA (funnel) iteration snapshot.
Options used by Tikz_Scene beamer/handout export helpers.
std::string class_options
beamer class options (for example aspectratio=169).