Interface sandy.core.group.INode

Description

Method Index

addChild(), destroy(), dispose(), getChild(), getChildByName(), getChildList(), getId(), getParent(), hasParent(), isModified(), isParent(), remove(), removeChildById(), removeChildByName(), render(), setModified(), setParent()

Method Detail

getId

public function getId(Void):Number

Retuns the unique ID Number that represents the node. This value is very usefull to retrieve a specific Node. This method is FINAL, IT MUST NOT BE OVERLOADED.

Parameters

Void

Return

Number the node ID.

isParent

public function isParent(n:Node):Boolean

Say is the node is the parent of the current node.

Parameters

nThe Node you are going to test the patternity

Return

Boolean True is the node in argument if the father of the current one, false otherwise.

isModified

public function isModified(Void):Boolean

Allows you to know if this node has been modified (true value) or not (false value). Mainly usefull for the cache system.

Return

Boolean Value specifying the statut of the node. A true value means the node has been modified, it it should be rendered again

setModified

public function setModified(b:Boolean):Void

Allows you to set the modified property of the node.

Parameters

bBoolean true means the node is modified, and false the opposite.

setParent

public function setParent(n:Node):Boolean

Set the parent of a node

Parameters

Return

Boolean false is nothing has been done, true if the operation succeded

getParent

public function getParent(Void):Node

Returns the parent node reference

Parameters

Void

Return

Node The parent node reference, which is null if no parents (for exemple for a root object).

hasParent

public function hasParent(Void):Boolean

Allows the user to know if the current node have a parent or not.

Parameters

Void

Return

Boolean. True is the node has a parent, False otherwise

addChild

public function addChild(child:Node):Void

Add a new child to this group. a basicGroup can have several childs, and when you add a child to a group, the child is automatically conencted to it's parent thanks to its parent property.

Parameters

child

getChildList

public function getChildList(Void):Array

Returns all the childs of the current group in an array

Parameters

Void

Return

Array The array containing all the childs node of this group

getChildByName

public function getChildByName(pName:String):Node

getChild

public function getChild(index:Number):Node

Returns the child node at the specific index.

Parameters

indexNumber The ID of the child you want to get

Return

Node The desired Node

removeChildById

public function removeChildById(id:Number):Boolean

Remove the child given in arguments. Returns true if the node has been removed, and false otherwise. All the children of the node you want to remove are lost. The link between them and the rest of the tree is broken. They will not be rendered anymore! But the object itself and his children are still in memory! If you want to free them completely, use child.destroy();

Parameters

Return

Boolean True if the node has been removed from the list, false otherwise.

removeChildByName

public function removeChildByName(pName:String):Boolean

destroy

public function destroy(Void):Void

Delete all the childs of this node, and also the datas it is actually storing. Do a recurssive call to child's destroy method.

remove

public function remove(Void):Void

Remove the current node on the tree. It makes current node children the children of the current parent node. The interest of this paramater is that it allows you to update the World3D only once during your destroy/remove call!

render

public function render(Void):Void

dispose

public function dispose(Void):Void