Class TX3DRoute
Unit
Declaration
type TX3DRoute = class(TX3DFileItem)
Description
Route makes a connection between two X3D events, making the destination event occur when the source event happened.
Hierarchy
- TObject
- TPersistent
- TX3DFileItem
- TX3DRoute
Overview
Methods
constructor Create; |
|
destructor Destroy; override; |
|
procedure SetSource( const SourceNodeName, SourceFieldOrEventName: string; Reader: TX3DReaderNames); |
|
procedure SetDestination( const DestinationNodeName, DestinationFieldOrEventName: string; Reader: TX3DReaderNames); |
|
procedure SetSourceDirectly( const NewNode: TX3DNode; const FieldOrEvent: TX3DFieldOrEvent); overload; |
|
procedure SetDestinationDirectly( const NewNode: TX3DNode; const FieldOrEvent: TX3DFieldOrEvent); overload; |
|
procedure SetSourceDirectly(const FieldOrEvent: TX3DFieldOrEvent); overload; |
|
procedure SetDestinationDirectly(const FieldOrEvent: TX3DFieldOrEvent); overload; |
|
procedure Parse(Lexer: TX3DLexer; Reader: TX3DReaderNames); |
|
procedure ParseXML(Element: TDOMElement; Reader: TX3DReaderNames); |
|
procedure SaveToStream(Writer: TX3DWriter); override; |
|
procedure ResetLastEventTime; |
|
function DeepCopy(const CopyState: TX3DNodeDeepCopyState): TX3DRoute; |
Properties
property SourceNode: TX3DNode read FSourceNode; |
|
property SourceEvent: TX3DEvent read FSourceEvent; |
|
property DestinationNode: TX3DNode read FDestinationNode; |
|
property DestinationEvent: TX3DEvent read FDestinationEvent; |
|
property Internal: boolean read FInternal write FInternal default false; |
Description
Methods
constructor Create; |
|
destructor Destroy; override; |
|
procedure SetSource( const SourceNodeName, SourceFieldOrEventName: string; Reader: TX3DReaderNames); |
|
Set source/destination of the route. This does everything that VRML parser should do when parsed VRML route. It looks for given node name (in Names.Nodes, then Names.Imported), then it looks for field/event within this node, and if everything is successful — sets route properties. If something goes wrong, WritelnWarning is generated and route ending is left unset. |
procedure SetDestination( const DestinationNodeName, DestinationFieldOrEventName: string; Reader: TX3DReaderNames); |
|
procedure SetSourceDirectly( const NewNode: TX3DNode; const FieldOrEvent: TX3DFieldOrEvent); overload; |
|
These set source/destination of the route in more direct way. FieldOrEvent is used to set SourceEvent (or DestinationEvent). FieldOrEvent may be the actual event to set, or exposed field containing this event. You specify explictly NewNode, which is not checked in any way. We don't check whether it exists, whether it contains given FieldOrEvent, etc. — you have to guarantee this yourself. Also, remember that normal SetSource actually look for events inside PrototypeInstanceSourceNode, if exists — if you want this, you have to do this yourself when using these SetXxxDirectly. It is used to set SourceNode (or DestinationNode). Overloaded versions that don't take NewNode parameter just assume that NewNode can be taken from FieldOrEvent.ParentNode. |
procedure SetDestinationDirectly( const NewNode: TX3DNode; const FieldOrEvent: TX3DFieldOrEvent); overload; |
|
procedure SetSourceDirectly(const FieldOrEvent: TX3DFieldOrEvent); overload; |
|
procedure SetDestinationDirectly(const FieldOrEvent: TX3DFieldOrEvent); overload; |
|
procedure Parse(Lexer: TX3DLexer; Reader: TX3DReaderNames); |
|
Parse the route (classic VRML encoding). Implementation should be able to safely assume that current token is ROUTE. |
procedure ParseXML(Element: TDOMElement; Reader: TX3DReaderNames); |
|
Parse the route (XML encoding). Given Element here must have TagName = 'ROUTE'. |
procedure SaveToStream(Writer: TX3DWriter); override; |
|
Save a ROUTE to VRML file. Will generate WritelnWarning when route cannot be saved. This can happen when SourceNode or SourceEvent or DestinationNode or DestinationEvent are |
procedure ResetLastEventTime; |
|
Clear the memory when the last event passed through this route. Route must remember such thing, to avoid loops in routes. This is following VRML 2.0 / X3D specifications, that explicitly say that only one event per ROUTE per timestamp is allowed. Use |
function DeepCopy(const CopyState: TX3DNodeDeepCopyState): TX3DRoute; |
|
Properties
property SourceNode: TX3DNode read FSourceNode; |
|
Source event properties. Either all three are
|
property SourceEvent: TX3DEvent read FSourceEvent; |
|
property DestinationNode: TX3DNode read FDestinationNode; |
|
Destination event properties. Analogous to SourceEvent, SourceNode. |
property DestinationEvent: TX3DEvent read FDestinationEvent; |
|
property Internal: boolean read FInternal write FInternal default false; |
|
Internal routes are created by PROTO expansion code, which needs to create internal routes to implement "IS" clauses for events. These routes work exactly like normal routes, except:
|
Generated by PasDoc 0.16.0.