-
Notifications
You must be signed in to change notification settings - Fork 0
/
Tree.h
38 lines (31 loc) · 905 Bytes
/
Tree.h
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
29
30
31
32
33
34
35
36
37
38
#pragma once
#ifndef TREE_H
#define TREE_H
#include "TreeConfiguration.h"
#include <functional>
#include <QPainter>
#include "Branch.h"
#include "Wind.h"
class Tree
{
public:
Tree(const TreeConfiguration& config, int positionX, int positionY, Wind* wind, size_t currentDepth, std::function<size_t()> children);
virtual ~Tree();
Tree(const Tree& tr) = delete;
Tree(Tree&& tr) noexcept;
Tree& operator=(const Tree& tr) = delete;
Tree& operator=(Tree&& tr) noexcept;
virtual void tic();
virtual void draw(QPainter* painter) const;
virtual void setColor(QColor color);
virtual void setDensity(double density);
virtual void setDeformationResistance(double deformationResistance);
virtual QPoint getPosition() const;
virtual void setPosition(QPoint position);
virtual void setLength(double length);
private:
std::unique_ptr<Branch> mTrunk;
QPoint mBasePosition;
Wind* mWind;
};
#endif