CAD Exchanger SDK
cadex::ModelXDE_Converter Class Reference

Converts ModelData_Model to/from XDE document. More...

Static Public Member Functions

static bool Convert (const ModelData_Model &theSource, const Handle_C &theTarget)
 
static bool Convert (const Handle_C &theSource, ModelData_Model &theTarget)
 

Detailed Description

Converts ModelData_Model to/from XDE document.

The following code excerpts demonstrate CAD Exchanger import/export operations using XDE document:

Handle(TDocStd_Document) aDoc = ...;
Para_Reader aReader;
ModelData_Model aModel;
if (aReader.ReadFile (theSource) &&
aReader.Transfer (aModel) &&
ModelXDE_Converter::Convert (aModel, aDoc)) {
return 0;
}
Handle(TDocStd_Document) aDoc = ...;
ACIS_Writer aWriter;
ModelData_Model aModel;
if (ModelXDE_Converter::Convert (aDoc, aModel) &&
aWriter.Transfer (aModel) &&
aWriter.WriteFile (theDest)) {
return 0;
}

Implementation notes: As XDE (XCAFDoc_ShapeTool) does not offer API to construct XDE entities (assemblies, parts, instances) step-by-step, the respective functions from XCAFDoc_ShapeTool had to created.