Hide menu
cadex::ModelData_ModelReader Class Reference

Reads any format that CAD Exchanger can import. More...

Public Member Functions

 ModelData_ModelReader ()
 ~ModelData_ModelReader ()
bool Read (const Base_UTF16String &theFilePath, ModelData_Model &theModel)
 Reads the file at the specified path into the specified model. More...
void SetReaderParameters (const Base_ReaderParameters &theParameters)
 Sets reader parameters. More...
void SetProgressStatus (const Base_ProgressStatus &theProgressStatus)
 Sets the progress status for the reading process.
const Base_ProgressStatusProgressStatus () const
 Returns the progress status for the reading process.
internal::ModelData_ModelReaderImpl * Impl ()

Detailed Description

Reads any format that CAD Exchanger can import.

Use this class to streamline the code where multiple formats have to be read in a uniform fashion. This reader handles the task of determining the suitable reader itself, the client code then receives the resulting ModelData_Model.

Each CAD Exchanger reader has its own binary. This class will load the binaries of readers 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 read.

advgeom/brepsimplify/main.cxx, advgeom/meshsimplify/main.cxx, conversion/cdxfbconverter/main.cxx, conversion/export/main.cxx, conversion/transfer/main.cxx, conversion/transferparams/main.cxx, exploring/appearance/main.cxx, exploring/bom/main.cxx, exploring/breprepresentation/main.cxx, exploring/layers/main.cxx, exploring/pmi/main.cxx, exploring/polyrepresentation/main.cxx, exploring/propertytable/main.cxx, exploring/transformations/main.cxx, meshing/mefisto/main.cxx, meshing/netgen/main.cxx, meshing/remeshing/main.cxx, meshing/visualizationmesher/main.cxx, misc/logging/main.cxx, modeling/elementremoval/main.cxx, Unigine/source/ModelImporter.cpp, visualization/offscreen/main.cxx, and visualization/qtquick_qml/baseviewer/main.cxx.

Member Function Documentation

◆ Read()

bool cadex::ModelData_ModelReader::Read ( const Base_UTF16String theFileName,
ModelData_Model theModel 

Reads the file at the specified path into the specified model.

Automatically selects a reader suitable for the specified file. The selection is performed from the readers that can be loaded at runtime. Returns true if the reading process succeeded, false otherwise.

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.
BaseError_MissingFileif the file can't be found at the specified path.
BaseError_MissingModuleif no reader 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 reader was found but there was no active license for it.
advgeom/brepsimplify/main.cxx, advgeom/meshsimplify/main.cxx, conversion/cdxfbconverter/main.cxx, conversion/transfer/main.cxx, conversion/transferparams/main.cxx, exploring/pmi/main.cxx, exploring/polyrepresentation/main.cxx, meshing/remeshing/main.cxx, meshing/visualizationmesher/main.cxx, misc/logging/main.cxx, Unigine/source/ModelImporter.cpp, visualization/offscreen/main.cxx, and visualization/qtquick_qml/baseviewer/main.cxx.

◆ SetReaderParameters()

void cadex::ModelData_ModelReader::SetReaderParameters ( const Base_ReaderParameters theParameters)

Sets reader parameters.

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

conversion/transferparams/main.cxx, exploring/pmi/main.cxx, visualization/offscreen/main.cxx, and visualization/qtquick_qml/baseviewer/main.cxx.