You.i Engine
CYISceneNode Class Reference

Detailed Description

A scene node is the base type for all nodes which are used by the scene manager; it is an integral part of You.i Engine and is used extensively by various parts of the framework.

The scene node is the base class for all visual elements in the framework; CYISceneView derives from this class and serves as the base class for all pre-built user interface components.

The CYISceneNode class exposes all the necessary functionality for handling input, signals, animation, and timeline updates. It also provides functions for obtaining information about scene position and size in in both local and world coordinates.

This class is the basis for constructing a scene tree. Given the nature of a node in tree based systems, nodes can be detached and placed anywhere in the scene tree. However, some nodes may have logical or visual dependencies on other nodes in the tree, and care must be taken when placing these nodes in other locations.

Masks and visual effects can be created manually or imported from After Effects; these types can be added to a scene node for use during rendering.

A scene node can also be rendered into a different render target for the purposes of off-screen rendering.

The tree structure describes a transformation stack, properties of parents are inherited into their children. Additionally a drawing order is specified that is usually equivalent to the transformation stack. CYISceneNode::DrawInFrontOfChildren, CYISceneNode::DrawBehindChildren, CYISceneNode::DrawInFront, and CYISceneNode::DrawBehind are used to modify the draw structure. Modifying this structure may be necessary in cases where a node must have its transforms relative to another node, but must not change the order in which it draws to the screen, such as when making use of the parenting feature in After Effects.

A draw list is then created based on this draw structure to represent the order in which the nodes will be drawn. For further information see the documentation provided for the above functions.

The scene tree employs a dirty flag mechanism for tracking changes to nodes during and across frames. However, users can call any getters on the node and rely on the data being correct even if the node is marked as dirty. This is because getters do just-in-time evaluation of properties if they have not already been calculated.

In circumstances where a node must be deleted in response to signals or events, it is advisable to use CYISceneNode::RequestDeletion to ensure that the node is deleted only at the end of the frame when all potential processing on it has completed.

CYISceneNode::RequestDeletion can also be used to delete nodes from another thread, but in general scene tree modifications should be done on the main thread as operations to the scene tree are not generally thread-safe.

Scene Node Specification

Type Labels Property Description
Comment interactive Optional Setting to 'off' prevents the capturing of events on layers
Comment placeholder Optional Setting to 'true' prevents export by the You.i Engine After Effects Plug-in.

#include <scenetree/YiSceneNode.h>

Inheritance diagram for CYISceneNode:

Classes

class  Iterator
 
class  MeasureSpec
 
class  PropertyAnimation
 Class representing a node property animation. More...
 

Public Types

enum  DirtyFlag {
  DirtyClean = 0x0000,
  DirtySceneGraph = 0x0001,
  DirtyVisibility = 0x0002,
  DirtyOpacity = 0x0004,
  DirtyLocalTransform = 0x0008,
  DirtyWorldTransform = 0x0010,
  DirtyUniform = 0x0020,
  DirtyWorldBoundingBox = 0x0040,
  DirtyMesh = 0x0080,
  DirtyWorldSurfaceScale = 0x0100,
  DirtyWorldScale = 0x0200,
  DirtyLocalBoundingBox = 0x0400,
  DirtyEverything = (DirtySceneGraph | DirtyVisibility | DirtyOpacity | DirtyLocalTransform | DirtyWorldTransform | DirtyUniform | DirtyWorldBoundingBox | DirtyWorldSurfaceScale | DirtyWorldScale | DirtyLocalBoundingBox)
}
 
enum  LayoutDirtyFlag {
  LayoutClean,
  LayoutChildDirty,
  LayoutDirty
}
 
enum  LayoutConfigFetchMode {
  LAYOUT_CONFIG_DO_NOT_LAZY_INSTANTIATE = 0,
  LAYOUT_CONFIG_LAZY_INSTANTIATE
}
 
enum  MeasureMode {
  MEASURE_UNSPECIFIED,
  MEASURE_UP_TO,
  MEASURE_EXACTLY
}
 
enum  FETCH_TYPE {
  FETCH_OPTIONAL = 0,
  FETCH_MANDATORY
}
 
typedef std::reverse_iterator< IteratorReverseIterator
 
- Public Types inherited from CYIEventTarget
enum  EVENT_PHASE {
  BUBBLE,
  CAPTURE
}
 

Public Member Functions

 CYISceneNode ()
 
virtual ~CYISceneNode ()
 
virtual bool Init ()
 
void ForceDirty ()
 
void ClearDirtyFlag ()
 
void SetDirtyFlag (DirtyFlag eDirtyFlag)
 
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 nID)
 
uint64_t GetUniqueID () const
 
bool AddChild (std::unique_ptr< CYISceneNode > pSceneNode)
 
bool AddChild (std::unique_ptr< CYISceneNode >, int32_t nIndex)
 
bool InsertChildAfter (CYISceneNode *pRefNode, std::unique_ptr< CYISceneNode > pSceneNode)
 
std::unique_ptr< CYISceneNodeRemoveChild (CYISceneNode *pSceneNode)
 
bool ReorderChild (uint32_t uFromIndex, uint32_t uToIndex)
 
CYISceneNodeGetParent () const
 
bool ChangeParent (CYISceneNode *pParent)
 
CYISceneNodeGetDrawParent () const
 
bool IsAncestorOf (const CYISceneNode *pNode) const
 
CYISceneManagerGetSceneManager () const
 
uint32_t GetChildCount () const
 
uint32_t GetChildCountRecursive () const
 
CYISceneNodeGetChild (uint32_t nIndex) const
 
Iterator begin (Iterator::ITERATION_MODE eMode=Iterator::IMMEDIATE_CHILDREN) const
 
Iterator end (Iterator::ITERATION_MODE eMode=Iterator::IMMEDIATE_CHILDREN) const
 
ReverseIterator rbegin (Iterator::ITERATION_MODE eMode=Iterator::IMMEDIATE_CHILDREN) const
 
ReverseIterator rend (Iterator::ITERATION_MODE eMode=Iterator::IMMEDIATE_CHILDREN) const
 
CYISceneNodeGetChild (const CYIString &sName) const
 
uint32_t GetDrawChildCount () const
 
CYISceneNodeGetDrawChild (uint32_t uIndex) const
 
CYISceneNodeGetDrawChildByID (int32_t nID) const
 
template<class YI_SCENE_NODE_SUBCLASS >
YI_SCENE_NODE_SUBCLASS * GetChild (uint32_t uTargetMatchedNodeCount=1) const
 
template<class YI_SCENE_NODE_SUBCLASS >
std::list< YI_SCENE_NODE_SUBCLASS * > GetChildren () const
 
int32_t GetIndexOfChild (const CYISceneNode *pSceneNode) const
 
void Show ()
 
void Hide ()
 
void SetVisibility (bool bVisible)
 
void SetOpacity (float fOpacity)
 
float GetCompositeOpacity () const
 
float GetLocalOpacity () const
 
bool IsVisible () const
 
bool IsTrulyVisible () const
 
CYISceneNodeGetNode (const CYIString &name)
 
CYISceneNodeGetNode (const CYIString &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 (const CYIString &name)
 
CYISceneNodeGetNode (const int32_t nID)
 
CYISceneNodeGetNode (const int32_t nID, const CYIRuntimeTypeInfo &enforceClassType)
 
template<class YI_SCENE_NODE_SUBCLASS >
bool FindNode (YI_SCENE_NODE_SUBCLASS *&pNode, const CYIString &nodeName, FETCH_TYPE eType, const CYIString &tag)
 
std::list< CYISceneNode * > GetNodes (const CYIString &name)
 
std::list< CYISceneNode * > GetNodes (int32_t nID)
 
std::list< CYISceneNode * > GetNodes (const CYIRuntimeTypeInfo &enforceClassType)
 
template<class YI_SCENE_NODE_SUBCLASS >
const YI_SCENE_NODE_SUBCLASS * GetNode (uint32_t uTargetMatchedNodeCount=1) const
 
template<class YI_SCENE_NODE_SUBCLASS >
YI_SCENE_NODE_SUBCLASS * GetNode (uint32_t uTargetMatchedNodeCount=1)
 
void SetMesh (const std::shared_ptr< CYIMesh > &pMesh)
 
void SetMaterial (const std::shared_ptr< CYIMaterial > &pMaterial, uint32_t nIndex=0)
 
void AddEffect (const std::shared_ptr< CYIEffect > &pEffect)
 
void RemoveEffect (const std::shared_ptr< CYIEffect > &pEffect)
 
uint32_t GetEffectCount () const
 
std::shared_ptr< CYIEffectGetEffect (uint32_t uIndex) const
 
void ConnectEffectsToTimelines (const CYITimelineTrack *pTrack)
 
void AddMask (std::unique_ptr< CYIMask > pMask)
 
std::unique_ptr< CYIMaskRemoveMask (const CYIMask *pMask)
 
uint32_t GetMaskCount () const
 
const CYIMaskGetMask (uint32_t uIndex) const
 
CYIMaskGetMask (uint32_t uIndex)
 
const std::shared_ptr< CYIMesh > & GetMesh () const
 
uint32_t GetMaterialCount () const
 
const std::shared_ptr< CYIMaterialGetMaterial (uint32_t nIndex=0) const
 
const std::shared_ptr< IYIUniformBufferObject > & GetShaderUniforms () const
 
void SetMeshTransform (const glm::mat4 &rTransform)
 
void DestroyChildren ()
 
const glm::mat4 & GetLocalTransform () const
 
const glm::mat4 & GetEffectTransform () const
 
const glm::mat4 & GetWorldTransform () const
 
bool Intersects (const CYISceneNode *pNode) const
 
void SetRenderTarget (const std::shared_ptr< CYIRenderTarget > &pRenderTarget)
 
const std::shared_ptr< CYIRenderTargetGetRenderTarget () const
 
virtual void BuildDrawList (std::vector< IYIRenderer::Command > &drawList, CYIAbstractCameraSceneNode *pCameraToDrawWith=nullptr)
 
const CYIAABBGetWorldAABB () const
 
const CYIAABBGetLocalAABB () const
 
void SetAnchorPoint (const glm::vec3 &ref)
 
void SetAnchorPoint (float fX, float fY, float fZ)
 
void SetAnchorPointX (float fX)
 
void SetAnchorPointY (float fY)
 
void SetAnchorPointZ (float fZ)
 
void SetPosition (const glm::vec3 &ref)
 
void SetPosition (float fX, float fY, float fZ)
 
void SetPositionX (float fX)
 
void SetPositionY (float fY)
 
void SetPositionZ (float fZ)
 
void SetRotation (const glm::vec3 &fEulerDegrees)
 
void SetRotation (float fPitchDegrees, float fYawDegrees, float fRollDegrees)
 
void SetRotationX (float fPitchDegrees)
 
void SetRotationY (float fYawDegrees)
 
void SetRotationZ (float fRollDegrees)
 
void SetOrientation (float fPitchDegrees, float fYawDegrees, float fRollDegrees)
 
void SetOrientation (const glm::quat &orient)
 
void SetScale (const glm::vec3 &fScaleFactors)
 
void SetScale (float fFactorX, float fFactorY, float fFactorZ)
 
void SetScaleX (float fFactor)
 
void SetScaleY (float fFactor)
 
void SetScaleZ (float fFactor)
 
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 &vSize, bool bDirtyLayout=true)
 
const glm::vec3 & GetSize () const
 
const glm::vec3 & GetInitialSize () const
 
void SetMeasuredSize (const glm::vec3 &vMeasuredSize)
 
const glm::vec3 & GetMeasuredSize () const
 
void SetInternalCustomTimelineValue (uint32_t nTrackID, const CYIVariant &value)
 
virtual void SetCustomTimelineValue (uint32_t nTrackID, const CYIVariant &value)
 
void SetClippingOn ()
 
void SetClippingOff ()
 
bool GetClipping () const
 
void SetClippingBox (const CYIAABB &rWorldBox)
 
const CYIAABBGetClippingBox () const
 
void StartPropertyAnimation (YI_NODE_PROPERTY_TYPE ePropType, float fFrom, float fTo, uint32_t nDurMs, CYITimeInterpolator *pTimeInterpolator=nullptr, bool bDirtyLayout=true)
 
void StopPropertyAnimation (YI_NODE_PROPERTY_TYPE ePropType)
 
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 &rWorldSpaceRay) const
 
bool IsMeshHit (const CYIRay &rWorldSpaceRay) const
 
void DumpTree () const
 
void StartCaptureKeyboardEvents ()
 
void StopCaptureKeyboardEvents ()
 
void StartCaptureTrackpadEvents ()
 
void StopCaptureTrackpadEvents ()
 
void StartCapturePointerEvents (uint8_t uPointerID)
 
void StopCapturePointerEvents (uint8_t uPointerID)
 
bool DrawBehindChildren (CYISceneNode *pSceneNode)
 
bool DrawInFrontOfChildren (CYISceneNode *pSceneNode)
 
bool DrawBehind (CYISceneNode *pSceneNode)
 
bool DrawInFront (CYISceneNode *pSceneNode)
 
bool IsFocusRoot () const
 
void SetIsFocusRoot (bool bIsFocusRoot)
 
virtual void OnFocusGainedInDescendants ()
 
virtual void FocusGainedInDescendants ()
 
virtual void OnFocusLostInDescendants ()
 
virtual void FocusLostInDescendants ()
 
virtual void OnFocusChangedInDescendants ()
 
virtual void FocusChangedInDescendants ()
 
virtual bool ContainsFocusableDescendant (const CYIFocusSearchOptions &options=CYIFocusSearchOptions()) const
 
void ShowPointerDebugNode (CYIActionEvent *pActionEvent)
 
void SetUseLocalTransformAndAlpha (bool bUse)
 
virtual bool GetProperty (const CYIString &rPropertyName, CYIString *pValue) const override
 
virtual const std::map< CYIString, CYIString > & GetProperties () const override
 
void SetProperty (const CYIString &rPropertyName, const CYIString &rPropertyValue)
 
const std::shared_ptr< CYISceneNodeProxy > & GetSceneNodeProxy () const
 
void SetLayoutConfig (std::unique_ptr< CYILayoutConfig > pLayoutConfig)
 
const CYILayoutConfigGetLayoutConfig (LayoutConfigFetchMode eFetchMode=LAYOUT_CONFIG_LAZY_INSTANTIATE) const
 
CYILayoutConfigGetLayoutConfig (LayoutConfigFetchMode eFetchMode=LAYOUT_CONFIG_LAZY_INSTANTIATE)
 
void SetLayoutState (std::unique_ptr< CYILayoutState > pLayoutState)
 
const CYILayoutStateGetLayoutState () const
 
CYILayoutStateGetLayoutState ()
 
void RequestLayout ()
 
LayoutDirtyFlag GetLayoutDirtyFlag () const
 
virtual void SetLayoutDirtyFlag (LayoutDirtyFlag eFlag)
 
virtual void Measure (const MeasureSpec &widthSpec, const MeasureSpec &heightSpec, const MeasureSpec &depthSpec)
 
virtual void ApplyMeasurements ()
 
CYIAbstractCameraSceneNodeFindActiveCamera () const
 
template<typename T >
bool CanCastTo () const
 
- Public Member Functions inherited from CYIEventTarget
 CYIEventTarget ()
 
virtual ~CYIEventTarget ()
 
bool AddEventListener (YI_EVENT_TYPE eEventType, CYIEventHandler *pListener, EVENT_PHASE ePhase=BUBBLE)
 
bool RemoveEventListener (YI_EVENT_TYPE eEventType, CYIEventHandler *pListener, EVENT_PHASE ePhase=BUBBLE)
 
void SetSpecialTypeFlag (YI_SPECIAL_EVENT_TARGET_TYPE eType)
 
void ClearSpecialTypeFlag (YI_SPECIAL_EVENT_TARGET_TYPE eType)
 
YI_SPECIAL_EVENT_TARGET_TYPE GetSpecialTypes () const
 
- 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)
 
- Public Member Functions inherited from CYISignalHandler
 CYISignalHandler ()
 
 CYISignalHandler (const CYISignalHandler &rSignalHandler)
 
virtual ~CYISignalHandler ()
 
CYISignalHandleroperator= (const CYISignalHandler &rSignalHandler)
 
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 &rThreadAffinity)
 
virtual bool IsConnected () const
 
virtual bool IsConnected (const CYISignalBase &rSignal) const
 
void Disconnect (CYISignalBase &rSignal)
 
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 ()
 

Static Public Member Functions

static void RegisterAllSceneNodes ()
 

Public Attributes

CYISignal< CYISceneNode *, YI_NODE_PROPERTY_TYPEPropertyAnimationComplete
 
CYISignal DescendantGainedFocus
 Emitted when focus has entered this tree. More...
 
CYISignal DescendantLostFocus
 Emitted when focus has left this tree. More...
 
CYISignal DescendantsChangedFocus
 Emitted when focus has changed within this tree. More...
 

Static Public Attributes

static const float OPACITY_NOT_VISIBLE_EPSILON
 

Protected Member Functions

void Update (bool bForceDirty=false)
 
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 WorldScaleUpdated ()
 
virtual void OnWorldSurfaceScaleUpdated ()
 
virtual void WorldSurfaceScaleUpdated ()
 
virtual void OnVisibilityUpdated ()
 
virtual void VisibilityUpdated ()
 
virtual void OnCompositeOpacityUpdated ()
 
virtual void CompositeOpacityUpdated ()
 
virtual void OnWorldBoundingBoxUpdated ()
 
virtual void WorldBoundingBoxUpdated ()
 
virtual void OnLocalBoundingBoxUpdated ()
 
virtual void LocalBoundingBoxUpdated ()
 
virtual void OnChildAdded (CYISceneNode *pChild)
 
virtual void ChildAdded (CYISceneNode *pChild)
 
virtual void OnChildRemoved (CYISceneNode *pChild)
 
virtual void ChildRemoved (CYISceneNode *pChild)
 
virtual void OnSizeChanged ()
 
virtual void SizeChanged ()
 
virtual void CalculateLocalTransform (glm::mat4 *pTransform) const
 
virtual void ChildNeedsLayout ()
 
virtual void LayoutDirtied ()
 
virtual void OnChildVisibilityChanged (CYISceneNode *pChild)
 
virtual void ChildVisibilityChanged (CYISceneNode *pChild)
 
virtual bool ProcessEvent (const std::shared_ptr< CYIEventDispatcher > &pDispatcher, CYIEvent *pEvent) override
 
LayoutDirtyFlag GetCurrentLayoutDirtyFlag () const
 
virtual CYIString GetDumpTreeString () const
 
void DumpTree (int32_t nIndentLevel) const
 
void SetShaderUniforms ()
 
virtual void SetCustomUniforms ()
 
template<class T >
void SetNodeType ()
 
virtual CYISceneNodeGetNodeFromChildren (const CYIString &name)
 
virtual CYISceneNodeGetNodeFromChildren (const int32_t nID)
 
virtual CYISceneNodeGetNodeFromChildren (const CYIRuntimeTypeInfo &enforceClassType)
 
CYISceneNodeGetNodeFromChildrenAfterTarget (const CYIRuntimeTypeInfo &enforceClassType, bool *pbTargetReached, CYISceneNode *pStartAfterTarget)
 
- Protected Member Functions inherited from CYIScriptableRTTIObject
virtual std::pair< const CYIRuntimeTypeInfo *, const void * > GetRuntimeTypeInfoWithObject () const =0
 

Protected Attributes

CYIString m_name
 
CYISceneNodem_pParent
 
CYISceneNodem_pDrawParent
 
CYISceneManagerm_pSceneManager
 
std::vector< std::unique_ptr< CYISceneNode > > m_children
 
std::vector< CYISceneNode * > m_drawChildren
 
std::map< CYIString, CYIStringm_Properties
 
std::vector< std::shared_ptr< CYIMaterial > > m_pMaterials
 
std::vector< std::unique_ptr< CYIMask > > m_Masks
 
std::vector< std::shared_ptr< CYIEffect > > m_Effects
 
std::vector< PropertyAnimation * > m_propertyAnimations
 
float m_fLocalOpacity
 
CYIAABB m_WSClipBox
 
glm::mat4 m_EffectTransform
 
glm::quat m_Orientation
 
glm::vec3 m_Rotate
 
glm::vec3 m_AnchorPoint
 
glm::vec3 m_Position
 
glm::vec3 m_Scale
 
glm::vec3 m_vSize
 
glm::vec3 m_vInitialSize
 
glm::vec3 m_vMeasuredSize
 
glm::vec3 m_vlsLastCollision
 
bool m_bClip
 
bool m_bIsRotated
 
bool m_bIsOriented
 
bool m_bLocalVisibility
 
int32_t m_nID
 
uint64_t m_uGUID
 
std::shared_ptr< CYIRenderTargetm_pRenderTarget
 
std::shared_ptr< CYIMeshm_pMesh
 
std::shared_ptr< IYIUniformBufferObjectm_pShaderUniforms
 
- Protected Attributes inherited from CYIEventTarget
YI_SPECIAL_EVENT_TARGET_TYPE m_eSpecialTypes
 
std::vector< EventListenerEntry > m_listeners
 

Friends

class CYISceneManager
 

Member Typedef Documentation

typedef std::reverse_iterator<Iterator> CYISceneNode::ReverseIterator

Member Enumeration Documentation

Enumerator
DirtyClean 
DirtySceneGraph 

Indicates that the scene graph is dirty and requires an update pass. Setting this flag recurses automatically through all ancestors.

DirtyVisibility 

Indicates that the visibility of the node changed, and that the absolute visibility of the node needs to be re-calculated. Setting this flag recurses automatically through all children and will emit a DirtySceneGraph recursively to all ancestors

DirtyOpacity 

Indicates that the opacity of the node changed, and that the composite opacity of the node needs to be re-calculated. Setting this flag recurses automatically through all children and will emit a DirtySceneGraph recursively to all ancestors

DirtyLocalTransform 

Indicates that the local transform of the node needs to be recalculated. This dirty flag will also automatically emit DirtyWorldTransform to all children, DirtyWorldBoundingBox to all children and ancestors, DirtySceneGraph to all ancestors, and DirtyLocalBoundingBox to all ancestors.

DirtyWorldTransform 

Indicates that the world transform needs to be re-calculated. This flag is normally emitted automatically when using DirtyLocalTransform, and should normally not be called directly. This will automatically recurse to all children and ancestors, and will also recursively set DirtyWorldBoundingBox to all children and ancestors, and DirtySceneGraph to all the ancestors.

DirtyUniform 

Indicates that a uniform buffer needs to be re-uploaded to the GPU. This flag is non-recursive, but will recursively emit DirtySceneGraph to all ancestors.

DirtyWorldBoundingBox 

Indicates that the world bounding box needs to be re-calculated. Like DirtySceneGraph, this flag automatically recurses through all ancestors. Will also emit DirtySceneGraph through all ancestors.

DirtyMesh 

Indiates that a new mesh was set on the node. Will automatically emit DirtyUniform on the node and DirtyWorldBoundingBox recursively to all ancestors. Will also emit DirtySceneGraph through all ancestors. DirtyLocalBoundingBox will also be set on the node and all ancestors.

This is a placeholder flag that only represents its side effects. It will never be directly reflected in the dirty flags.

DirtyWorldSurfaceScale 

Indicates that the scale of the node or its parent or its nearest render target's scaling factor changed, and that the world surface scaling factor of the node needs to be re-calculated. Setting this flag recurses automatically through all children and will emit DirtyWorldSurfaceScale recursively to all ancestors.

DirtyWorldScale 

Indicates that the scale of the node or its parent changed, and that the world scaling factor of the node needs to be re-calculated. Setting this flag recurses automatically through all children and will emit DirtyWorldScale recursively to all ancestors.

DirtyLocalBoundingBox 

Indicates that the local bounding box needs to be re-calculated. This flag automatically recurses through all ancestors. DirtyWorldBoundingBox will also be set on the node and all ancestors, and DirtySceneGraph will be set on all ancestors.

DirtyEverything 

Dirties everything except DirtyMesh. DirtyMesh is a placeholder flag that only represents its side effects. This is the flag used by ForceDirty().

Used in CYISceneNode::FindNode or CYISceneView::FindTimeline to specify whether the search target is mandatory (meaning an error will be logged if it is not found), or optional.

Enumerator
FETCH_OPTIONAL 

This node or timeline is optional, no logging occurs if it is not found.

FETCH_MANDATORY 

The node or timeline is mandatory, an error will be logged if it is not found.

Enumerator
LAYOUT_CONFIG_DO_NOT_LAZY_INSTANTIATE 

Indicates that a CYILayoutConfig object instance should not automatically be created if one does not exist already.

LAYOUT_CONFIG_LAZY_INSTANTIATE 

Indicates that a CYILayoutConfig object instance should automatically be created and assigned if one does not exist already.

Enumerator
LayoutClean 

Indicates that this node (and all of its children) do not require a re-layout.

LayoutChildDirty 

Indicates that this node does not require a re-layout, but one or more of its children does.

LayoutDirty 

Indicates that this node requires a re-layout.

Enumerator
MEASURE_UNSPECIFIED 

Indicates that the measure size is unspecified (and thus the size can be anything)

MEASURE_UP_TO 

Indicates that the size can be up to the provided measure size.

MEASURE_EXACTLY 

Indicates that the size should be exactly the provided measure size (if possible).

Constructor & Destructor Documentation

CYISceneNode::CYISceneNode ( )
virtual CYISceneNode::~CYISceneNode ( )
virtual

Member Function Documentation

bool CYISceneNode::AddChild ( std::unique_ptr< CYISceneNode pSceneNode)

Adds a child to this node.

By default the child will be pushed at the end of the child list meaning that it will be drawn over top of its siblings.

The function will return false if the pSceneNode already has a parent or if pSceneNode is this node.

bool CYISceneNode::AddChild ( std::unique_ptr< CYISceneNode ,
int32_t  nIndex 
)

Adds a child to this node.

The child will be added at nIndex into the child list.

The function will return false if the pSceneNode already has a parent or if pSceneNode is this node.

void CYISceneNode::AddEffect ( const std::shared_ptr< CYIEffect > &  pEffect)

Adds an effect to this node. If pEffect is null it will be ignored. Effects are processed during the construction of the draw list.

void CYISceneNode::AddMask ( std::unique_ptr< CYIMask pMask)

Adds a mask to this node. If pMask is null it will be ignored. Masks are processed during the construction of the draw list.

Note
This node takes ownership of pMask.
virtual void CYISceneNode::ApplyMeasurements ( )
virtual

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 in CYIScrollingView, CYISceneView, CYITextSceneNode, CYIImageView, and CYIListView.

Iterator CYISceneNode::begin ( Iterator::ITERATION_MODE  eMode = Iterator::IMMEDIATE_CHILDREN) const

Returns the iterator to the first node in the iteration sequence.

virtual bool CYISceneNode::BroadcastEvent ( const std::shared_ptr< CYIEventDispatcher > &  pDispatcher,
CYIEvent pEvent 
)
virtual

Recursively broadcasts an event to the node's children, then offers it to the node itself.

Reimplemented in CYIScrollingView.

virtual void CYISceneNode::BuildDrawList ( std::vector< IYIRenderer::Command > &  drawList,
CYIAbstractCameraSceneNode pCameraToDrawWith = nullptr 
)
virtual

Interal use only, this function will construct the list of render actions required to render the data contained in the subtree rooted at this node. Specify the camera used to draw with pCameraToDrawWith. The camera must be a draw-child of the node and be visible.

Warning
Override at your own risk; no guarantee of consistent behaviour.

Reimplemented in CYIScrollingView, and CYISceneView.

virtual void CYISceneNode::CalculateLocalTransform ( glm::mat4 *  pTransform) const
protectedvirtual
template<typename T >
bool CYISceneNode::CanCastTo ( ) const

Returns true if this object's type is T or a subtype of T.

Note
This is equivalent to using GetRuntimeTypeInfo().CanCastTo<T>(), but is optimized to run faster with certain built-in types such as scene views and cameras.
bool CYISceneNode::ChangeParent ( CYISceneNode pParent)

Changes the pParent of this node and updates the former parent, to remove this node as a child. By default this node will be pushed at the end of the child list of the new parent meaning that it will be drawn over top of its new siblings. Returns true if the node's parent has been changed.

Note
If this node does not currently have a parent, this function has no effect and false is returned.
virtual void CYISceneNode::ChildAdded ( CYISceneNode pChild)
protectedvirtual

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 in CYIScrollingView, and CYISceneView.

virtual void CYISceneNode::ChildNeedsLayout ( )
protectedvirtual

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 in CYISceneView.

virtual void CYISceneNode::ChildRemoved ( CYISceneNode pChild)
protectedvirtual

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 in CYIScrollingView, and CYISceneView.

virtual void CYISceneNode::ChildVisibilityChanged ( CYISceneNode pChild)
protectedvirtual

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 in CYISceneView.

void CYISceneNode::ClearDirtyFlag ( )

Clears the dirty flags applied to this node and its children.

Warning
This function is recursive.
virtual void CYISceneNode::CompositeOpacityUpdated ( )
protectedvirtual

Called by Update() when the transform update process is complete and only when the composite opacity 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
GetCompositeOpacity
Warning
Overrides must call the base class implementation.
See also
Update()
OnCompositeOpacityUpdated()
void CYISceneNode::ConnectEffectsToTimelines ( const CYITimelineTrack pTrack)

The provided pTrack will be used to drive the node's effects.

Note
This node does not take ownership of pTrack.
virtual bool CYISceneNode::ContainsFocusableDescendant ( const CYIFocusSearchOptions options = CYIFocusSearchOptions()) const
virtual

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 in CYIScrollingView, and yi::deprecated::CYIListView.

void CYISceneNode::DestroyChildren ( )

Recursively destroys the children of this node. Note that data will be deleted, this is not the same as remove.

virtual void CYISceneNode::DirtyFlagChanged ( )
protectedvirtual

This hook provides subclasses a means to react to dirty state changes. When a node has its dirty flag changed, the callback will be triggered immediately on that node. If any upward or downward recursion is required as a result of the dirty flag change, the callbacks on those nodes will be triggered outward from this node, first in the parent direction then in the child direction.

Considering the following lineage:

A -> B -> C -> D -> E

When C's dirty flag is changed, the sequence of OnDirtyFlagChanged() calls (assuming all flags change) will be

C -> B -> A -> D -> E

Note
This hook is called when the 'live' dirty flag is changed, not when the 'frame' dirty flag is changed. However, whenever the 'frame' dirty flag is changed the 'live' dirty flag is typically also changed.
This hook is not called when a dirty flag is 'cleared'.
Warning
Using SetDirtyFlag() within this function may cause another invocation of this function
See also
SetDirtyFlag(DirtyFlag)
Warning
Overrides must call the base class implementation.
See also
OnDirtyFlagChanged()
bool CYISceneNode::DrawBehind ( CYISceneNode pSceneNode)

This node is inserted into pSceneNode's parent's draw order behind pSceneNode.

Returns false if pSceneNode doesn't exist, if pSceneNode is this node, or if pSceneNode doesn't have a draw parent.

bool CYISceneNode::DrawBehindChildren ( CYISceneNode pSceneNode)

This node is inserted into the draw order behind the other children of pSceneNode.

Returns false if pSceneNode doesn't exist, or if pSceneNode is this node.

bool CYISceneNode::DrawInFront ( CYISceneNode pSceneNode)

This node is inserted into pSceneNode's parent's draw order in front of pSceneNode.

Returns false if pSceneNode doesn't exist, if pSceneNode is this node, or if pSceneNode doesn't have a draw parent.

bool CYISceneNode::DrawInFrontOfChildren ( CYISceneNode pSceneNode)

This node is inserted into the draw order above the other children of pSceneNode.

Returns false if pSceneNode doesn't exist, or if pSceneNode is this node.

void CYISceneNode::DumpTree ( ) const

Dumps an xml-formatted representation of this subtree to the console.

The log tag used is "CYISceneNode::DumpTree" at YI_LOG_DEBUG level. To see these logs in your application, ensure that debug level logs for this tag are enabled.

See also
CYILogger
CYIPreferences
void CYISceneNode::DumpTree ( int32_t  nIndentLevel) const
protected

nIndentLevel specifies the number of tabs (4 spaces) for this output level. This is a recursive call and nIndentLevel will be incremented automatically at each level so the output looks like a tree.

Iterator CYISceneNode::end ( Iterator::ITERATION_MODE  eMode = Iterator::IMMEDIATE_CHILDREN) const

Returns the position after the last node in the iteration sequence.

CYIAbstractCameraSceneNode* CYISceneNode::FindActiveCamera ( ) const

The active camera is the last encountered visible child of this node which is also a camera node. The order the children are encountered in is defined by the draw order.

template<class YI_SCENE_NODE_SUBCLASS >
bool CYISceneNode::FindNode ( YI_SCENE_NODE_SUBCLASS *&  pNode,
const CYIString nodeName,
FETCH_TYPE  eType,
const CYIString tag 
)

The node's descendants will be searched to locate a pNode with nodeName matching YI_SCENE_NODE_SUBCLASS.

Returns false if the node is not found or if it is not of type YI_SCENE_NODE_SUBCLASS.

Logs an error if eType is CYISceneNode::FETCH_MANDATORY and the node is not found. The provided tag will be used when logging.

See also
GetNode()
virtual void CYISceneNode::FocusChangedInDescendants ( )
virtual
Note
The base implementation must be called.
See also
OnFocusChangedInDescendants()

Reimplemented in CYIScrollingView, yi::deprecated::CYIListView, and CYIFocusZoneView.

virtual void CYISceneNode::FocusGainedInDescendants ( )
virtual
Note
The base implementation must be called.
See also
OnFocusGainedInDescendants()

Reimplemented in CYIScrollingView, yi::deprecated::CYIListView, and CYIFocusZoneView.

virtual void CYISceneNode::FocusLostInDescendants ( )
virtual
Note
The base implementation must be called.
See also
OnFocusLostInDescendants
void CYISceneNode::ForceDirty ( )

Fully dirties the node, triggering an update of its internal state.

All of the node's direct ancestors and descendants will be dirtied also.

Warning
This function is recursive.
const glm::vec3& CYISceneNode::GetAnchorPoint ( ) const

Get the anchor point for this node in its parent's space.

CYISceneNode* CYISceneNode::GetChild ( uint32_t  nIndex) const

Returns the child of this node at nIndex, or null if the index is invalid.

Note
This node retains ownership of the returned node.
CYISceneNode* CYISceneNode::GetChild ( const CYIString sName) const

Returns the first encountered child named sName or null if no such child exists.

Note
This node retains ownership of the returned node.
template<class YI_SCENE_NODE_SUBCLASS >
YI_SCENE_NODE_SUBCLASS* CYISceneNode::GetChild ( uint32_t  uTargetMatchedNodeCount = 1) const

If the node contains no children of type YI_SCENE_NODE_SUBCLASS, returns null.

If the node contains at least uTargetMatchedNodeCount children of type YI_SCENE_NODE_SUBCLASS, returns the child of that type who, in order of being encountered, matches uTargetMatchedNodeCount.

If the node contains fewer than uTargetMatchedNodeCount children of type YI_SCENE_NODE_SUBCLASS, returns the last encountered child.

Note
This node retains ownership of the returned node.
uint32_t CYISceneNode::GetChildCount ( ) const

Returns the number of children.

uint32_t CYISceneNode::GetChildCountRecursive ( ) const

Returns the total number of descendants of this node, including itself.

template<class YI_SCENE_NODE_SUBCLASS >
std::list<YI_SCENE_NODE_SUBCLASS*> CYISceneNode::GetChildren ( ) const

Returns a list of all children of type YI_SCENE_NODE_SUBCLASS.

Note
This node retains ownership of the returned nodes.
bool CYISceneNode::GetClipping ( ) const

Returns true if the node has clipping enabled, false otherwise.

const CYIAABB& CYISceneNode::GetClippingBox ( ) const

Returns the clipping volume for this node. The volume is specified in 3-dimensional world space but the clipping will be done in screen-space.

float CYISceneNode::GetCompositeOpacity ( ) const

Returns the effective opacity for this node. A value of 0.0 means not visible, and a value of 1.0 means fully visible. This may differ from the value set by SetOpacity() if a parent of this node has transparency.

LayoutDirtyFlag CYISceneNode::GetCurrentLayoutDirtyFlag ( ) const
protected

Returns the (current) layout dirty flag for this scene node.

See also
GetLayoutDirtyFlag()
DirtyFlag CYISceneNode::GetDirtyFlag ( ) const

Returns the current dirty state of the node. Will return CYIScenNode::DirtyClean if the node is clean. This is the 'frame dirty' state, which is cleared only during the node's Update call.

CYISceneNode* CYISceneNode::GetDrawChild ( uint32_t  uIndex) const

Returns the child, in the draw order, at index uIndex.

Note
The caller does not obtain ownership of the returned node.
CYISceneNode* CYISceneNode::GetDrawChildByID ( int32_t  nID) const

Returns the first child node in the draw order with the specified id, or null if no such child exists.

Note
The caller does not obtain ownership of the returned node.
uint32_t CYISceneNode::GetDrawChildCount ( ) const

Returns the total number of draw children of this node. Draw children are nodes, possibly parented to nodes other than this one, which are drawn when this node is drawn.

CYISceneNode* CYISceneNode::GetDrawParent ( ) const

Returns the parent of this node, in the draw order. Returns null if this node is a draw root.

Note
The caller does not obtain ownership of the returned node.
virtual CYIString CYISceneNode::GetDumpTreeString ( ) const
protectedvirtual

Returns a string containing useful information about this node, displayed by DumpTree

Subclasses can implement this method to specify different or additional information. Appending to the default string is recommended.

See also
DumpTree()

Reimplemented in CYITextSceneNode, CYIAbstractCameraSceneNode, CYIPerspectiveCameraSceneNode, and CYIOrthographicCameraSceneNode.

std::shared_ptr<CYIEffect> CYISceneNode::GetEffect ( uint32_t  uIndex) const

Returns the effect at uIndex.

uint32_t CYISceneNode::GetEffectCount ( ) const

Returns the number of effects applied to this node.

const glm::mat4& CYISceneNode::GetEffectTransform ( ) const

Returns a matrix representing this node's effect transform.

int32_t CYISceneNode::GetID ( ) const

Returns the ID of this node.

IDs are more likely than names to uniquely identify nodes as they are configured during import. Names can be duplicated within a single view template, but IDs are uniquely assigned from the template.

It is always best practice to do scene tree search operations like GetNode from the most immediate ancestor of your likely candidate pool.

Warning
This ID is not globally unique to this node. For a globally unique ID, use GetUniqueID().
See also
GetUniqueID()
int32_t CYISceneNode::GetIndexOfChild ( const CYISceneNode pSceneNode) const

Returns the index of pSceneNode if it is a child of this node, otherwise returns -1.

const glm::vec3& CYISceneNode::GetInitialSize ( ) const

Returns the size that this node had at initialization.

const CYILayoutConfig* CYISceneNode::GetLayoutConfig ( LayoutConfigFetchMode  eFetchMode = LAYOUT_CONFIG_LAZY_INSTANTIATE) const

Returns the layout config object assigned to this node. May be null.

Note
If eFetchMode is LAYOUT_CONFIG_LAZY_INSTANTIATE and no layout config object is currently assigned to this scene node, a new instance of CYILayoutConfig will be created, assigned to this object, and returned.
This node retains ownership of the returned layout config.
CYILayoutConfig* CYISceneNode::GetLayoutConfig ( LayoutConfigFetchMode  eFetchMode = LAYOUT_CONFIG_LAZY_INSTANTIATE)

Returns the layout config object assigned to this node. May be null.

Note
If eFetchMode is LAYOUT_CONFIG_LAZY_INSTANTIATE and no layout config object is currently assigned to this scene node, a new instance of CYILayoutConfig will be created, assigned to this object, and returned.
This node retains ownership of the returned layout config.
LayoutDirtyFlag CYISceneNode::GetLayoutDirtyFlag ( ) const

Returns the (future) layout dirty flag for this scene node.

Note
Dirtying the layout affects the next layout pass. If this function is called during a layout pass, the dirty state is only updated for the following layout pass.
See also
GetCurrentLayoutDirtyFlag()
const CYILayoutState* CYISceneNode::GetLayoutState ( ) const

Returns the layout state object assigned to this node. May be null.

Note
This node retains ownership of the returned layout config.
CYILayoutState* CYISceneNode::GetLayoutState ( )

Returns the layout state object assigned to this node. May be null.

Note
This node retains ownership of the returned layout config.
const CYIAABB& CYISceneNode::GetLocalAABB ( ) const

Returns the local axis-aligned bounding box for this node, encapsulating all of its children.

float CYISceneNode::GetLocalOpacity ( ) const

Returns the local opacity for this node. A value of 0.0 means not visible, and a value of 1.0 means fully visible.

Note that the effective opacity will be influenced by any ancestors of this node, this setting is for the local opacity of the node.

See also
GetCompositeOpacity()
const glm::mat4& CYISceneNode::GetLocalTransform ( ) const

Returns a matrix representing this node's local transform.

const CYIMask* CYISceneNode::GetMask ( uint32_t  uIndex) const

Returns the mask at uIndex.

CYIMask* CYISceneNode::GetMask ( uint32_t  uIndex)

Returns a mutable mask effect.

uint32_t CYISceneNode::GetMaskCount ( ) const

Returns the number of masks on this node.

const std::shared_ptr<CYIMaterial> CYISceneNode::GetMaterial ( uint32_t  nIndex = 0) const

Returns the material of this node at nIndex.

uint32_t CYISceneNode::GetMaterialCount ( ) const

Returns the number of materials on this node.

const glm::vec3& CYISceneNode::GetMeasuredSize ( ) const

Returns the measured size of this node. The measured size of a scene node is calculated and stored by the Measure function. It is then used by the ApplyMeasurements function to set the size of the scene node. This is part of the layout system.

const std::shared_ptr<CYIMesh>& CYISceneNode::GetMesh ( ) const

Returns the node's mesh.

const CYIString& CYISceneNode::GetName ( ) const

Returns the name of this node.

See also
SetName
CYISceneNode* CYISceneNode::GetNode ( const CYIString name)

Recursively searches this subtree to find the first node matching the provided name. Does not include 'this.' When running in debug mode, the search continues after a match is found in order to log duplicate names.

Returns null if none found.

Note
The caller does not obtain ownership of the returned node.
CYISceneNode* CYISceneNode::GetNode ( const CYIString name,
const CYIRuntimeTypeInfo enforceClassType 
)

Recursively searches this subtree to find the first node matching the provided name and enforces the provided enforceClassType. Does not include 'this.'

Returns null if none found.

Note
The caller does not obtain ownership of the returned node.
CYISceneNode* CYISceneNode::GetNode ( const CYIRuntimeTypeInfo enforceClassType)

Recursively searches this subtree to find the first node matching the class type provided. Does not include 'this.' CYIRuntimeTypeInfo Returns null if none found.

Note
The caller does not obtain ownership of the returned node.
template<class YI_SCENE_NODE_SUBCLASS >
YI_SCENE_NODE_SUBCLASS* CYISceneNode::GetNode ( const CYIString name)

Recursively searches this subtree to find the first encountered node of name matching YI_SCENE_NODE_SUBCLASS. Does not include 'this.'

If the node contains no descendants of type YI_SCENE_NODE_SUBCLASS, returns null.

If the node contains no descendants with name name, returns null.

Note
The caller does not obtain ownership of the returned node.
CYISceneNode* CYISceneNode::GetNode ( const int32_t  nID)

Recursively searches this subtree to find the first encountered node with the provided nID. Does not include 'this.'

Returns null if none found.

Note
The caller does not obtain ownership of the returned node.
CYISceneNode* CYISceneNode::GetNode ( const int32_t  nID,
const CYIRuntimeTypeInfo enforceClassType 
)

Recursively searches this subtree to find the first encountered node with the provided nID. Does not include 'this.'

Returns null if the node does not match the provided enforceClassType, or is not present in this subtree.

Note
The caller does not obtain ownership of the returned node.
template<class YI_SCENE_NODE_SUBCLASS >
const YI_SCENE_NODE_SUBCLASS* CYISceneNode::GetNode ( uint32_t  uTargetMatchedNodeCount = 1) const

Recursively searches this subtree, not including 'this.'

If the node contains no descendants of type YI_SCENE_NODE_SUBCLASS, returns null.

If the node contains at least uTargetMatchedNodeCount descendants of type YI_SCENE_NODE_SUBCLASS, returns the descendant of that type who, in order of being encountered, matches uTargetMatchedNodeCount.

If the node contains fewer than uTargetMatchedNodeCount descendants of type YI_SCENE_NODE_SUBCLASS, returns null.

Note
The caller does not obtain ownership of the returned node.
template<class YI_SCENE_NODE_SUBCLASS >
YI_SCENE_NODE_SUBCLASS* CYISceneNode::GetNode ( uint32_t  uTargetMatchedNodeCount = 1)
CYISceneNode* CYISceneNode::GetNodeAfterTarget ( const CYIRuntimeTypeInfo enforceClassType,
CYISceneNode pStartAfterTarget 
)

Recursively searches this subtree to find the first node matching the class type provided.

Returns null if none found.

Note
The caller does not obtain ownership of the returned node.
virtual CYISceneNode* CYISceneNode::GetNodeFromChildren ( const CYIString name)
protectedvirtual

Finds and returns the node with the provided name, searching the children of this node using a modified pre-order depth-first algorithm. All children are searched before their own children are searched. This node isn't checked.

virtual CYISceneNode* CYISceneNode::GetNodeFromChildren ( const int32_t  nID)
protectedvirtual

Finds and returns the node with the provided ID, searching the children of this node using a modified pre-order depth-first algorithm. All children are searched before their own children are searched. This node isn't checked.

virtual CYISceneNode* CYISceneNode::GetNodeFromChildren ( const CYIRuntimeTypeInfo enforceClassType)
protectedvirtual

Finds and returns the node with the provided class type, searching the children of this node using a modified pre-order depth-first algorithm. All children are searched before their own children are searched. This node isn't checked.

CYISceneNode* CYISceneNode::GetNodeFromChildrenAfterTarget ( const CYIRuntimeTypeInfo enforceClassType,
bool *  pbTargetReached,
CYISceneNode pStartAfterTarget 
)
protected

Finds and returns the node with the provided class type, searching the children of this node using a modified pre-order depth-first algorithm. All children are searched before their own children are searched. This node isn't checked. The node returned will be the first node encountered after pStartAfterTarget, or null if no candidates exist after the target.

std::list<CYISceneNode*> CYISceneNode::GetNodes ( const CYIString name)

Recursively searches this subtree to return a list of nodes matching the provided name. Does not include 'this.'

Returns an empty list if none found.

Note
The caller does not obtain ownership of the returned nodes.
std::list<CYISceneNode *> CYISceneNode::GetNodes ( int32_t  nID)

Recursively searches this subtree to return a list of nodes matching the provided nID. Does not include 'this.'

Returns an empty list if none found.

Note
The caller does not obtain ownership of the returned nodes.
std::list<CYISceneNode*> CYISceneNode::GetNodes ( const CYIRuntimeTypeInfo enforceClassType)

Recursively searches this subtree to return a list of nodes matching the provided enforceClassType. Does not include 'this.'

Returns an empty list if none found.

Note
The caller does not obtain ownership of the returned nodes.
const glm::quat& CYISceneNode::GetOrientation ( ) const

Get the orientation for this node, represented as a quaternion, in its parent's space.

CYISceneNode* CYISceneNode::GetParent ( ) const

Returns the parent of this node, or null if this node is a root.

Note
The caller does not obtain ownership of the returned node.
const glm::vec3& CYISceneNode::GetPosition ( ) const

Returns the position of the node in its parent's space.

DirtyFlag CYISceneNode::GetPreviousDirtyFlag ( ) const

Returns the previous dirty state of the node before update is called.

At the start of an update, the current dirty flag will be reset in order to record new dirty information from any user callback.

See also
CYISceneNode::Update(bool bForceDirty)
virtual const std::map<CYIString, CYIString>& CYISceneNode::GetProperties ( ) const
overridevirtual

Returns the map of all available properties.

Implements IYIPropertiesSource.

virtual bool CYISceneNode::GetProperty ( const CYIString propertyName,
CYIString pValue 
) const
overridevirtual

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

Implements IYIPropertiesSource.

Reimplemented in CYISceneView.

const std::shared_ptr<CYIRenderTarget> CYISceneNode::GetRenderTarget ( ) const

Returns the render target for this node.

const glm::vec3& CYISceneNode::GetRotation ( ) const

Returns the rotation of the node in its parent's space in degrees.

const glm::vec3& CYISceneNode::GetScale ( ) const

Get the scale of the node in its parent's space.

CYISceneManager* CYISceneNode::GetSceneManager ( ) const

Returns the scene manager associated with this node.

const std::shared_ptr<CYISceneNodeProxy>& CYISceneNode::GetSceneNodeProxy ( ) const

Returns the scene node's proxy tracking object. If the scene node is deleted, the proxy will turn into a no-op to prevent a segmentation fault.

const std::shared_ptr<IYIUniformBufferObject>& CYISceneNode::GetShaderUniforms ( ) const

Returns the shader uniforms that will be used for rendering this node.

const glm::vec3& CYISceneNode::GetSize ( ) const

Returns the size of this node.

uint64_t CYISceneNode::GetUniqueID ( ) const

Returns the unique ID of this node.

This ID is globally unique but won't persist over multiple sessions.

CYIString CYISceneNode::GetUniqueName ( ) const

Returns a globally unique name for this node. This is a concatenation of the node's name and unique ID ('<name>-<unique id>').

See also
GetName
GetUniqueID
const CYIAABB& CYISceneNode::GetWorldAABB ( ) const

Returns the world axis-aligned bounding box for this node, encapsulating all of its children.

const glm::vec3& CYISceneNode::GetWorldScale ( ) const

Returns the world scale of the node. This is the combined scales of this node and all of its ancestors.

const glm::vec3& CYISceneNode::GetWorldSurfaceScale ( ) const

Returns the world surface scale of the node. This is the node's world scale multiplied by the render target's pixel ratios.

const glm::mat4& CYISceneNode::GetWorldTransform ( ) const

Returns a matrix representing this node's world transform. The world transform is a concatenation of the node's local transform with the local transforms of all of its ancestors.

void CYISceneNode::Hide ( )

Hides the node.

Note
Does not affect the local or composite opacity of the node.
See also
IsVisible()
SetVisibility(bool)
bool CYISceneNode::InsertChildAfter ( CYISceneNode pRefNode,
std::unique_ptr< CYISceneNode pSceneNode 
)

Adds a child to this node. The pSceneNode will be added after pRefNode, if pRefNode is a child of this node.

The function will return false if the pSceneNode already has a parent, if pSceneNode is this node, or if pRefNode isn't a child of this node. If pRefNode isn't a child of this node, pSceneNode will be deleted.

bool CYISceneNode::Intersects ( const CYISceneNode pNode) const

Returns true if this node's bounding box intersects the bounding box of the provided pNode. The bounding box comparisons are done in world space. If the provided pNode is not a member of the same scene as this node then the comparison is undefined.

bool CYISceneNode::IsAncestorOf ( const CYISceneNode pNode) const

Returns whether this node is an ancestor of the specified node.

bool CYISceneNode::IsBoundingBoxHit ( const CYIRay rWorldSpaceRay) const

Checks whether the ray, specified in world space, will collide with our bounding box

Will also return false if the node is invisible due to opacity or visibility settings

bool CYISceneNode::IsFocusRoot ( ) const

Returns true if this node is a focus root.

When focus enters a focus root, focus will be constrained to its descendants until: it is deleted, becomes hidden, is detached from the main tree, or if there are no focus candidates among its descendents.

When focus leaves a focus root focus returns to the last view that had focus in the parent focus root. If that view is no longer focusable another view in the parent focus root will be given focus. If no views in the parent focus root are focusable focus will leave that focus root. If there are no focusable views focus will be cleared.

By default the root of the scene tree is a focus root.

Warning
Configuring a node to be a focus root when one of its descendants already has focus may have undesirable effects. To avoid this focus roots should be configured at initialization with SetIsFocusRoot().
bool CYISceneNode::IsMeshHit ( const CYIRay rWorldSpaceRay) const

Checks whether the ray, specified in world space, will collide with our mesh

Will also return false if the node is invisible due to opacity or visibility settings

See also
CYIMesh
bool CYISceneNode::IsTrulyVisible ( ) const

Returns whether this node is truly visible, meaning that all of its ancestors and the node itself are visible.

Note
This does not consider the local or composite opacity of the node.
See also
IsVisible()
bool CYISceneNode::IsVisible ( ) const

Returns true if this node is set to be visible. The node may return true but still be effectively invisible if one of its ancestors is hidden.

Note
This does not consider the local or composite opacity of the node.
See also
IsTrulyVisible()
virtual void CYISceneNode::LayoutDirtied ( )
protectedvirtual

Called when the layout dirty flag of this scene node has been set to LayoutDirty.

Warning
Overrides must call the base class implementation.

Reimplemented in CYISceneView.

virtual void CYISceneNode::LocalBoundingBoxUpdated ( )
protectedvirtual

Called by Update() when the local 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()
OnLocalBoundingBoxUpdated()
virtual void CYISceneNode::Measure ( const MeasureSpec widthSpec,
const MeasureSpec heightSpec,
const MeasureSpec depthSpec 
)
virtual

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 fSize 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 in CYIScrollingView, CYISceneView, CYITextSceneNode, CYIImageView, and CYIImageSceneNode.

virtual void CYISceneNode::OnChildAdded ( CYISceneNode pChild)
protectedvirtual

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

virtual void CYISceneNode::OnChildRemoved ( CYISceneNode pChild)
protectedvirtual

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 )
virtual void CYISceneNode::OnChildVisibilityChanged ( CYISceneNode pChild)
protectedvirtual

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

virtual void CYISceneNode::OnCompositeOpacityUpdated ( )
protectedvirtual

Called by Update() when the transform update process is complete and only when the composite opacity 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
GetCompositeOpacity
virtual void CYISceneNode::OnDirtyFlagChanged ( )
protectedvirtual

This hook provides subclasses a means to react to dirty state changes. When a node has its dirty flag changed, the callback will be triggered immediately on that node. If any upward or downward recursion is required as a result of the dirty flag change, the callbacks on those nodes will be triggered outward from this node, first in the parent direction then in the child direction.

Considering the following lineage:

A -> B -> C -> D -> E

When C's dirty flag is changed, the sequence of OnDirtyFlagChanged() calls (assuming all flags change) will be

C -> B -> A -> D -> E

Note
This hook is called when the 'live' dirty flag is changed, not when the 'frame' dirty flag is changed. However, whenever the 'frame' dirty flag is changed the 'live' dirty flag is typically also changed.
This hook is not called when a dirty flag is 'cleared'.
Warning
Using SetDirtyFlag() within this function may cause another invocation of this function
See also
SetDirtyFlag(DirtyFlag)
virtual void CYISceneNode::OnFocusChangedInDescendants ( )
virtual

Called when focus has changed within this tree.

virtual void CYISceneNode::OnFocusGainedInDescendants ( )
virtual

Called when focus has entered this tree.

See also
DescendantGainedFocus
virtual void CYISceneNode::OnFocusLostInDescendants ( )
virtual

Called when focus has left this tree.

See also
DescendantLostFocus
virtual void CYISceneNode::OnLocalBoundingBoxUpdated ( )
protectedvirtual

Called by Update() when the local 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().
virtual void CYISceneNode::OnSizeChanged ( )
protectedvirtual

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

virtual void CYISceneNode::OnTransformUpdated ( )
protectedvirtual

Called by Update() when the transform 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().
virtual void CYISceneNode::OnUpdateBegin ( )
protectedvirtual

This hook provides subclasses a means to do operations prior to update.

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().
virtual void CYISceneNode::OnUpdateEnd ( )
protectedvirtual

This hook provides subclasses a means to do operations subsequent to update. This hook is called after all children of the current node have been updated.

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().
virtual void CYISceneNode::OnVisibilityUpdated ( )
protectedvirtual

Called by Update() when the composite visibility of a class has been calculated. 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().
virtual void CYISceneNode::OnWorldBoundingBoxUpdated ( )
protectedvirtual

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().
virtual void CYISceneNode::OnWorldScaleUpdated ( )
protectedvirtual

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
virtual void CYISceneNode::OnWorldSurfaceScaleUpdated ( )
protectedvirtual

Called by Update() when the transform update process is complete and only when the world surface 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
GetWorldSurfaceScale
virtual bool CYISceneNode::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 CYIEventTarget.

Reimplemented in CYISceneView.

Returns the reverse iterator to the last node in the iteration sequence.

static void CYISceneNode::RegisterAllSceneNodes ( )
static

Called once by the framework to register all RTTI classes with the linker.

Should not be called.

std::unique_ptr<CYISceneNode> CYISceneNode::RemoveChild ( CYISceneNode pSceneNode)

Removes the child from this node.

Will return null if the node is not a child of this node.

void CYISceneNode::RemoveEffect ( const std::shared_ptr< CYIEffect > &  pEffect)

Removes an effect from this node.

std::unique_ptr<CYIMask> CYISceneNode::RemoveMask ( const CYIMask pMask)

Remove a mask from this node.

Returns the reverse iterator to the position before the first node in the iteration sequence.

bool CYISceneNode::ReorderChild ( uint32_t  uFromIndex,
uint32_t  uToIndex 
)

Moves the child present at index uFromIndex to index uToIndex.

Note
The uToIndex parameter must represent an index within a children list where the item at index uFromIndex has been removed. For example, given the children list 'A, B, C, D', if 'ReorderChid(0, 1) is called then the new children list would be 'B, A, C, D'.

Will return false if uFromIndex or uToIndex are not valid indices.

void CYISceneNode::RequestLayout ( )

Marks this scene node as needing to be laid out. This is a convenience function equivalent to SetLayoutDirtyFlag(CYISceneNode::LayoutDirty).

void CYISceneNode::SetAnchorPoint ( const glm::vec3 &  ref)

Sets the anchor point for this node. The anchor point is the point around which transformations will take place. The default anchor point is (0, 0, 0).

void CYISceneNode::SetAnchorPoint ( float  fX,
float  fY,
float  fZ 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

void CYISceneNode::SetAnchorPointX ( float  fX)

Sets the x-coordinate value for the anchor point.

void CYISceneNode::SetAnchorPointY ( float  fY)

Sets the y-coordinate value for the anchor point.

void CYISceneNode::SetAnchorPointZ ( float  fZ)

Sets the z-coordinate value for the anchor point.

void CYISceneNode::SetClippingBox ( const CYIAABB rWorldBox)

Sets the clipping volume for this node. The volume is specified in 3-dimensional world space but the clipping will be done in screen-space.

void CYISceneNode::SetClippingOff ( )

Disables 2D clipping for this node. Clipping is calculated based on the screen-space axis-aligned bounding box of this node.

void CYISceneNode::SetClippingOn ( )

Enables 2D clipping for this node. Clipping is calculated based on the screen-space axis-aligned bounding box of this node.

virtual void CYISceneNode::SetCustomTimelineValue ( uint32_t  nTrackID,
const CYIVariant value 
)
virtual

This function can be overridden to provide access for custom values when a timeline track is desired for controlling features other than internal existing functions in a scene node.

virtual void CYISceneNode::SetCustomUniforms ( )
protectedvirtual

Called by You.i Engine to prompt the scene node to configure any custom uniforms that a user would like to configure for their custom rendering pipeline. This should be overloaded in subclasses which wish to make use of custom shaders.

void CYISceneNode::SetDirtyFlag ( DirtyFlag  eDirtyFlag)

This node's dirty flag will be set to eDirtyFlag, and depending on the eDirtyFlag the node's ancestors or descendants may also be dirtied.

Warning
This function can be recursive.
void CYISceneNode::SetID ( int32_t  nID)

Sets the ID of this node.

See also
GetID(int32_t)
void CYISceneNode::SetInternalCustomTimelineValue ( uint32_t  nTrackID,
const CYIVariant value 
)

Allows custom values for effects or other internal expansions when a timeline track is desired for controlling features other than internal existing functions in a scene node.

void CYISceneNode::SetIsFocusRoot ( bool  bIsFocusRoot)
See also
IsFocusRoot()
void CYISceneNode::SetLayoutConfig ( std::unique_ptr< CYILayoutConfig pLayoutConfig)

Sets the layout config of this scene node to pLayoutConfig.

If a layout config object had already been assigned, it will be deleted.

Note
Call with nullptr to remove an already-assigned layout config object.
virtual void CYISceneNode::SetLayoutDirtyFlag ( LayoutDirtyFlag  eFlag)
virtual

Sets the (future) layout dirty flag of this scene node to eFlag.

The 'layout dirty' flag may propagate up to the parent of this scene node. If eFlag is LayoutClean, only this node's flag is set. If eFlag is LayoutChildDirty, the layout dirty flag of the parent node will be set to LayoutChildDirty if it was previously LayoutClean. If eFlag is LayoutDirty, the OnChildNeedsLayout function of the parent will be called (which itself may change the layout dirty flag of the parent)

The purpose of this relatively complex process is to implement this behaviour: if a node is being set as 'layout dirty', then its parent should also be 'layout dirty' if a layout is assigned to the parent. Otherwise, the parent should just be 'layout child dirty'.

Note
This function sets the layout dirty flag for the next layout pass. If this function is called during a layout pass, the layout dirty flag is set for the following layout pass.
void CYISceneNode::SetLayoutState ( std::unique_ptr< CYILayoutState pLayoutState)

Sets the layout state of this scene node to pLayoutState.

If a layout state object had already been assigned, it will be deleted.

Note
Call with nullptr to remove an already-assigned layout state object.
void CYISceneNode::SetMaterial ( const std::shared_ptr< CYIMaterial > &  pMaterial,
uint32_t  nIndex = 0 
)

Assigns a material to this node.

void CYISceneNode::SetMeasuredSize ( const glm::vec3 &  vMeasuredSize)

Sets the measured size to vMeasuredSize. The measured size is used by the ApplyMeasurements function to set the size of a scene node. This is part of the layout system.

void CYISceneNode::SetMesh ( const std::shared_ptr< CYIMesh > &  pMesh)

Assigns a mesh to this node.

void CYISceneNode::SetMeshTransform ( const glm::mat4 &  rTransform)

Equivalent to GetMesh()->SetTransform().

void CYISceneNode::SetName ( const CYIString name)

Sets the name of this node. Nodes can be unnamed, and names can be re-used, so IDs should be used for situations in which confidence and control are required.

See also
GetID()
template<class T >
void CYISceneNode::SetNodeType ( )
protected

Used to set the runtime type of this object to T.

Note
This function is for internal use only and will assert if called in user code.
void CYISceneNode::SetOpacity ( float  fOpacity)

Sets the opacity for this node. A value of 0.0 means not visible, and a value of 1.0 means fully visible.

Note that the effective opacity will be influenced by any ancestors of this node, this setting is for the local opacity of the node.

See also
GetCompositeOpacity()
GetLocalOpacity()
void CYISceneNode::SetOrientation ( float  fPitchDegrees,
float  fYawDegrees,
float  fRollDegrees 
)

Sets the orientation for this node as a set of euler angles (pitch, yaw, roll) in degrees.

void CYISceneNode::SetOrientation ( const glm::quat &  orient)

Sets the orientation for this node as a quaternion.

void CYISceneNode::SetPosition ( const glm::vec3 &  ref)

Sets the position for this node. This position is relative to its parent.

void CYISceneNode::SetPosition ( float  fX,
float  fY,
float  fZ 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

void CYISceneNode::SetPositionX ( float  fX)

Sets the X position for this node. This position is relative to its parent.

void CYISceneNode::SetPositionY ( float  fY)

Sets the Y position for this node. This position is relative to its parent.

void CYISceneNode::SetPositionZ ( float  fZ)

Sets the Z position for this node. This position is relative to its parent.

void CYISceneNode::SetProperty ( const CYIString rPropertyName,
const CYIString rPropertyValue 
)

Sets a property value, given a name. If the property does not exist, it is added. If it exists, the value is replaced.

void CYISceneNode::SetRenderTarget ( const std::shared_ptr< CYIRenderTarget > &  pRenderTarget)

Sets the render target for this node. This is the destination to which the node and all of its descendants will be rendered.

void CYISceneNode::SetRotation ( const glm::vec3 &  fEulerDegrees)

Sets the rotation for this node. The three components of the vector correspond to pitch, yaw, and roll, or rotations about the x, y and z axes in degrees. Rotations are expressed clockwise.

void CYISceneNode::SetRotation ( float  fPitchDegrees,
float  fYawDegrees,
float  fRollDegrees 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

void CYISceneNode::SetRotationX ( float  fPitchDegrees)

Sets the pitch for this node, in degrees.

void CYISceneNode::SetRotationY ( float  fYawDegrees)

Sets the yaw for this node, in degrees.

void CYISceneNode::SetRotationZ ( float  fRollDegrees)

Sets the roll for this node, in degrees.

void CYISceneNode::SetScale ( const glm::vec3 &  fScaleFactors)

Sets the scaling factor on all three axes.

void CYISceneNode::SetScale ( float  fFactorX,
float  fFactorY,
float  fFactorZ 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

void CYISceneNode::SetScaleX ( float  fFactor)

Sets the scaling factor on the x axis.

void CYISceneNode::SetScaleY ( float  fFactor)

Sets the scaling factor on the y axis.

void CYISceneNode::SetScaleZ ( float  fFactor)

Sets the scaling factor on the z axis.

void CYISceneNode::SetSceneManager ( CYISceneManager pSceneManager)

Sets the node's scene manager.

Note
This node does not take ownership of pSceneManager.
Warning
This must be set before Init is called.
void CYISceneNode::SetShaderUniforms ( )
protected

Called by You.i Engine to prompt the scene node to configure its shader uniforms.

virtual void CYISceneNode::SetSize ( const glm::vec3 &  vSize,
bool  bDirtyLayout = true 
)
virtual

Sets the size of this node to vSize.

Note
Changing the size of a node may affect other properties of the node (such as the mesh size or the node's scale)
Subclasses that override this function must call the OnSizeChanged function if the size changed. Subclasses that override this function should dirty the layout if the size changed and bDirtyLayout is true.

Reimplemented in CYITextSceneNode, yi::deprecated::CYIListView, CYIImageSceneNode, CYINPatchSceneNode, and CYIBitmapTextSceneNode.

void CYISceneNode::SetUseLocalTransformAndAlpha ( bool  bUse)

If enabled, this node will use its local transform and local opacity when rendering. This is used for certain effects.

void CYISceneNode::SetVisibility ( bool  bVisible)

Sets the node's visibility to bVisible.

Note
Does not affect the local or composite opacity of the node.
See also
IsVisible()
Show()
Hide()
void CYISceneNode::Show ( )

Shows the node.

Note
Does not affect the local or composite opacity of the node.
See also
IsVisible()
SetVisibility(bool)
void CYISceneNode::ShowPointerDebugNode ( CYIActionEvent pActionEvent)

Displays a visual representation of the location of this pActionEvent under this node. Useful for debugging.

virtual void CYISceneNode::SizeChanged ( )
protectedvirtual

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

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

Reimplemented in CYIScrollingView, and CYISceneView.

void CYISceneNode::StartCaptureKeyboardEvents ( )

Starts capturing keyboard events. All incoming keyboard events will subsequently be sent to this node

void CYISceneNode::StartCapturePointerEvents ( uint8_t  uPointerID)

Starts capturing pointer events. All incoming pointer events will subsequently be sent to this node, regardless of their location.

void CYISceneNode::StartCaptureTrackpadEvents ( )

Starts capturing trackpad events. All incoming trackpad events will subsequently be sent to this node.

void CYISceneNode::StartPropertyAnimation ( YI_NODE_PROPERTY_TYPE  ePropType,
float  fFrom,
float  fTo,
uint32_t  nDurMs,
CYITimeInterpolator pTimeInterpolator = nullptr,
bool  bDirtyLayout = true 
)

Starts a property animation on this node.

See also
CYISceneNode::PropertyAnimation
void CYISceneNode::StopCaptureKeyboardEvents ( )

Stops capturing keyboard events.

void CYISceneNode::StopCapturePointerEvents ( uint8_t  uPointerID)

Stops capturing pointer events.

void CYISceneNode::StopCaptureTrackpadEvents ( )

Stops capturing trackpad events.

void CYISceneNode::StopPropertyAnimation ( YI_NODE_PROPERTY_TYPE  ePropType)

Stops the property animation for property ePropType on this node.

See also
CYISceneNode::PropertyAnimation
virtual void CYISceneNode::TransformUpdated ( )
protectedvirtual

Called by Update() when the transform 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()
OnTransformUpdated()

Reimplemented in CYITextSceneNode, and CYIPerspectiveCameraSceneNode.

void CYISceneNode::Update ( bool  bForceDirty = false)
protected

Recursively updates the node and its children.

This function is typically invoked by the scene manager on each frame, if and only if the scene graph is dirty.

The bForceDirty flag will overwrite the local dirty flag if it is set to true.

See also
GetDirtyFlag()
GetPreviousDirtyFlag()
ForceDirty();
SetDirtyFlag(DirtyFlag eDirtyFlag);
virtual void CYISceneNode::UpdateBegin ( )
protectedvirtual

This hook provides subclasses a means to do operations prior to update.

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()
OnUpdateBegin()

Reimplemented in CYIVideoSurfaceView, and CYIPlatformView.

virtual void CYISceneNode::UpdateEnd ( )
protectedvirtual

This hook provides subclasses a means to do operations subsequent to update. This hook is called after all children of the current node have been updated.

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()
OnUpdateEnd()

Reimplemented in CYIScrollingView, yi::deprecated::CYIListView, CYITextSceneNode, CYITextEditView, CYIAbstractCameraSceneNode, CYIScrollBarView, CYIVideoSurfaceView, and CYIPlatformView.

void CYISceneNode::UpdateEventForLocalSpace ( CYIActionEvent pActionEvent,
glm::vec3 &  rayOrigin,
glm::vec3 &  rayNonOriginPoint 
) const

Update the event's ray for the local space of this node. This transforms the provided event such that its ray is in the local space of this scene node, taking the node's world transform and cameras into consideration.

void CYISceneNode::UpdateLocalSpaceCollision ( CYIActionEvent pActionEvent)

The provided pActionEvent is used to update the node's internal local space collision.

virtual void CYISceneNode::VisibilityUpdated ( )
protectedvirtual

Called by Update() when the composite visibility of a class has been calculated. 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()
OnVisibilityUpdated()
virtual void CYISceneNode::WorldBoundingBoxUpdated ( )
protectedvirtual

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 in CYIScrollingView, CYISceneView, and CYIListView.

virtual void CYISceneNode::WorldScaleUpdated ( )
protectedvirtual

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 in CYISceneView.

virtual void CYISceneNode::WorldSurfaceScaleUpdated ( )
protectedvirtual

Called by Update() when the transform update process is complete and only when the world surface 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
GetWorldSurfaceScale
Warning
Overrides must call the base class implementation.
See also
Update()
OnWorldSurfaceScaleUpdated()

Reimplemented in CYITextSceneNode, CYITextEditView, CYINPatchSceneNode, and CYISDFAtlasTextSceneNode.

Friends And Related Function Documentation

friend class CYISceneManager
friend

Member Data Documentation

CYISignal CYISceneNode::DescendantGainedFocus

Emitted when focus has entered this tree.

CYISignal CYISceneNode::DescendantLostFocus

Emitted when focus has left this tree.

CYISignal CYISceneNode::DescendantsChangedFocus

Emitted when focus has changed within this tree.

glm::vec3 CYISceneNode::m_AnchorPoint
protected

Node anchor point. The anchor point is the origin of all transforms.

bool CYISceneNode::m_bClip
protected

Clip enable flag

bool CYISceneNode::m_bIsOriented
protected

Helper optimization flag to see if we can perform fast matrix math

bool CYISceneNode::m_bIsRotated
protected

Helper optimization flag to see if we can perform fast matrix math

bool CYISceneNode::m_bLocalVisibility
protected

The local node visibility flag

std::vector<std::unique_ptr<CYISceneNode> > CYISceneNode::m_children
protected
std::vector<CYISceneNode *> CYISceneNode::m_drawChildren
protected
std::vector<std::shared_ptr<CYIEffect> > CYISceneNode::m_Effects
protected

The node's list of active effects

glm::mat4 CYISceneNode::m_EffectTransform
protected
float CYISceneNode::m_fLocalOpacity
protected

The local opacity for this node

std::vector<std::unique_ptr<CYIMask> > CYISceneNode::m_Masks
protected
CYIString CYISceneNode::m_name
protected
int32_t CYISceneNode::m_nID
protected

The id of this node

glm::quat CYISceneNode::m_Orientation
protected

Quaternion representation of the node orientation

CYISceneNode* CYISceneNode::m_pDrawParent
protected
std::vector<std::shared_ptr<CYIMaterial> > CYISceneNode::m_pMaterials
protected

The node's materials, if any

std::shared_ptr<CYIMesh> CYISceneNode::m_pMesh
protected

The node's mesh, if any

glm::vec3 CYISceneNode::m_Position
protected

Node position

CYISceneNode* CYISceneNode::m_pParent
protected
std::shared_ptr<CYIRenderTarget> CYISceneNode::m_pRenderTarget
protected

Destination render target

std::map<CYIString, CYIString> CYISceneNode::m_Properties
protected
std::vector<PropertyAnimation*> CYISceneNode::m_propertyAnimations
protected

The node property animations for this node

CYISceneManager* CYISceneNode::m_pSceneManager
protected
std::shared_ptr<IYIUniformBufferObject> CYISceneNode::m_pShaderUniforms
mutableprotected

The node's shader uniform configuration

glm::vec3 CYISceneNode::m_Rotate
protected

Euler angle representation of the node rotation

glm::vec3 CYISceneNode::m_Scale
protected

Scaling factor of this node on all three axes

uint64_t CYISceneNode::m_uGUID
protected

The unique id of this node

glm::vec3 CYISceneNode::m_vInitialSize
protected

The size of this node at initialization

glm::vec3 CYISceneNode::m_vlsLastCollision
protected

The node's list of active mask effects

glm::vec3 CYISceneNode::m_vMeasuredSize
protected

The measured size of this node (used by the layout system)

glm::vec3 CYISceneNode::m_vSize
protected

The size of this node

CYIAABB CYISceneNode::m_WSClipBox
protected

The world-space axis-aligned clipping box for this node

const float CYISceneNode::OPACITY_NOT_VISIBLE_EPSILON
static
CYISignal<CYISceneNode *, YI_NODE_PROPERTY_TYPE> CYISceneNode::PropertyAnimationComplete

Emitted when a node property animation is completed.


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