You.i Engine
YiViewAdapter.h
Go to the documentation of this file.
1 #ifndef _YI_VIEW_ADAPTER_H_
2 #define _YI_VIEW_ADAPTER_H_
3 
5 
7 class CYISceneView;
8 class IYIViewRecycler;
9 
24 {
25 public:
29  CYIViewAdapter(const std::shared_ptr<IYIViewRecycler> &pViewRecycler = std::shared_ptr<IYIViewRecycler>());
30  virtual ~CYIViewAdapter();
31 
32  virtual size_t GetItemsCount() const override = 0;
33 
40  virtual glm::vec3 GetInitialNodeSize(size_t index) const override;
41 
53  virtual void ConfigureProperties(size_t index, CYISceneNode *pNode) const override;
54 
55  virtual std::unique_ptr<CYISceneNode> BuildNode(size_t index, CYISceneManager *pSceneManager) final override;
56 
57  virtual void ReleaseNode(size_t index, std::unique_ptr<CYISceneNode> pNode) final override;
58 
62  virtual std::shared_ptr<CYIAssetViewTemplate> GetViewTemplate(size_t index) const = 0;
63 
70  virtual const CYIRuntimeTypeInfo *GetViewClass(size_t index) const;
71 
72 protected:
76  virtual void PopulateView(size_t index, CYISceneView *pView) = 0;
77 
86  virtual void OnReleaseView(size_t index, CYISceneView *pView);
87 
88 private:
89  std::shared_ptr<IYIViewRecycler> m_pViewRecycler;
90 
92 };
93 
98 #endif
Scene trees composed of CYISceneNode objects are registered with the scene manager in order for them ...
Definition: YiSceneManager.h:82
The base class for all view types. Views are containers of renderable elements that often define inte...
Definition: YiSceneView.h:47
virtual std::shared_ptr< CYIAssetViewTemplate > GetViewTemplate(size_t index) const =0
virtual std::unique_ptr< CYISceneNode > BuildNode(size_t index, CYISceneManager *pSceneManager) final override
A simplified CYINodeAdapter interface for automatically building views using provided view templates...
Definition: YiViewAdapter.h:23
virtual void ConfigureProperties(size_t index, CYISceneNode *pNode) const override
Provides an interface for supplying and reclaiming nodes to and from CYIStreamer. ...
Definition: YiNodeAdapter.h:32
virtual glm::vec3 GetInitialNodeSize(size_t index) const override
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
virtual void ReleaseNode(size_t index, std::unique_ptr< CYISceneNode > pNode) final override
ViewTemplate asset. Wrapper around a CYIViewTemplate.
Definition: YiAssetViewTemplate.h:21
The abstract runtime representation of a C++ type.
Definition: YiRtti.h:58
CYIViewAdapter(const std::shared_ptr< IYIViewRecycler > &pViewRecycler=std::shared_ptr< IYIViewRecycler >())
virtual size_t GetItemsCount() const override=0
Definition: YiViewRecycler.h:24
#define YI_TYPE_BASES(CLASS, BASES...)
Definition: YiRtti.h:259
virtual ~CYIViewAdapter()
virtual const CYIRuntimeTypeInfo * GetViewClass(size_t index) const
virtual void PopulateView(size_t index, CYISceneView *pView)=0
virtual void OnReleaseView(size_t index, CYISceneView *pView)