Medical Imaging Interaction Toolkit  2026.06.00
Medical Imaging Interaction Toolkit
mitk::RenderWindowBridge Class Reference

Bridge between the REST API server and the Qt/render-window layer. More...

#include <mitkRenderWindowBridge.h>

Public Types

using ScreenshotProvider = std::function< std::vector< unsigned char >(std::optional< std::pair< int, int > > size, ScreenshotFormat format)>
 Callback type for taking a screenshot. More...
 
using PositionGetter = std::function< SelectedPositionInfo()>
 Callback type for reading the current global crosshair position and scene bounds. More...
 
using PositionSetter = std::function< void(const Point3D &pos)>
 Callback type for setting the global crosshair position. More...
 
using EditorListProvider = std::function< std::vector< EditorInfo >()>
 
using StdMultiWindowListProvider = std::function< std::vector< WindowInfo >()>
 
using StdMultiEditorScreenshotProvider = std::function< std::vector< unsigned char >(std::optional< std::pair< int, int > > size, ScreenshotFormat format)>
 
using StdMultiWindowScreenshotProvider = std::function< std::vector< unsigned char >(const std::string &windowId, std::optional< std::pair< int, int > > size, ScreenshotFormat format)>
 
using StdMultiCameraGetter = std::function< CameraState(const std::string &windowId)>
 
using StdMultiCameraSetter = std::function< void(const std::string &windowId, const CameraPatch &patch)>
 
using StdMultiSelectedSliceGetter = std::function< SliceState(const std::string &windowId)>
 
using StdMultiSelectedSliceStepSetter = std::function< void(const std::string &windowId, unsigned int step)>
 Callback type: set the selected slice of a StdMulti 2D window by step index. More...
 
using MxNWindowListProvider = std::function< std::vector< MxNWindowInfo >()>
 
using MxNEditorScreenshotProvider = std::function< std::vector< unsigned char >(std::optional< std::pair< int, int > > size, ScreenshotFormat format)>
 
using MxNWindowScreenshotProvider = std::function< std::vector< unsigned char >(const std::string &windowId, std::optional< std::pair< int, int > > size, ScreenshotFormat format)>
 
using MxNCameraGetter = std::function< CameraState(const std::string &windowId)>
 
using MxNCameraSetter = std::function< void(const std::string &windowId, const CameraPatch &patch)>
 
using MxNSelectedSliceGetter = std::function< SliceState(const std::string &windowId)>
 
using MxNSelectedSliceStepSetter = std::function< void(const std::string &windowId, unsigned int step)>
 Callback type: set the selected slice of a 2D MxN cell by step index. More...
 
using MxNSelectedPositionGetter = std::function< SelectedPositionInfo(const std::string &windowId)>
 Callback type: read the per-cell selected position (cell anchor) plus scene bounds atomically. More...
 
using MxNSelectedPositionSetter = std::function< void(const std::string &windowId, const Point3D &position)>
 
using MxNLayoutGetter = std::function< std::string()>
 Callback type: serialize the editor's current layout to a v2.0 JSON document. More...
 
using MxNLayoutSetter = std::function< std::string(const std::string &layoutJson)>
 Callback type: apply a v2.0 JSON layout document and return the freshly serialized layout (so callers can echo the new state in a PUT response without a follow-up GET). More...
 

Public Member Functions

void SetDispatcher (StorageThreadDispatcherBase *dispatcher)
 Set the thread dispatcher for UI thread dispatching. More...
 
void SetScreenshotProvider (ScreenshotProvider provider)
 Set or clear the screenshot provider callback. More...
 
void SetPositionGetter (PositionGetter getter)
 Set or clear the position getter callback. More...
 
void SetPositionSetter (PositionSetter setter)
 Set or clear the position setter callback. More...
 
void SetEditorListProvider (EditorListProvider provider)
 
void SetStdMultiWindowListProvider (StdMultiWindowListProvider provider)
 
void SetStdMultiEditorScreenshotProvider (StdMultiEditorScreenshotProvider provider)
 
void SetStdMultiWindowScreenshotProvider (StdMultiWindowScreenshotProvider provider)
 
void SetStdMultiCameraGetter (StdMultiCameraGetter getter)
 
void SetStdMultiCameraSetter (StdMultiCameraSetter setter)
 
void SetStdMultiSelectedSliceGetter (StdMultiSelectedSliceGetter getter)
 
void SetStdMultiSelectedSliceStepSetter (StdMultiSelectedSliceStepSetter setter)
 
void SetMxNWindowListProvider (MxNWindowListProvider provider)
 
void SetMxNEditorScreenshotProvider (MxNEditorScreenshotProvider provider)
 
void SetMxNWindowScreenshotProvider (MxNWindowScreenshotProvider provider)
 
void SetMxNCameraGetter (MxNCameraGetter getter)
 
void SetMxNCameraSetter (MxNCameraSetter setter)
 
void SetMxNSelectedSliceGetter (MxNSelectedSliceGetter getter)
 
void SetMxNSelectedSliceStepSetter (MxNSelectedSliceStepSetter setter)
 
void SetMxNSelectedPositionGetter (MxNSelectedPositionGetter getter)
 
void SetMxNSelectedPositionSetter (MxNSelectedPositionSetter setter)
 
void SetMxNLayoutGetter (MxNLayoutGetter getter)
 
void SetMxNLayoutSetter (MxNLayoutSetter setter)
 
void ResetCallbacks ()
 Clear all registered callbacks in a single atomic operation. More...
 
bool HasScreenshotProvider () const
 
bool HasPositionGetter () const
 
bool HasPositionSetter () const
 
bool HasEditorListProvider () const
 
bool HasStdMultiWindowListProvider () const
 
bool HasStdMultiEditorScreenshotProvider () const
 
bool HasStdMultiWindowScreenshotProvider () const
 
bool HasStdMultiCameraGetter () const
 
bool HasStdMultiCameraSetter () const
 
bool HasStdMultiSelectedSliceGetter () const
 
bool HasStdMultiSelectedSliceStepSetter () const
 
bool HasMxNWindowListProvider () const
 
bool HasMxNEditorScreenshotProvider () const
 
bool HasMxNWindowScreenshotProvider () const
 
bool HasMxNCameraGetter () const
 
bool HasMxNCameraSetter () const
 
bool HasMxNSelectedSliceGetter () const
 
bool HasMxNSelectedSliceStepSetter () const
 
bool HasMxNSelectedPositionGetter () const
 
bool HasMxNSelectedPositionSetter () const
 
bool HasMxNLayoutGetter () const
 
bool HasMxNLayoutSetter () const
 
std::vector< unsigned char > TakeScreenshot (std::optional< std::pair< int, int >> size, ScreenshotFormat format) const
 Capture a screenshot using the registered provider. More...
 
SelectedPositionInfo GetSelectedPosition () const
 Read the current global crosshair position and scene bounds atomically. More...
 
void SetSelectedPosition (const Point3D &pos) const
 Move the crosshair to the given world position. More...
 
std::vector< EditorInfo > ListEditors () const
 Invoke the editor list provider. More...
 
std::vector< WindowInfo > ListStdMultiWindows () const
 Invoke the StdMulti window list provider. More...
 
std::vector< unsigned char > TakeStdMultiEditorScreenshot (std::optional< std::pair< int, int >> size, ScreenshotFormat format) const
 Invoke the StdMulti editor screenshot provider. More...
 
std::vector< unsigned char > TakeStdMultiWindowScreenshot (const std::string &windowId, std::optional< std::pair< int, int >> size, ScreenshotFormat format) const
 Invoke the StdMulti per-window screenshot provider. More...
 
CameraState GetStdMultiCamera (const std::string &windowId) const
 
void SetStdMultiCamera (const std::string &windowId, const CameraPatch &patch) const
 
SliceState GetStdMultiSelectedSlice (const std::string &windowId) const
 
void SetStdMultiSelectedSliceStep (const std::string &windowId, unsigned int step) const
 
std::vector< MxNWindowInfo > ListMxNWindows () const
 Invoke the MxN window list provider. More...
 
std::vector< unsigned char > TakeMxNEditorScreenshot (std::optional< std::pair< int, int >> size, ScreenshotFormat format) const
 Invoke the MxN editor screenshot provider. More...
 
std::vector< unsigned char > TakeMxNWindowScreenshot (const std::string &windowId, std::optional< std::pair< int, int >> size, ScreenshotFormat format) const
 Invoke the MxN per-window screenshot provider. More...
 
CameraState GetMxNCamera (const std::string &windowId) const
 Read the camera state of a specific MxN cell. More...
 
void SetMxNCamera (const std::string &windowId, const CameraPatch &patch) const
 Apply a camera patch to a specific MxN cell. More...
 
SliceState GetMxNSelectedSlice (const std::string &windowId) const
 Read the selected-slice state of a 2D MxN cell. More...
 
void SetMxNSelectedSliceStep (const std::string &windowId, unsigned int step) const
 Set the selected slice of a 2D MxN cell by step index. More...
 
SelectedPositionInfo GetMxNSelectedPosition (const std::string &windowId) const
 Read the per-cell selected position and scene bounds atomically. More...
 
