Mantid
Loading...
Searching...
No Matches
Classes | Public Member Functions | Protected Slots | Protected Member Functions | Protected Attributes | Private Member Functions | Friends | List of all members
MantidQt::MantidWidgets::FunctionTreeView Class Reference

Class FitPropertyBrowser implements QtPropertyBrowser to display and control fitting function parameters and settings. More...

#include <FunctionTreeView.h>

Inheritance diagram for MantidQt::MantidWidgets::FunctionTreeView:
MantidQt::MantidWidgets::IFunctionView

Classes

struct  AConstraint
 Constraint structure. More...
 
struct  AProperty
 To keep QtProperty and its QtBrowserItem in one place. More...
 
struct  ATie
 Tie structure. More...
 

Public Member Functions

void clear () override
 Clear the contents.
 
void clearErrors () override
 Clear all errors.
 
std::optional< std::string > currentFunctionIndex () const override
 Index of currently selected function.
 
DoubleDialogEditorFactory * doubleEditorFactory ()
 
 FunctionTreeView (QWidget *parent, bool multi, std::vector< std::string > categories=std::vector< std::string >())
 Constructor.
 
IFunction::Attribute getAttribute (std::string const &attrName) const override
 Get a value of a attribute.
 
Mantid::API::IFunction_sptr getFunction (QtProperty *prop=nullptr, bool attributesOnly=false)
 Return the function.
 
std::vector< std::string > getGlobalParameters () const
 Get a list of global parameters.
 
int getNumberOfConstraintProperties () const
 
int getNumberOfQtProperties () const
 
int getNumberOfTieProperties () const
 
double getParameter (std::string const &parameterName) const override
 Get a value of a parameter.
 
QWidget * getParamWidget (std::string const &parameterName) const
 
IFunction_sptr getSelectedFunction () override
 Get user selected function.
 
QRect getVisualRectFunctionProperty (std::string const &index) const
 
QRect getVisualRectParameterProperty (std::string const &index) const
 
bool hasFunction () const override
 Check if a function is set.
 
void hideGlobals ()
 Show global column.
 
void setColumnSizes (int s0, int s1, int s2=-1)
 Resize the browser's columns.
 
void setErrorsEnabled (bool enabled) override
 Set error display on/off.
 
void setFunction (Mantid::API::IFunction_sptr fun) override
 Set the function in the browser.
 
void setGlobalParameters (const std::vector< std::string > &) override
 Set new global parameters.
 
void setGlobalTies (std::vector< GlobalTie > const &globalTies)
 The global ties within a multi-domain function.
 
void setMultiDomainFunctionPrefix (std::string const &functionPrefix)
 The function index displayed as a multi-domain function index at the top of the FunctionTreeView.
 
void setParameter (std::string const &parameterName, double value) override
 Update the function parameter value.
 
void setParameterConstraint (std::string const &parameterName, std::string const &constraint) override
 Set a constraint.
 
void setParameterError (std::string const &parameterName, double error) override
 Update the function parameter error.
 
void setParameterTie (std::string const &parameterName, std::string const &tie) override
 Set a tie.
 
void setStretchLastColumn (bool stretch)
 Set the last column to stretch.
 
void showFunctionHelp (std::string const &functionName) const override
 Show function help page for input functionName.
 
void showGlobals ()
 
QtTreePropertyBrowser * treeBrowser ()
 
QTreeWidget * treeWidget () const
 
 ~FunctionTreeView () override
 Destructor.
 
- Public Member Functions inherited from MantidQt::MantidWidgets::IFunctionView
 IFunctionView (QWidget *parent=nullptr)
 
template<typename T >
void setAttributeValue (std::string const &attributeName, T &value)
 
virtual ~IFunctionView ()=default
 

Protected Slots

void addConstraints ()
 Add both constraints to current parameter.
 
void addConstraints10 ()
 Add both constraints to current parameter.
 
void addConstraints50 ()
 Add both constraints to current parameter.
 
void addFunctionBegin ()
 Add a function.
 
void addFunctionEnd (int result)
 
void addTie ()
 Add a tie to a parameter.
 
void attributeChanged (QtProperty *)
 Called when a function attribute property is changed.
 
void attributeVectorDoubleChanged (QtProperty *)
 Called when a member of a vector attribute is changed.
 
void attributeVectorSizeChanged (QtProperty *)
 Called when the size of a vector attribute is changed.
 
void constraintChanged (QtProperty *)
 Called when a constraint property changes.
 
void copyToClipboard ()
 Copy the function to the clipboard.
 
void fixParameter ()
 Fix a parameter.
 
void globalChanged (QtProperty *, const QString &, bool)
 Called when "Global" check-box was clicked.
 
void parameterButtonClicked (QtProperty *)
 Called when button in local parameter editor was clicked.
 
void parameterPropertyChanged (QtProperty *)
 Called when a function parameter property is changed.
 
void pasteFromClipboard ()
 Copy function from the clipboard.
 
void popupMenu (const QPoint &)
 Show the context menu.
 
void removeConstraint ()
 Remove one of the constraints.
 
void removeConstraints ()
 Remove both constraints from current parameter.
 
void removeFunction ()
 Remove a function.
 
void removeTie ()
 Unfix a parameter.
 
void setAttributeToFunction (Mantid::API::IFunction &fun, QtProperty *prop)
 Set value of an attribute (as a property) to a function.
 
void tieChanged (QtProperty *)
 Called when a tie property changes.
 
void updateCurrentFunctionIndex ()
 Update index of currently selected function.
 

Protected Member Functions

void addAttributeAndParameterProperties (QtProperty *prop, const Mantid::API::IFunction_sptr &fun, const Mantid::API::CompositeFunction_sptr &parentComposite=nullptr, const std::size_t &parentIndex=0)
 Add attribute and parameter properties to a function property.
 
AProperty addAttributeProperty (QtProperty *parent, std::string const &attName, const Mantid::API::IFunction::Attribute &att)
 Add a attribute property.
 
QList< APropertyaddConstraintProperties (QtProperty *prop, std::string const &constraint)
 Add a constraint property.
 
bool addFunction (QtProperty *prop, const Mantid::API::IFunction_sptr &fun)
 Add a function.
 
AProperty addFunctionProperty (QtProperty *parent, std::string const &funName)
 Add a function property.
 
void addGlobalParameterTie (QtProperty *property, const std::string &parameterName, const CompositeFunction_sptr &parentComposite=nullptr, const std::size_t &parentIndex=0)
 Adds a global tie for a parameter if one exists.
 
AProperty addIndexProperty (QtProperty *prop)
 Add property showing function's index in the composite function.
 
void addMultiDomainIndexProperty (QtProperty *prop)
 Adds an index property representing the function index of a specific domain within a MultiDomainFunction.
 
AProperty addParameterProperty (QtProperty *parent, std::string const &parameterName, std::string const &paramDesc, double paramValue)
 Add a parameter property.
 
void addParameterTie (QtProperty *property, const Mantid::API::IFunction_sptr &function, const std::string &parameterName, const std::size_t &parameterIndex, const Mantid::API::CompositeFunction_sptr &parentComposite=nullptr, const std::size_t &parentIndex=0)
 Add tie to a parameter property.
 
bool addParameterTieInComposite (QtProperty *property, const std::string &parameterName, const Mantid::API::CompositeFunction_sptr &composite, const std::size_t &index)
 Add tie to a parameter property stored within a composite function.
 
AProperty addProperty (QtProperty *parent, QtProperty *subproperty)
 Add a sub-property.
 
void addTieProperty (QtProperty *prop, std::string const &tie, bool globalTie=false)
 Add a tie property.
 
void createActions ()
 Create and connect actions.
 
void createBrowser ()
 Create the Qt property browser.
 
std::string getAttributeName (QtProperty *prop) const
 Get name of the attribute for a property.
 
QtProperty * getAttributeProperty (std::string const &parameterName) const
 Get a property for a parameter.
 
std::string getConstraint (std::string const &parameterName, const double &lowerBound=Mantid::EMPTY_DBL(), const double &upperBound=Mantid::EMPTY_DBL()) const
 Get a constraint string.
 
std::pair< std::string, std::string > getFunctionAndConstraint (QtProperty *prop) const
 Get a pair of function index (eg f0.f2.) and constraint expression given a parameter property.
 
AProperty getFunctionProperty () const
 Get property of the overall function.
 
QtProperty * getFunctionProperty (std::string const &index) const
 Get function property for the index.
 
std::string getIndex (QtProperty *prop) const
 Get the function index for a property.
 
double getParameter (QtProperty *prop) const
 Get attribute as a string.
 
std::string getParameterName (QtProperty *prop) const
 Get name of the parameter for a property.
 
QtProperty * getParameterProperty (std::string const &parameterName) const
 Get a property for a parameter Get a property for a parameter.
 
QtProperty * getParentParameterProperty (QtProperty *prop) const
 Get a property for a parameter which is a parent of a given property (tie or constraint).
 
