You.i Engine
CYIAEViewTemplate Class Reference

Detailed Description

A specialized CYIViewTemplate providing data read from a layout file.

The class provides a variety of methods to instance and initialize CYIAEViewTemplate objects, and to retrieve information about the layout.

#include <import/YiAEViewTemplate.h>

Inheritance diagram for CYIAEViewTemplate:

Public Member Functions

 CYIAEViewTemplate (std::unique_ptr< CYIAEViewTemplatePriv > pPriv)
 
virtual ~CYIAEViewTemplate ()
 
virtual void SetTimelineSource (std::shared_ptr< CYIAssetTimelineSource > pTimelineSource) override
 
virtual std::shared_ptr< CYIAssetTimelineSourceGetTimelineSource () override
 
virtual std::unique_ptr< CYITimelineBuildTimeline (CYISceneNode *pRootNode) override
 
virtual std::unique_ptr< CYITimelineBuildTimeline (CYISceneNode *pRootNode, const CYIString &rMarkerName) override
 
virtual std::unique_ptr< CYITimelineBuildTimeline (CYISceneNode *pRootNode, CYIMarkerData::ID id) override
 
virtual std::unique_ptr< CYITimelineBuildTimeline (CYISceneNode *pRootNode, int32_t startOffset, int32_t duration) override
 
virtual void GetSize (float &width, float &height) override
 
virtual float GetHeight () override
 
virtual float GetWidth () override
 
virtual float GetDefaultCameraDistance () override
 
virtual CYIString GetName () const override
 
virtual const CYIStringGetViewClassName () const override
 
virtual bool GetBackgroundColor (CYIColor *pColor) override
 
virtual CYIOptional< CYIStringViewGetProperty (CYIStringView propertyName) const override
 
virtual std::map< CYIString, CYIStringGetProperties () const override
 
virtual void ForEachProperty (const std::function< void(const CYIString &, const CYIString &)> &action) const override
 
virtual bool HasProperties () const override
 
virtual const std::vector< CYIString > & GetChildTemplateNames () override
 
virtual std::vector< SourceGetSources () const override
 
virtual size_t GetApproximateSize () const override
 
- Public Member Functions inherited from CYIViewTemplate
virtual ~CYIViewTemplate ()
 
std::unique_ptr< CYISceneViewBuildView (CYISceneManager *pSceneManager, const std::shared_ptr< CYIAssetViewTemplate > &pAssetViewTemplate)
 
- Public Member Functions inherited from IYIPropertiesSource
virtual ~IYIPropertiesSource ()=default
 
bool GetProperty (CYIStringView propertyName, CYIString *pValue) const
 

Static Public Member Functions

static std::unique_ptr< CYIAEViewTemplateImportCompositionTemplate (const CYIString &filename)
 
static std::unique_ptr< CYIAEViewTemplateImportCompositionTemplateFromPath (const CYIString &path)
 
static std::unique_ptr< CYIAEViewTemplateImportCompositionTemplateFromBytes (CYIStringView bytes)
 
static std::unique_ptr< CYIAEViewTemplateImportCompositionTemplateFromStream (std::istream &data)
 
- Static Public Member Functions inherited from CYIViewTemplate
static std::shared_ptr< CYIAssetViewTemplateGetViewTemplate (const CYIString &viewTemplateName)
 
static glm::vec2 GetViewTemplateSize (const CYIString &viewTemplateName)
 

Friends

class CYIAESceneFilter
 

Additional Inherited Members

- Protected Member Functions inherited from CYIViewTemplate
 CYIViewTemplate ()
 

Constructor & Destructor Documentation

◆ CYIAEViewTemplate()

CYIAEViewTemplate::CYIAEViewTemplate ( std::unique_ptr< CYIAEViewTemplatePriv >  pPriv)

◆ ~CYIAEViewTemplate()

virtual CYIAEViewTemplate::~CYIAEViewTemplate ( )
virtual

Member Function Documentation

◆ BuildTimeline() [1/4]

virtual std::unique_ptr<CYITimeline> CYIAEViewTemplate::BuildTimeline ( CYISceneNode pRootNode)
overridevirtual

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

Implements CYIViewTemplate.

◆ BuildTimeline() [2/4]

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

Returns a timeline referencing a portion of the 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

Implements CYIViewTemplate.

◆ BuildTimeline() [3/4]

virtual std::unique_ptr<CYITimeline> CYIAEViewTemplate::BuildTimeline ( CYISceneNode pRootNode,
CYIMarkerData::ID  id 
)
overridevirtual

Returns a timeline referencing a portion of the 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 id, as an alternative to marker names. If id is not valid for this associated timeline source, null is returned.

See also
CYIMarkerData

Implements CYIViewTemplate.

◆ BuildTimeline() [4/4]

virtual std::unique_ptr<CYITimeline> CYIAEViewTemplate::BuildTimeline ( CYISceneNode pRootNode,
int32_t  startOffset,
int32_t  duration 
)
overridevirtual

Returns a timeline referencing a portion of the 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 startOffset and has size duration. A non-null timeline will always be returned even if startOffset and duration are not valid for the timeline source.

Implements CYIViewTemplate.

◆ ForEachProperty()

virtual void CYIAEViewTemplate::ForEachProperty ( const std::function< void(const CYIString &, const CYIString &)> &  action) const
overridevirtual

Executes action for each property held by this object. Each property name and property value pair is passed to action.

Implements IYIPropertiesSource.

◆ GetApproximateSize()

virtual size_t CYIAEViewTemplate::GetApproximateSize ( ) const
overridevirtual

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

Implements CYIViewTemplate.

◆ GetBackgroundColor()

virtual bool CYIAEViewTemplate::GetBackgroundColor ( CYIColor pColor)
overridevirtual

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

Implements CYIViewTemplate.

◆ GetChildTemplateNames()

virtual const std::vector<CYIString>& CYIAEViewTemplate::GetChildTemplateNames ( )
overridevirtual

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.

Implements CYIViewTemplate.

◆ GetDefaultCameraDistance()

virtual float CYIAEViewTemplate::GetDefaultCameraDistance ( )
overridevirtual

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

Reimplemented from CYIViewTemplate.

◆ GetHeight()

virtual float CYIAEViewTemplate::GetHeight ( )
overridevirtual

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.

Implements CYIViewTemplate.

◆ GetName()

virtual CYIString CYIAEViewTemplate::GetName ( ) const
overridevirtual

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

Implements CYIViewTemplate.

◆ GetProperties()

virtual std::map<CYIString, CYIString> CYIAEViewTemplate::GetProperties ( ) const
overridevirtual

Returns the map of all available properties.

Implements IYIPropertiesSource.

◆ GetProperty()

virtual CYIOptional<CYIStringView> CYIAEViewTemplate::GetProperty ( CYIStringView  propertyName) const
overridevirtual

Returns the value of the property identified by propertyName, or an empty optional if the property does not exist.

Note
The returned string view may become invalid if new properties are subsequently added to (or removed from) the properties source.

Implements IYIPropertiesSource.

◆ GetSize()

virtual void CYIAEViewTemplate::GetSize ( float &  width,
float &  height 
)
overridevirtual

Returns the width and height of this view template, stored in width and height 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.

Implements CYIViewTemplate.

◆ GetSources()

virtual std::vector<Source> CYIAEViewTemplate::GetSources ( ) const
overridevirtual

Returns a list of the view template's sources.

Implements CYIViewTemplate.

◆ GetTimelineSource()

virtual std::shared_ptr<CYIAssetTimelineSource> CYIAEViewTemplate::GetTimelineSource ( )
overridevirtual

Returns the timeline source associated with this view template.

See also
SetTimelineSource

Implements CYIViewTemplate.

◆ GetViewClassName()

virtual const CYIString& CYIAEViewTemplate::GetViewClassName ( ) const
overridevirtual

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.

Implements CYIViewTemplate.

◆ GetWidth()

virtual float CYIAEViewTemplate::GetWidth ( )
overridevirtual

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.

Implements CYIViewTemplate.

◆ HasProperties()

virtual bool CYIAEViewTemplate::HasProperties ( ) const
overridevirtual

Returns true if this source contains at least one property.

Implements IYIPropertiesSource.

◆ ImportCompositionTemplate()

static std::unique_ptr<CYIAEViewTemplate> CYIAEViewTemplate::ImportCompositionTemplate ( const CYIString filename)
static

This method accepts a layout filename. It behaves in the same way as ImportCompositionTemplateFromPath(), but will expand filename to a fully qualified path automatically using the CYIAssetRootLocator.

◆ ImportCompositionTemplateFromBytes()

static std::unique_ptr<CYIAEViewTemplate> CYIAEViewTemplate::ImportCompositionTemplateFromBytes ( CYIStringView  bytes)
static

Loads a layout from the bytes bytes and returns a new CYIAEViewTemplate instance. Returns null if the layout cannot be loaded.

◆ ImportCompositionTemplateFromPath()

static std::unique_ptr<CYIAEViewTemplate> CYIAEViewTemplate::ImportCompositionTemplateFromPath ( const CYIString path)
static

Loads the specified layout file and returns a new CYIAEViewTemplate instance. The path must be fully qualified. Returns null if the layout cannot be found or loaded.

◆ ImportCompositionTemplateFromStream()

static std::unique_ptr<CYIAEViewTemplate> CYIAEViewTemplate::ImportCompositionTemplateFromStream ( std::istream &  data)
static
Deprecated:
This function is deprecated and may be removed in a future release. ImportCompositionTemplateFromBytes(CYIStringView) should be used instead.

Loads a layout from the stream data and returns a new CYIAEViewTemplate instance. Returns null if the layout cannot be loaded.

◆ SetTimelineSource()

virtual void CYIAEViewTemplate::SetTimelineSource ( std::shared_ptr< CYIAssetTimelineSource pTimelineSource)
overridevirtual

Associates pTimelineSource with this view template.

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

Implements CYIViewTemplate.

Friends And Related Function Documentation

◆ CYIAESceneFilter

friend class CYIAESceneFilter
friend

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