Class TSFNode

DescriptionHierarchyFieldsMethodsProperties

Unit

Declaration

type TSFNode = class(TVRMLSingleField)

Description

SFNode VRML field. It's defined in this unit, not in VRMLFields, since it uses TVRMLNode definition. NULL value of the field is indicated by Value field = nil. This field has always the same default value: NULL.

Note that we store AllowedChildren list, which is a list of classes allowed as a Value (also nil is always allowed). But this is used only to produce warnings for a user. You should never assert that Value actually is one the requested classes. We want to keep here even not allowed items, because we want operation "read from VRML file + write to VRML file" to be as non-destructible as possible. So if user wrote invalid class hierarchy, we will output this invalid class hierarchy.

Hierarchy

Overview

Methods

Protected procedure SaveToStreamValue(SaveProperties: TVRMLSaveToStreamProperties); override;
Public constructor CreateUndefined(const AName: string); override;
Public constructor Create(AParentNode: TVRMLNode; const AName: string; const AnAllowedChildren: array of TVRMLNodeClass); overload;
Public constructor Create(AParentNode: TVRMLNode; const AName: string; AnAllowedChildren: TVRMLNodeClassesList); overload;
Public destructor Destroy; override;
Public procedure Parse(Lexer: TVRMLLexer; IsClauseAllowed: boolean); override;
Public function EqualsDefaultValue: boolean; override;
Public function Equals(SecondValue: TVRMLField; const EqualityEpsilon: Single): boolean; override;
Public procedure Assign(Source: TPersistent); override;
Public procedure AssignValue(Source: TVRMLField); override;
Public class function VRMLTypeName: string; override;

Properties

Public property AllowedChildrenAll: boolean read FAllowedChildrenAll write FAllowedChildrenAll;
Public property Value: TVRMLNode read FValue write SetValue;
Public property ParentNode: TVRMLNode read FParentNode;

Description

Methods

Protected procedure SaveToStreamValue(SaveProperties: TVRMLSaveToStreamProperties); override;
 
Public constructor CreateUndefined(const AName: string); override;
 
Public constructor Create(AParentNode: TVRMLNode; const AName: string; const AnAllowedChildren: array of TVRMLNodeClass); overload;
 
Public constructor Create(AParentNode: TVRMLNode; const AName: string; AnAllowedChildren: TVRMLNodeClassesList); overload;

Constructor that takes AnAllowedChildren as TVRMNodeClassesList. Note that we copy the contents of AnAllowedChildren, not the reference.

Public destructor Destroy; override;
 
Public procedure Parse(Lexer: TVRMLLexer; IsClauseAllowed: boolean); override;
 
Public function EqualsDefaultValue: boolean; override;
 
Public function Equals(SecondValue: TVRMLField; const EqualityEpsilon: Single): boolean; override;
 
Public procedure Assign(Source: TPersistent); override;
 
Public procedure AssignValue(Source: TVRMLField); override;
 
Public class function VRMLTypeName: string; override;
 

Properties

Public property AllowedChildrenAll: boolean read FAllowedChildrenAll write FAllowedChildrenAll;

This says that all children are allowed, regardless of AllowedChildren value.

CreateUndefined creates always object with AllowedChildrenAll = True (otherwise AllowedChildren list is empty and nothing would be allowed; but for e.g. fields in instantiated prototypes, we must initially just allow all, otherwise valid prototypes with SFNode/MFNode would cause warnings when parsing).

Other constructors set AllowedChildren to something meaningful and set this to False. You can change this to True then if you consciously want to turn this check off.

Public property Value: TVRMLNode read FValue write SetValue;
 
Public property ParentNode: TVRMLNode read FParentNode;
 

Generated by PasDoc 0.10.0 on 2008-02-25 00:00:42