You.i Engine
CYIAssetViewTemplate Class Reference

Detailed Description

ViewTemplate asset. Wrapper around a CYIViewTemplate.

#include <asset/YiAssetViewTemplate.h>

Inheritance diagram for CYIAssetViewTemplate:

Public Member Functions

 CYIAssetViewTemplate ()
 
 CYIAssetViewTemplate (const CYIString &path, PathType pathType=PathType::Relative)
 
virtual ~CYIAssetViewTemplate ()
 
const std::shared_ptr< CYIViewTemplate > & GetTemplate ()
 
std::unique_ptr< CYISceneViewBuildView (CYISceneManager *pSceneManager)
 
- Public Member Functions inherited from CYIAsset
virtual ~CYIAsset ()
 
const CYIStringGetPath () const
 
CYIAssetLoadParamsGetLoadParameters () const
 
virtual std::pair< size_t, size_tGetApproximateSize () const
 
bool SetName (const CYIString &name)
 
const CYIStringGetName () const
 
bool Load ()
 
void Unload ()
 
bool IsLoaded () const
 
bool Equals (const std::shared_ptr< CYIAsset > &pAsset)
 
virtual bool Prepare ()
 

Protected Member Functions

virtual void OnUnload () override
 
void SetTemplate (const std::shared_ptr< CYIViewTemplate > &pViewTemplate)
 
- Protected Member Functions inherited from CYIAsset
 CYIAsset ()
 
ssize_t GetID () const
 
void SetPath (const CYIString &path, PathType pathType)
 
void SetApproximateSize (size_t size)
 
void SetLoaded (bool assetLoaded)
 
void SetLoadParameters (std::unique_ptr< CYIAssetLoadParams > pParams)
 
virtual void OnLoad ()
 

Friends

class CYIAssetDecoderTemplate
 

Additional Inherited Members

- Public Types inherited from CYIAsset
enum  PathType {
  PathType::Absolute = 0,
  PathType::Relative
}
 
- Static Protected Attributes inherited from CYIAsset
static ssize_t INVALID_ID
 

Constructor & Destructor Documentation

◆ CYIAssetViewTemplate() [1/2]

CYIAssetViewTemplate::CYIAssetViewTemplate ( )

◆ CYIAssetViewTemplate() [2/2]

CYIAssetViewTemplate::CYIAssetViewTemplate ( const CYIString path,
PathType  pathType = PathType::Relative 
)

◆ ~CYIAssetViewTemplate()

virtual CYIAssetViewTemplate::~CYIAssetViewTemplate ( )
virtual

Member Function Documentation

◆ BuildView()

std::unique_ptr<CYISceneView> CYIAssetViewTemplate::BuildView ( CYISceneManager pSceneManager)

Constructs a new view instance from the view template. Before a CYISceneView is ready to be used, the Init() method must also be called.

Consider the following example to construct and initialize a CYISceneView:

std::shared_ptr<CYIAssetViewTemplate> pAssetViewTemplate = CYIViewTemplate::GetViewTemplate("CustomViews_CustomButton");
pSceneView = pAssetViewTemplate->BuildView(m_pSceneManager);
pSceneView->Init();

The caller is responsible for destroying the view.

◆ GetTemplate()

const std::shared_ptr<CYIViewTemplate>& CYIAssetViewTemplate::GetTemplate ( )

Returns the view template object. The template will be reloaded if necessary.

◆ OnUnload()

virtual void CYIAssetViewTemplate::OnUnload ( )
overrideprotectedvirtual

Reimplemented from CYIAsset.

◆ SetTemplate()

void CYIAssetViewTemplate::SetTemplate ( const std::shared_ptr< CYIViewTemplate > &  pViewTemplate)
protected

Friends And Related Function Documentation

◆ CYIAssetDecoderTemplate

friend class CYIAssetDecoderTemplate
friend

The documentation for this class was generated from the following file: