-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCScene.h
52 lines (38 loc) · 1.23 KB
/
CScene.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
48
49
50
51
52
#ifndef CSCENE_H
#define CSCENE_H
#include <QList>
#include <QGraphicsScene>
class CEntity;
class CStaticGeometryEntity;
class CAnimatedGeometryEntity;
class CResource;
class CScene
{
public:
// ctor
CScene();
// dtor
~CScene();
// Returns a list of all the scene's entities
QList<CEntity*>& getEntities() const;
// Add all the entities to the specified scene
void addAllElementsToScene(QGraphicsScene* scene);
// Create a Static Geometry entity
CStaticGeometryEntity* createStaticGeometry(CResource* resource, int entityId = -1);
// Create an Animated Geometry entity
CAnimatedGeometryEntity* createAnimatedGeometry(CResource* resource, int entityId = -1);
// Returns an entity whom QGraphicsItem representation is the specified pointer
CEntity* getEntityFromGraphicsView(QGraphicsItem* element);
// Clone the specified entity and returns the copied one
CEntity* cloneEntity(CEntity* src);
// Delete the provided entity
void remove(CEntity* ent);
// Save the scene
void save(const QString& filename);
// Load the scene from file
void load(const QString& filename);
protected:
QList<CEntity*> mEntities;
long mFreeEntityId;
};
#endif // CSCENE_H