8#ifndef W_LINE_ENTITY_HPP
9#define W_LINE_ENTITY_HPP
14#pragma GCC diagnostic push
15#pragma GCC diagnostic ignored "-Wfloat-equal"
16#pragma GCC diagnostic ignored "-Wswitch-default"
17#include <SFML/Graphics.hpp>
18#pragma GCC diagnostic pop
54 LineEntity(
const sf::Vector2f& origin,
const sf::Vector2f& scale,
const sf::Vector2f& start,
const sf::Vector2f& end,
55 bool withArrow =
false );
114 [[nodiscard]]
bool hasArrow( )
const;
132 void render( sf::RenderWindow& window );
138 sf::ConvexShape mArrowHead;
152 void initArrowHead(
const sf::Vector2f& lineEnd,
const sf::Vector2f& dir,
float arrowSize, sf::Color color );
Represents an entity in the ECS (Entity-Component System) architecture.
Definition wEntity.hpp:60
LineStyle
Available styles for line rendering.
Definition wLineStyleComponent.hpp:35
void setDashLength(float dashLength)
Sets the dash length for dashed lines.
Definition wLineEntity.cpp:62
float getThickness() const
Returns the current thickness of the line.
Definition wLineEntity.cpp:42
void setThickness(float thickness)
Sets the thickness of the line.
Definition wLineEntity.cpp:52
virtual ~LineEntity()=default
Virtual destructor.
void setArrowSize(float arrowSize)
Sets the arrowhead size factor.
Definition wLineEntity.cpp:92
bool hasArrow() const
Checks if the line has an arrowhead.
Definition wLineEntity.cpp:82
sf::Vector2f getStartPoint() const
Returns the starting point of the line.
Definition wLineEntity.cpp:72
void render(sf::RenderWindow &window)
Renders the line (and optional arrowhead).
Definition wLineEntity.cpp:103
void setGapLength(float gapLength)
Sets the gap length between dashes or dots.
Definition wLineEntity.cpp:67
sf::Vector2f getEndPoint() const
Returns the ending point of the line.
Definition wLineEntity.cpp:77
float getArrowSize() const
Returns the arrowhead size factor.
Definition wLineEntity.cpp:87
void setColor(sf::Color color)
Sets the color of the line and arrowhead.
Definition wLineEntity.cpp:47
LineEntity(const sf::Vector2f &origin, const sf::Vector2f &scale, const sf::Vector2f &start, const sf::Vector2f &end, bool withArrow=false)
Construct a line entity between two points.
Definition wLineEntity.cpp:23
void setLineStyle(wEngine::LineStyleComponent::LineStyle style)
Sets the visual style of the line.
Definition wLineEntity.cpp:57
Definition wAxisEntity.cpp:17