IOptions

Functions

CID

GetClassID

RED_RC

RemoveOverloadedOptions

RED_RC

SetAllDefaultOptions

RED_RC

GetOptionValue

RED_RC

GetOptionValue

RED_RC

GetOptionValue

RED_RC

GetOptionValue

RED_RC

SetOptionValue

RED_RC

SetOptionValue

RED_RC

SetOptionValue

RED_RC

GetOptionValueFormat

RED_RC

GetOptionInfo

RED_RC

GetOptionInfo

RED_RC

GetOptionInfo

RED_RC

GetOptionInfo

Detailed Description

class IOptions : public RED::IREDObject

Option management class.

@related Options, class RED::IResourceManager, class RED::IWindow, class RED::IViewpoint

This is the REDsdk options management class. Options defined through this interface let the application change the default rendering behavior of REDsdk and modify the way resources are managed.

REDsdk has a hierarchical option system. Options can be changed at three different API object levels:

By default, a camera option value will be inherited from a window option value that is itself inherited from the resource manager option value, as illustrated by the image below:

../build/doxygen/RED/xml/API_OptionsInherit.png

If we change for example the value of “RED::OPTIONS_RAY_SHADOWS” at the window option level, then all cameras linked to that window will inherit of the value defined at the window level and the window no longer inherits from the default value stored in the resource manager. If a window child camera also changes that option value, it’ll remove the inheritance link and override the value set at the window level.

The full list of options is defined by the RED::OPTIONS enumeration. Note that some options are restricted to windows or to the resource manager.

The RED::OPTIONS_RAY_ENABLE_SOFT_TRACER option is a particular option that must be set once for all at the application startup, during the first transaction before any REDsdk operation.

Public Functions

virtual RED_RC RemoveOverloadedOptions(const RED::State &iState) = 0

Removes any options overload on the object.

Removes any option value that may have been specifically set on the object itself. If the caller is a window or a camera, all options are inheriting their values from higher level objects after the call. If the caller is the resource manager, this method has no effect as the resource manager is the higher level object and it has values for all options and no inheritance.

Parameters

iState – Current transaction.

Returns

RED_OK when the operation has succeeded,

RED_BAD_PARAM if the method has received an invalid parameter,

RED_ALLOC_FAILURE if an internal allocation has failed,

RED_WORKFLOW_ERROR if a transaction error has occurred,

RED_FAIL otherwise.

virtual RED_RC SetAllDefaultOptions(const RED::State &iState) = 0

Overloads all options values to default values.

This method overloads all options values for the class, and assigns default values for each of them. Note that the RED::OPTIONS_RAY_ENABLE_SOFT_TRACER is ignored by the method.

Parameters

iState – Current transaction.

Returns

RED_OK when the operation has succeeded,

RED_BAD_PARAM if the method has received an invalid parameter,

RED_ALLOC_FAILURE if an internal allocation has failed,

RED_WORKFLOW_ERROR if a transaction error has occurred,

RED_FAIL otherwise.

virtual RED_RC GetOptionValue(bool &oValue, RED::OPTIONS iOption, const RED::Object *iPathWindow, int iStateNumber = -1) const = 0

Returns the value of an option for the object.

Returns the value of a given option. Note that if no value has been set for the considered option for the object, the inheritance rule apply and we look for a value in a parent class of the object.

If we’re a camera, we look for a parent window option. In this case, we may need to supply a ‘iPathWindow’ information to solve possible multiple inheritance paths. If we’re a window, we look for the resource manager option value if we have no value set for the class.

Parameters
  • oValue – Option value.

  • iOption – Option identifier to access. Refer to REDOptionList.h for a list of all options labels.

  • iPathWindow – Context information parameter used to solve any multiple path resolution issue for the option inheritance model, used if the caller is a camera. This parameter can be set to NULL and will be ignored if the caller is a window or the resource manager. If this parameter is NULL and if we’re a camera, we use the first window we’re linked to to resolve any ambiguous path.

  • iStateNumber – Queried state number.

Returns

RED_OK when the operation has succeeded,

RED_BAD_PARAM if the method has received an invalid parameter,

RED_WORKFLOW_ERROR if the option format does not match this API’s format,

RED_FAIL otherwise.

virtual RED_RC GetOptionValue(float &oValue, RED::OPTIONS iOption, const RED::Object *iPathWindow, int iStateNumber = -1) const = 0

Returns the value of an option for the object.

Returns the value of a given option. Note that if no value has been set for the considered option for the object, the inheritance rule apply and we look for a value in a parent class of the object.

