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.
Comment accessible Optional Enabling or disabling the accessibility
Comment accessibilityLabel Optional Setting the accessibility label
Comment accessibilityHint Optional Setting the accessibility hint
Comment accessibilityRole Optional Setting the accessibility role

#include <scenetree/YiSceneNode.h>

Inheritance diagram for CYISceneNode:

Classes

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

Public Types

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::LastMove = 0x01,
  SpecialEventTargetType::LastDown = 0x02,
  SpecialEventTargetType::PointerCapture = 0x04,
  SpecialEventTargetType::KeyboardCapture = 0x08,
  SpecialEventTargetType::Root = 0x10,
  SpecialEventTargetType::NoPick = 0x20,
  SpecialEventTargetType::TrackpadCapture = 0x40
}
 
enum  Phase : uint8_t {
  Phase::Bubble,
  Phase::Capture
}
 

Public Member Functions

 CYISceneNode ()
 
virtual ~CYISceneNode ()
 
virtual bool Init ()
 
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
 
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 (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 id)
 
CYISceneNodeGetNode (const int32_t id, const CYIRuntimeTypeInfo &enforceClassType)
 
template<class YI_SCENE_NODE_SUBCLASS >
bool FindNode (YI_SCENE_NODE_SUBCLASS *&pNode, const CYIString &nodeName, FetchType type, const CYIString &tag)
 
std::list< CYISceneNode * > GetNodes (const CYIString &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
 
std::shared_ptr< CYIEffectGetEffect (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< CYIMaterialGetMaterial (size_t index=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 &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 &rWorldBox)
 
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 &rWorldSpaceRay) const
 
bool IsMeshHit (const CYIRay &rWorldSpaceRay) 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 ()
 
virtual void FocusGainedInDescendants ()
 
virtual void OnFocusLostInDescendants ()
 
virtual void FocusLostInDescendants ()
 
virtual void OnFocusChangedInDescendants ()
 
virtual void FocusChangedInDescendants ()
 
virtual bool ContainsFocusableDescendant (const CYIFocusSearchOptions &options=CYIFocusSearchOptions()) const
 
void SetUseLocalTransformAndAlpha (bool use)
 
virtual bool GetProperty (const CYIString &rPropertyName, CYIString *pValue) const override
 
virtual const std::map< CYIString, CYIString > & GetProperties () const override
 
virtual bool HasProperties () 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 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 void Measure (const MeasureSpec &widthSpec, const MeasureSpec &heightSpec, const MeasureSpec &depthSpec)
 
virtual void ApplyMeasurements ()
 
virtual CYIAbstractCameraSceneNodeFindActiveCamera (const CYISceneNode *pTargetSceneNode=nullptr) const
 
CYIAccessibilityAttributes::Accessible GetAccessible () const
 
void SetAccessible (CYIAccessibilityAttributes::Accessible accessible)
 
const CYIAccessibilityAttributesGetAccessibilityAttributes () const
 
CYIAccessibilityAttributesGetAccessibilityAttributes ()
 
void SetAccessibilityAttributes (std::unique_ptr< CYIAccessibilityAttributes > pAttributes)
 
template<typename T >
bool CanCastTo () 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
 
- 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 *, PropertyAnimation::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...
 
CYISignal< CYIAccessibilityAttributes::AccessibleAccessibleStateChanged
 Emitted when accessible state changed. More...
 

Static Public Attributes

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)
 

Protected Member Functions

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 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 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 indentLevel) const
 
virtual void SetCustomUniforms ()
 
template<class T >
void SetNodeType ()
 
virtual CYISceneNodeGetNodeFromChildren (const CYIString &name)
 
virtual CYISceneNodeGetNodeFromChildren (const int32_t id)
 
virtual CYISceneNodeGetNodeFromChildren (const CYIRuntimeTypeInfo &enforceClassType)
 
CYISceneNodeGetNodeFromChildrenAfterTarget (const CYIRuntimeTypeInfo &enforceClassType, bool *pTargetReached, 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
 
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_localOpacity
 
CYIAABB m_WSClipBox
 
glm::mat4 m_EffectTransform
 
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::shared_ptr< CYIRenderTargetm_pRenderTarget
 
std::shared_ptr< CYIMeshm_pMesh
 
std::unique_ptr< CYINPatch > m_pNPatch
 
std::shared_ptr< CYIBitmapm_pNPatchBitmap
 
std::shared_ptr< IYIUniformBufferObjectm_pShaderUniforms
 
- Protected Attributes inherited from CYIEventTarget
std::vector< EventListenerEntry > m_listeners
 
SpecialEventTargetType m_specialTypes
 

Friends

class CYISceneManager
 

Member Typedef Documentation

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

Member Enumeration Documentation

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
Optional 

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

Mandatory 

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

Enumerator
DoNotLazyInstantiate 

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

LazyInstantiate 

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

enum CYISceneNode::LayoutDirtyFlag : uint8_t
strong
Enumerator
Clean 

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

ChildDirty 

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

Dirty 

Indicates that this node requires a re-layout.

Enumerator
Unspecified 

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

UpTo 

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

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.

Warning
The node must have an assigned CYISceneManager before this function can be called.
See also
SetSceneManager
bool CYISceneNode::AddChild ( std::unique_ptr< CYISceneNode ,
size_t  index 
)

Adds a child to this node.

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

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

Warning
The node must have an assigned CYISceneManager before this function can be called.
See also
SetSceneManager
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::Mode  mode = Iterator::Mode::ImmediateChildren) 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.

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.
Warning
The node must have an assigned CYISceneManager before this function can be called.
See also
SetSceneManager
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::ClearNPatch ( )

Clears the NPatch data for this node.

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.

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 immediately when the node is dirtied, not during Update().
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,
bool *  pChanged = nullptr 
)

This node is inserted into pSceneNode's parent's draw order behind pSceneNode. An optional bool changed is set to identify when the draw order changed.

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,
bool *  pChanged = nullptr 
)

This node is inserted into the draw order behind the other children of pSceneNode. An optional bool changed is set to identify when the draw order changed.

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

bool CYISceneNode::DrawInFront ( CYISceneNode pSceneNode,
bool *  pChanged = nullptr 
)

This node is inserted into pSceneNode's parent's draw order in front of pSceneNode. An optional bool changed is set to identify when the draw order changed.

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,
bool *  pChanged = nullptr 
)

This node is inserted into the draw order above the other children of pSceneNode. An optional bool changed is set to identify when the draw order changed.

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_LOGGING_PARAMS::Severity::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  indentLevel) const
protected

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

Iterator CYISceneNode::end ( Iterator::Mode  mode = Iterator::Mode::ImmediateChildren) const

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

virtual CYIAbstractCameraSceneNode* CYISceneNode::FindActiveCamera ( const CYISceneNode pTargetSceneNode = nullptr) const
virtual

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.

Note
This method can be overridden to find the active camera based on the child node pTargetSceneNode. Otherwise this argument is not used.

Reimplemented in CYIScrollingView.

template<class YI_SCENE_NODE_SUBCLASS >
bool CYISceneNode::FindNode ( YI_SCENE_NODE_SUBCLASS *&  pNode,
const CYIString nodeName,
FetchType  type,
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 type is CYISceneNode::FetchType::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, and CYIFocusZoneView.

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

Reimplemented in CYIScrollingView, 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 CYIAccessibilityAttributes* CYISceneNode::GetAccessibilityAttributes ( ) const

Returns the accessibility attributes for this scene node. Even if there are no attributes available, buttons and text nodes will be treated as accessible nodes by the accessibility event dispatcher.

Note
A valid pointer will be returned only when accessibility attributes have been set, otherwise nullptr will be returned. For the CYIAbstractButton, the accessibility role was already set as the "Button", so it will return a valid pointer.
See also
SetAccessibilityAttributes()
CYIAccessibilityAttributes* CYISceneNode::GetAccessibilityAttributes ( )
CYIAccessibilityAttributes::Accessible CYISceneNode::GetAccessible ( ) const

Returns the accessible state.

Button and Text nodes are accessible by default. CYIAccessibilityAttributes are in effect only when the node is accessible.

See also
SetAccessible
const glm::vec3& CYISceneNode::GetAnchorPoint ( ) const

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

CYISceneNode* CYISceneNode::GetChild ( size_t  index) const

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

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

Returns the first encountered child named name 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  targetMatchedNodeCount = 1) const

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

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

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

Note
This node retains ownership of the returned node.
size_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 ( size_t  index) const

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

Note
The caller does not obtain ownership of the returned node.
CYISceneNode* CYISceneNode::GetDrawChildByID ( int32_t  id) 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.
size_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.

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

Returns a list of all children, in the draw order, of type YI_SCENE_NODE_SUBCLASS.

Note
This node retains ownership of the returned nodes.
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 ( size_t  index) const

Returns the effect at index.

size_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()
size_t CYISceneNode::GetIndexOfChild ( const CYISceneNode pSceneNode) const

Returns the index of pSceneNode if it is a child of this node, otherwise returns std::numeric_limits<size_t>::max().

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

Returns the size that this node had at initialization.

const CYILayoutConfig* CYISceneNode::GetLayoutConfig ( LayoutConfigFetchMode  fetchMode = LayoutConfigFetchMode::LazyInstantiate) const

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

Note
If fetchMode is CYISceneNode::LayoutConfigFetchMode::LazyInstantiate 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  fetchMode = LayoutConfigFetchMode::LazyInstantiate)

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

Note
If fetchMode is CYISceneNode::LayoutConfigFetchMode::LazyInstantiate 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 ( size_t  index) const

Returns the mask at index.

CYIMask* CYISceneNode::GetMask ( size_t  index)

Returns a mutable mask effect.

size_t CYISceneNode::GetMaskCount ( ) const

Returns the number of masks on this node.

const std::shared_ptr<CYIMaterial> CYISceneNode::GetMaterial ( size_t  index = 0) const

Returns the material of this node at index.

size_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  id)

Recursively searches this subtree to find the first encountered node with the provided id. 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  id,
const CYIRuntimeTypeInfo enforceClassType 
)

Recursively searches this subtree to find the first encountered node with the provided id. 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  targetMatchedNodeCount = 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 targetMatchedNodeCount descendants of type YI_SCENE_NODE_SUBCLASS, returns the descendant of that type who, in order of being encountered, matches targetMatchedNodeCount.

If the node contains fewer than targetMatchedNodeCount 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  targetMatchedNodeCount = 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  id)
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 *  pTargetReached,
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  id)

Recursively searches this subtree to return a list of nodes matching the provided id. 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 std::shared_ptr<CYIBitmap>& CYISceneNode::GetNPatchBitmap ( ) const

Returns the node's NPatch bitmap. This should match a bitmap in the material of the node.

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()
virtual const std::map<CYIString, CYIString>& CYISceneNode::GetProperties ( ) const
overridevirtual

Returns the map of all available properties.

Note
Classes that combine properties from multiple sources may return a map that only contains some of the 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.

CYITransform* CYISceneNode::GetTransform ( )
inline
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.

Warning
The node must have an assigned CYISceneManager before this function can be called.
See also
SetSceneManager
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.

Warning
The node must have an assigned CYISceneManager before this function can be called.
See also
SetSceneManager
virtual bool CYISceneNode::HasProperties ( ) const
overridevirtual

Returns true if this source contains at least one property.

Implements IYIPropertiesSource.

Reimplemented in CYISceneView.

void CYISceneNode::Hide ( )

Hides the node.

Note
Does not affect the local or composite opacity of the node.
See also
IsVisible()
SetVisibility(bool)
virtual bool CYISceneNode::Init ( )
virtual

Initializes the scene node. Children of the scene node are also recursively initialized.

Subclasses must call CYISceneNode::Init.

Note
A CYISceneManager must be set on the node using SetSceneManager before the node can be initialized.
Warning
The node must have an assigned CYISceneManager before this function can be called.
See also
SetSceneManager

Reimplemented in CYIScrollingView, CYIImageView, CYISceneView, CYIVectorCanvasNode, CYIDrawerView, CYIPasswordTextEditView, CYIListView, CYIEpgGridView, CYIImageSceneNode, CYIScrollBarView, CYIAbstractButtonView, CYIToggleButtonView, CYITextEditView, CYIPageIndicatorView, CYIScrollingTextView, CYIVideoSurfaceView, CYIDecoratedView, CYIWebView, CYIPlatformView, CYIPlayerPreviewThumbnailView, CYIPushButtonView, CYIActivityIndicatorView, CYIPlayerTimePopupView, CYIAbstractCameraSceneNode, CYIProgressBarView, CYIStackView, and CYIRadioGroupView.

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.

Warning
The node must have an assigned CYISceneManager before this function can be called.
See also
SetSceneManager
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::IsPerceptible ( ) const

Returns whether this node is perceptible, meaning that it IsTrulyVisible and it has a perceptible amount of composite opacity.

See also
IsTrulyVisible()
GetCompositeOpacity()
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()
IsPerceptible()
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 CYISceneNode::LayoutDirtyFlag::Dirty.

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 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 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 immediately when the node is dirtied, not during Update().
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. Any changes that dirty this node are applied immediately after this function returns.

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, and after all other update hooks have been called.

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.

ReverseIterator CYISceneNode::rbegin ( Iterator::Mode  mode = Iterator::Mode::ImmediateChildren) const

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 ( size_t  fromIndex,
size_t  toIndex 
)

Moves the child present at index fromIndex to index toIndex.

Note
The toIndex parameter must represent an index within a children list where the item at index fromIndex 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 fromIndex or toIndex are not valid indices.

Warning
The node must have an assigned CYISceneManager before this function can be called.
See also
SetSceneManager
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::SetAccessibilityAttributes ( std::unique_ptr< CYIAccessibilityAttributes pAttributes)

Sets the accessibility attributes for this scene node. It will be set when a node contains accessibility label, hint, and/or actions.

Note
Even if an accessibility attributes were set, the node will not be accessible until m_accessible is set to CYIAccessibilityAttributes::Accessible::Enabled.
See also
GetAccessibilityAttributes()
void CYISceneNode::SetAccessible ( CYIAccessibilityAttributes::Accessible  accessible)

Sets the accessible state. It will emit the signal AccessibleStateChanged.

See also
GetAccessible()
void CYISceneNode::SetAnchorPoint ( const glm::vec3 &  anchorPoint)

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).

Warning
The node must have an assigned CYISceneManager before this function can be called.
See also
SetSceneManager
void CYISceneNode::SetAnchorPoint ( float  x,
float  y,
float  z 
)

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  x)

Sets the x-coordinate value for the anchor point.

void CYISceneNode::SetAnchorPointY ( float  y)

Sets the y-coordinate value for the anchor point.

void CYISceneNode::SetAnchorPointZ ( float  z)

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  trackID,
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  dirtyFlag)

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

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

Sets the ID of this node.

See also
GetID(int32_t)
void CYISceneNode::SetInternalCustomTimelineValue ( uint32_t  trackID,
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  isFocusRoot)
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  flag)
virtual

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

The 'layout dirty' flag may propagate up to the parent of this scene node. If flag is LayoutClean, only this node's flag is set. If flag is LayoutDirtyFlag::ChildDirty, the layout dirty flag of the parent node will be set to LayoutDirtyFlag::ChildDirty if it was previously LayoutClean. If flag is LayoutDirtyFlag::Dirty, 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,
size_t  index = 0 
)

Assigns a material to this node.

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

Sets the measured size to measuredSize. 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.
bool CYISceneNode::SetNPatchBitmap ( const std::shared_ptr< CYIBitmap > &  pNPatchBitmap)

Assigns an NPatch bitmap to this node. Returns false if pNPatchBitmap is not a valid NPatch bitmap.

void CYISceneNode::SetOpacity ( float  opacity)

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  pitchDegrees,
float  yawDegrees,
float  rollDegrees 
)

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

Warning
The node must have an assigned CYISceneManager before this function can be called.
See also
SetSceneManager
void CYISceneNode::SetOrientation ( const glm::quat &  orientation)

Sets the orientation for this node as a quaternion.

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

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

Warning
The node must have an assigned CYISceneManager before this function can be called.
See also
SetSceneManager
void CYISceneNode::SetPosition ( float  x,
float  y,
float  z 
)

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  x)

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

void CYISceneNode::SetPositionY ( float  y)

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

void CYISceneNode::SetPositionZ ( float  z)

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 &  rotation)

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 Euler degrees. Rotations are expressed clockwise.

Warning
The node must have an assigned CYISceneManager before this function can be called.
See also
SetSceneManager
void CYISceneNode::SetRotation ( float  pitchDegrees,
float  yawDegrees,
float  rollDegrees 
)

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  pitchDegrees)

Sets the pitch for this node, in degrees.

void CYISceneNode::SetRotationY ( float  yawDegrees)

Sets the yaw for this node, in degrees.

void CYISceneNode::SetRotationZ ( float  rollDegrees)

Sets the roll for this node, in degrees.

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

Sets the scaling factor on all three axes.

Warning
The node must have an assigned CYISceneManager before this function can be called.
See also
SetSceneManager
void CYISceneNode::SetScale ( float  factorX,
float  factorY,
float  factorZ 
)

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  factor)

Sets the scaling factor on the x axis.

void CYISceneNode::SetScaleY ( float  factor)

Sets the scaling factor on the y axis.

void CYISceneNode::SetScaleZ ( float  factor)

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
CYISceneNodes must have an assigned CYISceneManager before use.
virtual void CYISceneNode::SetSize ( const glm::vec3 &  size,
bool  dirtyLayout = true 
)
virtual

Sets the size of this node to size.

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 dirtyLayout is true.

Reimplemented in CYITextSceneNode, CYIImageSceneNode, and CYIBitmapTextSceneNode.

void CYISceneNode::SetUseLocalTransformAndAlpha ( bool  use)

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

void CYISceneNode::SetVisibility ( bool  visible)

Sets the node's visibility to visible.

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)
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, CYISceneView, and CYIVectorCanvasNode.

void CYISceneNode::StartCaptureKeyboardEvents ( )

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

void CYISceneNode::StartCapturePointerEvents ( uint8_t  pointerID)

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 ( PropertyAnimation::Type  propType,
float  from,
float  to,
uint32_t  durMs,
CYITimeInterpolator pTimeInterpolator = nullptr,
bool  dirtyLayout = true 
)

Starts a property animation on this node.

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

Stops capturing keyboard events.

void CYISceneNode::StopCapturePointerEvents ( uint8_t  pointerID)

Stops capturing pointer events.

void CYISceneNode::StopCaptureTrackpadEvents ( )

Stops capturing trackpad events.

void CYISceneNode::StopPropertyAnimation ( PropertyAnimation::Type  propType)

Stops the property animation for property propType 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 CYIPerspectiveCameraSceneNode, and CYIDecoratedView.

void CYISceneNode::Update ( )
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.

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

This hook provides subclasses a means to do operations prior to update. Any changes that dirty this node are applied immediately after this function returns.

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

Reimplemented in CYIVectorCanvasNode, and CYIDecoratedView.

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, and after all other update hooks have been called.

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, CYITextSceneNode, CYITextEditView, CYIAbstractCameraSceneNode, and CYIScrollBarView.

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, CYITextSceneNode, 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, and CYISDFAtlasTextSceneNode.

Friends And Related Function Documentation

friend class CYISceneManager
friend

Member Data Documentation

CYISignal<CYIAccessibilityAttributes::Accessible> CYISceneNode::AccessibleStateChanged

Emitted when accessible state changed.

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.

constexpr DirtyFlag CYISceneNode::DirtyClean = 0x0000
static

Indicates the the scene graph is clean.

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

constexpr DirtyFlag CYISceneNode::DirtyLocalBoundingBox = 0x0400
static

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.

constexpr DirtyFlag CYISceneNode::DirtyLocalTransform = 0x0008
static

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.

constexpr DirtyFlag CYISceneNode::DirtyMesh = 0x0080
static

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.

constexpr DirtyFlag CYISceneNode::DirtyOpacity = 0x0004
static

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

constexpr DirtyFlag CYISceneNode::DirtySceneGraph = 0x0001
static

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

constexpr DirtyFlag CYISceneNode::DirtyUniform = 0x0020
static

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.

constexpr DirtyFlag CYISceneNode::DirtyVisibility = 0x0002
static

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

constexpr DirtyFlag CYISceneNode::DirtyWorldBoundingBox = 0x0040
static

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.

constexpr DirtyFlag CYISceneNode::DirtyWorldScale = 0x0200
static

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.

constexpr DirtyFlag CYISceneNode::DirtyWorldSurfaceScale = 0x0100
static

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.

constexpr DirtyFlag CYISceneNode::DirtyWorldTransform = 0x0010
static

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.

std::vector<std::unique_ptr<CYISceneNode> > CYISceneNode::m_children
protected
bool CYISceneNode::m_clip
protected

Clip enable flag

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
uint64_t CYISceneNode::m_guid
protected

The unique id of this node

int32_t CYISceneNode::m_id
protected

The id of this node

glm::vec3 CYISceneNode::m_initialSize
protected

The size of this node at initialization

float CYISceneNode::m_localOpacity
protected

The local opacity for this node

bool CYISceneNode::m_localVisibility
protected

The local node visibility flag

std::vector<std::unique_ptr<CYIMask> > CYISceneNode::m_Masks
protected
glm::vec3 CYISceneNode::m_measuredSize
protected

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

CYIString CYISceneNode::m_name
protected
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

std::unique_ptr<CYINPatch> CYISceneNode::m_pNPatch
protected

The node's N Patch, if any

std::shared_ptr<CYIBitmap> CYISceneNode::m_pNPatchBitmap
protected

The node's mesh, if any

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

std::shared_ptr<IYIUniformBufferObject> CYISceneNode::m_pShaderUniforms
mutableprotected

The node's shader uniform configuration

std::unique_ptr<CYITransform> CYISceneNode::m_pTransform
protected
glm::vec3 CYISceneNode::m_size
protected

The size of this node

glm::vec3 CYISceneNode::m_vlsLastCollision
protected

The last ray collision with the node in local space

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 *, PropertyAnimation::Type> CYISceneNode::PropertyAnimationComplete

Emitted when a node property animation is completed.


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