neuray API Programmer's Manual

mi::neuraylib::IImport_result Class Reference

[Importer and Exporter]

Description

This interface represents the result of an import operation. Such an import operation is triggered by mi::neuraylib::IImport_api::import_elements() or mi::neuraylib::IImport_api::import_elements_from_string(). It gives access to messages, message numbers, and message severities, and to important scene elements like root group, camera instance, and options. Furthermore you can query the imported element names, if requested during import.

Importers should use the message severities according to the following guidelines:

  • mi::base::details::MESSAGE_SEVERITY_FATAL

    The importer is no longer usable.

  • mi::base::details::MESSAGE_SEVERITY_ERROR

    The file contains errors and not all elements could be imported.

  • mi::base::details::MESSAGE_SEVERITY_WARNING

    The file contains minor errors.

  • mi::base::details::MESSAGE_SEVERITY_INFO

    A normal operational message.

  • mi::base::details::MESSAGE_SEVERITY_VERBOSE and mi::base::details::MESSAGE_SEVERITY_DEBUG

    These message severities should be avoided by importers.

Public Member Functions

virtual const char* get_camera_inst() const =0
Returns the name of the camera instance. More...
virtual const char* get_element( Size index) const =0
Returns the name of the element indicated by index.
virtual Size get_elements_length() const =0
Returns the length of the element array.
virtual const char* get_error_message() const =0
Returns the message of the first error. More...
virtual Uint32 get_error_number() const =0
Returns the number of the first error. More...
virtual const char* get_message( Size index) const =0
Returns a message from the array of messages. More...
virtual Uint32 get_message_number( Size index) const =0
Returns the message number for a given message from the array of messages. More...
virtual base::​Message_severity get_message_severity( Size index) const =0
Returns the severity for a given message from the array of messages. More...
virtual Size get_messages_length() const =0
Returns the number of messages.
virtual const char* get_options() const =0
Returns the name of the options element. More...
virtual const char* get_rootgroup() const =0
Returns the name of the root group. More...

Member Functions

virtual const char* mi::​neuraylib::​IImport_result::get_camera_inst() const [pure virtual]

Returns the name of the camera instance. If the scene file has a scene root (like a render statement in a .mi file) containing a camera instance, the method returns the name of the camera instance element.

virtual const char* mi::​neuraylib::​IImport_result::get_element( Size index) const [pure virtual]

Returns the name of the element indicated by index.

virtual Size mi::​neuraylib::​IImport_result::get_elements_length() const [pure virtual]

Returns the length of the element array.

virtual const char* mi::​neuraylib::​IImport_result::get_error_message() const [pure virtual]

Returns the message of the first error. A message describing the error condition corresponding to the error reported from get_error_number().

It is possible to query the all messages, see get_messages_length() and get_message( mi::Size)const. This method just reports the the first message of severity mi::base::details::MESSAGE_SEVERITY_ERROR or above, or NULL if there is no such message.

virtual Uint32 mi::​neuraylib::​IImport_result::get_error_number() const [pure virtual]

Returns the number of the first error. The error number indicates the status of the import operation: 0 means success, all other values indicate failures, in which case get_error_message() provides a diagnostic message. Numbers in the range 4000-5999 are reserved for custom importers. All other numbers are reserved for other purposes.

It is possible to query the message numbers of all messages, see get_messages_length() and get_message_number( mi::Size)const. This method just reports the number of the first message of severity mi::base::details::MESSAGE_SEVERITY_ERROR or above, or 0 if there is no such message.

virtual const char* mi::​neuraylib::​IImport_result::get_message( Size index) const [pure virtual]

Returns a message from the array of messages.

See also:

get_messages_length()

virtual Uint32 mi::​neuraylib::​IImport_result::get_message_number( Size index) const [pure virtual]

Returns the message number for a given message from the array of messages.

See also:

get_messages_length()

virtual base::​Message_severity mi::​neuraylib::​IImport_result::get_message_severity( Size index) const [pure virtual]

Returns the severity for a given message from the array of messages.

See also:

get_messages_length()

virtual Size mi::​neuraylib::​IImport_result::get_messages_length() const [pure virtual]

Returns the number of messages.

virtual const char* mi::​neuraylib::​IImport_result::get_options() const [pure virtual]

Returns the name of the options element. If the scene file has a scene root (like a render statement in a .mi file) containing an options element, the method returns the name of the options element.

virtual const char* mi::​neuraylib::​IImport_result::get_rootgroup() const [pure virtual]

Returns the name of the root group. If the scene file has a scene root (like a render or root statement in a .mi file), the method returns the name of the root element. For most other files, this is the name of a group that was created by the importer and that contains the top-level scene elements. Returns NULL for .mdl files.