HierarchyObjectInterface Class Reference

#include <hierarchyobject.h>

Inheritance diagram for HierarchyObjectInterface:

详细描述

Object that allows to create hierarchical tree like structures.

An object can have siblings and branches with children. By default the children are all stored in the default branch branchId == ConstDataPtr(). But you can add as many branches to categorize and separate different flavors of children. You can do this by defining different branches like in this example:

enum class IMAGEHIERARCHY { TEXTURE , IMAGE , ALPHA , LAYER , MASK , MAX_ELEMENTS , } MAXON_ENUM_LIST ( IMAGEHIERARCHY );

You can then pass the branch to one of the functions below by replacing the default ConstDataPtr() by a different id. This example will return the first child of IMAGEHIERARCHY::IMAGE branch.

HierarchyObjectRef child = object .GetFirstChild(ConstDataPtr( IMAGEHIERARCHY::IMAGE ))

公共成员函数

MAXON_METHOD Result < void >  InsertBefore (const typename HIERARCHY::template Sibling< Interface >::type &nextSibling)
MAXON_METHOD Result < void >  InsertAfter (const typename HIERARCHY::template Sibling< Interface >::type &prevSibling)
MAXON_METHOD Result < void >  InsertAsFirstChildOf (const typename HIERARCHY::template Parent< Interface >::type &parent, const ConstDataPtr &branchId= ConstDataPtr ())
MAXON_METHOD Result < void >  InsertAsLastChildOf (const typename HIERARCHY::template Parent< Interface >::type &parent, const ConstDataPtr &branchId= ConstDataPtr ())
MAXON_METHOD Result < void >  InsertAsChildAt (const typename HIERARCHY::template Parent< Interface >::type &parent, Int position, const ConstDataPtr &branchId= ConstDataPtr ())
MAXON_METHOD Result < void >  InsertChildAsFirst (const typename HIERARCHY::template Child< Interface >::type &child, const ConstDataPtr &branchId= ConstDataPtr ())
MAXON_METHOD Result < void >  InsertChildAsLast (const typename HIERARCHY::template Child< Interface >::type &child, const ConstDataPtr &branchId= ConstDataPtr ())
MAXON_METHOD Result < void >  InsertChildAt (const typename HIERARCHY::template Child< Interface >::type &child, Int position, const ConstDataPtr &branchId= ConstDataPtr ())
MAXON_METHOD Result < void >  InsertChildrenAsFirst (const Block < const typename HIERARCHY::template Child< Interface >::type > &children, const ConstDataPtr &branchId= ConstDataPtr ())
MAXON_METHOD Result < void >  InsertChildrenAsLast (const Block < const typename HIERARCHY::template Child< Interface >::type > &children, const ConstDataPtr &branchId= ConstDataPtr ())
MAXON_METHOD Result < void >  InsertChildrenAt (const Block < const typename HIERARCHY::template Child< Interface >::type > &children, Int position, const ConstDataPtr &branchId= ConstDataPtr ())
MAXON_METHOD Result < void >  替换 (const typename HIERARCHY::template Sibling< Interface >::type &newObject)
MAXON_METHOD HierarchyObjectRef   移除 ()
MAXON_METHOD HIERARCHY::template Child< Interface >::type  RemoveChildren (const ConstDataPtr &branchId= ConstDataPtr ())
MAXON_METHOD void  RemoveAllChildren ()
MAXON_METHOD Result < 数据 GetOwner () const
MAXON_METHOD HIERARCHY::template Child< Interface >::type  GetFirstChild (const ConstDataPtr &branchId= ConstDataPtr ()) const
MAXON_METHOD HIERARCHY::template Child< Interface >::type  GetLastChild (const ConstDataPtr &branchId= ConstDataPtr ()) const
MAXON_METHOD HIERARCHY::template Child< Interface >::type  GetChildAt ( Int position, const ConstDataPtr &branchId= ConstDataPtr ()) const
MAXON_METHOD Result < BaseArray < typename HIERARCHY::template Child< Interface >::type > >  GetChildren (const ConstDataPtr &branchId= ConstDataPtr ()) const
MAXON_METHOD Result < BaseArray < ConstDataPtr > >  GetBranches () const
MAXON_METHOD ConstDataPtr   GetBranchId () const
MAXON_METHOD void  SetLocking (const Bool locking)
MAXON_METHOD Bool   IsLocked () const
MAXON_METHOD HIERARCHY::template Parent< Interface >::type  GetParent () const
MAXON_METHOD HIERARCHY::template Sibling< Interface >::type  GetNext () const
MAXON_METHOD HIERARCHY::template Sibling< Interface >::type  GetPrev () const
MAXON_METHOD HIERARCHY::template Sibling< Interface >::type  GetFirst () const
MAXON_METHOD HIERARCHY::template Sibling< Interface >::type  GetLast () const
MAXON_METHOD void  ParentChanged ( Bool removed)
MAXON_METHOD std::add_pointer< HierarchyObjectInterface >::type  FindNextLeaf (const HierarchyObjectInterface *stopAtParent) const
  MAXON_OBSERVABLE ( Result < void >, ObservableHierarchyInsert,(const HierarchyObjectRef <> &sender, const HierarchyObjectRef <> &object, const ConstDataPtr &branchId), ObservableCombinerRunAllComponent)
  MAXON_OBSERVABLE ( Result < void >, ObservableHierarchyRemove,(const HierarchyObjectRef <> &sender, const HierarchyObjectRef <> &object, const ConstDataPtr &branchId), ObservableCombinerRunAllComponent)

私有成员函数

  MAXON_INTERFACE ( HierarchyObjectInterface , MAXON_REFERENCE_NORMAL , "net.maxon.interface.hierarchyobject")
  MAXON_GENERIC (typename HIERARCHY= DefaultHierarchy < void >)

成员函数文档编制

◆  MAXON_INTERFACE()

MAXON_INTERFACE ( HierarchyObjectInterface   ,
MAXON_REFERENCE_NORMAL   ,
"net.maxon.interface.hierarchyobject"   
)
private

◆  MAXON_GENERIC()

MAXON_GENERIC ( typename HIERARCHY  = DefaultHierarchy< void > )
private

◆  InsertBefore()

MAXON_METHOD Result <void> InsertBefore ( const typename HIERARCHY::template Sibling< Interface >::type &  nextSibling )

Inserts this object (including its children and next siblings, if any) into the hierarchy as the previous sibling of nextSibling. Before invocation, nextSibling needs to have either a previous sibling or a parent object, which will get the ownership of this object. This object will take over the ownership of nextSibling.

This object mustn't have a parent or a previous sibling.

参数
[in] nextSibling An object which shall become the next sibling of this object.
返回
OK on success. @MAXON_ANNOTATION{interfaceParameter=Interface}

◆  InsertAfter()

MAXON_METHOD Result <void> InsertAfter ( const typename HIERARCHY::template Sibling< Interface >::type &  prevSibling )

Inserts this object (including its children and next siblings, if any) into the hierarchy as the next sibling of prevSibling. prevSibling gets the ownership of this object.

This object mustn't have a parent or a previous sibling.

参数
[in] prevSibling Another object of which this object shall become the next sibling.
返回
OK on success. @MAXON_ANNOTATION{interfaceParameter=Interface}

◆  InsertAsFirstChildOf()

MAXON_METHOD Result <void> InsertAsFirstChildOf ( const typename HIERARCHY::template Parent< Interface >::type &  parent ,
const ConstDataPtr branchId = ConstDataPtr()  
)

Insert this object (including its children and next siblings, if any) as the first child of the given parent object. The parent object gets the ownership of this object.

This object mustn't have a parent or a previous sibling.

参数
[in] parent Parent object under which the object should be inserted.
[in] branchId Defines the branch the child belongs to.
返回
OK on success. @MAXON_ANNOTATION{interfaceParameter=Interface}

◆  InsertAsLastChildOf()

MAXON_METHOD Result <void> InsertAsLastChildOf ( const typename HIERARCHY::template Parent< Interface >::type &  parent ,
const ConstDataPtr branchId = ConstDataPtr()  
)

Insert this object (including its children and next siblings, if any) as the last child of the given parent object. If there are already children existing in the given branch the last one will get ownership of this object. Otherwise the parent object gets the ownership of this object.

This object mustn't have a parent or a previous sibling.

参数
[in] parent Parent object under which the object should be inserted.
[in] branchId Defines the branch the child belongs to.
返回
OK on success. @MAXON_ANNOTATION{interfaceParameter=Interface}

◆  InsertAsChildAt()

MAXON_METHOD Result <void> InsertAsChildAt ( const typename HIERARCHY::template Parent< Interface >::type &  parent ,
Int   position ,
const ConstDataPtr branchId = ConstDataPtr()  
)

Insert this object (including its children and next siblings, if any) as a child of the given parent position. For example if you specify a position of 3 and there are already 5 children existing the object will be inserted between the previously second and third child. If you specify a position of 1 the object will be inserted as the first child.

If a next sibling exists, this object gets ownership of the next sibling. If a previous sibling exists, the previous sibling gets the ownership of this object. Otherwise the parent object gets the ownership of this object.

This object mustn't have a parent or a previous sibling.

参数
[in] parent Parent object under which the object should be inserted.
[in] position A child of parent which shall become the next sibling of this object, or nullptr if this object shall become the last child.
[in] branchId Defines the branch the child belongs to.
返回
OK on success. @MAXON_ANNOTATION{interfaceParameter=Interface}

◆  InsertChildAsFirst()

MAXON_METHOD Result <void> InsertChildAsFirst ( const typename HIERARCHY::template Child< Interface >::type &  child ,
const ConstDataPtr branchId = ConstDataPtr()  
)

Insert a child object (including its children and next siblings, if any) as the first child of this object. This object gets the ownership of the given child.

The child object mustn't have a parent or a previous sibling.

参数
[in] child Parent object under which the object should be inserted.
[in] branchId Defines the branch the children belongs to.
返回
OK on success. @MAXON_ANNOTATION{interfaceParameter=Interface}

◆  InsertChildAsLast()

MAXON_METHOD Result <void> InsertChildAsLast ( const typename HIERARCHY::template Child< Interface >::type &  child ,
const ConstDataPtr branchId = ConstDataPtr()  
)

Insert a child object (including its children and next siblings, if any) as the last child of this object. If there are already children existing in the given branch the last one will get ownership of the given child object. Otherwise this object gets the ownership of the given child.

The child object mustn't have a parent or a previous sibling.

参数
[in] child Parent object under which the object should be inserted.
[in] branchId Defines the branch the child belongs to.
返回
OK on success. @MAXON_ANNOTATION{interfaceParameter=Interface}

◆  InsertChildAt()

MAXON_METHOD Result <void> InsertChildAt ( const typename HIERARCHY::template Child< Interface >::type &  child ,
Int   position ,
const ConstDataPtr branchId = ConstDataPtr()  
)

Insert a child object (including its children and next siblings, if any) as the given child position of this object. For example if you specify a position of 3 and there are already 5 children existing the child object will be inserted between the previously second and third child. If you specify a position of 1 the given child object will be inserted as the first child.

If a next sibling exists, the given child object gets ownership of the next sibling. If a previous sibling exists, the previous sibling gets the ownership of the given child object. Otherwise this object gets the ownership of the given child object.

The child object mustn't have a parent or a previous sibling.

参数
[in] child Parent object under which the object should be inserted.
[in] position A child of parent which shall become the next sibling of this object, or nullptr if this object shall become the last child.
[in] branchId Defines the branch the child belongs to.
返回
OK on success. @MAXON_ANNOTATION{interfaceParameter=Interface}

◆  InsertChildrenAsFirst()

MAXON_METHOD Result <void> InsertChildrenAsFirst ( const Block < const typename HIERARCHY::template Child< Interface >::type > &  children ,
const ConstDataPtr branchId = ConstDataPtr()  
)

Insert a list of child objects (including its children and next siblings, if any) as the first child of this object. This object gets the ownership of the given children.

Each child object mustn't have a parent or a previous sibling.

参数
[in] children Parent object under which the object should be inserted.
[in] branchId Defines the branch the children belong to.
返回
OK on success. @MAXON_ANNOTATION{interfaceParameter=Interface}

◆  InsertChildrenAsLast()

MAXON_METHOD Result <void> InsertChildrenAsLast ( const Block < const typename HIERARCHY::template Child< Interface >::type > &  children ,
const ConstDataPtr branchId = ConstDataPtr()  
)

Insert a list of child objects (including its children and next siblings, if any) as the last child of this object. If there are already children existing in the given branch the last one will get ownership of the given children objects. Otherwise this object gets the ownership of the given children.

Each child object mustn't have a parent or a previous sibling.

参数
[in] children Parent object under which the object should be inserted.
[in] branchId Defines the branch the children belong to.
返回
OK on success. @MAXON_ANNOTATION{interfaceParameter=Interface}

◆  InsertChildrenAt()

MAXON_METHOD Result <void> InsertChildrenAt ( const Block < const typename HIERARCHY::template Child< Interface >::type > &  children ,
Int   position ,
const ConstDataPtr branchId = ConstDataPtr()  
)

Insert a list of children objects (including its children and next siblings, if any) as the given child position of this object. For example if you specify a position of 3 and there are already 5 children existing the children will be inserted between the previously second and third child. If you specify a position of 1 the given children will bbe inserted as the first child.

If a next sibling exists, the last children object gets ownership of the next sibling. If a previous sibling exists, the previous sibling gets the ownership of the given children objects. Otherwise this object gets the ownership of the given children.

Each child object mustn't have a parent or a previous sibling.

参数
[in] children Parent object under which the object should be inserted.
[in] position A child of parent which shall become the next sibling of this object, or nullptr if this object shall become the last child.
[in] branchId Defines the branch the children belong to.
返回
OK on success. @MAXON_ANNOTATION{interfaceParameter=Interface}

◆  Replace()

MAXON_METHOD Result <void> Replace ( const typename HIERARCHY::template Sibling< Interface >::type &  newObject )

Replace this object with the new one and remove it from the hierarchy. The new object will have the same prev/next siblings and descendants like this object.

返回
This object including the descendants hierarchy. @MAXON_ANNOTATION{interfaceParameter=Interface}

◆  Remove()

MAXON_METHOD HierarchyObjectRef 移除 ( )

Removes this object from the hierarchy, including all descendants.

返回
This object including the descendants hierarchy.

◆  RemoveChildren()

MAXON_METHOD HIERARCHY::template Child<Interface>::type RemoveChildren ( const ConstDataPtr branchId = ConstDataPtr() )

Removes all descendants from the given branch hierarchy. The descendants hierarchy is returned as a reference which has the ownership of the descendants.

参数
[in] branchId Defines from which branch the children are removed.
返回
Descendants hierarchy. @MAXON_ANNOTATION{interfaceParameter=Interface}

◆  RemoveAllChildren()

MAXON_METHOD void RemoveAllChildren ( )

Removes all descendants from the hierarchy including all branches.

◆  GetOwner()

MAXON_METHOD Result < 数据 > GetOwner ( ) const

Returns the owner of this object (and the whole hierarchy).

返回
Owner of hierarchy.

◆  GetFirstChild()

MAXON_METHOD HIERARCHY::template Child<Interface>::type GetFirstChild ( const ConstDataPtr branchId = ConstDataPtr() ) const

Returns the first child of this object.

参数
[in] branchId The branch.
返回
Child object or nullptr if not available. @MAXON_ANNOTATION{interfaceParameter=Interface}

◆  GetLastChild()

MAXON_METHOD HIERARCHY::template Child<Interface>::type GetLastChild ( const ConstDataPtr branchId = ConstDataPtr() ) const

Returns the last child of this object.

参数
[in] branchId The branch.
返回
Child object or nullptr if not available. @MAXON_ANNOTATION{interfaceParameter=Interface}

◆  GetChildAt()

MAXON_METHOD HIERARCHY::template Child<Interface>::type GetChildAt ( Int   position ,
const ConstDataPtr branchId = ConstDataPtr()  
) const

Returns the n'th child of this object.

参数
[in] position The child position.
[in] branchId The branch.
返回
Child object or nullptr if not available. @MAXON_ANNOTATION{interfaceParameter=Interface}

◆  GetChildren()

MAXON_METHOD Result < BaseArray <typename HIERARCHY::template Child<Interface>::type> > GetChildren ( const ConstDataPtr branchId = ConstDataPtr() ) const

Returns all children of the given hierarchy.

参数
[in] branchId The branch. @MAXON_ANNOTATION{interfaceParameter=Interface}

◆  GetBranches()

MAXON_METHOD Result < BaseArray < ConstDataPtr > > GetBranches ( ) const

Returns all branches of the given hierarchy.

◆  GetBranchId()

