MyGUI  3.2.1
MyGUI_ILayerNode.h
Go to the documentation of this file.
00001 /*
00002  * This source file is part of MyGUI. For the latest info, see http://mygui.info/
00003  * Distributed under the MIT License
00004  * (See accompanying file COPYING.MIT or copy at http://opensource.org/licenses/MIT)
00005  */
00006 
00007 #ifndef __MYGUI_I_LAYER_NODE_H__
00008 #define __MYGUI_I_LAYER_NODE_H__
00009 
00010 #include "MyGUI_Prerequest.h"
00011 #include "MyGUI_Enumerator.h"
00012 #include "MyGUI_IObject.h"
00013 #include "MyGUI_IRenderTarget.h"
00014 
00015 namespace MyGUI
00016 {
00017 
00018     class ILayer;
00019     class ILayerItem;
00020     class ILayerNode;
00021 
00022     class RenderItem;
00023 
00024     typedef std::vector<ILayerNode*> VectorILayerNode;
00025     typedef Enumerator<VectorILayerNode> EnumeratorILayerNode;
00026 
00027     class MYGUI_EXPORT ILayerNode :
00028         public IObject
00029     {
00030         MYGUI_RTTI_DERIVED( ILayerNode )
00031 
00032     public:
00033         virtual ~ILayerNode() { }
00034 
00035         // леер, которому мы принадлежим
00036         virtual ILayer* getLayer() const = 0;
00037 
00038         // возвращает отца или nullptr
00039         virtual ILayerNode* getParent() const = 0;
00040 
00041         // создаем дочерний нод
00042         virtual ILayerNode* createChildItemNode() = 0;
00043         // удаляем дочерний нод
00044         virtual void destroyChildItemNode(ILayerNode* _node) = 0;
00045 
00046         // поднимаем дочерний нод
00047         virtual void upChildItemNode(ILayerNode* _node) = 0;
00048 
00049         // список детей
00050         virtual EnumeratorILayerNode getEnumerator() const = 0;
00051 
00052         virtual size_t getLayerNodeCount() const = 0;
00053 
00054         virtual ILayerNode* getLayerNodeAt(size_t _index) const = 0;
00055 
00056         // добавляем айтем к ноду
00057         virtual void attachLayerItem(ILayerItem* _item) = 0;
00058         // удаляем айтем из нода
00059         virtual void detachLayerItem(ILayerItem* _root) = 0;
00060 
00061         // добавляет саб айтем и возвращает рендер айтем
00062         virtual RenderItem* addToRenderItem(ITexture* _texture, bool _firstQueue, bool _separate) = 0;
00063         // необходимо обновление нода
00064         virtual void outOfDate(RenderItem* _item) = 0;
00065 
00066         // возвращает виджет по позиции
00067         virtual ILayerItem* getLayerItemByPoint(int _left, int _top) const = 0;
00068 
00069         // рисует леер
00070         virtual void renderToTarget(IRenderTarget* _target, bool _update) = 0;
00071 
00072         virtual void resizeView(const IntSize& _viewSize) = 0;
00073 
00074         virtual float getNodeDepth() = 0;
00075     };
00076 
00077 } // namespace MyGUI
00078 
00079 #endif // __MYGUI_I_LAYER_NODE_H__