29 #ifndef THOR_CONCAVESHAPE_HPP
30 #define THOR_CONCAVESHAPE_HPP
34 #include <SFML/Graphics/Color.hpp>
35 #include <SFML/Graphics/ConvexShape.hpp>
36 #include <SFML/Graphics/Drawable.hpp>
37 #include <SFML/Graphics/Transformable.hpp>
38 #include <SFML/Graphics/VertexArray.hpp>
52 class THOR_API
ConcaveShape :
public sf::Drawable,
public sf::Transformable
67 void setPointCount(std::size_t count);
71 std::size_t getPointCount()
const;
76 void setPoint(std::size_t index, sf::Vector2f position);
80 sf::Vector2f getPoint(std::size_t index)
const;
84 void setFillColor(
const sf::Color& fillColor);
88 void setOutlineColor(
const sf::Color& outlineColor);
92 sf::Color getFillColor()
const;
96 sf::Color getOutlineColor()
const;
100 void setOutlineThickness(
float outlineThickness);
104 float getOutlineThickness()
const;
108 sf::FloatRect getLocalBounds()
const;
114 sf::FloatRect getGlobalBounds()
const;
120 struct TriangleGenerator;
127 virtual void draw(sf::RenderTarget& target, sf::RenderStates states)
const;
130 void ensureDecomposed()
const;
133 void ensureOutlineUpdated()
const;
139 std::vector<sf::Vector2f> mPoints;
140 sf::Color mFillColor;
141 sf::Color mOutlineColor;
142 float mOutlineThickness;
144 mutable sf::VertexArray mTriangleVertices;
145 mutable std::vector<sf::ConvexShape> mOutlineShapes;
146 mutable sf::FloatRect mLocalBounds;
147 mutable bool mNeedsDecomposition;
148 mutable bool mNeedsOutlineUpdate;
155 #endif // THOR_CONCAVESHAPE_HPP
Concave shape class.
Definition: ConcaveShape.hpp:52
Definition: Animator.hpp:42
Configuration header of the library.