Castle Game Engine: X3DNodes: Class TX3DRootNode

# Class TX3DRootNode
Description | Hierarchy | Fields | Methods | Properties
## Unit X3DNodes ## 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 TPersistent TNonRefCountedInterfacedPersistent TX3DFileItem TX3DNode TAbstractNode TAbstractChildNode TAbstractGroupingNode TAbstractX3DGroupingNode TGroupNode TX3DRootNode ## Overview ### Fields
| `ForceVersion: TX3DVersion;`
### Methods
| `function DeepCopyCore(CopyState: TX3DNodeDeepCopyState): TX3DNode; override;`
| `function SeparateGroup: boolean; override;`
| `procedure ApplyTransform(State: TX3DGraphTraverseState); override;`
| `procedure CreateNode; override;`
| `destructor Destroy; override;`
| `procedure SaveToStream(Writer: TX3DWriter); override;`
| `procedure ForceSaveAsX3D(const AMajor: Integer = 3; const AMinor: Integer = 2; const AProfile: string = 'Interchange');`
### 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: TStringLongIntMap read FComponents;`
| `property Meta: TStringStringMap read FMeta;`
| `property PrototypeNames: TX3DPrototypeNames read FPrototypeNames;`
| `property ExportedNames: TX3DNodeNames read FExportedNames;`
| `property Scale: Single read FScale write FScale default 1.0;`
## Description ### Fields
| `ForceVersion: TX3DVersion;`
### Methods
| `function DeepCopyCore(CopyState: TX3DNodeDeepCopyState): TX3DNode; override;`
| `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.
| `procedure ApplyTransform(State: TX3DGraphTraverseState); override;`
| `procedure CreateNode; override;`
| `destructor Destroy; override;`
| `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 = 3; const AMinor: Integer = 2; const AProfile: string = 'Interchange');`
Set properties to force saving this node graph as X3D. If we're already configured to save as X3D (major version >= 3) then do nothing. Otherwise, sets major/minor versions (by default: for X3D 3.2; make sure AMajor is >= 3) and sets X3D profile (default: Interchange).
### 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 `False` (or saving this node may generate dumb contents). Although, generally, you should avoid using the TX3DRootNode class at all for non-root nodes.
| `property HasForceVersion: boolean read FHasForceVersion write FHasForceVersion default false;`
Set `HasForceVersion` to `True` to force saving this model with given ForceVersion.
| `property Profile: string read FProfile write FProfile;`
Profile required for this X3D file. See X3D spec about profiles. Every X3D file must always define a profile. (However, we use this class also for VRML 1.0 and 2.0 root nodes, where profile is empty.) Relevant only if this node is the root of X3D file.
| `property Components: TStringLongIntMap read FComponents;`
`Components` and levels required for this X3D file. Relevant if this node is the root of X3D file.
| `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: TX3DNodeNames read FExportedNames;`
Node names exported from the file by EXPORT keyword. Useful for importing them later, to handle IMPORT/EXPORT X3D mechanism.
| `property Scale: Single read FScale write FScale default 1.0;`
Scale of the model. When loading, this is set to honor `"UNIT length ..."` declaration in X3D 3.3. It scales model such that 1 unit = 1 meter. When one model is inlined inside another (e.g. using X3D Inline node), this is adjusted to the existing scale of the outer model (always to make the resulting complete node graph keep the assumption 1 unit = 1 meter).
Generated by PasDoc 0.13.0 on 2015-06-15 04:43:14