# IRnActiveWidget Interface Reference

Inherits IUnknown.

List of all members.

## Public Member Functions
HRESULT | SetActiveAspect ([in] IRnWidgetAspect *pController)
HRESULT | SetWidgetPrototype ([in] IRnWidget *pPrototype)
HRESULT | Cleanup ()
HRESULT | SetDefaultCoordinateSystemConnector ([in] CONID *pConID,[in] IRsUnknownCoordinateSystem *ppCoordSystem)
HRESULT | GetWidgetActiveStatus ([out, retval] RtBool *pbActive)
HRESULT | AddActionToExecutionQueue ([in]IRsNode *pNode)
HRESULT | ExecuteCommandQueue ()
HRESULT | SetViewportParameters ([in]IRsNode *pViewNode,[in]RtRenderTargetInfo *pRenderTagetInfo,[in]RtLayerInfo *pLayerInfo)
HRESULT | SetViewportData ([in]IRsNode *pViewNode,[in]RtRenderTargetInfo *pRenderTagetInfo,[in]RtLayerInfo *pLayerInfo)
HRESULT | GetCameraProjectionCompensationScale ([out] RtVector4f *pScale)
HRESULT | GetCameraTransformMatrix ([out] RtMatrixf *pTransformMatrix)
HRESULT | GetCameraTransformMatrixInv ([out] RtMatrixf *pTransformMatrix)
HRESULT | GetCameraProjectionMatrix ([out] RtMatrixf *pProjectionMatrix)
HRESULT | GetCameraPosition ([out] RtVector3f *pCameraPosition)
HRESULT | GetCameraNearPlane ([out] RtVector4f *pCameraNearPlane)
HRESULT | GetRenderTargetInfo ([out] RtRenderTargetInfo *pRenderTagetInfo)
HRESULT | GetLayerInfo ([out] RtLayerInfo *pLayerInfo)
HRESULT | ProcessMouseEvent ([in] RtBool bSequenceStart,[in]RtMouseEvent *pEvent,[in]IRsNode *pViewNode)
HRESULT | UpdateWidget ()
HRESULT | IsVisible ([out, retval] RtBool *pbVisible)
HRESULT | LockWidget ()
HRESULT | UnlockWidget ()
HRESULT | GetWidgetPrototype ([out] IRnWidget **ppPrototype)
HRESULT | GetActiveAspect ([out] BSTR *pbAspectName)
HRESULT | GetActiveAspectNode ([out, retval] IRnWidgetAspect **ppWc)
HRESULT | Activate ()
HRESULT | GetWidgetDisplacement ([out, retval] RtMatrixf *pMatrix)
HRESULT | SetWidgetDisplacement ([in] RtMatrixf *pMatrix)
HRESULT | GetLocalTimestamp ([out, retval] RtUlong *puTimestamp)
HRESULT | GetActivationLayer ([out, retval] RtBool *pbLayer)
HRESULT | GetWidgetParameters ([out] IRdWidgetParameters **ppWp)
HRESULT | UpdateWidgetParameters ([in] IRdWidgetParameters *pWp)
HRESULT | SetManagedState ([in] RtBool bManaged)
HRESULT | GetManagedState ([out] RtBool *pbManaged)
HRESULT | SetControlledObjectsListManagement ([in] RtBool bExternalManagement)
HRESULT | Reinitialize ()
HRESULT | GetActiveViewNode (IRsNode **pViewNode)
HRESULT | GetRenderViewNode (IRsNode **pViewNode)
HRESULT | SetWidgetGroupId (GUID gGroupId)
HRESULT | GetWidgetGroupId (GUID *pgGroupId)
HRESULT | SendOnActivateDoMessage (IRcUndoRedoGroup *pUndoRedo)
HRESULT | SendOnActivateUndoMessage (IRcUndoRedoGroup *pUndoRedo)
HRESULT | SendOnDeactivateDoMessage (IRcUndoRedoGroup *pUndoRedo)
HRESULT | SendOnDeactivateUndoMessage (IRcUndoRedoGroup *pUndoRedo)
HRESULT | CheckActivationPossible (RtBool *pbActivationPossible)
HRESULT | GetWidgetActivationEvent (RtMouseEvent *pEvent, IRsNode **ppViewNode)
HRESULT | SetWidgetActivationEvent (RtMouseEvent *pEvent, IRsNode *pViewNode)
HRESULT | UpdateWidgetVisibility ()
HRESULT | SetEventHandling ([in] RtBool bEnable)
HRESULT | GetActiveCamera (IRsNode **ppCamera)
HRESULT | SetLocalVisibility ([in] RtBool bVisible)
HRESULT | GetLocalVisibility ([out, retval] RtBool *pbVisible)

