2019-05-07 13:07:58 +02:00
|
|
|
//
|
|
|
|
// Created by trotfunky on 07/05/19.
|
|
|
|
//
|
|
|
|
|
|
|
|
#ifndef SNIPPETS_CIRCLE_H
|
|
|
|
#define SNIPPETS_CIRCLE_H
|
|
|
|
|
|
|
|
#include <string>
|
|
|
|
#include <pugixml.hpp>
|
2019-05-16 01:16:19 +02:00
|
|
|
#include <SFML/Graphics.hpp>
|
2019-05-16 13:07:29 +02:00
|
|
|
#include <sstream>
|
2019-05-16 01:16:19 +02:00
|
|
|
|
|
|
|
#include "DrawingElement.h"
|
2019-05-07 13:07:58 +02:00
|
|
|
|
|
|
|
namespace xmlParser
|
|
|
|
{
|
2019-05-16 01:16:19 +02:00
|
|
|
class Circle : public DrawingElement
|
2019-05-07 13:07:58 +02:00
|
|
|
{
|
2019-05-14 13:07:25 +02:00
|
|
|
public:
|
2019-05-16 13:07:29 +02:00
|
|
|
explicit Circle(std::string label = "Test Circle", float x = 0, float y = 1, float r = 2,
|
|
|
|
const sf::Color& color = sf::Color::Yellow);
|
|
|
|
|
2019-05-16 01:16:19 +02:00
|
|
|
explicit Circle(const pugi::xml_node&);
|
2019-05-14 13:07:25 +02:00
|
|
|
|
2019-05-16 01:16:19 +02:00
|
|
|
void draw(sf::RenderWindow&) override;
|
2019-05-07 13:07:58 +02:00
|
|
|
|
2019-05-16 13:07:29 +02:00
|
|
|
void setX(float newX) override;
|
|
|
|
|
|
|
|
void setY(float newY) override;
|
|
|
|
|
|
|
|
float getR() const;
|
|
|
|
void setR(float newR);
|
2019-05-16 01:16:19 +02:00
|
|
|
|
2019-05-21 12:48:08 +02:00
|
|
|
const std::string toString(int indent) const override;
|
2019-05-16 01:16:19 +02:00
|
|
|
private:
|
2019-05-16 13:07:29 +02:00
|
|
|
float r;
|
2019-05-14 13:07:25 +02:00
|
|
|
};
|
2019-05-07 13:07:58 +02:00
|
|
|
}
|
|
|
|
#endif //SNIPPETS_CIRCLE_H
|