Exemplo n.º 1
0
void AddCircle(const std::vector<std::string> & inputParts, std::vector<std::shared_ptr<CShape>> & figures, std::vector<std::shared_ptr<sf::Shape>> & shapes)
{
	CPoint pos = CPoint(std::stod(inputParts[1]), std::stod(inputParts[2]));
	double radius = std::stod(inputParts[3]);
	std::string outlineColor = inputParts[4];
	std::string fillColor = inputParts[5];

	CCircle circle = CCircle(pos, radius, fillColor, outlineColor);
	sf::CircleShape drawCircle;
	drawCircle.setPosition((float)pos.GetPosition().first, (float)pos.GetPosition().second);
	drawCircle.setRadius((float)radius);
	drawCircle.setFillColor(ConvertHexToRgb(fillColor));
	drawCircle.setOutlineThickness(3.f);
	drawCircle.setOutlineColor(ConvertHexToRgb(outlineColor));
	figures.push_back(std::make_shared<CCircle>(circle));
	shapes.push_back(std::make_shared<sf::CircleShape>(drawCircle));
}
Exemplo n.º 2
0
void CRectangle::SetPosition(const CPoint & point)
{
	m_position.SetPosition(point.GetPosition());
}