-
Notifications
You must be signed in to change notification settings - Fork 0
/
Grid.h
47 lines (39 loc) · 866 Bytes
/
Grid.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
41
42
43
44
45
46
47
/*
* Grid.h
*
* Created on: Jun 9, 2010
* Author: Vincent
*/
#ifndef GRID_H_
#define GRID_H_
#include <QDataStream>
#include <QList>
#include <QRect>
class Grid;
// Methods to save Grids
QDataStream & operator<<(QDataStream & stream, const Grid & grid);
QDataStream & operator>>(QDataStream & stream, Grid & grid);
class Grid {
public:
enum GridType {
GRID_NULL, GRID_ELLIPSE, GRID_RECTANGLE
};
public:
Grid(GridType type = GRID_NULL);
virtual ~Grid();
public:
GridType getType() const;
QList<QRect> getGeometries() const;
int size() const;
void clear();
const QRect & operator[](int i) const;
QRect & operator[](int i);
void setType(GridType type);
void setGeometries(const QList<QRect> & grid);
void appendGeometry(const QRect & geometry);
void remove(int i);
private:
GridType type;
QList<QRect> grid;
};
#endif /* GRID_H_ */