31 if (
step.emitted_left)
return "emit-left";
32 if (
step.emitted_right)
return "emit-right";
33 if (
step.tightened_left
and step.tightened_right)
return "tighten-both";
34 if (
step.tightened_left)
return "tighten-left";
35 if (
step.tightened_right)
return "tighten-right";
41 std::ostringstream
ss;
42 ss <<
"(" << std::fixed << std::setprecision(2)
55 plane.put_cartesian_axis();
56 plane.set_point_radius_mm(0.70);
75 std::ostringstream
ss;
85 plane.put_cartesian_axis();
86 plane.set_point_radius_mm(0.70);
91 std::ostringstream
ss;
101 std::ostringstream
ss;
104 <<
"\\footnotesize event: \\texttt{" <<
step_event(
step) <<
"}\\\\\n"
106 <<
"\\begin{tabular}{@{}ll@{}}\n"
112 <<
"Committed & " <<
step.committed_path.size() <<
" pts\\\\\n"
120 std::ostringstream
ss;
121 ss <<
"\\small\\textbf{Final Path}\\\\\n"
122 <<
"\\footnotesize overlays: " << (
trace.steps.size() + 1) <<
"\\\\\n"
123 <<
"portals: " <<
trace.portals.size() <<
"\\\\\n"
124 <<
"path nodes: " <<
trace.final_path.size() <<
"\\\\[1.2mm]\n"
125 <<
"\\begin{tabular}{@{}ll@{}}\n";
127 if (
trace.final_path.is_empty())
129 ss <<
"Source & N/A\\\\\n"
130 <<
"Target & N/A\\\\\n";
139 ss <<
"\\end{tabular}";
149 argc > 1 ?
argv[1] :
"tikz_funnel_beamer_twocol_example.tex";
154 std::cerr <<
"Cannot open output file: " <<
output_path <<
'\n';
159 const Point source(2, 16);
160 const Point target(22, 16);
170 for (
size_t i = 0; i <
trace.steps.size(); ++i)
179 out <<
"\\documentclass{beamer}\n"
180 <<
"\\usepackage{tikz}\n"
181 <<
"\\setbeamertemplate{navigation symbols}{}\n"
182 <<
"\\begin{document}\n\n"
183 <<
"\\begin{frame}[t]{Shortest Path Funnel Trace (Two Columns)}\n"
184 <<
"\\begin{columns}[T,totalwidth=\\textwidth]\n"
185 <<
"\\begin{column}{0.70\\textwidth}\n";
188 out <<
"\\only<" << (i + 1) <<
">{%\n"
192 out <<
"\\end{column}\n"
193 <<
"\\begin{column}{0.29\\textwidth}\n";
196 out <<
"\\only<" << (i + 1) <<
">{%\n"
200 out <<
"\\end{column}\n"
201 <<
"\\end{columns}\n"
202 <<
"\\end{frame}\n\n"
203 <<
"\\end{document}\n";
207 <<
"Compile with: pdflatex " <<
output_path <<
'\n';
Simple dynamic array with automatic resizing and functional operations.
void reserve(size_t cap)
Reserves cap cells into the array.
Represents a point with rectangular coordinates in a 2D plane.
const Geom_Number & get_x() const noexcept
Gets the x-coordinate value.
const Geom_Number & get_y() const noexcept
Gets the y-coordinate value.
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.
2D TikZ canvas storing geometry objects and emitting LaTeX output.
Main namespace for Aleph-w library functions.
and
Check uniqueness with explicit hash + equality functors.
void put_funnel_trace_step(Tikz_Plane &plane, const Polygon &polygon, const Point &source, const Point &target, const FunnelTraceResult &trace, size_t step_index, const Tikz_Style &polygon_style=tikz_area_style("black", "gray!15", 0.22), const Tikz_Style &source_style=tikz_points_style("green!50!black"), const Tikz_Style &target_style=tikz_points_style("blue"), const Tikz_Style &all_portals_style=tikz_wire_style("purple", true), const Tikz_Style &active_portal_style=tikz_path_style("purple"), const Tikz_Style &funnel_leg_style=tikz_path_style("orange!90!black"), const Tikz_Style &committed_style=tikz_path_style("red"), const bool draw_waypoints=true, const Tikz_Style &waypoint_style=tikz_points_style("red"), const int polygon_layer=Tikz_Plane::Layer_Default, const int portal_layer=Tikz_Plane::Layer_Foreground, const int highlight_layer=Tikz_Plane::Layer_Overlay)
Render one funnel-trace frame in a plane.
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.
ShortestPathDebugResult visualize_shortest_path_with_portals(Tikz_Plane &plane, const Polygon &polygon, const Point &source, const Point &target, const ShortestPathInPolygon &algorithm={}, const Tikz_Style &polygon_style=tikz_area_style("black", "gray!15", 0.25), const Tikz_Style &source_style=tikz_points_style("green!50!black"), const Tikz_Style &target_style=tikz_points_style("blue"), const Tikz_Style &portal_style=tikz_wire_style("purple", true), const Tikz_Style &path_style=tikz_path_style("red"), const bool draw_waypoints=true, const Tikz_Style &waypoint_style=tikz_points_style("red"), const int polygon_layer=Tikz_Plane::Layer_Default, const int portal_layer=Tikz_Plane::Layer_Foreground, const int path_layer=Tikz_Plane::Layer_Overlay)
Visualize the shortest path plus funnel portals.
double geom_number_to_double(const Geom_Number &n)
Converts a Geom_Number to its double precision representation.
Tikz_Style tikz_path_style(const std::string &color="red", const bool with_arrow=false)
Creates a style optimized for polyline paths.
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.
Helpers to visualize computational-geometry algorithm results in TikZ.