## Detailed Description

IRnActiveWidget is interface to activated managed/local widgets.

## Member Function Documentation

HRESULT IRnActiveWidget::SetActiveAspect | ( | [in] IRnWidgetAspect * | pController | ) |

Set active widget active aspect for activation.

Parameters:

  | pController | [in] Aspect node.

Returns:
  standard HRESULT processing can be applied to returned value.

HRESULT IRnActiveWidget::SetWidgetPrototype | ( | [in] IRnWidget * | pPrototype | ) |

Set widget prototype node.

- Prototype can be NULL in case of scene widgets which are activated directly and not using prototypes and specialized activation layers.

Parameters:

  | pPrototype | [in] Widget prototype node.

Returns:
  standard HRESULT processing can be applied to returned value.

HRESULT IRnActiveWidget::Cleanup | ( |  | ) |

Uninitialize active widget.

Returns:
  standard HRESULT processing can be applied to returned value.

HRESULT IRnActiveWidget::SetDefaultCoordinateSystemConnector | ( | [in] CONID * | pConID,
|  | [in] IRsUnknownCoordinateSystem * | ppCoordSystem |
| ) |  |  |

Set default coordinate system connector con ID and connector node.

Parameters:

  | pConID | [in] Default coordinate system connector.
  | ppCoordSystem | [in] Default coordinate system.

Returns:
  standard HRESULT processing can be applied to returned value.

HRESULT IRnActiveWidget::GetWidgetActiveStatus | ( | [out, retval] RtBool * | pbActive | ) |

Check whether there is any widget active.

- Function provided for tools convenience and fast access.
  Returns:
    pbActive [out,retval] Returns true if active widget(s) detected.

    standard HRESULT processing can be applied to returned value

HRESULT IRnActiveWidget::AddActionToExecutionQueue | ( | [in] IRsNode * | pNode | ) |

Add executed action to internal execution queue.

Parameters:

  | pNode | [in] Action node/command to execute.

Returns:
  standard HRESULT processing can be applied to returned value.

HRESULT IRnActiveWidget::ExecuteCommandQueue | ( |  | ) |

Execute all commands added to internal execution queue.

Returns:
  standard HRESULT processing can be applied to returned value.

HRESULT IRnActiveWidget::SetViewportParameters | ( | [in] IRsNode * | pViewNode,
|  | [in] RtRenderTargetInfo * | pRenderTagetInfo,
|  | [in] RtLayerInfo * | pLayerInfo |
| ) |  |  |

Called to set internal view parameters for view node for which widget will be rendered.

Parameters:

  | pViewNode | [in] View node that will be rendered.
  | pRenderTagetInfo | [in] View render target info.
  | pLayerInfo | [in] View layer info.

Returns:
  standard HRESULT processing can be applied to returned value.

HRESULT IRnActiveWidget::SetViewportData | ( | [in] IRsNode * | pViewNode,
|  | [in] RtRenderTargetInfo * | pRenderTagetInfo,
|  | [in] RtLayerInfo * | pLayerInfo |
| ) |  |  |

Called to set internal view parameters for view node in which tool is activated.

Parameters:

  | pViewNode | [in] View node in which user has clicked and fired widget tool/command.
  | pRenderTagetInfo | [in] View node render target info.
  | pLayerInfo | [in] View node layer info.

Returns:
  standard HRESULT processing can be applied to returned value.

HRESULT IRnActiveWidget::GetCameraProjectionCompensationScale | ( | [out] RtVector4f * | pScale | ) |

Return plane used for projective scaling compensation - to keep widget same screen-size.

Parameters:

  | pScale | [out] Plane equation that can be used to calculate projection scale compensation ratio.

Returns:
  standard HRESULT processing can be applied to returned value

HRESULT IRnActiveWidget::GetCameraTransformMatrix | ( | [out] RtMatrixf * | pTransformMatrix | ) |

Return camera transformation matrix for active view.

Parameters:

  | pTransformMatrix | [out] Camera transformation matrix.

Returns:
  standard HRESULT processing can be applied to returned value.

HRESULT IRnActiveWidget::GetCameraTransformMatrixInv | ( | [out] RtMatrixf * | pTransformMatrix | ) |

Return inverse of camera transformation matrix for active view.

Parameters:

  | pTransformMatrix | [out] Inverse of camera transform matrix.

Returns:
  standard HRESULT processing can be applied to returned value.

HRESULT IRnActiveWidget::GetCameraProjectionMatrix | ( | [out] RtMatrixf * | pProjectionMatrix | ) |

Return active camera projection matrix.

Parameters:

  | pProjectionMatrix | [out] Camera projection matrix.

Returns:
  standard HRESULT processing can be applied to returned value.

HRESULT IRnActiveWidget::GetCameraPosition | ( | [out] RtVector3f * | pCameraPosition | ) |

Return camera position.

Parameters:

  | pCameraPosition | [out] Active camera position.

Returns:
  standard HRESULT processing can be applied to returned value.

HRESULT IRnActiveWidget::GetCameraNearPlane | ( | [out] RtVector4f * | pCameraNearPlane | ) |

Return camera near-plane used for clipping.

Parameters:

  | pCameraNearPlane | [out] Camera near plane.

Returns:
  standard HRESULT processing can be applied to returned value.

HRESULT IRnActiveWidget::GetRenderTargetInfo | ( | [out] RtRenderTargetInfo * | pRenderTagetInfo | ) |

Get active render target info.

Parameters:

  | pRenderTagetInfo | [out] Filled with active render target info.

Returns:
  standard HRESULT processing can be applied to returned value.

HRESULT IRnActiveWidget::GetLayerInfo | ( | [out] RtLayerInfo * | pLayerInfo | ) |

Get active layer info.

Parameters:

  | pLayerInfo | [out] Layer info.

Returns:
  standard HRESULT processing can be applied to returned value

HRESULT IRnActiveWidget::ProcessMouseEvent | ( | [in] RtBool | bSequenceStart,
|  | [in] RtMouseEvent * | pEvent,
|  | [in] IRsNode * | pViewNode |
| ) |  |  |

Set mouse event related parameters into internal active widget state (keys, buttons,...).

Parameters:

  | bSequenceStart | [in] is true if this is first activation. False means that user is transiting from one tool to another.
  | pEvent | [in] Activation mouse event.
  | pViewNode | [in] Activation view node.

Returns:
  standard HRESULT processing can be applied to returned value.

HRESULT IRnActiveWidget::UpdateWidget | ( |  | ) |

Force widget update/refresh.

Returns:
  standard HRESULT processing can be applied to returned value.

HRESULT IRnActiveWidget::IsVisible | ( | [out, retval] RtBool * | pbVisible | ) |

Check if widget is visible in current context specified by active view parameters.

Parameters:

  | pbVisible | [out, retval] Set to true if widget is visible.

Returns:
  standard HRESULT processing can be applied to returned value.

HRESULT IRnActiveWidget::LockWidget | ( |  | ) |

Lock widget for current thread to prevent thread sync issues.

Remarks:
  Please note, that widget functions can be called from rendering/read/master threads and careless locking may cause deadlocks.

Returns:
  standard HRESULT processing can be applied to returned value.

HRESULT IRnActiveWidget::UnlockWidget | ( |  | ) |

Unlock widget. Check LockWidget for details.

Returns:
  standard HRESULT processing can be applied to returned value.

HRESULT IRnActiveWidget::GetWidgetPrototype | ( | [out] IRnWidget ** | ppPrototype | ) |

Get widget prototype node.

Parameters:

  | ppPrototype | [out] Filled with prototype node or NULL if no prorotype exists.

Returns:
  standard HRESULT processing can be applied to returned value.

