-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCStaticGeometryEntity.h
More file actions
60 lines (44 loc) · 1.55 KB
/
CStaticGeometryEntity.h
File metadata and controls
60 lines (44 loc) · 1.55 KB
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
53
54
55
56
57
58
59
60
#ifndef CSTATICGEOMETRYENTITY_H
#define CSTATICGEOMETRYENTITY_H
#include "CEntity.h"
#include "CScene.h"
#include <QGraphicsPixmapItem>
class CResource;
class CStaticGeometryEntity : public CEntity
{
protected:
friend class CScene;
// ctor
CStaticGeometryEntity(long id, CResource* resource);
// dtor
~CStaticGeometryEntity();
public:
// Returns the resource used by this entity
CResource* getResource() const { return mResource; }
// Apply the entity to the current scene
virtual void addToScene(QGraphicsScene* scene);
// Set Entity Position
virtual void setPosition(const Vector2D& pos);
// Set entity angle
virtual void setAngle(float angle);
// Returns the type of this entity
virtual EntityType getType() const { return ENTITY_TYPE_STATIC_GEOMETRY; }
// Returns the current RenderWidget item representation
virtual QGraphicsItem* getSceneItem() const { return mSceneItem; }
// Returns the properties available for this entity
virtual QVariantMap getProperties();
// Defines a property for this entity
// Returns if the property has been successfully set
virtual bool setProperty(const QString& key, const QVariant& value);
// Set entity Z depth index
virtual void setZIndex(unsigned short layer);
///////////////////////////////
// PROPERTIES
static const QString PROP_KEY_RESOURCE;
///////////////////////////////
protected:
CResource* mResource;
QPixmap mTexturePixmap;
QGraphicsPixmapItem* mSceneItem;
};
#endif // CSTATICGEOMETRYENTITY_H