tsp_cpp/snippets/DrawingElement.h
trotFunky 71ce85cec4 Continuing vector graphics exercise
New classes :
 - DrawingElement (Base class for every other element)
 - Group : Groups DrawingElements together

Modified Circle to work with DrawingElement
Corrected a *maybe* failed vector copy in Polynomial.tpp
2019-05-16 01:16:19 +02:00

45 lines
816 B
C++

//
// Created by trotfunky on 15/05/19.
//
#ifndef SNIPPETS_DRAWINGELEMENT_H
#define SNIPPETS_DRAWINGELEMENT_H
#include <SFML/Graphics.hpp>
#include <pugixml.hpp>
#include <string>
namespace xmlParser
{
class DrawingElement
{
public:
DrawingElement();
explicit DrawingElement(const pugi::xml_node&);
virtual void draw(sf::RenderWindow&) = 0;
std::string label;
int getX() const;
void setX(int newX);
int getY() const;
void setY(int newY);
const sf::Color& getColor() const;
void setColor(const sf::Color& newColor);
void setColor(const std::string& stringColor);
protected:
int x;
int y;
sf::Color color;
sf::Shape* shape;
};
}
#endif //SNIPPETS_DRAWINGELEMENT_H