Class TCastleIfcMapping

Unit

Declaration

type TCastleIfcMapping = class(TObject)

Description

Maintains mapping between IFC concepts and X3D nodes. Allows to comfortably load IFC file and convert it to X3D multple times (using Load, Update, RootNode). Allows also to resolve X3D nodes back to IFC concepts (using NodeToProduct).

Source: src/scene/load/ifc/castleifc_load_to_x3d.inc (line 26).

Hierarchy

  • TObject
  • TCastleIfcMapping

Overview

Methods

Public constructor Create;
Public destructor Destroy; override;
Public procedure Load(const Ifc: TIfcFile; const ABaseUrl: String);
Public procedure Update(const Ifc: TIfcFile);
Public function NodeToProduct(const Node: TAbstractShapeNode): TIfcProduct;
Public function ProductToNodes(const Product: TIfcProduct): TX3DNodeList;
Public procedure ShowDebugShapes(const Show: Boolean);

Properties

Public property RootNode: TX3DRootNode read FRootNode;
Public property OwnsRootNode: Boolean read FOwnsRootNode write FOwnsRootNode default false;
Public property OptimizeAssumingOneMapping: Boolean read FOptimizeAssumingOneMapping write SetOptimizeAssumingOneMapping;

Description

Methods

Public constructor Create;

This item has no description.

Source: src/scene/load/ifc/castleifc_load_to_x3d.inc (line 109).

Public destructor Destroy; override;

This item has no description.

Source: src/scene/load/ifc/castleifc_load_to_x3d.inc (line 110).

Public procedure Load(const Ifc: TIfcFile; const ABaseUrl: String);

Load IFC instance (TIfcFile) converting it to a new X3D node (available in RootNode).

The BaseUrl will be used to resolve relative URLs, e.g. texture URLs mentioned in IFC information.

If OwnsRootNode = False (which is the default state), then after calling this (and before destroying this class or calling Load again) remember to free the resulting RootNode. It is not freed automatically by this class (OwnsRootNode = False by default) because in most practical use-cases, you want to keep the X3D node around, e.g. to be owned by TCastleScene or freed manually later.

Source: src/scene/load/ifc/castleifc_load_to_x3d.inc (line 125).

Public procedure Update(const Ifc: TIfcFile);

Update the nodes in RootNode based on the new IFC contents. Call this only after calling Load once.

Tries to be efficient and do as little work as possible and update X3D graph in RootNode to reflect the new IFC contents. For example, changing a translation in IFC will just change the corresponding TTransformNode.Translation, without recreating any X3D nodes.

Source: src/scene/load/ifc/castleifc_load_to_x3d.inc (line 145).

Public function NodeToProduct(const Node: TAbstractShapeNode): TIfcProduct;

For a shape node (TAbstractShapeNode), return the corresponding IFC product (TIfcProduct descendant, like a TIfcWall, TIfcWindow, TIfcDoor). Returns Nil if cannot be determined. Assumes that the nodes have been updated to reflect the latest state of the IFC classes using Update.

See also
ProductToNodes
For IFC product, return the corresponding shape nodes.

Source: src/scene/load/ifc/castleifc_load_to_x3d.inc (line 154).

Public function ProductToNodes(const Product: TIfcProduct): TX3DNodeList;

For IFC product, return the corresponding shape nodes. Assumes that the nodes have been updated to reflect the latest state of the IFC classes using Update. All the nodes returned are of TAbstractShapeNode class and map back (using NodeToProduct) to the given product.

It is the caller's responsibility to free the resulting list. The TX3DNodeList does not own the children.

See also
NodeToProduct
For a shape node (TAbstractShapeNode), return the corresponding IFC product (TIfcProduct descendant, like a TIfcWall, TIfcWindow, TIfcDoor).

Source: src/scene/load/ifc/castleifc_load_to_x3d.inc (line 166).

Public procedure ShowDebugShapes(const Show: Boolean);

Show or hide the IFC debug geometry (just IfcBoundingBox now). This only updates the display (X3D nodes in RootNode), not IFC state.

Source: src/scene/load/ifc/castleifc_load_to_x3d.inc (line 171).

Properties

Public property RootNode: TX3DRootNode read FRootNode;

Latest X3D root node, built from the latest IFC instance.

Source: src/scene/load/ifc/castleifc_load_to_x3d.inc (line 128).

Public property OwnsRootNode: Boolean read FOwnsRootNode write FOwnsRootNode default false;

Should this class (TCastleIfcMapping) free the RootNode when loading new one or when destroying this class.

By default this False, so you're responsible for freeing the RootNode yourself after calling Load. See Load for more explanation.

Source: src/scene/load/ifc/castleifc_load_to_x3d.inc (line 136).

Public property OptimizeAssumingOneMapping: Boolean read FOptimizeAssumingOneMapping write SetOptimizeAssumingOneMapping;

Enable extra optimizations of some IFC operations by assuming that IFC classes (in TIfcFile given to Load and Update) can safely remember this TCastleIfcMapping instance. This is OK if the TCastleIfcMapping instance exists for the whole lifetime of the TIfcFile instance (free TCastleIfcMapping later) and you use only one TCastleIfcMapping instance with this TIfcFile.

Source: src/scene/load/ifc/castleifc_load_to_x3d.inc (line 179).


Generated by PasDoc 0.17.0.snapshot.