You.i Engine
YiNodeAdapter.h
Go to the documentation of this file.
1 // © You i Labs Inc. All rights reserved.
2 #ifndef _YI_NODE_ADAPTER_H_
3 #define _YI_NODE_ADAPTER_H_
4 
5 #include "signal/YiSignal.h"
6 #include "utility/YiRtti.h"
7 
8 #include <glm/fwd.hpp>
9 
10 #include <map>
11 
12 class CYISceneManager;
13 class CYISceneNode;
15 
33 {
34 public:
36  virtual ~CYINodeAdapter();
37 
44  virtual size_t GetItemsCount() const = 0;
45 
49  virtual glm::vec3 GetInitialNodeSize(size_t index) const = 0;
50 
61  virtual void ConfigureProperties(size_t index, CYISceneNode *pNode) const;
62 
71  IYIPropertiesSource *GetProperties(const CYIString &viewTemplateName) const;
72 
82  void SetProperties(const std::map<CYIString, IYIPropertiesSource *> &properties);
83 
89  virtual std::unique_ptr<CYISceneNode> BuildNode(size_t index, CYISceneManager *pSceneManager) = 0;
90 
98  virtual void ReleaseNode(size_t index, std::unique_ptr<CYISceneNode> pNode) = 0;
99 
105  CYISignal<size_t /* index */> ItemAddedAtIndex;
106 
110  CYISignal<size_t /* index */> ItemRemovedAtIndex;
111 
117  CYISignal<size_t /* fromIndex */, size_t /* toIndex */> ItemMoved;
118 
119 private:
120  std::map<CYIString, IYIPropertiesSource *> m_properties;
121 
123 };
124 
129 #endif // _YI_NODE_ADAPTER_H_
virtual size_t GetItemsCount() const =0
virtual std::unique_ptr< CYISceneNode > BuildNode(size_t index, CYISceneManager *pSceneManager)=0
Scene trees composed of CYISceneNode objects are registered with the scene manager in order for them ...
Definition: YiSceneManager.h:82
Container class for Unicode strings. Conceptually, a CYIString object is a sequence of Unicode charac...
Definition: YiString.h:32
Provides an interface for supplying and reclaiming nodes to and from CYIStreamer. ...
Definition: YiNodeAdapter.h:32
virtual void ReleaseNode(size_t index, std::unique_ptr< CYISceneNode > pNode)=0
A scene node is the base type for all nodes which are used by the scene manager; it is an integral pa...
Definition: YiSceneNode.h:105
CYISignal< size_t, size_t > ItemMoved
Definition: YiNodeAdapter.h:117
virtual glm::vec3 GetInitialNodeSize(size_t index) const =0
void SetProperties(const std::map< CYIString, IYIPropertiesSource *> &properties)
An interface to a class that provides key-value properties.
Definition: YiPropertiesSource.h:21
CYISignal< size_t > ItemRemovedAtIndex
Definition: YiNodeAdapter.h:110
#define YI_TYPE_BASES(CLASS, BASES...)
Definition: YiRtti.h:259
CYISignal< size_t > ItemAddedAtIndex
Definition: YiNodeAdapter.h:105
This file contains the classes and macros used to implement RTTI in You.i Engine. ...
IYIPropertiesSource * GetProperties(const CYIString &viewTemplateName) const
Signals and slots are a thread-safe and flexible communication framework that will allow various obje...
Definition: YiSignal.h:169
virtual void ConfigureProperties(size_t index, CYISceneNode *pNode) const
virtual ~CYINodeAdapter()