From 7ad4ac2cbe5343f698c006827bfff15861518a33 Mon Sep 17 00:00:00 2001 From: dnk-88 Date: Mon, 8 Aug 2011 22:07:04 +0300 Subject: [PATCH] Changed: #1302 Added methods for keeping graphics data (QGraphicsItem and future the 3d_WorldEditor classes). --- .../src/plugins/world_editor/primitive_item.cpp | 10 ++++++++++ .../src/plugins/world_editor/primitive_item.h | 9 ++++++++- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/world_editor/primitive_item.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/world_editor/primitive_item.cpp index e948f8b0f..672bd2954 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/world_editor/primitive_item.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/world_editor/primitive_item.cpp @@ -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; diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/world_editor/primitive_item.h b/code/nel/tools/3d/object_viewer_qt/src/plugins/world_editor/primitive_item.h index 01c63962c..01c96c9d2 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/world_editor/primitive_item.h +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/world_editor/primitive_item.h @@ -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 m_children; QHash m_data; + QHash m_graphicsData; }; /*