MeshLib C++ Docs
Loading...
Searching...
No Matches
MRMcpCommon.h File Reference
#include "MRMesh/MRExpected.h"
#include <nlohmann/json.hpp>
#include <chrono>
#include <cstdint>
#include <functional>
#include <memory>
#include <stdexcept>
#include <string>
#include <string_view>

Go to the source code of this file.

Namespaces

namespace  MR
 Only strictly necessary for the bindings (to make MR::MeshIntersectionResult a complete type).
namespace  MR::Mcp

Functions

uint64_t MR::Mcp::idOf (const Object *obj)
 Pointer -> id (as a JSON number). Matches the ##<id> suffix in ImGui labels for the same object.
Expected< std::shared_ptr< Object > > MR::Mcp::resolveId (uint64_t id)
Color MR::Mcp::parseColor (const nlohmann::json &j, std::string_view field)
 Color from [r, g, b] or [r, g, b, a] floats in [0, 1].
std::runtime_error MR::Mcp::busyError (std::string_view what)
 The error for a main thread that did not respond within cMainThreadTimeout
void MR::Mcp::runOnMainThread (const std::function< void()> &func)
 CommandLoop::runCommandFromGUIThread, but throws busyError if the main thread does not start func in time
std::string MR::Mcp::waitFramesAfterInput (const std::function< void()> &after={})
nlohmann::json MR::Mcp::inputResult (std::string busy)
 The result of a tool that sends an input: {}, or {busy: <message>} from waitFramesAfterInput

Variables

constexpr std::chrono::seconds MR::Mcp::cMainThreadTimeout { 20 }