Communicator::Exporter Class Reference

#include <libconverter.h>

Public Member Functions

 Exporter ()
 
bool Init (Importer *importer)
 
bool Write3MF (const char *out_filename, SC_Export_Options export_options=SC_Export_Options())
 
bool WriteConfigFile (const char *out_filename, SC::Store::MemoryDevice *memory_device=nullptr)
 
bool WriteDependencies (const char *out_filename, SC::Store::MemoryDevice *memory_device=nullptr)
 
bool WriteHSF (char const *out_filename)
 
bool WriteHTML (const char *utf8_html_path, const char *utf8_html_template_path, SC_Export_Options export_options)
 
bool WriteJT (const char *out_filename, SC_Export_Options export_options=SC_Export_Options())
 
bool WritePDF (char const *out_filename, const char *template_filename, const char *modify_list, Color background_color, SC_Export_Options export_options)
 
bool WritePNG (char const *outFilename, int xres, int yres, Color backgroundColor, Camera *cameraOverride=nullptr, ViewOrientation viewOrientation=ViewOrientation::Unspecified, bool fitWorldExact=false, bool enableHiddenLine=false, bool enableTransparentBackground=false, bool exportPmi=true, RenderingMode renderingMode=RenderingMode::ShadedWithLines, LightingMode lightingMode=LightingMode::Lighting2016)
 
bool WritePRC (const char *out_filename, SC_Export_Options export_options)
 
bool WriteSC (char const *utf8_model_path, char const *utf8_scs_filename, SC_Export_Options export_options)
 
bool WriteSCMaster (const char *xmlFile, const char *modelsPath, const char *outputFile, SC_Export_Options export_options)
 
bool WriteSCShattered (SC_Export_Options export_options)
 
bool WriteSTEP (const char *out_filename, SC_Export_Options export_options)
 
bool WriteSTL (const char *out_filename, SC_Export_Options export_options)
 
bool WriteXML (const char *out_filename, SC_Export_Options export_options)
 
bool WriteXMLBOM (const char *out_filename, SC::Store::MemoryDevice *memory_device=nullptr)
 
bool WriteXT (const char *out_filename)
 
 ~Exporter ()
 

Detailed Description

The Exporter class converts a CAD file and exports it to a variety of output formats

Constructor & Destructor Documentation

◆ Exporter()

Communicator::Exporter::Exporter ( )

◆ ~Exporter()

Communicator::Exporter::~Exporter ( )

Member Function Documentation

◆ Init()

bool Communicator::Exporter::Init ( Importer importer)

Initializes the importer with an importer object

◆ Write3MF()

bool Communicator::Exporter::Write3MF ( const char *  out_filename,
SC_Export_Options  export_options = SC_Export_Options() 
)

Exports a 3MF file.

Parameters
out_filenameName of the 3MF file
export_optionsOptional object defining the export settings for writing out the 3MF File
Returns
True if file export completed successfully.

◆ WriteConfigFile()

bool Communicator::Exporter::WriteConfigFile ( const char *  out_filename,
SC::Store::MemoryDevice *  memory_device = nullptr 
)

Exports a text file containing configuration list.

Parameters
out_filenameName of the text file
memory_deviceAn optional MemoryDevice used to sandbox IO.
Returns
True if file export completed successfully.

◆ WriteDependencies()

bool Communicator::Exporter::WriteDependencies ( const char *  out_filename,
SC::Store::MemoryDevice *  memory_device = nullptr 
)

Exports a text file containing all dependencies.

Parameters
out_filenameName of the dependencies file
memory_deviceAn optional MemoryDevice used to sandbox IO.
Returns
True if file export completed successfully.

◆ WriteHSF()

bool Communicator::Exporter::WriteHSF ( char const *  out_filename)

Exports a HSF file.

Parameters
out_filenameName of the HSF file
Returns
True if file export completed successfully.

◆ WriteHTML()

bool Communicator::Exporter::WriteHTML ( const char *  utf8_html_path,
const char *  utf8_html_template_path,
SC_Export_Options  export_options 
)

Exports a self contained HTML file

Parameters
utf8_html_pathFull path of the output html file
utf8_html_template_pathFull path of the html template file
export_optionsObject defining the export settings for writing out the stream cache instance
Returns
True if file export completed successfully.

◆ WriteJT()

bool Communicator::Exporter::WriteJT ( const char *  out_filename,
SC_Export_Options  export_options = SC_Export_Options() 
)

Exports a JT file.

Parameters
out_filenameName of the JT file
export_optionsOptional object defining the export settings for writing out the JT File
Returns
True if file export completed successfully.

◆ WritePDF()

bool Communicator::Exporter::WritePDF ( char const *  out_filename,
const char *  template_filename,
const char *  modify_list,
Color  background_color,
SC_Export_Options  export_options 
)

Exports a 3D PDF File (currently not supported on Linux)

Parameters
out_filenameName of the PDF file
template_filenameName of the template file used for the PDF generation (required)
modify_listList of field modifications that will be applied to the specified template. Example: "Filename$$Part.CatPart$$FileType$$CatiaModel"
background_colorPDF background color
Returns
True if file export completed successfully.

◆ WritePNG()

bool Communicator::Exporter::WritePNG ( char const *  outFilename,
int  xres,
int  yres,
Color  backgroundColor,
Camera cameraOverride = nullptr,
ViewOrientation  viewOrientation = ViewOrientation::Unspecified,
bool  fitWorldExact = false,
bool  enableHiddenLine = false,
bool  enableTransparentBackground = false,
bool  exportPmi = true,
RenderingMode  renderingMode = RenderingMode::ShadedWithLines,
LightingMode  lightingMode = LightingMode::Lighting2016 
)

Exports a png file with the specified resolution.

Parameters
outFilenameName of the PNG file.
xresHorizontal resolution of the PNG image.
yresVertical resolution of the PNG image.
backgroundColorImage background color.
cameraOverrideIf non-null, PNG export uses this camera. Otherwise the default camera is used.
standardViewIf specified, the camera used for export has its orientation changed to that of the supplied standard view.
fitWorldExactIf true, the camera used for export is fitted around the entire scene.
enableHiddenLineIf true, hidden line rendering is enabled for the exported PNG image.
enableTransparentBackgroundIf true, the image background will be transparent.
exportPmiIf true, PMI will be shown.
renderingModeSpecifies the rendering mode for the exported PNG image. If enableHiddenLine is true, the rendering mode will be hidden line.
lightingModeSpecifies the lighting mode for the exported PNG image. 0 = HC 2015 lighting, 1 = HC 2016 and newer.
Returns
True if file export completed successfully.

◆ WritePRC()

bool Communicator::Exporter::WritePRC ( const char *  out_filename,
SC_Export_Options  export_options 
)

Exports a PRC file.

Parameters
out_filenameName of the PRC file
Returns
True if file export completed successfully.

◆ WriteSC()

bool Communicator::Exporter::WriteSC ( char const *  utf8_model_path,
char const *  utf8_scs_filename,
SC_Export_Options  export_options 
)

Exports a SC Instance.

Parameters
utf8_model_pathFull path of the output SC model directory
utf8_scs_filenameFull path of the output .scs or nullptr or empty string if none is desired
export_optionsObject defining the export settings for writing out the stream cache instance
Returns
True if file export completed successfully.

◆ WriteSCMaster()

bool Communicator::Exporter::WriteSCMaster ( const char *  xmlFile,
const char *  modelsPath,
const char *  outputFile,
SC_Export_Options  export_options 
)

Given an XML file, will build a master model file, corresponding to the XML file content and referencing all the external model files

Parameters
inputXML file
modelsPathDirectory of the shattered model parts
outputFileName of the output stream cache directory
export_optionsObject defining the export settings for writing out the stream cache instance
Returns
True if file export completed successfully.

◆ WriteSCShattered()

bool Communicator::Exporter::WriteSCShattered ( SC_Export_Options  export_options)

Will export a separate SC model for each part of the assembly and/or exports an XML representing the assembly structure and referencing those SC models

Parameters
export_optionsIf export_options.prepare_shattered_parts is defined, it will export a SC model for each part. If export_options.prepare_shattered_scs_parts is defined, it will export a SCS file for each part. If export_options.prepare_shattered_xml is defined, it will export an XML representing the assembly structure and referencing those SC models
Returns
True if file export completed successfully.

◆ WriteSTEP()

bool Communicator::Exporter::WriteSTEP ( const char *  out_filename,
SC_Export_Options  export_options 
)

Exports a STEP file.

Parameters
out_filenameName of the STEP file
export_optionsObject defining the export settings for writing out the STEP File
Returns
True if file export completed successfully.

◆ WriteSTL()

bool Communicator::Exporter::WriteSTL ( const char *  out_filename,
SC_Export_Options  export_options 
)

Exports a STL file.

Parameters
out_filenameName of the STL file
export_optionsObject defining the export settings for writing out the STL File
Returns
True if file export completed successfully.

◆ WriteXML()

bool Communicator::Exporter::WriteXML ( const char *  out_filename,
SC_Export_Options  export_options 
)

Exports a XML File

Parameters
out_filenameName of the XML file
export_optionsObject defining the export settings
Returns
True if file export completed successfully.

◆ WriteXMLBOM()

bool Communicator::Exporter::WriteXMLBOM ( const char *  out_filename,
SC::Store::MemoryDevice *  memory_device = nullptr 
)

Exports a XML file containing BOM.

Parameters
out_filenameName of the XML BOM file
memory_deviceAn optional MemoryDevice used to sandbox IO.
Returns
True if file export completed successfully.

◆ WriteXT()

bool Communicator::Exporter::WriteXT ( const char *  out_filename)

Exports a XT file.

Parameters
out_filenameName of the XT file
Returns
True if file export completed successfully.