7
This file is part of MyGUI.
9
MyGUI is free software: you can redistribute it and/or modify
10
it under the terms of the GNU Lesser General Public License as published by
11
the Free Software Foundation, either version 3 of the License, or
12
(at your option) any later version.
14
MyGUI is distributed in the hope that it will be useful,
15
but WITHOUT ANY WARRANTY; without even the implied warranty of
16
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17
GNU Lesser General Public License for more details.
19
You should have received a copy of the GNU Lesser General Public License
20
along with MyGUI. If not, see <http://www.gnu.org/licenses/>.
22
#ifndef __MYGUI_LAYER_NODE_H__
23
#define __MYGUI_LAYER_NODE_H__
25
#include "MyGUI_Prerequest.h"
26
#include "MyGUI_ILayer.h"
27
#include "MyGUI_ILayerNode.h"
28
#include "MyGUI_RenderItem.h"
34
typedef std::vector<RenderItem*> VectorRenderItem;
35
typedef std::vector<ILayerItem*> VectorLayerItem;
37
class MYGUI_EXPORT LayerNode :
40
MYGUI_RTTI_DERIVED( LayerNode )
43
explicit LayerNode(ILayer* _layer, ILayerNode* _parent = nullptr);
46
// леер, которому мы принадлежим
47
virtual ILayer* getLayer() const;
49
// возвращает отца или nullptr
50
virtual ILayerNode* getParent() const;
52
// создаем дочерний нод
53
virtual ILayerNode* createChildItemNode();
54
// удаляем дочерний нод
55
virtual void destroyChildItemNode(ILayerNode* _node);
57
// поднимаем дочерний нод
58
virtual void upChildItemNode(ILayerNode* _node);
61
virtual EnumeratorILayerNode getEnumerator() const;
63
// добавляем айтем к ноду
64
virtual void attachLayerItem(ILayerItem* _item);
65
// удаляем айтем из нода
66
virtual void detachLayerItem(ILayerItem* _item);
68
// добавляет саб айтем и возвращает рендер айтем
69
virtual RenderItem* addToRenderItem(ITexture* _texture, bool _firstQueue, bool _manualRender);
70
// необходимо обновление нода
71
virtual void outOfDate(RenderItem* _item);
73
// возвращает виджет по позиции
74
virtual ILayerItem* getLayerItemByPoint(int _left, int _top) const;
77
virtual void renderToTarget(IRenderTarget* _target, bool _update);
79
virtual void resizeView(const IntSize& _viewSize);
81
bool isOutOfDate() const;
84
void updateCompression();
87
// список двух очередей отрисовки, для сабскинов и текста
88
VectorRenderItem mFirstRenderItems;
89
VectorRenderItem mSecondRenderItems;
91
// список всех рутовых виджетов
92
// у перекрывающегося слоя здесь только один
93
VectorLayerItem mLayerItems;
95
// список такиж как мы, для построения дерева
96
VectorILayerNode mChildItems;
105
#endif // __MYGUI_LAYER_NODE_H__
2
* This source file is part of MyGUI. For the latest info, see http://mygui.info/
3
* Distributed under the MIT License
4
* (See accompanying file COPYING.MIT or copy at http://opensource.org/licenses/MIT)
7
#ifndef __MYGUI_LAYER_NODE_H__
8
#define __MYGUI_LAYER_NODE_H__
10
#include "MyGUI_Prerequest.h"
11
#include "MyGUI_ILayer.h"
12
#include "MyGUI_ILayerNode.h"
13
#include "MyGUI_RenderItem.h"
19
typedef std::vector<RenderItem*> VectorRenderItem;
20
typedef std::vector<ILayerItem*> VectorLayerItem;
22
class MYGUI_EXPORT LayerNode :
25
MYGUI_RTTI_DERIVED( LayerNode )
28
explicit LayerNode(ILayer* _layer, ILayerNode* _parent = nullptr);
31
// леер, которому мы принадлежим
32
virtual ILayer* getLayer() const;
34
// возвращает отца или nullptr
35
virtual ILayerNode* getParent() const;
37
// создаем дочерний нод
38
virtual ILayerNode* createChildItemNode();
39
// удаляем дочерний нод
40
virtual void destroyChildItemNode(ILayerNode* _node);
42
// поднимаем дочерний нод
43
virtual void upChildItemNode(ILayerNode* _node);
46
virtual EnumeratorILayerNode getEnumerator() const;
48
virtual size_t getLayerNodeCount() const;
50
virtual ILayerNode* getLayerNodeAt(size_t _index) const;
52
// добавляем айтем к ноду
53
virtual void attachLayerItem(ILayerItem* _item);
54
// удаляем айтем из нода
55
virtual void detachLayerItem(ILayerItem* _item);
57
// добавляет саб айтем и возвращает рендер айтем
58
virtual RenderItem* addToRenderItem(ITexture* _texture, bool _firstQueue, bool _manualRender);
59
// необходимо обновление нода
60
virtual void outOfDate(RenderItem* _item);
62
// возвращает виджет по позиции
63
virtual ILayerItem* getLayerItemByPoint(int _left, int _top) const;
66
virtual void renderToTarget(IRenderTarget* _target, bool _update);
68
virtual void resizeView(const IntSize& _viewSize);
70
virtual float getNodeDepth();
72
bool isOutOfDate() const;
75
void updateCompression();
78
// список двух очередей отрисовки, для сабскинов и текста
79
VectorRenderItem mFirstRenderItems;
80
VectorRenderItem mSecondRenderItems;
82
// список всех рутовых виджетов
83
// у перекрывающегося слоя здесь только один
84
VectorLayerItem mLayerItems;
86
// список такиж как мы, для построения дерева
87
VectorILayerNode mChildItems;
97
#endif // __MYGUI_LAYER_NODE_H__