You.i Engine
CYIViewTemplate Class Referenceabstract

Detailed Description

A view template defines information about a view, so it can be built automatically.

This class defines an interface for view construction information.

See also
CYIAEViewTemplate

#include <import/YiViewTemplate.h>

Inheritance diagram for CYIViewTemplate:

Classes

class  Source
 Defines information about the sources a view template may have. More...
 

Public Member Functions

virtual ~CYIViewTemplate ()
 
std::unique_ptr< CYISceneViewBuildView (CYISceneManager *pSceneManager, const std::shared_ptr< CYIAssetViewTemplate > &pAssetViewTemplate)
 
virtual void SetTimelineSource (uint32_t uTimelineHandle, std::shared_ptr< CYIAssetTimelineSource > pTimelineSource)=0
 
virtual std::shared_ptr< CYIAssetTimelineSourceGetTimelineSource (uint32_t uTimelineHandle)=0
 
virtual std::unique_ptr< CYITimelineBuildTimeline (CYISceneNode *pRootNode)=0
 
virtual std::unique_ptr< CYITimelineBuildTimeline (CYISceneNode *pRootNode, const CYIString &markerName)=0
 
virtual std::unique_ptr< CYITimelineBuildTimeline (CYISceneNode *pRootNode, CYIMarkerData::MARKER_ID eID)=0
 
virtual std::unique_ptr< CYITimelineBuildTimeline (CYISceneNode *pRootNode, int32_t nStartOffset, int32_t nDuration)=0
 
virtual std::unique_ptr< CYITimelineBuildTimeline (CYISceneNode *pRootNode, uint32_t uTimelineHandle)=0
 
virtual std::unique_ptr< CYITimelineBuildTimeline (CYISceneNode *pRootNode, uint32_t uTimelineHandle, const CYIString &markerName)=0
 
virtual std::unique_ptr< CYITimelineBuildTimeline (CYISceneNode *pRootNode, uint32_t uTimelineHandle, CYIMarkerData::MARKER_ID eID)=0
 
virtual std::unique_ptr< CYITimelineBuildTimeline (CYISceneNode *pRootNode, uint32_t uTimelineHandle, int32_t nStartOffset, int32_t nDuration)=0
 
virtual void GetSize (float &fWidth, float &fHeight)=0
 
virtual float GetHeight ()=0
 
virtual float GetWidth ()=0
 
virtual float GetDefaultCameraDistance ()
 
virtual CYIString GetName () const =0
 
virtual const CYIStringGetViewClassName () const =0
 
virtual bool GetBackgroundColor (CYIColor *pColor)=0
 
virtual bool GetProperty (const CYIString &propertyName, CYIString *pValue) const override=0
 
virtual const std::map< CYIString, CYIString > & GetProperties () const override=0
 
virtual const std::vector< CYIString > & GetChildTemplateNames ()=0
 
virtual int32_t GetApproximateSize () const =0
 
virtual std::vector< SourceGetSources () const =0
 
- Public Member Functions inherited from IYIPropertiesSource
virtual ~IYIPropertiesSource ()
 
- Public Member Functions inherited from CYIScriptableRTTIObject
 CYIScriptableRTTIObject ()
 
virtual ~CYIScriptableRTTIObject ()
 
virtual const CYIRuntimeTypeInfoGetRuntimeTypeInfoForScriptObject () const override
 
- Public Member Functions inherited from CYIScriptableObject
 CYIScriptableObject ()
 
 CYIScriptableObject (const CYIScriptableObject &other)
 
CYIScriptableObjectoperator= (const CYIScriptableObject &other)
 
virtual ~CYIScriptableObject ()
 
CYIBindingImplementationGetBindingImplementation () const
 
void SetBindingImplementation (CYIBindingImplementation *pBindingImplementation)
 

Static Public Member Functions

static std::shared_ptr< CYIAssetViewTemplateGetViewTemplate (const CYIString &viewTemplateName)
 
static glm::vec2 GetViewTemplateSize (const CYIString &viewTemplateName)
 

Static Public Attributes

static const uint32_t DEFAULT_TIMELINE_INDEX
 

Protected Member Functions

 CYIViewTemplate ()
 
- Protected Member Functions inherited from CYIScriptableRTTIObject
virtual std::pair< const CYIRuntimeTypeInfo *, const void * > GetRuntimeTypeInfoWithObject () const =0
 

Friends

class CYISceneView
 

Constructor & Destructor Documentation

virtual CYIViewTemplate::~CYIViewTemplate ( )
inlinevirtual
CYIViewTemplate::CYIViewTemplate ( )
inlineprotected

Member Function Documentation

virtual std::unique_ptr<CYITimeline> CYIViewTemplate::BuildTimeline ( CYISceneNode pRootNode)
pure virtual

Returns a timeline referencing the entire duration of the default timeline source associated with this template. The timeline's tracks will be associated with the tree rooted at pRootNode.

Implemented in CYIAEViewTemplate.

virtual std::unique_ptr<CYITimeline> CYIViewTemplate::BuildTimeline ( CYISceneNode pRootNode,
const CYIString markerName 
)
pure virtual

Returns a timeline referencing a portion of the default timeline source associated with this template. The timeline's tracks will be associated with the tree rooted at pRootNode.

The portion to be returned is named by markerName. If markerName is not valid for this associated timeline source, null is returned.

See also
CYIMarkerData

Implemented in CYIAEViewTemplate.

virtual std::unique_ptr<CYITimeline> CYIViewTemplate::BuildTimeline ( CYISceneNode pRootNode,
CYIMarkerData::MARKER_ID  eID 
)
pure virtual

Returns a timeline referencing a portion of the default timeline source associated with this template. The timeline's tracks will be associated with the tree rooted at pRootNode.

The portion to be returned is specified by eID, as an alternative to marker names. If eID is not valid for this associated timeline source, null is returned.

See also
CYIMarkerData

Implemented in CYIAEViewTemplate.

virtual std::unique_ptr<CYITimeline> CYIViewTemplate::BuildTimeline ( CYISceneNode pRootNode,
int32_t  nStartOffset,
int32_t  nDuration 
)
pure virtual

Returns a timeline referencing a portion of the default timeline source associated with this template. The timeline's tracks will be associated with the tree rooted at pRootNode.

The portion to be returned starts at nStartOffset and has size nDuration. A non-null timeline will always be returned even if nStartOffset and nDuration are not valid for the timeline source.

Implemented in CYIAEViewTemplate.

virtual std::unique_ptr<CYITimeline> CYIViewTemplate::BuildTimeline ( CYISceneNode pRootNode,
uint32_t  uTimelineHandle 
)
pure virtual

Returns a timeline referencing the entire duration of the timeline source with index uTimelineHandle. The timeline's tracks will be associated with the tree rooted at pRootNode.

Implemented in CYIAEViewTemplate.

virtual std::unique_ptr<CYITimeline> CYIViewTemplate::BuildTimeline ( CYISceneNode pRootNode,
uint32_t  uTimelineHandle,
const CYIString markerName 
)
pure virtual

Returns a timeline referencing a portion of the timeline source with index uTimelineHandle. The timeline's tracks will be associated with the tree rooted at pRootNode.

The portion to be returned is named by markerName. If markerName is not valid for this associated timeline source, null is returned.

See also
CYIMarkerData

Implemented in CYIAEViewTemplate.

virtual std::unique_ptr<CYITimeline> CYIViewTemplate::BuildTimeline ( CYISceneNode pRootNode,
uint32_t  uTimelineHandle,
CYIMarkerData::MARKER_ID  eID 
)
pure virtual

Returns a timeline referencing a portion of the timeline source with index uTimelineHandle. The timeline's tracks will be associated with the tree rooted at pRootNode.

The portion to be returned is specified by eID, as an alternative to marker names. If eID is not valid for this associated timeline source, null is returned.

See also
CYIMarkerData

Implemented in CYIAEViewTemplate.

virtual std::unique_ptr<CYITimeline> CYIViewTemplate::BuildTimeline ( CYISceneNode pRootNode,
uint32_t  uTimelineHandle,
int32_t  nStartOffset,
int32_t  nDuration 
)
pure virtual

Returns a timeline referencing a portion of the timeline source with index uTimelineHandle. The timeline's tracks will be associated with the tree rooted at pRootNode.

The portion to be returned starts at nStartOffset and has size nDuration. A non-null timeline will always be returned even if nStartOffset and nDuration are not valid for the timeline source.

Implemented in CYIAEViewTemplate.

std::unique_ptr<CYISceneView> CYIViewTemplate::BuildView ( CYISceneManager pSceneManager,
const std::shared_ptr< CYIAssetViewTemplate > &  pAssetViewTemplate 
)

Constructs a view instance from pAssetViewTemplate.

Note
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");
std::shared_ptr<CYIViewTemplate> pViewTemplate = pAssetViewTemplate->GetTemplate();
pSceneView = pViewTemplate->BuildView(m_pSceneManager, pAssetViewTemplate);
pSceneView->Init();

The caller is responsible for destroying the view.

