You.i Engine
YiSceneNode.h
Go to the documentation of this file.
1 // © You i Labs Inc. All rights reserved.
2 #ifndef _YI_SCENE_NODE_H_
3 #define _YI_SCENE_NODE_H_
4 
7 #include "event/YiEventTarget.h"
10 #include "renderer/YiRenderer.h"
11 #include "scenetree/YiAABB.h"
12 #include "scenetree/YiTransform.h"
13 #include "signal/YiSignal.h"
14 
15 #include <glm/gtc/quaternion.hpp>
16 #include <glm/mat4x4.hpp>
17 #include <glm/vec3.hpp>
18 
19 #include <list>
20 
21 #ifdef YI_DEPRECATED_PREDEF
23 # include "asset/YiAssetTexture.h"
24 # include "graphics/YiBitmap.h"
25 # include "renderer/YiMaterial.h"
26 #endif
27 
29 class CYIActionEvent;
30 class CYIAdjustmentLayerSceneNode;
31 class CYIBitmap;
32 class CYIEffect;
33 class CYILayoutConfig;
34 class CYILayoutState;
35 class CYIMask;
36 class CYIMaterial;
37 class CYIMesh;
38 class CYINPatch;
39 class CYIRenderTarget;
40 class CYISceneManager;
41 class CYISceneNode;
42 class CYISceneNodeIteratorPriv;
43 class CYISceneNodeProxy;
45 class CYITimelineTrack;
46 class CYIVariant;
48 class UnitTestSetupHelper;
49 
106 {
107  friend class CYISceneManager;
108 
109 public:
110  static const float OPACITY_NOT_VISIBLE_EPSILON;
111 
112  class Iterator;
113  typedef std::reverse_iterator<Iterator> ReverseIterator;
114 
120  class Iterator
121  {
122  public:
123  enum class Mode
124  {
127  DepthFirst,
129  };
130 
131  friend class CYISceneNode;
132  typedef std::bidirectional_iterator_tag iterator_category;
134  typedef ptrdiff_t difference_type;
136  typedef CYISceneNode *reference; // This iterator uses the value as the reference, since there is little point in returning a reference to a scene node pointer. The pointer itself suffices.
137 
138  Iterator();
139  Iterator(const Iterator &other);
140 
141  ~Iterator();
142 
143  value_type operator*() const;
144 
145  Iterator &operator=(const Iterator &other);
146  bool operator==(const Iterator &other) const;
147  bool operator!=(const Iterator &other) const;
148 
149  Iterator &operator++();
150  Iterator operator++(int);
151  Iterator &operator--();
152  Iterator operator--(int);
153  Iterator operator+(int n) const;
154  Iterator &operator+=(int n);
155  Iterator operator-(int n) const;
156  Iterator &operator-=(int n);
157 
158  private:
159  std::unique_ptr<CYISceneNodeIteratorPriv> m_pIteratorPriv;
160  };
161 
166  {
167  public:
171  enum class Type
172  {
173  PositionX,
174  PositionY,
175  PositionZ,
176  ScaleX,
177  ScaleY,
178  ScaleZ,
179  RotationX,
180  RotationY,
181  RotationZ,
182  Opacity,
183  SizeX,
184  SizeY,
185  SizeZ,
186  };
187 
191  PropertyAnimation(CYISceneNode *pNode, Type propetyType, float from, float to, uint32_t durMs, CYITimeInterpolator *pTimeInterpolator, bool dirtyLayout);
192 
193  virtual ~PropertyAnimation();
194 
198  void Reconfigure(float from, float to, uint32_t durMs, CYITimeInterpolator *pTimeInterpolator, bool dirtyLayout);
199 
200  std::shared_ptr<CYISceneNodeProxy> m_pNodeProxy;
203  float m_from;
204  float m_to;
207  protected:
211  virtual void OnAnimate(CYIAnimation *pAnim, float dataPosition) override;
212 
216  virtual void OnAnimationEnd(CYIAnimation *pAnim) override;
217 
218  private:
220  };
221 
222  typedef uint16_t DirtyFlag;
223 
227  static constexpr DirtyFlag DirtyClean = 0x0000;
228 
233  static constexpr DirtyFlag DirtySceneGraph = 0x0001;
234 
240  static constexpr DirtyFlag DirtyVisibility = 0x0002;
241 
247  static constexpr DirtyFlag DirtyOpacity = 0x0004;
248 
254  static constexpr DirtyFlag DirtyLocalTransform = 0x0008;
255 
262  static constexpr DirtyFlag DirtyWorldTransform = 0x0010;
263 
268  static constexpr DirtyFlag DirtyUniform = 0x0020;
269 
275  static constexpr DirtyFlag DirtyWorldBoundingBox = 0x0040;
276 
284  static constexpr DirtyFlag DirtyMesh = 0x0080;
285 
291  static constexpr DirtyFlag DirtyWorldSurfaceScale = 0x0100;
292 
298  static constexpr DirtyFlag DirtyWorldScale = 0x0200;
299 
304  static constexpr DirtyFlag DirtyLocalBoundingBox = 0x0400;
305 
309  static constexpr DirtyFlag DirtyEverything = (DirtySceneGraph | DirtyVisibility | DirtyOpacity | DirtyLocalTransform | DirtyWorldTransform | DirtyUniform | DirtyWorldBoundingBox | DirtyWorldSurfaceScale | DirtyWorldScale | DirtyLocalBoundingBox);
310 
311  enum class LayoutDirtyFlag : uint8_t
312  {
316  Clean,
320  ChildDirty,
324  Dirty
325  };
326 
328  {
332  DoNotLazyInstantiate = 0,
333 
337  LazyInstantiate
338  };
339 
340  enum class MeasureMode
341  {
345  Unspecified,
349  UpTo,
353  Exactly
354  };
355 
359  enum class FetchType
360  {
364  Optional = 0,
368  Mandatory
369  };
370 
374  struct MeasureSpec
375  {
377  : mode(MeasureMode::Unspecified)
378  , size(0.0f)
379  {
380  }
381  MeasureSpec(MeasureMode mode, float size)
382  : mode(mode)
383  , size(size)
384  {
385  }
386 
387  static MeasureSpec CreateExactlySpec(float size);
388  static MeasureSpec CreateUpToSpec(float size);
389  static const MeasureSpec &GetUndefinedSpec();
390  static const MeasureSpec defaultSpec;
391 
393  float size;
394  };
395 
396  CYISceneNode();
397  virtual ~CYISceneNode();
398 
412  virtual bool Init();
413 
418  bool IsInitialized() const;
419 
427  void ForceDirty();
428 
435  void SetDirtyFlag(DirtyFlag dirtyFlag);
436 
441  DirtyFlag GetDirtyFlag() const;
442 
451  DirtyFlag GetPreviousDirtyFlag() const;
452 
458  const CYIString &GetName() const;
459 
466  CYIString GetUniqueName() const;
467 
475  void SetSceneManager(CYISceneManager *pSceneManager);
476 
483  void SetName(const CYIString &name);
484 
496  int32_t GetID() const;
497 
503  void SetID(int32_t id);
504 
510  uint64_t GetUniqueID() const;
511 
524  bool AddChild(std::unique_ptr<CYISceneNode> pSceneNode);
525 
538  bool AddChild(std::unique_ptr<CYISceneNode>, size_t index);
539 
552  bool InsertChildAfter(CYISceneNode *pRefNode, std::unique_ptr<CYISceneNode> pSceneNode);
553 
559  std::unique_ptr<CYISceneNode> RemoveChild(CYISceneNode *pSceneNode);
560 
574  bool ReorderChild(size_t fromIndex, size_t toIndex);
575 
577  {
578  return m_pTransform.get();
579  }
580 
586  CYISceneNode *GetParent() const;
587 
600  bool ChangeParent(CYISceneNode *pParent);
601 
607  CYISceneNode *GetDrawParent() const;
608 
612  bool IsAncestorOf(const CYISceneNode *pNode) const;
613 
618 
622  size_t GetChildCount() const;
623 
627  uint32_t GetChildCountRecursive() const;
628 
634  CYISceneNode *GetChild(size_t index) const;
635 
640 
645 
649  ReverseIterator rbegin(Iterator::Mode mode = Iterator::Mode::ImmediateChildren) const;
650 
654  ReverseIterator rend(Iterator::Mode mode = Iterator::Mode::ImmediateChildren) const;
655 
661  CYISceneNode *GetChild(const CYIString &name) const;
662 
666  size_t GetDrawChildCount() const;
667 
673  CYISceneNode *GetDrawChild(size_t index) const;
674 
680  CYISceneNode *GetDrawChildByID(int32_t id) const;
681 
691  template<class YI_SCENE_NODE_SUBCLASS>
692  YI_SCENE_NODE_SUBCLASS *GetChild(uint32_t targetMatchedNodeCount = 1) const;
693 
699  template<class YI_SCENE_NODE_SUBCLASS>
700  std::list<YI_SCENE_NODE_SUBCLASS *> GetChildren() const;
701 
707  template<class YI_SCENE_NODE_SUBCLASS>
708  std::list<YI_SCENE_NODE_SUBCLASS *> GetDrawChildren() const;
709 
713  size_t GetIndexOfChild(const CYISceneNode *pSceneNode) const;
714 
720  size_t GetIndexOfDrawChild(const CYISceneNode *pSceneNode) const;
721 
730  void Show();
731 
740  void Hide();
741 
751  void SetVisibility(bool visible);
752 
762  void SetOpacity(float opacity);
763 
767  float GetCompositeOpacity() const;
768 
778  float GetLocalOpacity() const;
779 
788  bool IsVisible() const;
789 
798  bool IsTrulyVisible() const;
799 
806  bool IsPerceptible() const;
807 
817 
825  CYISceneNode *GetNode(CYIStringView name, const CYIRuntimeTypeInfo &enforceClassType);
826 
834  CYISceneNode *GetNode(const CYIRuntimeTypeInfo &enforceClassType);
835 
843  CYISceneNode *GetNodeAfterTarget(const CYIRuntimeTypeInfo &enforceClassType, CYISceneNode *pStartAfterTarget);
844 
854  template<class YI_SCENE_NODE_SUBCLASS>
855  YI_SCENE_NODE_SUBCLASS *GetNode(CYIStringView name);
856 
864  CYISceneNode *GetNode(const int32_t id);
865 
873  CYISceneNode *GetNode(const int32_t id, const CYIRuntimeTypeInfo &enforceClassType);
874 
884  CYISceneNode *GetNodeWithUniqueID(uint64_t uniqueID);
885 
895  template<class YI_SCENE_NODE_SUBCLASS>
896  bool FindNode(YI_SCENE_NODE_SUBCLASS *&pNode, CYIStringView nodeName, FetchType type, const CYIString &tag);
897 
905  std::list<CYISceneNode *> GetNodes(CYIStringView name);
906 
914  std::list<CYISceneNode *> GetNodes(int32_t id);
915 
923  std::list<CYISceneNode *> GetNodes(const CYIRuntimeTypeInfo &enforceClassType);
924 
936  template<class YI_SCENE_NODE_SUBCLASS>
937  const YI_SCENE_NODE_SUBCLASS *GetNode(uint32_t targetMatchedNodeCount = 1) const;
938  template<class YI_SCENE_NODE_SUBCLASS>
939  YI_SCENE_NODE_SUBCLASS *GetNode(uint32_t targetMatchedNodeCount = 1);
940 
944  void SetMesh(const std::shared_ptr<CYIMesh> &pMesh);
945 
949  bool SetNPatchBitmap(const std::shared_ptr<CYIBitmap> &pNPatchBitmap);
950 
954  void ClearNPatch();
955 
959  void SetMaterial(const std::shared_ptr<CYIMaterial> &pMaterial, size_t index = 0);
960 
964  void AddEffect(const std::shared_ptr<CYIEffect> &pEffect);
965 
969  void RemoveEffect(const std::shared_ptr<CYIEffect> &pEffect);
970 
974  size_t GetEffectCount() const;
975 
979  const std::shared_ptr<CYIEffect> &GetEffect(size_t index) const;
980 
986  void ConnectEffectsToTimelines(const CYITimelineTrack *pTrack);
987 
993  void AddMask(std::unique_ptr<CYIMask> pMask);
994 
998  std::unique_ptr<CYIMask> RemoveMask(const CYIMask *pMask);
999 
1003  size_t GetMaskCount() const;
1004 
1008  const CYIMask *GetMask(size_t index) const;
1009 
1013  CYIMask *GetMask(size_t index);
1014 
1018  const std::shared_ptr<CYIMesh> &GetMesh() const;
1019 
1023  const std::shared_ptr<CYIBitmap> &GetNPatchBitmap() const;
1024 
1028  size_t GetMaterialCount() const;
1029 
1033  const std::shared_ptr<CYIMaterial> &GetMaterial(size_t index = 0) const;
1034 
1038  const std::shared_ptr<IYIUniformBufferObject> &GetShaderUniforms() const;
1039 
1043  void SetMeshTransform(const glm::mat4 &rTransform);
1044 
1049  void DestroyChildren();
1050 
1054  glm::mat4 GetLocalTransform() const;
1055 
1065  glm::mat4 GetWorldTransform() const;
1066 
1072  bool Intersects(const CYISceneNode *pNode) const;
1073 
1077  void SetRenderTarget(const std::shared_ptr<CYIRenderTarget> &pRenderTarget);
1078 
1082  const std::shared_ptr<CYIRenderTarget> &GetRenderTarget() const;
1083 
1090  virtual void OnPreBuildDrawList(std::vector<IYIRenderer::Command> *pDrawList, std::vector<CYIAbstractCameraSceneNode *> *pDrawWithCameraList);
1091 
1097  virtual void OnPostBuildDrawList(std::vector<IYIRenderer::Command> *pDrawList);
1098 
1102  const CYIAABB &GetWorldAABB() const;
1103 
1107  const CYIAABB &GetLocalAABB() const;
1108 
1117  void SetAnchorPoint(const glm::vec3 &anchorPoint);
1118 
1122  void SetAnchorPoint(float x, float y, float z);
1123 
1127  void SetAnchorPointX(float x);
1128 
1132  void SetAnchorPointY(float y);
1133 
1137  void SetAnchorPointZ(float z);
1138 
1146  void SetPosition(const glm::vec3 &position);
1147 
1151  void SetPosition(float x, float y, float z);
1152 
1156  void SetPositionX(float x);
1157 
1161  void SetPositionY(float y);
1162 
1166  void SetPositionZ(float z);
1167 
1175  void SetRotation(const glm::vec3 &rotation);
1176 
1180  void SetRotation(float pitchDegrees, float yawDegrees, float rollDegrees);
1181 
1185  void SetRotationX(float pitchDegrees);
1186 
1190  void SetRotationY(float yawDegrees);
1191 
1195  void SetRotationZ(float rollDegrees);
1196 
1204  void SetOrientation(float pitchDegrees, float yawDegrees, float rollDegrees);
1205 
1209  void SetOrientation(const glm::quat &orientation);
1210 
1218  void SetScale(const glm::vec3 &scale);
1219 
1223  void SetScale(float factorX, float factorY, float factorZ);
1224 
1228  void SetScaleX(float factor);
1229 
1233  void SetScaleY(float factor);
1234 
1238  void SetScaleZ(float factor);
1239 
1243  const glm::vec3 &GetPosition() const;
1244 
1248  const glm::vec3 &GetScale() const;
1249 
1257  const glm::vec3 &GetWorldScale() const;
1258 
1262  const glm::vec3 &GetWorldSurfaceScale() const;
1263 
1267  const glm::vec3 &GetRotation() const;
1268 
1272  const glm::quat &GetOrientation() const;
1273 
1277  const glm::vec3 &GetAnchorPoint() const;
1278 
1286  virtual void SetSize(const glm::vec3 &size, bool dirtyLayout = true);
1287 
1291  const glm::vec3 &GetSize() const;
1292 
1296  const glm::vec3 &GetInitialSize() const;
1297 
1301  void SetMeasuredSize(const glm::vec3 &measuredSize);
1302 
1306  const glm::vec3 &GetMeasuredSize() const;
1307 
1311  void SetInternalCustomTimelineValue(uint32_t trackID, const CYIVariant &value);
1312 
1316  virtual void SetCustomTimelineValue(uint32_t trackID, const CYIVariant &value);
1317 
1321  void SetClippingOn();
1322 
1326  void SetClippingOff();
1327 
1331  bool GetClipping() const;
1332 
1337  void SetClippingBox(const CYIAABB &rWorldBox);
1338 
1343  const CYIAABB &GetClippingBox() const;
1344 
1350  void StartPropertyAnimation(PropertyAnimation::Type propType, float from, float to, uint32_t durMs, CYITimeInterpolator *pTimeInterpolator = nullptr, bool dirtyLayout = true);
1351 
1358 
1362  void UpdateLocalSpaceCollision(CYIActionEvent *pActionEvent);
1363 
1367  virtual bool BroadcastEvent(const std::shared_ptr<CYIEventDispatcher> &pDispatcher, CYIEvent *pEvent);
1368 
1372  void UpdateEventForLocalSpace(CYIActionEvent *pActionEvent, glm::vec3 &rayOrigin, glm::vec3 &rayNonOriginPoint) const;
1373 
1379  bool IsBoundingBoxHit(const CYIRay &rWorldSpaceRay) const;
1380 
1388  bool IsMeshHit(const CYIRay &rWorldSpaceRay) const;
1389 
1396  void DumpTree() const;
1397 
1402 
1407 
1412 
1417 
1421  void StartCapturePointerEvents(uint8_t pointerID);
1422 
1426  void StopCapturePointerEvents(uint8_t pointerID);
1427 
1433  bool DrawBehindChildren(CYISceneNode *pSceneNode, bool *pChanged = nullptr);
1434 
1440  bool DrawInFrontOfChildren(CYISceneNode *pSceneNode, bool *pChanged = nullptr);
1441 
1447  bool DrawBehind(CYISceneNode *pSceneNode, bool *pChanged = nullptr);
1448 
1454  bool DrawInFront(CYISceneNode *pSceneNode, bool *pChanged = nullptr);
1455 
1467  bool IsFocusRoot() const;
1468 
1472  void SetIsFocusRoot(bool isFocusRoot);
1473 
1481  virtual void OnFocusGainedInDescendants(CYISceneNode *pNewNodeWithFocus, CYISceneNode *pPreviousNodeWithFocus);
1482 
1492  virtual void FocusGainedInDescendants(CYISceneNode *pNewNodeWithFocus, CYISceneNode *pPreviousNodeWithFocus);
1493 
1501  virtual void OnFocusLostInDescendants(CYISceneNode *pNewNodeWithFocus, CYISceneNode *pPreviousNodeWithFocus);
1502 
1512  virtual void FocusLostInDescendants(CYISceneNode *pNewNodeWithFocus, CYISceneNode *pPreviousNodeWithFocus);
1513 
1517  virtual void OnFocusChangedInDescendants(CYISceneNode *pNewNodeWithFocus, CYISceneNode *pPreviousNodeWithFocus);
1518 
1526  virtual void FocusChangedInDescendants(CYISceneNode *pNewNodeWithFocus, CYISceneNode *pPreviousNodeWithFocus);
1527 
1533  virtual bool ContainsFocusableDescendant(const CYIFocusSearchOptions &options = CYIFocusSearchOptions()) const;
1534 
1538  void SetUseLocalTransformAndAlpha(bool use);
1539 
1545  static void RegisterAllSceneNodes();
1546 
1547  virtual CYIOptional<CYIStringView> GetProperty(CYIStringView propertyName) const override;
1548 
1554  bool GetProperty(CYIStringView propertyName, CYIString *pValue) const;
1555 
1556  virtual std::map<CYIString, CYIString> GetProperties() const override;
1557 
1558  virtual void ForEachProperty(const std::function<void(const CYIString & /* propertyName */, const CYIString & /* propertyValue */)> &action) const override;
1559 
1560  virtual bool HasProperties() const override;
1561 
1565  void SetProperty(const CYIString &rPropertyName, const CYIString &rPropertyValue);
1566 
1572  std::shared_ptr<CYISceneNodeProxy> GetSceneNodeProxy() const;
1573 
1581  void SetLayoutConfig(std::unique_ptr<CYILayoutConfig> pLayoutConfig);
1582 
1591 
1600 
1608  void SetLayoutState(std::unique_ptr<CYILayoutState> pLayoutState);
1609 
1615  const CYILayoutState *GetLayoutState() const;
1616 
1623 
1627  void RequestLayout();
1628 
1637 
1647  virtual void SetLayoutDirtyFlag(LayoutDirtyFlag flag);
1648 
1664  virtual void Measure(const MeasureSpec &widthSpec, const MeasureSpec &heightSpec, const MeasureSpec &depthSpec);
1665 
1677  virtual void ApplyMeasurements();
1678 
1687  virtual CYIAbstractCameraSceneNode *FindActiveCamera(const CYISceneNode *pTargetSceneNode = nullptr) const;
1688 
1698 
1705 
1714 
1723  std::unique_ptr<CYIAccessibilityAttributes> TakeAccessibilityAttributes();
1724 
1732  void SetAccessibilityAttributes(std::unique_ptr<CYIAccessibilityAttributes> pAttributes);
1733 
1739  const CYIRenderable *GetRenderable() const;
1740 
1746  template<typename T>
1747  bool CanCastTo() const;
1748 
1752  CYIAdjustmentLayerSceneNode *GetLastAdjustmentLayer() const;
1753 
1758 
1759  CYISignal<CYISceneNode * /* pNewNodeWithFocus */, CYISceneNode * /* pPreviousNodeWithFocus */> DescendantGainedFocus;
1760  CYISignal<CYISceneNode * /* pNewNodeWithFocus */, CYISceneNode * /* pPreviousNodeWithFocus */> DescendantLostFocus;
1761  CYISignal<CYISceneNode * /* pNewNodeWithFocus */, CYISceneNode * /* pPreviousNodeWithFocus */> DescendantsChangedFocus;
1763 
1764 protected:
1775  void Update();
1776 
1780  virtual void OnUpdateBegin();
1781 
1790  virtual void UpdateBegin();
1791 
1800  virtual void OnUpdateEnd();
1801 
1810  virtual void UpdateEnd();
1811 
1835  virtual void OnDirtyFlagChanged();
1836 
1844  virtual void DirtyFlagChanged();
1845 
1854  virtual void OnTransformUpdated();
1855 
1864  virtual void TransformUpdated();
1865 
1877  virtual void OnWorldScaleUpdated();
1878 
1887  virtual void WorldScaleUpdated();
1888 
1900  virtual void OnWorldSurfaceScaleUpdated();
1901 
1910  virtual void WorldSurfaceScaleUpdated();
1911 
1921  virtual void OnVisibilityUpdated();
1922 
1931  virtual void VisibilityUpdated();
1932 
1944  virtual void OnCompositeOpacityUpdated();
1945 
1954  virtual void CompositeOpacityUpdated();
1955 
1965  virtual void OnWorldBoundingBoxUpdated();
1966 
1975  virtual void WorldBoundingBoxUpdated();
1976 
1986  virtual void OnLocalBoundingBoxUpdated();
1987 
1996  virtual void LocalBoundingBoxUpdated();
1997 
2001  virtual void OnChildAdded(CYISceneNode *pChild);
2002 
2009  virtual void ChildAdded(CYISceneNode *pChild);
2010 
2016  virtual void OnChildRemoved(CYISceneNode *pChild);
2017 
2023  virtual void ChildRemoved(CYISceneNode *pChild);
2024 
2028  virtual void OnSizeChanged();
2029 
2035  virtual void SizeChanged();
2036 
2041  virtual void ChildNeedsLayout();
2042 
2047  virtual void LayoutDirtied();
2048 
2052  virtual void OnChildVisibilityChanged(CYISceneNode *pChild);
2053 
2059  virtual void ChildVisibilityChanged(CYISceneNode *pChild);
2060 
2064  virtual void OnDrawOrderChanged();
2065 
2066  virtual bool ProcessEvent(const std::shared_ptr<CYIEventDispatcher> &pDispatcher, CYIEvent *pEvent) override;
2067 
2074 
2083  virtual CYIString GetDumpTreeString() const;
2084 
2088  void DumpTree(int32_t indentLevel) const;
2089 
2095  virtual void SetCustomUniforms();
2096 
2102  template<class T>
2103  void SetNodeType();
2104 
2109  virtual CYISceneNode *GetNodeFromChildren(CYIStringView name);
2110 
2115  virtual CYISceneNode *GetNodeFromChildren(const int32_t id);
2116 
2121  virtual CYISceneNode *GetNodeFromChildren(const CYIRuntimeTypeInfo &enforceClassType);
2122 
2127  CYISceneNode *GetNodeFromChildrenAfterTarget(const CYIRuntimeTypeInfo &enforceClassType, bool *pTargetReached, CYISceneNode *pStartAfterTarget);
2128 
2130  CYISceneNode *m_pParent;
2131  CYISceneNode *m_pDrawParent;
2132 
2133  std::vector<std::unique_ptr<CYISceneNode>> m_children;
2134  std::vector<CYISceneNode *> m_drawChildren;
2135  std::map<CYIString, CYIString, std::less<>> m_Properties;
2136  std::vector<std::shared_ptr<CYIEffect>> m_Effects;
2137  std::vector<std::unique_ptr<PropertyAnimation>> m_propertyAnimations;
2139  /*
2140  * These members represent the node's effective alpha value,
2141  * m_localOpacity - the base opacity for this node, independent of hierarchy
2142  * m_compositeOpacity - the calculated effective opacity for this node, considering its parent chain
2143  */
2146  std::unique_ptr<CYITransform> m_pTransform;
2147 
2148  glm::vec3 m_size;
2149  glm::vec3 m_initialSize;
2150  glm::vec3 m_measuredSize;
2153  bool m_clip;
2156  int32_t m_id;
2157  uint64_t m_guid;
2159  std::unique_ptr<CYINPatch> m_pNPatch;
2160  std::shared_ptr<CYIBitmap> m_pNPatchBitmap;
2162  std::shared_ptr<CYIRenderable> m_pRenderable;
2164 private:
2165  static constexpr uint8_t TypeNode = 0x0001;
2166  static constexpr uint8_t TypeAbstractCamera = 0x0002 | TypeNode;
2167  static constexpr uint8_t TypeAdjustmentLayer = 0x0004 | TypeNode;
2168  static constexpr uint8_t TypeSprite = 0x0008 | TypeNode;
2169  static constexpr uint8_t TypeImage = 0x0010 | TypeNode;
2170  static constexpr uint8_t TypeText = 0x0020 | TypeNode;
2171  static constexpr uint8_t TypeView = 0x0040 | TypeNode;
2172  static constexpr uint8_t TypeStreamableView = 0x0080 | TypeView;
2177  void UpdateShaderUniforms();
2178 
2184  CYISceneNode *GetNodeFromChildrenLogDuplicates(CYIStringView name);
2185 
2189  void UpdateAdjustmentLayerEffects(CYISceneNode *pNode);
2190 
2191  void DirtyLiveChildrenRecursive(DirtyFlag dirtyFlag);
2192  void DirtyLiveParentRecursive(DirtyFlag dirtyFlag);
2194  void GetNodesFromChildren(CYIStringView name, std::list<CYISceneNode *> &list);
2196  void GetNodesFromChildren(const int32_t id, std::list<CYISceneNode *> &list);
2198  void GetNodesFromChildren(const CYIRuntimeTypeInfo &enforceClassType, std::list<CYISceneNode *> &list);
2200  void AssignDefaultLayoutConfig() const;
2208  void SetParent(CYISceneNode *pParent);
2209 
2213  size_t DrawRemove();
2214 
2215  void UpdateDrawOrder(CYISceneNode *pDrawParent, size_t fromIndex, size_t toIndex);
2216 
2217  void ClearLiveDirtyFlag(DirtyFlag flag) const;
2218  void SetLiveDirtyFlag(DirtyFlag dirtyFlag);
2219 
2220  virtual void UpdateCompositeOpacity(float *pCompositeOpacity) const;
2221 
2222  void MakeNextLayoutDirtyFlagCurrent();
2223 
2224  void RebuildNPatchMesh();
2225  void SetMeshPriv(const std::shared_ptr<CYIMesh> &pMesh);
2226 
2227  void ClearParentLiveDirtyFlagRecursively(DirtyFlag flag);
2228 
2229  void ProcessFocusEventInCapturePhase(CYIFocusEvent *pFocusEvent);
2230 
2231  void ParseAccessibilityProperties();
2232 
2233  CYIAdjustmentLayerSceneNode *GetLastAdjustmentLayer(const std::vector<std::unique_ptr<CYISceneNode>> &children) const;
2234 
2235  CYISceneManager *m_pSceneManager;
2236 
2237  mutable CYIAABB m_WorldAABB;
2238  mutable CYIAABB m_LocalAABB;
2239  mutable glm::vec3 m_WorldSurfaceScale;
2240  mutable glm::vec3 m_WorldScale;
2242  mutable float m_compositeOpacity;
2243  mutable bool m_compositeVisibility;
2245  bool m_initCalled;
2246  bool m_destroying;
2247 
2248  bool m_isFocusRoot;
2249  bool m_useLocalTransformAndAlpha;
2250 
2251  CYIAdjustmentLayerSceneNode *m_pLastAdjustmentLayer;
2252 
2253  mutable DirtyFlag m_liveDirtyFlag;
2254  mutable DirtyFlag m_hooksDirtyFlag;
2255  DirtyFlag m_previousDirtyFlag;
2257  uint8_t m_nodeType;
2259  LayoutDirtyFlag m_currentLayoutDirtyFlag;
2260  LayoutDirtyFlag m_nextLayoutDirtyFlag;
2262 
2263  mutable std::unique_ptr<CYILayoutConfig> m_pLayoutConfig;
2264  std::unique_ptr<CYILayoutState> m_pLayoutState;
2265 
2266  std::unique_ptr<CYIAccessibilityAttributes> m_pAccessibilityAttributes;
2267 
2268  // Give access to Unit Test framework to clear global IDs (ID, UniqueID)
2269  // so that generated scene tree is repeatable.
2270  friend class UnitTestSetupHelper;
2271  static void ResetGUIDSeed();
2272 
2273  YI_TYPE_BASES(CYISceneNode, CYIEventTarget)
2274  YI_DISALLOW_COPY_AND_ASSIGN(CYISceneNode)
2275 };
2276 
2279 #include "scenetree/YiSceneNode.inl"
2280 
2281 #endif // _YI_SCENE_NODE_H_
bool operator==(const Iterator &other) const
CYISignal< CYISceneNode *, CYISceneNode *> DescendantLostFocus
Emitted when focus has left this tree. The first signal parameter is the new node with focus...
Definition: YiSceneNode.h:1760
std::map< CYIString, CYIString, std::less<> > m_Properties
Definition: YiSceneNode.h:2135
void SetRotationX(float pitchDegrees)
void StartCaptureTrackpadEvents()
CYISceneNode * GetNode(CYIStringView name)
void SetRotation(const glm::vec3 &rotation)
void StartCapturePointerEvents(uint8_t pointerID)
virtual void OnChildAdded(CYISceneNode *pChild)
bool FindNode(YI_SCENE_NODE_SUBCLASS *&pNode, CYIStringView nodeName, FetchType type, const CYIString &tag)
void SetID(int32_t id)
static void RegisterAllSceneNodes()
virtual CYISceneNode * GetNodeFromChildren(CYIStringView name)
virtual void SetLayoutDirtyFlag(LayoutDirtyFlag flag)
bool IsTrulyVisible() const
bool DrawBehindChildren(CYISceneNode *pSceneNode, bool *pChanged=nullptr)
DirtyFlag GetDirtyFlag() const
virtual void Measure(const MeasureSpec &widthSpec, const MeasureSpec &heightSpec, const MeasureSpec &depthSpec)
virtual void OnChildVisibilityChanged(CYISceneNode *pChild)
Container for basic interpolator functions.
Definition: YiTimeInterpolator.h:20
virtual bool ContainsFocusableDescendant(const CYIFocusSearchOptions &options=CYIFocusSearchOptions()) const
size_t GetEffectCount() const
virtual void TransformUpdated()
virtual std::map< CYIString, CYIString > GetProperties() const override
glm::vec3 m_size
Definition: YiSceneNode.h:2148
LayoutConfigFetchMode
Definition: YiSceneNode.h:327
#define YI_DISALLOW_COPY_AND_ASSIGN(TypeName)
Delete the copy constructor and assignment operator (and consequently the move constructor as well) ...
Definition: YiPredef.h:69
int32_t m_id
Definition: YiSceneNode.h:2156
A container class for common data types.
Definition: YiVariant.h:33
void SetVisibility(bool visible)
Definition: YiSceneNode.h:120
bool m_localVisibility
Definition: YiSceneNode.h:2154
CYISceneNode * GetNodeAfterTarget(const CYIRuntimeTypeInfo &enforceClassType, CYISceneNode *pStartAfterTarget)
void StartCaptureKeyboardEvents()
virtual void OnPreBuildDrawList(std::vector< IYIRenderer::Command > *pDrawList, std::vector< CYIAbstractCameraSceneNode *> *pDrawWithCameraList)
bool CanCastTo() const
A class containing focus search options.
Definition: YiFocusSearchOptions.h:21
CYISceneNode * m_pParent
Definition: YiSceneNode.h:2130
void StopPropertyAnimation(PropertyAnimation::Type propType)
virtual void SizeChanged()
Iterator & operator+=(int n)
const glm::vec3 & GetInitialSize() const
ReverseIterator rend(Iterator::Mode mode=Iterator::Mode::ImmediateChildren) const
size_t GetMaterialCount() const
Scene trees composed of CYISceneNode objects are registered with the scene manager in order for them ...
Definition: YiSceneManager.h:82
void UpdateLocalSpaceCollision(CYIActionEvent *pActionEvent)
float GetCompositeOpacity() const
std::vector< std::shared_ptr< CYIEffect > > m_Effects
Definition: YiSceneNode.h:2136
uint64_t GetUniqueID() const
const std::shared_ptr< CYIMesh > & GetMesh() const
const CYILayoutConfig * GetLayoutConfig(LayoutConfigFetchMode fetchMode=LayoutConfigFetchMode::LazyInstantiate) const
Base class for events.
Definition: YiEvent.h:28
CYISceneNode * GetDrawParent() const
Class representing an instance of geometry information.
Definition: YiMesh.h:33
void StartPropertyAnimation(PropertyAnimation::Type propType, float from, float to, uint32_t durMs, CYITimeInterpolator *pTimeInterpolator=nullptr, bool dirtyLayout=true)
void UpdateEventForLocalSpace(CYIActionEvent *pActionEvent, glm::vec3 &rayOrigin, glm::vec3 &rayNonOriginPoint) const
Type m_type
Definition: YiSceneNode.h:201
Container class for Unicode strings. Conceptually, a CYIString object is a sequence of Unicode charac...
Definition: YiString.h:32
bool IsMeshHit(const CYIRay &rWorldSpaceRay) const
virtual CYIOptional< CYIStringView > GetProperty(CYIStringView propertyName) const override
CYISceneNode * GetNodeWithUniqueID(uint64_t uniqueID)
glm::vec3 m_measuredSize
Definition: YiSceneNode.h:2150
Type
Definition: YiSceneNode.h:171
static constexpr DirtyFlag DirtyVisibility
Definition: YiSceneNode.h:240
void SetMesh(const std::shared_ptr< CYIMesh > &pMesh)
Iterator & operator=(const Iterator &other)
std::unique_ptr< CYIAccessibilityAttributes > TakeAccessibilityAttributes()
void SetRotationZ(float rollDegrees)
virtual void OnCompositeOpacityUpdated()
virtual bool HasProperties() const override
CYISceneNode * GetNodeFromChildrenAfterTarget(const CYIRuntimeTypeInfo &enforceClassType, bool *pTargetReached, CYISceneNode *pStartAfterTarget)
CYISceneNode * GetParent() const
static constexpr DirtyFlag DirtyWorldSurfaceScale
Definition: YiSceneNode.h:291
static constexpr DirtyFlag DirtyWorldTransform
Definition: YiSceneNode.h:262
void SetAccessibilityAttributes(std::unique_ptr< CYIAccessibilityAttributes > pAttributes)
void StopCaptureTrackpadEvents()
static constexpr DirtyFlag DirtyLocalBoundingBox
Definition: YiSceneNode.h:304
CYISceneNode * GetChild(size_t index) const
size_t GetMaskCount() const
virtual void OnVisibilityUpdated()
virtual void OnDrawOrderChanged()
std::vector< std::unique_ptr< PropertyAnimation > > m_propertyAnimations
Definition: YiSceneNode.h:2137
bool operator!=(const Iterator &other) const
Iterator end(Iterator::Mode mode=Iterator::Mode::ImmediateChildren) const
bool DrawInFrontOfChildren(CYISceneNode *pSceneNode, bool *pChanged=nullptr)
virtual void ApplyMeasurements()
A representation of a single track of a CYITimeline.
Definition: YiTimelineTrack.h:25
virtual ~CYISceneNode()
Provides a base for the definition of camera objects.
Definition: YiAbstractCameraSceneNode.h:31
virtual CYIAbstractCameraSceneNode * FindActiveCamera(const CYISceneNode *pTargetSceneNode=nullptr) const
const glm::vec3 & GetPosition() const
The core bitmap container class used by You.i Engine.
Definition: YiBitmap.h:20
static constexpr DirtyFlag DirtyLocalTransform
Definition: YiSceneNode.h:254
void ConnectEffectsToTimelines(const CYITimelineTrack *pTrack)
const glm::vec3 & GetAnchorPoint() const
virtual void OnUpdateBegin()
bool IsFocusRoot() const
size_t GetChildCount() const
virtual void SetSize(const glm::vec3 &size, bool dirtyLayout=true)
bool IsBoundingBoxHit(const CYIRay &rWorldSpaceRay) const
virtual void LocalBoundingBoxUpdated()
CYIMaterial is a place holder for all the drawing parameters required by the renderer to draw a mesh/...
Definition: YiMaterial.h:29
Iterator begin(Iterator::Mode mode=Iterator::Mode::ImmediateChildren) const
friend class CYISceneNode
Definition: YiSceneNode.h:131
CYIAnimation m_animation
Definition: YiSceneNode.h:202
virtual void FocusChangedInDescendants(CYISceneNode *pNewNodeWithFocus, CYISceneNode *pPreviousNodeWithFocus)
virtual void CompositeOpacityUpdated()
void SetAccessible(CYIAccessibilityAttributes::Accessible accessible)
size_t GetIndexOfChild(const CYISceneNode *pSceneNode) const
virtual void OnSizeChanged()
Iterator & operator++()
void StopCaptureKeyboardEvents()
const glm::vec3 & GetRotation() const
CYIAdjustmentLayerSceneNode * GetLastAdjustmentLayer() const
Adds a masking effect to a scene node.
Definition: YiMask.h:18
A class used to proxy access to a CYISceneNode.
Definition: YiSceneNodeProxy.h:26
const std::shared_ptr< CYIEffect > & GetEffect(size_t index) const
void SetPosition(const glm::vec3 &position)
std::unique_ptr< CYIMask > RemoveMask(const CYIMask *pMask)
virtual CYIString GetDumpTreeString() const
static constexpr DirtyFlag DirtyMesh
Definition: YiSceneNode.h:284
CYISignal< CYIAccessibilityAttributes::Accessible > AccessibleStateChanged
Emitted when accessible state changed.
Definition: YiSceneNode.h:1762
MeasureSpec()
Definition: YiSceneNode.h:376
const glm::vec3 & GetSize() const
std::list< YI_SCENE_NODE_SUBCLASS * > GetDrawChildren() const
const glm::vec3 & GetWorldSurfaceScale() const
void StopCapturePointerEvents(uint8_t pointerID)
const CYIString & GetName() const
virtual void ChildVisibilityChanged(CYISceneNode *pChild)
virtual bool BroadcastEvent(const std::shared_ptr< CYIEventDispatcher > &pDispatcher, CYIEvent *pEvent)
void SetScale(const glm::vec3 &scale)
glm::mat4 GetWorldTransform() const
float m_to
Definition: YiSceneNode.h:204
void AddMask(std::unique_ptr< CYIMask > pMask)
size_t GetIndexOfDrawChild(const CYISceneNode *pSceneNode) const
CYIAccessibilityAttributes::Accessible GetAccessible() const
LayoutDirtyFlag GetLayoutDirtyFlag() const
void SetAnchorPointZ(float z)
float GetLocalOpacity() const
void DumpTree() const
const std::shared_ptr< IYIUniformBufferObject > & GetShaderUniforms() const
const glm::vec3 & GetScale() const
CYISceneNode * value_type
Definition: YiSceneNode.h:133
uint32_t GetChildCountRecursive() const
std::shared_ptr< CYISceneNodeProxy > GetSceneNodeProxy() const
const CYIAccessibilityAttributes * GetAccessibilityAttributes() const
static constexpr DirtyFlag DirtySceneGraph
Definition: YiSceneNode.h:233
bool DrawBehind(CYISceneNode *pSceneNode, bool *pChanged=nullptr)
virtual void OnPostBuildDrawList(std::vector< IYIRenderer::Command > *pDrawList)
static constexpr DirtyFlag DirtyClean
Definition: YiSceneNode.h:227
void SetPositionX(float x)
void SetAnchorPoint(const glm::vec3 &anchorPoint)
uint16_t DirtyFlag
Definition: YiSceneNode.h:222
Encapsulates the origin and direction points of a ray.
Definition: YiRay.h:32
void SetOpacity(float opacity)
CYITransform * GetTransform()
Definition: YiSceneNode.h:576
virtual void OnWorldBoundingBoxUpdated()
CYIString m_name
Definition: YiSceneNode.h:2129
virtual void UpdateBegin()
std::shared_ptr< CYIRenderable > m_pRenderable
Definition: YiSceneNode.h:2162
virtual void OnWorldScaleUpdated()
void SetInternalCustomTimelineValue(uint32_t trackID, const CYIVariant &value)
int32_t GetID() const
glm::vec3 m_initialSize
Definition: YiSceneNode.h:2149
void SetAnchorPointY(float y)
const CYIMask * GetMask(size_t index) const
void RemoveEffect(const std::shared_ptr< CYIEffect > &pEffect)
Represents an event target of type CYIEventTarget::SpecialEventTargetType.
Definition: YiEventTarget.h:25
MeasureMode mode
Definition: YiSceneNode.h:392
FetchType
Definition: YiSceneNode.h:359
CYISceneNode * GetDrawChild(size_t index) const
virtual void UpdateEnd()
std::unique_ptr< CYITransform > m_pTransform
Definition: YiSceneNode.h:2146
virtual bool Init()
A container class that either contains a value or &#39;nothing&#39;.
Definition: YiOptional.h:64
virtual void OnDirtyFlagChanged()
Defines a target for the rendering results to be sent to.
Definition: YiRenderTarget.h:51
bool GetClipping() const
virtual void DirtyFlagChanged()
float m_from
Definition: YiSceneNode.h:203
A scene node is the base type for all nodes which are used by the scene manager; it is an integral pa...
Definition: YiSceneNode.h:105
Definition: YiSceneNode.h:374
void SetIsFocusRoot(bool isFocusRoot)
Focus events represent when a view receives or loses focus.
Definition: YiFocusEvent.h:27
const CYIRenderable * GetRenderable() const
virtual void OnFocusGainedInDescendants(CYISceneNode *pNewNodeWithFocus, CYISceneNode *pPreviousNodeWithFocus)
Iterator operator+(int n) const
void SetOrientation(float pitchDegrees, float yawDegrees, float rollDegrees)
CYIString GetUniqueName() const
Provides transformation APIs.
Definition: YiTransform.h:21
std::bidirectional_iterator_tag iterator_category
Definition: YiSceneNode.h:132
A class used to hold node-specific layout configuration (such as, for example, Margin).
Definition: YiLayoutConfig.h:25
CYISignal< CYISceneNode *, PropertyAnimation::Type > PropertyAnimationComplete
Definition: YiSceneNode.h:1757
void SetProperty(const CYIString &rPropertyName, const CYIString &rPropertyValue)
void SetDirtyFlag(DirtyFlag dirtyFlag)
std::unique_ptr< CYINPatch > m_pNPatch
Definition: YiSceneNode.h:2159
Class representing a node property animation.
Definition: YiSceneNode.h:165
void SetUseLocalTransformAndAlpha(bool use)
virtual void OnFocusLostInDescendants(CYISceneNode *pNewNodeWithFocus, CYISceneNode *pPreviousNodeWithFocus)
Iterator & operator--()
void SetPositionZ(float z)
virtual void SetCustomUniforms()
bool m_clip
Definition: YiSceneNode.h:2153
friend class UnitTestSetupHelper
Definition: YiSceneNode.h:2270
virtual void OnTransformUpdated()
LayoutDirtyFlag
Definition: YiSceneNode.h:311
std::shared_ptr< CYIBitmap > m_pNPatchBitmap
Definition: YiSceneNode.h:2160
std::list< CYISceneNode * > GetNodes(CYIStringView name)
static constexpr DirtyFlag DirtyUniform
Definition: YiSceneNode.h:268
value_type operator*() const
void SetScaleX(float factor)
The abstract runtime representation of a C++ type.
Definition: YiRtti.h:58
MeasureSpec(MeasureMode mode, float size)
Definition: YiSceneNode.h:381
float m_localOpacity
Definition: YiSceneNode.h:2144
virtual void OnUpdateEnd()
virtual void WorldSurfaceScaleUpdated()
virtual bool ProcessEvent(const std::shared_ptr< CYIEventDispatcher > &pDispatcher, CYIEvent *pEvent) override
bool IsPerceptible() const
Definition: YiEffect.h:42
bool m_dirtyLayout
Definition: YiSceneNode.h:205
Definition: YiSignalHandler.h:175
CYISceneNode * m_pDrawParent
Definition: YiSceneNode.h:2131
glm::vec3 m_vlsLastCollision
Definition: YiSceneNode.h:2151
bool InsertChildAfter(CYISceneNode *pRefNode, std::unique_ptr< CYISceneNode > pSceneNode)
bool AddChild(std::unique_ptr< CYISceneNode > pSceneNode)
A class used to hold node-specific layout state.
Definition: YiLayoutState.h:16
static constexpr DirtyFlag DirtyWorldBoundingBox
Definition: YiSceneNode.h:275
void SetLayoutState(std::unique_ptr< CYILayoutState > pLayoutState)
std::vector< CYISceneNode * > m_drawChildren
Definition: YiSceneNode.h:2134
void SetClippingOff()
const CYIAABB & GetClippingBox() const
virtual void WorldBoundingBoxUpdated()
size_t GetDrawChildCount() const
virtual void OnLocalBoundingBoxUpdated()
void ClearNPatch()
void ForceDirty()
An interface to a class that provides key-value properties.
Definition: YiPropertiesSource.h:21
virtual void LayoutDirtied()
CYISceneNode * GetDrawChildByID(int32_t id) const
float size
Definition: YiSceneNode.h:393
This class represents an Axis-Aligned Bounding Box.
Definition: YiAABB.h:22
CYISceneNode * reference
Definition: YiSceneNode.h:136
uint64_t m_guid
Definition: YiSceneNode.h:2157
DirtyFlag GetPreviousDirtyFlag() const
virtual void ForEachProperty(const std::function< void(const CYIString &, const CYIString &)> &action) const override
std::shared_ptr< CYISceneNodeProxy > m_pNodeProxy
Definition: YiSceneNode.h:200
void SetAnchorPointX(float x)
Iterator operator-(int n) const
void SetSceneManager(CYISceneManager *pSceneManager)
glm::mat4 GetLocalTransform() const
bool Intersects(const CYISceneNode *pNode) const
void SetMeshTransform(const glm::mat4 &rTransform)
An accessibility attributes defines the accessibility related properties of the containing scene node...
Definition: YiAccessibilityAttributes.h:25
virtual void ChildAdded(CYISceneNode *pChild)
void SetMeasuredSize(const glm::vec3 &measuredSize)
void SetClippingBox(const CYIAABB &rWorldBox)
Accessible
The accessible type of the CYIAccessibilityAttributes class instance.
Definition: YiAccessibilityAttributes.h:31
void SetName(const CYIString &name)
Used to create animations programatically.
Definition: YiAnimation.h:29
#define YI_TYPE_BASES(CLASS, BASES...)
Definition: YiRtti.h:259
void SetLayoutConfig(std::unique_ptr< CYILayoutConfig > pLayoutConfig)
LayoutDirtyFlag GetCurrentLayoutDirtyFlag() const
Common interface for shader uniform buffers.
Definition: YiUniformBufferObject.h:16
virtual void OnFocusChangedInDescendants(CYISceneNode *pNewNodeWithFocus, CYISceneNode *pPreviousNodeWithFocus)
Iterator & operator-=(int n)
const CYIAABB & GetWorldAABB() const
virtual void VisibilityUpdated()
void SetNodeType()
const std::shared_ptr< CYIMaterial > & GetMaterial(size_t index=0) const
void SetMaterial(const std::shared_ptr< CYIMaterial > &pMaterial, size_t index=0)
bool IsInitialized() const
virtual void ChildNeedsLayout()
virtual void OnChildRemoved(CYISceneNode *pChild)
virtual void OnWorldSurfaceScaleUpdated()
std::vector< std::unique_ptr< CYISceneNode > > m_children
Definition: YiSceneNode.h:2133
virtual void SetCustomTimelineValue(uint32_t trackID, const CYIVariant &value)
Mode
Definition: YiSceneNode.h:123
const glm::quat & GetOrientation() const
bool IsVisible() const
const glm::vec3 & GetMeasuredSize() const
This class contains the data required by the renderer in order to render a renderable component...
Definition: YiRenderable.h:20
void SetScaleZ(float factor)
std::unique_ptr< CYISceneNode > RemoveChild(CYISceneNode *pSceneNode)
const CYILayoutState * GetLayoutState() const
bool DrawInFront(CYISceneNode *pSceneNode, bool *pChanged=nullptr)
static const MeasureSpec defaultSpec
Definition: YiSceneNode.h:390
const CYIAABB & GetLocalAABB() const
void SetRenderTarget(const std::shared_ptr< CYIRenderTarget > &pRenderTarget)
MeasureMode
Definition: YiSceneNode.h:340
bool SetNPatchBitmap(const std::shared_ptr< CYIBitmap > &pNPatchBitmap)
Base class used to listen to one or more CYIAnimations as they update over time.
Definition: YiAnimation.h:59
void AddEffect(const std::shared_ptr< CYIEffect > &pEffect)
static constexpr DirtyFlag DirtyWorldScale
Definition: YiSceneNode.h:298
bool ChangeParent(CYISceneNode *pParent)
void SetPositionY(float y)
ReverseIterator rbegin(Iterator::Mode mode=Iterator::Mode::ImmediateChildren) const
const std::shared_ptr< CYIRenderTarget > & GetRenderTarget() const
void RequestLayout()
std::reverse_iterator< Iterator > ReverseIterator
Definition: YiSceneNode.h:112
ptrdiff_t difference_type
Definition: YiSceneNode.h:134
CYISceneNode ** pointer
Definition: YiSceneNode.h:135
static const float OPACITY_NOT_VISIBLE_EPSILON
Definition: YiSceneNode.h:110
std::list< YI_SCENE_NODE_SUBCLASS * > GetChildren() const
virtual void WorldScaleUpdated()
CYISignal< CYISceneNode *, CYISceneNode *> DescendantGainedFocus
Emitted when focus has entered this tree. The first signal parameter is the new node with focus...
Definition: YiSceneNode.h:1759
CYISceneManager * GetSceneManager() const
Stores data related to a user Action event.
Definition: YiActionEvent.h:19
virtual void ChildRemoved(CYISceneNode *pChild)
void SetClippingOn()
const std::shared_ptr< CYIBitmap > & GetNPatchBitmap() const
CYISignal< CYISceneNode *, CYISceneNode *> DescendantsChangedFocus
Emitted when focus has changed within this tree. This signal is called only if focus was previously w...
Definition: YiSceneNode.h:1761
void SetRotationY(float yawDegrees)
virtual void FocusGainedInDescendants(CYISceneNode *pNewNodeWithFocus, CYISceneNode *pPreviousNodeWithFocus)
bool IsAncestorOf(const CYISceneNode *pNode) const
static constexpr DirtyFlag DirtyOpacity
Definition: YiSceneNode.h:247
void SetScaleY(float factor)
bool ReorderChild(size_t fromIndex, size_t toIndex)
virtual void FocusLostInDescendants(CYISceneNode *pNewNodeWithFocus, CYISceneNode *pPreviousNodeWithFocus)
static constexpr DirtyFlag DirtyEverything
Definition: YiSceneNode.h:309
A lightweight wrapper around a sequence of Unicode characters.
Definition: YiStringView.h:61
void DestroyChildren()
const glm::vec3 & GetWorldScale() const