Writes any format that CAD Exchanger can export. More...
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_ProgressStatus & | ProgressStatus () const |
Returns the progress status for the writing process. | |
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.
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.
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.
BaseError_MissingModule | if 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_LicenseError | if the corresponding writer was found but there was no active license for it. |