Base class for reader classes. More...
#include <cadex/Base_Reader.hxx>
Public Member Functions | |
~Base_Reader () | |
Destructor. | |
bool | ReadFile (const Base_UTF16String &theFileName) |
Reads the file into memory. | |
bool | ReadFile (std::istream &theStream) |
Reads the file into memory. | |
bool | ReadFile (const std::shared_ptr< Base_IStreamProviderFactory > &theFactory, const Base_UTF16String &theFileName) |
Reads the file into memory. | |
bool | Transfer (ModelData_Model &theModel) |
Converts read file into a resulting model. | |
bool | Transfer (ModelData_BIMModel &theModel) |
Converts read file into a resulting BIM model. | |
bool | Transfer (TopoDS_Shape &theShape) |
Converts read file into a resulting shape. | |
Base_ProgressStatus & | ProgressStatus () const |
Returns a progress status. | |
Base_ReaderStatistics | Statistics () const |
Returns an object containing information about import process. | |
internal::Base_Reader_Private * | Impl () const |
template<typename T > | |
T * | Impl () const |
Reserved for internal use. | |
Protected Member Functions | |
Base_Reader (internal::Base_Reader_Private *theImpl) | |
Constructor. | |
Base class for reader classes.
The reader class provides API for reading (i.e. importing) files in two steps:
Base_Reader subclasses (e.g. IGES_Reader) must be used following the same pattern:
|
inline |
Returns the pointer to the implementation object.
bool cadex::Base_Reader::ReadFile | ( | const Base_UTF16String & | theFileName | ) |
Reads the file into memory.
Returns True if the conversion has been successful and False otherwise.
BaseError_MissingModel | |
BaseError_UnsupportedVersion | |
BaseError_UnexpectedFormat | |
BaseError_UnsupportedFileVariant |
bool cadex::Base_Reader::ReadFile | ( | const std::shared_ptr< Base_IStreamProviderFactory > & | theFactory, |
const Base_UTF16String & | theFileName | ||
) |
Reads the file into memory.
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. This overload should be used when parsing files referring to external files (e.g. JT files with external references) residing on specific data storage such as cloud.
theFactory must be an instance of specific subclass of StreamProviderFactory which creates instances of specific subclass(es) of StreamProvider.
BaseError_MissingModel | |
BaseError_UnsupportedVersion | |
BaseError_UnexpectedFormat | |
BaseError_UnsupportedFileVariant |
bool cadex::Base_Reader::ReadFile | ( | std::istream & | theStream | ) |
Reads the file into memory.
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. The file is specified in the form of the stream. theStream must be opened and use binary format (the ios::binary flag).
Not all subclasses support this syntax (e.g. STEP_Reader or JT_Reader do not). In this case the method returns False and asserts in debug mode.
Returns True if the conversion has been successful and False otherwise.
BaseError_MissingModel | |
BaseError_UnsupportedVersion | |
BaseError_UnexpectedFormat | |
BaseError_UnsupportedFileVariant |
bool cadex::Base_Reader::Transfer | ( | ModelData_BIMModel & | theBIMModel | ) |
Converts read file into a resulting BIM model.
Returns true if the conversion has been successful and false otherwise.
The contents of theBIMModel will be appended.
bool cadex::Base_Reader::Transfer | ( | ModelData_Model & | theModel | ) |
Converts read file into a resulting model.
Returns true if the conversion has been successful and false otherwise.
The contents of theModel will be appended.
Sets the base name of the most recently read file (in ReadFile()) to theModel's name unless the model already has a name.
bool cadex::Base_Reader::Transfer | ( | TopoDS_Shape & | theShape | ) |
Converts read file into a resulting shape.
Returns true if the conversion has been successful and false otherwise.