Skip to content
Snippets Groups Projects
Commit ca2b102f authored by Matthias Puchner's avatar Matthias Puchner
Browse files

use namespace instead of class (LayerEditorUtils)

parent 34b4f1ca
No related branches found
No related tags found
1 merge request!413introduce layer oriented sample editor
Pipeline #47559 passed
......@@ -38,42 +38,41 @@ class ItemWithParticles;
class QPushButton;
//! Utility functions to support layer oriented sample editor
class LayerEditorUtils {
public:
static void updateLabelUnit(QLabel* label);
static void updateLabelUnit(QLabel* label, DoubleSpinBox* editor);
namespace LayerEditorUtils {
static void addMultiPropertyToGrid(QGridLayout* m_gridLayout, int firstCol,
const DoubleDescriptors& valueDescriptors,
SampleEditorController* m_ec, bool vertically,
bool addSpacer);
void updateLabelUnit(QLabel* label);
void updateLabelUnit(QLabel* label, DoubleSpinBox* editor);
static void addMultiPropertyToGrid(QGridLayout* m_gridLayout, int firstCol,
const DoubleDescriptors& valueDescriptors,
SampleEditorController* m_ec, bool addSpacer);
void addMultiPropertyToGrid(QGridLayout* m_gridLayout, int firstCol,
const DoubleDescriptors& valueDescriptors, SampleEditorController* m_ec,
bool vertically, bool addSpacer);
static void addVectorToGrid(QGridLayout* m_gridLayout, int firstCol, const VectorDescriptor& v,
SampleEditorController* m_ec, bool vertically, bool addSpacer);
void addMultiPropertyToGrid(QGridLayout* m_gridLayout, int firstCol,
const DoubleDescriptors& valueDescriptors, SampleEditorController* m_ec,
bool addSpacer);
static QLabel* createBoldLabel(const QString& text);
void addVectorToGrid(QGridLayout* m_gridLayout, int firstCol, const VectorDescriptor& v,
SampleEditorController* m_ec, bool vertically, bool addSpacer);
static DoubleDescriptors doubleDescriptorsOfItem(
const std::variant<LayerZeroRoughnessItem*, LayerBasicRoughnessItem*>& item);
QLabel* createBoldLabel(const QString& text);
static DoubleDescriptors doubleDescriptorsOfItem(FTDecayFunction1DItem* item);
static DoubleDescriptors doubleDescriptorsOfItem(FormFactorItem* item);
static DoubleDescriptors doubleDescriptorsOfItem(FTDistribution1DItem* item);
static DoubleDescriptors doubleDescriptorsOfItem(RotationItem* item);
DoubleDescriptors doubleDescriptorsOfItem(
const std::variant<LayerZeroRoughnessItem*, LayerBasicRoughnessItem*>& item);
static QWidget* createWidgetForItemWithParticles(QWidget* parentWidget,
ItemWithParticles* itemWithParticles,
SampleEditorController* ec,
bool allowRemove = true);
DoubleDescriptors doubleDescriptorsOfItem(FTDecayFunction1DItem* item);
DoubleDescriptors doubleDescriptorsOfItem(FormFactorItem* item);
DoubleDescriptors doubleDescriptorsOfItem(FTDistribution1DItem* item);
DoubleDescriptors doubleDescriptorsOfItem(RotationItem* item);
static QPushButton* createAddParticleButton(QWidget* parentWidget,
std::function<void(const QString&)> slot);
QWidget* createWidgetForItemWithParticles(QWidget* parentWidget,
ItemWithParticles* itemWithParticles,
SampleEditorController* ec, bool allowRemove = true);
static QList<QColor> predefinedLayerColors();
};
QPushButton* createAddParticleButton(QWidget* parentWidget,
std::function<void(const QString&)> slot);
QList<QColor> predefinedLayerColors();
} // namespace LayerEditorUtils
#endif // BORNAGAIN_GUI_VIEWS_SAMPLEDESIGNER_LAYEREDITORUTILS_H
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment