NVIDIA Iray API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
mi::neuraylib::IImporter Class Referenceabstract

Abstract interface for importers. More...

Inheritance diagram for mi::neuraylib::IImporter:
Inheritance graph
[legend]

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...
 

Additional Inherited Members

- Public Types inherited from mi::base::Interface_declare< 0x1288a8b7, 0x13ba, 0x4010, 0xb9, 0x0c, 0xbc, 0xf5, 0xca, 0x49, 0x70, 0xdd, IImpexp_base >
typedef Interface_declare< id1,
id2, id3, id4, id5, id6, id7,
id8, id9, id10, id11,
IImpexp_base
Self
  Own type. More...
 
typedef Uuid_t< id1, id2, id3,
id4, id5, id6, id7, id8, id9,
id10, id11 > 
IID
  Declares the interface ID (IID) of this interface. More...
 
- Static Public Member Functions inherited from mi::base::Interface_declare< 0x1288a8b7, 0x13ba, 0x4010, 0xb9, 0x0c, 0xbc, 0xf5, 0xca, 0x49, 0x70, 0xdd, IImpexp_base >
static bool  compare_iid (const Uuid &iid)
  Compares the interface ID iid against the interface ID of this interface and of its ancestors. More...
 

Detailed Description

Abstract interface for importers.

Member Function Documentation

virtual IImport_result* mi::neuraylib::IImporter::import_elements ( ITransaction transaction,
const char *  extension,
IReader reader,
const IMap importer_options,
IImpexp_state state 
) const
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:

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.

Parameters
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.
Returns
An instance of mi::IImport_result indicating success or failure.
virtual bool mi::neuraylib::IImporter::test_file_type ( const char *  extension,
const IReader reader 
) const
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.