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

Public Member Functions

 ColorMapPlotControllerImpl (ColorMapPlotController *master, QCustomPlot *plot, QCPColorScale *color_scale)
 
 ~ColorMapPlotControllerImpl ()
 
ColorMapItemcolormap_item ()
 
void update_colormap ()
 
void update_data_controller ()
 
void update_gradient ()
 
void update_interpolation ()
 Updates QCPColorMap's interpolation when corresponding property of ColorMapItem changed. More...
 

Public Attributes

QCPColorMap * color_map {nullptr}
 
QCustomPlot * custom_plot {nullptr}
 
std::unique_ptr< Data2DPlotControllerdata_controller
 
ColorMapPlotControllermaster {nullptr}
 

Detailed Description

Definition at line 56 of file colormapplotcontroller.cpp.

Constructor & Destructor Documentation

◆ ColorMapPlotControllerImpl()

ModelView::ColorMapPlotController::ColorMapPlotControllerImpl::ColorMapPlotControllerImpl ( ColorMapPlotController master,
QCustomPlot *  plot,
QCPColorScale *  color_scale 
)
inline

◆ ~ColorMapPlotControllerImpl()

ModelView::ColorMapPlotController::ColorMapPlotControllerImpl::~ColorMapPlotControllerImpl ( )
inline

Member Function Documentation

◆ colormap_item()

ColorMapItem* ModelView::ColorMapPlotController::ColorMapPlotControllerImpl::colormap_item ( )
inline

◆ update_colormap()

void ModelView::ColorMapPlotController::ColorMapPlotControllerImpl::update_colormap ( )
inline

◆ update_data_controller()

void ModelView::ColorMapPlotController::ColorMapPlotControllerImpl::update_data_controller ( )
inline

Definition at line 85 of file colormapplotcontroller.cpp.

References ModelView::ColorMapPlotController::ColorMapPlotControllerImpl::colormap_item(), and ModelView::ColorMapPlotController::ColorMapPlotControllerImpl::data_controller.

Referenced by ModelView::ColorMapPlotController::ColorMapPlotControllerImpl::update_colormap().

Here is the call graph for this function:

◆ update_gradient()

void ModelView::ColorMapPlotController::ColorMapPlotControllerImpl::update_gradient ( )
inline

Definition at line 95 of file colormapplotcontroller.cpp.

96  {
97  auto combo = colormap_item()->property<ComboProperty>(ColorMapItem::P_GRADIENT);
98  color_map->setGradient(getGradient(combo.value()));
99  }
Custom property to define list of string values with multiple selections.
Definition: comboproperty.h:27
T property(const std::string &tag) const
Returns data stored in property item.
Definition: sessionitem.h:181
QCPColorGradient getGradient(const QString &gradientName)

References ModelView::ColorMapPlotController::ColorMapPlotControllerImpl::color_map, ModelView::ColorMapPlotController::ColorMapPlotControllerImpl::colormap_item(), ColorMapUtils::getGradient(), ModelView::ColorMapItem::P_GRADIENT, and ModelView::SessionItem::property().

Referenced by ModelView::ColorMapPlotController::ColorMapPlotControllerImpl::update_colormap().

Here is the call graph for this function:

◆ update_interpolation()

void ModelView::ColorMapPlotController::ColorMapPlotControllerImpl::update_interpolation ( )
inline

Updates QCPColorMap's interpolation when corresponding property of ColorMapItem changed.

Definition at line 89 of file colormapplotcontroller.cpp.

90  {
91  auto is_interpolated = colormap_item()->property<bool>(ColorMapItem::P_INTERPOLATION);
92  color_map->setInterpolate(is_interpolated);
93  }

References ModelView::ColorMapPlotController::ColorMapPlotControllerImpl::color_map, ModelView::ColorMapPlotController::ColorMapPlotControllerImpl::colormap_item(), ModelView::ColorMapItem::P_INTERPOLATION, and ModelView::SessionItem::property().

Referenced by ModelView::ColorMapPlotController::ColorMapPlotControllerImpl::update_colormap().

Here is the call graph for this function:

Member Data Documentation

◆ color_map

◆ custom_plot

◆ data_controller

◆ master

ColorMapPlotController* ModelView::ColorMapPlotController::ColorMapPlotControllerImpl::master {nullptr}

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