Base class for scene graph nodes in Kanzi. More...
#include <kanzi/node/node.hpp>
Classes | |
struct | BindingEntry |
binding entry. More... | |
struct | TriggerEntry |
Object node trigger entry. More... | |
Public Member Functions | |
virtual | ~Node () |
Destructor. More... | |
template<typename DataType > | |
PropertyType< DataType >::DataType | getProperty (const PropertyType< DataType > &propertyType) const |
Returns the current value of a property. More... | |
template<typename DataType > | |
bool | getProperty (const PropertyType< DataType > &propertyType, typename PropertyType< DataType >::DataType &value) const |
Evaluates the property value in the same way as the overload above but does not default to the value in property metadata if there are no inputs to the property value. More... | |
template<typename DataType > | |
DataType | getAbstractProperty (AbstractPropertyType abstractPropertyType) const |
template<typename DataType > | |
bool | getAbstractProperty (AbstractPropertyType abstractPropertyType, typename PropertyType< DataType >::DataType &value) const |
template<typename TMessageType , typename TClass , typename TClassMethod > | |
MessageSubscriptionToken | addMessageHandler (TMessageType &messageType, TClass *messageHandlerObject, TClassMethod method) |
Adds a message handler where handler is a method to invoke on an object. More... | |
template<typename TMessageType , typename TClass , typename TClassMethod > | |
MessageSubscriptionToken | addMessageFilter (TMessageType &messageType, TClass *messageHandlerObject, TClassMethod method) |
Adds a message filter where filter is a method to invoke on an object. More... | |
template<typename TMessageType > | |
MessageSubscriptionToken | addMessageHandler (const TMessageType &messageType, typename TMessageType::FunctionType function) |
Adds a message handler where handler is function. More... | |
template<typename TMessageType > | |
MessageSubscriptionToken | addMessageFilter (const TMessageType &messageType, typename TMessageType::FunctionType function) |
Adds a message filter where filter is function. More... | |
void | removeMessageHandler (MessageSubscriptionToken token) |
Removes a message subscription. More... | |
template<typename TArgumentsType > | |
void | dispatchMessage (const MessageType< TArgumentsType > &messageType, typename MessageType< TArgumentsType >::ArgumentsType &messageArguments) |
Dispatches a message with specified arguments. More... | |
void | addResource (const ResourceID &resourceId, string_view resourceUrl) |
Adds a resource manager resource to an object node. If resourceID already exists in object, removes the existing entry. If resourceURL is NULL, error is thrown. */. More... | |
void | removeResource (const ResourceID &resourceId) |
Removes a resource with given ID from object node resource dictionary. Does not do anything if resourceID was not found. */. More... | |
bool | containsResource (const ResourceID &resourceID) const |
Returns if object node resource dictionary contains the resource with given ID. Resource can be any type: style, alias or resource manager resource. */. More... | |
optional< string > | findResourceURL (const ResourceID &resourceId) const |
ResourceSharedPtr | acquireResource (const ResourceID &id) const |
Acquires a resource from the node or the node's closest ancestor having the resource id in the resource dictionary. More... | |
template<typename T > | |
shared_ptr< T > | acquireResource (const ResourceID &id) const |
Acquires a resource from the node or the node's closest ancestor having the resource id in the resource dictionary, and casts the resource to given type. More... | |
ResourceSharedPtr | tryAcquireResource (const ResourceID &id) const |
Acquires a resource from the node or the node's closest ancestor having the resource id in the resource dictionary. More... | |
template<typename T > | |
shared_ptr< T > | tryAcquireResource (const ResourceID &id) const |
Acquires a resource from the node or the node's closest ancestor having the resource and casts the resource to given type. More... | |
ResourceDictionarySharedPtr | getResourceDictionary () const |
ResourceDictionarySharedPtr | acquireResourceDictionary () |
void | setResourceDictionary (ResourceDictionarySharedPtr resourceDictionary) |
void | addAnonymousResource (ResourceSharedPtr resource) |
Adds alias resource to an object node. More... | |
void | removeAnonymousResource (const Resource &resource) |
Removes anonymous resource from object node resources. More... | |
bool | isNamed (string_view name) const |
Node * | getParent () const |
Returns the parent of the node. More... | |
void | setParent (Node *parent) |
VisitorResult | visit (const Visitor &visitor, VisitorOrder order) |
VisitorResult | visitDescendants (const Visitor &visitor, VisitorOrder order) |
template<typename Type > | |
shared_ptr< Type > | lookupNode (string_view pathOrKey) |
Returns a node of specified type by looking it up with specified path or alias. More... | |
Node * | lookupNodeRaw (string_view relativePath) |
Get an object node by another node and a relative path. More... | |
ObjectSharedPtr | lookupObject (string_view relativePath) |
Lookup for an object from a node. More... | |
template<typename Type > | |
shared_ptr< Type > | lookupObject (string_view path) |
ObjectSharedPtr | lookupResource (string_view resourceName) |
Lookup for a resource from a node. More... | |
template<typename TNodeType > | |
shared_ptr< TNodeType > | findAbstractChild (string_view name) |
Find a child by name. Finds direct children as well as children connected indirectly for example Viewport->Scene. More... | |
virtual bool | addAbstractChildOverride (NodeSharedPtr child)=0 |
virtual size_t | getAbstractChildCountOverride ()=0 |
virtual NodeSharedPtr | getAbstractChildOverride (size_t index)=0 |
virtual bool | removeAbstractChildOverride (Node &child)=0 |
void | addInputManipulator (InputManipulatorSharedPtr inputManipulator) |
Transfers the ownership and attaches an input manipulator to an object node. More... | |
void | removeInputManipulator (InputManipulator &inputManipulator) |
Removes the ownership and detaches an input manipulator from an object node. More... | |
InputManipulatorConstIterator | beginInputManipulators () const |
InputManipulatorConstIterator | endInputManipulators () const |
void | addBinding (BindingSharedPtr binding) |
Transfers the ownership of a binding rule to an object node. More... | |
void | addBindingWithOwner (BindingSharedPtr binding, const void *owner) |
Transfers the ownership of a binding rule to an object node and sets the owner of binding rule. More... | |
void | removeBinding (Binding &binding) |
Removes the ownership and detaches a binding rule from an object node. More... | |
void | removeBindingsWithOwner (const void *owner) |
Removes all bindings with the specified owner. More... | |
BindingConstIterator | beginBindings () const |
BindingConstIterator | endBindings () const |
void | addTrigger (TriggerSharedPtr trigger) |
Transfers the ownership of a trigger to an object node. More... | |
void | addTriggerWithOwner (TriggerSharedPtr trigger, const void *owner) |
Transfers the ownership of a trigger to an object node and sets the owner of the trigger. More... | |
void | removeTrigger (Trigger &trigger) |
Removes the ownership of a trigger from an object node. More... | |
void | removeTriggersWithOwner (const void *owner) |
Removes all bindings with the specified owner. More... | |
TriggerConstIterator | beginTriggers () const |
TriggerConstIterator | endTriggers () const |
void | setRenderable (bool state) |
Sets whether the object node is renderable. More... | |
bool | isRenderable () const |
Returns whether node is renderable. More... | |
bool | isEffectivelyVisible () const |
Checks if the node and all of its ancestors are visible. More... | |
bool | isEffectivelyEnabled () const |
Checks if the node and all of its ancestors are enabled. More... | |
uint32_t | getChangeFlags () const |
Get current change flags. More... | |
uint32_t | getChildChangeFlags () const |
Get current child change flags. More... | |
void | setChangeFlag (uint32_t flag) |
Sets a change flag. More... | |
void | clearChangeFlag (uint32_t flag) |
Clears a change flag. More... | |
bool | isChangeFlagSet (uint32_t flag) const |
Checks if a change flag is set. More... | |
void | setChildChangeFlag (uint32_t flag) |
Sets a child change flag. More... | |
void | clearChildChangeFlag (uint32_t flag) |
Clears a child change flag. More... | |
bool | isChildChangeFlagSet (uint32_t flag) const |
Checks if child change flags match. More... | |
bool | isAnyChildChangeFlagSet (uint32_t flag) const |
Checks if any child change flags (corresponding to given mask) are set. More... | |
bool | isInvalidMeasure () const |
Check if the node needs measure. More... | |
void | invalidateMeasure () |
Invalidates measure for the node. More... | |
void | validateMeasure () |
Validates measure for the node. More... | |
bool | isInvalidArrange () const |
Checks if the node needs arrange. More... | |
void | invalidateArrange () |
Invalidates arrange. More... | |
void | validateArrange () |
Validates arrange. More... | |
bool | isInvalidRender () const |
Returns if node render flag is invalid. More... | |
void | validateRender () |
Validates render for object node. More... | |
void | invalidateRender () |
Invalidates render for object node. More... | |
bool | isAttached () const |
Returns true if the node is attached to a screen or one of its descendants. More... | |
bool | isAttaching () const |
Returns true if node is in the process of attaching, false otherwise. More... | |
bool | isDetaching () const |
Returns true if the node currently detaching. More... | |
void | attachRecursive () |
Attaches an object node and its children recursively. More... | |
void | detachRecursive () |
Detaches an object node and its children recursively. More... | |
kzsError | addTimeLineEntry (struct KzuTimeLineEntry *timeLineEntry) |
Adds timeline entry for object's animation player. More... | |
TimeLineEntrySharedPtr | addAnimationItem (AnimationItemSharedPtr animationItemSharedPtr, bool reverse, int repeatCount) |
Adds animation item for object's animation player. More... | |
kzsError | createAnimationPlayerAttachToParentPlayer (struct KzuAnimationPlayer **out_animationPlayer) |
Create an animation player that references this object node, attach to an animation player in parent node. More... | |
kzsError | createAnimationPlayerAttachToTaskScheduler (struct KzuAnimationPlayer **out_animationPlayer) |
Create an animation player that references this object node, attach to the master animation player in task scheduler. More... | |
kzsError | animationPlayerAttachToTaskScheduler (struct KzuAnimationPlayer *animationPlayer) const |
Attach given animation player to the task scheduler acquired via the object node. More... | |
struct KzuAnimationPlayer * | getAnimationPlayer () const |
Returns animation player from object node. More... | |
virtual void | getBoundingVolume (KzuBoundingVolume **out_boundingVolume) const |
Gets bounding volume from object node. More... | |
AppliedStyleEntry * | applyStyle (StyleSharedPtr style) |
Applies a style to an object node. More... | |
void | unapplyStyle (AppliedStyleEntry *appliedStyleEntry) |
Unapplies a style from an object node. More... | |
void | applyStyles () |
Apply all styles for an object node. More... | |
void | unapplyStyles () |
Unapplies and removes all applied styles. More... | |
void | applyStylesRecursive () |
Applies styles recursively. More... | |
void | unapplyStylesRecursive () |
Unapplies styles recursively. More... | |
void | removeKZBData () |
Destroys all object node data loaded from KZB, including properties, bindings, triggers, resources etc. More... | |
void | addPropertyNotificationHandler (AbstractPropertyType propertyType, AbstractPropertyNotificationHandler *handler) |
Add an abstract property notification handler. More... | |
void | removePropertyNotificationHandler (const AbstractPropertyNotificationHandler &handler) |
Remove an abstract property notification handler. More... | |
size_t | getPropertyNotificationHandlerCount () const |
Gets number of current notification handlers. More... | |
void | addResourceReference (AbstractPropertyType propertyType, AbstractResourceReference *reference) |
This is a helper for automatic resource tracking in ResourceReference. More... | |
void | removeResourceReference (const AbstractResourceReference &reference) |
This is a helper for automatic resource tracking in ResourceReference. More... | |
void | addNodeReference (AbstractPropertyType propertyType, AbstractNodeReference *reference) |
void | removeNodeReference (const AbstractNodeReference &reference) |
virtual void | restoreResources () |
Reattaches an object node after potential resource change. More... | |
ScriptingContextSharedPtr | getScriptingContext () const |
void | setScriptingContext (ScriptingContextSharedPtr context) |
![]() | |
Object (Domain *domain) | |
virtual | ~Object () |
Domain * | getDomain () const |
Returns the domain the object belongs to. More... | |
KzuPropertyManager * | getPropertyManager () const |
Returns the property manager of the object. More... | |
KzuTaskScheduler * | getTaskScheduler () const |
Returns the task scheduler of the object. More... | |
KzuMessageDispatcher * | getMessageDispatcher () const |
Returns the message dispatcher of the object. More... | |
ResourceManager * | getResourceManager () const |
Returns the resource manager of the object. More... | |
virtual const Metaclass * | getDynamicMetaclass () const |
Returns the metaclass of the dynamic type of the object. More... | |
bool | isTypeOf (const Metaclass *objectType) const |
Determines if the type of this object is the given type or derived from it. More... | |
template<typename DataType > | |
void | setProperty (const PropertyType< DataType > &propertyType, typename PropertyType< DataType >::DataType value) |
Sets the local value of a property. More... | |
void | setProperty (const PropertyType< ResourceID > &propertyType, ResourceSharedPtr value) |
Sets the local value of a resource id property with a resource pointer. More... | |
template<typename DataType > | |
DataType | getProperty (const PropertyType< DataType > &propertyType) const |
Returns the current value of a property. More... | |
template<typename DataType > | |
bool | getProperty (const PropertyType< DataType > &propertyType, typename PropertyType< DataType >::DataType &value) const |
Evaluates the property value in the same way as the overload above but does not default to the value in property metadata if there are no inputs to the property value. More... | |
template<typename DataType > | |
void | setAbstractProperty (AbstractPropertyType abstractPropertyType, typename PropertyType< DataType >::DataType value) |
void | setAbstractProperty (AbstractPropertyType abstractPropertyType, ResourceSharedPtr value) |
template<typename DataType > | |
DataType | getAbstractProperty (AbstractPropertyType abstractPropertyType) const |
template<typename DataType > | |
bool | getAbstractProperty (AbstractPropertyType abstractPropertyType, typename PropertyType< DataType >::DataType &value) const |
bool | hasValue (AbstractPropertyType propertyType) const |
Evaluates whether there are any inputs into the property value. More... | |
bool | hasLocalValue (AbstractPropertyType propertyType) const |
Evaluates whether there is a local value set for the property. More... | |
void | removeLocalValue (AbstractPropertyType propertyType) |
Removes the local value associated with the property. More... | |
void | copyLocalValues (const Object &other) |
Copies all local values from another object. More... | |
AppliedStyleEntry * | applyObjectStyle (kanzi::StyleSharedPtr style) |
Applies a style to an object. More... | |
void | unapplyObjectStyle (AppliedStyleEntry *appliedStyleEntry) |
void | applyObjectStyles () |
Apply all styles for an object node. More... | |
void | unapplyObjectStyles () |
Unapplies and removes all applied styles. More... | |
Protected Member Functions | |
Node (Domain *domain, string_view name) | |
Constructor. More... | |
void | initialize () |
virtual void | onAttached () |
Called when an object node becomes attached. More... | |
virtual void | onDetached () |
Called when an object node becomes detached. More... | |
virtual void | onNodePropertyChanged (AbstractPropertyType propertyType, KzuPropertyNotificationReason reason) |
Method executed on node property change. More... | |
virtual NodeSharedPtr | findAbstractChildOverride (string_view name)=0 |
virtual VisitorResult | visitAbstractChildOverride (const Visitor &visitor, VisitorOrder order)=0 |
void | updateResourceReferences () |
void | updateResourceReferences (AbstractPropertyType propertyType) |
void | updateResourceReferencesRecursive () |
void | updateResourceReferencesRecursive (const ResourceID &resourceID) |
void | attach () |
Attaches the object node. More... | |
void | detach () |
Detaches the object node. More... | |
![]() | |
void | initialize () |
void | onCopy (const Object &other) |
Static Protected Member Functions | |
static VisitorResult | updateResourceVisitor (Node &node, const ResourceID &id) |
static VisitorResult | updateAllResourcesVisitor (Node &node) |
static VisitorResult | applyStylesVisitor (Node &node, bool apply) |
static VisitorResult | attachVisitor (Node &node) |
static VisitorResult | detachVisitor (Node &node) |
static void | processPropertyChanged (Node &node, AbstractPropertyType propertyType, KzuPropertyNotificationReason reason) |
static VisitorResult | propertyChangedVisitor (Node &node, AbstractPropertyType propertyType, KzuPropertyNotificationReason reason) |
Friends | |
struct | KzuInputManager |
Additional Inherited Members | |
![]() | |
static const Metaclass * | getStaticMetaclass () |
Returns the metaclass of Object class. More... | |
static PropertyTypeEditorInfoSharedPtr | makeEditorInfo () |
Default implementation that returns empty editor info. More... | |
![]() | |
typedef vector < AppliedStyleEntry * > | AppliedStyleContainer |
Applied style container. More... | |
![]() | |
AppliedStyleContainer | m_appliedStyles |
Listing of applied styles applied to this object. More... | |
Base class for scene graph nodes in Kanzi.
To set node properties:
To introduce new message types and use them:
typedef kanzi::vector<Node::MessageSubscriptionToken> kanzi::Node::MessageSubscriptionTokenVector |
typedef function<VisitorResult(Node&)> kanzi::Node::Visitor |
typedef vector<InputManipulatorSharedPtr> kanzi::Node::InputManipulatorContainer |
Gets the input manipulator iterator.
typedef InputManipulatorContainer::iterator kanzi::Node::InputManipulatorIterator |
typedef InputManipulatorContainer::const_iterator kanzi::Node::InputManipulatorConstIterator |
typedef vector<BindingEntry> kanzi::Node::BindingContainer |
Gets the bindings iterator.
typedef BindingContainer::iterator kanzi::Node::BindingIterator |
typedef BindingContainer::const_iterator kanzi::Node::BindingConstIterator |
typedef vector<TriggerEntry> kanzi::Node::TriggerContainer |
Gets the triggers iterator.
typedef TriggerContainer::iterator kanzi::Node::TriggerIterator |
typedef TriggerContainer::const_iterator kanzi::Node::TriggerConstIterator |
Content stretch option.
|
virtual |
Destructor.
|
explicitprotected |
Constructor.
|
inline |
Gets the value of NameProperty.
|
inline |
Sets the value of NameProperty.
|
inline |
Gets the value of PathProperty.
|
inline |
Sets the value of PathProperty.
|
inline |
Gets the value of LocaleProperty.
|
inline |
Sets the value of LocaleProperty.
|
inline |
Gets the value of WidthProperty.
|
inline |
Sets the value of WidthProperty.
|
inline |
Gets the value of HeightProperty.
|
inline |
Sets the value of HeightProperty.
|
inline |
Gets the value of DepthProperty.
|
inline |
Sets the value of DepthProperty.
|
inline |
Gets the value of ActualWidthProperty.
|
inline |
Sets the value of ActualWidthProperty.
|
inline |
Gets the value of ActualHeightProperty.
|
inline |
Sets the value of ActualHeightProperty.
|
inline |
Gets the value of ActualDepthProperty.
|
inline |
Sets the value of ActualDepthProperty.
|
inline |
Gets the value of HorizontalAlignmentProperty.
|
inline |
Sets the value of HorizontalAlignmentProperty.
|
inline |
Gets the value of VerticalAlignmentProperty.
|
inline |
Sets the value of VerticalAlignmentProperty.
|
inline |
Gets the value of DepthAlignmentProperty.
|
inline |
Sets the value of DepthAlignmentProperty.
|
inline |
Gets the value of HorizontalMarginProperty.
|
inline |
Sets the value of HorizontalMarginProperty.
|
inline |
Gets the value of VerticalMarginProperty.
|
inline |
Sets the value of VerticalMarginProperty.
|
inline |
Gets the value of DepthMarginProperty.
|
inline |
Sets the value of DepthMarginProperty.
|
inline |
Gets the value of HitTestableProperty.
|
inline |
Sets the value of HitTestableProperty.
|
inline |
Gets the value of HitTestableContainerProperty.
|
inline |
Sets the value of HitTestableContainerProperty.
|
inline |
Gets the value of VisibleProperty.
|
inline |
Sets the value of VisibleProperty.
|
inline |
Gets the value of EnabledProperty.
|
inline |
Sets the value of EnabledProperty.
|
inline |
Gets the value of FocusableProperty.
|
inline |
Sets the value of FocusableProperty.
|
inline |
Gets the value of FocusedProperty.
|
inline |
Sets the value of FocusedProperty.
|
inline |
Gets the value of FontProperty.
|
inline |
Sets the value of FontProperty.
|
inline |
Gets the value of VisibleAmountInParentProperty.
|
inline |
Sets the value of VisibleAmountInParentProperty.
|
inline |
Gets the value of ClipChildrenProperty.
|
inline |
Sets the value of ClipChildrenProperty.
|
inline |
Gets the value of Projection2DTo3DScaleProperty.
|
inline |
Sets the value of Projection2DTo3DScaleProperty.
|
inline |
Gets the value of DataContextProperty.
|
inline |
Sets the value of DataContextProperty.
|
inline |
Gets the value of EnableClickProperty.
|
inline |
Sets the value of EnableClickProperty.
|
inline |
Gets the value of EnableMultiClickProperty.
|
inline |
Sets the value of EnableMultiClickProperty.
|
inline |
Gets the value of ContentStretchProperty.
|
inline |
Sets the value of ContentStretchProperty.
|
inline |
Gets the value of OpacityProperty.
|
inline |
Sets the value of OpacityProperty.
|
inline |
Gets the value of StyleProperty.
|
inline |
Sets the value of StyleProperty.
|
inline |
Gets the value of StateManagerProperty.
|
inline |
Sets the value of StateManagerProperty.
PropertyType<DataType>::DataType kanzi::Node::getProperty | ( | const PropertyType< DataType > & | propertyType | ) | const |
Returns the current value of a property.
The value returned by this function is the result of the property system evaluating the inputs that can affect the values of properties. The final value is calculated by determining the base value of the property and applying existing modifiers to it.
Base value is affected by the following inputs where the highest entry in the list determines the base value:
When the base value is determined the system applies modifiers to the value that can change the value or replace it completely. The following is the list of possible modifiers, where the order of evaluation is determined by the order the modifiers were added or applied.
If the property metadata specifies that the property is inheritable and no inputs for the property value can be determined at the current node the system iterates the scene graph to the root until inputs are found or the root is reached.
If no inputs to the property value can be established the system returns the value registered in the property type metadata.
propertyType | The property type identifying the property to retrieve. |
bool kanzi::Node::getProperty | ( | const PropertyType< DataType > & | propertyType, |
typename PropertyType< DataType >::DataType & | value | ||
) | const |
Evaluates the property value in the same way as the overload above but does not default to the value in property metadata if there are no inputs to the property value.
propertyType | The property type identifying the property to retrieve. |
value | The reference that receives the value the function evaluates. The reference is not modified if there are no inputs to the property value. |
DataType kanzi::Node::getAbstractProperty | ( | AbstractPropertyType | abstractPropertyType | ) | const |
bool kanzi::Node::getAbstractProperty | ( | AbstractPropertyType | abstractPropertyType, |
typename PropertyType< DataType >::DataType & | value | ||
) | const |
MessageSubscriptionToken kanzi::Node::addMessageHandler | ( | TMessageType & | messageType, |
TClass * | messageHandlerObject, | ||
TClassMethod | method | ||
) |
Adds a message handler where handler is a method to invoke on an object.
The handler is invoked when a message of messageType is signaled in the node the handler is added to.
MessageSubscriptionToken kanzi::Node::addMessageFilter | ( | TMessageType & | messageType, |
TClass * | messageHandlerObject, | ||
TClassMethod | method | ||
) |
Adds a message filter where filter is a method to invoke on an object.
The filter is invoked when a message of messageType bubbles through the node the handler is added to.
MessageSubscriptionToken kanzi::Node::addMessageHandler | ( | const TMessageType & | messageType, |
typename TMessageType::FunctionType | function | ||
) |
Adds a message handler where handler is function.
The handler is invoked when a message of messageType is signaled in the node the handler is added to.
MessageSubscriptionToken kanzi::Node::addMessageFilter | ( | const TMessageType & | messageType, |
typename TMessageType::FunctionType | function | ||
) |
Adds a message filter where filter is function.
The filter is invoked when a message of messageType bubbles through the node the handler is added to.
void kanzi::Node::removeMessageHandler | ( | MessageSubscriptionToken | token | ) |
Removes a message subscription.
void kanzi::Node::dispatchMessage | ( | const MessageType< TArgumentsType > & | messageType, |
typename MessageType< TArgumentsType >::ArgumentsType & | messageArguments | ||
) |
Dispatches a message with specified arguments.
void kanzi::Node::addResource | ( | const ResourceID & | resourceId, |
string_view | resourceUrl | ||
) |
Adds a resource manager resource to an object node. If resourceID already exists in object, removes the existing entry. If resourceURL is NULL, error is thrown. */.
void kanzi::Node::removeResource | ( | const ResourceID & | resourceId | ) |
Removes a resource with given ID from object node resource dictionary. Does not do anything if resourceID was not found. */.
bool kanzi::Node::containsResource | ( | const ResourceID & | resourceID | ) | const |
Returns if object node resource dictionary contains the resource with given ID. Resource can be any type: style, alias or resource manager resource. */.
optional<string> kanzi::Node::findResourceURL | ( | const ResourceID & | resourceId | ) | const |
ResourceSharedPtr kanzi::Node::acquireResource | ( | const ResourceID & | id | ) | const |
Acquires a resource from the node or the node's closest ancestor having the resource id in the resource dictionary.
If the resource id maps to a resource url, but the url doesn't map to any resource, throws an exception.
Id | Name of the resource. |
shared_ptr<T> kanzi::Node::acquireResource | ( | const ResourceID & | id | ) | const |
Acquires a resource from the node or the node's closest ancestor having the resource id in the resource dictionary, and casts the resource to given type.
If the cast fails, or the found resource url doesn't map to a resource, throws an exception.
Id | Name of the resource. |
ResourceSharedPtr kanzi::Node::tryAcquireResource | ( | const ResourceID & | id | ) | const |
Acquires a resource from the node or the node's closest ancestor having the resource id in the resource dictionary.
Id | Name of the resource. |
shared_ptr<T> kanzi::Node::tryAcquireResource | ( | const ResourceID & | id | ) | const |
Acquires a resource from the node or the node's closest ancestor having the resource and casts the resource to given type.
Id | Name of the resource. |
ResourceDictionarySharedPtr kanzi::Node::getResourceDictionary | ( | ) | const |
ResourceDictionarySharedPtr kanzi::Node::acquireResourceDictionary | ( | ) |
void kanzi::Node::setResourceDictionary | ( | ResourceDictionarySharedPtr | resourceDictionary | ) |
void kanzi::Node::addAnonymousResource | ( | ResourceSharedPtr | resource | ) |
Adds alias resource to an object node.
Removes alias resource from an object node. Adds anonymous resource (such as style) for object node resources.
void kanzi::Node::removeAnonymousResource | ( | const Resource & | resource | ) |
Removes anonymous resource from object node resources.
bool kanzi::Node::isNamed | ( | string_view | name | ) | const |
Node* kanzi::Node::getParent | ( | ) | const |
Returns the parent of the node.
void kanzi::Node::setParent | ( | Node * | parent | ) |
VisitorResult kanzi::Node::visit | ( | const Visitor & | visitor, |
VisitorOrder | order | ||
) |
VisitorResult kanzi::Node::visitDescendants | ( | const Visitor & | visitor, |
VisitorOrder | order | ||
) |
shared_ptr<Type> kanzi::Node::lookupNode | ( | string_view | pathOrKey | ) |
Returns a node of specified type by looking it up with specified path or alias.
Node* kanzi::Node::lookupNodeRaw | ( | string_view | relativePath | ) |
Get an object node by another node and a relative path.
User should use lookupNode.
relativePath | Path to use for relative lookup. |
ObjectSharedPtr kanzi::Node::lookupObject | ( | string_view | relativePath | ) |
Lookup for an object from a node.
Object found may be another node or a resource within a node.
relativePath | Relative path to use for lookup. |
|
inline |
ObjectSharedPtr kanzi::Node::lookupResource | ( | string_view | resourceName | ) |
Lookup for a resource from a node.
Goes through the resource references to locate desired object.
resourceName | Name of the resource to search. |
shared_ptr<TNodeType> kanzi::Node::findAbstractChild | ( | string_view | name | ) |
Find a child by name. Finds direct children as well as children connected indirectly for example Viewport->Scene.
|
pure virtual |
Implemented in kanzi::Node2D, and kanzi::Node3D.
|
pure virtual |
Implemented in kanzi::Node2D, and kanzi::Node3D.
|
pure virtual |
Implemented in kanzi::Node2D, and kanzi::Node3D.
|
pure virtual |
Implemented in kanzi::Node2D, and kanzi::Node3D.
void kanzi::Node::addInputManipulator | ( | InputManipulatorSharedPtr | inputManipulator | ) |
Transfers the ownership and attaches an input manipulator to an object node.
void kanzi::Node::removeInputManipulator | ( | InputManipulator & | inputManipulator | ) |
Removes the ownership and detaches an input manipulator from an object node.
InputManipulatorConstIterator kanzi::Node::beginInputManipulators | ( | ) | const |
InputManipulatorConstIterator kanzi::Node::endInputManipulators | ( | ) | const |
void kanzi::Node::addBinding | ( | BindingSharedPtr | binding | ) |
Transfers the ownership of a binding rule to an object node.
void kanzi::Node::addBindingWithOwner | ( | BindingSharedPtr | binding, |
const void * | owner | ||
) |
Transfers the ownership of a binding rule to an object node and sets the owner of binding rule.
void kanzi::Node::removeBinding | ( | Binding & | binding | ) |
Removes the ownership and detaches a binding rule from an object node.
void kanzi::Node::removeBindingsWithOwner | ( | const void * | owner | ) |
Removes all bindings with the specified owner.
BindingConstIterator kanzi::Node::beginBindings | ( | ) | const |
BindingConstIterator kanzi::Node::endBindings | ( | ) | const |
void kanzi::Node::addTrigger | ( | TriggerSharedPtr | trigger | ) |
Transfers the ownership of a trigger to an object node.
void kanzi::Node::addTriggerWithOwner | ( | TriggerSharedPtr | trigger, |
const void * | owner | ||
) |
Transfers the ownership of a trigger to an object node and sets the owner of the trigger.
void kanzi::Node::removeTrigger | ( | Trigger & | trigger | ) |
Removes the ownership of a trigger from an object node.
void kanzi::Node::removeTriggersWithOwner | ( | const void * | owner | ) |
Removes all bindings with the specified owner.
TriggerConstIterator kanzi::Node::beginTriggers | ( | ) | const |
TriggerConstIterator kanzi::Node::endTriggers | ( | ) | const |
void kanzi::Node::setRenderable | ( | bool | state | ) |
Sets whether the object node is renderable.
bool kanzi::Node::isRenderable | ( | ) | const |
Returns whether node is renderable.
bool kanzi::Node::isEffectivelyVisible | ( | ) | const |
Checks if the node and all of its ancestors are visible.
bool kanzi::Node::isEffectivelyEnabled | ( | ) | const |
Checks if the node and all of its ancestors are enabled.
|
inline |
Get current change flags.
|
inline |
Get current child change flags.
void kanzi::Node::setChangeFlag | ( | uint32_t | flag | ) |
Sets a change flag.
void kanzi::Node::clearChangeFlag | ( | uint32_t | flag | ) |
Clears a change flag.
bool kanzi::Node::isChangeFlagSet | ( | uint32_t | flag | ) | const |
Checks if a change flag is set.
void kanzi::Node::setChildChangeFlag | ( | uint32_t | flag | ) |
Sets a child change flag.
void kanzi::Node::clearChildChangeFlag | ( | uint32_t | flag | ) |
Clears a child change flag.
bool kanzi::Node::isChildChangeFlagSet | ( | uint32_t | flag | ) | const |
Checks if child change flags match.
bool kanzi::Node::isAnyChildChangeFlagSet | ( | uint32_t | flag | ) | const |
Checks if any child change flags (corresponding to given mask) are set.
bool kanzi::Node::isInvalidMeasure | ( | ) | const |
Check if the node needs measure.
void kanzi::Node::invalidateMeasure | ( | ) |
Invalidates measure for the node.
void kanzi::Node::validateMeasure | ( | ) |
Validates measure for the node.
bool kanzi::Node::isInvalidArrange | ( | ) | const |
Checks if the node needs arrange.
void kanzi::Node::invalidateArrange | ( | ) |
Invalidates arrange.
void kanzi::Node::validateArrange | ( | ) |
Validates arrange.
bool kanzi::Node::isInvalidRender | ( | ) | const |
Returns if node render flag is invalid.
void kanzi::Node::validateRender | ( | ) |
Validates render for object node.
void kanzi::Node::invalidateRender | ( | ) |
Invalidates render for object node.
bool kanzi::Node::isAttached | ( | ) | const |
Returns true if the node is attached to a screen or one of its descendants.
bool kanzi::Node::isAttaching | ( | ) | const |
Returns true if node is in the process of attaching, false otherwise.
bool kanzi::Node::isDetaching | ( | ) | const |
Returns true if the node currently detaching.
void kanzi::Node::attachRecursive | ( | ) |
Attaches an object node and its children recursively.
void kanzi::Node::detachRecursive | ( | ) |
Detaches an object node and its children recursively.
kzsError kanzi::Node::addTimeLineEntry | ( | struct KzuTimeLineEntry * | timeLineEntry | ) |
Adds timeline entry for object's animation player.
timeLineEntry | Animation entry launched. KZ_NULL just to create the animation player. |
TimeLineEntrySharedPtr kanzi::Node::addAnimationItem | ( | AnimationItemSharedPtr | animationItemSharedPtr, |
bool | reverse, | ||
int | repeatCount | ||
) |
Adds animation item for object's animation player.
out_timeLineEntry | Resulting timeline entry. KZ_NULL if not wanted to use. |
kzsError kanzi::Node::createAnimationPlayerAttachToParentPlayer | ( | struct KzuAnimationPlayer ** | out_animationPlayer | ) |
Create an animation player that references this object node, attach to an animation player in parent node.
kzsError kanzi::Node::createAnimationPlayerAttachToTaskScheduler | ( | struct KzuAnimationPlayer ** | out_animationPlayer | ) |
Create an animation player that references this object node, attach to the master animation player in task scheduler.
kzsError kanzi::Node::animationPlayerAttachToTaskScheduler | ( | struct KzuAnimationPlayer * | animationPlayer | ) | const |
Attach given animation player to the task scheduler acquired via the object node.
struct KzuAnimationPlayer* kanzi::Node::getAnimationPlayer | ( | ) | const |
Returns animation player from object node.
|
virtual |
Gets bounding volume from object node.
Returns KZ_NULL if the object is not renderable.
Reimplemented in kanzi::Model3D, and kanzi::TextBlock3D.
AppliedStyleEntry* kanzi::Node::applyStyle | ( | StyleSharedPtr | style | ) |
Applies a style to an object node.
Returns a style entry that is used to unapply the style.
void kanzi::Node::unapplyStyle | ( | AppliedStyleEntry * | appliedStyleEntry | ) |
Unapplies a style from an object node.
void kanzi::Node::applyStyles | ( | ) |
Apply all styles for an object node.
void kanzi::Node::unapplyStyles | ( | ) |
Unapplies and removes all applied styles.
void kanzi::Node::applyStylesRecursive | ( | ) |
Applies styles recursively.
void kanzi::Node::unapplyStylesRecursive | ( | ) |
Unapplies styles recursively.
void kanzi::Node::removeKZBData | ( | ) |
Destroys all object node data loaded from KZB, including properties, bindings, triggers, resources etc.
void kanzi::Node::addPropertyNotificationHandler | ( | AbstractPropertyType | propertyType, |
AbstractPropertyNotificationHandler * | handler | ||
) |
Add an abstract property notification handler.
propertyType | Property type to listen changes on. |
handler | Property handler to execute when property is changed. |
void kanzi::Node::removePropertyNotificationHandler | ( | const AbstractPropertyNotificationHandler & | handler | ) |
Remove an abstract property notification handler.
handler | Property handler to execute when property is removed. |
|
inline |
Gets number of current notification handlers.
void kanzi::Node::addResourceReference | ( | AbstractPropertyType | propertyType, |
AbstractResourceReference * | reference | ||
) |
This is a helper for automatic resource tracking in ResourceReference.
propertyType | Property type to listen changes on. |
reference | Reference to react on. |
void kanzi::Node::removeResourceReference | ( | const AbstractResourceReference & | reference | ) |
This is a helper for automatic resource tracking in ResourceReference.
reference | Reference to remove. |
void kanzi::Node::addNodeReference | ( | AbstractPropertyType | propertyType, |
AbstractNodeReference * | reference | ||
) |
void kanzi::Node::removeNodeReference | ( | const AbstractNodeReference & | reference | ) |
|
inlinevirtual |
Reattaches an object node after potential resource change.
Reimplemented in kanzi::Node2D.
|
inline |
|
inline |
|
protected |
|
protectedvirtual |
Called when an object node becomes attached.
Reimplemented in kanzi::ListBoxConceptImpl< Node3D, GridListBox3D, GridListBox3DTraits >, kanzi::ListBoxConceptImpl< Node3D, TrajectoryListBox3D, TrajectoryListBox3DTraits >, kanzi::ListBoxConceptImpl< Node2D, GridListBox2D, GridListBox2DTraits >, kanzi::Page, kanzi::ButtonConceptImpl< Node2D, Button2D >, kanzi::ButtonConceptImpl< Node3D, Button3D >, kanzi::ButtonConceptImpl< Node3D, ToggleButton3D >, kanzi::ButtonConceptImpl< Node2D, ToggleButton2D >, kanzi::TransitionView2D, kanzi::Screen, kanzi::GridListBox3D, kanzi::GridListBox2D, kanzi::ListBoxItemContainer2D, kanzi::Light, kanzi::TrajectoryListBox3D, kanzi::ListBoxItemContainer3D, kanzi::ScrollView2D, kanzi::Model3D, kanzi::TextBlock3D, kanzi::ToggleButtonGroupConceptImpl< Node2D, ToggleButtonGroup2D >, kanzi::ToggleButtonGroupConceptImpl< Node3D, ToggleButtonGroup3D >, kanzi::TextBlock2D, kanzi::Viewport3D, and kanzi::NinePatchImage2D.
|
protectedvirtual |
Called when an object node becomes detached.
Reimplemented in kanzi::Node2D, kanzi::ListBoxConceptImpl< Node3D, GridListBox3D, GridListBox3DTraits >, kanzi::ListBoxConceptImpl< Node3D, TrajectoryListBox3D, TrajectoryListBox3DTraits >, kanzi::ListBoxConceptImpl< Node2D, GridListBox2D, GridListBox2DTraits >, kanzi::Page, kanzi::ButtonConceptImpl< Node2D, Button2D >, kanzi::ButtonConceptImpl< Node3D, Button3D >, kanzi::ButtonConceptImpl< Node3D, ToggleButton3D >, kanzi::ButtonConceptImpl< Node2D, ToggleButton2D >, kanzi::TransitionView2D, kanzi::Screen, kanzi::ListBoxItemContainer2D, kanzi::ListBoxItemContainer3D, kanzi::ScrollView2D, kanzi::Model3D, kanzi::TextBlock3D, kanzi::TextBlock2D, kanzi::Viewport3D, kanzi::NinePatchImage2D, and kanzi::ProgressiveRenderingViewport2D.
|
protectedvirtual |
Method executed on node property change.
propertyType | Property that was changed in node. |
reason | Change reason. |
Reimplemented in kanzi::ListBoxConceptImpl< Node3D, GridListBox3D, GridListBox3DTraits >, kanzi::ListBoxConceptImpl< Node3D, TrajectoryListBox3D, TrajectoryListBox3DTraits >, kanzi::ListBoxConceptImpl< Node2D, GridListBox2D, GridListBox2DTraits >, kanzi::GridLayoutConceptImpl< Node2D, GridLayout2D >, kanzi::GridLayoutConceptImpl< Node3D, GridLayout3D >, kanzi::Node3D, kanzi::Page, kanzi::ButtonConceptImpl< Node2D, Button2D >, kanzi::ButtonConceptImpl< Node3D, Button3D >, kanzi::ButtonConceptImpl< Node3D, ToggleButton3D >, kanzi::ButtonConceptImpl< Node2D, ToggleButton2D >, kanzi::TransitionView2D, kanzi::Viewport2D, kanzi::Screen, kanzi::ScrollView3D, kanzi::TextBlock2D, and kanzi::Viewport3D.
|
protectedpure virtual |
Implemented in kanzi::Node2D, kanzi::Node3D, kanzi::Viewport2D, and kanzi::Viewport3D.
|
protectedpure virtual |
Implemented in kanzi::Node2D, kanzi::Node3D, kanzi::Viewport2D, and kanzi::Viewport3D.
|
staticprotected |
|
staticprotected |
|
staticprotected |
|
staticprotected |
|
staticprotected |
|
staticprotected |
|
staticprotected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
Attaches the object node.
|
protected |
Detaches the object node.
|
friend |
|
static |
|
static |
|
static |
|
static |
CreatedFromKZB property.
The default value is false.
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
HorizontalAlignment property.
The default value is Node::HorizontalAlignmentCenter.
|
static |
VerticalAlignment property.
The default value is Node::VerticalAlignmentCenter.
|
static |
DepthAlignment property.
The default value is Node::DepthAlignmentCenter.
|
static |
HorizontalMargin property.
The default value is Vector2(0.0f, 0.0f).
|
static |
VerticalMargin property.
The default value is Vector2(0.0f, 0.0f).
|
static |
DepthMargin property.
The default value is Vector2(0.0f, 0.0f).
|
static |
|
static |
HitTestableContainer property.
The default value is false.
|
static |
|
static |
|
static |
|
static |
|
static |
Font property.
Defines the resource ID of the font resource. The default value is ResourceID("DefaultFont").
|
static |
VisibleAmountInParent property.
The default value is 1.0f.
|
static |
|
static |
Projection2DTo3DScale property.
The default value is 0.02f.
|
static |
|
static |
|
static |
EnableMultiClick property.
The default value is false.
|
static |
ContentStretch property.
The default value is Node::ContentStretchUniform.
|
static |
|
static |
Style property.
The default value is ResourceID().
|
static |
StateManager property.
The default value is ResourceID().
|
static |
SceneGraphAddNodeChangeChildFlags property.
The default value is KZU_PROPERTY_TYPE_CHANGE_FLAG_FINAL_TRANSFORMATION | KZU_PROPERTY_TYPE_CHANGE_FLAG_MEASURE.
|
static |
SceneGraphAddNodeChangeParentFlags property.
The default value is KZU_PROPERTY_TYPE_CHANGE_FLAG_MEASURE.
|
static |
SceneGraphRemoveNodeChangeChildFlags property.
The default value is 0.
|
static |
SceneGraphRemoveNodeChangeParentFlags property.
The default value is KZU_PROPERTY_TYPE_CHANGE_FLAG_MEASURE.
|
static |
PrefabTemplateSource property.
The default value is 0.