Abstract interface for importers. More...
#include <iimporter.h>
Public Member Functions | |
virtual bool | test_file_type (const char *extension, const IReader *reader) const =0 |
Indicates whether the importer can handle the file type. More... | |
virtual IImport_result * | import_elements (ITransaction *transaction, const char *extension, IReader *reader, const IMap *importer_options, IImpexp_state *state) const =0 |
Imports a scene via a reader. More... | |
virtual bool | test_file_type (const char *extension) const=0 |
Indicates whether a file name extension is supported. More... | |
![]() | |
virtual IImpexp_state * | create_impexp_state (const char *uri, const IImpexp_state *parent_state=nullptr) const =0 |
Returns a state suitable for passing it to a recursive import or export call. More... | |
virtual bool | test_file_type (const char *extension) const =0 |
Indicates whether a file name extension is supported. More... | |
virtual Impexp_priority | get_priority () const =0 |
Returns the priority of the importer or exporter. More... | |
virtual const char * | get_supported_extensions (Uint32 i) const =0 |
Returns the i -th supported file name extension. More... | |
virtual const char * | get_name () const =0 |
Returns a concise single-line clear text description of the importer or exporter. More... | |
virtual const char * | get_author () const =0 |
Returns a concise single-line clear text description of the author of this importer or exporter. More... | |
virtual base::Uuid | get_uuid () const =0 |
Returns the unique identifier for the importer or exporter. More... | |
virtual Uint32 | get_major_version () const =0 |
Returns the major version number of the importer or exporter. More... | |
virtual Uint32 | get_minor_version () const =0 |
Returns the minor version number of the importer or exporter. More... | |
![]() | |
virtual Uint32 | retain () const =0 |
Increments the reference count. More... | |
virtual Uint32 | release () const =0 |
Decrements the reference count. More... | |
virtual const IInterface * | get_interface (const Uuid &interface_id) const =0 |
Acquires a const interface from another. More... | |
template<class T> | |
const T * | get_interface () const |
Acquires a const interface from another. More... | |
virtual IInterface * | get_interface (const Uuid &interface_id)=0 |
Acquires a mutable interface from another. More... | |
template<class T> | |
T * | get_interface () |
Acquires a mutable interface from another. More... | |
virtual Uuid | get_iid () const =0 |
Returns the interface ID of the most derived interface. More... | |
Additional Inherited Members | |
![]() | |
using | Self = Interface_declare< id1, ... > |
Own type. More... | |
using | IID = Uuid_t< id1, ... > |
Declares the interface ID (IID) of this interface. More... | |
![]() | |
using | Self = Interface_declare< id1, ... > |
Own type. More... | |
using | IID = Uuid_t< id1, ... > |
Declares the interface ID (IID) of this interface. More... | |
![]() | |
using | IID = Uuid_t<0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0> |
Declares the interface ID (IID) of this interface. More... | |
![]() | |
static bool | compare_iid (const Uuid &iid) |
Compares the interface ID iid against the interface ID of this interface and of its ancestors. More... | |
![]() | |
static bool | compare_iid (const Uuid &iid) |
Compares the interface ID iid against the interface ID of this interface and of its ancestors. More... | |
![]() | |
static bool | compare_iid (const Uuid &iid) |
Compares the interface ID iid against the interface ID of this interface. More... | |
Abstract interface for importers.
|
pure virtual |
Imports a scene via a reader.
Imports all elements from the reader in a format determined by the file extension and (optionally) the lookahead of the reader.
In addition to importer-specific options, every importer has to implement the following standard options:
"prefix"
of type mi::IString: This prefix is to be prepended to the names of all imported elements. Default: the empty string."list_elements"
of type mi::IBoolean: If true
, the name of each imported element has to be stored in the returned instance of mi::neuraylib::IImport_result (e.g. via mi::neuraylib::IImport_result_ext::element_push_back()). Default: false
.It is strongly recommended that names for importer-specific options use a prefix related to the importer to avoid name conflicts, e.g., the file name extension.
transaction | The transaction to be used. |
extension | The file name extension (which might influence the file format). |
reader | The reader to read the byte stream from. |
importer_options | The options that control the way the importer works (optional). |
state | The current importer state. |
|
virtual |
Indicates whether a file name extension is supported.
Returns true
if the importer or exporter can handle the file type determined by the file name extension. The extension is defined as the part of the file name after and including the first dot, for example, ".mi"
.
Implements mi::neuraylib::IImpexp_base.
|
pure virtual |
Indicates whether the importer can handle the file type.
Returns true
if the importer can handle the file type determined by the file name extension or by looking at the lookahead. The extension is defined as the part of the file name after and including the first dot, for example, ".mi". This method also checks if the reader has sufficient capabilities to import successfully. If not, the importer shall return false
immediately.
For formats that have a mandatory and sufficiently distinguishing magic header, the importer shall use an available lookahead to determine the answer. Otherwise, the importer shall use the file name extension. In addition, if the lookahead is available the importer may check if the file header is plausible. If the file header is not understood by the importer, it should return false
.