QString getTie (QtProperty *prop) const
 Get a tie for a paramater.
 
QtProperty * getTieProperty (QtProperty *prop) const
 Get a tie property attached to a parameter property.
 
bool hasConstraint (QtProperty *prop) const
 Check if a parameter property has a constraint.
 
bool hasLowerBound (QtProperty *prop) const
 Check if a parameter property has a lower bound.
 
bool hasTie (QtProperty *prop) const
 Check if a parameter property has a tie.
 
bool hasUpperBound (QtProperty *prop) const
 Check if a parameter property has a upper bound.
 
bool isAttribute (QtProperty *prop) const
 Check if property is a function attribute.
 
bool isBoolAttribute (QtProperty *prop) const
 Check if property is a bool attribute.
 
bool isConstraint (QtProperty *prop) const
 Check if a property is a constraint.
 
bool isDoubleAttribute (QtProperty *prop) const
 Check if property is a double attribute.
 
bool isFunction (QtProperty *prop) const
 Check if property is a function group.
 
bool isIndex (QtProperty *prop) const
 Check if a property is an index.
 
bool isIntAttribute (QtProperty *prop) const
 Check if property is a int attribute.
 
bool isParameter (QtProperty *prop) const
 Check if property is a function paramater.
 
bool isStringAttribute (QtProperty *prop) const
 Check if property is a string attribute.
 
bool isTie (QtProperty *prop) const
 Check if a property is a tie.
 
bool isVectorAttribute (QtProperty *prop) const
 Check if property is a vector attribute.
 
void removeConstraintsQuiet (QtProperty *paramProp)
 
void removeProperty (QtProperty *prop)
 Remove and delete property.
 
void setFunction (QtProperty *prop, const Mantid::API::IFunction_sptr &fun)
 Set a function.
 
void updateFunctionIndices (QtProperty *prop=nullptr, std::string const &index="")
 Update function index properties.
 

Protected Attributes

QAction * m_actionAddFunction
 Add a function.
 
QAction * m_actionAddTie
 Add a custom tie to a parameter.
 
QAction * m_actionConstraints
 Add both constraints to current parameter.
 
QAction * m_actionConstraints10
 Add both constraints to current parameter with 10% spread.
 
QAction * m_actionConstraints50
 Add both constraints to current parameter with 50% spread.
 
QAction * m_actionFixParameter
 Fix a parameter.
 
QAction * m_actionFromClipboard
 Copy a function from the clipboard.
 
QAction * m_actionFunctionHelp
 Show function help menu.
 
QAction * m_actionRemoveConstraint
 Remove one constraints from current parameter.
 
QAction * m_actionRemoveConstraints
 Remove both constraints from current parameter.
 
QAction * m_actionRemoveFunction
 Remove a function.
 
QAction * m_actionRemoveTie
 Unfix a parameter.
 
QAction * m_actionToClipboard
 Copy a function to the clipboard.
 
std::vector< std::string > m_allowedCategories
 
QtBoolPropertyManager * m_attributeBoolManager
 Manager for function bool attribute properties.
 
QtDoublePropertyManager * m_attributeDoubleManager
 Manager for function double attribute properties.
 
QtIntPropertyManager * m_attributeIntManager
 Manager for function int attribute properties.
 
QtIntPropertyManager * m_attributeSizeManager
 Manager for vector attribute size properties.
 
QtStringPropertyManager * m_attributeStringManager
 Manager for function string attribute properties.
 
QtDoublePropertyManager * m_attributeVectorDoubleManager
 Manager for vector attribute member properties.
 
QtGroupPropertyManager * m_attributeVectorManager
 Manager for vector attribute properties.
 
QtTreePropertyBrowser * m_browser
 Qt property browser which displays properties.
 
QtDoublePropertyManager * m_constraintManager
 Manager for parameter constraint properties.
 
QMultiMap< QtProperty *, AConstraintm_constraints
 Store parameter constraints. Keys are function properties.
 
std::optional< std::string > m_currentFunctionIndex
 Index of currently selected function.
 
DoubleDialogEditorFactory * m_doubleEditorFactory
 Editor used for editing doubles.
 
bool m_emitAttributeValueChange = true
 
bool m_emitParameterValueChange = true
 
QtStringPropertyManager * m_filenameManager
 Manager for file name attributes.
 
QtStringPropertyManager * m_formulaManager
 Manager for Formula attributes.
 
QtGroupPropertyManager * m_functionManager
 Manager for function group properties.
 
std::vector< GlobalTiem_globalTies
 
QtStringPropertyManager * m_indexManager
 Manager for function index properties.
 
bool m_multiDataset
 Set true if the constructed function is intended to be used in a multi-dataset fit.
 
std::string m_multiDomainFunctionPrefix
 The function prefix of the domain with a MultiDomainFunction currently being displayed.
 
ParameterPropertyManager * m_parameterManager
 Manager for function parameter properties.
 
QMap< QtProperty *, APropertym_properties
 Store all properties in a map for easy access.
 
QtProperty * m_selectedFunctionProperty
 
SelectFunctionDialogm_selectFunctionDialog
 
QtStringPropertyManager * m_tieManager
 Manager for function tie properties.
 
QMultiMap< QtProperty *, ATiem_ties
 Store parameter ties. Keys are function properties.
 
QtStringPropertyManager * m_workspaceManager
 Manager for Workspace attributes.
 

Private Member Functions

std::string getFullParameterName (const std::string &parameter, int compositeIndex=-1) const
 Gets the full parameter name when using the m_multiDomainFunctionPrefix.
 
std::string getFullTie (std::string const &tie) const
 Gets the full tie when using the m_multiDomainFunctionPrefix.
 
QTreeWidgetItem * getPropertyWidgetItem (QtProperty *prop) const
 
void setBooleanAttribute (std::string const &attrName, bool value) override
 Updates the value of a boolean attribute.
 
void setDoubleAttribute (std::string const &attrName, double value) override
 Update a double attribute.
 
void setIntAttribute (std::string const &attrName, int value) override
 Updates the value of a integer attribute.
 
void setStringAttribute (std::string const &attrName, std::string &value) override
 Updates the value of a string attribute.
 
void setVectorAttribute (std::string const &attrName, std::vector< double > &val) override
 Updates the value of a vector attribute NOTE: This is currently not implemented as there is no need for it as the use of vector attributes is limited to tabulated functions (e.g resolution) which create their attributes 'on-the-fly' when the fit is performed.
 
QRect visualItemRect (QtProperty *prop) const
 

Friends

class CreateAttributePropertyForFunctionTreeView
 
class SetAttributeFromProperty
 

Additional Inherited Members

- Signals inherited from MantidQt::MantidWidgets::IFunctionView
void attributePropertyChanged (std::string const &attrName)
 Function attribute gets changed.
 
void copyToClipboardRequest ()
 User requested copy function to clipboard.
 
void currentFunctionChanged ()
 User selects a different (sub)function (or one of it's sub-properties)
 
void functionAdded (std::string const &funStr)
 User adds a function.
 
void functionHelpRequest ()
 User requested function help.
 
void functionRemoved (std::string const &functionIndex)
 User removes a function.
 
void functionRemovedString (std::string const &funStr)
 User removes a function.
 
void functionReplaced (std::string const &funStr)
 User replaces the whole function (eg, by pasting it from clipboard)
 
void globalsChanged (const std::vector< std::string > &)
 User changed the list of global parameters.
 
void localParameterButtonClicked (std::string const &parameterName)
 In multi-dataset context a button value editor was clicked.
 
void parameterChanged (std::string const &parameterName)
 Function parameter gets changed.
 
void parameterConstraintAdded (std::string const &functionIndex, std::string const &constraint)
 User sets a constraint.
 
void parameterConstraintRemoved (std::string const &parameterName)
 User removes a constraint.
 
void parameterTieChanged (std::string const &parameterName, std::string const &tie)
 User sets a tie.
 

Detailed Description

Class FitPropertyBrowser implements QtPropertyBrowser to display and control fitting function parameters and settings.

Date
18/04/2012

Definition at line 66 of file FunctionTreeView.h.

Constructor & Destructor Documentation

◆ FunctionTreeView()

MantidQt::MantidWidgets::FunctionTreeView::FunctionTreeView ( QWidget *  parent,
bool  multi,
std::vector< std::string >  categories = std::vector<std::string>() 
)

Constructor.

Parameters
parent:: The parent widget.
multi:: Option to use the browser for multi-dataset fitting.
categories:: Function categories to be included to the Add Function dialog. An empty vector means include all available categories.

Definition at line 106 of file FunctionTreeView.cpp.

References createActions(), createBrowser(), and m_browser.

◆ ~FunctionTreeView()

MantidQt::MantidWidgets::FunctionTreeView::~FunctionTreeView ( )
override

Member Function Documentation

◆ addAttributeAndParameterProperties()

void MantidQt::MantidWidgets::FunctionTreeView::addAttributeAndParameterProperties ( QtProperty *  prop,
const Mantid::API::IFunction_sptr fun,
const Mantid::API::CompositeFunction_sptr parentComposite = nullptr,
const std::size_t &  parentIndex = 0 
)
protected

Add attribute and parameter properties to a function property.

For a composite function adds all member functions' properties

Parameters
prop:: A function property
fun:: Shared pointer to a created function
parentComposite:: If relevant, the composite the function is part of.
parentIndex:: If relevant, the index of the function within its composite.

Definition at line 642 of file FunctionTreeView.cpp.

References addAttributeAndParameterProperties(), addAttributeProperty(), addConstraintProperties(), addFunctionProperty(), addGlobalParameterTie(), addIndexProperty(), addParameterProperty(), addParameterTie(), name, MantidQt::MantidWidgets::FunctionTreeView::AProperty::prop, and value.

Referenced by addAttributeAndParameterProperties(), and setFunction().

◆ addAttributeProperty()

FunctionTreeView::AProperty MantidQt::MantidWidgets::FunctionTreeView::addAttributeProperty ( QtProperty *  parent,
std::string const &  attName,
const Mantid::API::IFunction::Attribute att 
)
protected

Add a attribute property.

Parameters
parent:: Parent function property
attName:: Attribute name
att:: Attribute value

Definition at line 626 of file FunctionTreeView.cpp.

References Mantid::API::IFunction::Attribute::apply().

Referenced by addAttributeAndParameterProperties().

◆ addConstraintProperties()

QList< FunctionTreeView::AProperty > MantidQt::MantidWidgets::FunctionTreeView::addConstraintProperties ( QtProperty *  prop,
std::string const &  constraint 
)
protected

◆ addConstraints

void MantidQt::MantidWidgets::FunctionTreeView::addConstraints ( )
protectedslot

◆ addConstraints10

void MantidQt::MantidWidgets::FunctionTreeView::addConstraints10 ( )
protectedslot

◆ addConstraints50

void MantidQt::MantidWidgets::FunctionTreeView::addConstraints50 ( )
protectedslot

◆ addFunction()

bool MantidQt::MantidWidgets::FunctionTreeView::addFunction ( QtProperty *  prop,
const Mantid::API::IFunction_sptr fun 
)
protected

Add a function.

Parameters
prop:: Property of the parent composite function or NULL
fun:: A function to add

Definition at line 445 of file FunctionTreeView.cpp.

References addFunctionProperty(), getFunction(), MantidQt::MantidWidgets::FunctionTreeView::AProperty::prop, setFunction(), and updateFunctionIndices().

Referenced by addFunctionEnd(), and setFunction().

◆ addFunctionBegin

void MantidQt::MantidWidgets::FunctionTreeView::addFunctionBegin ( )
protectedslot

Add a function.

Add a function to currently selected composite function property.

Definition at line 1246 of file FunctionTreeView.cpp.

References addFunctionEnd(), MantidQt::MantidWidgets::SelectFunctionDialog::clearSearchBoxText(), isFunction(), m_allowedCategories, m_browser, m_selectedFunctionProperty, m_selectFunctionDialog, and top.

Referenced by createActions().

◆ addFunctionEnd

void MantidQt::MantidWidgets::FunctionTreeView::addFunctionEnd ( int  result)
protectedslot

◆ addFunctionProperty()

FunctionTreeView::AProperty MantidQt::MantidWidgets::FunctionTreeView::addFunctionProperty ( QtProperty *  parent,
std::string const &  funName 
)
protected

Add a function property.

Parameters
parent:: Parent function property or NULL
funName:: Function name
Returns
:: A set AProperty struct

Definition at line 389 of file FunctionTreeView.cpp.

References addProperty(), and m_functionManager.

Referenced by addAttributeAndParameterProperties(), and addFunction().

◆ addGlobalParameterTie()

void MantidQt::MantidWidgets::FunctionTreeView::addGlobalParameterTie ( QtProperty *  property,
const std::string &  parameterName,
const CompositeFunction_sptr parentComposite = nullptr,
const std::size_t &  parentIndex = 0 
)
protected

Adds a global tie for a parameter if one exists.

Add a global tie to a function property if one exists for the specified parameter.

Parameters
property:: A function property.
parameterName:: The name of the parameter to check for a global tie.
parentComposite:: The composite function the parameter is in. This is a nullptr if the parameter is not in a composite function.
parentIndex:: The index of the parameter within its composite.

Definition at line 742 of file FunctionTreeView.cpp.

References addTieProperty(), getFullParameterName(), m_globalTies, and m_multiDomainFunctionPrefix.

Referenced by addAttributeAndParameterProperties().

◆ addIndexProperty()

FunctionTreeView::AProperty MantidQt::MantidWidgets::FunctionTreeView::addIndexProperty ( QtProperty *  prop)
protected

Add property showing function's index in the composite function.

Parameters
prop:: A function property
Returns
:: AProperty struct for added property. If all fields are NULL - property wasn't added because it is the top function

Definition at line 776 of file FunctionTreeView.cpp.

References addProperty(), index, isFunction(), MantidQt::MantidWidgets::FunctionTreeView::AProperty::item, m_indexManager, m_properties, MantidQt::MantidWidgets::FunctionTreeView::AProperty::parent, MantidQt::MantidWidgets::FunctionTreeView::AProperty::prop, and updateFunctionIndices().

Referenced by addAttributeAndParameterProperties().

◆ addMultiDomainIndexProperty()

void MantidQt::MantidWidgets::FunctionTreeView::addMultiDomainIndexProperty ( QtProperty *  prop)
protected

Adds an index property representing the function index of a specific domain within a MultiDomainFunction.

Adds a property showing the function index of a domain within a MultiDomainFunction.

It is used when we don't want to display an entire MultiDomainFunction, just a specific function within it.

Parameters
prop:: The property to add the function index on to.

Definition at line 762 of file FunctionTreeView.cpp.

References addProperty(), m_indexManager, and m_multiDomainFunctionPrefix.

Referenced by setFunction().

◆ addParameterProperty()

FunctionTreeView::AProperty MantidQt::MantidWidgets::FunctionTreeView::addParameterProperty ( QtProperty *  parent,
std::string const &  parameterName,
std::string const &  paramDesc,
double  paramValue 
)
protected

Add a parameter property.

Parameters
parent:: Parent function property
parameterName:: Parameter name
paramDesc:: Parameter description
paramValue:: Parameter value

Definition at line 405 of file FunctionTreeView.cpp.

References addProperty(), m_functionManager, m_multiDataset, and m_parameterManager.

Referenced by addAttributeAndParameterProperties().

◆ addParameterTie()

void MantidQt::MantidWidgets::FunctionTreeView::addParameterTie ( QtProperty *  property,
const Mantid::API::IFunction_sptr function,
const std::string &  parameterName,
const std::size_t &  parameterIndex,
const Mantid::API::CompositeFunction_sptr parentComposite = nullptr,
const std::size_t &  parentIndex = 0 
)
protected

Add tie to a parameter property.

Add a tie to a function property.

This will also work for ties across functions in a composite function.

If the tie is stored within the wider composite function, it will find this tie and apply it.

Parameters
property:: A function property.
function:: Shared pointer to the function.
parameterName:: The name of the parameter to be tied.
parameterIndex:: The index of the parameter within its function.
parentComposite:: If relevant, the composite the function is part of.
parentIndex:: If relevant, the index of the function within its composite.

Definition at line 693 of file FunctionTreeView.cpp.

References addParameterTieInComposite(), and addTieProperty().

Referenced by addAttributeAndParameterProperties().

◆ addParameterTieInComposite()

bool MantidQt::MantidWidgets::FunctionTreeView::addParameterTieInComposite ( QtProperty *  property,
const std::string &  parameterName,
const Mantid::API::CompositeFunction_sptr composite,
const std::size_t &  index 
)
protected

Add tie to a parameter property stored within a composite function.

Add a tie to a function property.

Used if a tie is stored within the wider composite function.

Parameters
property:: A function property.
parameterName:: The name of the parameter to be tied.
composite:: The composite function containing the tie.
index:: The index of the function within the composite function.
Returns
true if a tie was found, and a tie property was added.

Definition at line 717 of file FunctionTreeView.cpp.

References addTieProperty(), index, and std::to_string().

Referenced by addParameterTie().

◆ addProperty()

FunctionTreeView::AProperty MantidQt::MantidWidgets::FunctionTreeView::addProperty ( QtProperty *  parent,
QtProperty *  subproperty 
)
protected

◆ addTie

void MantidQt::MantidWidgets::FunctionTreeView::addTie ( )
protectedslot

Add a tie to a parameter.

Add a custom tie to currently selected parameter.

Definition at line 1706 of file FunctionTreeView.cpp.

References addTieProperty(), getParameterName(), isParameter(), m_browser, and MantidQt::MantidWidgets::IFunctionView::parameterTieChanged().

Referenced by createActions().

◆ addTieProperty()

void MantidQt::MantidWidgets::FunctionTreeView::addTieProperty ( QtProperty *  prop,
std::string const &  tie,
bool  globalTie = false 
)
protected

◆ attributeChanged

void MantidQt::MantidWidgets::FunctionTreeView::attributeChanged ( QtProperty *  prop)
protectedslot

Called when a function attribute property is changed.

Slot connected to all function attribute managers.

Update the corresponding function.

Parameters
prop:: An attribute property that was changed

Definition at line 1895 of file FunctionTreeView.cpp.

References MantidQt::MantidWidgets::IFunctionView::attributePropertyChanged(), MantidQt::MantidWidgets::IFunctionView::functionReplaced(), getAttributeName(), getFunction(), m_emitAttributeValueChange, m_properties, setFunction(), and updateFunctionIndices().

Referenced by attributeVectorDoubleChanged(), and createBrowser().

◆ attributeVectorDoubleChanged

void MantidQt::MantidWidgets::FunctionTreeView::attributeVectorDoubleChanged ( QtProperty *  prop)
protectedslot

Called when a member of a vector attribute is changed.

Slot connected to a property displaying the value of a member of a vector attribute.

Parameters
prop:: A property that was changed.

Definition at line 1963 of file FunctionTreeView.cpp.

References attributeChanged(), and m_properties.

Referenced by createBrowser().

◆ attributeVectorSizeChanged

void MantidQt::MantidWidgets::FunctionTreeView::attributeVectorSizeChanged ( QtProperty *  prop)
protectedslot

Called when the size of a vector attribute is changed.

Parameters
prop:: A property that was changed.

Definition at line 1928 of file FunctionTreeView.cpp.

References getFunction(), m_attributeSizeManager, m_properties, setFunction(), and updateFunctionIndices().

Referenced by createBrowser().

◆ clear()

void MantidQt::MantidWidgets::FunctionTreeView::clear ( )
overridevirtual

Clear the contents.

Implements MantidQt::MantidWidgets::IFunctionView.

Definition at line 284 of file FunctionTreeView.cpp.

References m_browser, and m_properties.

Referenced by setFunction().

◆ clearErrors()

void MantidQt::MantidWidgets::FunctionTreeView::clearErrors ( )
overridevirtual

Clear all errors.

Clear all errors, if they are set.

Implements MantidQt::MantidWidgets::IFunctionView.

Definition at line 2067 of file FunctionTreeView.cpp.

References m_parameterManager.

◆ constraintChanged

void MantidQt::MantidWidgets::FunctionTreeView::constraintChanged ( QtProperty *  prop)
protectedslot

◆ copyToClipboard

void MantidQt::MantidWidgets::FunctionTreeView::copyToClipboard ( )
protectedslot

Copy the function to the clipboard.

Copy function to the clipboard.

Definition at line 1752 of file FunctionTreeView.cpp.

References MantidQt::MantidWidgets::IFunctionView::copyToClipboardRequest().

Referenced by createActions().

◆ createActions()

void MantidQt::MantidWidgets::FunctionTreeView::createActions ( )
protected

◆ createBrowser()

void MantidQt::MantidWidgets::FunctionTreeView::createBrowser ( )
protected

◆ currentFunctionIndex()

std::optional< std::string > MantidQt::MantidWidgets::FunctionTreeView::currentFunctionIndex ( ) const
overridevirtual

Index of currently selected function.

Implements MantidQt::MantidWidgets::IFunctionView.

Definition at line 2069 of file FunctionTreeView.cpp.

References m_currentFunctionIndex.

◆ doubleEditorFactory()

DoubleDialogEditorFactory * MantidQt::MantidWidgets::FunctionTreeView::doubleEditorFactory ( )

Definition at line 2174 of file FunctionTreeView.cpp.

References m_doubleEditorFactory.

◆ fixParameter

void MantidQt::MantidWidgets::FunctionTreeView::fixParameter ( )
protectedslot

Fix a parameter.

Fix currently selected parameter.

Definition at line 1663 of file FunctionTreeView.cpp.

References addTieProperty(), getParameter(), getParameterName(), isParameter(), m_browser, and MantidQt::MantidWidgets::IFunctionView::parameterTieChanged().

Referenced by createActions().

◆ getAttribute()

IFunction::Attribute MantidQt::MantidWidgets::FunctionTreeView::getAttribute ( std::string const &  attrName) const
overridevirtual

◆ getAttributeName()

std::string MantidQt::MantidWidgets::FunctionTreeView::getAttributeName ( QtProperty *  prop) const
protected

Get name of the attribute for a property.

Parameters
prop:: A property

Definition at line 956 of file FunctionTreeView.cpp.

References getIndex(), and isAttribute().

Referenced by attributeChanged().

◆ getAttributeProperty()

QtProperty * MantidQt::MantidWidgets::FunctionTreeView::getAttributeProperty ( std::string const &  parameterName) const
protected

Get a property for a parameter.

Get a property for an attribute.

Definition at line 1569 of file FunctionTreeView.cpp.

References getFunctionProperty(), index, m_browser, name, and MantidQt::MantidWidgets::splitParameterName().

Referenced by getAttribute(), setBooleanAttribute(), setDoubleAttribute(), setIntAttribute(), and setStringAttribute().

◆ getConstraint()

std::string MantidQt::MantidWidgets::FunctionTreeView::getConstraint ( std::string const &  parameterName,
const double &  lowerBound = Mantid::EMPTY_DBL(),
const double &  upperBound = Mantid::EMPTY_DBL() 
) const
protected

Get a constraint string.

Definition at line 1167 of file FunctionTreeView.cpp.

References Mantid::EMPTY_DBL().

Referenced by getFunction(), and getFunctionAndConstraint().

◆ getFullParameterName()

std::string MantidQt::MantidWidgets::FunctionTreeView::getFullParameterName ( const std::string &  parameter,
int  compositeIndex = -1 
) const
private

Gets the full parameter name when using the m_multiDomainFunctionPrefix.

Returns the full parameter name.

This will add the m_multiDomainFunctionPrefix to the start if we are using multiple datasets, and will add the composite index if it is within a composite.

Parameters
parameter:: The original parameter.
compositeIndex:: The index of the function within the composite that the parameter is in.
Returns
The full parameter name.

Definition at line 1036 of file FunctionTreeView.cpp.

References m_multiDomainFunctionPrefix, and std::to_string().

Referenced by addGlobalParameterTie().

◆ getFullTie()

std::string MantidQt::MantidWidgets::FunctionTreeView::getFullTie ( std::string const &  tie) const
private

Gets the full tie when using the m_multiDomainFunctionPrefix.

Returns the full tie to add as a Tie property.

This will add the m_multiDomainFunctionPrefix to the start if we are using multiple datasets.

Parameters
tie:: The original tie.
Returns
The full tie to use as a tie property.

Definition at line 1021 of file FunctionTreeView.cpp.

References MantidQt::MantidWidgets::isNumber(), and m_multiDomainFunctionPrefix.

Referenced by addTieProperty().

◆ getFunction()

Mantid::API::IFunction_sptr MantidQt::MantidWidgets::FunctionTreeView::getFunction ( QtProperty *  prop = nullptr,
bool  attributesOnly = false 
)

◆ getFunctionAndConstraint()

std::pair< std::string, std::string > MantidQt::MantidWidgets::FunctionTreeView::getFunctionAndConstraint ( QtProperty *  prop) const
protected

Get a pair of function index (eg f0.f2.) and constraint expression given a parameter property.

Definition at line 1872 of file FunctionTreeView.cpp.

References Mantid::EMPTY_DBL(), getConstraint(), getParameterName(), lower, m_constraintManager, name, MantidQt::MantidWidgets::splitParameterName(), and upper.

Referenced by constraintChanged(), and removeConstraint().

◆ getFunctionProperty() [1/2]

FunctionTreeView::AProperty MantidQt::MantidWidgets::FunctionTreeView::getFunctionProperty ( ) const
protected

◆ getFunctionProperty() [2/2]

QtProperty * MantidQt::MantidWidgets::FunctionTreeView::getFunctionProperty ( std::string const &  index) const
protected

Get function property for the index.

Return function property for a function with given index.

Parameters
index:: Function index to search, or empty string for top-level function
Returns
Function property, or NULL if not found

Definition at line 969 of file FunctionTreeView.cpp.

References getIndex(), index, isFunction(), and m_properties.

◆ getGlobalParameters()

std::vector< std::string > MantidQt::MantidWidgets::FunctionTreeView::getGlobalParameters ( ) const

Get a list of global parameters.

Definition at line 2107 of file FunctionTreeView.cpp.

References getParameterName(), m_properties, and name.

Referenced by addFunctionEnd(), globalChanged(), and removeFunction().

◆ getIndex()

std::string MantidQt::MantidWidgets::FunctionTreeView::getIndex ( QtProperty *  prop) const
protected

Get the function index for a property.

Parameters
prop:: A property

Definition at line 922 of file FunctionTreeView.cpp.

References getIndex(), isFunction(), m_indexManager, and m_properties.

Referenced by getAttributeName(), getFunctionProperty(), getIndex(), getParameterName(), parameterButtonClicked(), removeFunction(), and updateCurrentFunctionIndex().

◆ getNumberOfConstraintProperties()

int MantidQt::MantidWidgets::FunctionTreeView::getNumberOfConstraintProperties ( ) const
inline

Definition at line 418 of file FunctionTreeView.h.

◆ getNumberOfQtProperties()

int MantidQt::MantidWidgets::FunctionTreeView::getNumberOfQtProperties ( ) const
inline

Definition at line 416 of file FunctionTreeView.h.

◆ getNumberOfTieProperties()

int MantidQt::MantidWidgets::FunctionTreeView::getNumberOfTieProperties ( ) const
inline

Definition at line 417 of file FunctionTreeView.h.

◆ getParameter() [1/2]

double MantidQt::MantidWidgets::FunctionTreeView::getParameter ( QtProperty *  prop) const
protected

Get attribute as a string.

Get parameter value as a string.

Parameters
prop:: A parameter property

Definition at line 909 of file FunctionTreeView.cpp.

References m_parameterManager.

◆ getParameter() [2/2]

double MantidQt::MantidWidgets::FunctionTreeView::getParameter ( std::string const &  parameterName) const
overridevirtual

Get a value of a parameter.

Parameters
parameterName:: Parameter name

Implements MantidQt::MantidWidgets::IFunctionView.

Definition at line 1526 of file FunctionTreeView.cpp.

References getParameterProperty(), and m_parameterManager.

Referenced by addConstraints(), addConstraints10(), addConstraints50(), fixParameter(), and getFunction().

◆ getParameterName()

std::string MantidQt::MantidWidgets::FunctionTreeView::getParameterName ( QtProperty *  prop) const
protected

◆ getParameterProperty()

QtProperty * MantidQt::MantidWidgets::FunctionTreeView::getParameterProperty ( std::string const &  parameterName) const
protected

Get a property for a parameter Get a property for a parameter.

Get a property for a parameter.

Definition at line 1551 of file FunctionTreeView.cpp.

References getFunctionProperty(), index, name, and MantidQt::MantidWidgets::splitParameterName().

Referenced by getParameter(), getParamWidget(), getVisualRectParameterProperty(), setParameter(), setParameterConstraint(), and setParameterTie().

◆ getParamWidget()

QWidget * MantidQt::MantidWidgets::FunctionTreeView::getParamWidget ( std::string const &  parameterName) const

Definition at line 2161 of file FunctionTreeView.cpp.

References getParameterProperty(), and getPropertyWidgetItem().

◆ getParentParameterProperty()

QtProperty * MantidQt::MantidWidgets::FunctionTreeView::getParentParameterProperty ( QtProperty *  prop) const
protected

Get a property for a parameter which is a parent of a given property (tie or constraint).

Definition at line 1593 of file FunctionTreeView.cpp.

References m_constraints, and m_ties.

Referenced by constraintChanged(), getParameterName(), and removeConstraint().

◆ getPropertyWidgetItem()

QTreeWidgetItem * MantidQt::MantidWidgets::FunctionTreeView::getPropertyWidgetItem ( QtProperty *  prop) const
private

Definition at line 2132 of file FunctionTreeView.cpp.

References m_browser, and m_properties.

Referenced by getParamWidget(), and visualItemRect().

◆ getSelectedFunction()

IFunction_sptr MantidQt::MantidWidgets::FunctionTreeView::getSelectedFunction ( )
overridevirtual

Get user selected function.

Implements MantidQt::MantidWidgets::IFunctionView.

Definition at line 1856 of file FunctionTreeView.cpp.

References getFunction(), isFunction(), and m_browser.

◆ getTie()

QString MantidQt::MantidWidgets::FunctionTreeView::getTie ( QtProperty *  prop) const
protected

Get a tie for a paramater.

Get a tie for a parameter.

Parameters
prop:: A parameter property

Definition at line 1068 of file FunctionTreeView.cpp.

References m_tieManager.

Referenced by tieChanged().

◆ getTieProperty()

QtProperty * MantidQt::MantidWidgets::FunctionTreeView::getTieProperty ( QtProperty *  prop) const
protected

Get a tie property attached to a parameter property.

Definition at line 1676 of file FunctionTreeView.cpp.

Referenced by parameterPropertyChanged(), removeTie(), and setParameterTie().

◆ getVisualRectFunctionProperty()

QRect MantidQt::MantidWidgets::FunctionTreeView::getVisualRectFunctionProperty ( std::string const &  index) const

◆ getVisualRectParameterProperty()

QRect MantidQt::MantidWidgets::FunctionTreeView::getVisualRectParameterProperty ( std::string const &  index) const

◆ globalChanged

void MantidQt::MantidWidgets::FunctionTreeView::globalChanged ( QtProperty *  ,
const QString &  ,
bool   
)
protectedslot

Called when "Global" check-box was clicked.

Emit a signal when any of the Global options change.

Definition at line 2054 of file FunctionTreeView.cpp.

References getGlobalParameters(), and MantidQt::MantidWidgets::IFunctionView::globalsChanged().

Referenced by createBrowser().

◆ hasConstraint()

bool MantidQt::MantidWidgets::FunctionTreeView::hasConstraint ( QtProperty *  prop) const
protected

Check if a parameter property has a constraint.

Parameters
prop:: A parameter property.

Definition at line 1136 of file FunctionTreeView.cpp.

References hasLowerBound(), and hasUpperBound().

Referenced by setParameterConstraint().

◆ hasFunction()

bool MantidQt::MantidWidgets::FunctionTreeView::hasFunction ( ) const
overridevirtual

Check if a function is set.

Implements MantidQt::MantidWidgets::IFunctionView.

Definition at line 2015 of file FunctionTreeView.cpp.

References m_functionManager.

◆ hasLowerBound()

bool MantidQt::MantidWidgets::FunctionTreeView::hasLowerBound ( QtProperty *  prop) const
protected

Check if a parameter property has a lower bound.

Parameters
prop:: A parameter property.

Definition at line 1142 of file FunctionTreeView.cpp.

References isParameter().

Referenced by hasConstraint(), and popupMenu().

◆ hasTie()

bool MantidQt::MantidWidgets::FunctionTreeView::hasTie ( QtProperty *  prop) const
protected

Check if a parameter property has a tie.

Parameters
prop:: A parameter property

Definition at line 1048 of file FunctionTreeView.cpp.

Referenced by popupMenu().

◆ hasUpperBound()

bool MantidQt::MantidWidgets::FunctionTreeView::hasUpperBound ( QtProperty *  prop) const
protected

Check if a parameter property has a upper bound.

Parameters
prop:: A parameter property.

Definition at line 1156 of file FunctionTreeView.cpp.

References isParameter().

Referenced by hasConstraint(), and popupMenu().

◆ hideGlobals()

void MantidQt::MantidWidgets::FunctionTreeView::hideGlobals ( )

◆ isAttribute()

bool MantidQt::MantidWidgets::FunctionTreeView::isAttribute ( QtProperty *  prop) const
protected

Check if property is a function attribute.

Parameters
prop:: Property to check

Definition at line 892 of file FunctionTreeView.cpp.

References isBoolAttribute(), isDoubleAttribute(), isIntAttribute(), isStringAttribute(), and isVectorAttribute().

Referenced by getAttributeName(), and getFunction().

◆ isBoolAttribute()

bool MantidQt::MantidWidgets::FunctionTreeView::isBoolAttribute ( QtProperty *  prop) const
protected

Check if property is a bool attribute.

Check if property is a function bool attribute.

Parameters
prop:: Property to check

Definition at line 876 of file FunctionTreeView.cpp.

References m_attributeBoolManager.

Referenced by getAttribute(), and isAttribute().

◆ isConstraint()

bool MantidQt::MantidWidgets::FunctionTreeView::isConstraint ( QtProperty *  prop) const
protected

Check if a property is a constraint.

Parameters
prop:: Property to check.

Definition at line 1128 of file FunctionTreeView.cpp.

References m_constraintManager.

Referenced by popupMenu(), removeConstraint(), removeConstraintsQuiet(), and removeProperty().

◆ isDoubleAttribute()

bool MantidQt::MantidWidgets::FunctionTreeView::isDoubleAttribute ( QtProperty *  prop) const
protected

Check if property is a double attribute.

Check if property is a function attribute.

Parameters
prop:: Property to check

Definition at line 860 of file FunctionTreeView.cpp.

References m_attributeDoubleManager.

Referenced by getAttribute(), and isAttribute().

◆ isFunction()

bool MantidQt::MantidWidgets::FunctionTreeView::isFunction ( QtProperty *  prop) const
protected

Check if property is a function group.

Parameters
prop:: Property to check

Definition at line 841 of file FunctionTreeView.cpp.

References m_functionManager.

Referenced by addFunctionBegin(), addIndexProperty(), getFunction(), getFunctionProperty(), getIndex(), getSelectedFunction(), popupMenu(), removeFunction(), removeProperty(), and updateFunctionIndices().

◆ isIndex()

bool MantidQt::MantidWidgets::FunctionTreeView::isIndex ( QtProperty *  prop) const
protected

Check if a property is an index.

Parameters
prop:: A property

Definition at line 914 of file FunctionTreeView.cpp.

References m_indexManager.

Referenced by updateFunctionIndices().

◆ isIntAttribute()

bool MantidQt::MantidWidgets::FunctionTreeView::isIntAttribute ( QtProperty *  prop) const
protected

Check if property is a int attribute.

Check if property is a function attribute.

Parameters
prop:: Property to check

Definition at line 868 of file FunctionTreeView.cpp.

References m_attributeIntManager.

Referenced by getAttribute(), and isAttribute().

◆ isParameter()

bool MantidQt::MantidWidgets::FunctionTreeView::isParameter ( QtProperty *  prop) const
protected

Check if property is a function paramater.

Check if property is a function parameter.

Parameters
prop:: Property to check

Definition at line 901 of file FunctionTreeView.cpp.

References m_parameterManager.

Referenced by addConstraintProperties(), addConstraints(), addConstraints10(), addConstraints50(), addTie(), addTieProperty(), fixParameter(), getFunction(), getParameterName(), hasLowerBound(), hasUpperBound(), popupMenu(), removeConstraints(), and removeTie().

◆ isStringAttribute()

bool MantidQt::MantidWidgets::FunctionTreeView::isStringAttribute ( QtProperty *  prop) const
protected

Check if property is a string attribute.

Check if property is any of the string attributes.

Parameters
prop:: Property to check

Definition at line 849 of file FunctionTreeView.cpp.

References m_attributeStringManager, m_filenameManager, m_formulaManager, and m_workspaceManager.

Referenced by getAttribute(), and isAttribute().

◆ isTie()

bool MantidQt::MantidWidgets::FunctionTreeView::isTie ( QtProperty *  prop) const
protected

Check if a property is a tie.

Parameters
prop:: A property

Definition at line 1060 of file FunctionTreeView.cpp.

References m_tieManager.

Referenced by removeProperty().

◆ isVectorAttribute()

bool MantidQt::MantidWidgets::FunctionTreeView::isVectorAttribute ( QtProperty *  prop) const
protected

Check if property is a vector attribute.

Check if property is a function vector attribute.

Parameters
prop:: Property to check

Definition at line 884 of file FunctionTreeView.cpp.

References m_attributeVectorManager.

Referenced by getAttribute(), and isAttribute().

◆ parameterButtonClicked

void MantidQt::MantidWidgets::FunctionTreeView::parameterButtonClicked ( QtProperty *  prop)
protectedslot

Called when button in local parameter editor was clicked.

Definition at line 2011 of file FunctionTreeView.cpp.

References getIndex(), and MantidQt::MantidWidgets::IFunctionView::localParameterButtonClicked().

Referenced by createBrowser().

◆ parameterPropertyChanged

void MantidQt::MantidWidgets::FunctionTreeView::parameterPropertyChanged ( QtProperty *  prop)
protectedslot

◆ pasteFromClipboard

void MantidQt::MantidWidgets::FunctionTreeView::pasteFromClipboard ( )
protectedslot

Copy function from the clipboard.

Definition at line 1731 of file FunctionTreeView.cpp.

References MantidQt::MantidWidgets::IFunctionView::functionReplaced(), and setFunction().

Referenced by createActions().

◆ popupMenu

void MantidQt::MantidWidgets::FunctionTreeView::popupMenu ( const QPoint &  )
protectedslot

◆ removeConstraint

void MantidQt::MantidWidgets::FunctionTreeView::removeConstraint ( )
protectedslot

◆ removeConstraints

void MantidQt::MantidWidgets::FunctionTreeView::removeConstraints ( )
protectedslot

Remove both constraints from current parameter.

Definition at line 1822 of file FunctionTreeView.cpp.

References getParameterName(), isParameter(), m_browser, MantidQt::MantidWidgets::IFunctionView::parameterConstraintRemoved(), and removeConstraintsQuiet().

Referenced by createActions().

◆ removeConstraintsQuiet()

void MantidQt::MantidWidgets::FunctionTreeView::removeConstraintsQuiet ( QtProperty *  paramProp)
protected

Definition at line 1810 of file FunctionTreeView.cpp.

References isConstraint(), and removeProperty().

Referenced by removeConstraints(), and setParameterConstraint().

◆ removeFunction

void MantidQt::MantidWidgets::FunctionTreeView::removeFunction ( )
protectedslot

◆ removeProperty()

void MantidQt::MantidWidgets::FunctionTreeView::removeProperty ( QtProperty *  prop)
protected

◆ removeTie

void MantidQt::MantidWidgets::FunctionTreeView::removeTie ( )
protectedslot

Unfix a parameter.

Unfix currently selected parameter.

Definition at line 1689 of file FunctionTreeView.cpp.

References getParameterName(), getTieProperty(), isParameter(), m_browser, MantidQt::MantidWidgets::IFunctionView::parameterTieChanged(), and removeProperty().

Referenced by createActions().

◆ setAttributeToFunction

void MantidQt::MantidWidgets::FunctionTreeView::setAttributeToFunction ( Mantid::API::IFunction fun,
QtProperty *  prop 
)
protectedslot

Set value of an attribute (as a property) to a function.

Parameters
fun:: Function to which attribute is set.
prop:: A property with the name and value of the attribute.

Definition at line 1327 of file FunctionTreeView.cpp.

References Mantid::API::IFunction::Attribute::apply(), Mantid::API::IFunction::getAttribute(), and Mantid::API::IFunction::setAttribute().

Referenced by getFunction().

◆ setBooleanAttribute()

void MantidQt::MantidWidgets::FunctionTreeView::setBooleanAttribute ( std::string const &  attrName,
bool  value 
)
overrideprivatevirtual

Updates the value of a boolean attribute.

Parameters
attrName:: Attribute name
value:: New value

Implements MantidQt::MantidWidgets::IFunctionView.

Definition at line 1504 of file FunctionTreeView.cpp.

References getAttributeProperty(), m_attributeBoolManager, m_emitAttributeValueChange, and value.

◆ setColumnSizes()

void MantidQt::MantidWidgets::FunctionTreeView::setColumnSizes ( int  s0,
int  s1,
int  s2 = -1 
)

Resize the browser's columns.

Parameters
s0:: New size for the first column (Parameter).
s1:: New size for the second column (Value).
s2:: New size for the third optional column (Global).

Definition at line 2021 of file FunctionTreeView.cpp.

References m_browser.

Referenced by MantidQt::MantidWidgets::FunctionMultiDomainPresenter::setColumnSizes().

◆ setDoubleAttribute()

void MantidQt::MantidWidgets::FunctionTreeView::setDoubleAttribute ( std::string const &  attrName,
double  value 
)
overrideprivatevirtual

Update a double attribute.

Updates the value of a double attribute.

Parameters
attrName:: Attribute name
value:: New value

Implements MantidQt::MantidWidgets::IFunctionView.

Definition at line 1463 of file FunctionTreeView.cpp.

References getAttributeProperty(), m_attributeDoubleManager, m_emitAttributeValueChange, and value.

◆ setErrorsEnabled()

void MantidQt::MantidWidgets::FunctionTreeView::setErrorsEnabled ( bool  enabled)
overridevirtual

Set error display on/off.

Set display of parameter errors on/off.

Parameters
enabled:: [input] On/off display of errors

Implements MantidQt::MantidWidgets::IFunctionView.

Definition at line 2062 of file FunctionTreeView.cpp.

References m_parameterManager.

Referenced by createActions(), and parameterPropertyChanged().

◆ setFunction() [1/2]

void MantidQt::MantidWidgets::FunctionTreeView::setFunction ( Mantid::API::IFunction_sptr  fun)
overridevirtual

Set the function in the browser.

Parameters
fun:: A function

Implements MantidQt::MantidWidgets::IFunctionView.

Definition at line 293 of file FunctionTreeView.cpp.

References addFunction(), and clear().

Referenced by addFunction(), addFunctionEnd(), attributeChanged(), attributeVectorSizeChanged(), pasteFromClipboard(), and removeFunction().

◆ setFunction() [2/2]

void MantidQt::MantidWidgets::FunctionTreeView::setFunction ( QtProperty *  prop,
const Mantid::API::IFunction_sptr fun 
)
protected

Set a function.

Parameters
prop:: Property of the function or NULL
fun:: A function

Definition at line 429 of file FunctionTreeView.cpp.

References addAttributeAndParameterProperties(), addMultiDomainIndexProperty(), m_multiDomainFunctionPrefix, and removeProperty().

◆ setGlobalParameters()

void MantidQt::MantidWidgets::FunctionTreeView::setGlobalParameters ( const std::vector< std::string > &  globals)
overridevirtual

Set new global parameters.

Implements MantidQt::MantidWidgets::IFunctionView.

Definition at line 2118 of file FunctionTreeView.cpp.

References getParameterName(), and m_properties.

Referenced by addFunctionEnd(), and removeFunction().

◆ setGlobalTies()

void MantidQt::MantidWidgets::FunctionTreeView::setGlobalTies ( std::vector< GlobalTie > const &  globalTies)

The global ties within a multi-domain function.

It is used when we don't want to display an entire MultiDomainFunction, and so we have to store the GlobalTies manually in this vector.

Parameters
globalTies:: A vector of global ties to be displayed within the function tree.

Definition at line 2049 of file FunctionTreeView.cpp.

References m_globalTies.

◆ setIntAttribute()

void MantidQt::MantidWidgets::FunctionTreeView::setIntAttribute ( std::string const &  attrName,
int  value 
)
overrideprivatevirtual

Updates the value of a integer attribute.

Parameters
attrName:: Attribute name
value:: New value

Implements MantidQt::MantidWidgets::IFunctionView.

Definition at line 1473 of file FunctionTreeView.cpp.

References getAttributeProperty(), m_attributeIntManager, m_emitAttributeValueChange, and value.

◆ setMultiDomainFunctionPrefix()

void MantidQt::MantidWidgets::FunctionTreeView::setMultiDomainFunctionPrefix ( std::string const &  functionPrefix)

The function index displayed as a multi-domain function index at the top of the FunctionTreeView.

It is used as an offset for the other function prefixes. It is used when we don't want to display an entire MultiDomainFunction, just a specific function within it.

Parameters
functionPrefix:: The function prefix of the domain currently being displayed in the FunctionTreeView.

Definition at line 2038 of file FunctionTreeView.cpp.

References m_multiDomainFunctionPrefix.

◆ setParameter()

void MantidQt::MantidWidgets::FunctionTreeView::setParameter ( std::string const &  parameterName,
double  value 
)
overridevirtual

Update the function parameter value.

Updates the function parameter value.

Parameters
parameterName:: Parameter name
value:: New value

Implements MantidQt::MantidWidgets::IFunctionView.

Definition at line 1434 of file FunctionTreeView.cpp.

References getParameterProperty(), m_emitParameterValueChange, m_parameterManager, and value.

◆ setParameterConstraint()

void MantidQt::MantidWidgets::FunctionTreeView::setParameterConstraint ( std::string const &  parameterName,
std::string const &  constraint 
)
overridevirtual

◆ setParameterError()

void MantidQt::MantidWidgets::FunctionTreeView::setParameterError ( std::string const &  parameterName,
double  error 
)
overridevirtual

Update the function parameter error.

Updates the function parameter error.

Parameters
parameterName:: Parameter name
error:: New error

Implements MantidQt::MantidWidgets::IFunctionView.

Definition at line 1445 of file FunctionTreeView.cpp.

References error, getFunctionProperty(), index, m_parameterManager, name, and MantidQt::MantidWidgets::splitParameterName().

◆ setParameterTie()

void MantidQt::MantidWidgets::FunctionTreeView::setParameterTie ( std::string const &  parameterName,
std::string const &  tie 
)
overridevirtual

◆ setStretchLastColumn()

void MantidQt::MantidWidgets::FunctionTreeView::setStretchLastColumn ( bool  stretch)

Set the last column to stretch.

Definition at line 2023 of file FunctionTreeView.cpp.

References m_browser.

◆ setStringAttribute()

void MantidQt::MantidWidgets::FunctionTreeView::setStringAttribute ( std::string const &  attrName,
std::string &  valueAsStdStr 
)
overrideprivatevirtual

Updates the value of a string attribute.

Parameters
attrName:: Attribute name
valueAsStdStr:: New value

Implements MantidQt::MantidWidgets::IFunctionView.

Definition at line 1483 of file FunctionTreeView.cpp.

References getAttributeProperty(), m_attributeStringManager, m_emitAttributeValueChange, m_filenameManager, m_formulaManager, m_workspaceManager, and value.

◆ setVectorAttribute()

void MantidQt::MantidWidgets::FunctionTreeView::setVectorAttribute ( std::string const &  attrName,
std::vector< double > &  value 
)
overrideprivatevirtual

Updates the value of a vector attribute NOTE: This is currently not implemented as there is no need for it as the use of vector attributes is limited to tabulated functions (e.g resolution) which create their attributes 'on-the-fly' when the fit is performed.

Parameters
attrName:: Attribute name
value:: New value

Implements MantidQt::MantidWidgets::IFunctionView.

Definition at line 1518 of file FunctionTreeView.cpp.

References UNUSED_ARG, and value.

◆ showFunctionHelp()

void MantidQt::MantidWidgets::FunctionTreeView::showFunctionHelp ( std::string const &  functionName) const
overridevirtual

Show function help page for input functionName.

Implements MantidQt::MantidWidgets::IFunctionView.

Definition at line 1868 of file FunctionTreeView.cpp.

References MantidQt::API::InterfaceManager::showFitFunctionHelp().

◆ showGlobals()

void MantidQt::MantidWidgets::FunctionTreeView::showGlobals ( )

◆ tieChanged

void MantidQt::MantidWidgets::FunctionTreeView::tieChanged ( QtProperty *  prop)
protectedslot

Called when a tie property changes.

Definition at line 1986 of file FunctionTreeView.cpp.

References getParameterName(), getTie(), m_ties, and MantidQt::MantidWidgets::IFunctionView::parameterTieChanged().

Referenced by createBrowser().

◆ treeBrowser()

QtTreePropertyBrowser * MantidQt::MantidWidgets::FunctionTreeView::treeBrowser ( )

Definition at line 2172 of file FunctionTreeView.cpp.

References m_browser.

◆ treeWidget()

QTreeWidget * MantidQt::MantidWidgets::FunctionTreeView::treeWidget ( ) const

Definition at line 2170 of file FunctionTreeView.cpp.

References m_browser.

◆ updateCurrentFunctionIndex

void MantidQt::MantidWidgets::FunctionTreeView::updateCurrentFunctionIndex ( )
protectedslot

Update index of currently selected function.

Definition at line 2071 of file FunctionTreeView.cpp.

References MantidQt::MantidWidgets::IFunctionView::currentFunctionChanged(), getIndex(), m_browser, and m_currentFunctionIndex.

Referenced by createBrowser().

◆ updateFunctionIndices()

void MantidQt::MantidWidgets::FunctionTreeView::updateFunctionIndices ( QtProperty *  prop = nullptr,
std::string const &  index = "" 
)
protected

Update function index properties.

Parameters
prop:: A function property
index:: The parent function's index

Definition at line 802 of file FunctionTreeView.cpp.

References index, isFunction(), isIndex(), m_browser, m_indexManager, m_multiDomainFunctionPrefix, std::to_string(), top, and updateFunctionIndices().

Referenced by addFunction(), addIndexProperty(), attributeChanged(), attributeVectorSizeChanged(), removeFunction(), and updateFunctionIndices().

◆ visualItemRect()

QRect MantidQt::MantidWidgets::FunctionTreeView::visualItemRect ( QtProperty *  prop) const
private

Friends And Related Symbol Documentation

◆ CreateAttributePropertyForFunctionTreeView

Definition at line 394 of file FunctionTreeView.h.

◆ SetAttributeFromProperty

friend class SetAttributeFromProperty
friend

Definition at line 395 of file FunctionTreeView.h.

Member Data Documentation

◆ m_actionAddFunction

QAction* MantidQt::MantidWidgets::FunctionTreeView::m_actionAddFunction
protected

Add a function.

Definition at line 352 of file FunctionTreeView.h.

Referenced by createActions(), and popupMenu().

◆ m_actionAddTie

QAction* MantidQt::MantidWidgets::FunctionTreeView::m_actionAddTie
protected

Add a custom tie to a parameter.

Definition at line 360 of file FunctionTreeView.h.

Referenced by createActions(), and popupMenu().

◆ m_actionConstraints

QAction* MantidQt::MantidWidgets::FunctionTreeView::m_actionConstraints
protected

Add both constraints to current parameter.

Definition at line 370 of file FunctionTreeView.h.

Referenced by createActions(), and popupMenu().

◆ m_actionConstraints10

QAction* MantidQt::MantidWidgets::FunctionTreeView::m_actionConstraints10
protected

Add both constraints to current parameter with 10% spread.

Definition at line 366 of file FunctionTreeView.h.

Referenced by createActions(), and popupMenu().

◆ m_actionConstraints50

QAction* MantidQt::MantidWidgets::FunctionTreeView::m_actionConstraints50
protected

Add both constraints to current parameter with 50% spread.

Definition at line 368 of file FunctionTreeView.h.

Referenced by createActions(), and popupMenu().

◆ m_actionFixParameter

QAction* MantidQt::MantidWidgets::FunctionTreeView::m_actionFixParameter
protected

Fix a parameter.

Definition at line 356 of file FunctionTreeView.h.

Referenced by createActions(), and popupMenu().

◆ m_actionFromClipboard

QAction* MantidQt::MantidWidgets::FunctionTreeView::m_actionFromClipboard
protected

Copy a function from the clipboard.

Definition at line 362 of file FunctionTreeView.h.

Referenced by createActions(), and popupMenu().

◆ m_actionFunctionHelp

QAction* MantidQt::MantidWidgets::FunctionTreeView::m_actionFunctionHelp
protected

Show function help menu.

Definition at line 376 of file FunctionTreeView.h.

Referenced by createActions(), and popupMenu().

◆ m_actionRemoveConstraint

QAction* MantidQt::MantidWidgets::FunctionTreeView::m_actionRemoveConstraint
protected

Remove one constraints from current parameter.

Definition at line 374 of file FunctionTreeView.h.

Referenced by createActions(), and popupMenu().

◆ m_actionRemoveConstraints

QAction* MantidQt::MantidWidgets::FunctionTreeView::m_actionRemoveConstraints
protected

Remove both constraints from current parameter.

Definition at line 372 of file FunctionTreeView.h.

Referenced by createActions(), and popupMenu().

◆ m_actionRemoveFunction

QAction* MantidQt::MantidWidgets::FunctionTreeView::m_actionRemoveFunction
protected

Remove a function.

Definition at line 354 of file FunctionTreeView.h.

Referenced by createActions(), and popupMenu().

◆ m_actionRemoveTie

QAction* MantidQt::MantidWidgets::FunctionTreeView::m_actionRemoveTie
protected

Unfix a parameter.

Definition at line 358 of file FunctionTreeView.h.

Referenced by createActions(), and popupMenu().

◆ m_actionToClipboard

QAction* MantidQt::MantidWidgets::FunctionTreeView::m_actionToClipboard
protected

Copy a function to the clipboard.

Definition at line 364 of file FunctionTreeView.h.

Referenced by createActions(), and popupMenu().

◆ m_allowedCategories

std::vector<std::string> MantidQt::MantidWidgets::FunctionTreeView::m_allowedCategories
protected

Definition at line 388 of file FunctionTreeView.h.

Referenced by addFunctionBegin().

◆ m_attributeBoolManager

QtBoolPropertyManager* MantidQt::MantidWidgets::FunctionTreeView::m_attributeBoolManager
protected

◆ m_attributeDoubleManager

QtDoublePropertyManager* MantidQt::MantidWidgets::FunctionTreeView::m_attributeDoubleManager
protected

◆ m_attributeIntManager

QtIntPropertyManager* MantidQt::MantidWidgets::FunctionTreeView::m_attributeIntManager
protected

◆ m_attributeSizeManager

QtIntPropertyManager* MantidQt::MantidWidgets::FunctionTreeView::m_attributeSizeManager
protected

◆ m_attributeStringManager

QtStringPropertyManager* MantidQt::MantidWidgets::FunctionTreeView::m_attributeStringManager
protected

◆ m_attributeVectorDoubleManager

QtDoublePropertyManager* MantidQt::MantidWidgets::FunctionTreeView::m_attributeVectorDoubleManager
protected

◆ m_attributeVectorManager

QtGroupPropertyManager* MantidQt::MantidWidgets::FunctionTreeView::m_attributeVectorManager
protected

Manager for vector attribute properties.

Definition at line 334 of file FunctionTreeView.h.

Referenced by MantidQt::MantidWidgets::CreateAttributePropertyForFunctionTreeView::apply(), createBrowser(), and isVectorAttribute().

◆ m_browser

QtTreePropertyBrowser* MantidQt::MantidWidgets::FunctionTreeView::m_browser
protected

◆ m_constraintManager

QtDoublePropertyManager* MantidQt::MantidWidgets::FunctionTreeView::m_constraintManager
protected

Manager for parameter constraint properties.

Definition at line 326 of file FunctionTreeView.h.

Referenced by addConstraintProperties(), createBrowser(), getFunction(), getFunctionAndConstraint(), isConstraint(), and ~FunctionTreeView().

◆ m_constraints

QMultiMap<QtProperty *, AConstraint> MantidQt::MantidWidgets::FunctionTreeView::m_constraints
protected

Store parameter constraints. Keys are function properties.

Definition at line 347 of file FunctionTreeView.h.

Referenced by addConstraintProperties(), constraintChanged(), getFunction(), getParentParameterProperty(), and removeProperty().

◆ m_currentFunctionIndex

std::optional<std::string> MantidQt::MantidWidgets::FunctionTreeView::m_currentFunctionIndex
protected

Index of currently selected function.

Gets updated in updateCurrentFunctionIndex()

Definition at line 379 of file FunctionTreeView.h.

Referenced by currentFunctionIndex(), and updateCurrentFunctionIndex().

◆ m_doubleEditorFactory

DoubleDialogEditorFactory* MantidQt::MantidWidgets::FunctionTreeView::m_doubleEditorFactory
protected

Editor used for editing doubles.

Definition at line 308 of file FunctionTreeView.h.

Referenced by createBrowser(), and doubleEditorFactory().

◆ m_emitAttributeValueChange

bool MantidQt::MantidWidgets::FunctionTreeView::m_emitAttributeValueChange = true
protected

◆ m_emitParameterValueChange

bool MantidQt::MantidWidgets::FunctionTreeView::m_emitParameterValueChange = true
protected

Definition at line 391 of file FunctionTreeView.h.

Referenced by parameterPropertyChanged(), and setParameter().

◆ m_filenameManager

QtStringPropertyManager* MantidQt::MantidWidgets::FunctionTreeView::m_filenameManager
protected

◆ m_formulaManager

QtStringPropertyManager* MantidQt::MantidWidgets::FunctionTreeView::m_formulaManager
protected

◆ m_functionManager

QtGroupPropertyManager* MantidQt::MantidWidgets::FunctionTreeView::m_functionManager
protected

◆ m_globalTies

std::vector<GlobalTie> MantidQt::MantidWidgets::FunctionTreeView::m_globalTies
protected

Definition at line 387 of file FunctionTreeView.h.

Referenced by addGlobalParameterTie(), and setGlobalTies().

◆ m_indexManager

QtStringPropertyManager* MantidQt::MantidWidgets::FunctionTreeView::m_indexManager
protected

Manager for function index properties.

Definition at line 322 of file FunctionTreeView.h.

Referenced by addIndexProperty(), addMultiDomainIndexProperty(), createBrowser(), getIndex(), isIndex(), updateFunctionIndices(), and ~FunctionTreeView().

◆ m_multiDataset

bool MantidQt::MantidWidgets::FunctionTreeView::m_multiDataset
protected

Set true if the constructed function is intended to be used in a multi-dataset fit.

Definition at line 382 of file FunctionTreeView.h.

Referenced by addParameterProperty(), and createBrowser().

◆ m_multiDomainFunctionPrefix

std::string MantidQt::MantidWidgets::FunctionTreeView::m_multiDomainFunctionPrefix
protected

The function prefix of the domain with a MultiDomainFunction currently being displayed.

Definition at line 385 of file FunctionTreeView.h.

Referenced by addFunctionEnd(), addGlobalParameterTie(), addMultiDomainIndexProperty(), getFullParameterName(), getFullTie(), removeFunction(), setFunction(), setMultiDomainFunctionPrefix(), and updateFunctionIndices().

◆ m_parameterManager

ParameterPropertyManager* MantidQt::MantidWidgets::FunctionTreeView::m_parameterManager
protected

◆ m_properties

QMap<QtProperty *, AProperty> MantidQt::MantidWidgets::FunctionTreeView::m_properties
protected

◆ m_selectedFunctionProperty

QtProperty* MantidQt::MantidWidgets::FunctionTreeView::m_selectedFunctionProperty
protected

Definition at line 390 of file FunctionTreeView.h.

Referenced by addFunctionBegin(), and addFunctionEnd().

◆ m_selectFunctionDialog

SelectFunctionDialog* MantidQt::MantidWidgets::FunctionTreeView::m_selectFunctionDialog
protected

Definition at line 389 of file FunctionTreeView.h.

Referenced by addFunctionBegin(), and addFunctionEnd().

◆ m_tieManager

QtStringPropertyManager* MantidQt::MantidWidgets::FunctionTreeView::m_tieManager
protected

Manager for function tie properties.

Definition at line 324 of file FunctionTreeView.h.

Referenced by addTieProperty(), createBrowser(), getFunction(), getTie(), isTie(), parameterPropertyChanged(), setParameterTie(), and ~FunctionTreeView().

◆ m_ties

QMultiMap<QtProperty *, ATie> MantidQt::MantidWidgets::FunctionTreeView::m_ties
protected

Store parameter ties. Keys are function properties.

Definition at line 345 of file FunctionTreeView.h.

Referenced by addTieProperty(), getFunction(), getParentParameterProperty(), removeProperty(), and tieChanged().

◆ m_workspaceManager

QtStringPropertyManager* MantidQt::MantidWidgets::FunctionTreeView::m_workspaceManager
protected

The documentation for this class was generated from the following files: