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

The scene is the top-level element describing a subset of DB elements to be rendered. More...

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

Public Member Functions

virtual Sint32  set_rootgroup (const char *root)=0
  Sets the root group of this scene. More...
 
virtual const IString get_rootgroup () const =0
  Returns the name of the root group of this scene. More...
 
virtual Sint32  set_options (const char *options)=0
  Sets the options of this scene. More...
 
virtual const IString get_options () const =0
  Returns the name of the options of this scene. More...
 
virtual Sint32  set_camera_instance (const char *camera)=0
  Sets the camera instance of this scene. More...
 
virtual const IString get_camera_instance () const =0
  Returns the name of the camera instance of this scene. More...
 
virtual Sint32  get_bbox_min (Float32_3_struct &vector3)=0
  Returns the minimal corner of the bounding box of this scene. More...
 
virtual Sint32  get_bbox_max (Float32_3_struct &vector3)=0
  Returns the maximal corner of the bounding box of this scene. More...
 
virtual IRender_context create_render_context (ITransaction *transaction, const char *render_mode, Sint32 *errors=0)=0
  Creates a render context suitable for rendering the scene with a given render mode. More...
 

Additional Inherited Members

- Public Types inherited from mi::base::Interface_declare< 0x44e2a997, 0x8a86, 0x468d, 0x8d, 0x31, 0xed, 0x93, 0xc0, 0xb9, 0xac, 0x83 >
typedef Interface_declare< id1,
id2, id3, id4, id5, id6, id7,
id8, id9, id10, id11,
IInterface
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< 0x44e2a997, 0x8a86, 0x468d, 0x8d, 0x31, 0xed, 0x93, 0xc0, 0xb9, 0xac, 0x83 >
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

The scene is the top-level element describing a subset of DB elements to be rendered.

A scene is described by three elements:

Preprocessing of scene data is deferred until it is needed. In particular, get_bbox_min(), get_bbox_max(), and create_render_context() trigger preprocessing of the scene data.

Member Function Documentation

virtual IRender_context* mi::neuraylib::IScene::create_render_context ( ITransaction transaction,
const char *  render_mode,
Sint32 errors = 0 
)
pure virtual

Creates a render context suitable for rendering the scene with a given render mode.

Parameters
transaction The transaction to be used.
render_mode The render mode to be used, for example, "iray". Possible values are documented in Section Render mode selection of the Programmer's Manual.
[out] errors An optional pointer to an mi::Sint32 to which an error code will be written. The error codes have the following meaning:
  • 0: Success.
  • -1: Invalid parameters (NULL pointer).
  • -2: The scene object was not stored and retrieved from the database (this is required for this method to succeed).
  • -3: The parameter render_mode is not a valid render mode (see notes below).
  • -4: The root group, the options, or the camera instance are invalid.
  • -5: The render mode failed to create the render context for render mode-specific reasons.
Returns
The render context for the given render mode, or NULL in case of failure.
See Also
Certain render modes are only available if their corresponding plugin is loaded, see mi::neuraylib::IPlugin_configuration::load_plugin_library().
Not all render modes are available in all configurations. You can use mi::neuraylib::IRendering_configuration::get_renderers_length() and mi::neuraylib::IRendering_configuration::get_renderer() to query the render modes that are actually available.
virtual Sint32 mi::neuraylib::IScene::get_bbox_max ( Float32_3_struct vector3)
pure virtual

Returns the maximal corner of the bounding box of this scene.

This method is not a const method because it might trigger loading the actual scene data.

Note
The root group, options, and camera instance must be set to valid values before this method can succeed.
Parameters
[out] vector3 The maximum bounding box.
Returns
0, in case of success, -1 in case of failure.
virtual Sint32 mi::neuraylib::IScene::get_bbox_min ( Float32_3_struct vector3)
pure virtual

Returns the minimal corner of the bounding box of this scene.

This method is not a const method because it might trigger loading the actual scene data.

Note
The root group, options, and camera instance must be set to valid values before this method can succeed.
Parameters
[out] vector3 The minimum bounding box.
Returns
0, in case of success, -1 in case of failure.
virtual const IString* mi::neuraylib::IScene::get_camera_instance ( ) const
pure virtual

Returns the name of the camera instance of this scene.

Returns
The name, or NULL if there is no camera instance.
virtual const IString* mi::neuraylib::IScene::get_options ( ) const
pure virtual

Returns the name of the options of this scene.

Returns
The name, or NULL if there is no options object.
virtual const IString* mi::neuraylib::IScene::get_rootgroup ( ) const
pure virtual

Returns the name of the root group of this scene.

Returns
The name, or NULL if there is no root group.
virtual Sint32 mi::neuraylib::IScene::set_camera_instance ( const char *  camera)
pure virtual

Sets the camera instance of this scene.

Parameters
camera The name of the camera instance.
Returns
  • 0: Success.
  • -1: Invalid parameters (NULL pointer).
  • -2: There is no element with that name.
  • -3: The element can not be set as camera instance because it is in a more private scope than the scene.
  • -4: The element is not an instance.
virtual Sint32 mi::neuraylib::IScene::set_options ( const char *  options)
pure virtual

Sets the options of this scene.

Parameters
options The name of the options.
Returns
  • 0: Success.
  • -1: Invalid parameters (NULL pointer).
  • -2: There is no element with that name.
  • -3: The element can not be set as options because it is in a more private scope than the scene.
  • -4: The element is not an options object.
virtual Sint32 mi::neuraylib::IScene::set_rootgroup ( const char *  root)
pure virtual

Sets the root group of this scene.

Parameters
root The root group.
Returns
  • 0: Success.
  • -1: Invalid parameters (NULL pointer).
  • -2: There is no element with that name.
  • -3: The element can not be set as root group because it is in a more private scope than the scene.
  • -4: The element is not a group.