BornAgain  1.19.79
Simulate and fit neutron and x-ray scattering at grazing incidence
CommandAddLayer Class Reference

Description

Command to add a layer to a sample.

Definition at line 44 of file SampleEditorCommands.h.

Inheritance diagram for CommandAddLayer:
[legend]
Collaboration diagram for CommandAddLayer:
[legend]

Public Member Functions

 CommandAddLayer (SampleEditorController *ec, int atIndex, QUndoCommand *parent=nullptr)
 
void redo () override
 
void undo () override
 

Private Attributes

int m_atIndex
 
SampleEditorControllerm_ec
 

Constructor & Destructor Documentation

◆ CommandAddLayer()

CommandAddLayer::CommandAddLayer ( SampleEditorController ec,
int  atIndex,
QUndoCommand *  parent = nullptr 
)

Definition at line 55 of file SampleEditorCommands.cpp.

56  : m_ec(ec)
57  , m_atIndex(atIndex)
58 {
59  setText("Add layer");
60 }
SampleEditorController * m_ec

Member Function Documentation

◆ redo()

void CommandAddLayer::redo ( )
override

Definition at line 62 of file SampleEditorCommands.cpp.

63 {
65 }
void addLayerFromUndo(int atIndex)

References SampleEditorController::addLayerFromUndo(), m_atIndex, and m_ec.

Here is the call graph for this function:

◆ undo()

void CommandAddLayer::undo ( )
override

Definition at line 67 of file SampleEditorCommands.cpp.

68 {
69  // no backup of the layer has to be stored, since redo always creates the layer
70  // from scratch - no contents required for this
72 }
void removeLayerFromUndo(int atIndex)

References m_atIndex, m_ec, and SampleEditorController::removeLayerFromUndo().

Here is the call graph for this function:

Member Data Documentation

◆ m_atIndex

int CommandAddLayer::m_atIndex
private

Definition at line 53 of file SampleEditorCommands.h.

Referenced by redo(), and undo().

◆ m_ec

SampleEditorController* CommandAddLayer::m_ec
private

Definition at line 52 of file SampleEditorCommands.h.

Referenced by redo(), and undo().


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