Class TX3DFieldOrEvent
Unit
Declaration
type TX3DFieldOrEvent = class(TX3DFileItem)
Description
Base class for VRML/X3D field or event.
Hierarchy
- TObject
- TPersistent
- TX3DFileItem
- TX3DFieldOrEvent
Overview
Methods
constructor Create(const AParentNode: TX3DFileItem; const AX3DName: string); |
|
destructor Destroy; override; |
|
function IsClauseNamesCount: Integer; |
|
procedure IsClauseNamesAssign(const SourceIsClauseNames: TCastleStringList); |
|
procedure IsClauseNamesAdd(const S: string); |
|
procedure ParseIsClause(Lexer: TX3DLexer); |
|
procedure AddAlternativeName(const AlternativeName: string; const X3DMajorVersion: Integer); virtual; |
|
procedure RemoveAlternativeName(const X3DMajorVersion: Integer); |
|
function IsName(const S: string): boolean; |
|
function NameForVersion(Version: TX3DVersion): string; overload; |
|
function NameForVersion(Writer: TX3DWriter): string; overload; |
|
function NiceName: string; |
|
procedure SaveToStreamClassicIsClauses(Writer: TX3DWriter); |
Properties
property X3DName: string read FX3DName; |
|
property Name: string read FX3DName; deprecated 'use X3DName'; |
|
property ParentNode: TX3DFileItem read FParentNode write FParentNode; |
|
property IsClauseNames[constIndex:Integer]: string read GetIsClauseNames; |
|
property ParentInterfaceDeclaration: TX3DFileItem
read FParentInterfaceDeclaration write FParentInterfaceDeclaration; |
Description
Methods
constructor Create(const AParentNode: TX3DFileItem; const AX3DName: string); |
|
destructor Destroy; override; |
|
function IsClauseNamesCount: Integer; |
|
procedure IsClauseNamesAssign(const SourceIsClauseNames: TCastleStringList); |
|
procedure IsClauseNamesAdd(const S: string); |
|
procedure ParseIsClause(Lexer: TX3DLexer); |
|
Parse only "IS" clause, if it's not present — don't do nothing. For example, for the TX3DField descendant, this does not try to parse field value. |
procedure AddAlternativeName(const AlternativeName: string; const X3DMajorVersion: Integer); virtual; |
|
Add alternative name for the same field/event, to be used in different VRML version. When VRML major version is exactly equal X3DMajorVersion, the AlternativeName should be used — for both reading and writing of this field/event. In some cases, when reading, we may also allow all versions (both original and alternative), but this is mostly for implementation simplicity — don't count on it. A special value 0 for X3DMajorVersion means that this is just an alternative name, that should be allowed when reading (as alternative to normal Name), and never used when writing. Alternative names is a very handy mechanism for cases when the only thing that changed between VRML versions is the field name. Example: Switch node's children/choice, LOD node's children/level, Polyline2D lineSegments/point. Note that this also works for ExposedEvents with exposed TX3DField: if a field has alternative names, then it's exposed events always also have appropriate alternative names. |
procedure RemoveAlternativeName(const X3DMajorVersion: Integer); |
|
function IsName(const S: string): boolean; |
|
Returns if S matches current Name or one of the alternative names. Think about it like simple test "Name = S", but actually this checks also names added by AddAlternativeName method. |
function NameForVersion(Version: TX3DVersion): string; overload; |
|
Return how this field should be named for given VRML version. In almost all cases, this simply returns current Name. But it can also return a name added by AddAlternativeName method. |
function NameForVersion(Writer: TX3DWriter): string; overload; |
|
function NiceName: string; |
|
Nice and concise field description for user. Describes parent node type, name and field/event's name. |
procedure SaveToStreamClassicIsClauses(Writer: TX3DWriter); |
|
Save IS clauses to stream, only for classic encoding. For each IS clause, writeln field/event name followed by "IS" clause. |
Properties
property X3DName: string read FX3DName; |
|
Name of the field or event. Most fields/events are inside some X3D node, and then they have a non-empty name. But in some special cases we also use temporary fields with an empty name. Note that you cannot change this after object creation, since Name is used for various purposes (like to generate names for TX3DField.ExposedEvents). Note that this property is deliberately not called |
property Name: string read FX3DName; deprecated 'use X3DName'; |
|
Warning: this symbol is deprecated: use X3DName |
property ParentNode: TX3DFileItem read FParentNode write FParentNode; |
|
X3D node containing this field/event. This must always contain an instance of TX3DNode class (although it cannot be declared such, since X3DFields unit cannot depend on X3DNodes interface). It may be |
property IsClauseNames[constIndex:Integer]: string read GetIsClauseNames; |
|
"IS" clauses of this field/event, used when this field/event is inside prototype definition. This is an array, as one item may have many "IS" clauses (for a field, only one "IS" clause should refer to another field; but you can have many "IS" clauses connecting events, also exposedField may have "IS" clause that should be interpreted actually as links to it's exposed events). See e.g. Note that having "IS" clauses doesn't mean that the field should be considered "without any value". This is not a good way of thinking, as an exposed field may have an "IS" clause, but linking it to an event, and thus such field has it's value (default value, if not specified in the file), event though it also has an "IS" clause. Although there is TX3DField.ValueFromIsClause, which indicates whether current value was obtained from "IS" clause. To be able to significantly optimize memory, we do not expose |
property ParentInterfaceDeclaration: TX3DFileItem
read FParentInterfaceDeclaration write FParentInterfaceDeclaration; |
|
For fields contained in TX3DInterfaceDeclaration. This should always be |
Generated by PasDoc 0.16.0.