9int main(
int argc,
char * argv[])
11 const std::string output_path =
12 argc > 1 ? argv[1] :
"tikz_render_features_example.tex";
14 std::ofstream
out(output_path);
17 std::cerr <<
"Cannot open output file: " << output_path <<
'\n';
36 route_style.
thick =
true;
50 hatch.
pattern =
"north east lines";
83 bez_style.
thick =
true;
97 std::cout <<
"Generated " << output_path <<
'\n';
98 std::cout <<
"Compile with: pdflatex " << output_path <<
'\n';
size_t size_t int32_t * out
Simple dynamic array with automatic resizing and functional operations.
T & append(const T &data)
Append a copy of data
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.
Represents a line segment between two points.
Represents a text string positioned at a 2D point.
static constexpr int Layer_Foreground
static constexpr int Layer_Background
static constexpr int Layer_Overlay
High-level scene wrapper to compose objects and algorithm visualizations.
Tikz_Scene & put_coordinate_grid(const double step_x=1.0, const double step_y=1.0, const bool draw_ticks=true)
Tikz_Scene & enable_native_tikz_layers(const bool enabled=true)
void draw_standalone(std::ostream &output, const Tikz_Standalone_Document_Options &options={}) const
Tikz_Scene & enable_auto_legend(const bool enabled=true)
Tikz_Scene & put_cartesian_axis()
Tikz_Scene & add_legend_entry(const std::string &label, const Tikz_Style &style)
Tikz_Scene & add(const Geom &object)
Tikz_Scene & register_tikz_style(const std::string &name, const Tikz_Style &style)
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 & set_grid_style(const Tikz_Style &style)
Tikz_Scene & set_point_radius_mm(const double radius_mm)
Main namespace for Aleph-w library functions.
void put_cubic_bezier_native_in_plane(Tikz_Plane &plane, const Point &p0, const Point &p1, const Point &p2, const Point &p3, const Tikz_Style &style={}, const int layer=Tikz_Plane::Layer_Default)
Insert a cubic Bézier using native TikZ controls syntax.
void put_point_label_in_plane(Tikz_Plane &plane, const Point &point, const std::string &label, const std::string &placement="above", const Tikz_Style &style=make_tikz_draw_style("black"), const int layer=Tikz_Plane::Layer_Overlay)
Insert a point label with configurable placement (above, etc.).
Tikz_Style make_tikz_draw_style(const std::string &draw_color)
Create a basic draw style with a custom color.
Tikz_Style tikz_points_style(const std::string &color="black", const double opacity=-1.0)
Creates a style optimized for point clouds.
Style descriptor for TikZ primitives.
std::string text_anchor
TikZ node anchor (anchor=<value>)
std::string fill_color
TikZ fill color (fill=<color>)
std::string pattern
TikZ pattern (e.g. north east lines)
bool fill
Fill closed shapes (polygon/triangle/ellipse)
std::string tikz_style_name
Optional named style (from \tikzset)
double line_width_mm
line width=<value>mm when > 0
std::string draw_color
TikZ draw color (draw=<color>)
std::string pattern_color
TikZ pattern color (pattern color=<color>)
High-level scene management for TikZ geometry visualization.