HRESULT IRnActiveWidget::GetActiveAspect | ( | [out] BSTR * | pbAspectName | ) |

Get widget active aspect name.

Parameters:

  | pbAspectName | [out] BSTR string filled with active aspect (if any).

Returns:
  standard HRESULT processing can be applied to returned value.

HRESULT IRnActiveWidget::GetActiveAspectNode | ( | [out, retval] IRnWidgetAspect ** | ppWc | ) |

Get widget active aspect node.

Returns:
  ppWc [out,retval] Widget activation aspect node.

  standard HRESULT processing can be applied to returned value.

HRESULT IRnActiveWidget::Activate | ( |  | ) |

Called to activate tools.

Returns:
  standard HRESULT processing can be applied to returned value.

HRESULT IRnActiveWidget::GetWidgetDisplacement | ( | [out, retval] RtMatrixf * | pMatrix | ) |

Get internal widget displacement matrix.

Returns:
  pMatrix [out,retval] Internal widget displacement.

  standard HRESULT processing can be applied to returned value.

HRESULT IRnActiveWidget::SetWidgetDisplacement | ( | [in] RtMatrixf * | pMatrix | ) |

Set internal widget displacement matrix.

Parameters:

  | pMatrix | [in] Internal displacement matrix to set.

Returns:
  standard HRESULT processing can be applied to returned value.

HRESULT IRnActiveWidget::GetLocalTimestamp | ( | [out, retval] RtUlong * | puTimestamp | ) |

Get widget timestamp used for caching.

- Timestamp is taken from widget prototype during activation.
- If timestamp changes for widget template, old wigdets are discarded and new widget is created.

Returns:
  puTimestamp [out,retval] Widget template timestamp during widget activation.

  standard HRESULT processing can be applied to returned value.

HRESULT IRnActiveWidget::GetActivationLayer | ( | [out, retval] RtBool * | pbLayer | ) |

Get widget activation layer ID.

Returns:
  pbLayer [out,retval] True, if widget is activated into front layer, false otherwise.

  standard HRESULT processing can be applied to returned value.

HRESULT IRnActiveWidget::GetWidgetParameters | ( | [out] IRdWidgetParameters ** | ppWp | ) |

Get internal widget parameters.

Parameters:

  | ppWp | [out] Filled with internal widget parameters.

Returns:
  standard HRESULT processing can be applied to returned value.

HRESULT IRnActiveWidget::UpdateWidgetParameters | ( | [in] IRdWidgetParameters * | pWp | ) |

Set new internal widget parameters and perform internal refresh.

Parameters:

  | pWp | [in] Widget parameters to set.

Returns:
  standard HRESULT processing can be applied to returned value.

HRESULT IRnActiveWidget::SetManagedState | ( | [in] RtBool | bManaged | ) |

Set auto-managing state.

Parameters:

  | bManaged | [in] Set to true if widget is auto-managed (activated/deactivated).

Returns:
  standard HRESULT processing can be applied to returned value.

HRESULT IRnActiveWidget::GetManagedState | ( | [out] RtBool * | pbManaged | ) |

Get auto-managing state.

Parameters:

  | pbManaged | [out] Filled with current auto-managing state.

Returns:
  standard HRESULT processing can be applied to returned value.

HRESULT IRnActiveWidget::SetControlledObjectsListManagement | ( | [in] RtBool | bExternalManagement | ) |

SetControlledObjectsListManagement

Parameters:

  | bExternalManagement[in] | Set to true if management desired.

Returns:
  standard HRESULT processing can be applied to returned value.

HRESULT IRnActiveWidget::Reinitialize | ( |  | ) |

Reinitialize.

Returns:
  standard HRESULT processing can be applied to returned value.

HRESULT IRnActiveWidget::GetActiveViewNode | ( | IRsNode ** | pViewNode | ) |

GetActiveViewNode

Returns:
  pViewNode [out,retval] Returns active view node.

  standard HRESULT processing can be applied to returned value.

HRESULT IRnActiveWidget::GetRenderViewNode | ( | IRsNode ** | pViewNode | ) |

GetRenderViewNode

