# IRsWidgetToolController Struct Reference

Inherits IUnknown.

List of all members.

## Public Member Functions
HRESULT | AddBackgroundListener (IRsUnknownBackgroundController *pController)
HRESULT | RemoveBackgroundListener (IRsUnknownBackgroundController *pController)
HRESULT | DeactivateBackgroundListener (IRsUnknownBackgroundController *pController)
HRESULT | AddForegroundListener (IRsUnknownForegroundController *pController)
HRESULT | RemoveForegroundListener (IRsUnknownForegroundController *pController)
HRESULT | DeactivateForegroundListener (IRsUnknownForegroundController *pController)
HRESULT | GetLastRaycastRay (RtPoint *pPosition, RtVector3f *pDirection)
HRESULT | GetFocus (RtBool *pFocus)
HRESULT | SetIntersectionTolerance (RtFloat fDistance)
HRESULT | GetIntersectionTolerance (RtFloat *pfDistance)
HRESULT | CheckNodeWidgetActive (IRsNode *pNode)
HRESULT | GetActiveWidgetController (IRsWidgetController **ppCtrl)

## Detailed Description

interface IRsWidgetToolController

Singleton RsWidgetToolController interfaces widgets with tool manager.

- It handles raycasting and widget active surface detection, dispatches messages to widgets when active etc.

## Member Function Documentation

HRESULT IRsWidgetToolController::AddBackgroundListener | ( | IRsUnknownBackgroundController * | pController | ) |

Add background controller

HRESULT IRsWidgetToolController::RemoveBackgroundListener | ( | IRsUnknownBackgroundController * | pController | ) |

Add background controller

HRESULT IRsWidgetToolController::DeactivateBackgroundListener | ( | IRsUnknownBackgroundController * | pController | ) |

Force deactivation of controller if it is active.

HRESULT IRsWidgetToolController::AddForegroundListener | ( | IRsUnknownForegroundController * | pController | ) |

Add foreground controller (with activation surfaces)

HRESULT IRsWidgetToolController::RemoveForegroundListener | ( | IRsUnknownForegroundController * | pController | ) |

Remove foreground controller

HRESULT IRsWidgetToolController::DeactivateForegroundListener | ( | IRsUnknownForegroundController * | pController | ) |

deactivate foreground controller if it is active

HRESULT IRsWidgetToolController::GetLastRaycastRay | ( | RtPoint * | pPosition,
|  | RtVector3f * | pDirection |
| ) |  |  |

Get last ray parameters used for raycasting surfaces

HRESULT IRsWidgetToolController::GetFocus | ( | RtBool * | pFocus | ) |

Check if widget manager is focused in tool manager or not.

HRESULT IRsWidgetToolController::SetIntersectionTolerance | ( | RtFloat | fDistance | ) |

Set tolerance distance for cursor ray-widget intersections in screen pixels.

HRESULT IRsWidgetToolController::GetIntersectionTolerance | ( | RtFloat * | pfDistance | ) |

Get tolerance distance for cursor ray-widget intersections in screen pixels.

HRESULT IRsWidgetToolController::CheckNodeWidgetActive | ( | IRsNode * | pNode | ) |

Check if specified node is inside widget that is currently active.

Parameters:

  | pNode | Widget node

Returns:
  S_OK if widget that contains specified node is active, S_FALSE if it is not active, E_FAIL otherwise.

HRESULT IRsWidgetToolController::GetActiveWidgetController | ( | IRsWidgetController ** | ppCtrl | ) |

Return currently active (the one receiving mouse messages) widget tool.

Parameters:

  | ppCtrl | is filled with active widget controller, NULL is returned if no tool is active

Returns:
  Standard HRESULT processing.