Newer
Older
// ************************************************************************************************
//
// BornAgain: simulate and fit reflection and scattering
//
//! @file GUI/View/SampleDesigner/LayerOrientedSampleEditor.h
//! @brief Defines class LayerOrientedSampleEditor
//!
//! @homepage http://www.bornagainproject.org
//! @license GNU General Public License v3 or higher (see COPYING)
//! @copyright Forschungszentrum Jülich GmbH 2021
//! @authors Scientific Computing Group at MLZ (see CITATION, AUTHORS)
//
// ************************************************************************************************
#ifndef BORNAGAIN_GUI_VIEW_SAMPLEDESIGNER_LAYERORIENTEDSAMPLEEDITOR_H
#define BORNAGAIN_GUI_VIEW_SAMPLEDESIGNER_LAYERORIENTEDSAMPLEEDITOR_H
#include "GUI/Model/Sample/SampleItem.h"
#include <QMap>
#include <QWidget>
class MultiLayerItem;
class QToolBar;
class SampleEditorController;
class MultiLayerForm;
class QScrollArea;
Matthias Puchner
committed
class SessionItem;
class ProjectDocument;
//! Sample editor with layer oriented presentation of a sample
class LayerOrientedSampleEditor : public QWidget {
Q_OBJECT
public:
LayerOrientedSampleEditor(QWidget* parent, ProjectDocument* document);

Wuttke, Joachim
committed
~LayerOrientedSampleEditor() override;
void setCurrentSample(MultiLayerItem* multiLayerItem);
Matthias Puchner
committed
signals:
void requestViewInRealSpace(SampleItem itemToShow);
Matthias Puchner
committed
void requestCreateNewSample();
void aboutToRemoveItem(SampleItem item);
void modified();
Matthias Puchner
committed
private:
void updateActionEnabling();
void onShowInlineEditButtonsToggled(bool checked);
void onUnitActionToggled();
void createLayerColors();
Matthias Puchner
committed
//! Create empty widget with a button for sample creation
QWidget* createEmptyWidget();
private:
MultiLayerForm* m_currentMultiLayerWidget;
QScrollArea* m_scrollArea;
QToolBar* m_toolbar;
QAction* m_undoAction; // dedicated to the current sample
QAction* m_redoAction;
QAction* m_showInlineEditButtonsAction;
QAction* m_asAngstromAction;
MultiLayerItem* m_currentMultiLayerItem = nullptr;
QMap<MultiLayerItem*, SampleEditorController*> m_editControllers;
ProjectDocument* m_document;
#endif // BORNAGAIN_GUI_VIEW_SAMPLEDESIGNER_LAYERORIENTEDSAMPLEEDITOR_H