MyGUI  3.0.1
MyGUI_LayerNode.h
Go to the documentation of this file.
1 
7 /*
8  This file is part of MyGUI.
9 
10  MyGUI is free software: you can redistribute it and/or modify
11  it under the terms of the GNU Lesser General Public License as published by
12  the Free Software Foundation, either version 3 of the License, or
13  (at your option) any later version.
14 
15  MyGUI is distributed in the hope that it will be useful,
16  but WITHOUT ANY WARRANTY; without even the implied warranty of
17  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18  GNU Lesser General Public License for more details.
19 
20  You should have received a copy of the GNU Lesser General Public License
21  along with MyGUI. If not, see <http://www.gnu.org/licenses/>.
22 */
23 #ifndef __MYGUI_LAYER_NODE_H__
24 #define __MYGUI_LAYER_NODE_H__
25 
26 #include "MyGUI_Prerequest.h"
27 #include "MyGUI_ILayer.h"
28 #include "MyGUI_ILayerNode.h"
29 #include "MyGUI_RenderItem.h"
30 
31 namespace MyGUI
32 {
33 
34  class LayerItem;
35  typedef std::vector<RenderItem*> VectorRenderItem;
36  typedef std::vector<ILayerItem*> VectorLayerItem;
37 
39  {
41 
42  public:
43  explicit LayerNode(ILayer* _layer, ILayerNode * _parent = nullptr);
44  virtual ~LayerNode();
45 
46  // леер, которому мы принадлежим
47  virtual ILayer* getLayer() { return mLayer; }
48 
49  // возвращает отца или nullptr
50  virtual ILayerNode* getParent() { return mParent; }
51 
52  // создаем дочерний нод
53  virtual ILayerNode* createChildItemNode();
54  // удаляем дочерний нод
55  virtual void destroyChildItemNode(ILayerNode* _node);
56 
57  // поднимаем дочерний нод
58  virtual void upChildItemNode(ILayerNode* _node);
59 
60  // список детей
61  virtual EnumeratorILayerNode getEnumerator();
62 
63  // добавляем айтем к ноду
64  virtual void attachLayerItem(ILayerItem* _item);
65  // удаляем айтем из нода
66  virtual void detachLayerItem(ILayerItem* _item);
67 
68  // добавляет саб айтем и возвращает рендер айтем
69  virtual RenderItem* addToRenderItem(ITexture* _texture, ISubWidget* _item);
70  // необходимо обновление нода
71  virtual void outOfDate(RenderItem* _item);
72 
73  // возвращает виджет по позиции
74  virtual ILayerItem* getLayerItemByPoint(int _left, int _top);
75 
76  // рисует леер
77  virtual void renderToTarget(IRenderTarget* _target, bool _update);
78 
79  virtual void dumpStatisticToLog(size_t _level);
80 
81  bool isOutOfDate() { return mOutOfDate; }
82 
83  protected:
84  void updateCompression();
85 
86  protected:
87  // список двух очередей отрисовки, для сабскинов и текста
90 
91  // список всех рутовых виджетов
92  // у перекрывающегося слоя здесь только один
94 
95  // список такиж как мы, для построения дерева
97 
101  };
102 
103 } // namespace MyGUI
104 
105 #endif // __MYGUI_LAYER_NODE_H__