You.i Engine
CYISceneView Class Reference

Detailed Description

The base class for all view types. Views are containers of renderable elements that often define interaction behaviours through APIs and user-driven events.

Extends the CYISceneNode to add layouts, focus, and timelines. Subclasses of CYISceneView differentiate themselves by defining behaviours or interaction models. Views usually contain timelines which animate the properties of their children, the view will play these timelines as part of its visual presentation. Focus may enter or leave a view, or the view may explicitly receive focus, in response to the user-driven navigation events: CYIKeyEvent::ArrowUp, CYIKeyEvent::ArrowDown, CYIKeyEvent::ArrowLeft, CYIKeyEvent::ArrowRight, or CYIKeyEvent::Tab. A CYISceneView may have a CYILayout added to it in order to dictate how its children will move and resize in response to the view changing position and size.

View Template Specification

Type Labels Property Description
Marker FocusIn Optional The animation played when a view receives focus.
Marker FocusOut Optional The animation played when a view loses focus. If not defined, the reverse of FocusIn is used.
Marker In Optional Multi-purpose: 1) the animation played when a view is a list item that is inserted in the list. 2) the animation played when a view is part of a CYIStackView, and the view is brought to front.
Marker Out Optional Multi-purpose: 1) the animation played when a view is a list item that is removed from the list. 2) the animation played when a view is part of a CYIStackView, and the view is removed from the front.
Comment clip Optional If present and set to 'true', the view will be clipped to its size.
Marker Comment recursive Optional If present and set to 'true' on a marker, indicates that timelines created from this marker should be recursive. Such timelines are timeline groups that contains all other timelines of the same name. Defaults to 'false'.
Marker Comment stop-recursion Optional If present and set to 'true' on a marker, indicates that timeline groups of parent views should not include this view's timelines. Defaults to 'false'.
Marker Comment loop Optional If present and set to 'true' on a marker, indicates that timelines created from this marker should infinitely loop when played. Timeline groups may loop, but the loop option will be ignored on child timelines within a timeline group. Defaults to 'false'.
Marker Comment tracks Optional If present, this marker indicates how timelines should be created for a given marker. Can be 'keyframes', which indicates that only tracks with keyframes are used, or 'all', which indicates that all tracks should be used. Defaults to 'keyframes'.

#include <view/YiSceneView.h>

Inheritance diagram for CYISceneView:

Classes

struct  AssetRequirement
 
struct  YI_ANCHOR_DATA
 Anchors are used to apply scaling rules. More...
 

Public Types

enum  TimelineGetMode {
  TimelineGetMode::GetDefault,
  TimelineGetMode::GetTimeline,
  TimelineGetMode::GetTimelineGroup,
  TimelineGetMode::GetComponentOfTimelineGroup
}
 
enum  InitialFocusLifetime {
  InitialFocusLifetime::Persistent,
  InitialFocusLifetime::ClearOnEntry
}
 
- Public Types inherited from CYISceneNode
enum  LayoutDirtyFlag : uint8_t {
  LayoutDirtyFlag::Clean,
  LayoutDirtyFlag::ChildDirty,
  LayoutDirtyFlag::Dirty
}
 
enum  LayoutConfigFetchMode {
  LayoutConfigFetchMode::DoNotLazyInstantiate = 0,
  LayoutConfigFetchMode::LazyInstantiate
}
 
enum  MeasureMode {
  MeasureMode::Unspecified,
  MeasureMode::UpTo,
  MeasureMode::Exactly
}
 
enum  FetchType {
  FetchType::Optional = 0,
  FetchType::Mandatory
}
 
typedef std::reverse_iterator< IteratorReverseIterator
 
typedef uint16_t DirtyFlag
 
- Public Types inherited from CYIEventTarget
enum  SpecialEventTargetType : uint8_t {
  SpecialEventTargetType::None = 0x00,
  SpecialEventTargetType::NoPick = 0x20
}
 
enum  Phase : uint8_t {
  Phase::Bubble,
  Phase::Capture
}
 

Public Member Functions

 CYISceneView ()
 
virtual ~CYISceneView ()
 
bool BuildFromTemplate (CYISceneManager *pSceneManager, const std::shared_ptr< CYIAssetViewTemplate > &pAssetViewTemplate, CYISceneManager::MissingClassHandlingMode missingHandlingMode=CYISceneManager::MissingClassHandlingMode::Abort)
 
virtual bool Init () override
 
bool IsInitialized () const
 
void SetClippingAreaNode (CYISceneNode *pClippingNode)
 
virtual CYIOptional< CYIStringViewGetProperty (CYIStringView propertyName) const override
 
bool GetProperty (CYIStringView propertyName, CYIString *pValue) const
 
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
 
void EnableDefaultHitZone ()
 
bool IsResponsiveLayoutEnabled () const
 
void EnableResponsiveLayout ()
 
void DisableResponsiveLayout ()
 
void AddAnchor (EYIAnchorType anchorType)
 
YI_ANCHOR_DATA GetAnchor (EYIAnchorType anchorType) const
 
virtual const CYISceneView::AssetRequirementGetAssetRequirements (uint32_t *pRequirementCount)
 
CYIAbstractTimelineGetInTimeline () const
 
CYIAbstractTimelineGetOutTimeline () const
 
CYIAbstractTimelineGetFocusInTimeline () const
 
CYIAbstractTimelineGetFocusOutTimeline () const
 
virtual bool HandlesFocusInDescendants () const
 
virtual bool RequestFocus (CYIFocus::Direction direction=CYIFocus::Direction::Forward, CYIFocus::FocusRootRule focusRootRule=CYIFocus::FocusRootRule::DescendantsUpdateContext, const CYIAABB &previousFocusRect=CYIAABB(), const CYIFocusSearchOptions &options=CYIFocusSearchOptions())
 
bool HasFocus () const
 
void SetFocusable (bool focusable)
 
bool IsFocusable () const
 
bool CanBeFocused () const
 
void SetNextFocus (CYISceneView *pView, CYIFocus::Direction direction)
 
CYISceneViewGetNextFocus (CYIFocus::Direction direction) const
 
virtual void SetInitiallyFocusedView (CYISceneView *pView, InitialFocusLifetime initialFocusLifetime=InitialFocusLifetime::Persistent)
 
CYISceneViewGetInitiallyFocusedView () const
 
CYISceneView::InitialFocusLifetime GetInitialFocusLifetime () const
 
CYISceneViewFindNextFocus (CYIFocus::Direction direction, const CYIFocusSearchOptions &options=CYIFocusSearchOptions()) const
 
CYISceneViewFindNextFocus (CYIFocus::Direction direction, CYIAABB &screenSpaceFocusRegion, const CYIFocusSearchOptions &options=CYIFocusSearchOptions()) const
 
virtual CYISceneViewFindNextFocusInDescendants (const CYISceneView *pCurrentFocusView, CYIFocus::Direction direction, CYIAABB &screenSpaceFocusRegion, const CYIFocusSearchOptions &options=CYIFocusSearchOptions()) const
 
const CYISceneNodeGetFocusRoot () const
 
CYISceneViewGetFocusHandler () const
 
virtual void OnFocusGained ()
 
virtual void FocusGained ()
 
virtual void OnFocusLost ()
 
virtual void FocusLost ()
 
virtual void FocusGainedInDescendants (CYISceneNode *pNewNodeWithFocus, CYISceneNode *pPreviousNodeWithFocus) override
 
virtual bool ContainsFocusableDescendant (const CYIFocusSearchOptions &options=CYIFocusSearchOptions()) const override
 
const std::shared_ptr< CYIAssetViewTemplate > & GetViewTemplate () const
 
const std::vector< CYIString > & GetChildTemplateNames ()
 
template<typename T >
T * BuildTimeline (const CYIString &markerName)
 
CYITimelineBuildTimeline (const CYIString &markerName, int32_t startOffset, int32_t duration)
 
CYIAbstractTimelineGetTimeline (CYIMarkerData::ID id)
 
virtual CYIAbstractTimelineGetTimeline (CYIStringView markerName, TimelineGetMode mode=TimelineGetMode::GetDefault)
 
std::map< CYIString, CYITimeline * > GetSimpleTimelines () const
 
std::map< CYIString, CYIAbstractTimeline * > GetTimelines () const
 
bool FindTimeline (CYIAbstractTimeline *&pTimeline, CYIStringView markerName, FetchType type, const CYIString &tag="", TimelineGetMode mode=TimelineGetMode::GetDefault)
 