virtual int32_t CYIViewTemplate::GetApproximateSize ( ) const
pure virtual

Returns the approximate size of this class, which has use in implementing asset caching strategies.

Implemented in CYIAEViewTemplate.

virtual bool CYIViewTemplate::GetBackgroundColor ( CYIColor pColor)
pure virtual

Stores the background color of this template into pColor. Return false if this template does not have a background color.

Implemented in CYIAEViewTemplate.

virtual const std::vector<CYIString>& CYIViewTemplate::GetChildTemplateNames ( )
pure virtual

Returns a unique list of names of view templates references by this view template. Names are in the form <AEPFile_<CompName>.

Note that view templates may have multiple references to the same template, but each name will only show up once in this list.

Implemented in CYIAEViewTemplate.

virtual float CYIViewTemplate::GetDefaultCameraDistance ( )
virtual

The distance from which the view template was designed to be viewed.

Reimplemented in CYIAEViewTemplate.

virtual float CYIViewTemplate::GetHeight ( )
pure virtual

Returns the height of this view template.

The height of the template will be the height of the view created from the template. The height of the view is expressed in local space of the created view.

Implemented in CYIAEViewTemplate.

virtual CYIString CYIViewTemplate::GetName ( ) const
pure virtual

Returns the name of this template, corresponding to the AE comp name.

Implemented in CYIAEViewTemplate.

virtual const std::map<CYIString, CYIString>& CYIViewTemplate::GetProperties ( ) const
overridepure virtual

Returns the map of all available properties.

Implements IYIPropertiesSource.

Implemented in CYIAEViewTemplate.

virtual bool CYIViewTemplate::GetProperty ( const CYIString propertyName,
CYIString pValue 
) const
overridepure virtual

Stores the value of a property specified by propertyName into pValue. Returns false if the property cannot be found.

Implements IYIPropertiesSource.

Implemented in CYIAEViewTemplate.

virtual void CYIViewTemplate::GetSize ( float &  fWidth,
float &  fHeight 
)
pure virtual

Returns the width and height of this view template, stored in fWidth and fHeight respectively.

The size of the template will be the size of the view created from the template. The size of the view is expressed in local space of the created view.

Implemented in CYIAEViewTemplate.

virtual std::vector<Source> CYIViewTemplate::GetSources ( ) const
pure virtual

Returns a list of the view template's sources.

Implemented in CYIAEViewTemplate.

virtual std::shared_ptr<CYIAssetTimelineSource> CYIViewTemplate::GetTimelineSource ( uint32_t  uTimelineHandle)
pure virtual

Returns the timeline source associated with this view template at index uTimelineHandle.

See also
SetTimelineSource

Implemented in CYIAEViewTemplate.

virtual const CYIString& CYIViewTemplate::GetViewClassName ( ) const
pure virtual

Returns the name of the view class that should be instansiated when constructing a view with this template. An empty string can also be returned, implying the default view class.

Implemented in CYIAEViewTemplate.

static std::shared_ptr<CYIAssetViewTemplate> CYIViewTemplate::GetViewTemplate ( const CYIString viewTemplateName)
static

Returns a view template named viewTemplateName. If the view template was never loaded, it will be loaded automatically and added to the asset manager.

If the view template could not be found or could not be loaded, this function returns null.

Note
Template name format is <AEPFile>_<CompName> - not to be confused with the filename of the asset which includes the .layout extension.
static glm::vec2 CYIViewTemplate::GetViewTemplateSize ( const CYIString viewTemplateName)
static

Returns the size of a view template with name viewTemplateName. This uses GetViewTemplate internally, so if you already have a view template it would be better to query its size directly.

If the view template could not be found, size (0,0) is returned.

The size of the template will be the size of the view created from the template. The size of the view is expressed in local space of the created view.

See also
GetViewTemplate
virtual float CYIViewTemplate::GetWidth ( )
pure virtual

Returns the width of this view template.

The width of the template will be the width of the view created from the template. The width of the view is expressed in local space of the created view.

Implemented in CYIAEViewTemplate.

virtual void CYIViewTemplate::SetTimelineSource ( uint32_t  uTimelineHandle,
std::shared_ptr< CYIAssetTimelineSource pTimelineSource 
)
pure virtual

Associates pTimelineSource with this view template at index uTimelineHandle.

The timeline asset specifies how nodes generated by this view template will be animated.

Implemented in CYIAEViewTemplate.

Friends And Related Function Documentation

friend class CYISceneView
friend

Member Data Documentation

const uint32_t CYIViewTemplate::DEFAULT_TIMELINE_INDEX
static

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