Mantid
Loading...
Searching...
No Matches
SlicingAlgorithmDialog.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//----------------------
10// Includes
11//----------------------
12#include "DllOption.h"
13#include "MantidAPI/Algorithm.h"
17#include "ui_SlicingAlgorithmDialog.h"
18
19namespace MantidQt {
20namespace MantidWidgets {
21
22using PropertyDimensionMap = QMap<QString, QString>;
23
24/*
25Class SlicingAlgorithmDialog
26Abstract SlicingAlgorithm Dialog geared for MD Slicing type algorithms
27
28This custom dialog provides two advantages over the default custom generated
29one.
30
311) It dynamically creates dimension input controls based on the nature of the
32input MD workspace
332) It pre-populates those dimension input controls based on existing values.
34
35*/
37 Q_OBJECT
38public:
40 SlicingAlgorithmDialog(QWidget *parent = nullptr);
41
44
45protected:
47 Ui::SlicingAlgorithmDialog ui;
48
50 void commonSliceMDSetup(const bool /*isSliceMD*/);
51
53 void buildDimensionInputs(const bool bForceForget = false);
54
55protected slots:
56
58
59 void onAxisAlignedChanged(bool /*unused*/);
60
61 void onBrowse();
62
63 void onMaxFromInput(bool /*unused*/);
64
66
67 void onCalculateChanged(bool checked);
68
69private:
70 enum History { Remember, Forget };
71
72 enum HistoryChanged { HasChanged, HasNotChanged };
73
75 void initLayout() override;
76
78 bool doAxisAligned() const;
79
82
85
88
90 void makeDimensionInputs(const QString &propertyPrefix, QLayout *owningLayout,
92
94 History useHistory(const HistoryChanged &criticalChange, const bool bForceForget);
95
97 void cleanLayoutOfDimensions(QLayout *layout);
98
101
104
106 virtual void customiseInitLayout() = 0;
107
110
113
116};
117
118/*
119Class SliceMDDialog
120Concrete SlicingAlgorithm Dialog geared for SliceMD
121*/
123 Q_OBJECT
124public:
125 SliceMDDialog(QWidget *parent = nullptr) : SlicingAlgorithmDialog(parent) {}
126
127 ~SliceMDDialog() override = default;
128
129 void customiseInitLayout() override;
130};
131
132/*
133Class BinMDDialog
134Concrete BinMDDialog Dialog geared for BinMD
135*/
137 Q_OBJECT
138public:
139 BinMDDialog(QWidget *parent = nullptr) : SlicingAlgorithmDialog(parent) {}
140 ~BinMDDialog() override = default;
141 void customiseInitLayout() override;
142};
143} // namespace MantidWidgets
144} // namespace MantidQt
#define EXPORT_OPT_MANTIDQT_COMMON
Definition DllOption.h:15
std::vector< history_type > history
history information
This class should be the basis for all customised algorithm dialogs.
void customiseInitLayout() override
Give base classes the opportunity to do any custom overriding.
void customiseInitLayout() override
Give base classes the opportunity to do any custom overriding.
void buildDimensionInputs(const bool bForceForget=false)
Build dimension inputs.
void initLayout() override
Initialize the layout.
QString getHistoricalInputWorkspaceName() const
Getter for the historical input workspace name.
void cleanLayoutOfDimensions(QLayout *layout)
Cleans a given layout.
bool doAutoFillDimensions() const
Do auto fill dimension inputs on changes.
HistoryChanged hasDimensionHistoryChanged() const
Determine if the dimension history has changed.
void commonSliceMDSetup(const bool)
Common slice md setup.
QString getCurrentOutputWorkspaceName() const
Gets the output workspace name provided.
void clearExistingDimensions()
Clear out any exisiting dimension widgets.
virtual void customiseInitLayout()=0
Give base classes the opportunity to do any custom overriding.
bool doAxisAligned() const
Determine if axis aligned or non-axis aligned is required.
History useHistory(const HistoryChanged &criticalChange, const bool bForceForget)
Determine if history should be used.
SlicingAlgorithmDialog(QWidget *parent=nullptr)
Default Constructor.
QString getCurrentInputWorkspaceName() const
Gets the input workspace name provided.
void makeDimensionInputs(const QString &propertyPrefix, QLayout *owningLayout, QString(*format)(const Mantid::Geometry::IMDDimension_const_sptr &), History history)
Build dimension inputs.
QMap< QString, QString > PropertyDimensionMap
The AlgorithmProgressDialogPresenter keeps track of the running algorithms and displays a progress ba...
std::shared_ptr< const IMDDimension > IMDDimension_const_sptr
Shared Pointer to const IMDDimension.