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>
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< Iterator > | ReverseIterator |
typedef uint16_t | DirtyFlag |
![]() | |
enum | SpecialEventTargetType : uint8_t { SpecialEventTargetType::None = 0x00, SpecialEventTargetType::NoPick = 0x20 } |
enum | Phase : uint8_t { Phase::Bubble, Phase::Capture } |
Public Member Functions | |
CYISceneNode () | |
virtual | ~CYISceneNode () |
virtual bool | Init () |
bool | IsInitialized () const |
void | ForceDirty () |
void | SetDirtyFlag (DirtyFlag dirtyFlag) |
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 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< CYISceneNode > | RemoveChild (CYISceneNode *pSceneNode) |
bool | ReorderChild (size_t fromIndex, size_t toIndex) |
CYITransform * | GetTransform () |
CYISceneNode * | GetParent () const |
bool | ChangeParent (CYISceneNode *pParent) |
CYISceneNode * | GetDrawParent () const |
bool | IsAncestorOf (const CYISceneNode *pNode) const |
CYISceneManager * | GetSceneManager () const |
size_t | GetChildCount () const |
uint32_t | GetChildCountRecursive () const |
CYISceneNode * | GetChild (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 |
CYISceneNode * | GetChild (const CYIString &name) const |
size_t | GetDrawChildCount () const |
CYISceneNode * | GetDrawChild (size_t index) const |
CYISceneNode * | GetDrawChildByID (int32_t id) const |
template<class YI_SCENE_NODE_SUBCLASS > | |
YI_SCENE_NODE_SUBCLASS * | GetChild (uint32_t targetMatchedNodeCount=1) const |
template<class YI_SCENE_NODE_SUBCLASS > | |
std::list< YI_SCENE_NODE_SUBCLASS * > | GetChildren () const |
template<class YI_SCENE_NODE_SUBCLASS > | |
std::list< YI_SCENE_NODE_SUBCLASS * > | GetDrawChildren () const |
size_t | GetIndexOfChild (const CYISceneNode *pSceneNode) const |
size_t | GetIndexOfDrawChild (const CYISceneNode *pSceneNode) const |
void | Show () |
void | Hide () |
void | SetVisibility (bool visible) |
void | SetOpacity (float opacity) |
float | GetCompositeOpacity () const |
float | GetLocalOpacity () const |
bool | IsVisible () const |
bool | IsTrulyVisible () const |
bool | IsPerceptible () const |
CYISceneNode * | GetNode (CYIStringView name) |
CYISceneNode * | GetNode (CYIStringView 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 (CYIStringView name) |
CYISceneNode * | GetNode (const int32_t id) |
CYISceneNode * | GetNode (const int32_t id, const CYIRuntimeTypeInfo &enforceClassType) |
CYISceneNode * | GetNodeWithUniqueID (uint64_t uniqueID) |
template<class YI_SCENE_NODE_SUBCLASS > | |
bool | FindNode (YI_SCENE_NODE_SUBCLASS *&pNode, CYIStringView nodeName, FetchType type, const CYIString &tag) |
std::list< CYISceneNode * > | GetNodes (CYIStringView name) |
std::list< CYISceneNode * > | GetNodes (int32_t id) |
std::list< CYISceneNode * > | GetNodes (const CYIRuntimeTypeInfo &enforceClassType) |
template<class YI_SCENE_NODE_SUBCLASS > | |
const YI_SCENE_NODE_SUBCLASS * | GetNode (uint32_t targetMatchedNodeCount=1) const |
template<class YI_SCENE_NODE_SUBCLASS > | |
YI_SCENE_NODE_SUBCLASS * | GetNode (uint32_t targetMatchedNodeCount=1) |
void | SetMesh (const std::shared_ptr< CYIMesh > &pMesh) |
bool | SetNPatchBitmap (const std::shared_ptr< CYIBitmap > &pNPatchBitmap) |
void | ClearNPatch () |
void | SetMaterial (const std::shared_ptr< CYIMaterial > &pMaterial, size_t index=0) |
void | AddEffect (const std::shared_ptr< CYIEffect > &pEffect) |
void | RemoveEffect (const std::shared_ptr< CYIEffect > &pEffect) |
size_t | GetEffectCount () const |
const std::shared_ptr< CYIEffect > & | GetEffect (size_t index) const |
void | ConnectEffectsToTimelines (const CYITimelineTrack *pTrack) |
void | AddMask (std::unique_ptr< CYIMask > pMask) |
std::unique_ptr< CYIMask > | RemoveMask (const CYIMask *pMask) |
size_t | GetMaskCount () const |
const CYIMask * | GetMask (size_t index) const |
CYIMask * | GetMask (size_t index) |
const std::shared_ptr< CYIMesh > & | GetMesh () const |
const std::shared_ptr< CYIBitmap > & | GetNPatchBitmap () const |
size_t | GetMaterialCount () const |
const std::shared_ptr< CYIMaterial > & | GetMaterial (size_t index=0) const |
const std::shared_ptr< IYIUniformBufferObject > & | GetShaderUniforms () const |
void | SetMeshTransform (const glm::mat4 &transform) |
void | DestroyChildren () |
glm::mat4 | GetLocalTransform () const |
glm::mat4 | GetWorldTransform () const |
bool | Intersects (const CYISceneNode *pNode) const |
void | SetRenderTarget (const std::shared_ptr< CYIRenderTarget > &pRenderTarget) |
const std::shared_ptr< CYIRenderTarget > & | GetRenderTarget () const |
virtual void | OnPreBuildDrawList (std::vector< IYIRenderer::Command > *pDrawList, std::vector< CYIAbstractCameraSceneNode *> *pDrawWithCameraList) |
virtual void | OnPostBuildDrawList (std::vector< IYIRenderer::Command > *pDrawList) |
const CYIAABB & | GetWorldAABB () const |
const CYIAABB & | GetLocalAABB () const |
void | SetAnchorPoint (const glm::vec3 &anchorPoint) |
void | SetAnchorPoint (float x, float y, float z) |
void | SetAnchorPointX (float x) |
void | SetAnchorPointY (float y) |
void | SetAnchorPointZ (float z) |
void | SetPosition (const glm::vec3 &position) |
void | SetPosition (float x, float y, float z) |
void | SetPositionX (float x) |
void | SetPositionY (float y) |
void | SetPositionZ (float z) |
void | SetRotation (const glm::vec3 &rotation) |
void | SetRotation (float pitchDegrees, float yawDegrees, float rollDegrees) |
void | SetRotationX (float pitchDegrees) |
void | SetRotationY (float yawDegrees) |
void | SetRotationZ (float rollDegrees) |
void | SetOrientation (float pitchDegrees, float yawDegrees, float rollDegrees) |
void | SetOrientation (const glm::quat &orientation) |
void | SetScale (const glm::vec3 &scale) |
void | SetScale (float factorX, float factorY, float factorZ) |
void | SetScaleX (float factor) |
void | SetScaleY (float factor) |
void | SetScaleZ (float factor) |
const glm::vec3 & | GetPosition () const |
const glm::vec3 & | GetScale () const |
const glm::vec3 & | GetWorldScale () const |
const glm::vec3 & | GetWorldSurfaceScale () const |
const glm::vec3 & | GetRotation () const |
const glm::quat & | GetOrientation () const |
const glm::vec3 & | GetAnchorPoint () const |
virtual void | SetSize (const glm::vec3 &size, bool dirtyLayout=true) |
const glm::vec3 & | GetSize () const |
const glm::vec3 & | GetInitialSize () const |
void | SetMeasuredSize (const glm::vec3 &measuredSize) |
const glm::vec3 & | GetMeasuredSize () const |
void | SetInternalCustomTimelineValue (uint32_t trackID, const CYIVariant &value) |
virtual void | SetCustomTimelineValue (uint32_t trackID, const CYIVariant &value) |
void | SetClippingOn () |
void | SetClippingOff () |
bool | GetClipping () const |
void | SetClippingBox (const CYIAABB &worldBox) |
const CYIAABB & | GetClippingBox () const |
void | StartPropertyAnimation (PropertyAnimation::Type propType, float from, float to, uint32_t durMs, CYITimeInterpolator *pTimeInterpolator=nullptr, bool dirtyLayout=true) |
void | StopPropertyAnimation (PropertyAnimation::Type propType) |
void | UpdateLocalSpaceCollision (CYIActionEvent *pActionEvent) |
virtual bool | BroadcastEvent (const std::shared_ptr< CYIEventDispatcher > &pDispatcher, CYIEvent *pEvent) |
void | UpdateEventForLocalSpace (CYIActionEvent *pActionEvent, glm::vec3 &rayOrigin, glm::vec3 &rayNonOriginPoint) const |
bool | IsBoundingBoxHit (const CYIRay &worldSpaceRay) const |
bool | IsMeshHit (const CYIRay &worldSpaceRay) const |
void | DumpTree () const |
void | StartCaptureKeyboardEvents () |
void | StopCaptureKeyboardEvents () |
void | StartCaptureTrackpadEvents () |
void | StopCaptureTrackpadEvents () |
void | StartCapturePointerEvents (uint8_t pointerID) |
void | StopCapturePointerEvents (uint8_t pointerID) |
bool | DrawBehindChildren (CYISceneNode *pSceneNode, bool *pChanged=nullptr) |
bool | DrawInFrontOfChildren (CYISceneNode *pSceneNode, bool *pChanged=nullptr) |
bool | DrawBehind (CYISceneNode *pSceneNode, bool *pChanged=nullptr) |
bool | DrawInFront (CYISceneNode *pSceneNode, bool *pChanged=nullptr) |
bool | IsFocusRoot () const |
void | SetIsFocusRoot (bool isFocusRoot) |
virtual void | OnFocusGainedInDescendants (CYISceneNode *pNewNodeWithFocus, CYISceneNode *pPreviousNodeWithFocus) |
virtual void | FocusGainedInDescendants (CYISceneNode *pNewNodeWithFocus, CYISceneNode *pPreviousNodeWithFocus) |
virtual void | OnFocusLostInDescendants (CYISceneNode *pNewNodeWithFocus, CYISceneNode *pPreviousNodeWithFocus) |
virtual void | FocusLostInDescendants (CYISceneNode *pNewNodeWithFocus, CYISceneNode *pPreviousNodeWithFocus) |
virtual void | OnFocusChangedInDescendants (CYISceneNode *pNewNodeWithFocus, CYISceneNode *pPreviousNodeWithFocus) |
virtual void | FocusChangedInDescendants (CYISceneNode *pNewNodeWithFocus, CYISceneNode *pPreviousNodeWithFocus) |
virtual bool | ContainsFocusableDescendant (const CYIFocusSearchOptions &options=CYIFocusSearchOptions()) const |
void | SetUseLocalTransformAndAlpha (bool use) |
virtual CYIOptional< CYIStringView > | GetProperty (CYIStringView propertyName) const override |
bool | GetProperty (CYIStringView propertyName, CYIString *pValue) const |
virtual std::map< CYIString, CYIString > | GetProperties () const override |
virtual void | ForEachProperty (const std::function< void(const CYIString &, const CYIString &)> &action) const override |
virtual bool | HasProperties () const override |
void | SetProperty (const CYIString &propertyName, const CYIString &propertyValue) |
std::shared_ptr< CYISceneNodeProxy > | GetSceneNodeProxy () const |
void | SetLayoutConfig (std::unique_ptr< CYILayoutConfig > pLayoutConfig) |
const CYILayoutConfig * | GetLayoutConfig (LayoutConfigFetchMode fetchMode=LayoutConfigFetchMode::LazyInstantiate) const |
CYILayoutConfig * | GetLayoutConfig (LayoutConfigFetchMode fetchMode=LayoutConfigFetchMode::LazyInstantiate) |
void | SetLayoutState (std::unique_ptr< CYILayoutState > pLayoutState) |
const CYILayoutState * | GetLayoutState () const |
CYILayoutState * | GetLayoutState () |
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 CYIAbstractCameraSceneNode * | FindActiveCamera (const CYISceneNode *pTargetSceneNode=nullptr) const |
CYIAccessibilityAttributes::Accessible | GetAccessible () const |
void | SetAccessible (CYIAccessibilityAttributes::Accessible accessible) |
const CYIAccessibilityAttributes * | GetAccessibilityAttributes () const |
std::unique_ptr< CYIAccessibilityAttributes > | TakeAccessibilityAttributes () |
void | SetAccessibilityAttributes (std::unique_ptr< CYIAccessibilityAttributes > pAttributes) |
const CYIRenderable * | GetRenderable () const |
template<typename T > | |
bool | CanCastTo () const |
CYIAdjustmentLayerSceneNode * | GetLastAdjustmentLayer () const |
![]() | |
CYIEventTarget () | |
virtual | ~CYIEventTarget () |
bool | AddEventListener (CYIEvent::Type eventType, CYIEventHandler *pListener, CYIEventTarget::Phase phase=CYIEventTarget::Phase::Bubble) |
bool | RemoveEventListener (CYIEvent::Type eventType, CYIEventHandler *pListener, CYIEventTarget::Phase phase=CYIEventTarget::Phase::Bubble) |
void | SetSpecialTypeFlag (SpecialEventTargetType type) |
void | ClearSpecialTypeFlag (SpecialEventTargetType type) |
SpecialEventTargetType | GetSpecialTypes () const |
const std::shared_ptr< CYIEventTargetProxy > & | GetProxy () const |
![]() | |
CYISignalHandler () | |
CYISignalHandler (const CYISignalHandler &signalHandler) | |
virtual | ~CYISignalHandler () |
CYISignalHandler & | operator= (const CYISignalHandler &signalHandler) |
void | MoveToThread (CYIThread *pThread) |
This function allows the user to override the default thread affinity to any CYIThread that may or may not be running. More... | |
CYIThreadHandle | GetThreadAffinity () const |
void | SetThreadAffinity (const CYIThreadHandle &threadAffinity) |
virtual bool | IsConnected () const |
virtual bool | IsConnected (const CYISignalBase &signal) const |
void | Disconnect (CYISignalBase &signal) |
void | DisconnectFromAllSignals () |
![]() | |
Listener () | |
virtual | ~Listener () |
virtual void | OnThreadStarted (CYIThread *) |
virtual void | OnThreadTerminated (CYIThread *) |
virtual void | OnThreadFinished (CYIThread *) |
![]() | |
virtual | ~IYIPropertiesSource ()=default |
bool | GetProperty (CYIStringView propertyName, CYIString *pValue) const |
Static Public Member Functions | |
static void | RegisterAllSceneNodes () |
Public Attributes | |
CYISignal< CYISceneNode *, PropertyAnimation::Type > | PropertyAnimationComplete |
CYISignal< CYISceneNode *, CYISceneNode *> | DescendantGainedFocus |
Emitted when focus has entered this tree. The first signal parameter is the new node with focus, and the second signal parameter is the previous node with focus. More... | |
CYISignal< CYISceneNode *, CYISceneNode *> | DescendantLostFocus |
Emitted when focus has left this tree. The first signal parameter is the new node with focus, and the second signal parameter is the previous node with focus. More... | |
CYISignal< CYISceneNode *, CYISceneNode *> | DescendantsChangedFocus |
Emitted when focus has changed within this tree. This signal is called only if focus was previously within this tree and focus is now on a different node (but still within this tree). The first signal parameter is the new node with focus, and the second signal parameter is the previous node with focus. More... | |
CYISignal< CYIAccessibilityAttributes::Accessible > | AccessibleStateChanged |
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 void | OnDrawOrderChanged () |
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 CYISceneNode * | GetNodeFromChildren (CYIStringView name) |
virtual CYISceneNode * | GetNodeFromChildren (const int32_t id) |
virtual CYISceneNode * | GetNodeFromChildren (const CYIRuntimeTypeInfo &enforceClassType) |
CYISceneNode * | GetNodeFromChildrenAfterTarget (const CYIRuntimeTypeInfo &enforceClassType, bool *pTargetReached, CYISceneNode *pStartAfterTarget) |
Protected Attributes | |
CYIString | m_name |
CYISceneNode * | m_pParent |
CYISceneNode * | m_pDrawParent |
std::vector< std::unique_ptr< CYISceneNode > > | m_children |
std::vector< CYISceneNode * > | m_drawChildren |
std::map< CYIString, CYIString, std::less< void > > | m_Properties |
std::vector< std::shared_ptr< CYIEffect > > | m_Effects |
std::vector< std::unique_ptr< PropertyAnimation > > | m_propertyAnimations |
float | m_localOpacity |
std::unique_ptr< CYITransform > | m_pTransform |
glm::vec3 | m_size |
glm::vec3 | m_initialSize |
glm::vec3 | m_measuredSize |
glm::vec3 | m_vlsLastCollision |
bool | m_clip |
bool | m_localVisibility |
int32_t | m_id |
uint64_t | m_guid |
std::unique_ptr< CYINPatch > | m_pNPatch |
std::shared_ptr< CYIBitmap > | m_pNPatchBitmap |
std::shared_ptr< CYIRenderable > | m_pRenderable |
![]() | |
std::vector< EventListenerEntry > | m_listeners |
SpecialEventTargetType | m_specialTypes |
std::shared_ptr< CYIEventTargetProxy > | m_pEventTargetProxy |
Friends | |
class | CYISceneManager |
class | UnitTestSetupHelper |
typedef uint16_t CYISceneNode::DirtyFlag |
typedef std::reverse_iterator<Iterator> CYISceneNode::ReverseIterator |
|
strong |
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. |
|
strong |
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. |
|
strong |
|
strong |
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 > | , |
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.
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, CYITextSceneNode, CYISceneView, 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 |
Recursively broadcasts an event to the node's children, then offers it to the node itself.
Reimplemented in CYIScrollingView.
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::ClearNPatch | ( | ) |
Clears the NPatch data for this node.
|
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, CYISceneView, and CYIFocusZoneView.
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, |
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 EYILogLevel::debug level. To see these logs in your application, ensure that debug level logs for this tag are enabled.
|
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 |
The active camera is the last encountered visible child of this node which is also an enabled camera node. The order the children are encountered in is defined by the draw order.
Reimplemented in CYIScrollingView.
bool CYISceneNode::FindNode | ( | YI_SCENE_NODE_SUBCLASS *& | pNode, |
CYIStringView | 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.
|
virtual |
Called when focus has changed within this tree. This function is called only if focus was previously within this tree and focus is now on a different node (but still within this tree).
Reimplemented in CYIScrollingView, and CYIFocusZoneView.
|
virtual |
Called when focus has entered this tree.
Reimplemented in CYIScrollingView, CYISceneView, and CYIFocusZoneView.
|
virtual |
Called when focus has left this tree.
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.
|
overridevirtual |
Executes action for each property held by this object. Each property name and property value pair is passed to action.
Implements IYIPropertiesSource.
Reimplemented in CYISceneView.
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.
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.
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.
CYISceneNode* CYISceneNode::GetChild | ( | const CYIString & | name | ) | const |
Returns the first encountered child named name or null if no such child exists.
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.
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.
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 | ( | size_t | index | ) | const |
Returns the child, in the draw order, at index index.
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.
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.
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.
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.
Returns the effect at index.
size_t CYISceneNode::GetEffectCount | ( | ) | const |
Returns the number of effects applied to this node.
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.
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().
size_t CYISceneNode::GetIndexOfDrawChild | ( | const CYISceneNode * | pSceneNode | ) | const |
Returns the draw 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.
CYIAdjustmentLayerSceneNode* CYISceneNode::GetLastAdjustmentLayer | ( | ) | const |
Returns the adjustment layer child that is last drawn, or null.
const CYILayoutConfig* CYISceneNode::GetLayoutConfig | ( | LayoutConfigFetchMode | fetchMode = LayoutConfigFetchMode::LazyInstantiate | ) | const |
Returns the layout config object assigned to this node. May be null.
CYILayoutConfig* CYISceneNode::GetLayoutConfig | ( | LayoutConfigFetchMode | fetchMode = LayoutConfigFetchMode::LazyInstantiate | ) |
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.
glm::mat4 CYISceneNode::GetLocalTransform | ( | ) | const |
Returns a matrix representing this node's local transform.
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.
CYISceneNode* CYISceneNode::GetNode | ( | CYIStringView | 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 | ( | CYIStringView | 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.
Returns null if none found.
YI_SCENE_NODE_SUBCLASS* CYISceneNode::GetNode | ( | CYIStringView | 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 | id | ) |
Recursively searches this subtree to find the first encountered node with the provided id.
Returns null if none found.
CYISceneNode* CYISceneNode::GetNode | ( | const int32_t | id, |
const CYIRuntimeTypeInfo & | enforceClassType | ||
) |
Recursively searches this subtree to find the first encountered node with the provided id.
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 | 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.
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.
|
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 | ( | CYIStringView | 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 | 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.
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.
CYISceneNode* CYISceneNode::GetNodeWithUniqueID | ( | uint64_t | uniqueID | ) |
Recursively searches this subtree to find the first encountered node with the provided uniqueID.
Returns null if none found.
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.
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.
Reimplemented in CYISceneView.
|
overridevirtual |
Returns the value of the property identified by propertyName, or an empty optional if the property does not exist.
Implements IYIPropertiesSource.
Reimplemented in CYISceneView.
bool CYISceneNode::GetProperty | ( | CYIStringView | propertyName, |
CYIString * | pValue | ||
) | const |
Stores the value of a property specified by propertyName into pValue. Returns false if the property cannot be found.
const CYIRenderable* CYISceneNode::GetRenderable | ( | ) | const |
Gets the CYIRenderable associated with this node.
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.
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.
|
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. It is independent from the timeline unique ID, accessed through CYIAbstractTimeline::GetUniqueID. A scene node and timeline may have the same unique ID, but these are unrelated.
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.
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.
|
overridevirtual |
Returns true if this source contains at least one property.
Implements IYIPropertiesSource.
Reimplemented in CYISceneView.
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, CYIImageView, CYISceneView, CYITextEditView, CYIDrawerView, CYIEpgGridView, CYIListView, CYIImageSceneNode, CYIScrollBarView, CYIAbstractButtonView, CYIToggleButtonView, CYIFocusZoneView, CYIPageIndicatorView, CYIScrollingTextView, CYIVideoSurfaceView, CYIDecoratedView, CYIAbstractCameraSceneNode, CYIPlayerPreviewThumbnailView, CYIWebView, CYIPlatformView, CYIPushButtonView, CYIActivityIndicatorView, CYIPlayerTimePopupView, CYIProgressBarView, CYIStackView, CYIRadioGroupView, and CYIContentOverlay.
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 & | worldSpaceRay | ) | 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::IsInitialized | ( | ) | const |
Returns true if the scene node was initialized.
bool CYISceneNode::IsMeshHit | ( | const CYIRay & | worldSpaceRay | ) | 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::IsPerceptible | ( | ) | const |
Returns whether this node is perceptible, meaning that it IsTrulyVisible and it has a perceptible amount of composite opacity.
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 CYISceneNode::LayoutDirtyFlag::Dirty.
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, CYITextSceneNode, CYISceneView, 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
|
protectedvirtual |
Called when this scene node's draw order has been modified.
Reimplemented in CYIVideoSurfaceView.
|
virtual |
Called when focus has changed within this tree. This function is called only if focus was previously within this tree and focus is now on a different node (but still 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.
|
virtual |
Optional method to allow subclasses to do operations after CYIRenderListBuilder::BuildDrawList.
This is called after CYIRenderListBuilder::BuildDrawList.
|
virtual |
Optional method to allow subclasses to do operations prior to CYIRenderListBuilder::BuildDrawList. pDrawWithCameraList can be used to specify which camera(s) should be used for rendering.
This is called before CYIRenderListBuilder::BuildDrawList.
Reimplemented in CYIScrollingView.
|
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. Any changes that dirty this node are applied immediately after this function returns.
|
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.
|
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::Mode | mode = Iterator::Mode::ImmediateChildren | ) | 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::Mode | mode = Iterator::Mode::ImmediateChildren | ) | const |
Returns the reverse iterator to the position before the first node in the iteration sequence.
Moves the child present at index fromIndex to index toIndex.
Will return false if fromIndex or toIndex 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::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.
void CYISceneNode::SetAccessible | ( | CYIAccessibilityAttributes::Accessible | accessible | ) |
Sets the accessible state. It will emit the signal AccessibleStateChanged.
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).
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 & | worldBox | ) |
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 | 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.
void CYISceneNode::SetID | ( | int32_t | id | ) |
Sets the ID of this node.
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 | ) |
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 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'.
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, |
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 & | transform | ) |
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.
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.
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.
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.
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.
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.
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.
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.
|
virtual |
Sets the size of this node to size.
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.
void CYISceneNode::Show | ( | ) |
Shows the node.
|
protectedvirtual |
Called when the size of this scene node has been changed.
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.
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.
std::unique_ptr<CYIAccessibilityAttributes> CYISceneNode::TakeAccessibilityAttributes | ( | ) |
Returns the accessibility attributes for this scene node and transfers ownership.
|
protectedvirtual |
Called by Update() when the transform update process is complete. Subclasses may overload this function to do post-processing.
Reimplemented in CYIPerspectiveCameraSceneNode, and CYIDecoratedView.
|
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.
|
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.
Reimplemented in CYITextEditView, CYIVectorCanvasNode, and CYIDecoratedView.
|
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.
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.
|
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, CYITextSceneNode, 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, and CYISDFAtlasTextSceneNode.
|
friend |
|
friend |
CYISignal<CYIAccessibilityAttributes::Accessible> CYISceneNode::AccessibleStateChanged |
Emitted when accessible state changed.
CYISignal<CYISceneNode * , CYISceneNode * > CYISceneNode::DescendantGainedFocus |
Emitted when focus has entered this tree. The first signal parameter is the new node with focus, and the second signal parameter is the previous node with focus.
CYISignal<CYISceneNode * , CYISceneNode * > CYISceneNode::DescendantLostFocus |
Emitted when focus has left this tree. The first signal parameter is the new node with focus, and the second signal parameter is the previous node with focus.
CYISignal<CYISceneNode * , CYISceneNode * > CYISceneNode::DescendantsChangedFocus |
Emitted when focus has changed within this tree. This signal is called only if focus was previously within this tree and focus is now on a different node (but still within this tree). The first signal parameter is the new node with focus, and the second signal parameter is the previous node with focus.
|
static |
Indicates the the scene graph is clean.
|
static |
Dirties everything except DirtyMesh. DirtyMesh is a placeholder flag that only represents its side effects. This is the flag used by ForceDirty().
|
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.
|
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.
|
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.
|
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
|
static |
Indicates that the scene graph is dirty and requires an update pass. Setting this flag recurses automatically through all ancestors.
|
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.
|
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
|
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.
|
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.
|
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.
|
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.
|
protected |
|
protected |
Clip enable flag
|
protected |
|
protected |
The node's list of active effects
|
protected |
The unique id of this node
|
protected |
The id of this node
|
protected |
The size of this node at initialization
|
protected |
The local opacity for this node
|
protected |
The local node visibility flag
|
protected |
The measured size of this node (used by the layout system)
|
protected |
|
protected |
|
protected |
The node's N Patch, if any
|
protected |
The node's mesh, if any
|
protected |
|
protected |
The node's renderable
|
protected |
The node property animations for this node
|
protected |
|
protected |
The size of this node
|
protected |
The last ray collision with the node in local space
|
static |
CYISignal<CYISceneNode *, PropertyAnimation::Type> CYISceneNode::PropertyAnimationComplete |
Emitted when a node property animation is completed.