A scene node is the base type for all nodes which are used by the scene manager; it is an integral part of You.i Engine and is used extensively by various parts of the framework.
The scene node is the base class for all visual elements in the framework; CYISceneView derives from this class and serves as the base class for all pre-built user interface components.
The CYISceneNode class exposes all the necessary functionality for handling input, signals, animation, and timeline updates. It also provides functions for obtaining information about scene position and size in in both local and world coordinates.
This class is the basis for constructing a scene tree. Given the nature of a node in tree based systems, nodes can be detached and placed anywhere in the scene tree. However, some nodes may have logical or visual dependencies on other nodes in the tree, and care must be taken when placing these nodes in other locations.
Masks and visual effects can be created manually or imported from After Effects; these types can be added to a scene node for use during rendering.
A scene node can also be rendered into a different render target for the purposes of off-screen rendering.
The tree structure describes a transformation stack, properties of parents are inherited into their children. Additionally a drawing order is specified that is usually equivalent to the transformation stack. CYISceneNode::DrawInFrontOfChildren, CYISceneNode::DrawBehindChildren, CYISceneNode::DrawInFront, and CYISceneNode::DrawBehind are used to modify the draw structure. Modifying this structure may be necessary in cases where a node must have its transforms relative to another node, but must not change the order in which it draws to the screen, such as when making use of the parenting feature in After Effects.
A draw list is then created based on this draw structure to represent the order in which the nodes will be drawn. For further information see the documentation provided for the above functions.
The scene tree employs a dirty flag mechanism for tracking changes to nodes during and across frames. However, users can call any getters on the node and rely on the data being correct even if the node is marked as dirty. This is because getters do just-in-time evaluation of properties if they have not already been calculated.
In circumstances where a node must be deleted in response to signals or events, it is advisable to use CYISceneNode::RequestDeletion to ensure that the node is deleted only at the end of the frame when all potential processing on it has completed.
CYISceneNode::RequestDeletion can also be used to delete nodes from another thread, but in general scene tree modifications should be done on the main thread as operations to the scene tree are not generally thread-safe.
Scene Node Specification
| Type | Labels | Property | Description |
|---|---|---|---|
| Comment | interactive | Optional | Setting to 'off' prevents the capturing of events on layers |
| Comment | placeholder | Optional | Setting to 'true' prevents export by the You.i Engine After Effects Plug-in. |
#include <scenetree/YiSceneNode.h>

Classes | |
| class | Iterator |
| class | MeasureSpec |
| class | PropertyAnimation |
| Class representing a node property animation. More... | |
Public Member Functions | |
| CYISceneNode () | |
| virtual | ~CYISceneNode () |
| virtual bool | Init () |
| void | ForceDirty () |
| void | ClearDirtyFlag () |
| void | SetDirtyFlag (DirtyFlag eDirtyFlag) |
| DirtyFlag | GetDirtyFlag () const |
| DirtyFlag | GetPreviousDirtyFlag () const |
| const CYIString & | GetName () const |
| CYIString | GetUniqueName () const |
| void | SetSceneManager (CYISceneManager *pSceneManager) |
| void | SetName (const CYIString &name) |
| int32_t | GetID () const |
| void | SetID (int32_t nID) |
| uint64_t | GetUniqueID () const |
| bool | AddChild (std::unique_ptr< CYISceneNode > pSceneNode) |
| bool | AddChild (std::unique_ptr< CYISceneNode >, int32_t nIndex) |
| bool | InsertChildAfter (CYISceneNode *pRefNode, std::unique_ptr< CYISceneNode > pSceneNode) |
| std::unique_ptr< CYISceneNode > | RemoveChild (CYISceneNode *pSceneNode) |
| bool | ReorderChild (uint32_t uFromIndex, uint32_t uToIndex) |
| CYISceneNode * | GetParent () const |
| bool | ChangeParent (CYISceneNode *pParent) |
| CYISceneNode * | GetDrawParent () const |
| bool | IsAncestorOf (const CYISceneNode *pNode) const |
| CYISceneManager * | GetSceneManager () const |
| uint32_t | GetChildCount () const |
| uint32_t | GetChildCountRecursive () const |
| CYISceneNode * | GetChild (uint32_t nIndex) const |
| Iterator | begin (Iterator::ITERATION_MODE eMode=Iterator::IMMEDIATE_CHILDREN) const |
| Iterator | end (Iterator::ITERATION_MODE eMode=Iterator::IMMEDIATE_CHILDREN) const |
| ReverseIterator | rbegin (Iterator::ITERATION_MODE eMode=Iterator::IMMEDIATE_CHILDREN) const |
| ReverseIterator | rend (Iterator::ITERATION_MODE eMode=Iterator::IMMEDIATE_CHILDREN) const |
| CYISceneNode * | GetChild (const CYIString &sName) const |
| uint32_t | GetDrawChildCount () const |
| CYISceneNode * | GetDrawChild (uint32_t uIndex) const |
| CYISceneNode * | GetDrawChildByID (int32_t nID) const |
| template<class YI_SCENE_NODE_SUBCLASS > | |
| YI_SCENE_NODE_SUBCLASS * | GetChild (uint32_t uTargetMatchedNodeCount=1) const |
| template<class YI_SCENE_NODE_SUBCLASS > | |
| std::list< YI_SCENE_NODE_SUBCLASS * > | GetChildren () const |
| int32_t | GetIndexOfChild (const CYISceneNode *pSceneNode) const |
| void | Show () |
| void | Hide () |
| void | SetVisibility (bool bVisible) |
| void | SetOpacity (float fOpacity) |
| float | GetCompositeOpacity () const |
| float | GetLocalOpacity () const |
| bool | IsVisible () const |
| bool | IsTrulyVisible () const |
| CYISceneNode * | GetNode (const CYIString &name) |
| CYISceneNode * | GetNode (const CYIString &name, const CYIRuntimeTypeInfo &enforceClassType) |
| CYISceneNode * | GetNode (const CYIRuntimeTypeInfo &enforceClassType) |
| CYISceneNode * | GetNodeAfterTarget (const CYIRuntimeTypeInfo &enforceClassType, CYISceneNode *pStartAfterTarget) |
| template<class YI_SCENE_NODE_SUBCLASS > | |
| YI_SCENE_NODE_SUBCLASS * | GetNode (const CYIString &name) |
| CYISceneNode * | GetNode (const int32_t nID) |
| CYISceneNode * | GetNode (const int32_t nID, const CYIRuntimeTypeInfo &enforceClassType) |
| template<class YI_SCENE_NODE_SUBCLASS > | |
| bool | FindNode (YI_SCENE_NODE_SUBCLASS *&pNode, const CYIString &nodeName, FETCH_TYPE eType, const CYIString &tag) |
| std::list< CYISceneNode * > | GetNodes (const CYIString &name) |
| std::list< CYISceneNode * > | GetNodes (int32_t nID) |
| std::list< CYISceneNode * > | GetNodes (const CYIRuntimeTypeInfo &enforceClassType) |
| template<class YI_SCENE_NODE_SUBCLASS > | |
| const YI_SCENE_NODE_SUBCLASS * | GetNode (uint32_t uTargetMatchedNodeCount=1) const |
| template<class YI_SCENE_NODE_SUBCLASS > | |
| YI_SCENE_NODE_SUBCLASS * | GetNode (uint32_t uTargetMatchedNodeCount=1) |
| void | SetMesh (const std::shared_ptr< CYIMesh > &pMesh) |
| void | SetMaterial (const std::shared_ptr< CYIMaterial > &pMaterial, uint32_t nIndex=0) |
| void | AddEffect (const std::shared_ptr< CYIEffect > &pEffect) |
| void | RemoveEffect (const std::shared_ptr< CYIEffect > &pEffect) |
| uint32_t | GetEffectCount () const |
| std::shared_ptr< CYIEffect > | GetEffect (uint32_t uIndex) const |
| void | ConnectEffectsToTimelines (const CYITimelineTrack *pTrack) |
| void | AddMask (std::unique_ptr< CYIMask > pMask) |
| std::unique_ptr< CYIMask > | RemoveMask (const CYIMask *pMask) |
| uint32_t | GetMaskCount () const |
| const CYIMask * | GetMask (uint32_t uIndex) const |
| CYIMask * | GetMask (uint32_t uIndex) |
| const std::shared_ptr< CYIMesh > & | GetMesh () const |
| uint32_t | GetMaterialCount () const |
| const std::shared_ptr< CYIMaterial > | GetMaterial (uint32_t nIndex=0) const |
| const std::shared_ptr< IYIUniformBufferObject > & | GetShaderUniforms () const |
| void | SetMeshTransform (const glm::mat4 &rTransform) |
| void | DestroyChildren () |
| const glm::mat4 & | GetLocalTransform () const |
| const glm::mat4 & | GetEffectTransform () const |
| const glm::mat4 & | GetWorldTransform () const |
| bool | Intersects (const CYISceneNode *pNode) const |
| void | SetRenderTarget (const std::shared_ptr< CYIRenderTarget > &pRenderTarget) |
| const std::shared_ptr< CYIRenderTarget > | GetRenderTarget () const |
| virtual void | BuildDrawList (std::vector< IYIRenderer::Command > &drawList, CYIAbstractCameraSceneNode *pCameraToDrawWith=nullptr) |
| const CYIAABB & | GetWorldAABB () const |
| const CYIAABB & | GetLocalAABB () const |
| void | SetAnchorPoint (const glm::vec3 &ref) |
| void | SetAnchorPoint (float fX, float fY, float fZ) |
| void | SetAnchorPointX (float fX) |
| void | SetAnchorPointY (float fY) |
| void | SetAnchorPointZ (float fZ) |
| void | SetPosition (const glm::vec3 &ref) |
| void | SetPosition (float fX, float fY, float fZ) |
| void | SetPositionX (float fX) |
| void | SetPositionY (float fY) |
| void | SetPositionZ (float fZ) |
| void | SetRotation (const glm::vec3 &fEulerDegrees) |
| void | SetRotation (float fPitchDegrees, float fYawDegrees, float fRollDegrees) |
| void | SetRotationX (float fPitchDegrees) |
| void | SetRotationY (float fYawDegrees) |
| void | SetRotationZ (float fRollDegrees) |
| void | SetOrientation (float fPitchDegrees, float fYawDegrees, float fRollDegrees) |
| void | SetOrientation (const glm::quat &orient) |
| void | SetScale (const glm::vec3 &fScaleFactors) |
| void | SetScale (float fFactorX, float fFactorY, float fFactorZ) |
| void | SetScaleX (float fFactor) |
| void | SetScaleY (float fFactor) |
| void | SetScaleZ (float fFactor) |
| const glm::vec3 & | GetPosition () const |
| const glm::vec3 & | GetScale () const |
| const glm::vec3 & | GetWorldScale () const |
| const glm::vec3 & | GetWorldSurfaceScale () const |
| const glm::vec3 & | GetRotation () const |
| const glm::quat & | GetOrientation () const |
| const glm::vec3 & | GetAnchorPoint () const |
| virtual void | SetSize (const glm::vec3 &vSize, bool bDirtyLayout=true) |
| const glm::vec3 & | GetSize () const |
| const glm::vec3 & | GetInitialSize () const |
| void | SetMeasuredSize (const glm::vec3 &vMeasuredSize) |
| const glm::vec3 & | GetMeasuredSize () const |
| void | SetInternalCustomTimelineValue (uint32_t nTrackID, const CYIVariant &value) |
| virtual void | SetCustomTimelineValue (uint32_t nTrackID, const CYIVariant &value) |
| void | SetClippingOn () |
| void | SetClippingOff () |
| bool | GetClipping () const |
| void | SetClippingBox (const CYIAABB &rWorldBox) |
| const CYIAABB & | GetClippingBox () const |
| void | StartPropertyAnimation (YI_NODE_PROPERTY_TYPE ePropType, float fFrom, float fTo, uint32_t nDurMs, CYITimeInterpolator *pTimeInterpolator=nullptr, bool bDirtyLayout=true) |
| void | StopPropertyAnimation (YI_NODE_PROPERTY_TYPE ePropType) |
| void | UpdateLocalSpaceCollision (CYIActionEvent *pActionEvent) |
| virtual bool | BroadcastEvent (const std::shared_ptr< CYIEventDispatcher > &pDispatcher, CYIEvent *pEvent) |
| void | UpdateEventForLocalSpace (CYIActionEvent *pActionEvent, glm::vec3 &rayOrigin, glm::vec3 &rayNonOriginPoint) const |
| bool | IsBoundingBoxHit (const CYIRay &rWorldSpaceRay) const |
| bool | IsMeshHit (const CYIRay &rWorldSpaceRay) const |
| void | DumpTree () const |
| void | StartCaptureKeyboardEvents () |
| void | StopCaptureKeyboardEvents () |
| void | StartCaptureTrackpadEvents () |
| void | StopCaptureTrackpadEvents () |
| void | StartCapturePointerEvents (uint8_t uPointerID) |
| void | StopCapturePointerEvents (uint8_t uPointerID) |
| bool | DrawBehindChildren (CYISceneNode *pSceneNode) |
| bool | DrawInFrontOfChildren (CYISceneNode *pSceneNode) |
| bool | DrawBehind (CYISceneNode *pSceneNode) |
| bool | DrawInFront (CYISceneNode *pSceneNode) |
| bool | IsFocusRoot () const |
| void | SetIsFocusRoot (bool bIsFocusRoot) |
| virtual void | OnFocusGainedInDescendants () |
| virtual void | FocusGainedInDescendants () |
| virtual void | OnFocusLostInDescendants () |
| virtual void | FocusLostInDescendants () |
| virtual void | OnFocusChangedInDescendants () |
| virtual void | FocusChangedInDescendants () |
| virtual bool | ContainsFocusableDescendant (const CYIFocusSearchOptions &options=CYIFocusSearchOptions()) const |
| void | ShowPointerDebugNode (CYIActionEvent *pActionEvent) |
| void | SetUseLocalTransformAndAlpha (bool bUse) |
| virtual bool | GetProperty (const CYIString &rPropertyName, CYIString *pValue) const override |
| virtual const std::map< CYIString, CYIString > & | GetProperties () const override |
| void | SetProperty (const CYIString &rPropertyName, const CYIString &rPropertyValue) |
| const std::shared_ptr< CYISceneNodeProxy > & | GetSceneNodeProxy () const |
| void | SetLayoutConfig (std::unique_ptr< CYILayoutConfig > pLayoutConfig) |
| const CYILayoutConfig * | GetLayoutConfig (LayoutConfigFetchMode eFetchMode=LAYOUT_CONFIG_LAZY_INSTANTIATE) const |
| CYILayoutConfig * | GetLayoutConfig (LayoutConfigFetchMode eFetchMode=LAYOUT_CONFIG_LAZY_INSTANTIATE) |
| void | SetLayoutState (std::unique_ptr< CYILayoutState > pLayoutState) |
| const CYILayoutState * | GetLayoutState () const |
| CYILayoutState * | GetLayoutState () |
| void | RequestLayout () |
| LayoutDirtyFlag | GetLayoutDirtyFlag () const |
| virtual void | SetLayoutDirtyFlag (LayoutDirtyFlag eFlag) |
| virtual void | Measure (const MeasureSpec &widthSpec, const MeasureSpec &heightSpec, const MeasureSpec &depthSpec) |
| virtual void | ApplyMeasurements () |
| CYIAbstractCameraSceneNode * | FindActiveCamera () const |
| template<typename T > | |
| bool | CanCastTo () const |
Public Member Functions inherited from CYIEventTarget | |
| CYIEventTarget () | |
| virtual | ~CYIEventTarget () |
| bool | AddEventListener (YI_EVENT_TYPE eEventType, CYIEventHandler *pListener, EVENT_PHASE ePhase=BUBBLE) |
| bool | RemoveEventListener (YI_EVENT_TYPE eEventType, CYIEventHandler *pListener, EVENT_PHASE ePhase=BUBBLE) |
| void | SetSpecialTypeFlag (YI_SPECIAL_EVENT_TARGET_TYPE eType) |
| void | ClearSpecialTypeFlag (YI_SPECIAL_EVENT_TARGET_TYPE eType) |
| YI_SPECIAL_EVENT_TARGET_TYPE | GetSpecialTypes () const |
Public Member Functions inherited from CYIScriptableRTTIObject | |
| CYIScriptableRTTIObject () | |
| virtual | ~CYIScriptableRTTIObject () |
| virtual const CYIRuntimeTypeInfo * | GetRuntimeTypeInfoForScriptObject () const override |
Public Member Functions inherited from CYIScriptableObject | |
| CYIScriptableObject () | |
| CYIScriptableObject (const CYIScriptableObject &other) | |
| CYIScriptableObject & | operator= (const CYIScriptableObject &other) |
| virtual | ~CYIScriptableObject () |
| CYIBindingImplementation * | GetBindingImplementation () const |
| void | SetBindingImplementation (CYIBindingImplementation *pBindingImplementation) |
Public Member Functions inherited from CYISignalHandler | |
| CYISignalHandler () | |
| CYISignalHandler (const CYISignalHandler &rSignalHandler) | |
| virtual | ~CYISignalHandler () |
| CYISignalHandler & | operator= (const CYISignalHandler &rSignalHandler) |
| void | MoveToThread (CYIThread *pThread) |
| This function allows the user to override the default thread affinity to any CYIThread that may or may not be running. More... | |
| CYIThreadHandle | GetThreadAffinity () const |
| void | SetThreadAffinity (const CYIThreadHandle &rThreadAffinity) |
| virtual bool | IsConnected () const |
| virtual bool | IsConnected (const CYISignalBase &rSignal) const |
| void | Disconnect (CYISignalBase &rSignal) |
| void | DisconnectFromAllSignals () |
Public Member Functions inherited from CYIThread::Listener | |
| Listener () | |
| virtual | ~Listener () |
| virtual void | OnThreadStarted (CYIThread *) |
| virtual void | OnThreadTerminated (CYIThread *) |
| virtual void | OnThreadFinished (CYIThread *) |
Public Member Functions inherited from IYIPropertiesSource | |
| virtual | ~IYIPropertiesSource () |
Static Public Member Functions | |
| static void | RegisterAllSceneNodes () |
Public Attributes | |
| CYISignal< CYISceneNode *, YI_NODE_PROPERTY_TYPE > | PropertyAnimationComplete |
| CYISignal | DescendantGainedFocus |
| Emitted when focus has entered this tree. More... | |
| CYISignal | DescendantLostFocus |
| Emitted when focus has left this tree. More... | |
| CYISignal | DescendantsChangedFocus |
| Emitted when focus has changed within this tree. More... | |
Static Public Attributes | |
| static const float | OPACITY_NOT_VISIBLE_EPSILON |
Protected Member Functions | |
| void | Update (bool bForceDirty=false) |
| virtual void | OnUpdateBegin () |
| virtual void | UpdateBegin () |
| virtual void | OnUpdateEnd () |
| virtual void | UpdateEnd () |
| virtual void | OnDirtyFlagChanged () |
| virtual void | DirtyFlagChanged () |
| virtual void | OnTransformUpdated () |
| virtual void | TransformUpdated () |
| virtual void | OnWorldScaleUpdated () |
| virtual void | WorldScaleUpdated () |
| virtual void | OnWorldSurfaceScaleUpdated () |
| virtual void | WorldSurfaceScaleUpdated () |
| virtual void | OnVisibilityUpdated () |
| virtual void | VisibilityUpdated () |
| virtual void | OnCompositeOpacityUpdated () |
| virtual void | CompositeOpacityUpdated () |
| virtual void | OnWorldBoundingBoxUpdated () |
| virtual void | WorldBoundingBoxUpdated () |
| virtual void | OnLocalBoundingBoxUpdated () |
| virtual void | LocalBoundingBoxUpdated () |
| virtual void | OnChildAdded (CYISceneNode *pChild) |
| virtual void | ChildAdded (CYISceneNode *pChild) |
| virtual void | OnChildRemoved (CYISceneNode *pChild) |
| virtual void | ChildRemoved (CYISceneNode *pChild) |
| virtual void | OnSizeChanged () |
| virtual void | SizeChanged () |
| virtual void | CalculateLocalTransform (glm::mat4 *pTransform) const |
| virtual void | ChildNeedsLayout () |
| virtual void | LayoutDirtied () |
| virtual void | OnChildVisibilityChanged (CYISceneNode *pChild) |
| virtual void | ChildVisibilityChanged (CYISceneNode *pChild) |
| virtual bool | ProcessEvent (const std::shared_ptr< CYIEventDispatcher > &pDispatcher, CYIEvent *pEvent) override |
| LayoutDirtyFlag | GetCurrentLayoutDirtyFlag () const |
| virtual CYIString | GetDumpTreeString () const |
| void | DumpTree (int32_t nIndentLevel) const |
| void | SetShaderUniforms () |
| virtual void | SetCustomUniforms () |
| template<class T > | |
| void | SetNodeType () |
| virtual CYISceneNode * | GetNodeFromChildren (const CYIString &name) |
| virtual CYISceneNode * | GetNodeFromChildren (const int32_t nID) |
| virtual CYISceneNode * | GetNodeFromChildren (const CYIRuntimeTypeInfo &enforceClassType) |
| CYISceneNode * | GetNodeFromChildrenAfterTarget (const CYIRuntimeTypeInfo &enforceClassType, bool *pbTargetReached, CYISceneNode *pStartAfterTarget) |
Protected Member Functions inherited from CYIScriptableRTTIObject | |
| virtual std::pair< const CYIRuntimeTypeInfo *, const void * > | GetRuntimeTypeInfoWithObject () const =0 |
Friends | |
| class | CYISceneManager |
| typedef std::reverse_iterator<Iterator> CYISceneNode::ReverseIterator |
| Enumerator | |
|---|---|
| DirtyClean | |
| DirtySceneGraph |
Indicates that the scene graph is dirty and requires an update pass. Setting this flag recurses automatically through all ancestors. |
| DirtyVisibility |
Indicates that the visibility of the node changed, and that the absolute visibility of the node needs to be re-calculated. Setting this flag recurses automatically through all children and will emit a DirtySceneGraph recursively to all ancestors |
| DirtyOpacity |
Indicates that the opacity of the node changed, and that the composite opacity of the node needs to be re-calculated. Setting this flag recurses automatically through all children and will emit a DirtySceneGraph recursively to all ancestors |
| DirtyLocalTransform |
Indicates that the local transform of the node needs to be recalculated. This dirty flag will also automatically emit DirtyWorldTransform to all children, DirtyWorldBoundingBox to all children and ancestors, DirtySceneGraph to all ancestors, and DirtyLocalBoundingBox to all ancestors. |
| DirtyWorldTransform |
Indicates that the world transform needs to be re-calculated. This flag is normally emitted automatically when using DirtyLocalTransform, and should normally not be called directly. This will automatically recurse to all children and ancestors, and will also recursively set DirtyWorldBoundingBox to all children and ancestors, and DirtySceneGraph to all the ancestors. |
| DirtyUniform |
Indicates that a uniform buffer needs to be re-uploaded to the GPU. This flag is non-recursive, but will recursively emit DirtySceneGraph to all ancestors. |
| DirtyWorldBoundingBox |
Indicates that the world bounding box needs to be re-calculated. Like DirtySceneGraph, this flag automatically recurses through all ancestors. Will also emit DirtySceneGraph through all ancestors. |
| DirtyMesh |
Indiates that a new mesh was set on the node. Will automatically emit DirtyUniform on the node and DirtyWorldBoundingBox recursively to all ancestors. Will also emit DirtySceneGraph through all ancestors. DirtyLocalBoundingBox will also be set on the node and all ancestors. This is a placeholder flag that only represents its side effects. It will never be directly reflected in the dirty flags. |
| DirtyWorldSurfaceScale |
Indicates that the scale of the node or its parent or its nearest render target's scaling factor changed, and that the world surface scaling factor of the node needs to be re-calculated. Setting this flag recurses automatically through all children and will emit DirtyWorldSurfaceScale recursively to all ancestors. |
| DirtyWorldScale |
Indicates that the scale of the node or its parent changed, and that the world scaling factor of the node needs to be re-calculated. Setting this flag recurses automatically through all children and will emit DirtyWorldScale recursively to all ancestors. |
| DirtyLocalBoundingBox |
Indicates that the local bounding box needs to be re-calculated. This flag automatically recurses through all ancestors. DirtyWorldBoundingBox will also be set on the node and all ancestors, and DirtySceneGraph will be set on all ancestors. |
| DirtyEverything |
Dirties everything except DirtyMesh. DirtyMesh is a placeholder flag that only represents its side effects. This is the flag used by ForceDirty(). |
Used in CYISceneNode::FindNode or CYISceneView::FindTimeline to specify whether the search target is mandatory (meaning an error will be logged if it is not found), or optional.
| Enumerator | |
|---|---|
| FETCH_OPTIONAL |
This node or timeline is optional, no logging occurs if it is not found. |
| FETCH_MANDATORY |
The node or timeline is mandatory, an error will be logged if it is not found. |
| Enumerator | |
|---|---|
| LAYOUT_CONFIG_DO_NOT_LAZY_INSTANTIATE |
Indicates that a CYILayoutConfig object instance should not automatically be created if one does not exist already. |
| LAYOUT_CONFIG_LAZY_INSTANTIATE |
Indicates that a CYILayoutConfig object instance should automatically be created and assigned if one does not exist already. |
| CYISceneNode::CYISceneNode | ( | ) |
|
virtual |
| bool CYISceneNode::AddChild | ( | std::unique_ptr< CYISceneNode > | pSceneNode | ) |
Adds a child to this node.
By default the child will be pushed at the end of the child list meaning that it will be drawn over top of its siblings.
The function will return false if the pSceneNode already has a parent or if pSceneNode is this node.
| bool CYISceneNode::AddChild | ( | std::unique_ptr< CYISceneNode > | , |
| int32_t | nIndex | ||
| ) |
Adds a child to this node.
The child will be added at nIndex into the child list.
The function will return false if the pSceneNode already has a parent or if pSceneNode is this node.
| void CYISceneNode::AddEffect | ( | const std::shared_ptr< CYIEffect > & | pEffect | ) |
Adds an effect to this node. If pEffect is null it will be ignored. Effects are processed during the construction of the draw list.
| void CYISceneNode::AddMask | ( | std::unique_ptr< CYIMask > | pMask | ) |
Adds a mask to this node. If pMask is null it will be ignored. Masks are processed during the construction of the draw list.
|
virtual |
Applies the measured sizes of this node's children.
Reimplemented in CYIScrollingView, CYISceneView, CYITextSceneNode, CYIImageView, and CYIListView.
| Iterator CYISceneNode::begin | ( | Iterator::ITERATION_MODE | eMode = Iterator::IMMEDIATE_CHILDREN | ) | const |
Returns the iterator to the first node in the iteration sequence.
|
virtual |
Recursively broadcasts an event to the node's children, then offers it to the node itself.
Reimplemented in CYIScrollingView.
|
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.
Reimplemented in CYIScrollingView, and CYISceneView.
|
protectedvirtual |
| bool CYISceneNode::CanCastTo | ( | ) | const |
Returns true if this object's type is T or a subtype of T.
| 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.
|
protectedvirtual |
Called when a scene node is added to this node's children list.
Reimplemented in CYIScrollingView, and CYISceneView.
|
protectedvirtual |
Called when a child in this scene node's children hierarchy needs to be laid out.
Reimplemented in CYISceneView.
|
protectedvirtual |
Called when a scene node is removed from this node's children list.
Reimplemented in CYIScrollingView, and CYISceneView.
|
protectedvirtual |
Called when the visibility of a child of this scene node has been modified.
Reimplemented in CYISceneView.
| void CYISceneNode::ClearDirtyFlag | ( | ) |
Clears the dirty flags applied to this node and its children.
|
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.
| void CYISceneNode::ConnectEffectsToTimelines | ( | const CYITimelineTrack * | pTrack | ) |
The provided pTrack will be used to drive the node's effects.
|
virtual |
Returns true if this node contains any descendants which can receive focus.
The default implementation returns true if CYISceneManager::CanBeFocused() returns true for any descendant and if those descendants are valid candidates according to options.
Reimplemented in CYIScrollingView, and yi::deprecated::CYIListView.
| void CYISceneNode::DestroyChildren | ( | ) |
Recursively destroys the children of this node. Note that data will be deleted, this is not the same as remove.
|
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
| bool CYISceneNode::DrawBehind | ( | CYISceneNode * | pSceneNode | ) |
This node is inserted into pSceneNode's parent's draw order behind pSceneNode.
Returns false if pSceneNode doesn't exist, if pSceneNode is this node, or if pSceneNode doesn't have a draw parent.
| bool CYISceneNode::DrawBehindChildren | ( | CYISceneNode * | pSceneNode | ) |
This node is inserted into the draw order behind the other children of pSceneNode.
Returns false if pSceneNode doesn't exist, or if pSceneNode is this node.
| bool CYISceneNode::DrawInFront | ( | CYISceneNode * | pSceneNode | ) |
This node is inserted into pSceneNode's parent's draw order in front of pSceneNode.
Returns false if pSceneNode doesn't exist, if pSceneNode is this node, or if pSceneNode doesn't have a draw parent.
| bool CYISceneNode::DrawInFrontOfChildren | ( | CYISceneNode * | pSceneNode | ) |
This node is inserted into the draw order above the other children of pSceneNode.
Returns false if pSceneNode doesn't exist, or if pSceneNode is this node.
| void CYISceneNode::DumpTree | ( | ) | const |
Dumps an xml-formatted representation of this subtree to the console.
The log tag used is "CYISceneNode::DumpTree" at YI_LOG_DEBUG level. To see these logs in your application, ensure that debug level logs for this tag are enabled.
|
protected |
nIndentLevel specifies the number of tabs (4 spaces) for this output level. This is a recursive call and nIndentLevel will be incremented automatically at each level so the output looks like a tree.
| Iterator CYISceneNode::end | ( | Iterator::ITERATION_MODE | eMode = Iterator::IMMEDIATE_CHILDREN | ) | const |
Returns the position after the last node in the iteration sequence.
| CYIAbstractCameraSceneNode* CYISceneNode::FindActiveCamera | ( | ) | const |
The active camera is the last encountered visible child of this node which is also a camera node. The order the children are encountered in is defined by the draw order.
| bool CYISceneNode::FindNode | ( | YI_SCENE_NODE_SUBCLASS *& | pNode, |
| const CYIString & | nodeName, | ||
| FETCH_TYPE | eType, | ||
| const CYIString & | tag | ||
| ) |
The node's descendants will be searched to locate a pNode with nodeName matching YI_SCENE_NODE_SUBCLASS.
Returns false if the node is not found or if it is not of type YI_SCENE_NODE_SUBCLASS.
Logs an error if eType is CYISceneNode::FETCH_MANDATORY and the node is not found. The provided tag will be used when logging.
|
virtual |
Reimplemented in CYIScrollingView, yi::deprecated::CYIListView, and CYIFocusZoneView.
|
virtual |
Reimplemented in CYIScrollingView, yi::deprecated::CYIListView, and CYIFocusZoneView.
|
virtual |
| 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.
| const glm::vec3& CYISceneNode::GetAnchorPoint | ( | ) | const |
Get the anchor point for this node in its parent's space.
| CYISceneNode* CYISceneNode::GetChild | ( | uint32_t | nIndex | ) | const |
Returns the child of this node at nIndex, or null if the index is invalid.
| CYISceneNode* CYISceneNode::GetChild | ( | const CYIString & | sName | ) | const |
Returns the first encountered child named sName or null if no such child exists.
| YI_SCENE_NODE_SUBCLASS* CYISceneNode::GetChild | ( | uint32_t | uTargetMatchedNodeCount = 1 | ) | const |
If the node contains no children of type YI_SCENE_NODE_SUBCLASS, returns null.
If the node contains at least uTargetMatchedNodeCount children of type YI_SCENE_NODE_SUBCLASS, returns the child of that type who, in order of being encountered, matches uTargetMatchedNodeCount.
If the node contains fewer than uTargetMatchedNodeCount children of type YI_SCENE_NODE_SUBCLASS, returns the last encountered child.
| uint32_t CYISceneNode::GetChildCount | ( | ) | const |
Returns the number of children.
| uint32_t CYISceneNode::GetChildCountRecursive | ( | ) | const |
Returns the total number of descendants of this node, including itself.
| std::list<YI_SCENE_NODE_SUBCLASS*> CYISceneNode::GetChildren | ( | ) | const |
Returns a list of all children of type YI_SCENE_NODE_SUBCLASS.
| 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.
|
protected |
Returns the (current) layout dirty flag for this scene node.
| DirtyFlag CYISceneNode::GetDirtyFlag | ( | ) | const |
Returns the current dirty state of the node. Will return CYIScenNode::DirtyClean if the node is clean. This is the 'frame dirty' state, which is cleared only during the node's Update call.
| CYISceneNode* CYISceneNode::GetDrawChild | ( | uint32_t | uIndex | ) | const |
Returns the child, in the draw order, at index uIndex.
| CYISceneNode* CYISceneNode::GetDrawChildByID | ( | int32_t | nID | ) | const |
Returns the first child node in the draw order with the specified id, or null if no such child exists.
| uint32_t CYISceneNode::GetDrawChildCount | ( | ) | const |
Returns the total number of draw children of this node. Draw children are nodes, possibly parented to nodes other than this one, which are drawn when this node is drawn.
| CYISceneNode* CYISceneNode::GetDrawParent | ( | ) | const |
Returns the parent of this node, in the draw order. Returns null if this node is a draw root.
|
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.
Reimplemented in CYITextSceneNode, CYIAbstractCameraSceneNode, CYIPerspectiveCameraSceneNode, and CYIOrthographicCameraSceneNode.
| std::shared_ptr<CYIEffect> CYISceneNode::GetEffect | ( | uint32_t | uIndex | ) | const |
Returns the effect at uIndex.
| uint32_t CYISceneNode::GetEffectCount | ( | ) | const |
Returns the number of effects applied to this node.
| const glm::mat4& CYISceneNode::GetEffectTransform | ( | ) | const |
Returns a matrix representing this node's effect transform.
| int32_t CYISceneNode::GetID | ( | ) | const |
Returns the ID of this node.
IDs are more likely than names to uniquely identify nodes as they are configured during import. Names can be duplicated within a single view template, but IDs are uniquely assigned from the template.
It is always best practice to do scene tree search operations like GetNode from the most immediate ancestor of your likely candidate pool.
| int32_t CYISceneNode::GetIndexOfChild | ( | const CYISceneNode * | pSceneNode | ) | const |
Returns the index of pSceneNode if it is a child of this node, otherwise returns -1.
| const glm::vec3& CYISceneNode::GetInitialSize | ( | ) | const |
Returns the size that this node had at initialization.
| const CYILayoutConfig* CYISceneNode::GetLayoutConfig | ( | LayoutConfigFetchMode | eFetchMode = LAYOUT_CONFIG_LAZY_INSTANTIATE | ) | const |
Returns the layout config object assigned to this node. May be null.
| CYILayoutConfig* CYISceneNode::GetLayoutConfig | ( | LayoutConfigFetchMode | eFetchMode = LAYOUT_CONFIG_LAZY_INSTANTIATE | ) |
Returns the layout config object assigned to this node. May be null.
| LayoutDirtyFlag CYISceneNode::GetLayoutDirtyFlag | ( | ) | const |
Returns the (future) layout dirty flag for this scene node.
| const CYILayoutState* CYISceneNode::GetLayoutState | ( | ) | const |
Returns the layout state object assigned to this node. May be null.
| CYILayoutState* CYISceneNode::GetLayoutState | ( | ) |
Returns the layout state object assigned to this node. May be null.
| 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.
| const glm::mat4& CYISceneNode::GetLocalTransform | ( | ) | const |
Returns a matrix representing this node's local transform.
| const CYIMask* CYISceneNode::GetMask | ( | uint32_t | uIndex | ) | const |
Returns the mask at uIndex.
| CYIMask* CYISceneNode::GetMask | ( | uint32_t | uIndex | ) |
Returns a mutable mask effect.
| uint32_t CYISceneNode::GetMaskCount | ( | ) | const |
Returns the number of masks on this node.
| const std::shared_ptr<CYIMaterial> CYISceneNode::GetMaterial | ( | uint32_t | nIndex = 0 | ) | const |
Returns the material of this node at nIndex.
| uint32_t CYISceneNode::GetMaterialCount | ( | ) | const |
Returns the number of materials on this node.
| const glm::vec3& CYISceneNode::GetMeasuredSize | ( | ) | const |
Returns the measured size of this node. The measured size of a scene node is calculated and stored by the Measure function. It is then used by the ApplyMeasurements function to set the size of the scene node. This is part of the layout system.
| const std::shared_ptr<CYIMesh>& CYISceneNode::GetMesh | ( | ) | const |
Returns the node's mesh.
| 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.
| 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.
| 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.
| 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.
| CYISceneNode* CYISceneNode::GetNode | ( | const int32_t | nID | ) |
Recursively searches this subtree to find the first encountered node with the provided nID. Does not include 'this.'
Returns null if none found.
| CYISceneNode* CYISceneNode::GetNode | ( | const int32_t | nID, |
| const CYIRuntimeTypeInfo & | enforceClassType | ||
| ) |
Recursively searches this subtree to find the first encountered node with the provided nID. Does not include 'this.'
Returns null if the node does not match the provided enforceClassType, or is not present in this subtree.
| const YI_SCENE_NODE_SUBCLASS* CYISceneNode::GetNode | ( | uint32_t | uTargetMatchedNodeCount = 1 | ) | const |
Recursively searches this subtree, not including 'this.'
If the node contains no descendants of type YI_SCENE_NODE_SUBCLASS, returns null.
If the node contains at least uTargetMatchedNodeCount descendants of type YI_SCENE_NODE_SUBCLASS, returns the descendant of that type who, in order of being encountered, matches uTargetMatchedNodeCount.
If the node contains fewer than uTargetMatchedNodeCount descendants of type YI_SCENE_NODE_SUBCLASS, returns null.
| YI_SCENE_NODE_SUBCLASS* CYISceneNode::GetNode | ( | uint32_t | uTargetMatchedNodeCount = 1 | ) |
| CYISceneNode* CYISceneNode::GetNodeAfterTarget | ( | const CYIRuntimeTypeInfo & | enforceClassType, |
| CYISceneNode * | pStartAfterTarget | ||
| ) |
Recursively searches this subtree to find the first node matching the class type provided.
Returns null if none found.
|
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.
|
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.
|
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.
|
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.
| std::list<CYISceneNode *> CYISceneNode::GetNodes | ( | int32_t | nID | ) |
Recursively searches this subtree to return a list of nodes matching the provided nID. Does not include 'this.'
Returns an empty list if none found.
| 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.
| 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.
| 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.
Returns the map of all available properties.
Implements IYIPropertiesSource.
|
overridevirtual |
Stores the value of a property specified by propertyName into pValue. Returns false if the property cannot be found.
Implements IYIPropertiesSource.
Reimplemented in CYISceneView.
| const std::shared_ptr<CYIRenderTarget> CYISceneNode::GetRenderTarget | ( | ) | const |
Returns the render target for this node.
| const glm::vec3& CYISceneNode::GetRotation | ( | ) | const |
Returns the rotation of the node in its parent's space in degrees.
| const glm::vec3& CYISceneNode::GetScale | ( | ) | const |
Get the scale of the node in its parent's space.
| CYISceneManager* CYISceneNode::GetSceneManager | ( | ) | const |
Returns the scene manager associated with this node.
| const std::shared_ptr<CYISceneNodeProxy>& CYISceneNode::GetSceneNodeProxy | ( | ) | const |
Returns the scene node's proxy tracking object. If the scene node is deleted, the proxy will turn into a no-op to prevent a segmentation fault.
| const std::shared_ptr<IYIUniformBufferObject>& CYISceneNode::GetShaderUniforms | ( | ) | const |
Returns the shader uniforms that will be used for rendering this node.
| const glm::vec3& CYISceneNode::GetSize | ( | ) | const |
Returns the size of this node.
| uint64_t CYISceneNode::GetUniqueID | ( | ) | const |
Returns the unique ID of this node.
This ID is globally unique but won't persist over multiple sessions.
| CYIString CYISceneNode::GetUniqueName | ( | ) | const |
Returns a globally unique name for this node. This is a concatenation of the node's name and unique ID ('<name>-<unique id>').
| const CYIAABB& CYISceneNode::GetWorldAABB | ( | ) | const |
Returns the world axis-aligned bounding box for this node, encapsulating all of its children.
| const glm::vec3& CYISceneNode::GetWorldScale | ( | ) | const |
Returns the world scale of the node. This is the combined scales of this node and all of its ancestors.
| const glm::vec3& CYISceneNode::GetWorldSurfaceScale | ( | ) | const |
Returns the world surface scale of the node. This is the node's world scale multiplied by the render target's pixel ratios.
| const glm::mat4& CYISceneNode::GetWorldTransform | ( | ) | const |
Returns a matrix representing this node's world transform. The world transform is a concatenation of the node's local transform with the local transforms of all of its ancestors.
| void CYISceneNode::Hide | ( | ) |
Hides the node.
|
virtual |
Initializes the scene node. Children of the scene node are also recursively initialized.
Subclasses must call CYISceneNode::Init.
Reimplemented in CYIScrollingView, yi::deprecated::CYIListView, CYIImageView, CYISceneView, CYIDrawerView, CYIPasswordTextEditView, CYIImageSceneNode, CYIScrollBarView, CYIAbstractButtonView, CYIToggleButtonView, CYITextEditView, yi::deprecated::CYIGridLayoutView, yi::deprecated::CYIPopupView, CYIDecoratedView, CYIScrollingTextView, CYIVideoSurfaceView, CYIWebView, CYIPushButtonView, CYIPlayerPreviewThumbnailView, CYIActivityIndicatorView, CYIPlatformView, CYIListView, CYIPageIndicatorView, CYIPlayerTimePopupView, CYIProgressBarView, CYINPatchSceneNode, 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.
| 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.
| 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
| bool CYISceneNode::IsTrulyVisible | ( | ) | const |
Returns whether this node is truly visible, meaning that all of its ancestors and the node itself are visible.
| 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.
|
protectedvirtual |
Called when the layout dirty flag of this scene node has been set to LayoutDirty.
Reimplemented in CYISceneView.
|
protectedvirtual |
Called by Update() when the local bounding box update process is complete. Subclasses may overload this function to do post-processing.
|
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.
Reimplemented in CYIScrollingView, CYISceneView, CYITextSceneNode, CYIImageView, and CYIImageSceneNode.
|
protectedvirtual |
Called when a scene node is added to this node's children list.
|
protectedvirtual |
Called when a scene node is removed from this node's children list.
|
protectedvirtual |
Called when the visibility of a child of this scene node has been modified.
|
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.
|
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
|
virtual |
Called when focus has changed within this tree.
|
virtual |
Called when focus has entered this tree.
|
virtual |
Called when focus has left this tree.
|
protectedvirtual |
Called by Update() when the local bounding box update process is complete. Subclasses may overload this function to do post-processing.
|
protectedvirtual |
Called when the size of this scene node has been changed.
|
protectedvirtual |
Called by Update() when the transform update process is complete. Subclasses may overload this function to do post-processing.
|
protectedvirtual |
This hook provides subclasses a means to do operations prior to update.
|
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.
|
protectedvirtual |
Called by Update() when the composite visibility of a class has been calculated. Subclasses may overload this function to do post-processing.
|
protectedvirtual |
Called by Update() when the world bounding box update process is complete. Subclasses may overload this function to do post-processing.
|
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.
|
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.
|
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::ITERATION_MODE | eMode = Iterator::IMMEDIATE_CHILDREN | ) | const |
Returns the reverse iterator to the last node in the iteration sequence.
|
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.
Remove a mask from this node.
| ReverseIterator CYISceneNode::rend | ( | Iterator::ITERATION_MODE | eMode = Iterator::IMMEDIATE_CHILDREN | ) | const |
Returns the reverse iterator to the position before the first node in the iteration sequence.
| bool CYISceneNode::ReorderChild | ( | uint32_t | uFromIndex, |
| uint32_t | uToIndex | ||
| ) |
Moves the child present at index uFromIndex to index uToIndex.
Will return false if uFromIndex or uToIndex are not valid indices.
| void CYISceneNode::RequestLayout | ( | ) |
Marks this scene node as needing to be laid out. This is a convenience function equivalent to SetLayoutDirtyFlag(CYISceneNode::LayoutDirty).
| void CYISceneNode::SetAnchorPoint | ( | const glm::vec3 & | ref | ) |
Sets the anchor point for this node. The anchor point is the point around which transformations will take place. The default anchor point is (0, 0, 0).
| void CYISceneNode::SetAnchorPoint | ( | float | fX, |
| float | fY, | ||
| float | fZ | ||
| ) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
| void CYISceneNode::SetAnchorPointX | ( | float | fX | ) |
Sets the x-coordinate value for the anchor point.
| void CYISceneNode::SetAnchorPointY | ( | float | fY | ) |
Sets the y-coordinate value for the anchor point.
| void CYISceneNode::SetAnchorPointZ | ( | float | fZ | ) |
Sets the z-coordinate value for the anchor point.
| void CYISceneNode::SetClippingBox | ( | const CYIAABB & | rWorldBox | ) |
Sets the clipping volume for this node. The volume is specified in 3-dimensional world space but the clipping will be done in screen-space.
| void CYISceneNode::SetClippingOff | ( | ) |
Disables 2D clipping for this node. Clipping is calculated based on the screen-space axis-aligned bounding box of this node.
| void CYISceneNode::SetClippingOn | ( | ) |
Enables 2D clipping for this node. Clipping is calculated based on the screen-space axis-aligned bounding box of this node.
|
virtual |
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.
|
protectedvirtual |
Called by You.i Engine to prompt the scene node to configure any custom uniforms that a user would like to configure for their custom rendering pipeline. This should be overloaded in subclasses which wish to make use of custom shaders.
| void CYISceneNode::SetDirtyFlag | ( | DirtyFlag | eDirtyFlag | ) |
This node's dirty flag will be set to eDirtyFlag, and depending on the eDirtyFlag the node's ancestors or descendants may also be dirtied.
| void CYISceneNode::SetID | ( | int32_t | nID | ) |
Sets the ID of this node.
| void CYISceneNode::SetInternalCustomTimelineValue | ( | uint32_t | nTrackID, |
| const CYIVariant & | value | ||
| ) |
Allows custom values for effects or other internal expansions when a timeline track is desired for controlling features other than internal existing functions in a scene node.
| void CYISceneNode::SetIsFocusRoot | ( | bool | bIsFocusRoot | ) |
| 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.
|
virtual |
Sets the (future) layout dirty flag of this scene node to eFlag.
The 'layout dirty' flag may propagate up to the parent of this scene node. If eFlag is LayoutClean, only this node's flag is set. If eFlag is LayoutChildDirty, the layout dirty flag of the parent node will be set to LayoutChildDirty if it was previously LayoutClean. If eFlag is LayoutDirty, the OnChildNeedsLayout function of the parent will be called (which itself may change the layout dirty flag of the parent)
The purpose of this relatively complex process is to implement this behaviour: if a node is being set as 'layout dirty', then its parent should also be 'layout dirty' if a layout is assigned to the parent. Otherwise, the parent should just be 'layout child dirty'.
| 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.
| void CYISceneNode::SetMaterial | ( | const std::shared_ptr< CYIMaterial > & | pMaterial, |
| uint32_t | nIndex = 0 |
||
| ) |
Assigns a material to this node.
| void CYISceneNode::SetMeasuredSize | ( | const glm::vec3 & | vMeasuredSize | ) |
Sets the measured size to vMeasuredSize. The measured size is used by the ApplyMeasurements function to set the size of a scene node. This is part of the layout system.
| void CYISceneNode::SetMesh | ( | const std::shared_ptr< CYIMesh > & | pMesh | ) |
Assigns a mesh to this node.
| void CYISceneNode::SetMeshTransform | ( | const glm::mat4 & | rTransform | ) |
Equivalent to GetMesh()->SetTransform().
| void CYISceneNode::SetName | ( | const CYIString & | name | ) |
Sets the name of this node. Nodes can be unnamed, and names can be re-used, so IDs should be used for situations in which confidence and control are required.
|
protected |
Used to set the runtime type of this object to T.
| void CYISceneNode::SetOpacity | ( | float | fOpacity | ) |
Sets the opacity for this node. A value of 0.0 means not visible, and a value of 1.0 means fully visible.
Note that the effective opacity will be influenced by any ancestors of this node, this setting is for the local opacity of the node.
| void CYISceneNode::SetOrientation | ( | float | fPitchDegrees, |
| float | fYawDegrees, | ||
| float | fRollDegrees | ||
| ) |
Sets the orientation for this node as a set of euler angles (pitch, yaw, roll) in degrees.
| void CYISceneNode::SetOrientation | ( | const glm::quat & | orient | ) |
Sets the orientation for this node as a quaternion.
| void CYISceneNode::SetPosition | ( | const glm::vec3 & | ref | ) |
Sets the position for this node. This position is relative to its parent.
| void CYISceneNode::SetPosition | ( | float | fX, |
| float | fY, | ||
| float | fZ | ||
| ) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
| void CYISceneNode::SetPositionX | ( | float | fX | ) |
Sets the X position for this node. This position is relative to its parent.
| void CYISceneNode::SetPositionY | ( | float | fY | ) |
Sets the Y position for this node. This position is relative to its parent.
| void CYISceneNode::SetPositionZ | ( | float | fZ | ) |
Sets the Z position for this node. This position is relative to its parent.
| void CYISceneNode::SetProperty | ( | const CYIString & | rPropertyName, |
| const CYIString & | rPropertyValue | ||
| ) |
Sets a property value, given a name. If the property does not exist, it is added. If it exists, the value is replaced.
| void CYISceneNode::SetRenderTarget | ( | const std::shared_ptr< CYIRenderTarget > & | pRenderTarget | ) |
Sets the render target for this node. This is the destination to which the node and all of its descendants will be rendered.
| void CYISceneNode::SetRotation | ( | const glm::vec3 & | fEulerDegrees | ) |
Sets the rotation for this node. The three components of the vector correspond to pitch, yaw, and roll, or rotations about the x, y and z axes in degrees. Rotations are expressed clockwise.
| void CYISceneNode::SetRotation | ( | float | fPitchDegrees, |
| float | fYawDegrees, | ||
| float | fRollDegrees | ||
| ) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
| void CYISceneNode::SetRotationX | ( | float | fPitchDegrees | ) |
Sets the pitch for this node, in degrees.
| void CYISceneNode::SetRotationY | ( | float | fYawDegrees | ) |
Sets the yaw for this node, in degrees.
| void CYISceneNode::SetRotationZ | ( | float | fRollDegrees | ) |
Sets the roll for this node, in degrees.
| void CYISceneNode::SetScale | ( | const glm::vec3 & | fScaleFactors | ) |
Sets the scaling factor on all three axes.
| void CYISceneNode::SetScale | ( | float | fFactorX, |
| float | fFactorY, | ||
| float | fFactorZ | ||
| ) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
| void CYISceneNode::SetScaleX | ( | float | fFactor | ) |
Sets the scaling factor on the x axis.
| void CYISceneNode::SetScaleY | ( | float | fFactor | ) |
Sets the scaling factor on the y axis.
| void CYISceneNode::SetScaleZ | ( | float | fFactor | ) |
Sets the scaling factor on the z axis.
| void CYISceneNode::SetSceneManager | ( | CYISceneManager * | pSceneManager | ) |
Sets the node's scene manager.
|
protected |
Called by You.i Engine to prompt the scene node to configure its shader uniforms.
|
virtual |
Sets the size of this node to vSize.
Reimplemented in CYITextSceneNode, yi::deprecated::CYIListView, CYIImageSceneNode, CYINPatchSceneNode, and CYIBitmapTextSceneNode.
| void CYISceneNode::SetUseLocalTransformAndAlpha | ( | bool | bUse | ) |
If enabled, this node will use its local transform and local opacity when rendering. This is used for certain effects.
| void CYISceneNode::SetVisibility | ( | bool | bVisible | ) |
Sets the node's visibility to bVisible.
| void CYISceneNode::Show | ( | ) |
Shows the node.
| void CYISceneNode::ShowPointerDebugNode | ( | CYIActionEvent * | pActionEvent | ) |
Displays a visual representation of the location of this pActionEvent under this node. Useful for debugging.
|
protectedvirtual |
Called when the size of this scene node has been changed.
Reimplemented in CYIScrollingView, and CYISceneView.
| void CYISceneNode::StartCaptureKeyboardEvents | ( | ) |
Starts capturing keyboard events. All incoming keyboard events will subsequently be sent to this node
| void CYISceneNode::StartCapturePointerEvents | ( | uint8_t | uPointerID | ) |
Starts capturing pointer events. All incoming pointer events will subsequently be sent to this node, regardless of their location.
| void CYISceneNode::StartCaptureTrackpadEvents | ( | ) |
Starts capturing trackpad events. All incoming trackpad events will subsequently be sent to this node.
| void CYISceneNode::StartPropertyAnimation | ( | YI_NODE_PROPERTY_TYPE | ePropType, |
| float | fFrom, | ||
| float | fTo, | ||
| uint32_t | nDurMs, | ||
| CYITimeInterpolator * | pTimeInterpolator = nullptr, |
||
| bool | bDirtyLayout = true |
||
| ) |
Starts a property animation on this node.
| void CYISceneNode::StopCaptureKeyboardEvents | ( | ) |
Stops capturing keyboard events.
| void CYISceneNode::StopCapturePointerEvents | ( | uint8_t | uPointerID | ) |
Stops capturing pointer events.
| void CYISceneNode::StopCaptureTrackpadEvents | ( | ) |
Stops capturing trackpad events.
| void CYISceneNode::StopPropertyAnimation | ( | YI_NODE_PROPERTY_TYPE | ePropType | ) |
Stops the property animation for property ePropType on this node.
|
protectedvirtual |
Called by Update() when the transform update process is complete. Subclasses may overload this function to do post-processing.
Reimplemented in CYITextSceneNode, and CYIPerspectiveCameraSceneNode.
|
protected |
Recursively updates the node and its children.
This function is typically invoked by the scene manager on each frame, if and only if the scene graph is dirty.
The bForceDirty flag will overwrite the local dirty flag if it is set to true.
|
protectedvirtual |
This hook provides subclasses a means to do operations prior to update.
Reimplemented in CYIVideoSurfaceView, and CYIPlatformView.
|
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.
Reimplemented in CYIScrollingView, yi::deprecated::CYIListView, CYITextSceneNode, CYITextEditView, CYIAbstractCameraSceneNode, CYIScrollBarView, CYIVideoSurfaceView, and CYIPlatformView.
| void CYISceneNode::UpdateEventForLocalSpace | ( | CYIActionEvent * | pActionEvent, |
| glm::vec3 & | rayOrigin, | ||
| glm::vec3 & | rayNonOriginPoint | ||
| ) | const |
Update the event's ray for the local space of this node. This transforms the provided event such that its ray is in the local space of this scene node, taking the node's world transform and cameras into consideration.
| void CYISceneNode::UpdateLocalSpaceCollision | ( | CYIActionEvent * | pActionEvent | ) |
The provided pActionEvent is used to update the node's internal local space collision.
|
protectedvirtual |
Called by Update() when the composite visibility of a class has been calculated. Subclasses may overload this function to do post-processing.
|
protectedvirtual |
Called by Update() when the world bounding box update process is complete. Subclasses may overload this function to do post-processing.
Reimplemented in CYIScrollingView, CYISceneView, and CYIListView.
|
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.
Reimplemented in CYISceneView.
|
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.
Reimplemented in CYITextSceneNode, CYITextEditView, CYINPatchSceneNode, and CYISDFAtlasTextSceneNode.
|
friend |
| 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.
|
protected |
Node anchor point. The anchor point is the origin of all transforms.
|
protected |
Clip enable flag
|
protected |
Helper optimization flag to see if we can perform fast matrix math
|
protected |
Helper optimization flag to see if we can perform fast matrix math
|
protected |
The local node visibility flag
|
protected |
|
protected |
|
protected |
The node's list of active effects
|
protected |
|
protected |
The local opacity for this node
|
protected |
|
protected |
|
protected |
The id of this node
|
protected |
Quaternion representation of the node orientation
|
protected |
|
protected |
The node's materials, if any
|
protected |
The node's mesh, if any
|
protected |
Node position
|
protected |
|
protected |
Destination render target
|
protected |
The node property animations for this node
|
protected |
|
mutableprotected |
The node's shader uniform configuration
|
protected |
Euler angle representation of the node rotation
|
protected |
Scaling factor of this node on all three axes
|
protected |
The unique id of this node
|
protected |
The size of this node at initialization
|
protected |
The node's list of active mask effects
|
protected |
The measured size of this node (used by the layout system)
|
protected |
The size of this node
|
protected |
The world-space axis-aligned clipping box for this node
|
static |
| CYISignal<CYISceneNode *, YI_NODE_PROPERTY_TYPE> CYISceneNode::PropertyAnimationComplete |
Emitted when a node property animation is completed.