Iray SDK API nvidia_logo_transpbg.gif Up
mi::neuraylib::IExporter Class Referenceabstract

Abstract interface for exporters. More...

#include <iexporter.h>

Inheritance diagram for mi::neuraylib::IExporter:

Public Member Functions

virtual bool test_file_type (const char *extension, const IWriter *writer) const =0
 Indicates whether the exporter can handle the file type. More...
 
virtual IExport_resultexport_scene (ITransaction *transaction, const char *extension, IWriter *writer, const char *rootgroup, const char *caminst, const char *options, const IMap *exporter_options, IImpexp_state *state) const =0
 Exports a scene via a writer. More...
 
virtual IExport_resultexport_elements (ITransaction *transaction, const char *extension, IWriter *writer, const IArray *elements, const IMap *exporter_options, IImpexp_state *state) const =0
 Exports a set of named elements via a writer. More...
 
virtual bool test_file_type (const char *extension) const=0
 Indicates whether a file name extension is supported. More...
 
- Public Member Functions inherited from mi::neuraylib::IImpexp_base
virtual IImpexp_statecreate_impexp_state (const char *uri, const IImpexp_state *parent_state=0) 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...
 
- Public Member Functions inherited from mi::base::IInterface
virtual Uint32 retain () const =0
 Increments the reference count. More...
 
virtual Uint32 release () const =0
 Decrements the reference count. More...
 
virtual const IInterfaceget_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 IInterfaceget_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

- Public Types inherited from mi::base::Interface_declare< 0x543b5252, ... >
typedef Interface_declare< id1, ... > Self
 Own type. More...
 
typedef Uuid_t< id1, ... > IID
 Declares the interface ID (IID) of this interface. More...
 
- Public Types inherited from mi::base::Interface_declare< 0xf14bab60, ... >
typedef Interface_declare< id1, ... > Self
 Own type. More...
 
typedef Uuid_t< id1, ... > IID
 Declares the interface ID (IID) of this interface. More...
 
- Public Types inherited from mi::base::IInterface
typedef Uuid_t<0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0> IID
 Declares the interface ID (IID) of this interface. More...
 
- Static Public Member Functions inherited from mi::base::Interface_declare< 0x543b5252, ... >
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 Public Member Functions inherited from mi::base::Interface_declare< 0xf14bab60, ... >
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 Public Member Functions inherited from mi::base::IInterface
static bool compare_iid (const Uuid &iid)
 Compares the interface ID iid against the interface ID of this interface. More...
 

Detailed Description

Abstract interface for exporters.

Member Function Documentation

 export_elements()

virtual IExport_result * mi::neuraylib::IExporter::export_elements ( ITransaction transaction,
const char *  extension,
IWriter writer,
const IArray elements,
const IMap exporter_options,
IImpexp_state state 
) const
pure virtual

Exports a set of named elements via a writer.

Writes the named elements to the writer in a format determined by the exporter and the given extension. Note that in contrast to export_scene() references are not followed recursively.

The exporter can expect that the elements array contains no duplicates and that elements that are referenced come before elements that reference them. It is possible that these two conditions on the elements array are violated, but the exporter may then have undefined behavior, for example, produce invalid files.

In addition to exporter-specific options, every exporter has to implement the following standard option:

  • "strip_prefix" of type mi::IString: If present, this prefix is to be stripped from all names of database elements if they have the same prefix. Default: the empty string.

It is strongly recommended that names for exporter-specific options use a prefix related to the exporter to avoid name conflicts, e.g., the file name extension.

In the case of the .mi file format, the exported file will contain no render statement.

Parameters
transactionThe transaction to be used.
extensionThe file name extension (which might influence the file format).
writerThe writer to write the byte stream to.
stateThe current exporter state.
elementsThe array of elements to be exported.
exporter_optionsThe options that control the way the exporter works (optional).
Returns
An instance of mi::neuraylib::IExport_result indicating success or failure.

 export_scene()

virtual IExport_result * mi::neuraylib::IExporter::export_scene ( ITransaction transaction,
const char *  extension,
IWriter writer,
const char *  rootgroup,
const char *  caminst,
const char *  options,
const IMap exporter_options,
IImpexp_state state 
) const
pure virtual

Exports a scene via a writer.

Writes the scene identified by the root group, the camera instance, and the options to the writer in a format determined by the exporter and the given extension.

Any elements referenced by the three argument elements are written as well, recursively, in an order that allows re-importing (e.g., in .mi files, a referenced element must precede the reference). The scene graph cannot contain cyclic references and an exporter does not need to take any precautions to detect cycles.

In addition to exporter-specific options, every exporter has to implement the following standard option:

  • "strip_prefix" of type mi::IString: This prefix is to be stripped from the names of all exported elements if they have the same prefix. Default: the empty string.

It is strongly recommended that names for exporter-specific options use a prefix related to the exporter to avoid name conflicts, e.g., the file name extension.

In the case of the .mi file format, the exported file will contain a render statement.

Parameters
transactionThe transaction to be used.
extensionThe file name extension (which might influence the file format).
writerThe writer to write the byte stream to.
stateThe current exporter state.
rootgroupThe root group of the scene to be exported.
caminstThe camera instance of the scene to be exported (optional).
optionsThe options of the scene to be exported (optional).
exporter_optionsThe options that control the way the exporter works (optional).
Returns
An instance of mi::neuraylib::IExport_result indicating success or failure.
See also
mi::neuraylib::IExport_api::get_export_dependencies()

 test_file_type() [1/2]

virtual bool mi::neuraylib::IImpexp_base::test_file_type ( const char *  extension) const
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".

See also
mi::neuraylib::IImporter::test_file_type(), mi::neuraylib::IExporter::test_file_type()
These more specific versions also pass an mi::neuraylib::IReader or mi::neuraylib::IWriter as argument, which can be used to look at lookahead data for magic file headers (readers only) or to decide if the reader or writer capabilities are sufficient to do the import or export (for example, random access capability).

Implements mi::neuraylib::IImpexp_base.

 test_file_type() [2/2]

virtual bool mi::neuraylib::IExporter::test_file_type ( const char *  extension,
const IWriter writer 
) const
pure virtual

Indicates whether the exporter can handle the file type.

Returns true if the exporter can handle the file type determined by the file name extension and if the writer has sufficient capabilities for export (such as random access or availability of a file handle if that is required for this exporter). The extension is defined as the part of the filename after and including the first dot, for example, ".mi". In the case of missing capabilities the exporter shall return false immediately.