Bromeon
Public Member Functions | Related Functions
thor::ConcaveShape Class Reference

Concave shape class. More...

List of all members.

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 AddPoint (float x, float y, const sf::Color &color, const sf::Color &outlineColor=sf::Color(0, 0, 0))
 Adds a point to the concave shape.
void AddPoint (sf::Vector2f position, const sf::Color &color, const sf::Color &outlineColor=sf::Color(0, 0, 0))
 Adds a point to the concave shape.
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.

Detailed Description

Concave shape class.

This class has the same interface and functionality as sf::Shape, but is additionally able to work with shapes that are concave.


Constructor & Destructor Documentation

Creates an empty shape.

You can use AddPoint() 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 sf::Shape, however there may occur small deviations.


Member Function Documentation

void thor::ConcaveShape::AddPoint ( float  x,
float  y,
const sf::Color &  color,
const sf::Color &  outlineColor = sf::Color(0, 0, 0) 
)

Adds a point to the concave shape.

Parameters:
x,yPoint position.
colorPoint color (color in area between points is interpolated).
outlineColorColor of the shape's outline (color in line between points is interpolated).
void thor::ConcaveShape::AddPoint ( sf::Vector2f  position,
const sf::Color &  color,
const sf::Color &  outlineColor = sf::Color(0, 0, 0) 
)

Adds a point to the concave shape.

Parameters:
positionPoint position.
colorPoint color (color in area between points is interpolated).
outlineColorColor of the shape's outline (color in line between points is interpolated).
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.


The documentation for this class was generated from the following file: