Class TX3DNodeNames

Unit

Declaration

type TX3DNodeNames = class(specialize TStructList<TX3DNodeNameRec>)

Description

List to track node names while parsing VRML/X3D file.

Hierarchy

Overview

Methods

Public constructor Create(const AAutoRemove: boolean);
Public destructor Destroy; override;
Public procedure Bind(const Node: TX3DNode; const NodeFinished: boolean); overload;
Public procedure Bind(const Node: TX3DNode; const NodeFinished: boolean; const BindToName: string); overload;
Public function Bound(const Name: string; out NodeFinished: boolean): TX3DNode; overload;
Public function NodeDuringReading(const Node: TX3DNode): Boolean;
Public function Bound(Node: TX3DNode): boolean; overload;
Public function DeepCopy(const CopyState: TX3DNodeDeepCopyState): TX3DNodeNames;

Properties

Public property AutoRemove: boolean read FAutoRemove;

Description

Methods

Public constructor Create(const AAutoRemove: boolean);
 
Public destructor Destroy; override;
 
Public procedure Bind(const Node: TX3DNode; const NodeFinished: boolean); overload;

Associate given node with it's own name.

If not NodeFinished, then we understand that we're parsing / saving the node's contents now. If NodeFinished, then we know the node contents are fully parsed / saved now. This information helps us to detect cycles in X3D DEF/USE graph. For now, we just disallow such cycles. Still, we allow ROUTEs from inside the node, so calling with NodeFinished = false is still useful for parsing.

Public procedure Bind(const Node: TX3DNode; const NodeFinished: boolean; const BindToName: string); overload;
 
Public function Bound(const Name: string; out NodeFinished: boolean): TX3DNode; overload;

Find node bound to given name. Nil if none.

Public function NodeDuringReading(const Node: TX3DNode): Boolean;

Node is during reading, judging from Bind calls with NodeFinished=False (when node reading starts) and with NodeFinished=True (when node reading finishes).

Public function Bound(Node: TX3DNode): boolean; overload;

Check is Node bound in the current namespace. False means that node is not within this namespace, possibly it's name was hidden by other node with the same name.

Doesn't check is Node bound to it's name (Node.Name) or something else. So this assumes that node can only be bound (if at all) only to it's own name, which is true during parsing (when nothing can change in the middle of parsing).

Public function DeepCopy(const CopyState: TX3DNodeDeepCopyState): TX3DNodeNames;
 

Properties

Public property AutoRemove: boolean read FAutoRemove;

If True (determined at construction time), then destroyed nodes will be automatically removed from this list. This allows you to safely destroy node instances during this objects lifetime, without worrying that some dangling pointers remain on this list.

Internally, this is done by registering itself for AnyNodeDestructionNotifications.


Generated by PasDoc 0.16.0.