MCPcopy Create free account
hub / github.com/MITK/MITK / HandleGET_editors

Method HandleGET_editors

Modules/RESTAPI/src/mitkRenderingController.cpp:991–1018  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

989}
990
991void RenderingController::HandleGET_editors(const httplib::Request& req, httplib::Response& res) const
992{
993 if (m_RenderWindowBridge == nullptr || !m_RenderWindowBridge->HasEditorListProvider())
994 {
995 const auto error = ErrorResponse::RenderWindowNotAvailable(req.path);
996 this->SendErrorResponse(res, 503, error);
997 return;
998 }
999
1000 std::vector<EditorInfo> editors;
1001 try
1002 {
1003 editors = m_RenderWindowBridge->ListEditors();
1004 }
1005 catch (const std::exception& e)
1006 {
1007 const auto [status, payload] = MapBridgeException(e, req.path);
1008 this->SendErrorResponse(res, status, payload);
1009 return;
1010 }
1011
1012 nlohmann::json arr = nlohmann::json::array();
1013 for (const auto& ed : editors)
1014 arr.push_back(EditorInfoToJson(ed, /*includeWindowList=*/false));
1015
1016 res.status = 200;
1017 res.set_content(arr.dump(), "application/json");
1018}
1019
1020void RenderingController::HandleGET_stdmultiInfo(const httplib::Request& req, httplib::Response& res) const
1021{

Calls 4

SendErrorResponseMethod · 0.95
EditorInfoToJsonFunction · 0.85
HasEditorListProviderMethod · 0.80
ListEditorsMethod · 0.80