void SetMxNSelectedPosition (const std::string &windowId, const Point3D &position) const
 Set the per-cell selected position (cell anchor). More...
 
std::string GetMxNLayout () const
 
std::string SetMxNLayout (const std::string &layoutJson) const
 Apply a v2.0 layout document; returns the freshly serialized layout. More...
 

Detailed Description

Bridge between the REST API server and the Qt/render-window layer.

This class abstracts render-window capabilities so that the REST API module remains free of Qt and Berry dependencies. All callbacks are injected at runtime by the Qt plugin (org.mitk.gui.qt.restapi), which owns and configures the server-owned bridge instance.

Thread dispatching: all three dispatch functions copy the callback and dispatcher under the mutex, release it, then invoke the callback (optionally on the UI thread via the dispatcher). This keeps the mutex free during callback execution and avoids any risk of deadlock from re-entry.

Thread-safety: All public methods are thread-safe.

Definition at line 279 of file mitkRenderWindowBridge.h.

Member Typedef Documentation

◆ EditorListProvider

using mitk::RenderWindowBridge::EditorListProvider = std::function<std::vector<EditorInfo>()>

Callback type: list all known editor aliases with their activity state.

Definition at line 325 of file mitkRenderWindowBridge.h.

◆ MxNCameraGetter

using mitk::RenderWindowBridge::MxNCameraGetter = std::function<CameraState(const std::string& windowId)>

Callback type: read camera state of an MxN cell.

Definition at line 378 of file mitkRenderWindowBridge.h.

◆ MxNCameraSetter

using mitk::RenderWindowBridge::MxNCameraSetter = std::function<void(const std::string& windowId, const CameraPatch& patch)>

Callback type: apply a camera patch on an MxN cell.

Definition at line 381 of file mitkRenderWindowBridge.h.

◆ MxNEditorScreenshotProvider

using mitk::RenderWindowBridge::MxNEditorScreenshotProvider = std::function<std::vector<unsigned char>( std::optional<std::pair<int, int> > size, ScreenshotFormat format)>

Callback type: grab the MxN editor canvas.

Definition at line 365 of file mitkRenderWindowBridge.h.

◆ MxNLayoutGetter

using mitk::RenderWindowBridge::MxNLayoutGetter = std::function<std::string()>

Callback type: serialize the editor's current layout to a v2.0 JSON document.

The bridge boundary uses std::string to keep the bridge header free of nlohmann/json.hpp. The plugin serializes via QmitkMxNMultiWidget::SerializeLayout().dump().

Definition at line 419 of file mitkRenderWindowBridge.h.

◆ MxNLayoutSetter

using mitk::RenderWindowBridge::MxNLayoutSetter = std::function<std::string(const std::string& layoutJson)>

Callback type: apply a v2.0 JSON layout document and return the freshly serialized layout (so callers can echo the new state in a PUT response without a follow-up GET).

The std::string boundary keeps nlohmann/json.hpp out of the bridge header. Schema / structural validation throws mitk::Exception from QmitkMxNMultiWidget::ApplyLayout; the controller maps that to 400 INVALID_REQUEST locally (this is the one site where mitk::Exception does not become 422 RENDERING_ERROR).

Definition at line 432 of file mitkRenderWindowBridge.h.

◆ MxNSelectedPositionGetter

using mitk::RenderWindowBridge::MxNSelectedPositionGetter = std::function<SelectedPositionInfo(const std::string& windowId)>

Callback type: read the per-cell selected position (cell anchor) plus scene bounds atomically.

Mirrors the global PositionGetter shape but window-id-keyed. The returned bounds are the global scene AABB at the active timestep (same as the global getter); both pieces of data are read in one UI-thread snapshot.

Definition at line 404 of file mitkRenderWindowBridge.h.

◆ MxNSelectedPositionSetter

using mitk::RenderWindowBridge::MxNSelectedPositionSetter = std::function<void(const std::string& windowId, const Point3D& position)>

Callback type: set the per-cell selected position (cell anchor).

Definition at line 408 of file mitkRenderWindowBridge.h.

◆ MxNSelectedSliceGetter

using mitk::RenderWindowBridge::MxNSelectedSliceGetter = std::function<SliceState(const std::string& windowId)>

Callback type: read the selected-slice state of a 2D MxN cell.

Definition at line 384 of file mitkRenderWindowBridge.h.

◆ MxNSelectedSliceStepSetter

using mitk::RenderWindowBridge::MxNSelectedSliceStepSetter = std::function<void(const std::string& windowId, unsigned int step)>

Callback type: set the selected slice of a 2D MxN cell by step index.

