-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPatternScene.h
40 lines (34 loc) · 1.05 KB
/
PatternScene.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
39
40
#pragma once
#include <QGraphicsScene>
#include <QGraphicsItem>
#include <QSharedPointer>
#include "properties.h"
#include "PatternItem.h"
class PatternScene: public QObject
{
Q_OBJECT
public:
PatternScene();
PatternScene(const PatternScene& ) = delete;
PatternScene( PatternScene&&) = delete;
PatternScene& operator=(const PatternScene& ) = delete;
PatternScene& operator=( PatternScene&&) = delete;
QGraphicsScene* get();
QList<PatternItem*> items() const;
QList<PatternItem*> items(int a_first_frame, int a_last_frame) const;
void deleteItem(PatternItem* a_item);
void addItem (PatternItem* a_item);
void reset();
Frame size() const;
void setSize(Frame a_size);
QList<PatternItem*> selectedItems() const;
signals:
void itemAdded (PatternItem* a_item);
void itemDeleted(PatternItem* a_item);
private:
void updateSceneRect();
QList<PatternItem*> itemList(const QList<QGraphicsItem*>& a_items) const;
QGraphicsScene m_scene;
Frame m_size = Properties::Pattern::DefaultSize;
};
using PatternScenePtr = QSharedPointer<PatternScene>;