kanzi::Node Class Referenceabstract

Base class for scene graph nodes in Kanzi. More...

#include <kanzi/core.ui/node/node.hpp>

Inheritance diagram for kanzi::Node:
kanzi::Object kanzi::MetaObject kanzi::PropertyObject kanzi::Node2D kanzi::Node3D kanzi::ButtonConceptImpl< Node2D, Button2D > kanzi::ButtonConceptImpl< Node2D, ToggleButton2D > kanzi::DockLayoutConceptImpl< Node2D, DockLayout2D > kanzi::FlowLayoutConceptImpl< Node2D, FlowLayout2D > kanzi::GridLayoutConceptImpl< Node2D, GridLayout2D > kanzi::EmptyNode2D kanzi::Image2D kanzi::NinePatchImage2D kanzi::Page kanzi::Portal kanzi::Screen kanzi::TrajectoryLayout2D kanzi::Viewport2D kanzi::ListBoxConceptImpl< Node2D, GridListBox2D, GridListBox2DTraits > kanzi::ListBoxItemContainerImpl< Node2D, ListBoxItemContainer2D > kanzi::PrefabViewConceptImpl< Node2D, PrefabView2D > kanzi::ScrollViewConceptImpl< Node2D, ScrollView2D > kanzi::StackLayoutConceptImpl< Node2D, StackLayout2D > kanzi::TextBlockConceptImpl< Node2D, TextBlock2D > kanzi::ToggleButtonGroupConceptImpl< Node2D, ToggleButtonGroup2D > kanzi::ButtonConceptImpl< Node3D, Button3D > kanzi::ButtonConceptImpl< Node3D, ToggleButton3D > kanzi::DockLayoutConceptImpl< Node3D, DockLayout3D > kanzi::FlowLayoutConceptImpl< Node3D, FlowLayout3D > kanzi::GridLayoutConceptImpl< Node3D, GridLayout3D > kanzi::Camera kanzi::EmptyNode3D kanzi::Instantiator3D kanzi::LevelOfDetail3D kanzi::Light kanzi::Model3D kanzi::Scene kanzi::TrajectoryLayout3D kanzi::Viewport3D kanzi::ListBoxConceptImpl< Node3D, GridListBox3D, GridListBox3DTraits > kanzi::ListBoxConceptImpl< Node3D, TrajectoryListBox3D, TrajectoryListBox3DTraits > kanzi::ListBoxItemContainerImpl< Node3D, ListBoxItemContainer3D > kanzi::PrefabViewConceptImpl< Node3D, PrefabView3D > kanzi::ScrollViewConceptImpl< Node3D, ScrollView3D > kanzi::StackLayoutConceptImpl< Node3D, StackLayout3D > kanzi::TextBlockConceptImpl< Node3D, TextBlock3D > kanzi::ToggleButtonGroupConceptImpl< Node3D, ToggleButtonGroup3D >

Classes

struct  BindingEntry
 binding entry. More...
 
class  MessageSubscriptionToken
 Message subscription token for nodes. More...
 
struct  NodeComponentEntry
 Object node component entry. More...
 

Public Types

enum  HorizontalAlignment { HorizontalAlignmentLeft, HorizontalAlignmentRight, HorizontalAlignmentCenter, HorizontalAlignmentStretch }
 Horizontal alignment options. More...
 
enum  VerticalAlignment { VerticalAlignmentBottom, VerticalAlignmentTop, VerticalAlignmentCenter, VerticalAlignmentStretch }
 Vertical alignment options. More...
 
enum  DepthAlignment { DepthAlignmentBack, DepthAlignmentFront, DepthAlignmentCenter, DepthAlignmentStretch }
 Depth alignment options. More...
 
enum  ContentStretch {
  ContentStretchNone, ContentStretchFill, ContentStretchUniform, ContentStretchUniformToFill,
  ContentStretchRepeat
}
 Content stretch option. More...
 
enum  VisitorOrder { VisitorPreOrder, VisitorPostOrder }
 
enum  VisitorResult { VisitorAbort, VisitorContinue, VisitorContinueSibling }
 
typedef kanzi::vector< Node::MessageSubscriptionTokenMessageSubscriptionTokenVector
 
typedef function< VisitorResult(Node &)> Visitor
 
typedef vector< InputManipulatorSharedPtrInputManipulatorContainer
 Gets the input manipulator iterator. More...
 
typedef InputManipulatorContainer::iterator InputManipulatorIterator
 
typedef InputManipulatorContainer::const_iterator InputManipulatorConstIterator
 
typedef vector< BindingEntryBindingContainer
 Gets the bindings iterator. More...
 
typedef BindingContainer::iterator BindingIterator
 
typedef BindingContainer::const_iterator BindingConstIterator
 
typedef vector< NodeComponentEntryNodeComponentContainer
 Gets the node component iterator. More...
 
typedef NodeComponentContainer::iterator NodeComponentIterator
 
typedef NodeComponentContainer::const_iterator NodeComponentConstIterator
 
- Public Types inherited from kanzi::PropertyObject
typedef intrusive_ptr< AbstractPropertyTypeDescriptor::PropertyStoragePropertyStoragePtr
 
typedef vector< PropertyStoragePtrPropertyStorageContainer
 
typedef PropertyStorageContainer::iterator PropertyStorageIterator
 
typedef PropertyStorageContainer::const_iterator PropertyStorageConstIterator
 
typedef PropertyStorageContainer::reverse_iterator PropertyStorageReverseIterator
 

Public Member Functions

virtual ~Node ()
 Destructor. More...
 
template<typename DataType >
PropertyType< DataType >::Traits::ReturnType getProperty (const PropertyType< DataType > &propertyType) const
 Returns the current value of a property. More...
 
AbstractPropertyTypeDescriptor::ValueSourcegetNodeFinalValueSource (AbstractPropertyTypeDescriptor &descriptor) const
 
template<typename DataType >
optional< typename PropertyType< DataType >::Traits::ReturnType > getOptionalProperty (const PropertyType< DataType > &propertyType) 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 >
optional< typename PropertyType< DataType >::DataType > getOptionalAbstractProperty (AbstractPropertyType abstractPropertyType) 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...
 
template<typename TMessageType >
MessageSubscriptionToken addMessageHandler (const TMessageType &messageType, typename TMessageType::FunctionType function, Node *messageSourceFilter)
 Adds a message handler where handler is function and accepted source is explicitly defined. 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
 Tries to find Resource URL for Resource ID from this node. More...
 
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...
 
ResourceManager::AcquireTaskSharedPtr acquireResourceAsync (const ResourceID &key, ResourceManager::AsyncAcquireFinishedCallback func) const
 Posts an asynchronous task to acquire a resource. 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
 Gets the resource dictionary of the node, if the node has one. More...
 
ResourceDictionarySharedPtr acquireResourceDictionary ()
 Gets the resource dictionary of the node. More...
 
void notifyResourceDictionaryModified ()
 Forces the re-evaluation of resource IDs in a node tree. More...
 
void setResourceDictionary (ResourceDictionarySharedPtr resourceDictionary)
 Replaces the resource dictionary of the node. More...
 
void addResourceDictionary (ResourceDictionarySharedPtr resourceDictionary)
 Add a nested resource dictionary to the resource dictionary of the node. More...
 
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
 
NodegetParent () 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...
 
NodelookupNodeRaw (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...
 
tuple< NodeSharedPtr, AbstractPropertyTypelookupObjectForStateManager (string_view relativePath)
 Lookup for an node and possible object from within the node for state manager. More...
 
template<typename Type >
shared_ptr< Type > lookupObject (string_view path)
 Lookup for an object 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, shared_ptr< 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 (shared_ptr< void > owner)
 Removes all bindings with the specified owner. More...
 
BindingConstIterator beginBindings () const
 
BindingConstIterator endBindings () const
 
void addNodeComponent (NodeComponentSharedPtr nodeComponent)
 Transfers the ownership of a node component to an object node. More...
 
void addNodeComponentWithOwner (NodeComponentSharedPtr nodeComponent, const void *owner)
 Transfers the ownership of a node component to an object node and sets the owner of the node component. More...
 
void removeNodeComponent (NodeComponent &nodeComponent)
 Removes the ownership of a node component from an object node. More...
 
void removeNodeComponentWithOwner (const void *owner)
 Removes all bindings with the specified owner. More...
 
NodeComponentConstIterator beginNodeComponents () const
 
NodeComponentConstIterator endNodeComponents () const
 
template<typename Type >
shared_ptr< Type > lookupNodeComponent (string_view name)
 Returns a node component of specified type by looking it up with specified name. More...
 
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...
 
bool isAnyChangeFlagSet (uint32_t flag) const
 Checks if any of given flags 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 node. More...
 
void invalidateRender ()
 Invalidates render for node. More...
 
bool isInvalidFinalTransform () const
 Tells if final transform flag is invalid for node. More...
 
void invalidateFinalTransform ()
 Invalidates final transform for node. More...
 
bool isInvalidDraw ()
 Tells if node draw flag is invalid. More...
 
void invalidateDraw ()
 Invalidates draw flag for the node. More...
 
void validateDraw ()
 Validates draw flags for the node. More...
 
void validateDrawForChildrenRecursive ()
 Recursively validates draw for the children from this 2D node onwards. More...
 
bool isInitialized () const
 Returns true if initialize() has been called, false otherwise. 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...
 
virtual const KzuBoundingVolumegetBoundingVolume () const
 Gets bounding volume from object node. More...
 
AppliedStyleEntrySharedPtr applyStyle (StyleSharedPtr style)
 Applies a style to an object node. More...
 
AppliedStyleEntrySharedPtr applyManualStyle (StyleSharedPtr style)
 Applies a style to an object node. More...
 
void unapplyStyle (AppliedStyleEntrySharedPtr 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, node comopnents, resources etc. 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)
 
void setTemplateRoot (NodeSharedPtr templateRoot)
 Sets the template root of this node. More...
 
NodeSharedPtr getTemplateRoot () const
 Gets the template root of this node. More...
 
bool trySetActiveFocus ()
 The method tries to move the active focus on this node. More...
 
- Public Member Functions inherited from kanzi::Object
 Object (Domain *domain)
 
virtual ~Object ()
 
DomaingetDomain () const
 Returns the domain the object belongs to. More...
 
KzuTaskSchedulergetTaskScheduler () const
 Returns the task scheduler of the object. More...
 
KzuMessageDispatchergetMessageDispatcher () const
 Returns the message dispatcher of the object. More...
 
ResourceManagergetResourceManager () const
 Returns the resource manager of the object. More...
 
virtual const MetaclassgetDynamicMetaclass () const KZ_OVERRIDE
 Returns the metaclass of the dynamic type of the object. More...
 
AppliedStyleEntrySharedPtr applyObjectStyle (kanzi::StyleSharedPtr style)
 Applies a style to an object. More...
 
void unapplyObjectStyle (AppliedStyleEntrySharedPtr appliedStyleEntry)
 
void applyObjectStyles ()
 Apply all styles for an object node. More...
 
void unapplyObjectStyles ()
 Unapplies and removes all applied styles. More...
 
- Public Member Functions inherited from kanzi::MetaObject
virtual ~MetaObject ()
 
bool isTypeOf (const Metaclass *objectType) const
 Determines if the type of this object is the given type or derived from it. More...
 
- Public Member Functions inherited from kanzi::PropertyObject
 PropertyObject ()
 
virtual ~PropertyObject ()
 
template<typename DataType >
void setProperty (const PropertyType< DataType > &propertyType, typename PropertyType< DataType >::Traits::ParameterType value)
 Sets the local value of a property. More...
 
void removeKzbProperties ()
 
template<typename DataType >
PropertyType< DataType >::Traits::ReturnType getProperty (const PropertyType< DataType > &propertyType) const
 Returns the current value of a property. More...
 
template<typename DataType >
optional< typename PropertyType< DataType >::Traits::ReturnType > getOptionalProperty (const PropertyType< DataType > &propertyType) 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 >
PropertyType< DataType >::Traits::ReturnType getPropertyBase (const PropertyType< DataType > &propertyType) const
 Returns the current value of a property disregarding modifiers. More...
 
template<typename DataType >
void setAbstractProperty (AbstractPropertyType abstractPropertyType, typename PropertyType< DataType >::Traits::ParameterType value)
 
template<typename DataType >
PropertyType< DataType >::Traits::ReturnType getAbstractProperty (AbstractPropertyType abstractPropertyType) const
 
template<typename DataType >
PropertyType< DataType >::Traits::ReturnType getAbstractPropertyBase (AbstractPropertyType abstractPropertyType) const
 
template<typename DataType >
optional< typename PropertyType< DataType >::Traits::ReturnType > getOptionalAbstractProperty (AbstractPropertyType abstractPropertyType) const
 
void setPropertyFlag (AbstractPropertyType propertyType, uint32_t flag)
 
bool isPropertyFlagSet (AbstractPropertyType propertyType, uint32_t flag) const
 
void clearPropertyFlag (AbstractPropertyType propertyType, uint32_t flag)
 
bool hasValue (AbstractPropertyType propertyType) const
 Evaluates whether there are any inputs into the property value. More...
 
bool hasBaseValue (AbstractPropertyType propertyType) const
 Evaluates whether there are any inputs into the property value, disregarding modifiers. More...
 
bool hasLocalValue (AbstractPropertyType propertyType) const
 Evaluates whether there is a local value set for the property. More...
 
bool hasNonClassValue (AbstractPropertyType propertyType) const
 Evaluates whether there is a value of any precedence higher than class default value set for the property. More...
 
void removeLocalValue (AbstractPropertyType propertyType)
 Removes the local value associated with the property. More...
 
void copyLocalValue (const PropertyObject &other, AbstractPropertyType propertyType)
 Copies local value of single property from another object. More...
 
void copyLocalValues (const PropertyObject &other)
 Copies all local values from another object. More...
 
template<typename DataType >
void addPropertyValueSource (const PropertyType< DataType > &propertyType, typename PropertyType< DataType >::Descriptor::TypedValueSource *valueSource, PropertyValuePrecedence precedence, void *owner)
 
template<typename DataType >
void removePropertyValueSource (const PropertyType< DataType > &propertyType, typename PropertyType< DataType >::Descriptor::TypedValueSource *valueSource, void *owner)
 
template<typename DataType >
void addPropertyModifier (const PropertyType< DataType > &propertyType, typename PropertyType< DataType >::Descriptor::ModifierCallback callback, void *owner)
 
template<typename DataType >
void removePropertyModifier (const PropertyType< DataType > &propertyType, typename PropertyType< DataType >::Descriptor::ModifierCallback callback, void *owner)
 
void validatePropertyModifiers (AbstractPropertyType propertyType)
 
template<typename DataType >
void addPropertyNotificationHandler (const PropertyType< DataType > &propertyType, typename PropertyType< DataType >::Descriptor::NotificationCallback callback, void *owner)
 
template<typename DataType >
void removePropertyNotificationHandler (const PropertyType< DataType > &propertyType, typename PropertyType< DataType >::Descriptor::NotificationCallback callback, void *owner)
 
template<typename DataType >
size_t getPropertyNotificationHandlerCount (const PropertyType< DataType > &propertyType)
 Gets number of current notification handlers for given property type. More...
 

Static Public Member Functions

static bool isValidLayoutValue (float value)
 Indicates whether a value is valid layout value. More...
 
static float unboundedLayoutValue ()
 Returns an unbounded layout value. More...
 
static bool isUnboundedLayoutValue (float layoutValue)
 Indicates whether a value is an unbound layout value. More...
 
static float replaceUnboundedLayoutValue (float layoutValue, float resetValue)
 Replaces layout value with the specified value if it is unbounded and returns it. More...
 
static float replaceUnboundedLayoutValueWithZero (float layoutValue)
 Replaces layout value with zero if it is unbounded layout value and returns it. More...
 
- Static Public Member Functions inherited from kanzi::Object
static const MetaclassgetStaticMetaclass ()
 Returns the metaclass of Object class. More...
 
static PropertyTypeEditorInfoSharedPtr makeEditorInfo ()
 Default implementation that returns empty editor info. More...
 
- Static Public Member Functions inherited from kanzi::MetaObject
static const MetaclassgetStaticMetaclass ()
 Returns the metaclass of Object class. More...
 
static PropertyTypeEditorInfoSharedPtr makeEditorInfo ()
 Default implementation that returns empty editor info. 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, PropertyNotificationReason 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 updatePropertiesForConnectedNode ()
 Invokes property notifications for inherited properties during scene graph tree connections. More...
 
void updatePropertiesForDisconnectedNode (Node *oldParent)
 Invokes property notifications for inherited properties during scene graph tree disconnections. More...
 
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...
 
virtual void notifyPropertyHandlers (PropertyStoragePtr &propertyStorage, PropertyNotificationReason reason) KZ_OVERRIDE
 
- Protected Member Functions inherited from kanzi::Object
void initialize ()
 
void onCopy (const Object &other)
 
- Protected Member Functions inherited from kanzi::MetaObject
 MetaObject ()
 
void initialize ()
 
- Protected Member Functions inherited from kanzi::PropertyObject
void addPropertyValueSource (AbstractPropertyTypeDescriptor &descriptor, AbstractPropertyTypeDescriptor::ValueSource *valueSource, PropertyValuePrecedence precedence, void *owner)
 
void removePropertyValueSource (AbstractPropertyTypeDescriptor &descriptor, AbstractPropertyTypeDescriptor::ValueSource *valueSource, void *owner)
 
AbstractPropertyTypeDescriptor::ValueSourceEntrygetTopValueSourceEntry (AbstractPropertyTypeDescriptor::PropertyStorage &propertyStorage) const
 
AbstractPropertyTypeDescriptor::ValueSourceEntrygetTopValueSourceEntry (AbstractPropertyTypeDescriptor &descriptor) const
 
AbstractPropertyTypeDescriptor::ValueSourcegetTopValueSource (AbstractPropertyTypeDescriptor &descriptor) const
 
AbstractPropertyTypeDescriptor::ValueSourcegetFinalValueSource (AbstractPropertyTypeDescriptor &descriptor) const
 
AbstractPropertyTypeDescriptor::ValueSourcegetNonClassValueSource (AbstractPropertyTypeDescriptor &descriptor) const
 
AbstractPropertyTypeDescriptor::ValueSourcegetClassValueSource (AbstractPropertyTypeDescriptor &descriptor) const
 
AbstractPropertyTypeDescriptor::ValueSourceEntryfindLocalValueSourceEntry (AbstractPropertyTypeDescriptor::PropertyStorage &propertyStorage)
 
AbstractPropertyTypeDescriptor::ValueSourceEntryconstructLocalValueSourceEntry (AbstractPropertyTypeDescriptor &descriptor, AbstractPropertyTypeDescriptor::PropertyStorage &propertyStorage)
 
AbstractPropertyTypeDescriptor::ValueSourceEntryacquireLocalValueSourceEntry (AbstractPropertyTypeDescriptor &descriptor)
 
AbstractPropertyTypeDescriptor::PropertyStoragefindPropertyStorage (AbstractPropertyTypeDescriptor &descriptor) const
 
PropertyStoragePtr findPropertyStoragePtr (AbstractPropertyTypeDescriptor &descriptor) const
 Gets property storage intrusive pointer that can be used to hold a reference until end of operation. More...
 
PropertyStoragePtr constructPropertyStorage (AbstractPropertyTypeDescriptor &descriptor)
 
PropertyStoragePtr acquirePropertyStorage (AbstractPropertyTypeDescriptor &descriptor)
 
AbstractPropertyTypeDescriptor::ModifierStorageacquireModifierStorage (AbstractPropertyTypeDescriptor &descriptor)
 
AbstractPropertyTypeDescriptor::ModifierStoragefindModifierStorage (AbstractPropertyTypeDescriptor &descriptor)
 
AbstractPropertyTypeDescriptor::NotificationStorageacquireNotificationStorage (AbstractPropertyTypeDescriptor &descriptor)
 
AbstractPropertyTypeDescriptor::NotificationStoragefindNotificationStorage (AbstractPropertyTypeDescriptor &descriptor)
 
AbstractPropertyTypeDescriptorfindPropertyTypeDescriptorByUnqualifiedNameAndDataType (string_view unqualifiedName, PropertyDataType dataType)
 
void validatePropertyModifiersAndNotifyHandlers (PropertyStoragePtr &propertyStorage)
 
void copyLocalValue (const AbstractPropertyTypeDescriptor::PropertyStorage &propertyStorage)
 Copy local value from property storage. More...
 
PropertyStorageContainer::iterator beginPropertyStorage ()
 
PropertyStorageContainer::iterator endPropertyStorage ()
 
void onCopy (const PropertyObject &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 VisitorResult validateDrawVisitor (Node &node)
 Visitor for validating draw. More...
 
static bool processPropertyChanged (Node &node, AbstractPropertyType propertyType, const PropertyStoragePtr &nodePropertyStorage, AbstractPropertyTypeDescriptor::PropertyStorage *changedPropertyStorage, PropertyNotificationReason reason)
 Processes notification handlers for node and property storage. More...
 
static VisitorResult propertyChangedVisitor (Node &node, AbstractPropertyType propertyType, AbstractPropertyTypeDescriptor::PropertyStorage *propertyStorage, PropertyNotificationReason reason)
 

Friends

class InputManager
 

Properties

static PropertyType< string > NameProperty
 Name property. More...
 
static PropertyType< string > PathProperty
 Path property. More...
 
static PropertyType< string > LocaleProperty
 Locale property. More...
 
static PropertyType< bool > CreatedFromKZBProperty
 CreatedFromKZB property. More...
 
static PropertyType< bool > HitTestableProperty
 HitTestable property. More...
 
static PropertyType< bool > HitTestableContainerProperty
 HitTestableContainer property. More...
 
static PropertyType< bool > VisibleProperty
 Visible property. More...
 
static PropertyType< bool > EnabledProperty
 Enabled property. More...
 
static PropertyType< bool > FocusableProperty
 The property specifies whether a node can get active focus and can participate in the focus chain navigation. More...
 
static PropertyType< bool > FocusedProperty
 Specifies that the node is the active focus node, which receives keyboard messages. More...
 
static PropertyType< bool > LogicalFocusProperty
 Specifies that the node has logical focus state. More...
 
static PropertyType< ResourceSharedPtrFontProperty
 Font property. More...
 
static PropertyType< float > VisibleAmountInParentProperty
 VisibleAmountInParent property. More...
 
static PropertyType< float > Projection2DTo3DScaleProperty
 Projection2DTo3DScale property. More...
 
static PropertyType< bool > EnableClickProperty
 EnableClick property. More...
 
static PropertyType< bool > EnableMultiClickProperty
 EnableMultiClick property. More...
 
static PropertyType< ResourceSharedPtrStyleProperty
 Style property. More...
 
static PropertyType< ResourceSharedPtrStateManagerProperty
 StateManager property. More...
 
static PropertyType< void * > PrefabTemplateSourceProperty
 PrefabTemplateSource property. More...
 
static PropertyType< float > WidthProperty
 Width property. More...
 
static PropertyType< float > HeightProperty
 Height property. More...
 
static PropertyType< float > DepthProperty
 Depth property. More...
 
static PropertyType< float > ActualWidthProperty
 ActualWidth property. More...
 
static PropertyType< float > ActualHeightProperty
 ActualHeight property. More...
 
static PropertyType< float > ActualDepthProperty
 ActualDepth property. More...
 
static PropertyType< Node::HorizontalAlignmentHorizontalAlignmentProperty
 HorizontalAlignment property. More...
 
static PropertyType< Node::VerticalAlignmentVerticalAlignmentProperty
 VerticalAlignment property. More...
 
static PropertyType< Node::DepthAlignmentDepthAlignmentProperty
 DepthAlignment property. More...
 
static PropertyType< Vector2HorizontalMarginProperty
 Sets the horizontal space between this node and other nodes that are adjacent to this node in a layout. More...
 
static PropertyType< Vector2VerticalMarginProperty
 Sets the vertical space between this node and other nodes that are adjacent to this node in a layout. More...
 
static PropertyType< Vector2DepthMarginProperty
 Sets the space in the depth direction between this node and other nodes that are adjacent to this node in a layout. More...
 
static PropertyType< Node::ContentStretchContentStretchProperty
 ContentStretch property. More...
 
static PropertyType< float > OpacityProperty
 Opacity property. More...
 
static PropertyType< bool > ClipChildrenProperty
 ClipChildren property. More...
 
static PropertyType< int > SceneGraphAddNodeChangeChildFlagsProperty
 SceneGraphAddNodeChangeChildFlags property. More...
 
static PropertyType< int > SceneGraphAddNodeChangeParentFlagsProperty
 SceneGraphAddNodeChangeParentFlags property. More...
 
static PropertyType< int > SceneGraphRemoveNodeChangeChildFlagsProperty
 SceneGraphRemoveNodeChangeChildFlags property. More...
 
static PropertyType< int > SceneGraphRemoveNodeChangeParentFlagsProperty
 SceneGraphRemoveNodeChangeParentFlags property. More...
 
string getName () const
 Gets the value of NameProperty. More...
 
void setName (string_view value)
 Sets the value of NameProperty. More...
 
string getPath () const
 Gets the value of PathProperty. More...
 
void setPath (string value)
 Sets the value of PathProperty. More...
 
string getLocale () const
 Gets the value of LocaleProperty. More...
 
void setLocale (string value)
 Sets the value of LocaleProperty. More...
 
bool isHitTestable () const
 Gets the value of HitTestableProperty. More...
 
void setHitTestable (bool value)
 Sets the value of HitTestableProperty. More...
 
bool isHitTestableContainer () const
 Gets the value of HitTestableContainerProperty. More...
 
void setHitTestableContainer (bool value)
 Sets the value of HitTestableContainerProperty. More...
 
bool isVisible () const
 Gets the value of VisibleProperty. More...
 
void setVisible (bool value)
 Sets the value of VisibleProperty. More...
 
bool isEnabled () const
 Gets the value of EnabledProperty. More...
 
void setEnabled (bool value)
 Sets the value of EnabledProperty. More...
 
bool isFocusable () const
 Gets the value of FocusableProperty. More...
 
void setFocusable (bool value)
 Sets the value of FocusableProperty. More...
 
bool isFocused () const
 Gets the value of FocusedProperty. More...
 
void setFocused (bool value)
 Sets the value of FocusedProperty. More...
 
bool hasLogicalFocus () const
 Returns the #LogicalFocusedProperty value. More...
 
void setLogicalFocus (bool value)
 Sets the value of LogicalFocusProperty. More...
 
FontSharedPtr getFont () const
 Gets the value of FontProperty. More...
 
void setFont (FontSharedPtr value)
 Sets the value of FontProperty. More...
 
float getVisibleAmountInParent () const
 Gets the value of VisibleAmountInParentProperty. More...
 
void setVisibleAmountInParent (float value)
 Sets the value of VisibleAmountInParentProperty. More...
 
float getProjection2DTo3DScale () const
 Gets the value of Projection2DTo3DScaleProperty. More...
 
void setProjection2DTo3DScale (float value)
 Sets the value of Projection2DTo3DScaleProperty. More...
 
bool isEnableClick () const
 Gets the value of EnableClickProperty. More...
 
void setEnableClick (bool value)
 Sets the value of EnableClickProperty. More...
 
bool isEnableMultiClick () const
 Gets the value of EnableMultiClickProperty. More...
 
void setEnableMultiClick (bool value)
 Sets the value of EnableMultiClickProperty. More...
 
ResourceSharedPtr getStyle () const
 Gets the value of StyleProperty. More...
 
void setStyle (ResourceSharedPtr value)
 Sets the value of StyleProperty. More...
 
ResourceSharedPtr getStateManager () const
 Gets the value of StateManagerProperty. More...
 
void setStateManager (ResourceSharedPtr value)
 Sets the value of StateManagerProperty. More...
 
float getWidth () const
 Gets the value of WidthProperty. More...
 
void setWidth (float value)
 Sets the value of WidthProperty. More...
 
float getHeight () const
 Gets the value of HeightProperty. More...
 
void setHeight (float value)
 Sets the value of HeightProperty. More...
 
float getDepth () const
 Gets the value of DepthProperty. More...
 
void setDepth (float value)
 Sets the value of DepthProperty. More...
 
float getActualWidth () const
 Gets the value of ActualWidthProperty. More...
 
void setActualWidth (float value)
 Sets the value of ActualWidthProperty. More...
 
float getActualHeight () const
 Gets the value of ActualHeightProperty. More...
 
void setActualHeight (float value)
 Sets the value of ActualHeightProperty. More...
 
float getActualDepth () const
 Gets the value of ActualDepthProperty. More...
 
void setActualDepth (float value)
 Sets the value of ActualDepthProperty. More...
 
Node::HorizontalAlignment getHorizontalAlignment () const
 Gets the value of HorizontalAlignmentProperty. More...
 
void setHorizontalAlignment (Node::HorizontalAlignment value)
 Sets the value of HorizontalAlignmentProperty. More...
 
Node::VerticalAlignment getVerticalAlignment () const
 Gets the value of VerticalAlignmentProperty. More...
 
void setVerticalAlignment (Node::VerticalAlignment value)
 Sets the value of VerticalAlignmentProperty. More...
 
Node::DepthAlignment getDepthAlignment () const
 Gets the value of DepthAlignmentProperty. More...
 
void setDepthAlignment (Node::DepthAlignment value)
 Sets the value of DepthAlignmentProperty. More...
 
Vector2 getHorizontalMargin () const
 Gets the value of HorizontalMarginProperty. More...
 
void setHorizontalMargin (Vector2 value)
 Sets the value of HorizontalMarginProperty. More...
 
Vector2 getVerticalMargin () const
 Gets the value of VerticalMarginProperty. More...
 
void setVerticalMargin (Vector2 value)
 Sets the value of VerticalMarginProperty. More...
 
Vector2 getDepthMargin () const
 Gets the value of DepthMarginProperty. More...
 
void setDepthMargin (Vector2 value)
 Sets the value of DepthMarginProperty. More...
 
Node::ContentStretch getContentStretch () const
 Gets the value of ContentStretchProperty. More...
 
void setContentStretch (Node::ContentStretch value)
 Sets the value of ContentStretchProperty. More...
 
float getOpacity () const
 Gets the value of OpacityProperty. More...
 
void setOpacity (float value)
 Sets the value of OpacityProperty. More...
 
bool isClipChildren () const
 Gets the value of ClipChildrenProperty. More...
 
void setClipChildren (bool value)
 Sets the value of ClipChildrenProperty. More...
 

Additional Inherited Members

- Protected Types inherited from kanzi::Object
typedef vector< AppliedStyleEntrySharedPtrAppliedStyleContainer
 Applied style container. More...
 
- Protected Attributes inherited from kanzi::Object
AppliedStyleContainer m_appliedStyles
 Listing of applied styles applied to this object. More...
 

Detailed Description

Base class for scene graph nodes in Kanzi.

Examples

To set node properties:

// Create node and set its properties
Node3DSharedPtr objectNode;
objectNode = EmptyNode3D::create(domain, "TestNode");
objectNode->setProperty(Node::NameProperty, "NewTestNodeName");
objectNode->setProperty(Node::WidthProperty, 25);
objectNode->setProperty(Node::HorizontalMarginProperty, Vector2(5, 7));
objectNode->setProperty(Node::VisibleProperty, false);
objectNode->setProperty(Node::FontProperty, localFont);
string name = objectNode->getProperty(Node::NameProperty);
float width = objectNode->getProperty(Node::WidthProperty);
Vector2 hMargin = objectNode->getProperty(Node::HorizontalMarginProperty);
bool visible = objectNode->getProperty(Node::VisibleProperty);
ResourceSharedPtr resource = objectNode->getProperty(Node::FontProperty);

To introduce new message types and use them:

template<typename ArgType>
class MyMessageArguments : public MessageArguments
{
public:
// Register message arguments class in the engine.
KZ_MESSAGE_ARGUMENTS_METACLASS_BEGIN(MyMessageArguments<ArgType>, MessageArguments, "Kanzi.TestObjectNode.MyMessageArguments<ArgType>")
static PropertyType<ArgType> ArgumentType;
};
class MyNode : public Node2D
{
public:
KZ_METACLASS_BEGIN(MyNode, Node2D, "Kanzi.TestObjectNode.MyNode")
// Register property types in the engine.
KZ_METACLASS_PROPERTY_TYPE(MyMessageArguments<int>::ArgumentType)
KZ_METACLASS_PROPERTY_TYPE(MyMessageArguments<bool>::ArgumentType)
KZ_METACLASS_PROPERTY_TYPE(MyMessageArguments<Vector2>::ArgumentType)
KZ_METACLASS_PROPERTY_TYPE(MyMessageArguments<Matrix3x3>::ArgumentType)
KZ_METACLASS_PROPERTY_TYPE(MyMessageArguments<Matrix4x4>::ArgumentType)
// Register message types in the engine.
KZ_METACLASS_MESSAGE_TYPE(MyVector2Message)
KZ_METACLASS_MESSAGE_TYPE(MyMatrix3x3Message)
KZ_METACLASS_MESSAGE_TYPE(MyMatrix4x4Message)
static shared_ptr<MyNode> create(Domain* domain, string_view name)
{
shared_ptr<MyNode> node = shared_ptr<MyNode>(new MyNode(domain, name));
node->initialize();
return node;
}
{
// Register handler for each message.
// Message handler gets called when this object sends a message of certain type.
MessageSubscriptionToken intToken = addMessageHandler(MyIntMessage, this, &MyNode::intMessageHandler);
// Message filter gets called when any object sends a message of certain type.
addMessageFilter(MyIntMessage, this, &MyNode::intMessageFilter);
MessageSubscriptionToken boolToken = addMessageHandler(MyBoolMessage, this, &MyNode::boolMessageHandler);
addMessageFilter(MyBoolMessage, this, &MyNode::boolMessageFilter);
MessageSubscriptionToken vector2Token = addMessageHandler(MyVector2Message, this, &MyNode::vector2MessageHandler);
addMessageFilter(MyVector2Message, this, &MyNode::vector2MessageFilter);
MessageSubscriptionToken matrix3x3Token = addMessageHandler(MyMatrix3x3Message, this, &MyNode::matrix3x3MessageHandler);
addMessageFilter(MyMatrix3x3Message, this, &MyNode::matrix3x3MessageFilter);
MessageSubscriptionToken matrix4x4Token = addMessageHandler(MyMatrix4x4Message, this, &MyNode::matrix4x4MessageHandler);
addMessageFilter(MyMatrix4x4Message, this, &MyNode::matrix4x4MessageFilter);
// Optional: send test messages.
MyMessageArguments<int> intMessage;
intMessage.setArgument(intMessage.ArgumentType, 123);
// Send the message. The message handler and filter are called immediately.
dispatchMessage(MyIntMessage, intMessage);
// Send the same message that is already handled.
KZ_TEST_THROW(dispatchMessage(MyIntMessage, intMessage), runtime_error);
MyMessageArguments<bool> boolMessage;
boolMessage.setArgument(boolMessage.ArgumentType, true);
dispatchMessage(MyBoolMessage, boolMessage);
MyMessageArguments<Vector2> vector2Message;
vector2Message.setArgument(vector2Message.ArgumentType, Vector2(123.0f, 321.0f));
dispatchMessage(MyVector2Message, vector2Message);
MyMessageArguments<Matrix3x3> matrix3x3Message;
matrix3x3Message.setArgument(matrix3x3Message.ArgumentType, Matrix3x3());
dispatchMessage(MyMatrix3x3Message, matrix3x3Message);
MyMessageArguments<Matrix4x4> matrix4x4Message;
matrix4x4Message.setArgument(matrix4x4Message.ArgumentType, Matrix4x4());
dispatchMessage(MyMatrix4x4Message, matrix4x4Message);
assertEquals(10u, m_callCounter);
// Remove the message handlers. If this is not done, the message handler is valid until the object is destroyed.
removeMessageHandler(vector2Token);
removeMessageHandler(matrix3x3Token);
removeMessageHandler(matrix4x4Token);
}
void intMessageHandler(MyMessageArguments<int>& args)
{
assertEquals(args.getArgument(args.ArgumentType), 123);
++m_callCounter;
// Messages are marked handled by default. This allows the filter to receive it.
args.setHandled(false);
}
void intMessageFilter(MyMessageArguments<int>& args)
{
assertEquals(args.getArgument(args.ArgumentType), 123);
++m_callCounter;
}
void boolMessageHandler(MyMessageArguments<bool>& args)
{
assertTrue(args.getArgument(args.ArgumentType));
++m_callCounter;
args.setHandled(false);
}
void boolMessageFilter(MyMessageArguments<bool>& args)
{
assertTrue(args.getArgument(args.ArgumentType));
++m_callCounter;
}
void vector2MessageHandler(MyMessageArguments<Vector2>& args)
{
Vector2 argument = args.getArgument(args.ArgumentType);
assertEquals(argument[0], 123.0f);
assertEquals(argument[1], 321.0f);
++m_callCounter;
args.setHandled(false);
}
void vector2MessageFilter(MyMessageArguments<Vector2>& args)
{
Vector2 argument = args.getArgument(args.ArgumentType);
assertEquals(argument[0], 123.0f);
assertEquals(argument[1], 321.0f);
++m_callCounter;
}
void matrix3x3MessageHandler(MyMessageArguments<Matrix3x3>& args)
{
Matrix3x3 identity = Matrix3x3::createIdentity();
Matrix3x3 argument = args.getArgument(args.ArgumentType);
for (int i = 0; i < 9; ++i)
{
assertEquals(argument[i], identity[i]);
}
++m_callCounter;
args.setHandled(false);
}
void matrix3x3MessageFilter(MyMessageArguments<Matrix3x3>& args)
{
Matrix3x3 identity = Matrix3x3::createIdentity();
Matrix3x3 argument = args.getArgument(args.ArgumentType);
for (int i = 0; i < 9; ++i)
{
assertEquals(argument[i], identity[i]);
}
++m_callCounter;
}
void matrix4x4MessageHandler(MyMessageArguments<Matrix4x4>& args)
{
Matrix4x4 identity = Matrix4x4::createIdentity();
Matrix4x4 argument = args.getArgument(args.ArgumentType);
for (int i = 0; i < 16; ++i)
{
assertEquals(argument[i], identity[i]);
}
++m_callCounter;
args.setHandled(false);
}
void matrix4x4MessageFilter(MyMessageArguments<Matrix4x4>& args)
{
Matrix4x4 identity = Matrix4x4::createIdentity();
Matrix4x4 argument = args.getArgument(args.ArgumentType);
for (int i = 0; i < 16; ++i)
{
assertEquals(argument[i], identity[i]);
}
++m_callCounter;
}
static MessageType<MyMessageArguments<int> > MyIntMessage;
static MessageType<MyMessageArguments<bool> > MyBoolMessage;
static MessageType<MyMessageArguments<Vector2> > MyVector2Message;
static MessageType<MyMessageArguments<Matrix3x3> > MyMatrix3x3Message;
static MessageType<MyMessageArguments<Matrix4x4> > MyMatrix4x4Message;
private:
explicit MyNode(Domain* domain, string_view name):
Node2D(domain, name),
m_callCounter(0)
{
}
unsigned int m_callCounter;
};
// Construct static message types.
MessageType<MyMessageArguments<int> > MyNode::MyIntMessage(kzMakeFixedString("IntMessage"), 0);
MessageType<MyMessageArguments<bool> > MyNode::MyBoolMessage(kzMakeFixedString("BoolMessage"), 0);
MessageType<MyMessageArguments<Vector2> > MyNode::MyVector2Message(kzMakeFixedString("Vector2Message"), 0);
MessageType<MyMessageArguments<Matrix3x3> > MyNode::MyMatrix3x3Message(kzMakeFixedString("Matrix3x3Message"), 0);
MessageType<MyMessageArguments<Matrix4x4> > MyNode::MyMatrix4x4Message(kzMakeFixedString("Matrix4x4Message"), 0);
// Construct static property types.
template<> PropertyType<int> MyMessageArguments<int>::ArgumentType(kzMakeFixedString("int argument"));
template<> PropertyType<bool> MyMessageArguments<bool>::ArgumentType(kzMakeFixedString("bool argument"));
template<> PropertyType<Vector2> MyMessageArguments<Vector2>::ArgumentType(kzMakeFixedString("Vector2 argument"));
template<> PropertyType<Matrix3x3> MyMessageArguments<Matrix3x3>::ArgumentType(kzMakeFixedString("Matrix3x3 argument"));
template<> PropertyType<Matrix4x4> MyMessageArguments<Matrix4x4>::ArgumentType(kzMakeFixedString("Matrix4x4 argument"));

Member Typedef Documentation

Gets the input manipulator iterator.

typedef InputManipulatorContainer::iterator kanzi::Node::InputManipulatorIterator
typedef InputManipulatorContainer::const_iterator kanzi::Node::InputManipulatorConstIterator

Gets the bindings iterator.

typedef BindingContainer::iterator kanzi::Node::BindingIterator
typedef BindingContainer::const_iterator kanzi::Node::BindingConstIterator

Gets the node component iterator.

typedef NodeComponentContainer::iterator kanzi::Node::NodeComponentIterator
typedef NodeComponentContainer::const_iterator kanzi::Node::NodeComponentConstIterator

Member Enumeration Documentation

Horizontal alignment options.

Enumerator
HorizontalAlignmentLeft 
HorizontalAlignmentRight 
HorizontalAlignmentCenter 
HorizontalAlignmentStretch 

Vertical alignment options.

Enumerator
VerticalAlignmentBottom 
VerticalAlignmentTop 
VerticalAlignmentCenter 
VerticalAlignmentStretch 

Depth alignment options.

Enumerator
DepthAlignmentBack 
DepthAlignmentFront 
DepthAlignmentCenter 
DepthAlignmentStretch 

Content stretch option.

Enumerator
ContentStretchNone 
ContentStretchFill 

Content is displayed unstretched in the middle of area.

ContentStretchUniform 

Content encompasses full area.

ContentStretchUniformToFill 

Content stretched to fill as much of area as possible. If aspect ratios do not match, leave area undrawn.

ContentStretchRepeat 

Content stretched to fill full area. If aspect ratios do not match, clip excess area.

Enumerator
VisitorPreOrder 
VisitorPostOrder 
Enumerator
VisitorAbort 
VisitorContinue 
VisitorContinueSibling 

Constructor & Destructor Documentation

virtual kanzi::Node::~Node ( )
virtual

Destructor.

kanzi::Node::Node ( Domain domain,
string_view  name 
)
explicitprotected

Constructor.

Member Function Documentation

string kanzi::Node::getName ( ) const
inline

Gets the value of NameProperty.

See also
setName()
void kanzi::Node::setName ( string_view  value)
inline

Sets the value of NameProperty.

See also
getName()
string kanzi::Node::getPath ( ) const
inline

Gets the value of PathProperty.

See also
setPath()
void kanzi::Node::setPath ( string  value)
inline

Sets the value of PathProperty.

See also
getPath()
string kanzi::Node::getLocale ( ) const
inline

Gets the value of LocaleProperty.

See also
setLocale()
void kanzi::Node::setLocale ( string  value)
inline

Sets the value of LocaleProperty.

See also
getLocale()
bool kanzi::Node::isHitTestable ( ) const
inline

Gets the value of HitTestableProperty.

See also
setHitTestable()
void kanzi::Node::setHitTestable ( bool  value)
inline

Sets the value of HitTestableProperty.

See also
isHitTestable()
bool kanzi::Node::isHitTestableContainer ( ) const
inline
void kanzi::Node::setHitTestableContainer ( bool  value)
inline
bool kanzi::Node::isVisible ( ) const
inline

Gets the value of VisibleProperty.

See also
setVisible()
void kanzi::Node::setVisible ( bool  value)
inline

Sets the value of VisibleProperty.

See also
isVisible()
bool kanzi::Node::isEnabled ( ) const
inline

Gets the value of EnabledProperty.

See also
setEnabled()
void kanzi::Node::setEnabled ( bool  value)
inline

Sets the value of EnabledProperty.

See also
isEnabled()
bool kanzi::Node::isFocusable ( ) const
inline

Gets the value of FocusableProperty.

See also
setFocusable()
void kanzi::Node::setFocusable ( bool  value)
inline

Sets the value of FocusableProperty.

Parameters
valuetrue to set the node focusable, false if not.
See also
isFocusable()
bool kanzi::Node::isFocused ( ) const
inline

Gets the value of FocusedProperty.

See also
setFocused()
void kanzi::Node::setFocused ( bool  value)
inline

Sets the value of FocusedProperty.

Parameters
valuetrue to set the active focus, false to clear it.
See also
isFocused(), FocusManager::trySetActiveFocus()
bool kanzi::Node::hasLogicalFocus ( ) const
inline

Returns the #LogicalFocusedProperty value.

void kanzi::Node::setLogicalFocus ( bool  value)
inline

Sets the value of LogicalFocusProperty.

Parameters
valuetrue to set the logical focus, false to clear it.
FontSharedPtr kanzi::Node::getFont ( ) const

Gets the value of FontProperty.

See also
setFont()
void kanzi::Node::setFont ( FontSharedPtr  value)

Sets the value of FontProperty.

See also
getFont()
float kanzi::Node::getVisibleAmountInParent ( ) const
inline
void kanzi::Node::setVisibleAmountInParent ( float  value)
inline
float kanzi::Node::getProjection2DTo3DScale ( ) const
inline
void kanzi::Node::setProjection2DTo3DScale ( float  value)
inline
bool kanzi::Node::isEnableClick ( ) const
inline

Gets the value of EnableClickProperty.

See also
setEnableClick()
void kanzi::Node::setEnableClick ( bool  value)
inline

Sets the value of EnableClickProperty.

See also
isEnableClick()
bool kanzi::Node::isEnableMultiClick ( ) const
inline

Gets the value of EnableMultiClickProperty.

See also
setEnableMultiClick()
void kanzi::Node::setEnableMultiClick ( bool  value)
inline

Sets the value of EnableMultiClickProperty.

See also
isEnableMultiClick()
ResourceSharedPtr kanzi::Node::getStyle ( ) const
inline

Gets the value of StyleProperty.

See also
setStyle()
void kanzi::Node::setStyle ( ResourceSharedPtr  value)
inline

Sets the value of StyleProperty.

See also
getStyle()
ResourceSharedPtr kanzi::Node::getStateManager ( ) const
inline

Gets the value of StateManagerProperty.

See also
setStateManager()
void kanzi::Node::setStateManager ( ResourceSharedPtr  value)
inline

Sets the value of StateManagerProperty.

See also
getStateManager()
float kanzi::Node::getWidth ( ) const
inline

Gets the value of WidthProperty.

See also
setWidth()
void kanzi::Node::setWidth ( float  value)
inline

Sets the value of WidthProperty.

See also
getWidth()
float kanzi::Node::getHeight ( ) const
inline

Gets the value of HeightProperty.

See also
setHeight()
void kanzi::Node::setHeight ( float  value)
inline

Sets the value of HeightProperty.

See also
getHeight()
float kanzi::Node::getDepth ( ) const
inline

Gets the value of DepthProperty.

See also
setDepth()
void kanzi::Node::setDepth ( float  value)
inline

Sets the value of DepthProperty.

See also
getDepth()
float kanzi::Node::getActualWidth ( ) const
inline

Gets the value of ActualWidthProperty.

See also
setActualWidth()
void kanzi::Node::setActualWidth ( float  value)
inline

Sets the value of ActualWidthProperty.

See also
getActualWidth()
float kanzi::Node::getActualHeight ( ) const
inline

Gets the value of ActualHeightProperty.

See also
setActualHeight()
void kanzi::Node::setActualHeight ( float  value)
inline

Sets the value of ActualHeightProperty.

See also
getActualHeight()
float kanzi::Node::getActualDepth ( ) const
inline

Gets the value of ActualDepthProperty.

See also
setActualDepth()
void kanzi::Node::setActualDepth ( float  value)
inline

Sets the value of ActualDepthProperty.

See also
getActualDepth()
Node::HorizontalAlignment kanzi::Node::getHorizontalAlignment ( ) const
inline
void kanzi::Node::setHorizontalAlignment ( Node::HorizontalAlignment  value)
inline
Node::VerticalAlignment kanzi::Node::getVerticalAlignment ( ) const
inline
void kanzi::Node::setVerticalAlignment ( Node::VerticalAlignment  value)
inline
Node::DepthAlignment kanzi::Node::getDepthAlignment ( ) const
inline

Gets the value of DepthAlignmentProperty.

See also
setDepthAlignment()
void kanzi::Node::setDepthAlignment ( Node::DepthAlignment  value)
inline

Sets the value of DepthAlignmentProperty.

See also
getDepthAlignment()
Vector2 kanzi::Node::getHorizontalMargin ( ) const
inline

Gets the value of HorizontalMarginProperty.

See also
setHorizontalMargin()
void kanzi::Node::setHorizontalMargin ( Vector2  value)
inline

Sets the value of HorizontalMarginProperty.

See also
getHorizontalMargin()
Vector2 kanzi::Node::getVerticalMargin ( ) const
inline

Gets the value of VerticalMarginProperty.

See also
setVerticalMargin()
void kanzi::Node::setVerticalMargin ( Vector2  value)
inline

Sets the value of VerticalMarginProperty.

See also
getVerticalMargin()
Vector2 kanzi::Node::getDepthMargin ( ) const
inline

Gets the value of DepthMarginProperty.

See also
setDepthMargin()
void kanzi::Node::setDepthMargin ( Vector2  value)
inline

Sets the value of DepthMarginProperty.

See also
getDepthMargin()
Node::ContentStretch kanzi::Node::getContentStretch ( ) const
inline

Gets the value of ContentStretchProperty.

See also
setContentStretch()
void kanzi::Node::setContentStretch ( Node::ContentStretch  value)
inline

Sets the value of ContentStretchProperty.

See also
getContentStretch()
float kanzi::Node::getOpacity ( ) const
inline

Gets the value of OpacityProperty.

See also
setOpacity()
void kanzi::Node::setOpacity ( float  value)
inline

Sets the value of OpacityProperty.

See also
getOpacity()
bool kanzi::Node::isClipChildren ( ) const
inline

Gets the value of ClipChildrenProperty.

See also
setClipChildren()
void kanzi::Node::setClipChildren ( bool  value)
inline

Sets the value of ClipChildrenProperty.

See also
isClipChildren()
template<typename DataType >
PropertyType<DataType>::Traits::ReturnType kanzi::Node::getProperty ( const PropertyType< DataType > &  propertyType) const
inline

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:

  1. Local value set with setProperty or loaded from kzb
  2. Value set by a style affecting the property.
  3. Value defined by class metadata.

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.

  1. Values defined is states of state manager.
  2. Animations.

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.

Parameters
propertyTypeThe property type identifying the property to retrieve.
Returns
Returns the evaluated property value.
AbstractPropertyTypeDescriptor::ValueSource* kanzi::Node::getNodeFinalValueSource ( AbstractPropertyTypeDescriptor descriptor) const
inline
template<typename DataType >
optional<typename PropertyType<DataType>::Traits::ReturnType> kanzi::Node::getOptionalProperty ( const PropertyType< DataType > &  propertyType) const
inline

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.

Parameters
propertyTypeThe property type identifying the property to retrieve.
valueThe reference that receives the value the function evaluates. The reference is not modified if there are no inputs to the property value.
Returns
Returns true if there are inputs into the property value, false otherwise.
template<typename DataType >
DataType kanzi::Node::getAbstractProperty ( AbstractPropertyType  abstractPropertyType) const
template<typename DataType >
optional<typename PropertyType<DataType>::DataType> kanzi::Node::getOptionalAbstractProperty ( AbstractPropertyType  abstractPropertyType) const
template<typename TMessageType , typename TClass , typename TClassMethod >
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.

template<typename TMessageType , typename TClass , typename TClassMethod >
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.

template<typename TMessageType >
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.

template<typename TMessageType >
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.

template<typename TMessageType >
MessageSubscriptionToken kanzi::Node::addMessageHandler ( const TMessageType &  messageType,
typename TMessageType::FunctionType  function,
Node messageSourceFilter 
)

Adds a message handler where handler is function and accepted source is explicitly defined.

The handler is invoked when a message of messageType bubbles through the node the handler is added to, but only if it was dispatched from the given source node.

Parameters
messageTypeMessage type to listen to.
functionFunction to invoke when message is received.
messageSourceFilterOnly accept messages
void kanzi::Node::removeMessageHandler ( MessageSubscriptionToken  token)

Removes a message subscription.

template<typename TArgumentsType >
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

Tries to find Resource URL for Resource ID from this node.

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.

Parameters
IdName of the resource.
Returns
Shared pointer to the resource, or nullptr if the resource id doesn't map to any resource url.
template<typename T >
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.

Parameters
IdName of the resource.
Returns
Shared pointer to the resource, or nullptr if the resource id doesn't map to any resource url.
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.

Parameters
IdName of the resource.
Returns
Shared pointer to the resource, or nullptr if the resource id or resource url doesn't map to any resource.
ResourceManager::AcquireTaskSharedPtr kanzi::Node::acquireResourceAsync ( const ResourceID key,
ResourceManager::AsyncAcquireFinishedCallback  func 
) const

Posts an asynchronous task to acquire a resource.

Parameters
keyName of the resource.
funcCallback to execute upon completion of the task.
Returns
Task created or an empty shared pointer on failure.
template<typename T >
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.

Parameters
IdName of the resource.
Returns
Shared pointer to the resource, or nullptr if the resource is not found.
ResourceDictionarySharedPtr kanzi::Node::getResourceDictionary ( ) const

Gets the resource dictionary of the node, if the node has one.

Returns
The resource dictionary of the node, or nullptr if the node doesn't have a resource dictionary.
ResourceDictionarySharedPtr kanzi::Node::acquireResourceDictionary ( )

Gets the resource dictionary of the node.

Creates the dictionary if it doesn't exist.

Returns
The resource dictionary of the node.
void kanzi::Node::notifyResourceDictionaryModified ( )

Forces the re-evaluation of resource IDs in a node tree.

If you modify a resource dictionary of a node that is already attached, you can use this to update the resource properties. Note that you need to use this function only if you modify the dictionary directly through getResourceDictionary or acquireResourceDictionary. If you use other Node class functions like addResource or setResourceDictionary, you don't need to call this.

void kanzi::Node::setResourceDictionary ( ResourceDictionarySharedPtr  resourceDictionary)

Replaces the resource dictionary of the node.

Updates all the resource references of the child nodes.

Parameters
resourceDictionaryThe resource dictionary.
void kanzi::Node::addResourceDictionary ( ResourceDictionarySharedPtr  resourceDictionary)

Add a nested resource dictionary to the resource dictionary of the node.

Updates all the resource references of the child nodes.

Parameters
resourceDictionaryThe nested resource dictionary.
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 
)
template<typename Type >
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.

Parameters
relativePathPath to use for relative lookup.
Returns
Pointer to node.
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.

Parameters
relativePathRelative path to use for lookup.
Returns
Shared pointer referencing object. May be empty if no object found.
tuple<NodeSharedPtr, AbstractPropertyType> kanzi::Node::lookupObjectForStateManager ( string_view  relativePath)

Lookup for an node and possible object from within the node for state manager.

If the path points to a resource within the node, the node, and the associated abstract property type will be returned.

Parameters
relativePathRelative path to use for lookup.
Returns
Tuple of node and possibly abstract property type.
template<typename Type >
shared_ptr<Type> kanzi::Node::lookupObject ( string_view  path)
inline

Lookup for an object from a node.

Object found may be another node or a resource within a node.

Parameters
relativePathRelative path to use for lookup.
Returns
Shared pointer referencing object. May be empty if no object found.
template<typename TNodeType >
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.

virtual bool kanzi::Node::addAbstractChildOverride ( NodeSharedPtr  child)
pure virtual

Implemented in kanzi::Node2D, and kanzi::Node3D.

virtual size_t kanzi::Node::getAbstractChildCountOverride ( )
pure virtual

Implemented in kanzi::Node2D, and kanzi::Node3D.

virtual NodeSharedPtr kanzi::Node::getAbstractChildOverride ( size_t  index)
pure virtual

Implemented in kanzi::Node2D, and kanzi::Node3D.

virtual bool kanzi::Node::removeAbstractChildOverride ( Node child)
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,
shared_ptr< 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 ( shared_ptr< void >  owner)

Removes all bindings with the specified owner.

BindingConstIterator kanzi::Node::beginBindings ( ) const
BindingConstIterator kanzi::Node::endBindings ( ) const
void kanzi::Node::addNodeComponent ( NodeComponentSharedPtr  nodeComponent)

Transfers the ownership of a node component to an object node.

void kanzi::Node::addNodeComponentWithOwner ( NodeComponentSharedPtr  nodeComponent,
const void *  owner 
)

Transfers the ownership of a node component to an object node and sets the owner of the node component.

void kanzi::Node::removeNodeComponent ( NodeComponent nodeComponent)

Removes the ownership of a node component from an object node.

void kanzi::Node::removeNodeComponentWithOwner ( const void *  owner)

Removes all bindings with the specified owner.

NodeComponentConstIterator kanzi::Node::beginNodeComponents ( ) const
NodeComponentConstIterator kanzi::Node::endNodeComponents ( ) const
template<typename Type >
shared_ptr<Type> kanzi::Node::lookupNodeComponent ( string_view  name)

Returns a node component of specified type by looking it up with specified name.

If name is not specified, then the first anonymous node component of specified type is returned.

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.

uint32_t kanzi::Node::getChangeFlags ( ) const
inline

Get current change flags.

Returns
Change flags directly.
uint32_t kanzi::Node::getChildChangeFlags ( ) const
inline

Get current child change flags.

Returns
Child change flags directly.
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.

bool kanzi::Node::isAnyChangeFlagSet ( uint32_t  flag) const

Checks if any of given flags 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 node.

void kanzi::Node::invalidateRender ( )

Invalidates render for node.

bool kanzi::Node::isInvalidFinalTransform ( ) const

Tells if final transform flag is invalid for node.

void kanzi::Node::invalidateFinalTransform ( )

Invalidates final transform for node.

bool kanzi::Node::isInvalidDraw ( )

Tells if node draw flag is invalid.

void kanzi::Node::invalidateDraw ( )

Invalidates draw flag for the node.

void kanzi::Node::validateDraw ( )

Validates draw flags for the node.

void kanzi::Node::validateDrawForChildrenRecursive ( )

Recursively validates draw for the children from this 2D node onwards.

Called internally by the system in situations where draw does not otherwise descend to the node.

bool kanzi::Node::isInitialized ( ) const

Returns true if initialize() has been called, false otherwise.

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.

virtual const KzuBoundingVolume* kanzi::Node::getBoundingVolume ( ) const
virtual

Gets bounding volume from object node.

Returns KZ_NULL if the object is not renderable.

Reimplemented in kanzi::Model3D, and kanzi::TextBlock3D.

AppliedStyleEntrySharedPtr kanzi::Node::applyStyle ( StyleSharedPtr  style)

Applies a style to an object node.

Returns a style entry that is used to unapply the style.

AppliedStyleEntrySharedPtr kanzi::Node::applyManualStyle ( StyleSharedPtr  style)

Applies a style to an object node.

Returns a style entry that is used to unapply the style. The style must be unapplied manually.

void kanzi::Node::unapplyStyle ( AppliedStyleEntrySharedPtr  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, node comopnents, resources etc.

void kanzi::Node::addResourceReference ( AbstractPropertyType  propertyType,
AbstractResourceReference reference 
)

This is a helper for automatic resource tracking in ResourceReference.

Parameters
propertyTypeProperty type to listen changes on.
referenceReference to react on.
void kanzi::Node::removeResourceReference ( const AbstractResourceReference reference)

This is a helper for automatic resource tracking in ResourceReference.

Parameters
referenceReference to remove.
void kanzi::Node::addNodeReference ( AbstractPropertyType  propertyType,
AbstractNodeReference reference 
)
void kanzi::Node::removeNodeReference ( const AbstractNodeReference reference)
virtual void kanzi::Node::restoreResources ( )
inlinevirtual

Reattaches an object node after potential resource change.

Reimplemented in kanzi::Node2D, kanzi::Viewport2D, and kanzi::ProgressiveRenderingViewport2D.

ScriptingContextSharedPtr kanzi::Node::getScriptingContext ( ) const
inline
void kanzi::Node::setScriptingContext ( ScriptingContextSharedPtr  context)
inline
static bool kanzi::Node::isValidLayoutValue ( float  value)
inlinestatic

Indicates whether a value is valid layout value.

Valid layout value is a non-negative floating point number. Valid layout value can be positive infinity (unbounded layout value).

Parameters
valueValue to test if it is unbound layout value.
Returns
true if the value if valid layout value, false otherwise.
static float kanzi::Node::unboundedLayoutValue ( )
inlinestatic

Returns an unbounded layout value.

Returns
Unbounded layout value.
static bool kanzi::Node::isUnboundedLayoutValue ( float  layoutValue)
inlinestatic

Indicates whether a value is an unbound layout value.

Parameters
layoutValueValue to test if it is unbound layout value.
Returns
true if the layoutValue is unbound layout value, false otherwise.
static float kanzi::Node::replaceUnboundedLayoutValue ( float  layoutValue,
float  resetValue 
)
inlinestatic

Replaces layout value with the specified value if it is unbounded and returns it.

Parameters
layoutValueLayout value to test if it is unbounded layout value.
resetValueThe value which is returned if layoutValue is unbounded layout value.
Returns
resetValue if layoutValue is an unbounded layout value, layoutValue otherwise.
static float kanzi::Node::replaceUnboundedLayoutValueWithZero ( float  layoutValue)
inlinestatic

Replaces layout value with zero if it is unbounded layout value and returns it.

Parameters
layoutValueLayout value to test if it is unbounded layout value.
Returns
Zero if layoutValue is an unbounded layout value, layoutValue otherwise.
void kanzi::Node::setTemplateRoot ( NodeSharedPtr  templateRoot)
inline

Sets the template root of this node.

Template root is used in template root bindings. This is an internal function.

NodeSharedPtr kanzi::Node::getTemplateRoot ( ) const
inline

Gets the template root of this node.

Template root is used in template root bindings. This is an internal function.

bool kanzi::Node::trySetActiveFocus ( )

The method tries to move the active focus on this node.

Returns
true if the focus was moved on this node, false if not.
void kanzi::Node::initialize ( )
protected
virtual NodeSharedPtr kanzi::Node::findAbstractChildOverride ( string_view  name)
protectedpure virtual
virtual VisitorResult kanzi::Node::visitAbstractChildOverride ( const Visitor visitor,
VisitorOrder  order 
)
protectedpure virtual
static VisitorResult kanzi::Node::updateResourceVisitor ( Node node,
const ResourceID id 
)
staticprotected
static VisitorResult kanzi::Node::updateAllResourcesVisitor ( Node node)
staticprotected
static VisitorResult kanzi::Node::applyStylesVisitor ( Node node,
bool  apply 
)
staticprotected
static VisitorResult kanzi::Node::attachVisitor ( Node node)
staticprotected
static VisitorResult kanzi::Node::detachVisitor ( Node node)
staticprotected
static VisitorResult kanzi::Node::validateDrawVisitor ( Node node)
staticprotected

Visitor for validating draw.

static bool kanzi::Node::processPropertyChanged ( Node node,
AbstractPropertyType  propertyType,
const PropertyStoragePtr nodePropertyStorage,
AbstractPropertyTypeDescriptor::PropertyStorage changedPropertyStorage,
PropertyNotificationReason  reason 
)
staticprotected

Processes notification handlers for node and property storage.

Parameters
nodeNode to invoke change notification on.
propertyTypeChanged property type.
nodePropertyStorageProperty storage for the node being modified.
changedPropertyStorageProperty storage actually being changed (not necessarily from node).
reasonChange reason.
Returns
True of node still exists after notification handlers have been changed.
static VisitorResult kanzi::Node::propertyChangedVisitor ( Node node,
AbstractPropertyType  propertyType,
AbstractPropertyTypeDescriptor::PropertyStorage propertyStorage,
PropertyNotificationReason  reason 
)
staticprotected
void kanzi::Node::updatePropertiesForConnectedNode ( )
protected

Invokes property notifications for inherited properties during scene graph tree connections.

void kanzi::Node::updatePropertiesForDisconnectedNode ( Node oldParent)
protected

Invokes property notifications for inherited properties during scene graph tree disconnections.

void kanzi::Node::updateResourceReferences ( )
protected
void kanzi::Node::updateResourceReferences ( AbstractPropertyType  propertyType)
protected
void kanzi::Node::updateResourceReferencesRecursive ( )
protected
void kanzi::Node::updateResourceReferencesRecursive ( const ResourceID resourceID)
protected
void kanzi::Node::attach ( )
protected

Attaches the object node.

void kanzi::Node::detach ( )
protected

Detaches the object node.

virtual void kanzi::Node::notifyPropertyHandlers ( PropertyStoragePtr propertyStorage,
PropertyNotificationReason  reason 
)
protectedvirtual

Reimplemented from kanzi::PropertyObject.

Friends And Related Function Documentation

friend class InputManager
friend

Member Data Documentation

PropertyType<string> kanzi::Node::NameProperty
static

Name property.

The default value is "".

See also
setName(), getName()
PropertyType<string> kanzi::Node::PathProperty
static

Path property.

The default value is "".

See also
setPath(), getPath()
PropertyType<string> kanzi::Node::LocaleProperty
static

Locale property.

The default value is "".

See also
setLocale(), getLocale()
PropertyType<bool> kanzi::Node::CreatedFromKZBProperty
static

CreatedFromKZB property.

The default value is false.

See also
setCreatedFromKZB(), isCreatedFromKZB()
PropertyType<bool> kanzi::Node::HitTestableProperty
static

HitTestable property.

The default value is false.

See also
setHitTestable(), isHitTestable()
PropertyType<bool> kanzi::Node::HitTestableContainerProperty
static

HitTestableContainer property.

The default value is false.

See also
setHitTestableContainer(), isHitTestableContainer()
PropertyType<bool> kanzi::Node::VisibleProperty
static

Visible property.

The default value is true.

See also
setVisible(), isVisible()
PropertyType<bool> kanzi::Node::EnabledProperty
static

Enabled property.

The default value is true.

See also
setEnabled(), isEnabled()
PropertyType<bool> kanzi::Node::FocusableProperty
static

The property specifies whether a node can get active focus and can participate in the focus chain navigation.

When the node is also a focus scope, it specifies whether the scope is a focus fence. The default value is true.

See also
setFocusable(), isFocusable()
PropertyType<bool> kanzi::Node::FocusedProperty
static

Specifies that the node is the active focus node, which receives keyboard messages.

There is only one node in an application that can have active focus. The default value is false.

See also
setFocused(), isFocused()
PropertyType<bool> kanzi::Node::LogicalFocusProperty
static

Specifies that the node has logical focus state.

An application can have multiple logical focus nodes set, however only one node in a focus scope can have logical focus set. The default value is false.

See also
FocusManager::trySetActiveFocus(), FocusManager::FocusScopeProperty, setScopeFocusedNode()
PropertyType<ResourceSharedPtr> kanzi::Node::FontProperty
static

Font property.

Defines the resource ID of the font resource. The default value is ResourceSharedPtr().

See also
setFont(), getFont()
PropertyType<float> kanzi::Node::VisibleAmountInParentProperty
static

VisibleAmountInParent property.

The default value is 1.0f.

See also
setVisibleAmountInParent(), getVisibleAmountInParent()
PropertyType<float> kanzi::Node::Projection2DTo3DScaleProperty
static

Projection2DTo3DScale property.

The default value is 0.02f.

See also
setProjection2DTo3DScale(), getProjection2DTo3DScale()
PropertyType<bool> kanzi::Node::EnableClickProperty
static

EnableClick property.

The default value is false.

See also
setEnableClick(), isEnableClick()
PropertyType<bool> kanzi::Node::EnableMultiClickProperty
static

EnableMultiClick property.

The default value is false.

See also
setEnableMultiClick(), isEnableMultiClick()
PropertyType<ResourceSharedPtr> kanzi::Node::StyleProperty
static

Style property.

The default value is ResourceSharedPtr().

See also
setStyle(), getStyle()
PropertyType<ResourceSharedPtr> kanzi::Node::StateManagerProperty
static

StateManager property.

The default value is ResourceSharedPtr().

See also
setStateManager(), getStateManager()
PropertyType<void*> kanzi::Node::PrefabTemplateSourceProperty
static

PrefabTemplateSource property.

The default value is 0.

See also
setPrefabTemplateSource(), getPrefabTemplateSource()
PropertyType<float> kanzi::Node::WidthProperty
static

Width property.

The default value is 0.0f.

See also
setWidth(), getWidth()
PropertyType<float> kanzi::Node::HeightProperty
static

Height property.

The default value is 0.0f.

See also
setHeight(), getHeight()
PropertyType<float> kanzi::Node::DepthProperty
static

Depth property.

The default value is 0.0f.

See also
setDepth(), getDepth()
PropertyType<float> kanzi::Node::ActualWidthProperty
static

ActualWidth property.

The default value is 0.0f.

See also
setActualWidth(), getActualWidth()
PropertyType<float> kanzi::Node::ActualHeightProperty
static

ActualHeight property.

The default value is 0.0f.

See also
setActualHeight(), getActualHeight()
PropertyType<float> kanzi::Node::ActualDepthProperty
static

ActualDepth property.

The default value is 0.0f.

See also
setActualDepth(), getActualDepth()
PropertyType<Node::HorizontalAlignment> kanzi::Node::HorizontalAlignmentProperty
static

HorizontalAlignment property.

The default value is Node::HorizontalAlignmentCenter.

See also
setHorizontalAlignment(), getHorizontalAlignment()
PropertyType<Node::VerticalAlignment> kanzi::Node::VerticalAlignmentProperty
static

VerticalAlignment property.

The default value is Node::VerticalAlignmentCenter.

See also
setVerticalAlignment(), getVerticalAlignment()
PropertyType<Node::DepthAlignment> kanzi::Node::DepthAlignmentProperty
static

DepthAlignment property.

The default value is Node::DepthAlignmentCenter.

See also
setDepthAlignment(), getDepthAlignment()
PropertyType<Vector2> kanzi::Node::HorizontalMarginProperty
static

Sets the horizontal space between this node and other nodes that are adjacent to this node in a layout.

The X component sets the left margin and the Y component sets the right margin. The default value is Vector2(0.0f, 0.0f).

See also
setHorizontalMargin(), getHorizontalMargin()
PropertyType<Vector2> kanzi::Node::VerticalMarginProperty
static

Sets the vertical space between this node and other nodes that are adjacent to this node in a layout.

The X component sets the bottom margin and the Y component sets the top margin. The default value is Vector2(0.0f, 0.0f).

See also
setVerticalMargin(), getVerticalMargin()
PropertyType<Vector2> kanzi::Node::DepthMarginProperty
static

Sets the space in the depth direction between this node and other nodes that are adjacent to this node in a layout.

The X component sets the back margin and the Y component sets the front margin. The default value is Vector2(0.0f, 0.0f).

See also
setDepthMargin(), getDepthMargin()
PropertyType<Node::ContentStretch> kanzi::Node::ContentStretchProperty
static

ContentStretch property.

The default value is Node::ContentStretchUniform.

See also
setContentStretch(), getContentStretch()
PropertyType<float> kanzi::Node::OpacityProperty
static

Opacity property.

The default value is 1.0f.

See also
setOpacity(), getOpacity()
PropertyType<bool> kanzi::Node::ClipChildrenProperty
static

ClipChildren property.

The default value is true.

See also
setClipChildren(), isClipChildren()
PropertyType<int> kanzi::Node::SceneGraphAddNodeChangeChildFlagsProperty
static

SceneGraphAddNodeChangeChildFlags property.

The default value is PropertyTypeChangeFlagFinalTransformation | PropertyTypeChangeFlagMeasure.

See also
setSceneGraphAddNodeChangeChildFlags(), getSceneGraphAddNodeChangeChildFlags()
PropertyType<int> kanzi::Node::SceneGraphAddNodeChangeParentFlagsProperty
static

SceneGraphAddNodeChangeParentFlags property.

The default value is PropertyTypeChangeFlagMeasure.

See also
setSceneGraphAddNodeChangeParentFlags(), getSceneGraphAddNodeChangeParentFlags()
PropertyType<int> kanzi::Node::SceneGraphRemoveNodeChangeChildFlagsProperty
static

SceneGraphRemoveNodeChangeChildFlags property.

The default value is 0.

See also
setSceneGraphRemoveNodeChangeChildFlags(), getSceneGraphRemoveNodeChangeChildFlags()
PropertyType<int> kanzi::Node::SceneGraphRemoveNodeChangeParentFlagsProperty
static

SceneGraphRemoveNodeChangeParentFlags property.

The default value is PropertyTypeChangeFlagMeasure.

See also
setSceneGraphRemoveNodeChangeParentFlags(), getSceneGraphRemoveNodeChangeParentFlags()

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