![]() |
wPlot2D version: 0.1.0
A lightweight C++ library for clear and customizable 2D scientific plots.
|
Utility class for rendering thick lines and polylines with style support. More...
#include <wLineDrawer.hpp>
Static Public Member Functions | |
static float | drawLine (sf::RenderWindow &window, const sf::Vector2f &point1, const sf::Vector2f &point2, const sf::Color &color, float thickness, LineStyleComponent::LineStyle style=LineStyleComponent::LineStyle::Solid, float dashLength=20.0f, float gapLength=5.0f, float patternOffset=0.0f) |
Draws a single thick line segment between two points. | |
static void | drawPolylineRound (sf::RenderWindow &window, const std::vector< sf::Vector2f > &points, const sf::Color &color, float thickness, LineStyleComponent::LineStyle style=LineStyleComponent::LineStyle::Solid, float dashLength=20.0f, float gapLength=5.0f, unsigned int arcResolution=12) |
Draws a polyline (sequence of connected line segments) with optional round joins. |
Utility class for rendering thick lines and polylines with style support.
The LineDrawer provides static methods to draw line segments and polylines with configurable thickness, color, and style (Solid, Dashed, Dotted).
patternOffset
from drawLine( ) into the next segment.
|
static |
Draws a single thick line segment between two points.
dashLength
sets the visible length of each dash (Dashed style).gapLength
sets the empty space between dashes or dots.thickness
is reused as the dot length if style == Dotted.patternOffset
maintains pattern alignment between consecutive calls.window | Render target. |
point1 | First endpoint of the line. |
point2 | Second endpoint of the line. |
color | Line color. |
thickness | Line thickness in pixels. |
style | Line style (Solid, Dashed, Dotted). |
dashLength | Dash length (used if style == Dashed). |
gapLength | Gap length between dashes or dots. |
patternOffset | Initial offset within the dash/dot pattern. |
|
static |
Draws a polyline (sequence of connected line segments) with optional round joins.
window | Render target. |
points | List of polyline points (must contain at least 2). |
color | Polyline color. |
thickness | Line thickness in pixels. |
style | Line style (Solid, Dashed, Dotted). |
dashLength | Dash length (used if style == Dashed). |
gapLength | Gap length between dashes or dots. |
arcResolution | Number of triangles used to approximate each round join (higher = smoother). |