Class TX3DNodeList

Unit

Declaration

type TX3DNodeList = class(specialize TObjectList<TX3DNode>)

Description

List of TX3DNode.

Hierarchy

  • TObject
  • TList
  • TObjectList
  • TX3DNodeList

Overview

Methods

Protected procedure Notify( constref Value: TX3DNode; Action: TCollectionNotification); override;
Public function FindName(const Name: string): TX3DNode;
Public function IndexOfName(const Name: string): Integer;
Public procedure AddIfNotExists(const Node: TX3DNode);
Public function Equals(SecondValue: TObject): Boolean; override;
Public procedure Assign(const Source: TX3DNodeList); overload;
Public procedure Assign(const Source: array of TX3DNode); overload;

Properties

Public property AutoRemove: Boolean read FAutoRemove write SetAutoRemove default false;

Description

Methods

Protected procedure Notify( constref Value: TX3DNode; Action: TCollectionNotification); override;

This item has no description.

Public function FindName(const Name: string): TX3DNode;

Find node by name (TX3DNode.X3DName), Nil if not found.

If called with Name = '', always returns Nil (does not search for node with MyNode.X3DName = '' condition). This follows the meaning of TX3DNode.X3DName: empty means that node has no name, so it should not be found when searching by name, ever.

See also
Returns the node index. This is sometimes more flexible (you can always quickly get actual node knowing the index, by Items[Index], but not the other way around). It is also sometimes less comfortable (often you're not interested in node index).
Find index of a node with given name (TX3DNode.X3DName), -1 if not found.
Public function IndexOfName(const Name: string): Integer;

Find index of a node with given name (TX3DNode.X3DName), -1 if not found.

Consistently with FindName, always returns -1 when Name = ''.

Public procedure AddIfNotExists(const Node: TX3DNode);

Add node only if it's not already on the list.

Public function Equals(SecondValue: TObject): Boolean; override;

Does the SecondValue list has equal length and instances. The instances on the list are compared exactly, i.e. reference must match, not only some node properties.

Public procedure Assign(const Source: TX3DNodeList); overload;

Assign from Source. Equivalent to Clear and then AddRange(Source).

Public procedure Assign(const Source: array of TX3DNode); overload;

Assign from Source. Equivalent to Clear and then AddRange(Source).

Properties

Public property AutoRemove: Boolean read FAutoRemove write SetAutoRemove default false;

If True then destroyed nodes will be automatically removed from this list. This allows you to safely destroy node instances during the lifetime of this list, without worrying that some dangling pointers remain on this list.

You can only change this property when the list is empty. Otherwise we could have a weird situation when some nodes are automatically removed from the list, and some are not, which seems counter-intuitive.

Internally, this is done using TX3DNode.AddDestructionNotification.


Generated by PasDoc 0.16.0-snapshot.