MeshLib C++ Docs
Loading...
Searching...
No Matches
MR::UI::TestEngine::Control Namespace Reference

Classes

struct  TypedEntry
struct  Value
 Read/write values: (drags, sliders, etc) More...
struct  Value< std::string >

Typedefs

using PathedEntry = std::pair<std::vector<std::string>, TypedEntry>
 listAllEntries returns this: each element is (fullPath, entry) where fullPath.back() == entry.name.
using ValueInt = Value<std::int64_t>
using ValueUint = Value<std::uint64_t>
using ValueReal = Value<double>
using ValueString = Value<std::string>

Enumerations

enum class  EntryType {
  button , group , valueInt , valueUint ,
  valueReal , valueString
}

Functions

std::string_view toString (EntryType type)
std::string pathToString (const std::vector< std::string > &path)
 Returns the elements of path combined into a single string.
Expected< std::vector< TypedEntry > > listEntries (const std::vector< std::string > &path)
 Returns the contents of path, or an error if the path is wrong.
Expected< std::vector< PathedEntry > > listAllEntries (const std::vector< std::string > &rootPath)
Expected< std::string > pressButton (const std::vector< std::string > &path)
template<typename T>
Expected< Value< T > > readValue (const std::vector< std::string > &path)
 Returns the value at the path, or returns an error if the path or type is wrong.
template Expected< Value< std::int64_t > > readValue (const std::vector< std::string > &path)
template<typename T>
Expected< std::string > writeValue (const std::vector< std::string > &path, T value)
template Expected< std::string > writeValue (const std::vector< std::string > &path, std::int64_t value)
template Expected< std::string > writeValue (const std::vector< std::string > &path, std::uint64_t value)
template Expected< std::string > writeValue (const std::vector< std::string > &path, double value)
template Expected< std::string > writeValue (const std::vector< std::string > &path, std::string value)

Typedef Documentation

◆ PathedEntry

using MR::UI::TestEngine::Control::PathedEntry = std::pair<std::vector<std::string>, TypedEntry>

listAllEntries returns this: each element is (fullPath, entry) where fullPath.back() == entry.name.

◆ ValueInt

◆ ValueReal

◆ ValueString

◆ ValueUint

Enumeration Type Documentation

◆ EntryType

Most changes in this file must be synced with:

  • Python: source/mrviewerpy/MRPythonUiInteraction.cpp.
  • MCP: source/MRViewer/MRUiMcp.cpp.
Enumerator
button 
group 
valueInt 
valueUint 
valueReal 
valueString 

Function Documentation

◆ listAllEntries()

Expected< std::vector< PathedEntry > > MR::UI::TestEngine::Control::listAllEntries ( const std::vector< std::string > & rootPath)
nodiscard

Returns every entry in the subtree rooted at rootPath as a flat depth-first list. Pass an empty rootPath to get the whole tree. Groups are included in the list (identifiable by type == group) and their descendants appear on subsequent rows with path extending theirs.

◆ listEntries()

Expected< std::vector< TypedEntry > > MR::UI::TestEngine::Control::listEntries ( const std::vector< std::string > & path)
nodiscard

Returns the contents of path, or an error if the path is wrong.

◆ pathToString()

std::string MR::UI::TestEngine::Control::pathToString ( const std::vector< std::string > & path)
nodiscard

Returns the elements of path combined into a single string.

◆ pressButton()

Expected< std::string > MR::UI::TestEngine::Control::pressButton ( const std::vector< std::string > & path)

Presses the button at this path. Returns empty string on success (click simulated). If the button was drawn disabled, the press is a silent no-op and the return is a non-empty status ("disabled" / "disabled: <reason>") matching composeStatus(). unexpected is returned only for hard errors (path not found, entry is not a button).

◆ readValue() [1/2]

template<typename T>
template Expected< Value< std::string > > MR::UI::TestEngine::Control::readValue ( const std::vector< std::string > & path)

Returns the value at the path, or returns an error if the path or type is wrong.

◆ readValue() [2/2]

template Expected< Value< std::int64_t > > MR::UI::TestEngine::Control::readValue ( const std::vector< std::string > & path)
extern

◆ toString()

std::string_view MR::UI::TestEngine::Control::toString ( EntryType type)
inlinenodiscard

◆ writeValue() [1/5]

template Expected< std::string > MR::UI::TestEngine::Control::writeValue ( const std::vector< std::string > & path,
double value )
extern

◆ writeValue() [2/5]

template Expected< std::string > MR::UI::TestEngine::Control::writeValue ( const std::vector< std::string > & path,
std::int64_t value )
extern

◆ writeValue() [3/5]

template Expected< std::string > MR::UI::TestEngine::Control::writeValue ( const std::vector< std::string > & path,
std::string value )
extern

◆ writeValue() [4/5]

template Expected< std::string > MR::UI::TestEngine::Control::writeValue ( const std::vector< std::string > & path,
std::uint64_t value )
extern

◆ writeValue() [5/5]

template<typename T>
Expected< std::string > MR::UI::TestEngine::Control::writeValue ( const std::vector< std::string > & path,
T value )

Modifies the value at the path. Returns empty string on success (write simulated). If the widget was drawn disabled, the write is a silent no-op and the return is a non-empty status ("disabled" / "disabled: <reason>") matching composeStatus(). unexpected is returned only for hard errors (path not found, wrong type, out-of-range / not-in-allowedValues).