BornAgain  1.19.0
Simulate and fit neutron and x-ray scattering at grazing incidence
ModelView::GraphPlotController::GraphItemControllerImpl Struct Reference
Collaboration diagram for ModelView::GraphPlotController::GraphItemControllerImpl:
[legend]

Public Member Functions

 GraphItemControllerImpl (GraphPlotController *master, QCustomPlot *plot)
 
 ~GraphItemControllerImpl ()
 
GraphItemgraph_item ()
 
void init_graph ()
 Setups controllers and updates graph properties. More...
 
void reset_graph ()
 
void update_data_controller ()
 
void update_graph_pen ()
 Updates graph pen from GraphItem. More...
 
void update_visible ()
 Update visible. More...
 

Public Attributes

QCustomPlot * m_customPlot {nullptr}
 
std::unique_ptr< Data1DPlotControllerm_dataController
 
QCPGraph * m_graph {nullptr}
 
std::unique_ptr< PenControllerm_penController
 
GraphPlotControllerm_self {nullptr}
 

Detailed Description

Definition at line 26 of file graphplotcontroller.cpp.

Constructor & Destructor Documentation

◆ GraphItemControllerImpl()

ModelView::GraphPlotController::GraphItemControllerImpl::GraphItemControllerImpl ( GraphPlotController master,
QCustomPlot *  plot 
)
inline

◆ ~GraphItemControllerImpl()

ModelView::GraphPlotController::GraphItemControllerImpl::~GraphItemControllerImpl ( )
inline

Member Function Documentation

◆ graph_item()

GraphItem* ModelView::GraphPlotController::GraphItemControllerImpl::graph_item ( )
inline

◆ init_graph()

void ModelView::GraphPlotController::GraphItemControllerImpl::init_graph ( )
inline

Setups controllers and updates graph properties.

Definition at line 40 of file graphplotcontroller.cpp.

41  {
42  m_graph = m_customPlot->addGraph();
43  m_dataController = std::make_unique<Data1DPlotController>(m_graph);
44  m_penController = std::make_unique<PenController>(m_graph);
45 
49  }
std::unique_ptr< Data1DPlotController > m_dataController
void update_graph_pen()
Updates graph pen from GraphItem.

References ModelView::GraphPlotController::GraphItemControllerImpl::m_customPlot, ModelView::GraphPlotController::GraphItemControllerImpl::m_dataController, ModelView::GraphPlotController::GraphItemControllerImpl::m_graph, ModelView::GraphPlotController::GraphItemControllerImpl::m_penController, ModelView::GraphPlotController::GraphItemControllerImpl::update_data_controller(), ModelView::GraphPlotController::GraphItemControllerImpl::update_graph_pen(), and ModelView::GraphPlotController::GraphItemControllerImpl::update_visible().

Here is the call graph for this function:

◆ reset_graph()

void ModelView::GraphPlotController::GraphItemControllerImpl::reset_graph ( )
inline

◆ update_data_controller()

void ModelView::GraphPlotController::GraphItemControllerImpl::update_data_controller ( )
inline

Definition at line 59 of file graphplotcontroller.cpp.

References ModelView::GraphPlotController::GraphItemControllerImpl::graph_item(), and ModelView::GraphPlotController::GraphItemControllerImpl::m_dataController.

Referenced by ModelView::GraphPlotController::GraphItemControllerImpl::init_graph().

Here is the call graph for this function:

◆ update_graph_pen()

void ModelView::GraphPlotController::GraphItemControllerImpl::update_graph_pen ( )
inline

Updates graph pen from GraphItem.

Definition at line 63 of file graphplotcontroller.cpp.

63 { m_penController->setItem(graph_item()->penItem()); }

References ModelView::GraphPlotController::GraphItemControllerImpl::graph_item(), and ModelView::GraphPlotController::GraphItemControllerImpl::m_penController.

Referenced by ModelView::GraphPlotController::GraphItemControllerImpl::init_graph().

Here is the call graph for this function:

◆ update_visible()

void ModelView::GraphPlotController::GraphItemControllerImpl::update_visible ( )
inline

Update visible.

Definition at line 66 of file graphplotcontroller.cpp.

67  {
68  m_graph->setVisible(graph_item()->property<bool>(GraphItem::P_DISPLAYED));
69  m_customPlot->replot();
70  }

References ModelView::GraphPlotController::GraphItemControllerImpl::graph_item(), ModelView::GraphPlotController::GraphItemControllerImpl::m_customPlot, ModelView::GraphPlotController::GraphItemControllerImpl::m_graph, and ModelView::GraphItem::P_DISPLAYED.

Referenced by ModelView::GraphPlotController::GraphItemControllerImpl::init_graph().

Here is the call graph for this function:

Member Data Documentation

◆ m_customPlot

◆ m_dataController

◆ m_graph

◆ m_penController

◆ m_self

GraphPlotController* ModelView::GraphPlotController::GraphItemControllerImpl::m_self {nullptr}

The documentation for this struct was generated from the following file: