You.i Engine
CYIVectorCanvasNode Class Reference

Detailed Description

A scene node used to draw vector graphics.

This class provides an 'immediate mode'-type API to build a queue of vector drawing commands. Each frame, this node will draw its queued commands. The node's transform, opacity and visibility are also taken into account.

To start drawing a shape, call the PushBeginPath function. A path can then be built using the PushRectangle and PushEllipse functions. Once the path is complete, it can be drawn using the PushFill function or using the PushStroke functions. The drawing functions can be called multiple times using the same path.

Groups can be pushed onto the commands queue using PushGroup in order to apply transforms to a set of shapes. Pushing a new group does not end the current path, and only subsequent shapes are affected by the new group. Groups can be nested, and a group can be 'finished' by calling PopGroup.

#include <scenetree/YiVectorCanvasNode.h>

Inheritance diagram for CYIVectorCanvasNode:

Classes

struct  Vertex
 

Public Types

enum  Ordering : uint8_t {
  Ordering::Above = 0,
  Ordering::Below
}
 
enum  LineCap : uint8_t {
  LineCap::Butt = 0,
  LineCap::Round,
  LineCap::Projecting
}
 
enum  LineJoin : uint8_t {
  LineJoin::Miter = 0,
  LineJoin::Round,
  LineJoin::Bevel
}
 
enum  Winding : uint8_t {
  Winding::Forward = 0,
  Winding::Reverse
}
 
enum  SkewMode : uint8_t {
  SkewMode::Cartesian = 0,
  SkewMode::Polar
}
 
enum  PositionMode : uint8_t {
  PositionMode::TopLeft = 0,
  PositionMode::Centered
}
 
- Public Types inherited from CYISceneNode
enum  LayoutDirtyFlag : uint8_t {
  LayoutDirtyFlag::Clean,
  LayoutDirtyFlag::ChildDirty,
  LayoutDirtyFlag::Dirty
}
 
enum  LayoutConfigFetchMode {
  LayoutConfigFetchMode::DoNotLazyInstantiate = 0,
  LayoutConfigFetchMode::LazyInstantiate
}
 
enum  MeasureMode {
  MeasureMode::Unspecified,
  MeasureMode::UpTo,
  MeasureMode::Exactly
}
 
enum  FetchType {
  FetchType::Optional = 0,
  FetchType::Mandatory
}
 
typedef std::reverse_iterator< IteratorReverseIterator
 
typedef uint16_t DirtyFlag
 
- Public Types inherited from CYIEventTarget
enum  SpecialEventTargetType : uint8_t {
  SpecialEventTargetType::None = 0x00,
  SpecialEventTargetType::NoPick = 0x20
}
 
enum  Phase : uint8_t {
  Phase::Bubble,
  Phase::Capture
}
 

Public Member Functions

 CYIVectorCanvasNode ()
 
virtual ~CYIVectorCanvasNode ()
 
void PushGroup ()
 
void PushGroup (glm::vec2 position, float rotation, glm::vec2 scale, float opacity, int32_t componentID=-1)
 
void PushGroup (glm::vec2 anchorPoint, glm::vec2 position, float rotation, glm::vec2 scale, glm::vec2 skew, float opacity, SkewMode skewMode=SkewMode::Cartesian, int32_t componentID=-1)
 
void PopGroup ()
 
void PushRepeater (float copies, float offset, glm::vec2 anchorPoint, glm::vec2 position, float rotation, glm::vec2 scale, float startOpacity, float endOpacity, Ordering composite=Ordering::Above, int32_t componentID=-1)
 
void PopRepeater ()
 
void PushBeginPath ()
 
void PushWinding (Winding winding, int32_t componentID=-1)
 
void PushRectangle (glm::vec2 position, glm::vec2 size, float roundness=0.0f, PositionMode positionMode=PositionMode::TopLeft, int32_t componentID=-1)
 
void PushEllipse (glm::vec2 position, glm::vec2 size, int32_t componentID=-1)
 
void PushPath (std::vector< Vertex > vertices, bool closedPath, int32_t componentID=-1)
 
void PushFill (CYIColor color, int32_t componentID=-1)
 
void PushLinearGradientFill (CYIColor startColor, CYIColor endColor, glm::vec2 startPosition, glm::vec2 endPosition, int32_t componentID=-1)
 
void PushRadialGradientFill (CYIColor startColor, CYIColor endColor, glm::vec2 center, float innerRadius, float outerRadius, int32_t componentID=-1)
 
void PushStroke (float strokeWidth, CYIColor color, LineCap lineCap=LineCap::Butt, LineJoin lineJoin=LineJoin::Miter, float miterLimit=4.0f, int32_t componentID=-1)
 
void PushLinearGradientStroke (float strokeWidth, CYIColor startColor, CYIColor endColor, glm::vec2 startPosition, glm::vec2 endPosition, LineCap lineCap=LineCap::Butt, LineJoin lineJoin=LineJoin::Miter, float miterLimit=4.0f, int32_t componentID=-1)
 
void PushRadialGradientStroke (float strokeWidth, CYIColor startColor, CYIColor endColor, glm::vec2 center, float innerRadius, float outerRadius, LineCap lineCap=LineCap::Butt, LineJoin lineJoin=LineJoin::Miter, float miterLimit=4.0f, int32_t componentID=-1)
 
void ClearCommandQueue ()
 
size_t GetCommandQueueSize () const
 
void SetAttributeValue (CYITimelineTrack::AttributeType attribute, int32_t componentID, const CYIVariant &value)
 
- Public Member Functions inherited from CYISceneNode
 CYISceneNode ()
 
virtual ~CYISceneNode ()
 
virtual bool Init ()
 
bool IsInitialized () const
 
void ForceDirty ()
 
void SetDirtyFlag (DirtyFlag dirtyFlag)
 
DirtyFlag GetDirtyFlag () const
 
DirtyFlag GetPreviousDirtyFlag () const
 
const CYIStringGetName () const
 
CYIString GetUniqueName () const
 
void SetSceneManager (CYISceneManager *pSceneManager)
 
void SetName (const CYIString &name)
 
int32_t GetID () const
 
void SetID (int32_t id)
 
uint64_t GetUniqueID () const
 
bool AddChild (std::unique_ptr< CYISceneNode > pSceneNode)
 
bool AddChild (std::unique_ptr< CYISceneNode >, size_t index)
 
bool InsertChildAfter (CYISceneNode *pRefNode, std::unique_ptr< CYISceneNode > pSceneNode)
 
std::unique_ptr< CYISceneNodeRemoveChild (CYISceneNode *pSceneNode)
 
bool ReorderChild (size_t fromIndex, size_t toIndex)
 
CYITransformGetTransform ()
 
CYISceneNodeGetParent () const
 
bool ChangeParent (CYISceneNode *pParent)
 
CYISceneNodeGetDrawParent () const
 
bool IsAncestorOf (const CYISceneNode *pNode) const
 
CYISceneManagerGetSceneManager () const
 
size_t GetChildCount () const
 
uint32_t GetChildCountRecursive () const
 
CYISceneNodeGetChild (size_t index) const
 
Iterator begin (Iterator::Mode mode=Iterator::Mode::ImmediateChildren) const
 
Iterator end (Iterator::Mode mode=Iterator::Mode::ImmediateChildren) const
 
ReverseIterator rbegin (Iterator::Mode mode=Iterator::Mode::ImmediateChildren) const
 
ReverseIterator rend (Iterator::Mode mode=Iterator::Mode::ImmediateChildren) const
 
CYISceneNodeGetChild (const CYIString &name) const
 
size_t GetDrawChildCount () const
 
CYISceneNodeGetDrawChild (size_t index) const
 
CYISceneNodeGetDrawChildByID (int32_t id) const
 
template<class YI_SCENE_NODE_SUBCLASS >
YI_SCENE_NODE_SUBCLASS * GetChild (uint32_t targetMatchedNodeCount=1) const
 
template<class YI_SCENE_NODE_SUBCLASS >
std::list< YI_SCENE_NODE_SUBCLASS * > GetChildren () const
 
template<class YI_SCENE_NODE_SUBCLASS >
std::list< YI_SCENE_NODE_SUBCLASS * > GetDrawChildren () const
 
size_t GetIndexOfChild (const CYISceneNode *pSceneNode) const
 
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
 
CYISceneNodeGetNode (CYIStringView name)
 
CYISceneNodeGetNode (CYIStringView name, const CYIRuntimeTypeInfo &enforceClassType)
 
CYISceneNodeGetNode (const CYIRuntimeTypeInfo &enforceClassType)
 
CYISceneNodeGetNodeAfterTarget (const CYIRuntimeTypeInfo &enforceClassType, CYISceneNode *pStartAfterTarget)
 
template<class YI_SCENE_NODE_SUBCLASS >
YI_SCENE_NODE_SUBCLASS * GetNode (CYIStringView name)
 
CYISceneNodeGetNode (const int32_t id)
 
CYISceneNodeGetNode (const int32_t id, const CYIRuntimeTypeInfo &enforceClassType)
 
CYISceneNodeGetNodeWithUniqueID (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< CYIMaskRemoveMask (const CYIMask *pMask)
 
size_t GetMaskCount () const
 
const CYIMaskGetMask (size_t index) const
 
CYIMaskGetMask (size_t index)
 
const std::shared_ptr< CYIMesh > & GetMesh () const
 
const std::shared_ptr< CYIBitmap > & GetNPatchBitmap () const
 
size_t GetMaterialCount () const
 
const std::shared_ptr< CYIMaterial > & GetMaterial (size_t index=0) const
 
const std::shared_ptr< IYIUniformBufferObject > & GetShaderUniforms () const
 
void SetMeshTransform (const glm::mat4 &rTransform)
 
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 OnPostBuildDrawList (std::vector< IYIRenderer::Command > *pDrawList)
 
const CYIAABBGetWorldAABB () const
 
const CYIAABBGetLocalAABB () const
 
void SetAnchorPoint (const glm::vec3 &anchorPoint)
 
void SetAnchorPoint (float x, float y, float z)
 
void SetAnchorPointX (float x)
 
void SetAnchorPointY (float y)
 
void SetAnchorPointZ (float z)
 
void SetPosition (const glm::vec3 &position)
 
void SetPosition (float x, float y, float z)
 
void SetPositionX (float x)
 
void SetPositionY (float y)
 
void SetPositionZ (float z)
 
void SetRotation (const glm::vec3 &rotation)
 
void SetRotation (float pitchDegrees, float yawDegrees, float rollDegrees)
 
void SetRotationX (float pitchDegrees)
 
void SetRotationY (float yawDegrees)
 
void SetRotationZ (float rollDegrees)
 
void SetOrientation (float pitchDegrees, float yawDegrees, float rollDegrees)
 
void SetOrientation (const glm::quat &orientation)
 
void SetScale (const glm::vec3 &scale)
 
void SetScale (float factorX, float factorY, float factorZ)
 
void SetScaleX (float factor)
 
void SetScaleY (float factor)
 
void SetScaleZ (float factor)
 
const glm::vec3 & GetPosition () const
 
const glm::vec3 & GetScale () const
 
const glm::vec3 & GetWorldScale () const
 
const glm::vec3 & GetWorldSurfaceScale () const
 
const glm::vec3 & GetRotation () const
 
const glm::quat & GetOrientation () const
 
const glm::vec3 & GetAnchorPoint () const
 
virtual void SetSize (const glm::vec3 &size, bool dirtyLayout=true)
 
const glm::vec3 & GetSize () const
 
const glm::vec3 & GetInitialSize () const
 
void SetMeasuredSize (const glm::vec3 &measuredSize)
 
const glm::vec3 & GetMeasuredSize () const
 
void SetInternalCustomTimelineValue (uint32_t trackID, const CYIVariant &value)
 
virtual void SetCustomTimelineValue (uint32_t trackID, const CYIVariant &value)
 
void SetClippingOn ()
 
void SetClippingOff ()
 
bool GetClipping () const
 
void SetClippingBox (const CYIAABB &rWorldBox)
 
const CYIAABBGetClippingBox () const
 
void StartPropertyAnimation (PropertyAnimation::Type propType, float from, float to, uint32_t durMs, CYITimeInterpolator *pTimeInterpolator=nullptr, bool dirtyLayout=true)
 
void StopPropertyAnimation (PropertyAnimation::Type propType)
 
void UpdateLocalSpaceCollision (CYIActionEvent *pActionEvent)
 
virtual bool BroadcastEvent (const std::shared_ptr< CYIEventDispatcher > &pDispatcher, CYIEvent *pEvent)
 
void UpdateEventForLocalSpace (CYIActionEvent *pActionEvent, glm::vec3 &rayOrigin, glm::vec3 &rayNonOriginPoint) const
 
bool IsBoundingBoxHit (const CYIRay &rWorldSpaceRay) const
 
bool IsMeshHit (const CYIRay &rWorldSpaceRay) const
 
void DumpTree () const
 
void StartCaptureKeyboardEvents ()
 
void StopCaptureKeyboardEvents ()
 
void StartCaptureTrackpadEvents ()
 
void StopCaptureTrackpadEvents ()
 
void StartCapturePointerEvents (uint8_t pointerID)
 
void StopCapturePointerEvents (uint8_t pointerID)
 
bool DrawBehindChildren (CYISceneNode *pSceneNode, bool *pChanged=nullptr)
 
bool DrawInFrontOfChildren (CYISceneNode *pSceneNode, bool *pChanged=nullptr)
 
bool DrawBehind (CYISceneNode *pSceneNode, bool *pChanged=nullptr)
 
bool DrawInFront (CYISceneNode *pSceneNode, bool *pChanged=nullptr)
 
bool IsFocusRoot () const
 
void SetIsFocusRoot (bool isFocusRoot)
 
virtual void OnFocusGainedInDescendants (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< CYIStringViewGetProperty (CYIStringView propertyName) const override
 
bool GetProperty (CYIStringView propertyName, CYIString *pValue) const
 
virtual std::map< CYIString, CYIStringGetProperties () 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 &rPropertyName, const CYIString &rPropertyValue)
 
std::shared_ptr< CYISceneNodeProxyGetSceneNodeProxy () const
 
void SetLayoutConfig (std::unique_ptr< CYILayoutConfig > pLayoutConfig)
 
const CYILayoutConfigGetLayoutConfig (LayoutConfigFetchMode fetchMode=LayoutConfigFetchMode::LazyInstantiate) const
 
CYILayoutConfigGetLayoutConfig (LayoutConfigFetchMode fetchMode=LayoutConfigFetchMode::LazyInstantiate)
 
void SetLayoutState (std::unique_ptr< CYILayoutState > pLayoutState)
 
const CYILayoutStateGetLayoutState () const
 
CYILayoutStateGetLayoutState ()
 
void RequestLayout ()
 
LayoutDirtyFlag GetLayoutDirtyFlag () const
 
virtual void SetLayoutDirtyFlag (LayoutDirtyFlag flag)
 
virtual void Measure (const MeasureSpec &widthSpec, const MeasureSpec &heightSpec, const MeasureSpec &depthSpec)
 
virtual void ApplyMeasurements ()
 
virtual CYIAbstractCameraSceneNodeFindActiveCamera (const CYISceneNode *pTargetSceneNode=nullptr) const
 
CYIAccessibilityAttributes::Accessible GetAccessible () const
 
void SetAccessible (CYIAccessibilityAttributes::Accessible accessible)
 
const CYIAccessibilityAttributesGetAccessibilityAttributes () const
 
std::unique_ptr< CYIAccessibilityAttributesTakeAccessibilityAttributes ()
 
void SetAccessibilityAttributes (std::unique_ptr< CYIAccessibilityAttributes > pAttributes)
 
const CYIRenderableGetRenderable () const
 
template<typename T >
bool CanCastTo () const
 
CYIAdjustmentLayerSceneNode * GetLastAdjustmentLayer () const
 
- Public Member Functions inherited from CYIEventTarget
 CYIEventTarget ()
 
virtual ~CYIEventTarget ()
 
bool AddEventListener (CYIEvent::Type eventType, CYIEventHandler *pListener, CYIEventTarget::Phase phase=CYIEventTarget::Phase::Bubble)
 
bool RemoveEventListener (CYIEvent::Type eventType, CYIEventHandler *pListener, CYIEventTarget::Phase phase=CYIEventTarget::Phase::Bubble)
 
void SetSpecialTypeFlag (SpecialEventTargetType type)
 
void ClearSpecialTypeFlag (SpecialEventTargetType type)
 
SpecialEventTargetType GetSpecialTypes () const
 
const std::shared_ptr< CYIEventTargetProxy > & GetProxy () const
 
- Public Member Functions inherited from CYISignalHandler
 CYISignalHandler ()
 
 CYISignalHandler (const CYISignalHandler &rSignalHandler)
 
virtual ~CYISignalHandler ()
 
CYISignalHandleroperator= (const CYISignalHandler &rSignalHandler)
 
void MoveToThread (CYIThread *pThread)
 This function allows the user to override the default thread affinity to any CYIThread that may or may not be running. More...
 
CYIThreadHandle GetThreadAffinity () const
 
void SetThreadAffinity (const CYIThreadHandle &rThreadAffinity)
 
virtual bool IsConnected () const
 
virtual bool IsConnected (const CYISignalBase &rSignal) const
 
void Disconnect (CYISignalBase &rSignal)
 
void DisconnectFromAllSignals ()
 
- Public Member Functions inherited from CYIThread::Listener
 Listener ()
 
virtual ~Listener ()
 
virtual void OnThreadStarted (CYIThread *)
 
virtual void OnThreadTerminated (CYIThread *)
 
virtual void OnThreadFinished (CYIThread *)
 
- Public Member Functions inherited from IYIPropertiesSource
virtual ~IYIPropertiesSource ()=default
 
bool GetProperty (CYIStringView propertyName, CYIString *pValue) const
 

Protected Member Functions

virtual void UpdateBegin () override
 
virtual void SizeChanged () override
 
- Protected Member Functions inherited from CYISceneNode
void Update ()
 
virtual void OnUpdateBegin ()
 
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 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 CYISceneNodeGetNodeFromChildren (CYIStringView name)
 
virtual CYISceneNodeGetNodeFromChildren (const int32_t id)
 
virtual CYISceneNodeGetNodeFromChildren (const CYIRuntimeTypeInfo &enforceClassType)
 
CYISceneNodeGetNodeFromChildrenAfterTarget (const CYIRuntimeTypeInfo &enforceClassType, bool *pTargetReached, CYISceneNode *pStartAfterTarget)
 

Additional Inherited Members

- Static Public Member Functions inherited from CYISceneNode
static void RegisterAllSceneNodes ()
 
- Public Attributes inherited from CYISceneNode
CYISignal< CYISceneNode *, PropertyAnimation::TypePropertyAnimationComplete
 
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::AccessibleAccessibleStateChanged
 Emitted when accessible state changed. More...
 
- Static Public Attributes inherited from CYISceneNode
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 Attributes inherited from CYISceneNode
CYIString m_name
 
CYISceneNodem_pParent
 
CYISceneNodem_pDrawParent
 
std::vector< std::unique_ptr< CYISceneNode > > m_children
 
std::vector< CYISceneNode * > m_drawChildren
 
std::map< CYIString, CYIString, std::less<> > m_Properties
 
std::vector< std::shared_ptr< CYIEffect > > m_Effects
 
std::vector< std::unique_ptr< PropertyAnimation > > m_propertyAnimations
 
float m_localOpacity
 
std::unique_ptr< CYITransformm_pTransform
 
glm::vec3 m_size
 
glm::vec3 m_initialSize
 
glm::vec3 m_measuredSize
 
glm::vec3 m_vlsLastCollision
 
bool m_clip
 
bool m_localVisibility
 
int32_t m_id
 
uint64_t m_guid
 
std::unique_ptr< CYINPatch > m_pNPatch
 
std::shared_ptr< CYIBitmapm_pNPatchBitmap
 
std::shared_ptr< CYIRenderablem_pRenderable
 
- Protected Attributes inherited from CYIEventTarget
std::vector< EventListenerEntry > m_listeners
 
SpecialEventTargetType m_specialTypes
 
std::shared_ptr< CYIEventTargetProxym_pEventTargetProxy
 

Member Enumeration Documentation

◆ LineCap

enum CYIVectorCanvasNode::LineCap : uint8_t
strong

An enum listing the various supported line caps, used to draw the beginning and end of lines.

Enumerator
Butt 

Lines begin and end with a rectangular shape.

Round 

Lines begin and end with a rounded edge.

Projecting 

Lines begin and end farther than their actual end (by the line width amount) and have a rectangular shape.

◆ LineJoin

enum CYIVectorCanvasNode::LineJoin : uint8_t
strong

An enum listing the various line joins, used to draw where lines meet in a shape or path.

Enumerator
Miter 

Lines join with a sharp angle.

Round 

Lines join with a rounded edge.

Bevel 

Lines join with a beveled edge.

◆ Ordering

enum CYIVectorCanvasNode::Ordering : uint8_t
strong

An enum listing possible orderings.

Enumerator
Above 
Below 

◆ PositionMode

enum CYIVectorCanvasNode::PositionMode : uint8_t
strong

An enum listing the various modes for which position can be provided.

Enumerator
TopLeft 

The position is the top-left of the shape.

Centered 

The position is the center of the shape.

◆ SkewMode

enum CYIVectorCanvasNode::SkewMode : uint8_t
strong

An enum listing the various skew modes. These modes define the meaning of the skew values pushed along with groups.

Enumerator
Cartesian 

Each skew value indicates a skew, in radians, along one of the two axis.

Polar 

The first skew value represents a skew amount, and the second skew value represents a skew angle in radians.

◆ Winding

enum CYIVectorCanvasNode::Winding : uint8_t
strong

An enum listing the various windings for shapes. Windings can be used to draw 'holes' into shapes.

Enumerator
Forward 

Forward winding (also known as clockwise)

Reverse 

Reverse winding (also known as counter-clockwise)

Constructor & Destructor Documentation

◆ CYIVectorCanvasNode()

CYIVectorCanvasNode::CYIVectorCanvasNode ( )

◆ ~CYIVectorCanvasNode()

virtual CYIVectorCanvasNode::~CYIVectorCanvasNode ( )
virtual

Member Function Documentation

◆ ClearCommandQueue()

void CYIVectorCanvasNode::ClearCommandQueue ( )

Removes all queued drawing commands from the command queue.

◆ GetCommandQueueSize()

size_t CYIVectorCanvasNode::GetCommandQueueSize ( ) const

Returns the number of entries in the command queue.

◆ PopGroup()

void CYIVectorCanvasNode::PopGroup ( )

Ends the most recently-pushed group. Pushing a 'pop' command results in the last group ending, and the transform being restored to the transform that was in effect before that group was pushed.

Popping a group does not start a new path.

◆ PopRepeater()

void CYIVectorCanvasNode::PopRepeater ( )

Ends the most recently-pushed repeater 'group'. Pushing a 'pop' command demarks the set of commands that should be repeated (e.g. the commands in between the 'push repeater' command and the 'pop repeater' command.)

See also
PushRepeater

◆ PushBeginPath()

void CYIVectorCanvasNode::PushBeginPath ( )

Begins a new path. Previously-pushed paths (and shapes) will not be affected by subsequent calls to PushFill or PushStroke.

◆ PushEllipse()

void CYIVectorCanvasNode::PushEllipse ( glm::vec2  position,
glm::vec2  size,
int32_t  componentID = -1 
)

Pushes an ellipse shape onto the command queue.

◆ PushFill()

void CYIVectorCanvasNode::PushFill ( CYIColor  color,
int32_t  componentID = -1 
)

Pushes a Fill draw command onto the command queue. This causes the path-so-far to be drawn (as a 'filled' shape) onto the screen using the provided parameters. The same path can be 'filled' multiple times, and more shapes can be added to the path before 'filling' the path again. Stroke and Fill commands can be applied to the same path.

See also
PushStroke

◆ PushGroup() [1/3]

void CYIVectorCanvasNode::PushGroup ( )

Pushes a new group onto the command queue. The new group does not modify the transforms or opacity. Pushing a group does not start a new path. Groups can be nested by calling PushGroup multiple times.

See also
PopGroup

◆ PushGroup() [2/3]

void CYIVectorCanvasNode::PushGroup ( glm::vec2  position,
float  rotation,
glm::vec2  scale,
float  opacity,
int32_t  componentID = -1 
)

Pushes a new group onto the command queue. The new group applies the transform specified by the provided parameters. Pushing a group does not start a new path. Groups can be nested by calling PushGroup multiple times.

See also
PopGroup

◆ PushGroup() [3/3]

void CYIVectorCanvasNode::PushGroup ( glm::vec2  anchorPoint,
glm::vec2  position,
float  rotation,
glm::vec2  scale,
glm::vec2  skew,
float  opacity,
SkewMode  skewMode = SkewMode::Cartesian,
int32_t  componentID = -1 
)

Pushes a new group onto the command queue. The new group applies the transform specified by the provided parameters. Pushing a group does not start a new path. Groups can be nested by calling PushGroup multiple times.

See also
PopGroup
SkewMode

◆ PushLinearGradientFill()

void CYIVectorCanvasNode::PushLinearGradientFill ( CYIColor  startColor,
CYIColor  endColor,
glm::vec2  startPosition,
glm::vec2  endPosition,
int32_t  componentID = -1 
)

Pushes a Linear Gradient Fill draw command onto the command queue. This causes the path-so-far to be drawn (as a 'filled' shape) onto the screen using the provided parameters. The same path can be 'filled' multiple times, and more shapes can be added to the path before 'filling' the path again. Stroke and Fill commands can be applied to the same path.

See also
PushStroke

◆ PushLinearGradientStroke()

void CYIVectorCanvasNode::PushLinearGradientStroke ( float  strokeWidth,
CYIColor  startColor,
CYIColor  endColor,
glm::vec2  startPosition,
glm::vec2  endPosition,
LineCap  lineCap = LineCap::Butt,
LineJoin  lineJoin = LineJoin::Miter,
float  miterLimit = 4.0f,
int32_t  componentID = -1 
)

Pushes a Linear Gradient Stroke draw command onto the command queue. This causes the path-so-far to be drawn (as an outline) onto the screen using the provided parameters. The same path can be stroked multiple times, and more shapes can be added to the path before stroking the path again. Stroke and Fill commands can be applied to the same path.

Note
Stroke and Fill commands are executed in the order that they are queued, and so typically the Stroke is pushed after the Fill to ensure that the stroke is rendered on 'top'.
See also
PushFill
LineCap
LineJoin

◆ PushPath()

void CYIVectorCanvasNode::PushPath ( std::vector< Vertex vertices,
bool  closedPath,
int32_t  componentID = -1 
)

Pushes a path shape onto the command queue. If closedPath is set to true, the first and last vertices are joined to form a closed shape. A path must have at least 2 vertices to be renderable.

◆ PushRadialGradientFill()

void CYIVectorCanvasNode::PushRadialGradientFill ( CYIColor  startColor,
CYIColor  endColor,
glm::vec2  center,
float  innerRadius,
float  outerRadius,
int32_t  componentID = -1 
)

Pushes a Radial Gradient Fill draw command onto the command queue. This causes the path-so-far to be drawn (as a 'filled' shape) onto the screen using the provided parameters. The same path can be 'filled' multiple times, and more shapes can be added to the path before 'filling' the path again. Stroke and Fill commands can be applied to the same path.

See also
PushStroke

◆ PushRadialGradientStroke()

void CYIVectorCanvasNode::PushRadialGradientStroke ( float  strokeWidth,
CYIColor  startColor,
CYIColor  endColor,
glm::vec2  center,
float  innerRadius,
float  outerRadius,
LineCap  lineCap = LineCap::Butt,
LineJoin  lineJoin = LineJoin::Miter,
float  miterLimit = 4.0f,
int32_t  componentID = -1 
)

Pushes a Linear Gradient Stroke draw command onto the command queue. This causes the path-so-far to be drawn (as an outline) onto the screen using the provided parameters. The same path can be stroked multiple times, and more shapes can be added to the path before stroking the path again. Stroke and Fill commands can be applied to the same path.

Note
Stroke and Fill commands are executed in the order that they are queued, and so typically the Stroke is pushed after the Fill to ensure that the stroke is rendered on 'top'.
See also
PushFill
LineCap
LineJoin

◆ PushRectangle()

void CYIVectorCanvasNode::PushRectangle ( glm::vec2  position,
glm::vec2  size,
float  roundness = 0.0f,
PositionMode  positionMode = PositionMode::TopLeft,
int32_t  componentID = -1 
)

Pushes a rectangle shape onto the command queue.

◆ PushRepeater()

void CYIVectorCanvasNode::PushRepeater ( float  copies,
float  offset,
glm::vec2  anchorPoint,
glm::vec2  position,
float  rotation,
glm::vec2  scale,
float  startOpacity,
float  endOpacity,
Ordering  composite = Ordering::Above,
int32_t  componentID = -1 
)

Pushes a new repeater 'group' onto the command queue. All subsequent commands (until an associated 'pop repeater' command) will be repeated copies times, with the provided transform data being applied in between each item.

The number of copies can be fractionnal. When a fractionnal copies count is used, the last copy has an additionnal opacity modifier added to it to fade it proportionally to the fractional part. For example, using a copies count of 2.3 will result in 2 items being rendered with the current opacity, and 1 more item being rendered with an additionnal opacity modifier of 30% applied to it.

Note
A negative number of copies is equivalent to 0 copies.

The offset value pre-applies the provided transform values offset times.

The startOpacity and \ a endOpacity are not affected by the offset parameter. Instead, the first-drawn item is always drawn with startOpacity, and each subsequent item is drawn with an opacity getting closer and closer to endOpacity.

Note
startOpacity and endOpacity have no value when the repeater 'group' only contains transform commands.

The composite parameter defines the layering order of drawn copies. When CYIVectorCanvasNode::Ordering::Above is used, each subsequent copy is drawn 'on top' of the previous copy. When CYIVectorCanvasNode::Ordering::Below is used, each subsequent copy is drawn 'under' the previous copy.

Note
This command has no effect unless a 'pop repeater' command is later pushed onto the queue to 'finish' the repeater group.
See also
PopRepeater

◆ PushStroke()

void CYIVectorCanvasNode::PushStroke ( float  strokeWidth,
CYIColor  color,
LineCap  lineCap = LineCap::Butt,
LineJoin  lineJoin = LineJoin::Miter,
float  miterLimit = 4.0f,
int32_t  componentID = -1 
)

Pushes a Stroke draw command onto the command queue. This causes the path-so-far to be drawn (as an outline) onto the screen using the provided parameters. The same path can be stroked multiple times, and more shapes can be added to the path before stroking the path again. Stroke and Fill commands can be applied to the same path.

Note
Stroke and Fill commands are executed in the order that they are queued, and so typically the Stroke is pushed after the Fill to ensure that the stroke is rendered on 'top'.
See also
PushFill
LineCap
LineJoin

◆ PushWinding()

void CYIVectorCanvasNode::PushWinding ( Winding  winding,
int32_t  componentID = -1 
)

Sets the winding of the last shape that has been pushed. If multiple shapes have been pushed, only the last one is affected. Shapes pushed subsequently are not affected. Changing the winding after pushing a new shape allows for 'holes' to be made in the shape.

See also
Winding

◆ SetAttributeValue()

void CYIVectorCanvasNode::SetAttributeValue ( CYITimelineTrack::AttributeType  attribute,
int32_t  componentID,
const CYIVariant value 
)

Applies a value to a specific attribute type for a specific component. Has no effect if this node does not contain the specified combination of component ID and attribute type.

◆ SizeChanged()

virtual void CYIVectorCanvasNode::SizeChanged ( )
overrideprotectedvirtual

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

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

Reimplemented from CYISceneNode.

◆ UpdateBegin()

virtual void CYIVectorCanvasNode::UpdateBegin ( )
overrideprotectedvirtual

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

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

Reimplemented from CYISceneNode.


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