tsp_cpp/snippets/Group.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

38 lines
790 B
C++

//
// Created by trotfunky on 15/05/19.
//
#ifndef SNIPPETS_GROUP_H
#define SNIPPETS_GROUP_H
#include <pugixml.hpp>
#include <map>
#include <cstring>
#include <algorithm>
#include "Circle.h"
#include "DrawingElement.h"
namespace xmlParser
{
class Group : public DrawingElement
{
public:
Group();
explicit Group(const pugi::xml_node&);
explicit Group(const std::map<std::string, DrawingElement*>&);
bool addDrawingElement(DrawingElement* drawingElement);
bool removeDrawingElement(const std::string& label);
DrawingElement* getDrawingElement(const std::string&);
void draw(sf::RenderWindow&) override;
private:
std::map<std::string,DrawingElement*> drawingElements;
};
}
#endif //SNIPPETS_GROUP_H