Concave shape class. More...
Public Member Functions | |
ConcaveShape () | |
Creates an empty shape. | |
ConcaveShape (const sf::Shape &shape) | |
Implicit constructor that adapts an existing sf::Shape. | |
void | Swap (ConcaveShape &other) |
Exchanges the content of two instances in O(1). | |
void | SetPointCount (unsigned int count) |
Sets the amount of points in the concave polygon. | |
unsigned int | GetPointCount () const |
Returns the amount of points in the concave polygon. | |
void | SetPoint (unsigned int index, sf::Vector2f position) |
Sets the position of a point. | |
sf::Vector2f | GetPoint (unsigned int index) const |
Returns the position of a point. | |
void | SetFillColor (const sf::Color &fillColor) |
Sets the polygon's fill color. | |
void | SetOutlineColor (const sf::Color &outlineColor) |
Sets the polygon's outline color. | |
sf::Color | GetFillColor () const |
Returns the polygon's fill color. | |
sf::Color | GetOutlineColor () const |
Returns the polygon's outline color. | |
void | SetOutlineThickness (float outlineThickness) |
Sets the thickness of the shape's outline (0.f by default). | |
float | GetOutlineThickness () const |
Returns the shape's outline thickness. | |
Related Functions | |
void | thor::swap (ConcaveShape &lhs, ConcaveShape &rhs) |
Exchanges the contents of two concave shapes. |
Concave shape class.
This class has an interface and functionality similar to sf::ConvexShape, but is additionally able to work with shapes that are concave. It inherits the sf::Drawable and sf::Transformable classes.
Creates an empty shape.
You can use SetPointCount() and SetPoint() to build your own concave shape.
thor::ConcaveShape::ConcaveShape | ( | const sf::Shape & | shape | ) |
Implicit constructor that adapts an existing sf::Shape.
The concave shape should look as similar as possible to the original convex shape.
sf::Vector2f thor::ConcaveShape::GetPoint | ( | unsigned int | index | ) | const |
Returns the position of a point.
index | Which point? Must be in [0, GetPointCount()[ |
void thor::ConcaveShape::SetOutlineThickness | ( | float | outlineThickness | ) |
Sets the thickness of the shape's outline (0.f by default).
outlineThickness must be greater or equal to zero. If it is zero, no outline is visible.
void thor::ConcaveShape::SetPoint | ( | unsigned int | index, |
sf::Vector2f | position | ||
) |
Sets the position of a point.
index | Which point? Must be in [0, GetPointCount()[ |
position | New point position in local coordinates. |