If we’re a camera, we look for a parent window option. In this case, we may need to supply a ‘iPathWindow’ information to solve possible multiple inheritance paths. If we’re a window, we look for the resource manager option value if we have no value set for the class.

Parameters
  • oValue – Option value.

  • iOption – Option identifier to access. Refer to REDOptionList.h for a list of all options labels.

  • iPathWindow – Context information parameter used to solve any multiple path resolution issue for the option inheritance model, used if the caller is a camera. This parameter can be set to NULL and will be ignored if the caller is a window or the resource manager. If this parameter is NULL and if we’re a camera, we use the first window we’re linked to to resolve any ambiguous path.

  • iStateNumber – Queried state number.

Returns

RED_OK when the operation has succeeded,

RED_BAD_PARAM if the method has received an invalid parameter,

RED_WORKFLOW_ERROR if the option format does not match this API’s format,

RED_FAIL otherwise.

virtual RED_RC GetOptionValue(double &oValue, RED::OPTIONS iOption, const RED::Object *iPathWindow, int iStateNumber = -1) const = 0

Returns the value of an option for the object.

Returns the value of a given option. Note that if no value has been set for the considered option for the object, the inheritance rule apply and we look for a value in a parent class of the object.

If we’re a camera, we look for a parent window option. In this case, we may need to supply a ‘iPathWindow’ information to solve possible multiple inheritance paths. If we’re a window, we look for the resource manager option value if we have no value set for the class.

Parameters
  • oValue – Option value.

  • iOption – Option identifier to access. Refer to REDOptionList.h for a list of all options labels.

  • iPathWindow – Context information parameter used to solve any multiple path resolution issue for the option inheritance model, used if the caller is a camera. This parameter can be set to NULL and will be ignored if the caller is a window or the resource manager. If this parameter is NULL and if we’re a camera, we use the first window we’re linked to to resolve any ambiguous path.

  • iStateNumber – Queried state number.

Returns

RED_OK when the operation has succeeded,

RED_BAD_PARAM if the method has received an invalid parameter,

RED_WORKFLOW_ERROR if the option format does not match this API’s format,

RED_FAIL otherwise.

virtual RED_RC GetOptionValue(int &oValue, RED::OPTIONS iOption, const RED::Object *iPathWindow, int iStateNumber = -1) const = 0

Returns the value of an option for the object.

Return the value of a given option. Note that if no value has been set for the considered option for the object, the inheritance rule apply and we look for a value in a parent class of the object.

If we’re a camera, we look for a parent window option. In this case, we may need to supply a ‘iPathWindow’ information to solve possible multiple inheritance paths. If we’re a window, we look for the resource manager option value if we have no value set for the class.

Parameters
  • oValue – Option value.

  • iOption – Option identifier to access. Refer to REDOptionList.h for a list of all options labels.

  • iPathWindow – Context information parameter used to solve any multiple path resolution issue for the option inheritance model, used if the caller is a camera. This parameter can be set to NULL and will be ignored if the caller is a window or the resource manager. If this parameter is NULL and if we’re a camera, we use the first window we’re linked to to resolve any ambiguous path.

  • iStateNumber – Queried state number.

Returns

RED_OK when the operation has succeeded,

RED_BAD_PARAM if the method has received an invalid parameter,

RED_WORKFLOW_ERROR if the option format does not match this API’s format,

RED_FAIL otherwise.

virtual RED_RC SetOptionValue(RED::OPTIONS iOption, bool iValue, const RED::State &iState) = 0

Defines an option value for the object.

Defines the value of an option for the class. The option is considered overloaded for the class and the inheritance mechanism no longer applies.

See also \ref wf_hello_world.

Parameters
  • iOption – Option label or number whose value is to be changed. Refer to REDOptionList.h for a list of all options labels.

  • iValue – Option value to be set.

  • iState – Current transaction parameter.

Returns

RED_OK when the option was successfully modified,

RED_ALLOC_FAILURE if an internal allocation has failed,

RED_BAD_PARAM if the method has received an invalid parameter,

RED_BAD_PARAM if the option being set does not apply to the class,

RED_WORKFLOW_ERROR if the option format does not match this API’s format,

RED_FAIL otherwise.

virtual RED_RC SetOptionValue(RED::OPTIONS iOption, double iValue, const RED::State &iState) = 0

Defines an option value for the object.

Defines the value of an option for the class. The option is considered overloaded for the class and the inheritance mechanism no longer applies.

See also \ref wf_hello_world.

Parameters
  • iOption – Option label or number whose value is to be changed. Refer to REDOptionList.h for a list of all options labels.

  • iValue – Option value to be set.

  • iState – Current transaction parameter.

Returns

RED_OK when the option was successfully modified,

RED_ALLOC_FAILURE if an internal allocation has failed,

RED_BAD_PARAM if the method has received an invalid parameter,

RED_BAD_PARAM if the option being set does not apply to the class,

RED_WORKFLOW_ERROR if the option format does not match this API’s format,

RED_FAIL otherwise.

virtual RED_RC SetOptionValue(RED::OPTIONS iOption, int iValue, const RED::State &iState) = 0

Defines an option value for the object.

Defines the value of an option for the class. The option is considered overloaded for the class and the inheritance mechanism no longer applies.

See also \ref wf_hello_world.

Parameters
  • iOption – Option label or number whose value is to be changed. Refer to REDOptionList.h for a list of all options labels.

  • iValue – Option value to be set.

  • iState – Current transaction parameter.

Returns

RED_OK when the option was successfully modified,

RED_ALLOC_FAILURE if an internal allocation has failed,

RED_BAD_PARAM if the method has received an invalid parameter,

RED_BAD_PARAM if the option being set does not apply to the class,

RED_WORKFLOW_ERROR if the option format does not match this API’s format,

RED_WORKFLOW_ERROR if the option is

RED::OPTIONS_RAY_ENABLE_SOFT_TRACER

and if we’re not at the application startup. This option must be set before any other REDsdk operation, including a window creation for instance.

RED_FAIL otherwise.

virtual RED_RC GetOptionValueFormat(RED::OPTION_VALUE_FORMAT &oFormat, RED::OPTIONS iOption) const = 0

Retrieves the format of an option value.

Parameters
  • oFormat – Internal format of the option.

  • iOption – Option number.

Returns

RED_OK if the method has succeeded,

RED_BAD_PARAM if the method has received an invalid parameter,

RED_FAIL otherwise.

virtual RED_RC GetOptionInfo(bool &oDefaultValue, bool &oMinValue, bool &oMaxValue, RED::OPTIONS iOption) const = 0

Retrieves information about an option.

The returned range is inclusive: The option value is in [oMinValue, oMaxValue].

Parameters
  • oDefaultValue – Default value of the option.

  • oMinValue – Minimal possible value of the option.

  • oMaxValue – Maximal possible value of the option.

  • iOption – Option number.

Returns

RED_OK if the method has succeeded,

RED_BAD_PARAM if the method has received an invalid parameter,

RED_WORKFLOW_ERROR if the option format does not match this API’s format,

RED_FAIL otherwise.

virtual RED_RC GetOptionInfo(float &oDefaultValue, float &oMinValue, float &oMaxValue, RED::OPTIONS iOption) const = 0

Retrieves information about an option.

The returned range is inclusive: The option value is in [oMinValue, oMaxValue].

Parameters
  • oDefaultValue – Default value of the option.

  • oMinValue – Minimal possible value of the option.

  • oMaxValue – Maximal possible value of the option.

  • iOption – Option number.

Returns

RED_OK if the method has succeeded,

RED_BAD_PARAM if the method has received an invalid parameter,

RED_WORKFLOW_ERROR if the option format does not match this API’s format,

RED_FAIL otherwise.

virtual RED_RC GetOptionInfo(double &oDefaultValue, double &oMinValue, double &oMaxValue, RED::OPTIONS iOption) const = 0

Retrieves information about an option.

The returned range is inclusive: The option value is in [oMinValue, oMaxValue].

Parameters
  • oDefaultValue – Default value of the option.

  • oMinValue – Minimal possible value of the option.

  • oMaxValue – Maximal possible value of the option.

  • iOption – Option number.

Returns

RED_OK if the method has succeeded,

RED_BAD_PARAM if the method has received an invalid parameter,

RED_WORKFLOW_ERROR if the option format does not match this API’s format,

RED_FAIL otherwise.

virtual RED_RC GetOptionInfo(int &oDefaultValue, int &oMinValue, int &oMaxValue, RED::OPTIONS iOption) const = 0

Retrieves information about an option.

The returned range is inclusive: The option value is in [oMinValue, oMaxValue].

Parameters
  • oDefaultValue – Default value of the option.

  • oMinValue – Minimal possible value of the option.

  • oMaxValue – Maximal possible value of the option.

  • iOption – Option number.

Returns

RED_OK if the method has succeeded,

RED_BAD_PARAM if the method has received an invalid parameter,

RED_WORKFLOW_ERROR if the option format does not match this API’s format,

RED_FAIL otherwise.

Public Static Functions

static inline RED::CID GetClassID()