|
Aleph-w 7.10.0
A C++ Library for Data Structures and Algorithms
|
High-level scene wrapper to compose objects and algorithm visualizations. More...
#include <tikzgeom_scene.H>
Public Member Functions | |
| Tikz_Scene (const double width_mm, const double height_mm, const double xoffset_mm=0.0, const double yoffset_mm=0.0, const bool squarize=true) | |
| Tikz_Plane & | plane () |
| const Tikz_Plane & | plane () const |
| Array< std::string > | required_tikz_libraries () const |
| Return TikZ library dependencies required by this scene. | |
| bool | squarize () const |
| void | set_squarize (const bool value) |
| Tikz_Scene & | clear () |
| Tikz_Scene & | put_cartesian_axis () |
| Tikz_Scene & | remove_cartesian_axis () |
| Tikz_Scene & | put_coordinate_grid (const double step_x=1.0, const double step_y=1.0, const bool draw_ticks=true) |
| Tikz_Scene & | remove_coordinate_grid () |
| Tikz_Scene & | set_default_style (const Tikz_Style &style) |
| Tikz_Scene & | set_axis_style (const Tikz_Style &style) |
| Tikz_Scene & | set_grid_style (const Tikz_Style &style) |
| Tikz_Scene & | set_point_radius_mm (const double radius_mm) |
| Tikz_Scene & | enable_native_tikz_layers (const bool enabled=true) |
| Tikz_Scene & | enable_auto_legend (const bool enabled=true) |
| Tikz_Scene & | add_legend_entry (const std::string &label, const Tikz_Style &style) |
| Tikz_Scene & | clear_legend () |
| Tikz_Scene & | register_tikz_style (const std::string &name, const Tikz_Style &style) |
| template<typename Geom > | |
| Tikz_Scene & | add (const Geom &object) |
| template<typename Geom > | |
| Tikz_Scene & | add (const Geom &object, const Tikz_Style &style, const int layer=Tikz_Plane::Layer_Default) |
| Tikz_Scene & | add_points (const Array< Point > &points, const Tikz_Style &style=tikz_points_style("black"), const int layer=Tikz_Plane::Layer_Default) |
| Tikz_Scene & | add_points (const DynList< Point > &points, const Tikz_Style &style=tikz_points_style("black"), const int layer=Tikz_Plane::Layer_Default) |
| Tikz_Scene & | add_polygons (const Array< Polygon > &polys, const Tikz_Style &style=tikz_wire_style("black", true), const int layer=Tikz_Plane::Layer_Default) |
| template<typename Points , typename HullAlgorithm , typename... Args> | |
| Polygon | visualize_convex_hull (const Points &points, HullAlgorithm &&algorithm, Args &&... args) |
| template<typename... Args> | |
| Polygon | visualize_convex_intersection (Args &&... args) |
| template<typename... Args> | |
| Array< Polygon > | visualize_boolean_operation (Args &&... args) |
| template<typename... Args> | |
| auto | visualize_voronoi (Args &&... args) |
| template<typename... Args> | |
| auto | visualize_power_diagram (Args &&... args) |
| template<typename... Args> | |
| auto | visualize_segment_arrangement (Args &&... args) |
| template<typename... Args> | |
| DynList< Point > | visualize_shortest_path_in_polygon (Args &&... args) |
| template<typename... Args> | |
| ShortestPathDebugResult | visualize_shortest_path_with_portals (Args &&... args) |
| template<typename... Args> | |
| Array< Polygon > | visualize_convex_decomposition (Args &&... args) |
| template<typename... Args> | |
| AlphaShape::Result | visualize_alpha_shape (Args &&... args) |
| template<typename... Args> | |
| auto | visualize_delaunay (Args &&... args) |
| template<typename... Args> | |
| auto | visualize_regular_triangulation (Args &&... args) |
| template<typename... Args> | |
| auto | visualize_closest_pair (Args &&... args) |
| template<typename... Args> | |
| auto | visualize_rotating_calipers (Args &&... args) |
| template<typename... Args> | |
| auto | visualize_half_plane_intersection (Args &&... args) |
| template<typename... Args> | |
| auto | visualize_minkowski_sum (Args &&... args) |
| template<typename... Args> | |
| auto | visualize_monotone_triangulation (Args &&... args) |
| template<typename... Args> | |
| auto | visualize_visibility_polygon (Args &&... args) |
| template<typename... Args> | |
| auto | visualize_line_sweep (Args &&... args) |
| template<typename... Args> | |
| auto | visualize_kdtree_partitions (Args &&... args) |
| template<typename... Args> | |
| auto | visualize_range_tree (Args &&... args) |
| template<typename... Args> | |
| auto | visualize_range_tree_query (Args &&... args) |
| template<typename... Args> | |
| auto | visualize_aabb_tree (Args &&... args) |
| template<typename... Args> | |
| auto | visualize_aabb_tree_query (Args &&... args) |
| template<typename... Args> | |
| void | put_funnel_trace_step (Args &&... args) |
| template<typename Callable > | |
| decltype(auto) | run (Callable &&callable) |
| template<typename Callable > | |
| decltype(auto) | run (Callable &&callable) const |
| void | draw (std::ostream &output) const |
| std::string | to_tikz () const |
| void | draw_beamer_frame (std::ostream &output, const std::string &frame_title="TikZ Scene", const std::string &frame_options="t") const |
| void | draw_standalone (std::ostream &output, const Tikz_Standalone_Document_Options &options={}) const |
| std::string | to_standalone (const Tikz_Standalone_Document_Options &options={}) const |
| void | draw_beamer (std::ostream &output, const Tikz_Beamer_Document_Options &options={}) const |
| std::string | to_beamer (const Tikz_Beamer_Document_Options &options={}) const |
| void | draw_handout (std::ostream &output, const Tikz_Beamer_Document_Options &options={}) const |
| std::string | to_handout (const Tikz_Beamer_Document_Options &options={}) const |
Static Public Member Functions | |
| 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. | |
| static std::string | to_beamer_overlays (const std::vector< Tikz_Scene > &steps, const Tikz_Beamer_Document_Options &options={}) |
| String variant of draw_beamer_overlays. | |
| static void | draw_handout_overlays (std::ostream &output, const std::vector< Tikz_Scene > &steps, const Tikz_Beamer_Document_Options &options={}) |
| Export the final overlay scene as a static handout frame. | |
| static std::string | to_handout_overlays (const std::vector< Tikz_Scene > &steps, const Tikz_Beamer_Document_Options &options={}) |
| String variant of draw_handout_overlays. | |
Private Member Functions | |
| void | draw_beamer_document (std::ostream &output, const Tikz_Beamer_Document_Options &options, const bool handout_mode) const |
Static Private Member Functions | |
| static void | append_unique_libraries (Array< std::string > &destination, const Array< std::string > &source) |
Append unique library names from source to destination. | |
| static Array< std::string > | collect_required_libraries (const std::vector< Tikz_Scene > &steps) |
| Collect the union of TikZ dependencies across overlay steps. | |
| static void | draw_tikz_libraries (std::ostream &output, const Array< std::string > &libraries) |
Emit one \\usetikzlibrary{...} command when needed. | |
| static double | beamer_picture_scale (const Tikz_Scene &scene, const Tikz_Beamer_Document_Options &options) |
| Compute a uniform scale that fits a scene in a Beamer frame. | |
| static void | draw_fitted_beamer_picture (std::ostream &output, const Tikz_Scene &scene, const Tikz_Beamer_Document_Options &options) |
| Render a centered scene scaled to the configured Beamer bounds. | |
| static std::string | compose_beamer_class_options (const bool handout_mode, const std::string &class_options) |
| static void | draw_beamer_document_preamble (std::ostream &output, const Tikz_Beamer_Document_Options &options, const bool handout_mode, const Array< std::string > &libraries) |
| static void | draw_beamer_document_epilogue (std::ostream &output) |
| static void | draw_beamer_frame_begin (std::ostream &output, const std::string &frame_title, const std::string &frame_options) |
| static void | draw_beamer_overlays_document (std::ostream &output, const std::vector< Tikz_Scene > &steps, const Tikz_Beamer_Document_Options &options, const bool handout_mode) |
Private Attributes | |
| Tikz_Plane | plane_ |
| bool | squarize_ = true |
High-level scene wrapper to compose objects and algorithm visualizations.
Tikz_Scene owns a Tikz_Plane and exposes:
add),visualize_*), anddraw, to_tikz, draw_standalone, to_standalone, draw_beamer, draw_handout, overlay deck helpers).This keeps a single interface when a figure combines multiple geometric layers (inputs, intermediate states, final outputs, annotations).
Definition at line 96 of file tikzgeom_scene.H.
|
inline |
Definition at line 268 of file tikzgeom_scene.H.
|
inline |
Definition at line 379 of file tikzgeom_scene.H.
References plane_, and Aleph::put_in_plane().
Referenced by main(), TEST(), TEST(), TEST(), TEST(), and TEST().
|
inline |
Definition at line 386 of file tikzgeom_scene.H.
References plane_, and Aleph::put_in_plane().
|
inline |
Definition at line 358 of file tikzgeom_scene.H.
References Aleph::Tikz_Plane::add_legend_entry(), and plane_.
|
inline |
Definition at line 394 of file tikzgeom_scene.H.
References plane_, and Aleph::put_points().
Referenced by main().
|
inline |
Definition at line 403 of file tikzgeom_scene.H.
References plane_, and Aleph::put_points().
|
inline |
Definition at line 412 of file tikzgeom_scene.H.
References plane_, and Aleph::put_polygons().
|
inlinestaticprivate |
Append unique library names from source to destination.
Definition at line 99 of file tikzgeom_scene.H.
References Aleph::append_unique_tikz_library().
Referenced by collect_required_libraries().
|
inlinestaticprivate |
Compute a uniform scale that fits a scene in a Beamer frame.
Definition at line 132 of file tikzgeom_scene.H.
References ah_domain_error_if, Aleph::Tikz_Plane::get_height(), Aleph::Tikz_Plane::get_wide(), options, and plane_.
Referenced by draw_fitted_beamer_picture().
|
inline |
Definition at line 290 of file tikzgeom_scene.H.
References Aleph::Tikz_Plane::clear(), and plane_.
|
inline |
Definition at line 365 of file tikzgeom_scene.H.
References Aleph::Tikz_Plane::clear_legend(), and plane_.
|
inlinestaticprivate |
Collect the union of TikZ dependencies across overlay steps.
Definition at line 107 of file tikzgeom_scene.H.
References append_unique_libraries(), and steps.
Referenced by draw_beamer_overlays_document().
|
inlinestaticprivate |
Definition at line 166 of file tikzgeom_scene.H.
Referenced by draw_beamer_document_preamble().
|
inline |
Definition at line 627 of file tikzgeom_scene.H.
References Aleph::Tikz_Plane::draw(), output, plane_, and squarize_.
Referenced by draw_fitted_beamer_picture(), and to_tikz().
|
inline |
Definition at line 683 of file tikzgeom_scene.H.
Referenced by main().
|
inlineprivate |
Definition at line 251 of file tikzgeom_scene.H.
References draw_beamer_document_epilogue(), draw_beamer_document_preamble(), draw_beamer_frame_begin(), draw_fitted_beamer_picture(), options, output, plane_, and Aleph::Tikz_Plane::required_tikz_libraries().
|
inlinestaticprivate |
Definition at line 209 of file tikzgeom_scene.H.
References output.
Referenced by draw_beamer_document(), and draw_beamer_overlays_document().
|
inlinestaticprivate |
Definition at line 182 of file tikzgeom_scene.H.
References compose_beamer_class_options(), draw_tikz_libraries(), options, and output.
Referenced by draw_beamer_document(), and draw_beamer_overlays_document().
|
inline |
Definition at line 639 of file tikzgeom_scene.H.
References draw_beamer_frame_begin(), draw_fitted_beamer_picture(), and output.
|
inlinestaticprivate |
Definition at line 214 of file tikzgeom_scene.H.
References output.
Referenced by draw_beamer_document(), draw_beamer_frame(), and draw_beamer_overlays_document().
|
inlinestatic |
Export multiple scenes as beamer overlays (\\only<k>{...}) in one frame.
Definition at line 714 of file tikzgeom_scene.H.
Referenced by main().
|
inlinestaticprivate |
Definition at line 225 of file tikzgeom_scene.H.
References collect_required_libraries(), draw_beamer_document_epilogue(), draw_beamer_document_preamble(), draw_beamer_frame_begin(), draw_fitted_beamer_picture(), options, output, and steps.
|
inlinestaticprivate |
Render a centered scene scaled to the configured Beamer bounds.
Definition at line 151 of file tikzgeom_scene.H.
References beamer_picture_scale(), draw(), options, and output.
Referenced by draw_beamer_document(), draw_beamer_frame(), and draw_beamer_overlays_document().
|
inline |
Definition at line 698 of file tikzgeom_scene.H.
Referenced by main().
|
inlinestatic |
Export the final overlay scene as a static handout frame.
Rendering only the final state prevents Beamer handout mode from stacking every \\only body vertically in a single frame.
Definition at line 737 of file tikzgeom_scene.H.
Referenced by main().
|
inline |
Definition at line 650 of file tikzgeom_scene.H.
Referenced by main().
|
inlinestaticprivate |
Emit one \\usetikzlibrary{...} command when needed.
Definition at line 118 of file tikzgeom_scene.H.
References Aleph::Array< T >::is_empty(), output, and Aleph::Array< T >::size().
Referenced by draw_beamer_document_preamble().
|
inline |
Definition at line 352 of file tikzgeom_scene.H.
References Aleph::Tikz_Plane::enable_auto_legend(), and plane_.
Referenced by main().
|
inline |
Definition at line 346 of file tikzgeom_scene.H.
References Aleph::Tikz_Plane::enable_native_tikz_layers(), and plane_.
Referenced by main().
|
inline |
|
inline |
Definition at line 279 of file tikzgeom_scene.H.
References plane_.
|
inline |
Definition at line 296 of file tikzgeom_scene.H.
References plane_, and Aleph::Tikz_Plane::put_cartesian_axis().
|
inline |
Definition at line 308 of file tikzgeom_scene.H.
References plane_, and Aleph::Tikz_Plane::put_coordinate_grid().
Referenced by main().
|
inline |
Definition at line 610 of file tikzgeom_scene.H.
References plane_, and Aleph::put_funnel_trace_step().
|
inline |
Definition at line 371 of file tikzgeom_scene.H.
References plane_, and Aleph::Tikz_Plane::register_tikz_style().
|
inline |
Definition at line 302 of file tikzgeom_scene.H.
References plane_, and Aleph::Tikz_Plane::remove_cartesian_axis().
|
inline |
Definition at line 316 of file tikzgeom_scene.H.
References plane_, and Aleph::Tikz_Plane::remove_coordinate_grid().
|
inline |
Return TikZ library dependencies required by this scene.
Definition at line 282 of file tikzgeom_scene.H.
References plane_, and Aleph::Tikz_Plane::required_tikz_libraries().
|
inline |
Definition at line 616 of file tikzgeom_scene.H.
References plane_.
|
inline |
Definition at line 622 of file tikzgeom_scene.H.
References plane_.
|
inline |
Definition at line 328 of file tikzgeom_scene.H.
References plane_, and Aleph::Tikz_Plane::set_axis_style().
|
inline |
Definition at line 322 of file tikzgeom_scene.H.
References plane_, and Aleph::Tikz_Plane::set_default_style().
|
inline |
Definition at line 334 of file tikzgeom_scene.H.
References plane_, and Aleph::Tikz_Plane::set_grid_style().
Referenced by main().
|
inline |
Definition at line 340 of file tikzgeom_scene.H.
References plane_, and Aleph::Tikz_Plane::set_point_radius_mm().
|
inline |
Definition at line 288 of file tikzgeom_scene.H.
|
inline |
Definition at line 287 of file tikzgeom_scene.H.
References squarize_.
|
inline |
Definition at line 690 of file tikzgeom_scene.H.
|
inlinestatic |
String variant of draw_beamer_overlays.
Definition at line 723 of file tikzgeom_scene.H.
|
inline |
Definition at line 705 of file tikzgeom_scene.H.
Referenced by TEST().
|
inlinestatic |
String variant of draw_handout_overlays.
Definition at line 746 of file tikzgeom_scene.H.
|
inline |
|
inline |
|
inline |
Definition at line 596 of file tikzgeom_scene.H.
References plane_, and Aleph::visualize_aabb_tree().
|
inline |
Definition at line 603 of file tikzgeom_scene.H.
References plane_, and Aleph::visualize_aabb_tree_query().
Referenced by TEST().
|
inline |
Definition at line 505 of file tikzgeom_scene.H.
References plane_, and Aleph::visualize_alpha_shape().
|
inline |
Definition at line 456 of file tikzgeom_scene.H.
References plane_, and Aleph::visualize_boolean_operation().
Referenced by main().
|
inline |
Definition at line 526 of file tikzgeom_scene.H.
References plane_, and Aleph::visualize_closest_pair().
Referenced by TEST().
|
inline |
Definition at line 498 of file tikzgeom_scene.H.
References plane_, and Aleph::visualize_convex_decomposition().
|
inline |
Definition at line 422 of file tikzgeom_scene.H.
References Aleph::DynList< T >::append(), plane_, Aleph::DynList< T >::size(), and Aleph::visualize_convex_hull().
|
inline |
Definition at line 449 of file tikzgeom_scene.H.
References plane_, and Aleph::visualize_convex_intersection().
Referenced by main().
|
inline |
Definition at line 512 of file tikzgeom_scene.H.
References plane_, and Aleph::visualize_delaunay().
Referenced by TEST().
|
inline |
Definition at line 540 of file tikzgeom_scene.H.
References plane_, and Aleph::visualize_half_plane_intersection().
|
inline |
Definition at line 575 of file tikzgeom_scene.H.
References plane_, and Aleph::visualize_kdtree_partitions().
Referenced by TEST().
|
inline |
Definition at line 568 of file tikzgeom_scene.H.
References plane_, and Aleph::visualize_line_sweep().
Referenced by TEST().
|
inline |
Definition at line 547 of file tikzgeom_scene.H.
References plane_, and Aleph::visualize_minkowski_sum().
|
inline |
Definition at line 554 of file tikzgeom_scene.H.
References plane_, and Aleph::visualize_monotone_triangulation().
|
inline |
Definition at line 470 of file tikzgeom_scene.H.
References plane_, and Aleph::visualize_power_diagram().
|
inline |
Definition at line 582 of file tikzgeom_scene.H.
References plane_, and Aleph::visualize_range_tree().
|
inline |
Definition at line 589 of file tikzgeom_scene.H.
References plane_, and Aleph::visualize_range_tree_query().
Referenced by TEST().
|
inline |
Definition at line 519 of file tikzgeom_scene.H.
References plane_, and Aleph::visualize_regular_triangulation().
|
inline |
Definition at line 533 of file tikzgeom_scene.H.
References plane_, and Aleph::visualize_rotating_calipers().
Referenced by main().
|
inline |
Definition at line 477 of file tikzgeom_scene.H.
References plane_, and Aleph::visualize_segment_arrangement().
|
inline |
Definition at line 484 of file tikzgeom_scene.H.
References plane_, and Aleph::visualize_shortest_path_in_polygon().
|
inline |
Definition at line 491 of file tikzgeom_scene.H.
References plane_, and Aleph::visualize_shortest_path_with_portals().
Referenced by main().
|
inline |
Definition at line 561 of file tikzgeom_scene.H.
References plane_, and Aleph::visualize_visibility_polygon().
Referenced by main().
|
inline |
Definition at line 463 of file tikzgeom_scene.H.
References plane_, and Aleph::visualize_voronoi().
|
private |
Definition at line 264 of file tikzgeom_scene.H.
Referenced by add(), add(), add_legend_entry(), add_points(), add_points(), add_polygons(), beamer_picture_scale(), clear(), clear_legend(), draw(), draw_beamer_document(), enable_auto_legend(), enable_native_tikz_layers(), plane(), plane(), put_cartesian_axis(), put_coordinate_grid(), put_funnel_trace_step(), register_tikz_style(), remove_cartesian_axis(), remove_coordinate_grid(), required_tikz_libraries(), run(), run(), set_axis_style(), set_default_style(), set_grid_style(), set_point_radius_mm(), visualize_aabb_tree(), visualize_aabb_tree_query(), visualize_alpha_shape(), visualize_boolean_operation(), visualize_closest_pair(), visualize_convex_decomposition(), visualize_convex_hull(), visualize_convex_intersection(), visualize_delaunay(), visualize_half_plane_intersection(), visualize_kdtree_partitions(), visualize_line_sweep(), visualize_minkowski_sum(), visualize_monotone_triangulation(), visualize_power_diagram(), visualize_range_tree(), visualize_range_tree_query(), visualize_regular_triangulation(), visualize_rotating_calipers(), visualize_segment_arrangement(), visualize_shortest_path_in_polygon(), visualize_shortest_path_with_portals(), visualize_visibility_polygon(), and visualize_voronoi().
|
private |
Definition at line 265 of file tikzgeom_scene.H.
Referenced by draw(), set_squarize(), and squarize().