sf::Line (btw it should be sf::LineShape) would be just sf::RectangleShape with changed names of variables and one or two additional methods, there is no need to implement it in sfml if that can be easly written within 30-40 lines of code. I would rather add something like this:
void rotateTo(sf::Vector2f & factors) { /*some cool code*/ }
to some abstract class inherited by most default drawables, that one would be much more useful and universal.
So, to make it clear, the proposal is to add this:
sf::Line line(x1, y1, x2, y2);
line.setFillColor(color);
window.draw(line);
... to avoid writing this:
sf::Vertex line[] = {{{x1, y1}, color}, {{x2, y2}, color}};
window.draw(line, sf::Lines);
Is it really worth it? (real question, I personally don't know)
So, to make it clear, the proposal is to add this:
sf::Line line(x1, y1, x2, y2);
line.setFillColor(color);
window.draw(line);
... to avoid writing this:
sf::Vertex line[] = {{{x1, y1}, color}, {{x2, y2}, color}};
window.draw(line, sf::Lines);
Is it really worth it? (real question, I personally don't know)
That does not have thickness.
To add a line with thickness between two points requires a bit more boilerplate, like here (https://github.com/SFML/SFML/wiki/Source:-Line-segment-with-thickness). If I have been missing an obvious way to do that, by all means point it out.
The main issue with creating a line using sf::RectangleShape is that you can't define the start position and the end position. It's very arkward to rotate a sf::RectangleShape to do that. This is what I see a sf::LineShape looking like:
sf::LineShape arrow;
arrow.setThickness(2);
arrow.setPosition(sf::Vector2f(23, 74), sf::Vector2f(163, 293));
arrow.setFillColor(sf::Color::Red);
arrow.setOutlineColor(sf::Color::Black);
arrow.setOutlineThickness(4);
arrow.setSmoothEnds(true);
arrow.setFeatures(sf::Arrow::Front);
This abstracts away the whole having to create a rectangle, get the right angle and length so it starts at 23, 74 and ends at 163, 293, then creating two other rectangles and rotating them at the right angle so they make an arrow. And then having to create two circles or something at the end of the rectangle so that it has smooth ends. This gets tedious and sf::LineShape is much quicker and easier. Otherwise using a sf::RectangleShape to create this would be bordering on impossible.
So, to make it clear, the proposal is to add this:
sf::Line line(x1, y1, x2, y2);
line.setFillColor(color);
window.draw(line);
... to avoid writing this:
sf::Vertex line[] = {{{x1, y1}, color}, {{x2, y2}, color}};
window.draw(line, sf::Lines);
Is it really worth it? (real question, I personally don't know)
Just chiming in to say I think it has value. It shouldn't be about code golf or the difficultly to manually implement, the point is to provide consistency in SFML for the base set of shapes and if a line isn't included in the base set of shapes it's all quite arbitrary that anything is in my opinion.
If I don't care much one way or the other on the line thickness debate, I think it leads into a "how many style options should we add to the base shapes" argument more than it leads to any added value on the "should there be a line shape" argument.