Class TX3DExport

Unit

Declaration

type TX3DExport = class(TX3DFileItem)

Description

X3D export statement, allowing to access something from this model namespace in outer model namespace using TX3DImport.

Source: scene/x3d/x3dnodes_importexport.inc (line 38).

Hierarchy

Show Additional Members:

Overview

Fields

Public ExportedAlias: String;

Methods

Public constructor Create;
Public function SaveToXml: TSaveToXmlMethod; virtual;
Public destructor Destroy; override;
Public procedure Parse(Lexer: TX3DLexer; Reader: TX3DReaderNames);
Public procedure ParseXML(Element: TDOMElement; Reader: TX3DReaderNames);
Public procedure SaveToStream(Writer: TX3DWriter); override;
Public function DeepCopy(const CopyState: TX3DNodeDeepCopyState): TX3DExport;

Properties

Public property PositionInParent: Integer read FPositionInParent write FPositionInParent default -1;
Public property ExportedNode: TX3DNode read FExportedNode write SetExportedNode;

Description

Fields

Public ExportedAlias: String;

Name under which the EXPORTed node is available in outer files, i.e. IMPORT statements should refer to this alias. If empty, just use ExportedNode.X3DName.

Source: scene/x3d/x3dnodes_importexport.inc (line 47).

Methods

Public constructor Create;

This item is declared in ancestor TX3DFileItem.

This item has no description.

Source: scene/x3d/castlefields_x3dfileitem.inc (line 42).

Public function SaveToXml: TSaveToXmlMethod; virtual;

This item is declared in ancestor TX3DFileItem.

How is this saved to X3D XML encoding. This determines when SaveToStream is called. It also cooperates with some SaveToStream implementations, guiding how the item is actually saved. By default it is sxChildElement.

Source: scene/x3d/castlefields_x3dfileitem.inc (line 81).

Public destructor Destroy; override;

This item has no description.

Source: scene/x3d/x3dnodes_importexport.inc (line 49).

Public procedure Parse(Lexer: TX3DLexer; Reader: TX3DReaderNames);

This item has no description.

Source: scene/x3d/x3dnodes_importexport.inc (line 70).

Public procedure ParseXML(Element: TDOMElement; Reader: TX3DReaderNames);

Parse the EXPORT declaration (XML encoding). Given Element here must have TagName = 'EXPORT'.

Source: scene/x3d/x3dnodes_importexport.inc (line 74).

Public procedure SaveToStream(Writer: TX3DWriter); override;

This item has no description. Showing description inherited from TX3DFileItem.SaveToStream.

Save to stream.

Source: scene/x3d/x3dnodes_importexport.inc (line 76).

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

This item has no description.

Source: scene/x3d/x3dnodes_importexport.inc (line 77).

Properties

Public property PositionInParent: Integer read FPositionInParent write FPositionInParent default -1;

This item is declared in ancestor TX3DFileItem.

Position of this item within parent VRML/X3D node, used for saving the VRML/X3D graph to file. Default value -1 means "undefined".

For normal usage and processing of VRML graph, this is totally not needed. This position doesn't dictate actual meaning of VRML graph. If you're looking to change order of nodes, you probably want to rather look at something like ReplaceItems within TMFNode or such.

This field is purely a hint when encoding VRML file how to order VRML items (nodes, fields, routes, protos) within parent node or the VRML file. Reason: VRML allows non-unique node names. Each DEF XXX overrides all previous ("previous" in lexical sense, i.e. normal order of tokens in the file) DEF XXX with the same XXX, thus hiding previous node name "XXX". This means that when saving VRML file we have to be very careful about the order of items, such that e.g. all routes are specified when appropriate node names are bound.

This is a relative position, relative to other PositionInParent value of other TX3DFileItem items. So it's not necessary to keep all PositionInParent different or successive within some parent. When saving, we will sort everything according to PositionInParent.

See e.g. ../../../demo_models/x3d/tricky_def_use.x3dv for tests of some tricky layout. When reading such file we have to record PositionInParent to be able to save such file correctly.

Source: scene/x3d/castlefields_x3dfileitem.inc (line 71).

Public property ExportedNode: TX3DNode read FExportedNode write SetExportedNode;

Exported node. Note that we store node reference, not just ExportedNodeName, this way renaming the ExportedNode (e.g. by RenameUniquely during saving) is properly reflected in the saved EXPORT statement.

All code handling this should be prepared that this may be Nil.

Even though the current reading code always initializes this to non-nil... but if that node will be later freed -> then this will be set to nil (thanks to using TX3DNode.AddDestructionNotification mechanism here).

Testcase: https://github.com/castle-engine/castle-engine/issues/708 , which links to glTF model with unused material (TAppearanceNode), that is exported but later freed by X3DNodeList_FreeUnusedAndNil. We could avoid adding it in that case (checking Unused), but all code has to be prepared anyway for TX3DExport.ExportedNode = Nil.

Source: scene/x3d/x3dnodes_importexport.inc (line 68).


Generated by PasDoc 0.17.0.snapshot.