neuray API Programmer's Manual

mi::neuraylib::IGroup Class Reference

[Scene graph structure]

Description

A group is a container for other scene elements. Groups are typically used to structure the scene elements. Groups can be nested and thus can be used to create a hierarchy of scene elements. Typically, groups are used together with instances, either as group of instances or instance of a group. However, any scene element can be part of a group.

The root node of the scene graph is given by a top-level group (called root group).

The order of elements in a group does not matter.

Public Member Functions

virtual Sint32 attach( const char* scene_element) =0
Attaches a scene element to the group. More...
virtual void clear() =0
Removes all elements in the array of grouped elements.
virtual Sint32 detach( const char* scene_element) =0
Detaches a scene element from the group. More...
virtual const char* get_element( Uint32 index) const =0
Returns the name of the element index. More...
virtual Uint32 get_length() const =0
Returns the number of elements.

Member Functions

virtual Sint32 mi::​neuraylib::​IGroup::attach( const char* scene_element) [pure virtual]

Attaches a scene element to the group. Adding an element that is already in the group is an undefined operation.

Parameters

scene_element
The element to attach.

Returns

  • 0: Success.
  • -1: Invalid parameters (NULL pointer).
  • -2: There is no element with that name.
  • -3: The element can not be attached to the group because it is in a more private scope than the group.
virtual void mi::​neuraylib::​IGroup::clear() [pure virtual]

Removes all elements in the array of grouped elements.

virtual Sint32 mi::​neuraylib::​IGroup::detach( const char* scene_element) [pure virtual]

Detaches a scene element from the group. Removing an element that is not in the group has no effect. The detached element is not changed or deleted.

Parameters

scene_element
The element to detach.

Returns

  • 0: Success.
  • -1: Invalid parameters (NULL pointer).
  • -2: There is no element with that name.
  • -3: The element is not attached to the group.
virtual const char* mi::​neuraylib::​IGroup::get_element( Uint32 index) const [pure virtual]

Returns the name of the element index.

Returns

The name of the requested element, or NULL if index is out of bounds.

virtual Uint32 mi::​neuraylib::​IGroup::get_length() const [pure virtual]

Returns the number of elements.