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

Function CameraStateToJson

Modules/RESTAPI/src/mitkRenderingController.cpp:979–988  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

977 }
978
979 nlohmann::json CameraStateToJson(const mitk::CameraState& s)
980 {
981 nlohmann::json j;
982 j["position"] = {s.position[0], s.position[1], s.position[2]};
983 j["focal_point"] = {s.focalPoint[0], s.focalPoint[1], s.focalPoint[2]};
984 j["view_up"] = {s.viewUp[0], s.viewUp[1], s.viewUp[2]};
985 if (s.parallelScale.has_value()) j["parallel_scale"] = *s.parallelScale;
986 if (s.perspectiveAngle.has_value()) j["perspective_angle"] = *s.perspectiveAngle;
987 return j;
988 }
989}
990
991void RenderingController::HandleGET_editors(const httplib::Request& req, httplib::Response& res) const

Callers 2

HandleGET_mxnCameraMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected