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

Writes any format that CAD Exchanger can export. More...

#include <cadex/ModelData_ModelWriter.hxx>

Public Member Functions

 ModelData_ModelWriter ()
 Constructor.
 
 ~ModelData_ModelWriter ()
 Destructor.
 
bool Write (const ModelData_Model &theModel, const Base_UTF16String &theFilePath)
 Writes the specified model to the file at the specified path.
 
bool Write (const ModelData_BIMModel &theModel, const Base_UTF16String &theFilePath)
 
void SetWriterParameters (const Base_WriterParameters &theParameters)
 Sets writer parameters.
 
void SetProgressStatus (const Base_ProgressStatus &theProgressStatus)
 Sets the progress status for the writing process.
 
const Base_ProgressStatusProgressStatus () const
 Returns the progress status for the writing process.
 

Detailed Description

Writes any format that CAD Exchanger can export.

Use this class to streamline the code where multiple formats have to be written in a uniform fashion. This writer handles the task of determining the suitable writer itself, the client code only needs to provide the ModelData_Model and a resulting file path.

Each CAD Exchanger writer has its own binary. This class will load the binaries of writers at runtime for its operation. No linking is done at compile-time. If you're planning to omit some CAD Exchanger libraries from your software distribution, make sure to include the libraries for all the formats you intend to write.

Examples
advgeom/brepsimplify/Program.cs, advgeom/brepsimplify/main.cxx, advgeom/meshsimplify/Program.cs, advgeom/meshsimplify/main.cxx, conversion/cdxwebconverter/Program.cs, conversion/cdxwebconverter/main.cxx, conversion/import/Program.cs, conversion/import/main.cxx, conversion/transfer/Program.cs, conversion/transfer/main.cxx, conversion/transferparams/Program.cs, conversion/transferparams/main.cxx, meshing/lods/Program.cs, meshing/lods/main.cxx, meshing/mefisto/Program.cs, meshing/mefisto/main.cxx, meshing/netgen/Program.cs, meshing/netgen/main.cxx, meshing/remeshing/Program.cs, meshing/remeshing/main.cxx, meshing/visualizationmesher/Program.cs, meshing/visualizationmesher/main.cxx, modeling/assembly/Program.cs, modeling/assembly/main.cxx, modeling/brep/Program.cs, modeling/brep/main.cxx, modeling/brepfeatures/Program.cs, modeling/brepfeatures/main.cxx, modeling/brepprimitives/Program.cs, modeling/brepprimitives/main.cxx, modeling/elementremoval/Program.cs, modeling/elementremoval/main.cxx, modeling/metadata/Program.cs, modeling/metadata/main.cxx, modeling/poly/Program.cs, modeling/poly/main.cxx, modification/coloring/Program.cs, modification/coloring/main.cxx, modification/renaming/Program.cs, modification/renaming/main.cxx, modification/rotation/Program.cs, modification/rotation/main.cxx, sheet_metal/unfolder/Program.cs, sheet_metal/unfolder/main.cxx, wall_thickness/visualization/Program.cs, and wall_thickness/visualization/main.cxx.

Member Function Documentation

◆ SetWriterParameters()

void cadex::ModelData_ModelWriter::SetWriterParameters ( const Base_WriterParameters theParameters)

Sets writer parameters.

Any child of Base_WriterParameters can be passed to this function and it will affect the writing of the corresponding format only. Call multiple times with parameter objects for different writers to customize the behavior of these writers.

Examples
conversion/cdxwebconverter/main.cxx, conversion/transferparams/Program.cs, and conversion/transferparams/main.cxx.

◆ Write()

bool cadex::ModelData_ModelWriter::Write ( const ModelData_Model theModel,
const Base_UTF16String theFileName 
)

Writes the specified model to the file at the specified path.

Automatically selects a suitable writer based on the file extension specified in the path. The selection is performed from the writers that can be loaded at runtime. Returns true if the writing process succeeded, false otherwise.

Note
Aside from the exceptions listed below, this function call may be interrupted by exceptions specific to the formats being used; see other classes derived from Base_Exception.
Exceptions
BaseError_EvaluationLimitif evaluation license usage limit exceeded
BaseError_MissingModuleif no writer for the specified file could be found (either because the format is not supported by CAD Exchanger, or because a related module couldn't be loaded).
LicenseManager_LicenseErrorif the corresponding writer was found but there was no active license for it.
Examples
conversion/cdxwebconverter/Program.cs, conversion/cdxwebconverter/main.cxx, conversion/transfer/Program.cs, conversion/transfer/main.cxx, conversion/transferparams/Program.cs, conversion/transferparams/main.cxx, meshing/remeshing/Program.cs, meshing/remeshing/main.cxx, meshing/visualizationmesher/Program.cs, meshing/visualizationmesher/main.cxx, modeling/assembly/Program.cs, modeling/assembly/main.cxx, modeling/brep/Program.cs, modeling/brep/main.cxx, modeling/brepfeatures/Program.cs, modeling/brepfeatures/main.cxx, modeling/brepprimitives/Program.cs, modeling/brepprimitives/main.cxx, modeling/elementremoval/Program.cs, modeling/elementremoval/main.cxx, modeling/metadata/Program.cs, modeling/metadata/main.cxx, modeling/poly/Program.cs, modeling/poly/main.cxx, modification/coloring/Program.cs, modification/coloring/main.cxx, modification/renaming/Program.cs, modification/renaming/main.cxx, modification/rotation/Program.cs, modification/rotation/main.cxx, sheet_metal/unfolder/main.cxx, and wall_thickness/visualization/main.cxx.