Class TNodesManager

Unit

Declaration

type TNodesManager = class(TObject)

Description

Manages X3D non-abstract node classes, that can be used in X3D files. Use only through a singleton NodesManager.

Hierarchy

  • TObject
  • TNodesManager

Overview

Methods

Public constructor Create;
Public destructor Destroy; override;
Public procedure RegisterNodeClass(NodeClass: TX3DNodeClass);
Public procedure RegisterNodeClasses(const NodeClasses: array of TX3DNodeClass);
Public procedure UnRegisterNodeClass(NodeClass: TX3DNodeClass; ErrorIfNotRegistered: boolean = true);
Public function X3DTypeToClass(const AX3DType: string; const Version: TX3DVersion): TX3DNodeClass;
Public function URNToClass(const URN: string; const Version: TX3DVersion): TX3DNodeClass;
Public function RegisteredCount: Cardinal;

Properties

Public property Registered [Index: Integer]: TX3DNodeClass read GetRegistered;

Description

Methods

Public constructor Create;

This item has no description.

Public destructor Destroy; override;

This item has no description.

Public procedure RegisterNodeClass(NodeClass: TX3DNodeClass);

Make the given node class known to the parser and other routines. We associate the node class with it's TX3DNode.ClassX3DType (make sure it's not empty).

It is OK to register two different node classes with the same node. For example, VRML 1.0 TConeNode_1 class and VRML 2.0/X3D TConeNode_2 class both have a name 'Cone' (and will be correctly chosen during parsing). But you cannot register two times the same NodeClass.

Public procedure RegisterNodeClasses(const NodeClasses: array of TX3DNodeClass);

This item has no description.

Public procedure UnRegisterNodeClass(NodeClass: TX3DNodeClass; ErrorIfNotRegistered: boolean = true);

Unregisters given node class, removing it from our table.

Exceptions raised
ENodesManagerError
if NodeClass.ClassX3DType = '' (so it cannot be even registered), or if ((NodeClass was not registered) and ErrorIfNotRegistered)
Public function X3DTypeToClass(const AX3DType: string; const Version: TX3DVersion): TX3DNodeClass;

Return node class for a given name. This method is the main purpose of TNodesManager: to map node names into node classes.

Searches in nodes registered by RegisterNodeClass and such. During searching, looks not only for matching node name, but also at matching VRML/X3D version, checking ForVRMLVersion(Version).

Returns Nil when not found.

Public function URNToClass(const URN: string; const Version: TX3DVersion): TX3DNodeClass;

Return class that matches given URL. This is useful for EXTERNROTOs. Checks also ForVRMLVersion(Version). Returns Nil if not found.

Public function RegisteredCount: Cardinal;

This item has no description.

Properties

Public property Registered [Index: Integer]: TX3DNodeClass read GetRegistered;

Enumerate all registered classes, from Registered[0] to Registered[RegisteredCount - 1].


Generated by PasDoc 0.16.0-snapshot.