Ocular Engine
MaterialTree.hpp
1 
17 #pragma once
18 #ifndef __H__OCULAR_EDITOR_MATERIAL_TREE__H__
19 #define __H__OCULAR_EDITOR_MATERIAL_TREE__H__
20 
21 #include <QtWidgets/qtreewidget.h>
22 #include <unordered_map>
23 
24 //------------------------------------------------------------------------------------------
25 
30 namespace Ocular
31 {
36  namespace Editor
37  {
38  class MaterialTreeItem;
39 
44  class MaterialTree : public QTreeWidget
45  {
46  Q_OBJECT
47 
48  public:
49 
50  MaterialTree(QWidget* parent = nullptr);
51  ~MaterialTree();
52 
56  void refresh();
57 
58  protected:
59 
60  virtual void mousePressEvent(QMouseEvent* event) override;
61 
62  void populateTree();
63  void splitMapping(std::string const& mapping, std::string& path, std::string& name);
64  MaterialTreeItem* createParent(std::string const& parentPath);
65 
66  private slots:
67 
68  private:
69 
70  std::unordered_map<std::string, MaterialTreeItem*> m_ItemMap;
71 
72  };
73  }
77 }
82 //------------------------------------------------------------------------------------------
83 
84 #endif
void refresh()
Definition: MaterialTree.cpp:57
Definition: MaterialTree.hpp:44
Note: Once this library is made dynamic, this will no longer be needed.
Definition: Common.hpp:70
void splitMapping(std::string const &mapping, std::string &path, std::string &name)
Definition: MaterialTree.cpp:159
Definition: MaterialTreeItem.hpp:58