Position-based slice navigation is intentionally not exposed on the slice resource; per-cell world anchors live on the dedicated selected-position resource (see MxNSelectedPositionSetter).

Definition at line 393 of file mitkRenderWindowBridge.h.

◆ MxNWindowListProvider

using mitk::RenderWindowBridge::MxNWindowListProvider = std::function<std::vector<MxNWindowInfo>()>

Callback type: list the windows of the MxN multi-widget editor.

Definition at line 362 of file mitkRenderWindowBridge.h.

◆ MxNWindowScreenshotProvider

using mitk::RenderWindowBridge::MxNWindowScreenshotProvider = std::function<std::vector<unsigned char>( const std::string& windowId, std::optional<std::pair<int, int> > size, ScreenshotFormat format)>

Callback type: grab a single MxN cell's render window.

Definition at line 371 of file mitkRenderWindowBridge.h.

◆ PositionGetter

Callback type for reading the current global crosshair position and scene bounds.

Both pieces of data are read atomically within one callback invocation so that position and bounds always correspond to the same UI-thread snapshot.

Precondition
Must be called on the UI thread.
Must not re-enter RenderWindowBridge methods.
Note
Exceptions thrown by the callback are caught by the bridge and transported to the REST thread – they never reach the UI event loop.
Returns
SelectedPositionInfo containing position and optional bounds.
Exceptions
std::exceptionon failure.

Definition at line 311 of file mitkRenderWindowBridge.h.

◆ PositionSetter

using mitk::RenderWindowBridge::PositionSetter = std::function<void(const Point3D& pos)>

Callback type for setting the global crosshair position.

Precondition
Must be called on the UI thread.
Must not re-enter RenderWindowBridge methods.
Note
Exceptions thrown by the callback are caught by the bridge and transported to the REST thread – they never reach the UI event loop.
Exceptions
std::exceptionon failure.

Definition at line 322 of file mitkRenderWindowBridge.h.

◆ ScreenshotProvider

using mitk::RenderWindowBridge::ScreenshotProvider = std::function<std::vector<unsigned char>( std::optional<std::pair<int, int> > size, ScreenshotFormat format)>

Callback type for taking a screenshot.

The callback receives an optional output size (width, height) – both dimensions must be provided together; nullopt means native resolution – and the desired image encoding (Png or Jpeg). It returns the encoded image bytes and throws std::exception on failure.

Note
Exceptions thrown by the callback are caught by the bridge and transported to the REST thread – they never reach the UI event loop.

Definition at line 293 of file mitkRenderWindowBridge.h.

◆ StdMultiCameraGetter

using mitk::RenderWindowBridge::StdMultiCameraGetter = std::function<CameraState(const std::string& windowId)>

Callback type: read camera state of a StdMulti render window.

Definition at line 344 of file mitkRenderWindowBridge.h.

◆ StdMultiCameraSetter

using mitk::RenderWindowBridge::StdMultiCameraSetter = std::function<void(const std::string& windowId, const CameraPatch& patch)>

Callback type: apply a camera patch on a StdMulti render window.

Definition at line 347 of file mitkRenderWindowBridge.h.

◆ StdMultiEditorScreenshotProvider

using mitk::RenderWindowBridge::StdMultiEditorScreenshotProvider = std::function<std::vector<unsigned char>( std::optional<std::pair<int, int> > size, ScreenshotFormat format)>

Callback type: grab the StdMultiWidget editor canvas.

Definition at line 331 of file mitkRenderWindowBridge.h.

◆ StdMultiSelectedSliceGetter

using mitk::RenderWindowBridge::StdMultiSelectedSliceGetter = std::function<SliceState(const std::string& windowId)>

Callback type: read the selected-slice state of a StdMulti 2D window.

Definition at line 350 of file mitkRenderWindowBridge.h.

◆ StdMultiSelectedSliceStepSetter

using mitk::RenderWindowBridge::StdMultiSelectedSliceStepSetter = std::function<void(const std::string& windowId, unsigned int step)>

Callback type: set the selected slice of a StdMulti 2D window by step index.

StdMulti only supports step-based slice selection; world-position addressing is reserved for /rendering/selected-position. If MxN later needs position-based addressing, add a separate setter alias for it.

Definition at line 359 of file mitkRenderWindowBridge.h.

◆ StdMultiWindowListProvider

Callback type: list the windows of the StdMultiWidget editor.

Definition at line 328 of file mitkRenderWindowBridge.h.

◆ StdMultiWindowScreenshotProvider

