Changed: #1302 Added methods for keeping graphics data (QGraphicsItem and future the 3d_WorldEditor classes).

This commit is contained in:
dnk-88 2011-08-08 22:07:04 +03:00
parent 845cee0a88
commit 7ad4ac2cbe
2 changed files with 18 additions and 1 deletions

View file

@ -132,6 +132,16 @@ void Node::setData(int key, const QVariant &data)
m_data[key] = data;
}
void Node::setGraphicsData(int key, void *pointerToData)
{
m_graphicsData[key] = pointerToData;
}
void *Node::graphicsData(int key) const
{
return m_graphicsData[key];
}
Node *Node::parent()
{
return m_parent;

View file

@ -30,12 +30,14 @@
namespace WorldEditor
{
class WorldEditNode;
class RootPrimitiveNode;
class LandscapeNode;
class PrimitiveNode;
const int GRAPHICS_DATA_QT2D = 0;
const int GRAPHICS_DATA_NEL3D = 1;
/*
@class Node
@brief
@ -91,6 +93,10 @@ public:
/// Return this node's custom data for the key key as a QVariant.
QVariant data(int key) const;
void setGraphicsData(int key, void *pointerToData);
void *graphicsData(int key) const;
/// Return a type this node.
virtual NodeType type() const;
@ -100,6 +106,7 @@ private:
Node *m_parent;
QList<Node *> m_children;
QHash<int, QVariant> m_data;
QHash<int, void *> m_graphicsData;
};
/*