Hide menu
Loading...
Searching...
No Matches
cadex::ModelXDE_Converter Class Reference

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

#include <cadex/ModelXDE_Converter.hxx>

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;
if (aReader.ReadFile (theSource) &&
aReader.Transfer (aModel) &&
ModelXDE_Converter::Convert (aModel, aDoc)) {
return 0;
}
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
Provides CAD Exchanger data model.
Definition: ModelData_Model.hxx:43
Reads Parasolid files.
Definition: Para_Reader.hxx:29
Handle(TDocStd_Document) aDoc = ...;
ACIS_Writer aWriter;
if (ModelXDE_Converter::Convert (aDoc, aModel) &&
aWriter.Transfer (aModel) &&
aWriter.WriteFile (theDest)) {
return 0;
}
The ACIS_Writer class writes ACIS-SAT format.
Definition: ACIS_Writer.hxx:29
bool WriteFile(const Base_UTF16String &theFileName)
Writes contents to a target file.
Definition: Base_Writer.cxx:265
bool Transfer(const ModelData_Model &theModel)
Converts source model into memory representation of the target file.
Definition: Base_Writer.cxx:117

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.