Returns:
  pViewNode [out,retval] Returns render view node.

  standard HRESULT processing can be applied to returned value.

HRESULT IRnActiveWidget::SetWidgetGroupId | ( | GUID | gGroupId | ) |

SetWidgetGroupId

Parameters:

  | gGroupId | [in] GUID for widget group.

Returns:
  standard HRESULT processing can be applied to returned value.

HRESULT IRnActiveWidget::GetWidgetGroupId | ( | GUID * | pgGroupId | ) |

GetWidgetGroupId

Returns:
  pgGroupId [out,retval] Returns widget group GUID.

  standard HRESULT processing can be applied to returned value.

HRESULT IRnActiveWidget::SendOnActivateDoMessage | ( | IRcUndoRedoGroup * | pUndoRedo | ) |

SendOnActivateDoMessage

Parameters:

  | pUndoRedo | [in] .

Returns:
  standard HRESULT processing can be applied to returned value.

HRESULT IRnActiveWidget::SendOnActivateUndoMessage | ( | IRcUndoRedoGroup * | pUndoRedo | ) |

SendOnActivateUndoMessage

Parameters:

  | pUndoRedo | [in] .

Returns:
  standard HRESULT processing can be applied to returned value.

HRESULT IRnActiveWidget::SendOnDeactivateDoMessage | ( | IRcUndoRedoGroup * | pUndoRedo | ) |

SendOnDeactivateDoMessage

Parameters:

  | pUndoRedo | [in] .

Returns:
  standard HRESULT processing can be applied to returned value.

HRESULT IRnActiveWidget::SendOnDeactivateUndoMessage | ( | IRcUndoRedoGroup * | pUndoRedo | ) |

SendOnDeactivateUndoMessage

Parameters:

  | pUndoRedo | [in] .

Returns:
  standard HRESULT processing can be applied to returned value.

HRESULT IRnActiveWidget::CheckActivationPossible | ( | RtBool * | pbActivationPossible | ) |

CheckActivationPossible

Parameters:

  | pbActivationPossible | [out] Boolean value returned.

Returns:
  standard HRESULT processing can be applied to returned value.

HRESULT IRnActiveWidget::GetWidgetActivationEvent | ( | RtMouseEvent * | pEvent,
|  | IRsNode ** | ppViewNode |
| ) |  |  |

GetWidgetActivationEvent

Parameters:

  | pEvent | [in] .

Returns:
  ppViewNode [out,retval] View node which sent event.

  standard HRESULT processing can be applied to returned value.

HRESULT IRnActiveWidget::SetWidgetActivationEvent | ( | RtMouseEvent * | pEvent,
|  | IRsNode * | pViewNode |
| ) |  |  |

SetWidgetActivationEvent

Parameters:

  | pEvent | .
  | pViewNode | .

Returns:
  standard HRESULT processing can be applied to returned value.

HRESULT IRnActiveWidget::UpdateWidgetVisibility | ( |  | ) |

UpdateWidgetVisibility

Returns:
  standard HRESULT processing can be applied to returned value.

HRESULT IRnActiveWidget::SetEventHandling | ( | [in] RtBool | bEnable | ) |

SetEventHandling

Parameters:

  | bEnable | [in] .

Returns:
  standard HRESULT processing can be applied to returned value.

HRESULT IRnActiveWidget::GetActiveCamera | ( | IRsNode ** | ppCamera | ) |

GetActiveCamera

Returns:
  ppCamera [out,retval] Returns active camera.

  standard HRESULT processing can be applied to returned value.

HRESULT IRnActiveWidget::SetLocalVisibility | ( | [in] RtBool | bVisible | ) |

Set widget local visibility. Widget is visible if it is enabled in desktop and is set visible and coordinate systems and docking positions allow widget rendering.

Parameters:

  | bVisible | [in] Set to true if widget is visible.

Returns:
  standard HRESULT processing can be applied to returned value.

HRESULT IRnActiveWidget::GetLocalVisibility | ( | [out, retval] RtBool * | pbVisible | ) |

Get widget local visibility.

Parameters:

  | pbVisible | [out, retval] Set to true if widget is local visible.

Returns:
  standard HRESULT processing can be applied to returned value.