Hide menu
No Matches
Delayed Conversion


Delayed conversion allows to incrementally convert the model during its life span. This primarily applies in import scenarios when working with large assemblies consisting of multiple parts. Instead of complete one-shot import operation (in Base_Reader::Transfer()) when all model data contents are loaded from external file and converted into target representations much more light-weight structures are created under the cover. Real loading and conversion takes place upon first access to data.

This behavior is controlled by the DelayedConversion(). By default, this parameter is false in order to provide a blocking style behavior (i.e. conversion fully completes upon Base_Reader::Transfer() call exit). To take advantage of delayed conversion this parameter should be set to true in an object of a respective subclass of Base_ReaderParameters (e.g. STEP_ReaderParameters):

#include <cadex/STEP_Reader.hxx>
#include <cadex/STEP_ReaderParameters.hxx>
using namespace cadex;
STEP_Reader aReader;
auto& aParam = aReader.Parameters();
aParam.DelayedConversion() = true;
aReader.ReadFile ("myfile.stp") && aReader.Transfer (aModel);
bool Transfer(ModelData_Model &theModel)
Converts read file into a resulting model.
Definition: Base_Reader.cxx:296
bool ReadFile(const Base_UTF16String &theFileName)
Reads the file into memory.
Definition: Base_Reader.cxx:207
bool DelayedConversion() const
Specifies whether the import should fully complete conversion or defer it This is an overloaded membe...
Definition: Base_ReaderParameters.cxx:147
Provides CAD Exchanger data model.
Definition: ModelData_Model.hxx:43
Reads STEP files.
Definition: STEP_Reader.hxx:29
const STEP_ReaderParameters & Parameters() const
Returns parameters.
Definition: STEP_Reader.cxx:219
Defines classes, types, and global functions related to CAD Exchanger.
Definition: A3DSTestLib.hxx:22


Key benefits of delayed conversion include greater responsiveness of the application (due to shorter import times) and reduced memory footprint. This is especially beneficial when working with large assemblies consisting of multiple sub-assemblies and parts when the user may only intend to import particular sub-assembly or part. In such scenario, delayed conversion allows to quickly import a product structure (assembly/part tree), after what the user would be able to select a sub-tree of interest and only required parts would be loaded.

Taking advantage of delayed conversion CAD Exchanger Lab itself is able to offer greater user experience by gradually loading 3D model and displaying it simultaneously with conversion running in parallel threads.

Supported data and formats

Readers of the following formats support delayed conversion:

  • 3MF;
  • 3D PDF;
  • 3D XML
  • ACIS;
  • CATIA;
  • Creo;
  • DWG;
  • DXF;
  • GLTF;
  • IFC;
  • IGES;
  • INV;
  • JT;
  • PRC;
  • Parasolid;
  • Revit;
  • Rhino;
  • Solid Edge;
  • SolidWorks;
  • Siemens NX;
  • STEP;
  • U3D;
  • Native CAD Exchanger format.

The following data segments which are typically the most heavy-weight in the file support delayed conversion:

JT specificity

Due to specificities of the JT format JT reader makes even greater possibility of delayed conversion by deferring parsing JT file data segments (such as XT B-Rep, JT B-Rep, ShapeLOD, Meta Data and PMI data segments). This allows to additionally minimize amount of data to be loaded and parsed when reading JT files.

Potential pitfalls

Taking full advantage of delayed conversion requires its careful use by the application developers willing to integrate it into their application. Naive use can lead to the following potential downsides:

Longer conversion times

If the model is eventually completely loaded into the memory a total wall-clock time of incremental conversions can be greater comparing to immediate (non-delayed) conversion. This can happen if model parts are loaded one by one inside the user application. On the other hand, if immediate conversion were used instead of delayed one, then the model would be imported faster thanks to intensive use of parallel computations inside CAD Exchanger SDK.

To deal with that various pipelining techniques to enable concurrency need to be applied in the user's code.

Imbalanced data access times

As real conversion happens during first data access then the same user's code may take significantly different time whether it is a first or consequent calls. For instance, in the following code

void ProcessBRep (const ModelData_Part& thePart)
const ModelData_BodyList& aList = aBRep.Get(); // conversion happens inside during first call
// process part bodies...
Defines precise Boundary Representation of part.
Definition: ModelData_BRepRepresentation.hxx:39
const ModelData_BodyList & Get() const
Returns an associated topological object.
Definition: ModelData_BRepRepresentation.cxx:626
Defines a list of bodies.
Definition: ModelData_BodyList.hxx:31
Defines a leaf node in the scene graph hiearchy.
Definition: ModelData_Part.hxx:35
ModelData_BRepRepresentation BRepRepresentation() const
Definition: ModelData_Part.cxx:360

a time of ModelData_BRepRepresentation::Get() execution will be essentially zero if the B-Rep has already been loaded. In the case of delayed conversion this call will take relatively considerable time as real conversion takes place.