13 #ifndef mitkRenderWindowBridge_h
14 #define mitkRenderWindowBridge_h
79 using std::runtime_error::runtime_error;
90 using std::runtime_error::runtime_error;
102 using std::runtime_error::runtime_error;
114 using std::runtime_error::runtime_error;
294 std::function<std::vector<unsigned char>(
295 std::optional<std::pair<int, int>> size,
332 std::function<std::vector<unsigned char>(
333 std::optional<std::pair<int, int>> size,
338 std::function<std::vector<unsigned char>(
339 const std::string& windowId,
340 std::optional<std::pair<int, int>> size,
366 std::function<std::vector<unsigned char>(
367 std::optional<std::pair<int, int>> size,
372 std::function<std::vector<unsigned char>(
373 const std::string& windowId,
374 std::optional<std::pair<int, int>> size,
409 std::function<void(
const std::string& windowId,
const Point3D& position)>;
595 std::optional<std::pair<int, int>> size,
639 std::optional<std::pair<int, int>> size,
648 const std::string& windowId,
649 std::optional<std::pair<int, int>> size,
670 std::optional<std::pair<int, int>> size,
679 const std::string& windowId,
680 std::optional<std::pair<int, int>> size,
789 mutable std::mutex m_Mutex;
#define MITKRESTAPI_EXPORT
Thrown by bridge callbacks when the target editor instance is not open in the workbench.
Thrown by bridge callbacks when a window exists but its renderer is currently unavailable (server-sid...
Thrown by bridge callbacks when the window id is not known.
Thrown by bridge callbacks when the requested sub-resource does not apply to the addressed window (e....
Bridge between the REST API server and the Qt/render-window layer.
std::function< std::vector< MxNWindowInfo >()> MxNWindowListProvider
bool HasMxNSelectedSliceStepSetter() const
void SetPositionSetter(PositionSetter setter)
Set or clear the position setter callback.
std::function< SelectedPositionInfo(const std::string &windowId)> MxNSelectedPositionGetter
Callback type: read the per-cell selected position (cell anchor) plus scene bounds atomically.
bool HasStdMultiSelectedSliceStepSetter() const
bool HasStdMultiCameraGetter() const
void SetMxNSelectedPositionGetter(MxNSelectedPositionGetter getter)
std::function< std::vector< unsigned char >(std::optional< std::pair< int, int > > size, ScreenshotFormat format)> StdMultiEditorScreenshotProvider
void SetMxNSelectedSliceStep(const std::string &windowId, unsigned int step) const
Set the selected slice of a 2D MxN cell by step index.
bool HasStdMultiWindowScreenshotProvider() const
void SetMxNSelectedPositionSetter(MxNSelectedPositionSetter setter)
std::function< std::vector< unsigned char >(std::optional< std::pair< int, int > > size, ScreenshotFormat format)> ScreenshotProvider
Callback type for taking a screenshot.
bool HasMxNSelectedPositionSetter() const
std::function< SelectedPositionInfo()> PositionGetter
Callback type for reading the current global crosshair position and scene bounds.
bool HasMxNSelectedSliceGetter() const
void SetMxNSelectedSliceStepSetter(MxNSelectedSliceStepSetter setter)
void SetMxNLayoutSetter(MxNLayoutSetter setter)
std::function< std::vector< WindowInfo >()> StdMultiWindowListProvider
std::function< SliceState(const std::string &windowId)> StdMultiSelectedSliceGetter
void SetStdMultiSelectedSliceGetter(StdMultiSelectedSliceGetter getter)
std::function< void(const std::string &windowId, const CameraPatch &patch)> StdMultiCameraSetter
void SetMxNCameraGetter(MxNCameraGetter getter)
void SetMxNCameraSetter(MxNCameraSetter setter)
std::function< std::string(const std::string &layoutJson)> MxNLayoutSetter
Callback type: apply a v2.0 JSON layout document and return the freshly serialized layout (so callers...
void ResetCallbacks()
Clear all registered callbacks in a single atomic operation.
std::vector< WindowInfo > ListStdMultiWindows() const
Invoke the StdMulti window list provider.
void SetStdMultiCameraSetter(StdMultiCameraSetter setter)
bool HasStdMultiCameraSetter() const
std::vector< unsigned char > TakeScreenshot(std::optional< std::pair< int, int >> size, ScreenshotFormat format) const
Capture a screenshot using the registered provider.
void SetStdMultiCamera(const std::string &windowId, const CameraPatch &patch) const
SelectedPositionInfo GetSelectedPosition() const
Read the current global crosshair position and scene bounds atomically.
std::function< SliceState(const std::string &windowId)> MxNSelectedSliceGetter
std::vector< MxNWindowInfo > ListMxNWindows() const
Invoke the MxN window list provider.
bool HasStdMultiEditorScreenshotProvider() const
void SetEditorListProvider(EditorListProvider provider)
std::function< std::vector< EditorInfo >()> EditorListProvider
void SetStdMultiSelectedSliceStep(const std::string &windowId, unsigned int step) const
bool HasMxNWindowScreenshotProvider() const
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.
bool HasMxNWindowListProvider() const
std::function< std::vector< unsigned char >(const std::string &windowId, std::optional< std::pair< int, int > > size, ScreenshotFormat format)> MxNWindowScreenshotProvider
std::string GetMxNLayout() const
void SetSelectedPosition(const Point3D &pos) const
Move the crosshair to the given world position.
SliceState GetStdMultiSelectedSlice(const std::string &windowId) const
void SetStdMultiWindowScreenshotProvider(StdMultiWindowScreenshotProvider provider)
std::function< void(const Point3D &pos)> PositionSetter
Callback type for setting the global crosshair position.
void SetMxNEditorScreenshotProvider(MxNEditorScreenshotProvider provider)
std::function< std::vector< unsigned char >(const std::string &windowId, std::optional< std::pair< int, int > > size, ScreenshotFormat format)> StdMultiWindowScreenshotProvider
CameraState GetStdMultiCamera(const std::string &windowId) const
bool HasMxNLayoutGetter() const
void SetMxNWindowScreenshotProvider(MxNWindowScreenshotProvider provider)
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.
std::function< std::vector< unsigned char >(std::optional< std::pair< int, int > > size, ScreenshotFormat format)> MxNEditorScreenshotProvider
std::function< void(const std::string &windowId, const CameraPatch &patch)> MxNCameraSetter
bool HasPositionSetter() const
bool HasScreenshotProvider() const
bool HasMxNEditorScreenshotProvider() const
std::vector< EditorInfo > ListEditors() const
Invoke the editor list provider.
bool HasMxNCameraSetter() const
void SetMxNLayoutGetter(MxNLayoutGetter getter)
void SetMxNWindowListProvider(MxNWindowListProvider provider)
void SetScreenshotProvider(ScreenshotProvider provider)
Set or clear the screenshot provider callback.
bool HasMxNCameraGetter() const
void SetStdMultiEditorScreenshotProvider(StdMultiEditorScreenshotProvider provider)
void SetStdMultiSelectedSliceStepSetter(StdMultiSelectedSliceStepSetter setter)
void SetMxNSelectedSliceGetter(MxNSelectedSliceGetter getter)
std::string SetMxNLayout(const std::string &layoutJson) const
Apply a v2.0 layout document; returns the freshly serialized layout.
std::function< CameraState(const std::string &windowId)> StdMultiCameraGetter
SliceState GetMxNSelectedSlice(const std::string &windowId) const
Read the selected-slice state of a 2D MxN cell.
void SetStdMultiWindowListProvider(StdMultiWindowListProvider provider)
bool HasEditorListProvider() const
std::function< void(const std::string &windowId, const Point3D &position)> MxNSelectedPositionSetter
void SetMxNCamera(const std::string &windowId, const CameraPatch &patch) const
Apply a camera patch to a specific MxN cell.
std::function< CameraState(const std::string &windowId)> MxNCameraGetter
void SetDispatcher(StorageThreadDispatcherBase *dispatcher)
Set the thread dispatcher for UI thread dispatching.
void SetPositionGetter(PositionGetter getter)
Set or clear the position getter callback.
std::function< void(const std::string &windowId, unsigned int step)> MxNSelectedSliceStepSetter
Callback type: set the selected slice of a 2D MxN cell by step index.
std::function< void(const std::string &windowId, unsigned int step)> StdMultiSelectedSliceStepSetter
Callback type: set the selected slice of a StdMulti 2D window by step index.
bool HasPositionGetter() const
std::vector< unsigned char > TakeStdMultiEditorScreenshot(std::optional< std::pair< int, int >> size, ScreenshotFormat format) const
Invoke the StdMulti editor screenshot provider.
bool HasMxNLayoutSetter() const
SelectedPositionInfo GetMxNSelectedPosition(const std::string &windowId) const
Read the per-cell selected position and scene bounds atomically.
bool HasStdMultiWindowListProvider() const
std::function< std::string()> MxNLayoutGetter
Callback type: serialize the editor's current layout to a v2.0 JSON document.
bool HasStdMultiSelectedSliceGetter() const
bool HasMxNSelectedPositionGetter() const
void SetStdMultiCameraGetter(StdMultiCameraGetter getter)
std::vector< unsigned char > TakeMxNEditorScreenshot(std::optional< std::pair< int, int >> size, ScreenshotFormat format) const
Invoke the MxN editor screenshot provider.
CameraState GetMxNCamera(const std::string &windowId) const
Read the camera state of a specific MxN cell.
void SetMxNSelectedPosition(const std::string &windowId, const Point3D &position) const
Set the per-cell selected position (cell anchor).
Abstract base class for dispatching tasks to the thread that owns DataStorage.
A weak pointer that observes an itk::Object without preventing its deletion.
Find image slices visible on a given plane.
ScreenshotFormat
Format for screenshot capture.
MITKRESTAPI_EXPORT const char * WindowKindToString(WindowKind kind)
WindowKind
Closed set of render window kinds reported by the bridge.
MITKRESTAPI_EXPORT const char * AnatomicalPlaneToV2String(AnatomicalPlane plane)
AnatomicalPlane
Enumeration of standard anatomical image planes.
MITKRESTAPI_EXPORT AnatomicalPlane ParseV2ViewDirection(const std::string &s)
Parse the v2 layout schema's view_direction string.
std::optional< Vector3D > viewUp
std::optional< double > parallelScale
std::optional< Point3D > focalPoint
std::optional< Point3D > position
std::optional< double > perspectiveAngle
std::optional< std::string > standardView
std::optional< double > perspectiveAngle
std::optional< double > parallelScale
std::vector< std::string > windowIds
Summary of a single MxN cell exposed via the REST window list.
std::optional< AnatomicalPlane > viewDirection
std::optional< std::string > displayName
std::string selectionGroup
Position and world-bounds snapshot read atomically on the UI thread.
std::optional< WorldBounds > bounds
std::optional< AnatomicalPlane > viewDirection