mirror of
https://port.numenaute.org/aleajactaest/khanat-opennel-code.git
synced 2024-11-13 02:39:37 +00:00
Changed: #1302 Added methods for keeping graphics data (QGraphicsItem and future the 3d_WorldEditor classes).
This commit is contained in:
parent
79b9e6d3db
commit
a4ef4082fa
2 changed files with 18 additions and 1 deletions
|
@ -132,6 +132,16 @@ void Node::setData(int key, const QVariant &data)
|
||||||
m_data[key] = 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()
|
Node *Node::parent()
|
||||||
{
|
{
|
||||||
return m_parent;
|
return m_parent;
|
||||||
|
|
|
@ -30,12 +30,14 @@
|
||||||
|
|
||||||
namespace WorldEditor
|
namespace WorldEditor
|
||||||
{
|
{
|
||||||
|
|
||||||
class WorldEditNode;
|
class WorldEditNode;
|
||||||
class RootPrimitiveNode;
|
class RootPrimitiveNode;
|
||||||
class LandscapeNode;
|
class LandscapeNode;
|
||||||
class PrimitiveNode;
|
class PrimitiveNode;
|
||||||
|
|
||||||
|
const int GRAPHICS_DATA_QT2D = 0;
|
||||||
|
const int GRAPHICS_DATA_NEL3D = 1;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@class Node
|
@class Node
|
||||||
@brief
|
@brief
|
||||||
|
@ -91,6 +93,10 @@ public:
|
||||||
/// Return this node's custom data for the key key as a QVariant.
|
/// Return this node's custom data for the key key as a QVariant.
|
||||||
QVariant data(int key) const;
|
QVariant data(int key) const;
|
||||||
|
|
||||||
|
void setGraphicsData(int key, void *pointerToData);
|
||||||
|
|
||||||
|
void *graphicsData(int key) const;
|
||||||
|
|
||||||
/// Return a type this node.
|
/// Return a type this node.
|
||||||
virtual NodeType type() const;
|
virtual NodeType type() const;
|
||||||
|
|
||||||
|
@ -100,6 +106,7 @@ private:
|
||||||
Node *m_parent;
|
Node *m_parent;
|
||||||
QList<Node *> m_children;
|
QList<Node *> m_children;
|
||||||
QHash<int, QVariant> m_data;
|
QHash<int, QVariant> m_data;
|
||||||
|
QHash<int, void *> m_graphicsData;
|
||||||
};
|
};
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
Loading…
Reference in a new issue