using mitk::RenderWindowBridge::StdMultiWindowScreenshotProvider = std::function<std::vector<unsigned char>( const std::string& windowId, std::optional<std::pair<int, int> > size, ScreenshotFormat format)>

Callback type: grab a single StdMulti render window.

Definition at line 337 of file mitkRenderWindowBridge.h.

Member Function Documentation

◆ GetMxNCamera()

CameraState mitk::RenderWindowBridge::GetMxNCamera ( const std::string &  windowId) const

Read the camera state of a specific MxN cell.

Parameters
windowIdCanonical fully-qualified window id (e.g. "mxn__widget0").
Precondition
HasMxNCameraGetter() is true.
Exceptions
std::runtime_errorif no getter is set.
RenderWindowBridgeNoEditorException/ RenderWindowBridgeUnknownWindowException.
Anyexception thrown by the getter.

◆ GetMxNLayout()

std::string mitk::RenderWindowBridge::GetMxNLayout ( ) const

Get the current MxN layout as a v2.0 JSON document (string).

◆ GetMxNSelectedPosition()

SelectedPositionInfo mitk::RenderWindowBridge::GetMxNSelectedPosition ( const std::string &  windowId) const

Read the per-cell selected position and scene bounds atomically.

Parameters
windowIdCanonical fully-qualified window id.
Precondition
HasMxNSelectedPositionGetter() is true.
Exceptions
std::runtime_errorif no getter is set.
RenderWindowBridgeNoEditorException/ RenderWindowBridgeUnknownWindowException.
Anyexception thrown by the getter.

◆ GetMxNSelectedSlice()

SliceState mitk::RenderWindowBridge::GetMxNSelectedSlice ( const std::string &  windowId) const

Read the selected-slice state of a 2D MxN cell.

Parameters
windowIdCanonical fully-qualified window id.
Precondition
HasMxNSelectedSliceGetter() is true.
windowId addresses a 2D MxN cell.
Exceptions
std::runtime_errorif no getter is set.
RenderWindowBridgeNoEditorException/ RenderWindowBridgeUnknownWindowException.
Anyexception thrown by the getter.

◆ GetSelectedPosition()

SelectedPositionInfo mitk::RenderWindowBridge::GetSelectedPosition ( ) const

Read the current global crosshair position and scene bounds atomically.

Dispatches to the UI thread if a dispatcher is set.

Precondition
HasPositionGetter() is true.
Exceptions
std::runtime_errorif no getter is set.
Anyexception thrown by the getter.

◆ GetStdMultiCamera()

CameraState mitk::RenderWindowBridge::GetStdMultiCamera ( const std::string &  windowId) const

◆ GetStdMultiSelectedSlice()

SliceState mitk::RenderWindowBridge::GetStdMultiSelectedSlice ( const std::string &  windowId) const

◆ HasEditorListProvider()

bool mitk::RenderWindowBridge::HasEditorListProvider ( ) const

◆ HasMxNCameraGetter()

bool mitk::RenderWindowBridge::HasMxNCameraGetter ( ) const
Returns
true if an MxN camera getter is currently set.

◆ HasMxNCameraSetter()

bool mitk::RenderWindowBridge::HasMxNCameraSetter ( ) const
Returns
true if an MxN camera setter is currently set.

◆ HasMxNEditorScreenshotProvider()

bool mitk::RenderWindowBridge::HasMxNEditorScreenshotProvider ( ) const
Returns
true if an MxN editor screenshot provider is currently set.

◆ HasMxNLayoutGetter()

bool mitk::RenderWindowBridge::HasMxNLayoutGetter ( ) const
Returns
true if an MxN layout getter is currently set.

◆ HasMxNLayoutSetter()

bool mitk::RenderWindowBridge::HasMxNLayoutSetter ( ) const
Returns
true if an MxN layout setter is currently set.

◆ HasMxNSelectedPositionGetter()

bool mitk::RenderWindowBridge::HasMxNSelectedPositionGetter ( ) const
Returns
true if an MxN selected-position getter is currently set.

◆ HasMxNSelectedPositionSetter()

bool mitk::RenderWindowBridge::HasMxNSelectedPositionSetter ( ) const
Returns
true if an MxN selected-position setter is currently set.

◆ HasMxNSelectedSliceGetter()

bool mitk::RenderWindowBridge::HasMxNSelectedSliceGetter ( ) const
Returns
true if an MxN selected-slice getter is currently set.

◆ HasMxNSelectedSliceStepSetter()

bool mitk::RenderWindowBridge::HasMxNSelectedSliceStepSetter ( ) const
Returns
true if an MxN selected-slice step setter is currently set.

◆ HasMxNWindowListProvider()