MAXON_METHOD ConstDataPtr GetBranchId ( ) const

Returns the branch the object belongs to.

◆  SetLocking()

MAXON_METHOD void SetLocking ( const Bool   locking )

Set the locking of an object. If the object is locked it cannot be removed or changed in the hierarchy.

◆  IsLocked()

MAXON_METHOD Bool IsLocked ( ) const

Get the locking of an object. If the object is locked it cannot be removed or changed in the hierarchy.

返回
True if locked.

◆  GetParent()

MAXON_METHOD HIERARCHY::template Parent<Interface>::type GetParent ( ) const

Returns the parent of this object. @MAXON_ANNOTATION{interfaceParameter=Interface}

◆  GetNext()

MAXON_METHOD HIERARCHY::template Sibling<Interface>::type GetNext ( ) const

Returns the next sibling of this object. @MAXON_ANNOTATION{interfaceParameter=Interface}

◆  GetPrev()

MAXON_METHOD HIERARCHY::template Sibling<Interface>::type GetPrev ( ) const

Returns the previous sibling of this object. @MAXON_ANNOTATION{interfaceParameter=Interface}

◆  GetFirst()

MAXON_METHOD HIERARCHY::template Sibling<Interface>::type GetFirst ( ) const

Returns the first sibling of this chain. If the object is already the first element the object is returned;

◆  GetLast()

MAXON_METHOD HIERARCHY::template Sibling<Interface>::type GetLast ( ) const

Returns the last sibling of this chain. If the object is already the first element the object is returned;

◆  ParentChanged()

MAXON_METHOD void ParentChanged ( Bool   removed )

Is invoked whenever the parent of this object changes. This method can be overridden when special actions have to be taken on such a change, for example the update of an underlying hierarchy which has to be kept in sync with this hierarchy.

This method must not be invoked by user code.

参数
[in] removed Flag if the object has been removed (true) or inserted (false).

◆  FindNextLeaf()

MAXON_METHOD std::add_pointer< HierarchyObjectInterface >::type FindNextLeaf ( const HierarchyObjectInterface stopAtParent ) const

◆  MAXON_OBSERVABLE() [1/2]

MAXON_OBSERVABLE ( Result < void >  ,
ObservableHierarchyInsert  ,
(const HierarchyObjectRef <> &sender, const HierarchyObjectRef <> &object, const ConstDataPtr &branchId)  ,
ObservableCombinerRunAllComponent   
)

ObservableHierarchyInsert is sent whenever an object was inserted in the hierarchy. 注意 : The children and siblings of the object are not sent as an observable!

参数
[in] sender Sender object.
[in] object HierarchyObject which was added.
[in] branchId The branch the object belongs to.

◆  MAXON_OBSERVABLE() [2/2]

MAXON_OBSERVABLE ( Result < void >  ,
ObservableHierarchyRemove  ,
(const HierarchyObjectRef <> &sender, const HierarchyObjectRef <> &object, const ConstDataPtr &branchId)  ,
ObservableCombinerRunAllComponent   
)

ObservableHierarchyRemove is sent whenever an object was removed from the hierarchy. 注意 : The children of the object are not sent as an observable!

参数
[in] sender Sender object.
[in] object HierarchyObject which was removed.
[in] branchId The branch the object belongs to.
IMAGE
IMAGE
Filename Image input, one DescID.
定义: lib_substance.h:235
MASK
MASK
New pixels overwrite the old ones at the bits where the mask specified by the parameter equals 1.
定义: lib_clipmap.h:5
LAYER
LAYER
Layer mode.
定义: lib_activeobjectmanager.h:19
maxon::MAXON_ENUM_LIST
struct maxon::ABIParamType MAXON_ENUM_LIST
maxon::IMAGEHIERARCHY
IMAGEHIERARCHY
used by ImageBaseInterface to add layers/alphas/images to the right sub tree in the hierarchy.
定义: gfx_image.h:106
MAX_ELEMENTS
MAX_ELEMENTS
定义: gfx_image.h:8
TEXTURE
TEXTURE
Root of everything. Must not be used with AddChildren.
定义: gfx_image.h:418
ALPHA
ALPHA
定义: lib_birender.h:42
maxon::IMAGEHIERARCHY::IMAGE
@ IMAGE
Adds a subImage to a texture. Images are only allowed under Textures.