From 9e7fa49f168c4ae25d23e4858a895216e997d205 Mon Sep 17 00:00:00 2001 From: Stijn Buys Date: Sun, 19 Feb 2012 21:29:24 +0000 Subject: Added a seperate class to hold entity properties. --- src/entitywidget.h | 97 +++++------------------------------------------------- 1 file changed, 8 insertions(+), 89 deletions(-) (limited to 'src/entitywidget.h') diff --git a/src/entitywidget.h b/src/entitywidget.h index 4eaaf49..1bdfb93 100644 --- a/src/entitywidget.h +++ b/src/entitywidget.h @@ -8,6 +8,8 @@ #ifndef __INCLUDED_EDITOR_ENTITYWIDGET__ #define __INCLUDED_EDITOR_ENTITYWIDGET__ +#include "entityproperties.h" + #include #include #include @@ -26,46 +28,12 @@ public: EntityWidget(QWidget *parent = 0); /** - * @brief returns the entity label - * */ - inline const QString &label() const { - return entity_label; - } - - /** - * @brief returns the entity name - * */ - inline const QString &name() const { - return entity_name; - } - - /** - * @brief returns the entity radius + * @brief returns the entity propertie * */ - inline const float radius() const { - return entity_radius; + inline EntityProperties *properties() { + return &entitywidget_entityproperties; } - /** - * @brief returns the x, y, or z coordinate of the entity location - * */ - inline const float location(int index) const { - return entity_location[index]; - } - - /** - * @brief returns the properties string - * */ - inline const QString &properties() const { - return entity_properties; - } - - /** - * @brief returns the subsections string - * */ - inline const QString &subsections() const { - return entity_subsections; - } signals: /** * @brief this signal is emitted if the entity is clicked with the left mouse button @@ -78,47 +46,7 @@ signals: void dragged(EntityWidget *entity, int x, int y); public slots: - - /** - * @brief set the entity name - * */ - void set_label(const QString &label); - /** - * @brief set the entity label - * */ - void set_name(const QString &name); - - /** - * @brief set the entity radius - * */ - void set_radius(const float radius); - - /** - * @brief set the entity location - * */ - void set_location(const float x, const float y, const float z); - - /** - * @brief set the entity properties string - * */ - void set_properties(const QString &properties); - - /** - * @brief add a property - * */ - void add_property(const QString &key, const QString &value); - - /** - * @brief add a subsection - * */ - void add_subsection(const QString &name); - - /** - * @brief add a subsection property - * */ - void add_subsection_property(const QString &key, const QString &value); - /** * @brief set the selected state * */ @@ -146,20 +74,11 @@ protected: virtual void mouseMoveEvent(QMouseEvent *event); private: - bool is_selected; - bool is_dragging; - - QString entity_label; - QString entity_name; - QString entity_type; - - QString entity_properties; - QString entity_subsections; + EntityProperties entitywidget_entityproperties; - float entity_location[3]; - float entity_radius; + bool is_selected; + bool is_dragging; - QColor entity_color; }; } -- cgit v1.2.3