~masgk3team/masgk3/roads

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#ifndef LSYSTEMGENERATOR_HPP
#define LSYSTEMGENERATOR_HPP
//-----//
#include <QVector2D>
//-----//
#include "ConfigRoads.hpp"
#include "AbstractGenerator.hpp"
//-----//

class LSystemGenerator : public AbstractGenerator
{
    struct LSystemState
    {
		QVector2D position;
        QVector2D direction;
        float drawLength;
		LSystemState(QVector2D p, QVector2D d, float l) : position(p), direction(d), drawLength(l) {}
    };

    QVector2D RotateVectorByAngle(const QVector2D&, int);
	QVector2D Clamp(const QVector2D, const QSize&);
	bool ValidPoint(const QImage*, const QVector2D&) const;

public:
    Utils::Junctions GenerateRoads(const ConfigRoads&, const QImage*);
};
//-----//
#endif // LSYSTEMGENERATOR_HPP