bool mitk::RenderWindowBridge::HasMxNWindowListProvider ( ) const
Returns
true if an MxN window list provider is currently set.

◆ HasMxNWindowScreenshotProvider()

bool mitk::RenderWindowBridge::HasMxNWindowScreenshotProvider ( ) const
Returns
true if an MxN per-window screenshot provider is currently set.

◆ HasPositionGetter()

bool mitk::RenderWindowBridge::HasPositionGetter ( ) const
Returns
true if a position getter is currently set.

◆ HasPositionSetter()

bool mitk::RenderWindowBridge::HasPositionSetter ( ) const
Returns
true if a position setter is currently set.

◆ HasScreenshotProvider()

bool mitk::RenderWindowBridge::HasScreenshotProvider ( ) const
Returns
true if a screenshot provider is currently set.

◆ HasStdMultiCameraGetter()

bool mitk::RenderWindowBridge::HasStdMultiCameraGetter ( ) const

◆ HasStdMultiCameraSetter()

bool mitk::RenderWindowBridge::HasStdMultiCameraSetter ( ) const

◆ HasStdMultiEditorScreenshotProvider()

bool mitk::RenderWindowBridge::HasStdMultiEditorScreenshotProvider ( ) const

◆ HasStdMultiSelectedSliceGetter()

bool mitk::RenderWindowBridge::HasStdMultiSelectedSliceGetter ( ) const

◆ HasStdMultiSelectedSliceStepSetter()

bool mitk::RenderWindowBridge::HasStdMultiSelectedSliceStepSetter ( ) const

◆ HasStdMultiWindowListProvider()

bool mitk::RenderWindowBridge::HasStdMultiWindowListProvider ( ) const

◆ HasStdMultiWindowScreenshotProvider()

bool mitk::RenderWindowBridge::HasStdMultiWindowScreenshotProvider ( ) const

◆ ListEditors()

std::vector<EditorInfo> mitk::RenderWindowBridge::ListEditors ( ) const

Invoke the editor list provider.

Exceptions
std::runtime_errorif no provider is set.

◆ ListMxNWindows()

std::vector<MxNWindowInfo> mitk::RenderWindowBridge::ListMxNWindows ( ) const

Invoke the MxN window list provider.

Exceptions
std::runtime_errorif no provider is set.
RenderWindowBridgeNoEditorExceptionif the editor is not open.

◆ ListStdMultiWindows()

std::vector<WindowInfo> mitk::RenderWindowBridge::ListStdMultiWindows ( ) const

Invoke the StdMulti window list provider.

Exceptions
std::runtime_errorif no provider is set.
RenderWindowBridgeNoEditorExceptionif the editor is not open.

◆ ResetCallbacks()

void mitk::RenderWindowBridge::ResetCallbacks ( )

Clear all registered callbacks in a single atomic operation.

Should be called by the UI-layer owner (e.g. the workbench plugin activator) before the objects captured by the callbacks are destroyed.

Note
The dispatcher (set via SetDispatcher) is intentionally retained: it is owned by the REST server, which outlives the callback owner, so clearing it here would create a needless re-bind on every plugin cycle. Use SetDispatcher(nullptr) explicitly if a separation is ever required.

◆ SetDispatcher()

void mitk::RenderWindowBridge::SetDispatcher ( StorageThreadDispatcherBase *  dispatcher)

Set the thread dispatcher for UI thread dispatching.

If set, all callbacks are dispatched to the UI thread before invocation. If nullptr, callbacks execute directly on the calling thread.

Parameters
dispatcherThe dispatcher, or nullptr to clear.

◆ SetEditorListProvider()

void mitk::RenderWindowBridge::SetEditorListProvider ( EditorListProvider  provider)

Set or clear the editor list provider.

◆ SetMxNCamera()

void mitk::RenderWindowBridge::SetMxNCamera ( const std::string &  windowId,
const CameraPatch &  patch 
) const

Apply a camera patch to a specific MxN cell.

Parameters
windowIdCanonical fully-qualified window id.
patchPartial camera update.
Precondition
HasMxNCameraSetter() is true.
Exceptions
std::runtime_errorif no setter is set.
RenderWindowBridgeNoEditorException/ RenderWindowBridgeUnknownWindowException.
Anyexception thrown by the setter.

◆ SetMxNCameraGetter()

void mitk::RenderWindowBridge::SetMxNCameraGetter ( MxNCameraGetter  getter)

Set or clear the MxN camera getter.

◆ SetMxNCameraSetter()

void mitk::RenderWindowBridge::SetMxNCameraSetter ( MxNCameraSetter  setter)

Set or clear the MxN camera setter.

◆ SetMxNEditorScreenshotProvider()

