Mantid
Loading...
Searching...
No Matches
FunctionMultiDomainPresenter.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
8
9#include "DllOption.h"
10
13
14#include <QObject>
15#include <boost/optional.hpp>
16#include <memory>
17#include <vector>
18
19namespace MantidQt {
20namespace MantidWidgets {
21
22class FunctionModel;
23class IFunctionView;
24class EditLocalParameterDialog;
25
26using namespace Mantid::API;
27
29 Q_OBJECT
30public:
32 void clear();
33 void setFunction(IFunction_sptr fun);
34 void setFunctionString(const QString &funStr);
35 QString getFunctionString() const;
36 IFunction_sptr getFunction() const;
37 IFunction_sptr getFunctionByIndex(const QString &index);
38 IFunction_sptr getFitFunction() const;
39 QString getFitFunctionString() const;
40 bool hasFunction() const;
41 void setParameter(const QString &paramName, double value);
42 void setParameterError(const QString &paramName, double value);
43 double getParameter(const QString &paramName);
44 bool isParameterFixed(const QString &parName) const;
45 QString getParameterTie(const QString &parName) const;
46 void updateParameters(const IFunction &fun);
47 void updateMultiDatasetParameters(const IFunction &fun);
48 void updateMultiDatasetAttributes(const IFunction &fun);
49 void clearErrors();
50 boost::optional<QString> currentFunctionIndex() const;
51 void setNumberOfDatasets(int);
52 void setDatasets(const QStringList &datasetNames);
53 void setDatasets(const QList<FunctionModelDataset> &datasets);
54 void addDatasets(const QStringList &datasetNames);
55 QStringList getDatasetNames() const;
56 QStringList getDatasetDomainNames() const;
57 int getNumberOfDatasets() const;
58 int getCurrentDataset() const;
59 void setCurrentDataset(int);
60 void removeDatasets(QList<int> indices);
61 double getLocalParameterValue(const QString &parName, int i) const;
62 bool isLocalParameterFixed(const QString &parName, int i) const;
63 QString getLocalParameterTie(const QString &parName, int i) const;
64 QString getLocalParameterConstraint(const QString &parName, int i) const;
65 void setLocalParameterValue(const QString &parName, int i, double value);
66 void setLocalParameterValue(const QString &parName, int i, double value, double error);
67 void setLocalParameterFixed(const QString &parName, int i, bool fixed);
68 void setLocalParameterTie(const QString &parName, int i, const QString &tie);
69 void setLocalParameterConstraint(const QString &parName, int i, const QString &constraint);
70 QStringList getGlobalParameters() const;
71 void setGlobalParameters(const QStringList &globals);
72 QStringList getLocalParameters() const;
73 void setBackgroundA0(double value);
74
75 void setColumnSizes(int s0, int s1, int s2);
76 void setStretchLastColumn(bool stretch);
77 void setErrorsEnabled(bool enabled);
78 void hideGlobals();
79 void showGlobals();
80signals:
82 void parameterChanged(const QString &funcIndex, const QString &paramName);
83 void attributeChanged(const QString &attributeName);
84private slots:
85 void viewChangedParameter(const QString &parName);
86 void viewChangedAttribute(const QString &attrName);
87 void viewPastedFunction(const QString &funStr);
88 void viewAddedFunction(const QString &funStr);
89 void viewRemovedFunction(const QString &functionIndex);
90 void viewChangedTie(const QString &parName, const QString &tie);
91 void viewAddedConstraint(const QString &functionIndex, const QString &constraint);
92 void viewRemovedConstraint(const QString &parName);
93 void viewRequestedCopyToClipboard();
94 void viewChangedGlobals(const QStringList &globalParameters);
95 void editLocalParameter(const QString &parName);
96 void editLocalParameterFinish(int result);
97 void viewRequestedFunctionHelp();
98
99private:
100 void updateViewFromModel();
101 void updateViewAttributesFromModel();
102
103private:
105 std::unique_ptr<FunctionModel> m_model;
107
108public:
109 IFunctionView *view() const { return m_view; }
110};
111
112} // namespace MantidWidgets
113} // namespace MantidQt
#define EXPORT_OPT_MANTIDQT_COMMON
Definition: DllOption.h:15
double value
The value of the point.
Definition: FitMW.cpp:51
double error
Definition: IndexPeaks.cpp:133
std::map< DeltaEMode::Type, std::string > index
Definition: DeltaEMode.cpp:19
A dialog for displaying and editing values of local parameters.
void attributeChanged(const QString &attributeName)
void parameterChanged(const QString &funcIndex, const QString &paramName)
The interface to a function view.
Definition: IFunctionView.h:26
This is an interface to a fitting function - a semi-abstarct class.
Definition: IFunction.h:163
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