CYITimelineGroupGetTimelineGroup (CYIStringView markerName)
 
void BuildAnchorList ()
 
virtual void Reset ()
 
void SetLayout (std::unique_ptr< CYILayout > pLayout)
 
const CYILayoutGetLayout () const
 
CYILayoutGetLayout ()
 
virtual void Measure (const MeasureSpec &widthSpec, const MeasureSpec &heightSpec, const MeasureSpec &depthSpec) override
 
virtual void ApplyMeasurements () override
 
- Public Member Functions inherited from CYISceneNode
 CYISceneNode ()
 
virtual ~CYISceneNode ()
 
bool IsInitialized () const
 
void ForceDirty ()
 
void SetDirtyFlag (DirtyFlag dirtyFlag)
 
DirtyFlag GetDirtyFlag () const
 
DirtyFlag GetPreviousDirtyFlag () const
 
const CYIStringGetName () const
 
CYIString GetUniqueName () const
 
void SetSceneManager (CYISceneManager *pSceneManager)
 
void SetName (const CYIString &name)
 
int32_t GetID () const
 
void SetID (int32_t id)
 
uint64_t GetUniqueID () const
 
bool AddChild (std::unique_ptr< CYISceneNode > pSceneNode)
 
bool AddChild (std::unique_ptr< CYISceneNode >, size_t index)
 
bool InsertChildAfter (CYISceneNode *pRefNode, std::unique_ptr< CYISceneNode > pSceneNode)
 
std::unique_ptr< CYISceneNodeRemoveChild (CYISceneNode *pSceneNode)
 
bool ReorderChild (size_t fromIndex, size_t toIndex)
 
CYITransformGetTransform ()
 
CYISceneNodeGetParent () const
 
bool ChangeParent (CYISceneNode *pParent)
 
CYISceneNodeGetDrawParent () const
 
bool IsAncestorOf (const CYISceneNode *pNode) const
 
CYISceneManagerGetSceneManager () const
 
size_t GetChildCount () const
 
uint32_t GetChildCountRecursive () const
 
CYISceneNodeGetChild (size_t index) const
 
Iterator begin (Iterator::Mode mode=Iterator::Mode::ImmediateChildren) const
 
Iterator end (Iterator::Mode mode=Iterator::Mode::ImmediateChildren) const
 
ReverseIterator rbegin (Iterator::Mode mode=Iterator::Mode::ImmediateChildren) const
 
ReverseIterator rend (Iterator::Mode mode=Iterator::Mode::ImmediateChildren) const
 
CYISceneNodeGetChild (const CYIString &name) const
 
size_t GetDrawChildCount () const
 
CYISceneNodeGetDrawChild (size_t index) const
 
CYISceneNodeGetDrawChildByID (int32_t id) const
 
template<class YI_SCENE_NODE_SUBCLASS >
YI_SCENE_NODE_SUBCLASS * GetChild (uint32_t targetMatchedNodeCount=1) const
 
template<class YI_SCENE_NODE_SUBCLASS >
std::list< YI_SCENE_NODE_SUBCLASS * > GetChildren () const
 
template<class YI_SCENE_NODE_SUBCLASS >
std::list< YI_SCENE_NODE_SUBCLASS * > GetDrawChildren () const
 
size_t GetIndexOfChild (const CYISceneNode *pSceneNode) const
 
size_t GetIndexOfDrawChild (const CYISceneNode *pSceneNode) const
 
void Show ()
 
void Hide ()
 
void SetVisibility (bool visible)
 
void SetOpacity (float opacity)
 
float GetCompositeOpacity () const
 
float GetLocalOpacity () const
 
bool IsVisible () const
 
bool IsTrulyVisible () const
 
bool IsPerceptible () const
 
CYISceneNodeGetNode (CYIStringView name)
 
CYISceneNodeGetNode (CYIStringView name, const CYIRuntimeTypeInfo &enforceClassType)
 
CYISceneNodeGetNode (const CYIRuntimeTypeInfo &enforceClassType)
 
CYISceneNodeGetNodeAfterTarget (const CYIRuntimeTypeInfo &enforceClassType, CYISceneNode *pStartAfterTarget)
 
template<class YI_SCENE_NODE_SUBCLASS >
YI_SCENE_NODE_SUBCLASS * GetNode (CYIStringView name)
 
CYISceneNodeGetNode (const int32_t id)
 
CYISceneNodeGetNode (const int32_t id, const CYIRuntimeTypeInfo &enforceClassType)
 
CYISceneNodeGetNodeWithUniqueID (uint64_t uniqueID)
 
template<class YI_SCENE_NODE_SUBCLASS >
bool FindNode (YI_SCENE_NODE_SUBCLASS *&pNode, CYIStringView nodeName, FetchType type, const CYIString &tag)
 
std::list< CYISceneNode * > GetNodes (CYIStringView name)
 
std::list< CYISceneNode * > GetNodes (int32_t id)
 
std::list< CYISceneNode * > GetNodes (const CYIRuntimeTypeInfo &enforceClassType)
 
template<class YI_SCENE_NODE_SUBCLASS >
const YI_SCENE_NODE_SUBCLASS * GetNode (uint32_t targetMatchedNodeCount=1) const
 
template<class YI_SCENE_NODE_SUBCLASS >
YI_SCENE_NODE_SUBCLASS * GetNode (uint32_t targetMatchedNodeCount=1)
 
void SetMesh (const std::shared_ptr< CYIMesh > &pMesh)
 
bool SetNPatchBitmap (const std::shared_ptr< CYIBitmap > &pNPatchBitmap)
 
void ClearNPatch ()
 
void SetMaterial (const std::shared_ptr< CYIMaterial > &pMaterial, size_t index=0)
 
void AddEffect (const std::shared_ptr< CYIEffect > &pEffect)
 
void RemoveEffect (const std::shared_ptr< CYIEffect > &pEffect)
 
size_t GetEffectCount () const
 
const std::shared_ptr< CYIEffect > & GetEffect (size_t index) const
 
void ConnectEffectsToTimelines (const CYITimelineTrack *pTrack)
 
void AddMask (std::unique_ptr< CYIMask > pMask)
 
std::unique_ptr< CYIMaskRemoveMask (const CYIMask *pMask)
 
size_t GetMaskCount () const
 
const CYIMaskGetMask (size_t index) const
 
CYIMaskGetMask (size_t index)
 
const std::shared_ptr< CYIMesh > & GetMesh () const
 
const std::shared_ptr< CYIBitmap > & GetNPatchBitmap () const
 
size_t GetMaterialCount () const
 
const std::shared_ptr< CYIMaterial > & GetMaterial (size_t index=0) const
 
const std::shared_ptr< IYIUniformBufferObject > & GetShaderUniforms () const
 
void SetMeshTransform (const glm::mat4 &transform)
 
void DestroyChildren ()
 
glm::mat4 GetLocalTransform () const
 
glm::mat4 GetWorldTransform () const
 
bool Intersects (const CYISceneNode *pNode) const
 
void SetRenderTarget (const std::shared_ptr< CYIRenderTarget > &pRenderTarget)
 
const std::shared_ptr< CYIRenderTarget > & GetRenderTarget () const
 
virtual void OnPreBuildDrawList (std::vector< IYIRenderer::Command > *pDrawList, std::vector< CYIAbstractCameraSceneNode *> *pDrawWithCameraList)
 
virtual void OnPostBuildDrawList (std::vector< IYIRenderer::Command > *pDrawList)
 
const CYIAABBGetWorldAABB () const
 
const CYIAABBGetLocalAABB () const
 
void SetAnchorPoint (const glm::vec3 &anchorPoint)
 
void SetAnchorPoint (float x, float y, float z)
 
void SetAnchorPointX (float x)
 
void SetAnchorPointY (float y)
 
void SetAnchorPointZ (float z)
 
void SetPosition (const glm::vec3 &position)
 
void SetPosition (float x, float y, float z)
 
void SetPositionX (float x)
 
void SetPositionY (float y)
 
void SetPositionZ (float z)
 
void SetRotation (const glm::vec3 &rotation)
 
void SetRotation (float pitchDegrees, float yawDegrees, float rollDegrees)
 
void SetRotationX (float pitchDegrees)
 
void SetRotationY (float yawDegrees)
 
void SetRotationZ (float rollDegrees)
 
void SetOrientation (float pitchDegrees, float yawDegrees, float rollDegrees)
 
void SetOrientation (const glm::quat &orientation)
 
void SetScale (const glm::vec3 &scale)
 
void SetScale (float factorX, float factorY, float factorZ)
 
void SetScaleX (float factor)
 
void SetScaleY (float factor)
 
void SetScaleZ (float factor)
 
const glm::vec3 & GetPosition () const
 
const glm::vec3 & GetScale () const
 
const glm::vec3 & GetWorldScale () const
 
const glm::vec3 & GetWorldSurfaceScale () const
 
const glm::vec3 & GetRotation () const
 
const glm::quat & GetOrientation () const
 
const glm::vec3 & GetAnchorPoint () const
 
virtual void SetSize (const glm::vec3 &size, bool dirtyLayout=true)
 
const glm::vec3 & GetSize () const
 
const glm::vec3 & GetInitialSize () const
 
void SetMeasuredSize (const glm::vec3 &measuredSize)
 
const glm::vec3 & GetMeasuredSize () const
 
void SetInternalCustomTimelineValue (uint32_t trackID, const CYIVariant &value)
 
virtual void SetCustomTimelineValue (uint32_t trackID, const CYIVariant &value)
 
void SetClippingOn ()
 
void SetClippingOff ()
 
bool GetClipping () const
 
void SetClippingBox (const CYIAABB &worldBox)
 
const CYIAABBGetClippingBox () const
 
void StartPropertyAnimation (PropertyAnimation::Type propType, float from, float to, uint32_t durMs, CYITimeInterpolator *pTimeInterpolator=nullptr, bool dirtyLayout=true)
 
void StopPropertyAnimation (PropertyAnimation::Type propType)
 
void UpdateLocalSpaceCollision (CYIActionEvent *pActionEvent)
 
virtual bool BroadcastEvent (const std::shared_ptr< CYIEventDispatcher > &pDispatcher, CYIEvent *pEvent)
 
void UpdateEventForLocalSpace (CYIActionEvent *pActionEvent, glm::vec3 &rayOrigin, glm::vec3 &rayNonOriginPoint) const
 
bool IsBoundingBoxHit (const CYIRay &worldSpaceRay) const
 
bool IsMeshHit (const CYIRay &worldSpaceRay) const
 
void DumpTree () const
 
void StartCaptureKeyboardEvents ()
 
void StopCaptureKeyboardEvents ()
 
void StartCaptureTrackpadEvents ()
 
void StopCaptureTrackpadEvents ()
 
void StartCapturePointerEvents (uint8_t pointerID)
 
void StopCapturePointerEvents (uint8_t pointerID)
 
bool DrawBehindChildren (CYISceneNode *pSceneNode, bool *pChanged=nullptr)
 
bool DrawInFrontOfChildren (CYISceneNode *pSceneNode, bool *pChanged=nullptr)
 
bool DrawBehind (CYISceneNode *pSceneNode, bool *pChanged=nullptr)
 
bool DrawInFront (CYISceneNode *pSceneNode, bool *pChanged=nullptr)
 
bool IsFocusRoot () const
 
void SetIsFocusRoot (bool isFocusRoot)
 
virtual void OnFocusGainedInDescendants (CYISceneNode *pNewNodeWithFocus, CYISceneNode *pPreviousNodeWithFocus)
 
virtual void OnFocusLostInDescendants (CYISceneNode *pNewNodeWithFocus, CYISceneNode *pPreviousNodeWithFocus)
 
virtual void FocusLostInDescendants (CYISceneNode *pNewNodeWithFocus, CYISceneNode *pPreviousNodeWithFocus)
 
virtual void OnFocusChangedInDescendants (CYISceneNode *pNewNodeWithFocus, CYISceneNode *pPreviousNodeWithFocus)
 
virtual void FocusChangedInDescendants (CYISceneNode *pNewNodeWithFocus, CYISceneNode *pPreviousNodeWithFocus)
 
void SetUseLocalTransformAndAlpha (bool use)
 
bool GetProperty (CYIStringView propertyName, CYIString *pValue) const
 
void SetProperty (const CYIString &propertyName, const CYIString &propertyValue)
 
std::shared_ptr< CYISceneNodeProxyGetSceneNodeProxy () const
 
void SetLayoutConfig (std::unique_ptr< CYILayoutConfig > pLayoutConfig)
 
const CYILayoutConfigGetLayoutConfig (LayoutConfigFetchMode fetchMode=LayoutConfigFetchMode::LazyInstantiate) const
 
CYILayoutConfigGetLayoutConfig (LayoutConfigFetchMode fetchMode=LayoutConfigFetchMode::LazyInstantiate)
 
void SetLayoutState (std::unique_ptr< CYILayoutState > pLayoutState)
 
const CYILayoutStateGetLayoutState () const
 
CYILayoutStateGetLayoutState ()
 
void RequestLayout ()
 
LayoutDirtyFlag GetLayoutDirtyFlag () const
 
virtual void SetLayoutDirtyFlag (LayoutDirtyFlag flag)
 
virtual CYIAbstractCameraSceneNodeFindActiveCamera (const CYISceneNode *pTargetSceneNode=nullptr) const
 
CYIAccessibilityAttributes::Accessible GetAccessible () const
 
void SetAccessible (CYIAccessibilityAttributes::Accessible accessible)
 
const CYIAccessibilityAttributesGetAccessibilityAttributes () const
 
std::unique_ptr< CYIAccessibilityAttributesTakeAccessibilityAttributes ()
 
void SetAccessibilityAttributes (std::unique_ptr< CYIAccessibilityAttributes > pAttributes)
 
const CYIRenderableGetRenderable () const
 
template<typename T >
bool CanCastTo () const
 
CYIAdjustmentLayerSceneNode * GetLastAdjustmentLayer () const
 
- Public Member Functions inherited from CYIEventTarget
 CYIEventTarget ()
 
virtual ~CYIEventTarget ()
 
bool AddEventListener (CYIEvent::Type eventType, CYIEventHandler *pListener, CYIEventTarget::Phase phase=CYIEventTarget::Phase::Bubble)
 
bool RemoveEventListener (CYIEvent::Type eventType, CYIEventHandler *pListener, CYIEventTarget::Phase phase=CYIEventTarget::Phase::Bubble)
 
void SetSpecialTypeFlag (SpecialEventTargetType type)
 
void ClearSpecialTypeFlag (SpecialEventTargetType type)
 
SpecialEventTargetType GetSpecialTypes () const
 
const std::shared_ptr< CYIEventTargetProxy > & GetProxy () const
 
- Public Member Functions inherited from CYISignalHandler
 CYISignalHandler ()
 
 CYISignalHandler (const CYISignalHandler &signalHandler)
 
virtual ~CYISignalHandler ()
 
CYISignalHandleroperator= (const CYISignalHandler &signalHandler)
 
void MoveToThread (CYIThread *pThread)
 This function allows the user to override the default thread affinity to any CYIThread that may or may not be running. More...
 
CYIThreadHandle GetThreadAffinity () const
 
void SetThreadAffinity (const CYIThreadHandle &threadAffinity)
 
virtual bool IsConnected () const
 
virtual bool IsConnected (const CYISignalBase &signal) const
 
void Disconnect (CYISignalBase &signal)
 
void DisconnectFromAllSignals ()
 
- Public Member Functions inherited from CYIThread::Listener
 Listener ()
 
virtual ~Listener ()
 
virtual void OnThreadStarted (CYIThread *)
 
virtual void OnThreadTerminated (CYIThread *)
 
virtual void OnThreadFinished (CYIThread *)
 
- Public Member Functions inherited from IYIPropertiesSource
virtual ~IYIPropertiesSource ()=default
 
bool GetProperty (CYIStringView propertyName, CYIString *pValue) const
 
- Public Member Functions inherited from CYIEventHandler
 CYIEventHandler ()
 
 CYIEventHandler (const CYIEventHandler &)
 
virtual ~CYIEventHandler ()
 
CYIEventHandleroperator= (const CYIEventHandler &)
 
bool RegisterEventFilter (CYIEventFilter *pFilter)
 
bool UnregisterEventFilter (CYIEventFilter *pFilter)
 
bool PreFilter (const std::shared_ptr< CYIEventDispatcher > &pDispatcher, CYIEvent *pEvent)
 
bool PostFilter (const std::shared_ptr< CYIEventDispatcher > &pDispatcher, CYIEvent *pEvent)
 
bool AreEventsEnabled () const
 
void EnableEvents (bool enable)
 

Static Public Member Functions

static void RegisterAllViews ()
 
- Static Public Member Functions inherited from CYISceneNode
static void RegisterAllSceneNodes ()
 

Public Attributes

