Mantid
Loading...
Searching...
No Matches
FunctionBrowserUtils.h
Go to the documentation of this file.
1// Mantid Repository : https://github.com/mantidproject/mantid
2//
3// Copyright © 2018 ISIS Rutherford Appleton Laboratory UKRI,
4// NScD Oak Ridge National Laboratory, European Spallation Source,
5// Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS
6// SPDX - License - Identifier: GPL - 3.0 +
7#pragma once
10
11#include <QString>
12#include <boost/optional.hpp>
13
14#include <string>
15#include <vector>
16
17namespace MantidQt {
18namespace MantidWidgets {
19
20using namespace Mantid::API;
21
29EXPORT_OPT_MANTIDQT_COMMON std::pair<QString, QString> splitParameterName(const QString &paramName);
30
37
40EXPORT_OPT_MANTIDQT_COMMON std::pair<QString, int> splitFunctionPrefix(const std::string &prefix);
41EXPORT_OPT_MANTIDQT_COMMON std::pair<QString, int> splitFunctionPrefix(const QString &prefix);
42
45EXPORT_OPT_MANTIDQT_COMMON std::pair<QString, std::pair<QString, QString>>
46splitConstraintString(const std::string &constraint);
47EXPORT_OPT_MANTIDQT_COMMON std::pair<QString, std::pair<QString, QString>>
48splitConstraintString(const QString &constraint);
49
51EXPORT_OPT_MANTIDQT_COMMON bool isNumber(std::string const &str);
52
54EXPORT_OPT_MANTIDQT_COMMON std::vector<std::string> splitStringBy(std::string const &str, std::string const &delimiter);
55
57EXPORT_OPT_MANTIDQT_COMMON std::size_t getFunctionIndexAt(std::string const &parameter, std::size_t const &index);
58
60 bool &m_ref;
62
63public:
64 ScopedFalse(bool &variable) : m_ref(variable), m_oldValue(variable) { m_ref = false; }
66};
67
68} // namespace MantidWidgets
69} // namespace MantidQt
#define EXPORT_OPT_MANTIDQT_COMMON
Definition: DllOption.h:15
std::map< DeltaEMode::Type, std::string > index
Definition: DeltaEMode.cpp:19
EXPORT_OPT_MANTIDQT_COMMON IFunction_sptr getFunctionWithPrefix(const QString &prefix, const IFunction_sptr &fun)
Get a child function of a parent function whose parameters start with a given prefix.
EXPORT_OPT_MANTIDQT_COMMON bool isNumber(std::string const &str)
Checks if a string contains a number, or whether it contains characters.
EXPORT_OPT_MANTIDQT_COMMON std::pair< QString, std::pair< QString, QString > > splitConstraintString(const std::string &constraint)
Split a constraint definition into a parameter name and a pair of bounds, for example -1 < f0....
EXPORT_OPT_MANTIDQT_COMMON std::size_t getFunctionIndexAt(std::string const &parameter, std::size_t const &index)
Returns the function index found at index of a parameter.
EXPORT_OPT_MANTIDQT_COMMON std::pair< QString, int > splitFunctionPrefix(const std::string &prefix)
Split a function (eg f0.f3.f1.) into the parent prefix (f0.f3.) and the index of the child function (...
EXPORT_OPT_MANTIDQT_COMMON std::vector< std::string > splitStringBy(std::string const &str, std::string const &delimiter)
Splits the string by the given delimiters.
EXPORT_OPT_MANTIDQT_COMMON std::pair< QString, QString > splitParameterName(const QString &paramName)
Split a qualified parameter name into function index and local parameter name.
The AlgorithmProgressDialogPresenter keeps track of the running algorithms and displays a progress ba...
std::shared_ptr< IFunction > IFunction_sptr
shared pointer to the function base class
Definition: IFunction.h:732