MyGUI: MyGUI_LayerNode.h Source File

MyGUI 3.4.2

- Main Page
- Related Pages
- Namespaces
- Data Structures
- Files
- Examples

- File List
- Globals

MyGUI_LayerNode.h
Go to the documentation of this file.
1/*
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)
5 */
6
7#ifndef MYGUI_LAYER_NODE_H_
8#define MYGUI_LAYER_NODE_H_
9
10#include "MyGUI_Prerequest.h"
11#include "MyGUI_ILayer.h"
12#include "MyGUI_ILayerNode.h"
13#include "MyGUI_RenderItem.h"
14
15namespace MyGUI
16{
17
18 class LayerItem;
19 typedef std::vector<RenderItem*> VectorRenderItem;
20 typedef std::vector<ILayerItem*> VectorLayerItem;
21
22 class MYGUI_EXPORT LayerNode :
23 public ILayerNode
24 {
25 MYGUI_RTTI_DERIVED( LayerNode )
26
27 public:
28 explicit LayerNode(ILayer* _layer, ILayerNode* _parent = nullptr);
29 ~LayerNode() override;
30
31 // леер, которому мы принадлежим
32 ILayer* getLayer() const override;
33
34 // возвращает отца или nullptr
35 ILayerNode* getParent() const override;
36
37 // создаем дочерний нод
38 ILayerNode* createChildItemNode() override;
39 // удаляем дочерний нод
40 void destroyChildItemNode(ILayerNode* _node) override;
41
42 // поднимаем дочерний нод
43 void upChildItemNode(ILayerNode* _node) override;
44
45 // список детей
46 EnumeratorILayerNode getEnumerator() const override;
47
48 size_t getLayerNodeCount() const override;
49
50 ILayerNode* getLayerNodeAt(size_t _index) const override;
51
52 // добавляем айтем к ноду
53 void attachLayerItem(ILayerItem* _item) override;
54 // удаляем айтем из нода
55 void detachLayerItem(ILayerItem* _item) override;
56
57 // добавляет саб айтем и возвращает рендер айтем
58 RenderItem* addToRenderItem(ITexture* _texture, bool _firstQueue, bool _manualRender) override;
59 // необходимо обновление нода
60 void outOfDate(RenderItem* _item) override;
61
62 // возвращает виджет по позиции
63 ILayerItem* getLayerItemByPoint(int _left, int _top) const override;
64
65 // рисует леер
66 void renderToTarget(IRenderTarget* _target, bool _update) override;
67
68 void resizeView(const IntSize& _viewSize) override;
69
70 float getNodeDepth() const override;
71
72 bool isOutOfDate() const;
73
74 protected:
75 // push all empty buffers to the end of buffers list
76 void updateCompression();
77 RenderItem* addToRenderItemFirstQueue(ITexture* _texture, bool _manualRender);
78 RenderItem* addToRenderItemSecondQueue(ITexture* _texture, bool _manualRender);
79 protected:
80 // two render queues, for subskins and text
81 // first queue keep render order based on order of creation
82 // second queue ignore creation order and always merge render items with same texture
83 VectorRenderItem mFirstRenderItems;
84 VectorRenderItem mSecondRenderItems;
85
86 size_t mLastNotEmptyItem;
87
88 // root widgets list
89 // overlapping layers have only one item here
90 VectorLayerItem mLayerItems;
91
92 VectorILayerNode mChildItems;
93
94 ILayerNode* mParent;
95 ILayer* mLayer;
96 bool mOutOfDate;
97 bool mOutOfDateCompression;
98 float mDepth;
99 };
100
101} // namespace MyGUI
102
103#endif // MYGUI_LAYER_NODE_H_
MyGUI_ILayer.h
MyGUI_ILayerNode.h
MYGUI_EXPORT
#define MYGUI_EXPORT
Definition MyGUI_Platform.h:77
MyGUI_Prerequest.h
MYGUI_RTTI_DERIVED
#define MYGUI_RTTI_DERIVED(DerivedType)
Definition MyGUI_RTTI.h:48
MyGUI_RenderItem.h
MyGUI::Enumerator
Definition MyGUI_Enumerator.h:49
MyGUI::ILayer
Definition MyGUI_ILayer.h:23
MyGUI::ILayerItem
Definition MyGUI_ILayerItem.h:20
MyGUI::ILayerNode
Definition MyGUI_ILayerNode.h:30
MyGUI::IRenderTarget
Definition MyGUI_IRenderTarget.h:21
MyGUI::ITexture
Definition MyGUI_ITexture.h:28
MyGUI::LayerNode
Definition MyGUI_LayerNode.h:24
MyGUI::LayerNode::mLayer
ILayer * mLayer
Definition MyGUI_LayerNode.h:95
MyGUI::LayerNode::mOutOfDate
bool mOutOfDate
Definition MyGUI_LayerNode.h:96
MyGUI::LayerNode::mSecondRenderItems
VectorRenderItem mSecondRenderItems
Definition MyGUI_LayerNode.h:84
MyGUI::LayerNode::mLayerItems
VectorLayerItem mLayerItems
Definition MyGUI_LayerNode.h:90
MyGUI::LayerNode::mLastNotEmptyItem
size_t mLastNotEmptyItem
Definition MyGUI_LayerNode.h:86
MyGUI::LayerNode::mFirstRenderItems
VectorRenderItem mFirstRenderItems
Definition MyGUI_LayerNode.h:83
MyGUI::LayerNode::mParent
ILayerNode * mParent
Definition MyGUI_LayerNode.h:94
MyGUI::LayerNode::mDepth
float mDepth
Definition MyGUI_LayerNode.h:98
MyGUI::LayerNode::mChildItems
VectorILayerNode mChildItems
Definition MyGUI_LayerNode.h:92
MyGUI::LayerNode::mOutOfDateCompression
bool mOutOfDateCompression
Definition MyGUI_LayerNode.h:97
MyGUI::RenderItem
Definition MyGUI_RenderItem.h:23
MyGUI
Definition MyGUI_ActionController.h:15
MyGUI::VectorRenderItem
std::vector< RenderItem * > VectorRenderItem
Definition MyGUI_LayerNode.h:19
MyGUI::VectorILayerNode
std::vector< ILayerNode * > VectorILayerNode
Definition MyGUI_ILayerNode.h:25
MyGUI::VectorLayerItem
std::vector< ILayerItem * > VectorLayerItem
Definition MyGUI_LayerNode.h:20
MyGUI::types::TSize< int >