CYISignal< CYISceneView *, CYISceneView *> GainedFocus
 Emitted when focus has entered this view. The first signal argument is the view that gained focus (e.g. the current view) and the second signal argument is the view that lost focus. More...
 
CYISignal< CYISceneView *, CYISceneView *> LostFocus
 Emitted when focus has left this view. The first signal argument is the view that lost focus (e.g. the current view) and the second signal argument is the view that gained focus. More...
 
- Public Attributes inherited from CYISceneNode
CYISignal< CYISceneNode *, PropertyAnimation::TypePropertyAnimationComplete
 
CYISignal< CYISceneNode *, CYISceneNode *> DescendantGainedFocus
 Emitted when focus has entered this tree. The first signal parameter is the new node with focus, and the second signal parameter is the previous node with focus. More...
 
CYISignal< CYISceneNode *, CYISceneNode *> DescendantLostFocus
 Emitted when focus has left this tree. The first signal parameter is the new node with focus, and the second signal parameter is the previous node with focus. More...
 
CYISignal< CYISceneNode *, CYISceneNode *> DescendantsChangedFocus
 Emitted when focus has changed within this tree. This signal is called only if focus was previously within this tree and focus is now on a different node (but still within this tree). The first signal parameter is the new node with focus, and the second signal parameter is the previous node with focus. More...
 
CYISignal< CYIAccessibilityAttributes::AccessibleAccessibleStateChanged
 Emitted when accessible state changed. More...
 

Protected Member Functions

void UpdateClipping ()
 
virtual void WorldScaleUpdated () override
 
virtual void WorldBoundingBoxUpdated () override
 
virtual void OnViewReflowed (const glm::vec3 &worldScale)
 
virtual void ViewReflowed (const glm::vec3 &worldScale)
 
virtual bool HandleEvent (const std::shared_ptr< CYIEventDispatcher > &pDispatcher, CYIEvent *pEvent) override
 
virtual bool ProcessEvent (const std::shared_ptr< CYIEventDispatcher > &pDispatcher, CYIEvent *pEvent) override
 
void UpdateResponsiveLayoutAnchors ()
 
virtual void SizeChanged () override
 
virtual void ChildNeedsLayout () override
 
virtual void LayoutDirtied () override
 
virtual void ChildAdded (CYISceneNode *pChild) override
 
virtual void ChildRemoved (CYISceneNode *pChild) override
 
virtual void ChildVisibilityChanged (CYISceneNode *pChild) override
 
void OnViewIsInAnimatedPosition ()
 
void OnViewIsGoingOutOfAnimatedPosition ()
 
void SetInTimeline (CYIAbstractTimeline *pTimeline)
 
void SetOutTimeline (CYIAbstractTimeline *pTimeline)
 
virtual void OnInit ()
 
bool TryRequestFocusOnInitiallyFocusedView ()
 
- Protected Member Functions inherited from CYISceneNode
void Update ()
 
virtual void OnUpdateBegin ()
 
virtual void UpdateBegin ()
 
virtual void OnUpdateEnd ()
 
virtual void UpdateEnd ()
 
virtual void OnDirtyFlagChanged ()
 
virtual void DirtyFlagChanged ()
 
virtual void OnTransformUpdated ()
 
virtual void TransformUpdated ()
 
virtual void OnWorldScaleUpdated ()
 
virtual void OnWorldSurfaceScaleUpdated ()
 
virtual void WorldSurfaceScaleUpdated ()
 
virtual void OnVisibilityUpdated ()
 
virtual void VisibilityUpdated ()
 
virtual void OnCompositeOpacityUpdated ()
 
virtual void CompositeOpacityUpdated ()
 
virtual void OnWorldBoundingBoxUpdated ()
 
virtual void OnLocalBoundingBoxUpdated ()
 
virtual void LocalBoundingBoxUpdated ()
 
virtual void OnChildAdded (CYISceneNode *pChild)
 
virtual void OnChildRemoved (CYISceneNode *pChild)
 
virtual void OnSizeChanged ()
 
virtual void OnChildVisibilityChanged (CYISceneNode *pChild)
 
virtual void OnDrawOrderChanged ()
 
LayoutDirtyFlag GetCurrentLayoutDirtyFlag () const
 
virtual CYIString GetDumpTreeString () const
 
void DumpTree (int32_t indentLevel) const
 
virtual void SetCustomUniforms ()
 
template<class T >
void SetNodeType ()
 
virtual CYISceneNodeGetNodeFromChildren (CYIStringView name)
 
virtual CYISceneNodeGetNodeFromChildren (const int32_t id)
 
virtual CYISceneNodeGetNodeFromChildren (const CYIRuntimeTypeInfo &enforceClassType)
 
CYISceneNodeGetNodeFromChildrenAfterTarget (const CYIRuntimeTypeInfo &enforceClassType, bool *pTargetReached, CYISceneNode *pStartAfterTarget)
 

Protected Attributes

bool m_stopEventPropagation
 
bool m_responsiveLayoutEnabled
 
bool m_sceneTreeBuilt
 
bool m_inAnimatedPosition
 
CYISceneNodem_pClippingNode
 
CYIAbstractTimelinem_pFocusInTimeline
 
CYIAbstractTimelinem_pFocusOutTimeline
 
std::unique_ptr< CYILayoutm_pLayout
 
std::shared_ptr< CYIAssetViewTemplatem_pAssetViewTemplate
 
std::shared_ptr< CYISceneNodeProxym_pInitiallyFocusedView
 
InitialFocusLifetime m_initialFocusLifetime
 
std::multimap< EYIAnchorType, YI_ANCHOR_DATAm_anchors
 
std::map< CYIString, std::unique_ptr< CYITimeline >, std::less< void > > m_timelines
 
std::map< CYIString, std::unique_ptr< CYIParallelTimelineGroup >, std::less< void > > m_timelineGroups
 
std::map< CYIString, std::unique_ptr< CYIAbstractTimeline >, std::less< void > > m_externalTimelines
 
- Protected Attributes inherited from CYISceneNode
CYIString m_name
 
CYISceneNodem_pParent
 
CYISceneNodem_pDrawParent
 
std::vector< std::unique_ptr< CYISceneNode > > m_children
 
std::vector< CYISceneNode * > m_drawChildren
 
std::map< CYIString, CYIString, std::less< void > > m_Properties
 
std::vector< std::shared_ptr< CYIEffect > > m_Effects
 
std::vector< std::unique_ptr< PropertyAnimation > > m_propertyAnimations
 
float m_localOpacity
 
std::unique_ptr< CYITransformm_pTransform
 
glm::vec3 m_size
 
glm::vec3 m_initialSize
 
glm::vec3 m_measuredSize
 
glm::vec3 m_vlsLastCollision
 
bool m_clip
 
bool m_localVisibility
 
int32_t m_id
 
uint64_t m_guid
 
std::unique_ptr< CYINPatch > m_pNPatch
 
std::shared_ptr< CYIBitmapm_pNPatchBitmap
 
std::shared_ptr< CYIRenderablem_pRenderable
 
- Protected Attributes inherited from CYIEventTarget
std::vector< EventListenerEntry > m_listeners
 
SpecialEventTargetType m_specialTypes
 
std::shared_ptr< CYIEventTargetProxym_pEventTargetProxy
 
- Protected Attributes inherited from CYIEventHandler
bool m_enableEvents
 

Friends

class CYISceneViewPriv
 

Additional Inherited Members

- Static Public Attributes inherited from CYISceneNode
static const float OPACITY_NOT_VISIBLE_EPSILON
 
static constexpr DirtyFlag DirtyClean = 0x0000
 
static constexpr DirtyFlag DirtySceneGraph = 0x0001
 
static constexpr DirtyFlag DirtyVisibility = 0x0002
 
static constexpr DirtyFlag DirtyOpacity = 0x0004
 
static constexpr DirtyFlag DirtyLocalTransform = 0x0008
 
static constexpr DirtyFlag DirtyWorldTransform = 0x0010
 
static constexpr DirtyFlag DirtyUniform = 0x0020
 
static constexpr DirtyFlag DirtyWorldBoundingBox = 0x0040
 
static constexpr DirtyFlag DirtyMesh = 0x0080
 
static constexpr DirtyFlag DirtyWorldSurfaceScale = 0x0100
 
static constexpr DirtyFlag DirtyWorldScale = 0x0200
 
static constexpr DirtyFlag DirtyLocalBoundingBox = 0x0400
 
static constexpr DirtyFlag DirtyEverything = (DirtySceneGraph | DirtyVisibility | DirtyOpacity | DirtyLocalTransform | DirtyWorldTransform | DirtyUniform | DirtyWorldBoundingBox | DirtyWorldSurfaceScale | DirtyWorldScale | DirtyLocalBoundingBox)
 

Member Enumeration Documentation

◆ InitialFocusLifetime

Used to specify the lifetime of the initially focused view set via SetInitiallyFocusedView.

Enumerator
Persistent 

The initally focused view will remain set until the next call to SetInitiallyFocusedView.

ClearOnEntry 

The initially focused view will be cleared when focus enteres the subtree rooted at this view.

◆ TimelineGetMode

The various modes with which timelines can be obtained from CYISceneView.

Enumerator
GetDefault 

Automatically picks between the other modes depending on how the given timeline marker is configured.

GetTimeline 

Always returns a CYITimeline instance (e.g. never returns a timeline group). Returns null if the given timeline marker does not exist.

GetTimelineGroup 

Always returns a timeline group (which will recursively be created). Never returns null.

GetComponentOfTimelineGroup 

Returns a timeline group component. This is used internally when generating timeline groups. Returns null if the given timeline marker is configured as 'stop recursing'.

Constructor & Destructor Documentation

◆ CYISceneView()

CYISceneView::CYISceneView ( )

◆ ~CYISceneView()

virtual CYISceneView::~CYISceneView ( )
virtual

Member Function Documentation

◆ AddAnchor()

void CYISceneView::AddAnchor ( EYIAnchorType  anchorType)

Adds the anchorType responsive layout anchor to the view.

◆ ApplyMeasurements()

virtual void CYISceneView::ApplyMeasurements ( )
overridevirtual

Applies the measured sizes of this node's children.

Note
Typically, if ApplyMeasurements is overridden then Measure must also be overridden.
Measurements should be applied before calculating position for layout.
Warning
Subclasses that override this function must ensure that the ApplyMeasurements function of ALL children of this scene node is called.
Note
Subclasses that override this function should make use of the GetCurrentLayoutDirtyFlag() function (rather than GetLayoutDirtyFlag() ).

Reimplemented from CYISceneNode.

Reimplemented in CYIScrollingView, CYIImageView, and CYIListView.

◆ BuildAnchorList()

void CYISceneView::BuildAnchorList ( )

Used during view construction to initialize the list of responsive layout anchors present in this view.

◆ BuildFromTemplate()

bool CYISceneView::BuildFromTemplate ( CYISceneManager pSceneManager,
const std::shared_ptr< CYIAssetViewTemplate > &  pAssetViewTemplate,
CYISceneManager::MissingClassHandlingMode  missingHandlingMode = CYISceneManager::MissingClassHandlingMode::Abort 
)

Builds the view using pAssetViewTemplate. This must be called prior to CYISceneView::Init().

Note
This method will assert if called twice.

◆ BuildTimeline() [1/2]

template<typename T >
T* CYISceneView::BuildTimeline ( const CYIString markerName)

Builds a timeline of type T, where T derives from CYIAbstractTimeline, e.g. CYITimelineLoop, CYITimelineReverse, CYISerialTimelineGroup, CYIParallelTimelineGroup. The view will retain ownership of the returned timeline. The user can cache and use the returned timeline value as long as the associated CYISceneView is valid.

See also
GetTimeline
GetTimelineGroup

◆ BuildTimeline() [2/2]

CYITimeline* CYISceneView::BuildTimeline ( const CYIString markerName,
int32_t  startOffset,
int32_t  duration 
)

Builds a CYITimeline from the associated backing store, using startOffset and duration. markerName is assigned as its markerName. The view will retain ownership of the returned timeline. The user can cache and use the returned timeline value as long as the associated CYISceneView is valid.

◆ CanBeFocused()

bool CYISceneView::CanBeFocused ( ) const

◆ ChildAdded()

virtual void CYISceneView::ChildAdded ( CYISceneNode pChild)
overrideprotectedvirtual

Called when a scene node is added to this node's children list.

Warning
Overrides must call the base class implementation.
See also
OnChildAdded()

Reimplemented from CYISceneNode.

Reimplemented in CYIScrollingView.

◆ ChildNeedsLayout()

virtual void CYISceneView::ChildNeedsLayout ( )
overrideprotectedvirtual

Called when a child in this scene node's children hierarchy needs to be laid out.

Warning
Overrides must call the base class implementation.

Reimplemented from CYISceneNode.

◆ ChildRemoved()

virtual void CYISceneView::ChildRemoved ( CYISceneNode pChild)
overrideprotectedvirtual

Called when a scene node is removed from this node's children list.

Note
The scene node might be deleted immediately after this function is called (e.g. if a user called CYISceneNode::DestroyChildren )
Warning
Overrides must call the base class implementation.
See also
OnChildRemoved()

Reimplemented from CYISceneNode.

Reimplemented in CYIScrollingView.

◆ ChildVisibilityChanged()

virtual void CYISceneView::ChildVisibilityChanged ( CYISceneNode pChild)
overrideprotectedvirtual

Called when the visibility of a child of this scene node has been modified.

Warning
Overrides must call the base class implementation.
See also
OnChildVisibilityChanged()

Reimplemented from CYISceneNode.

◆ ContainsFocusableDescendant()

virtual bool CYISceneView::ContainsFocusableDescendant ( const CYIFocusSearchOptions options = CYIFocusSearchOptions()) const
overridevirtual

Returns true if this node contains any descendants which can receive focus.

The default implementation returns true if CYISceneManager::CanBeFocused() returns true for any descendant and if those descendants are valid candidates according to options.

Reimplemented from CYISceneNode.

Reimplemented in CYIScrollingView, and CYIFocusZoneView.

◆ DisableResponsiveLayout()

void CYISceneView::DisableResponsiveLayout ( )

Disables responsive layout on this view. Responsive layout is enabled by default.

See also
IsResponsiveLayoutEnabled

◆ EnableDefaultHitZone()

void CYISceneView::EnableDefaultHitZone ( )

Creates and assigns a CYIMesh to this view which is the same size as the view. This mesh is necessary for the view to become a target for events of type CYIActionEvent. A view may still receive events during the CYIEvent::Phase::Capture and CYIEvent::Phase::Bubble phases if it has no mesh, but for it to be the target of an event, corresponding to CYIEvent::Phase::AtTarget, it must have a mesh.

See also
GetSize()
CYIEvent::Phase

◆ EnableResponsiveLayout()

void CYISceneView::EnableResponsiveLayout ( )

Enables responsive layout on this view. Responsive layout is enabled by default.

See also
IsResponsiveLayoutEnabled

◆ FindNextFocus() [1/2]

CYISceneView* CYISceneView::FindNextFocus ( CYIFocus::Direction  direction,
const CYIFocusSearchOptions options = CYIFocusSearchOptions() 
) const

Returns the next focusable view in the requested direction.

If GetNextFocus() returns this view, null will be returned, indicating focus cannot change in direction.

If GetNextFocus() returns a view that is not this view, that will be returned.

Otherwise returns the closest view in direction that can take focus, using this view as a starting point.

Will return null if no possible focus candidate is found.

options can be used to further restrict the set of valid focus candidates.

See also
SetNextFocus

◆ FindNextFocus() [2/2]

CYISceneView* CYISceneView::FindNextFocus ( CYIFocus::Direction  direction,
CYIAABB screenSpaceFocusRegion,
const CYIFocusSearchOptions options = CYIFocusSearchOptions() 
) const

Returns the next focusable view in the requested direction within the specfied screen space region. screenSpaceFocusRegion is an in and out parameter. It will usually correspond to CYIFocus::GetScreenSpaceFocusRegion(pCurrentFocusView) but implementations may modify screenSpaceFocusRegion in order to hint that future focus searches should be performed with that modified bounding box.

See also
FindNextFocus

◆ FindNextFocusInDescendants()

virtual CYISceneView* CYISceneView::FindNextFocusInDescendants ( const CYISceneView pCurrentFocusView,
CYIFocus::Direction  direction,
CYIAABB screenSpaceFocusRegion,
const CYIFocusSearchOptions options = CYIFocusSearchOptions() 
) const
virtual

Focus handlers must override this function to perform focus searches in their descendants. Returns the next view to recieve focus or null if there are none in direction. screenSpaceFocusRegion will usually correspond to CYIFocus::GetScreenSpaceFocusRegion(pCurrentFocusView) but implementations may modify screenSpaceBoundingBox in order to hint that future focus searches should be performed with that modified bounding box.

options can be used to further restrict the set of valid focus candidates.

See also
HandlesFocusInDescendants

Reimplemented in CYIScrollingView, and CYIFocusZoneView.

◆ FindTimeline()

bool CYISceneView::FindTimeline ( CYIAbstractTimeline *&  pTimeline,
CYIStringView  markerName,
FetchType  type,
const CYIString tag = "",
TimelineGetMode  mode = TimelineGetMode::GetDefault 
)

If a timeline with markerName exists in this view, pTimeline will point to that timeline. The view will retain ownership of the timeline. The user can cache and use the returned timeline value as long as the associated CYISceneView is valid. If type is CYISceneNode::FetchType::Mandatory, an error message using the optional tag will be logged if markerName is not found.

Returns false if markerName is not found.

Note
If unsuccessful the value of pTimeline is set to nullptr.

◆ FocusGained()

virtual void CYISceneView::FocusGained ( )
virtual
See also
OnFocusGained
Note
The base implementation must be called.

◆ FocusGainedInDescendants()

virtual void CYISceneView::FocusGainedInDescendants ( CYISceneNode pNewNodeWithFocus,
CYISceneNode pPreviousNodeWithFocus 
)
overridevirtual

Called when focus has entered this tree.

Note
The base implementation must be called.
pPreviousNodeWithFocus may be null.
See also
OnFocusGainedInDescendants()

Reimplemented from CYISceneNode.

Reimplemented in CYIScrollingView, and CYIFocusZoneView.

◆ FocusLost()

virtual void CYISceneView::FocusLost ( )
virtual
See also
OnFocusLost
Note
The base implementation must be called.

Reimplemented in CYIScrollBarView.

◆ ForEachProperty()

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

Executes action for each property held by this scene view as welll as for each property of the view template associated with this scene view. Each property name and property value pair is passed to action.

Note
If a property exits in both this scene view and this scene view's associated view template, action is called twice for that property (but is called first with the value from the view template).

Reimplemented from CYISceneNode.

◆ GetAnchor()

YI_ANCHOR_DATA CYISceneView::GetAnchor ( EYIAnchorType  anchorType) const

Returns the YI_ANCHOR_DATA for the anchorType on this view, or a default YI_ANCHOR_DATA object if the anchor was not present in the view's template and has not been added using AddAnchor().

◆ GetAssetRequirements()

virtual const CYISceneView::AssetRequirement* CYISceneView::GetAssetRequirements ( uint32_t *  pRequirementCount)
virtual

Returns the asset requirements for the view; implemented in each subclass to return the nodes and timelines which must be present in the view. Used internally by the You.i Engine After Effects Plug-in.

Reimplemented in CYITextEditView, CYIScrollBarView, and CYIProgressBarView.

◆ GetChildTemplateNames()

const std::vector<CYIString>& CYISceneView::GetChildTemplateNames ( )

◆ GetFocusHandler()

CYISceneView* CYISceneView::GetFocusHandler ( ) const

Returns the focus handler for this view. The view's focus handler is the closest ancestor which is a focus handler.

See also
HandlesFocusInDescendants

◆ GetFocusInTimeline()

CYIAbstractTimeline* CYISceneView::GetFocusInTimeline ( ) const

Returns the 'FocusIn' CYIAbstractTimeline, or null if the view does not supply one. The view's 'FocusIn' CYIAbstractTimeline is set in Init().

◆ GetFocusOutTimeline()

CYIAbstractTimeline* CYISceneView::GetFocusOutTimeline ( ) const

Returns the 'FocusOut' CYIAbstractTimeline, or null if the view does not supply one. The view's 'FocusOut' CYIAbstractTimeline is set in Init().

◆ GetFocusRoot()

const CYISceneNode* CYISceneView::GetFocusRoot ( ) const

Returns the focus root for this view. The view's focus root is the closest ancestor which is a focus root.

See also
CYISceneNode::IsFocusRoot

◆ GetInitialFocusLifetime()

CYISceneView::InitialFocusLifetime CYISceneView::GetInitialFocusLifetime ( ) const

Returns the InitialFocusLifetime.

If initialFocusLifetime is CYISceneView::InitialFocusLifetime::ClearOnEntry, the initially focused view will be reset the next time focus enters this subtree.

if initialFocusLifetime is CYISceneView::InitialFocusLifetime::Persistent, the he initally focused view will remain set until the next call to SetInitiallyFocusedView.

See also
SetInitiallyFocusedView
TryRequestFocusOnInitiallyFocusedView

◆ GetInitiallyFocusedView()

CYISceneView* CYISceneView::GetInitiallyFocusedView ( ) const

Returns the view that will receive initial focus when focus enters this containing view. Will return nullptr if the initially focused view has been deleted, cleared, or is unset.

See also
SetInitiallyFocusedView
TryRequestFocusOnInitiallyFocusedView

◆ GetInTimeline()

CYIAbstractTimeline* CYISceneView::GetInTimeline ( ) const

Returns the 'In' CYIAbstractTimeline, or null if the view does not supply one. The view's 'In' CYIAbstractTimeline is set in Init(). Subclasses can overwrite this timeline using SetInTimeline().

◆ GetLayout() [1/2]

const CYILayout* CYISceneView::GetLayout ( ) const

Returns the layout currently assigned to this view, or null if there is no layout.

◆ GetLayout() [2/2]

CYILayout* CYISceneView::GetLayout ( )

Returns the layout currently assigned to this view, or null if there is no layout.

◆ GetNextFocus()

CYISceneView* CYISceneView::GetNextFocus ( CYIFocus::Direction  direction) const

Returns the next view in the specified direction if it has been set by SetNextFocus. Otherwise, null is returned.

If the view is not a focus candidate returns null.

See also
SetNextFocus
SetFocusable

◆ GetOutTimeline()

CYIAbstractTimeline* CYISceneView::GetOutTimeline ( ) const

Returns the 'Out' CYIAbstractTimeline, or null if the view does not supply one. The view's 'Out' CYIAbstractTimeline is set in Init(). Subclasses can overwrite this timeline using SetOutTimeline().

◆ GetProperties()

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

Returns a map containing all of the properties contained in this scene view and this scene view's associated view template. If a property exists both in this scene view and in this scene view's associatd view template, the returned map will contain the property's value from the scene view itself.

Reimplemented from CYISceneNode.

◆ GetProperty() [1/2]

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

Returns the value of a property named propertyName. If no such property exists, the property is fetched from the view's view template instead. Returns an empty optional if the property cannot be found in either of the two locations.

See also
IYIPropertiesSource::GetProperty(CYIStringView) const

Reimplemented from CYISceneNode.

◆ GetProperty() [2/2]

bool CYISceneView::GetProperty ( CYIStringView  propertyName,
CYIString pValue 
) const
Deprecated:
This function is deprecated and may be removed in a future release. IYIPropertiesSource::GetProperty(CYIStringView) const should be used instead.

Stores the value of a property specified by propertyName into pValue. If no such propery exists, the property is fetched from the view's view template instead. Returns false if the property cannot be found in either of the two locations.

◆ GetSimpleTimelines()

std::map<CYIString, CYITimeline *> CYISceneView::GetSimpleTimelines ( ) const

Returns a map of all currently-instantiated non-group timelines held by this scene view. The key of the map is the timeline's marker name, and the value is the timeline itself.

Note
A timeline for a given marker name is added to the returned map only when GetTimeline() is called for that particular marker name.
The returned map does not contain timeline groups managed by this CYISceneView.

◆ GetTimeline() [1/2]

CYIAbstractTimeline* CYISceneView::GetTimeline ( CYIMarkerData::ID  id)

Returns the timeline defined by id. If no such timeline exists, null is returned. The view will retain ownership of the returned timeline. The user can cache and use the returned timeline value as long as the associated CYISceneView is valid.

◆ GetTimeline() [2/2]

virtual CYIAbstractTimeline* CYISceneView::GetTimeline ( CYIStringView  markerName,
TimelineGetMode  mode = TimelineGetMode::GetDefault 
)
virtual

Returns the timeline with markerName. If no such timeline exists, null is returned. The view will retain ownership of the returned timeline. The user can cache and use the returned timeline value as long as the associated CYISceneView is valid.

The mode parameter can be used to control the type of timeline being returned. If set to CYISceneView::TimelineGetMode::GetTimelineGroup, a CYIParallelTimelineGroup is returned (built recursively throughout the children of this view). If set to CYISceneView::TimelineGetMode::GetTimeline, a CYITimeline is returned. If set to CYISceneView::TimelineGetMode::GetDefault, the type of timeline returned depends on the configuration of the marker from which the timeline is being created.

◆ GetTimelineGroup()

CYITimelineGroup* CYISceneView::GetTimelineGroup ( CYIStringView  markerName)

Returns a timeline group constructed from this view and all descendant views which contain a timeline called markerName.

Note
This function never returns null. If this scene view doesn't contain a marker matching markerName, the returned group may be empty or may contain timelines from descendant views.
If a descendant view's markerName marker is configured as 'stop recursion', its timelines will not be included in the returned timeline group.
The returned group is updated automatically if descendant views are added or removed.
This view retains ownership of the returned timeline group.
See also
GetTimeline

◆ GetTimelines()

std::map<CYIString, CYIAbstractTimeline *> CYISceneView::GetTimelines ( ) const

Returns a map of all currently-instantiated timelines owned and held by this scene view. The key of the map is the timeline's marker name, and the value is the timeline itself.

Note
Timelines created with GetTimeline(), GetTimelineGroup(), BuildTimeline() are all part of the returned map.

◆ GetViewTemplate()

const std::shared_ptr<CYIAssetViewTemplate>& CYISceneView::GetViewTemplate ( ) const

Returns the view template asset for this view.

See also
BuildFromTemplate
GetTimeline
GetTimelineGroup

◆ HandleEvent()

virtual bool CYISceneView::HandleEvent ( const std::shared_ptr< CYIEventDispatcher > &  pDispatcher,
CYIEvent pEvent 
)
overrideprotectedvirtual

Pure virtual for the child to implement according to how they wish the events to be handled.

The method is to return true if the event was processed and false otherwise.

Implements CYIEventHandler.

Reimplemented in CYIScrollingView, CYITextEditView, CYIToggleButtonView, CYIAbstractButtonView, CYIScrollBarView, CYIScrollingTextView, and CYIDrawerView.

◆ HandlesFocusInDescendants()

virtual bool CYISceneView::HandlesFocusInDescendants ( ) const
virtual

By default a CYISceneView is not a focus handler, but they can become one if an initial focus view is set. Override this to return true if this view handles focus in its descendants, meaning it will receive focus requests instead of its contents and must choose which view will receive focus in response to RequestFocus().

If this is overridden to return true, RequestFocus() and FindNextFocusInDescendants() must also be overridden. Overriding views may also want to override CYISceneNode::ContainsFocusableDescendant(const CYIFocusSearchOptions&).

See also
RequestFocus
FindNextFocusInDescendants
CYISceneNode::ContainsFocusableDescendant(const CYIFocusSearchOptions&) const
SetInitiallyFocusedView

Reimplemented in CYIScrollingView, CYIScrollingTextView, and CYIFocusZoneView.

◆ HasFocus()

bool CYISceneView::HasFocus ( ) const

Returns true if this view currently has focus.

◆ HasProperties()

virtual bool CYISceneView::HasProperties ( ) const
overridevirtual

Returns true if this view or this view's associated view template contains at least one property.

See also
IYIPropertiesSource::HasProperties

Reimplemented from CYISceneNode.

◆ Init()

◆ IsFocusable()

bool CYISceneView::IsFocusable ( ) const

Returns true if this view can receive focus.

See also
SetFocusable

◆ IsInitialized()

bool CYISceneView::IsInitialized ( ) const

Returns true if BuildFromTemplate() has been called.

◆ IsResponsiveLayoutEnabled()

bool CYISceneView::IsResponsiveLayoutEnabled ( ) const

Returns true if responsive layout is enabled on the view. CYISceneView has responsive layout enabled by default, but responsive layout does not take effect unless the view also has anchors.

See also
CYISceneManager::LoadScene
AddAnchor
Note
Unless explicitly disabled by DisableResponsiveLayout(), responsive layout is enabled, even if passing scaling rules other than CYISceneManager::ScaleType::ResponsiveLayout to CYISceneManager::LoadScene

◆ LayoutDirtied()

virtual void CYISceneView::LayoutDirtied ( )
overrideprotectedvirtual

Called when the layout dirty flag of this scene node has been set to CYISceneNode::LayoutDirtyFlag::Dirty.

Warning
Overrides must call the base class implementation.

Reimplemented from CYISceneNode.

◆ Measure()

virtual void CYISceneView::Measure ( const MeasureSpec widthSpec,
const MeasureSpec heightSpec,
const MeasureSpec depthSpec 
)
overridevirtual

Measures this scene node, considering the layout configuration constraints (if available) and the provided measure specifications. The Measure function is used by the layout system to determine the 'desired' size of elements in a container. The result of calls to this function can be accessed through the GetMeasuredSize() function.

Note
The Measure function may be called multiple times on a single scene node during a layout pass.
The measure specs passed in must take in consideration the node's scale. For example, if a node is calling the Measure function on one of its children and that child has a scale of glm::vec3(1, 3, 1), then the size of heightSpec must be divided by 3.
The measured values may exceed the provided measure specifications if the specifications cannot be met given the constraints placed on this scene node. In other words, the constraints placed on this node have a higher priority than the provided measure specifications.
Warning
Subclasses that override this function must ensure that the Measure function of ALL children of this scene node is called at least once, even if those children are hidden.
Note
Typically, if Measure is overridden then ApplyMeasurements must also be overridden.
Subclasses that override this function should make use of the GetCurrentLayoutDirtyFlag() function (rather than GetLayoutDirtyFlag() ).

Reimplemented from CYISceneNode.

Reimplemented in CYIScrollingView, and CYIImageView.

◆ OnFocusGained()

virtual void CYISceneView::OnFocusGained ( )
virtual

Called when focus has entered this view.

See also
GainedFocus

◆ OnFocusLost()

virtual void CYISceneView::OnFocusLost ( )
virtual

Called when focus has left this view.

See also
LostFocus

◆ OnInit()

virtual void CYISceneView::OnInit ( )
protectedvirtual

This function is deprecated and no longer called. Override Init() to achieve the same functionality.

◆ OnViewIsGoingOutOfAnimatedPosition()

void CYISceneView::OnViewIsGoingOutOfAnimatedPosition ( )
protected

◆ OnViewIsInAnimatedPosition()

void CYISceneView::OnViewIsInAnimatedPosition ( )
protected

Called when a view is in its animated position. Used with CYIAnimatingLayout when animating views that are in layouts. When a view is in its animated position its position may be modified directly. When it is animating to its animated position, its destination must be modified instead.

◆ OnViewReflowed()

virtual void CYISceneView::OnViewReflowed ( const glm::vec3 &  worldScale)
protectedvirtual

Called when the view has been reflowed by responsive layout.

◆ ProcessEvent()

virtual bool CYISceneView::ProcessEvent ( const std::shared_ptr< CYIEventDispatcher > &  pDispatcher,
CYIEvent pEvent 
)
overrideprotectedvirtual

Notifies this event target of an incoming event. Calls all the relevant listeners based on event type and phase. Returns true if any of the listeners' handleEvent() function returned true.

Reimplemented from CYISceneNode.

◆ RegisterAllViews()

static void CYISceneView::RegisterAllViews ( )
static

Registers the You.i Engine views with the linker to prevent symbols for views which are used in the You.i Engine After Effects Plug-in, but might not be referenced explicitly in code, from being removed during linking.

◆ RequestFocus()

virtual bool CYISceneView::RequestFocus ( CYIFocus::Direction  direction = CYIFocus::Direction::Forward,
CYIFocus::FocusRootRule  focusRootRule = CYIFocus::FocusRootRule::DescendantsUpdateContext,
const CYIAABB previousFocusRect = CYIAABB(),
const CYIFocusSearchOptions options = CYIFocusSearchOptions() 
)
virtual

By default, assigns focus to this view if it is focusable. If it is not focusable, performs a focus search within this view.

focusRootRule dictates whether the focus system will allow the focus request to a view outside of the current focus root.

This function can be overridden to change focus traversal. A custom search may be performed as long as the function returns true if a view has been found, and RequestFocus() has been called on the found view. options can be used to further restrict the set of valid focus candidates. When overriding this function make sure to call TryRequestFocusOnInitiallyFocusedView() to preserve the SetInitiallyFocusedView() functionality.

See also
CYISceneManager::StageScene
HandlesFocusInDescendants
TryRequestFocusOnInitiallyFocusedView
SetFocusable()

Reimplemented in CYIScrollingView, CYIScrollingTextView, and CYIFocusZoneView.

◆ Reset()

virtual void CYISceneView::Reset ( )
inlinevirtual

Called from CYIPooledViewRecycler::RecycleView to reset the view to an initial state. Default implementation does nothing. Subclasses must implement this function if used in conjunction with CYIPooledViewRecycler to restore their views to the initial state defined by the template.

See also
CYIPooledViewRecycler

Reimplemented in CYIImageView.

◆ SetClippingAreaNode()

void CYISceneView::SetClippingAreaNode ( CYISceneNode pClippingNode)

Defines the clipping area of this view using pClippingNode. Any contents of this view which fall outside of the clipping area will not be visible. The clipping area is based on the mesh of pClippingNode.

◆ SetFocusable()

void CYISceneView::SetFocusable ( bool  focusable)

Sets whether this view can receive focus.

Note
For a view to be a focus candidate it must meet the following requirements: it is visible, is part of a staged scene, is focusable, and does not already have focus.

◆ SetInitiallyFocusedView()

virtual void CYISceneView::SetInitiallyFocusedView ( CYISceneView pView,
InitialFocusLifetime  initialFocusLifetime = InitialFocusLifetime::Persistent 
)
virtual

Sets view that will receive initial focus when focus enters this containing view. Setting an initial focus view causes this view to become a focus handler. The initially focused view can be cleared by passing nullptr into this function.

If initialFocusLifetime is CYISceneView::InitialFocusLifetime::ClearOnEntry, the initially focused view will be reset the next time focus enters this subtree. Note that the initially focused view can be cleared even if it does not recieve focus.

See also
GetInitiallyFocusedView

Reimplemented in CYIFocusZoneView.

◆ SetInTimeline()

void CYISceneView::SetInTimeline ( CYIAbstractTimeline pTimeline)
protected

Sets the In timeline for this view to pTimeline. This view will not take ownership of pTimeline – the user is responsible for deleting pTimeline when the view is deleted.

See also
GetInTimeline

◆ SetLayout()

void CYISceneView::SetLayout ( std::unique_ptr< CYILayout pLayout)

Assigns layout pLayout to this view. If a layout already existed for this view, it will be deleted. This view will take ownership of pLayout. Call with null to remove the currently assigned layout without assigning a new one.

If assigning a non-null layout, the layout will be configured with this view. This involves extracting configuration parameters from this view's properties, and creating layout config and layout state objects as needed in this view's children.

◆ SetNextFocus()

void CYISceneView::SetNextFocus ( CYISceneView pView,
CYIFocus::Direction  direction 
)

Sets the next focus in direction to be pView, overriding the default focus search algorithm.

A value of null indicates that focus changes in direction should use the default search algorithm.

Setting pView to be this view prevents focus changes in direction.

If set on a focus handler, this override will be used when focus should leave the handler, with the same rules as above.

If direction is one of the relative focus directions: CYISceneView::Direction::Forward and CYISceneView::Direction::Reverse, the reverse focus link will also be set up, as long as pView does not point to this view.

Warning
Preventing focus changes in a relative direction breaks the tab-order focus ring and is not recommended.

◆ SetOutTimeline()

void CYISceneView::SetOutTimeline ( CYIAbstractTimeline pTimeline)
protected

Sets the Out timeline for this view to pTimeline. This view will not take ownership of pTimeline – the user is responsible for deleting pTimeline when the view is deleted.

See also
GetOutTimeline

◆ SizeChanged()

virtual void CYISceneView::SizeChanged ( )
overrideprotectedvirtual

Called when the size of this scene node has been changed.

Warning
Overrides must call the base class implementation.
See also
OnSizeChanged()

Reimplemented from CYISceneNode.

Reimplemented in CYIScrollingView.

◆ TryRequestFocusOnInitiallyFocusedView()

bool CYISceneView::TryRequestFocusOnInitiallyFocusedView ( )
protected

Attempts to focus the initial focus view. Returns true if the initial focus view is successfully focused.

If RequestFocus() is overridden, this function should be called in order to respect the initially focused view setting.

See also
RequestFocus
SetInitiallyFocusedView

◆ UpdateClipping()

void CYISceneView::UpdateClipping ( )
protected

Updates the clipping box which is computed form this view's clipping node, or if it has none, the view's mesh.

◆ UpdateResponsiveLayoutAnchors()

void CYISceneView::UpdateResponsiveLayoutAnchors ( )
protected

Updates the position of the responsive layout anchors of this view. This will be called when the size of the view has changed.

See also
SizeChanged

◆ ViewReflowed()

virtual void CYISceneView::ViewReflowed ( const glm::vec3 &  worldScale)
protectedvirtual

Called when the view has been reflowed by responsive layout.

Warning
Overrides must call the base class implementation.

◆ WorldBoundingBoxUpdated()

virtual void CYISceneView::WorldBoundingBoxUpdated ( )
overrideprotectedvirtual

Called by Update() when the world bounding box update process is complete. Subclasses may overload this function to do post-processing.

Warning
The dirty flag will be cleared prior to calling this function to allow new dirty state to be recorded from this function. If querying information about the dirty state of the node, use GetPreviousDirtyFlag().
Overrides must call the base class implementation.
See also
Update()
OnWorldBoundingBoxUpdated()

Reimplemented from CYISceneNode.

Reimplemented in CYIScrollingView, and CYIListView.

◆ WorldScaleUpdated()

virtual void CYISceneView::WorldScaleUpdated ( )
overrideprotectedvirtual

Called by Update() when the transform update process is complete and only when the world scale has changed. Subclasses may overload this function to do post-processing.

Warning
The dirty flag will be cleared prior to calling this function to allow new dirty state to be recorded from this function. If querying information about the dirty state of the node, use GetPreviousDirtyFlag().
See also
GetWorldScale
Warning
Overrides must call the base class implementation.
See also
Update()
OnWorldScaleUpdated()

Reimplemented from CYISceneNode.

Friends And Related Function Documentation

◆ CYISceneViewPriv

friend class CYISceneViewPriv
friend

Member Data Documentation

◆ GainedFocus

CYISignal<CYISceneView * , CYISceneView * > CYISceneView::GainedFocus

Emitted when focus has entered this view. The first signal argument is the view that gained focus (e.g. the current view) and the second signal argument is the view that lost focus.

See also
CYISceneNode::DescendantGainedFocus

◆ LostFocus

CYISignal<CYISceneView * , CYISceneView * > CYISceneView::LostFocus

Emitted when focus has left this view. The first signal argument is the view that lost focus (e.g. the current view) and the second signal argument is the view that gained focus.

See also
CYISceneNode::DescendantLostFocus

◆ m_anchors

std::multimap<EYIAnchorType, YI_ANCHOR_DATA> CYISceneView::m_anchors
protected

◆ m_externalTimelines

std::map<CYIString, std::unique_ptr<CYIAbstractTimeline>, std::less<void> > CYISceneView::m_externalTimelines
protected

◆ m_inAnimatedPosition

bool CYISceneView::m_inAnimatedPosition
protected

◆ m_initialFocusLifetime

InitialFocusLifetime CYISceneView::m_initialFocusLifetime
protected

◆ m_pAssetViewTemplate

std::shared_ptr<CYIAssetViewTemplate> CYISceneView::m_pAssetViewTemplate
protected

◆ m_pClippingNode

CYISceneNode* CYISceneView::m_pClippingNode
protected

◆ m_pFocusInTimeline

CYIAbstractTimeline* CYISceneView::m_pFocusInTimeline
protected

◆ m_pFocusOutTimeline

CYIAbstractTimeline* CYISceneView::m_pFocusOutTimeline
protected

◆ m_pInitiallyFocusedView

std::shared_ptr<CYISceneNodeProxy> CYISceneView::m_pInitiallyFocusedView
protected

◆ m_pLayout

std::unique_ptr<CYILayout> CYISceneView::m_pLayout
protected

◆ m_responsiveLayoutEnabled

bool CYISceneView::m_responsiveLayoutEnabled
protected

◆ m_sceneTreeBuilt

bool CYISceneView::m_sceneTreeBuilt
protected

◆ m_stopEventPropagation

bool CYISceneView::m_stopEventPropagation
protected

◆ m_timelineGroups

std::map<CYIString, std::unique_ptr<CYIParallelTimelineGroup>, std::less<void> > CYISceneView::m_timelineGroups
protected

◆ m_timelines

std::map<CYIString, std::unique_ptr<CYITimeline>, std::less<void> > CYISceneView::m_timelines
protected

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