Class TX3DRootNode
Unit
Declaration
type TX3DRootNode = class(TGroupNode)
Description
A top-level VRML/X3D node. This is what you get by loading 3D model from file.
It is declared as a descendant of VRML/X3D >= 2.0 Group node, but it's used with all VRML/X3D versions (including VRML 1.0 and Inventor). This makes things simple (previously we had two separate TX3DRootNode_1 and TX3DRootNode
, which was complicating stuff). Children (for all VRML/X3D versions) are inside FdChildren field.
This way VRML/X3D files may have many nodes at the top level (which is a standard feature of VRML/X3D >= 2.0, but we also allow it for VRML 1.0 as a commonly used extension). It may also have prototypes, routes etc. at the root level.
This also allows us to record in one place some information that is returned by the parser. Like parsed VRML/X3D version, X3D profile, some namespace information (exported names and such).
Hierarchy
- TObject
- TPersistent
- TX3DFileItem
- TX3DNode
- TAbstractNode
- TAbstractChildNode
- TAbstractInternalGroupingNode
- TAbstractGroupingNode
- TGroupNode
- TX3DRootNode
Overview
Fields
ForceVersion: TX3DVersion; |
Methods
function DeepCopyCore(CopyState: TX3DNodeDeepCopyState): TX3DNode; override; |
|
function SeparateGroup: boolean; override; |
|
constructor Create(const AX3DName: String = ''; const ABaseUrl: String = ''); override; |
|
destructor Destroy; override; |
|
function TransformationChange: TNodeTransformationChange; override; |
|
procedure SaveToStream(Writer: TX3DWriter); override; |
|
procedure ForceSaveAsX3D(const AMajor: Integer = 4; const AMinor: Integer = 0; const AProfile: string = 'Interchange'); |
|
procedure ExportNode(const Node: TX3DNode; const ExportedAlias: string); overload; |
|
procedure ExportNode(const Node: TX3DNode); overload; |
Properties
property SaveAsRootNode: boolean read FSaveAsRootNode write FSaveAsRootNode
default true; |
|
property HasForceVersion: boolean
read FHasForceVersion write FHasForceVersion default false; |
|
property Profile: string read FProfile write FProfile; |
|
property Components: TStringIntegerMap read FComponents; |
|
property Meta: TStringStringMap read FMeta; |
|
property PrototypeNames: TX3DPrototypeNames read FPrototypeNames; |
|
property ExportedNames: TX3DExportList read FExportedNames; |
|
property ImportedNames: TX3DNodeNames read FImportedNames; |
|
property Scale: Single read FScale write FScale default 1.0; |
Description
Fields
ForceVersion: TX3DVersion; |
|
This item has no description. |
Methods
function DeepCopyCore(CopyState: TX3DNodeDeepCopyState): TX3DNode; override; |
|
This item has no description. Showing description inherited from TX3DNode.DeepCopyCore. Does actual DeepCopy work. You can override this to copy some more properties for descendants. |
function SeparateGroup: boolean; override; |
|
Root node never saves/restores the traversing state. This means that all state changes "leak out" from a root node. This is a good thing: if root node isn't used as a final TCastleSceneCore.RootNode, then it is placed inside Inline node, which will do save/restore anyway. And this way VRML 1.0 WWWInline with separate=FALSE may also work too. |
constructor Create(const AX3DName: String = ''; const ABaseUrl: String = ''); override; |
|
This item has no description. Showing description inherited from TX3DNode.Create. Constructor. Initializes various properties:
|
destructor Destroy; override; |
|
This item has no description. |
function TransformationChange: TNodeTransformationChange; override; |
|
This item has no description. |
procedure SaveToStream(Writer: TX3DWriter); override; |
|
Save contents to the stream. If SaveAsRootNode then this is saved in a special way, such that only the contents are written, without surrounding braces (for classic encoding) or XML element (for xml encoding). This way, when saving, we hide the fact that everything was wrapped in an artificial TX3DRootNode. |
procedure ForceSaveAsX3D(const AMajor: Integer = 4; const AMinor: Integer = 0; const AProfile: string = 'Interchange'); |
|
Set properties to force saving this node graph as X3D. If we're already configured to save as X3D (current major version >= 3) then do nothing. Otherwise, sets major/minor versions (by default: for X3D 4.0, Interchange profile). Provided AMajor must be >= 3, since X3D version is always >= 3. This works to indicate convert VRML 2.0 to X3D. We simply change ForceVersion used to save to indicate X3D version. This is a reasonable conversion of VRML 2 -> X3D (except NURBS nodes, which are incompatible between VRML 2.0 and X3D and at this point not dealt by this conversion correctly). This should not be used if the original file version indicates that it's an old VRML 1.0 or Inventor file, as we have not implemented convertion from VRML 1.0/Inventor to X3D. So it wil result in VRML 1.0/Inventor nodes saved using the X3D (XML or classic) encoding, which is not a format supported by any X3D reader (even our own). We will display a warning if you attempt this. |
procedure ExportNode(const Node: TX3DNode; const ExportedAlias: string); overload; |
|
Export node, to have its name known by X3D graph that includes this graph by "Inline" node. Use this if you build X3D graph by hand, and you want do add the EXPORT X3D clause. It adds the clause (using AddExport, so it can be saved back to X3D file reliably) and also makes it immediately working (adding it to the proper namespace). |
procedure ExportNode(const Node: TX3DNode); overload; |
|
This item has no description. |
Properties
property SaveAsRootNode: boolean read FSaveAsRootNode write FSaveAsRootNode
default true; |
|
Should SaveToStream take care to nicely save us, treating as a root node of whole VRML file or prototype. If this node isn't a root node, you should set this to |
property HasForceVersion: boolean
read FHasForceVersion write FHasForceVersion default false; |
|
Set |
property Components: TStringIntegerMap read FComponents; |
|
|
property Meta: TStringStringMap read FMeta; |
|
Meta keys and values of this X3D file. Relevant if this node is the root of X3D file. |
property PrototypeNames: TX3DPrototypeNames read FPrototypeNames; |
|
Global prototype namespace at the end of parsing the file. Useful for things like EXTERNPROTO implementation. |
property ExportedNames: TX3DExportList read FExportedNames; |
|
Node names exported from the file by EXPORT keyword. Useful for importing them later, to handle IMPORT/EXPORT X3D mechanism. |
property ImportedNames: TX3DNodeNames read FImportedNames; |
|
Node names imported into this file by the IMPORT keyword. You may want to take this into account when searching nodes by name, this allows the user to rename nodes from Inlined files. |
Generated by PasDoc 0.16.0-snapshot.