void mitk::RenderWindowBridge::SetMxNEditorScreenshotProvider ( MxNEditorScreenshotProvider  provider)

Set or clear the MxN editor screenshot provider.

◆ SetMxNLayout()

std::string mitk::RenderWindowBridge::SetMxNLayout ( const std::string &  layoutJson) const

Apply a v2.0 layout document; returns the freshly serialized layout.

The string boundary keeps the bridge header free of nlohmann/json.hpp. Schema / structural failures escape as mitk::Exception (the engine's native throw type) which the controller maps locally to 400.

◆ SetMxNLayoutGetter()

void mitk::RenderWindowBridge::SetMxNLayoutGetter ( MxNLayoutGetter  getter)

Set or clear the MxN layout getter (returns v2.0 JSON document as string).

◆ SetMxNLayoutSetter()

void mitk::RenderWindowBridge::SetMxNLayoutSetter ( MxNLayoutSetter  setter)

Set or clear the MxN layout setter (accepts v2.0 JSON; returns the freshly serialized result).

◆ SetMxNSelectedPosition()

void mitk::RenderWindowBridge::SetMxNSelectedPosition ( const std::string &  windowId,
const Point3D &  position 
) const

Set the per-cell selected position (cell anchor).

Parameters
windowIdCanonical fully-qualified window id.
positionWorld coordinate for the cell's anchor.
Precondition
HasMxNSelectedPositionSetter() is true.
Exceptions
std::runtime_errorif no setter is set.
RenderWindowBridgeNoEditorException/ RenderWindowBridgeUnknownWindowException.
Anyexception thrown by the setter.

◆ SetMxNSelectedPositionGetter()

void mitk::RenderWindowBridge::SetMxNSelectedPositionGetter ( MxNSelectedPositionGetter  getter)

Set or clear the MxN per-cell selected-position getter.

◆ SetMxNSelectedPositionSetter()

void mitk::RenderWindowBridge::SetMxNSelectedPositionSetter ( MxNSelectedPositionSetter  setter)

Set or clear the MxN per-cell selected-position setter.

◆ SetMxNSelectedSliceGetter()

void mitk::RenderWindowBridge::SetMxNSelectedSliceGetter ( MxNSelectedSliceGetter  getter)

Set or clear the MxN selected-slice getter.

◆ SetMxNSelectedSliceStep()

void mitk::RenderWindowBridge::SetMxNSelectedSliceStep ( const std::string &  windowId,
unsigned int  step 
) const

Set the selected slice of a 2D MxN cell by step index.

Parameters
windowIdCanonical fully-qualified window id.
stepZero-based slice index along the cell's view direction.
Precondition
HasMxNSelectedSliceStepSetter() is true.
windowId addresses a 2D MxN cell.
Exceptions
std::runtime_errorif no setter is set.
RenderWindowBridgeNoEditorException/ RenderWindowBridgeUnknownWindowException.
Anyexception thrown by the setter.

◆ SetMxNSelectedSliceStepSetter()

void mitk::RenderWindowBridge::SetMxNSelectedSliceStepSetter ( MxNSelectedSliceStepSetter  setter)

Set or clear the MxN selected-slice step setter.

◆ SetMxNWindowListProvider()

void mitk::RenderWindowBridge::SetMxNWindowListProvider ( MxNWindowListProvider  provider)

Set or clear the MxN window list provider.

◆ SetMxNWindowScreenshotProvider()

void mitk::RenderWindowBridge::SetMxNWindowScreenshotProvider ( MxNWindowScreenshotProvider  provider)

Set or clear the MxN per-window screenshot provider.

◆ SetPositionGetter()

void mitk::RenderWindowBridge::SetPositionGetter ( PositionGetter  getter)

Set or clear the position getter callback.

Should read the global crosshair position from the StdMultiWidgetEditor via IRenderWindowPart::GetSelectedPosition().

Parameters
getterCallback to read current crosshair position, or empty to clear.

◆ SetPositionSetter()

void mitk::RenderWindowBridge::SetPositionSetter ( PositionSetter  setter)

Set or clear the position setter callback.

Should update the global crosshair position via IRenderWindowPart::SetSelectedPosition() on the StdMultiWidgetEditor.

Parameters
setterCallback to move crosshair to a position, or empty to clear.

◆ SetScreenshotProvider()

void mitk::RenderWindowBridge::SetScreenshotProvider ( ScreenshotProvider  provider)

Set or clear the screenshot provider callback.

Parameters
providerThe callback to use, or an empty function to clear.

◆ SetSelectedPosition()

void mitk::RenderWindowBridge::SetSelectedPosition ( const Point3D &  pos) const

Move the crosshair to the given world position.

Dispatches to the UI thread if a dispatcher is set.

Precondition
HasPositionSetter() is true.
Exceptions
std::runtime_errorif no setter is set.
Anyexception thrown by the setter.

◆ SetStdMultiCamera()

void mitk::RenderWindowBridge::SetStdMultiCamera ( const std::string &  windowId,
const CameraPatch &  patch 
) const

◆ SetStdMultiCameraGetter()

void mitk::RenderWindowBridge::SetStdMultiCameraGetter ( StdMultiCameraGetter  getter)

Set or clear the StdMulti camera getter.

◆ SetStdMultiCameraSetter()

void mitk::RenderWindowBridge::SetStdMultiCameraSetter ( StdMultiCameraSetter  setter)

Set or clear the StdMulti camera setter.

◆ SetStdMultiEditorScreenshotProvider()

void mitk::RenderWindowBridge::SetStdMultiEditorScreenshotProvider ( StdMultiEditorScreenshotProvider  provider)

Set or clear the StdMulti editor screenshot provider.

◆ SetStdMultiSelectedSliceGetter()

void mitk::RenderWindowBridge::SetStdMultiSelectedSliceGetter ( StdMultiSelectedSliceGetter  getter)

Set or clear the StdMulti selected-slice getter.

◆ SetStdMultiSelectedSliceStep()

void mitk::RenderWindowBridge::SetStdMultiSelectedSliceStep ( const std::string &  windowId,
unsigned int  step 
) const

◆ SetStdMultiSelectedSliceStepSetter()

void mitk::RenderWindowBridge::SetStdMultiSelectedSliceStepSetter ( StdMultiSelectedSliceStepSetter  setter)

Set or clear the StdMulti selected-slice step setter.

◆ SetStdMultiWindowListProvider()

void mitk::RenderWindowBridge::SetStdMultiWindowListProvider ( StdMultiWindowListProvider  provider)

Set or clear the StdMulti window list provider.

◆ SetStdMultiWindowScreenshotProvider()

void mitk::RenderWindowBridge::SetStdMultiWindowScreenshotProvider ( StdMultiWindowScreenshotProvider  provider)

Set or clear the StdMulti per-window screenshot provider.

◆ TakeMxNEditorScreenshot()

std::vector<unsigned char> mitk::RenderWindowBridge::TakeMxNEditorScreenshot ( std::optional< std::pair< int, int >>  size,
ScreenshotFormat  format 
) const

Invoke the MxN editor screenshot provider.

Exceptions
std::runtime_errorif no provider is set.
RenderWindowBridgeNoEditorExceptionif the editor is not open.

◆ TakeMxNWindowScreenshot()

std::vector<unsigned char> mitk::RenderWindowBridge::TakeMxNWindowScreenshot ( const std::string &  windowId,
std::optional< std::pair< int, int >>  size,
ScreenshotFormat  format 
) const

Invoke the MxN per-window screenshot provider.

Exceptions
std::runtime_errorif no provider is set.
RenderWindowBridgeNoEditorException/ RenderWindowBridgeUnknownWindowException.

◆ TakeScreenshot()

std::vector<unsigned char> mitk::RenderWindowBridge::TakeScreenshot ( std::optional< std::pair< int, int >>  size,
ScreenshotFormat  format 
) const

Capture a screenshot using the registered provider.

The provider is copied under the lock and called outside the lock so that the mutex is not held during the (potentially long) operation. Dispatches to the UI thread if a dispatcher is set.

Precondition
HasScreenshotProvider() is true.
Exceptions
std::runtime_errorif no provider is set.
Anyexception thrown by the provider.

◆ TakeStdMultiEditorScreenshot()

std::vector<unsigned char> mitk::RenderWindowBridge::TakeStdMultiEditorScreenshot ( std::optional< std::pair< int, int >>  size,
ScreenshotFormat  format 
) const

Invoke the StdMulti editor screenshot provider.

Exceptions
std::runtime_errorif no provider is set.
RenderWindowBridgeNoEditorExceptionif the editor is not open.

◆ TakeStdMultiWindowScreenshot()

std::vector<unsigned char> mitk::RenderWindowBridge::TakeStdMultiWindowScreenshot ( const std::string &  windowId,
std::optional< std::pair< int, int >>  size,
ScreenshotFormat  format 
) const

Invoke the StdMulti per-window screenshot provider.

Exceptions
std::runtime_errorif no provider is set.
RenderWindowBridgeNoEditorException/ RenderWindowBridgeUnknownWindowException.

The documentation for this class was generated from the following file: