BornAgain
1.19.79
Simulate and fit neutron and x-ray scattering at grazing incidence
|
A customplot based widget to display projections of IntensityDataItem on X,Y axes.
Definition at line 30 of file ProjectionsPlot.h.
Public Slots | |
void | onMarginsChanged (double left, double right) |
Public Member Functions | |
ProjectionsPlot (QString projectionType, QWidget *parent=nullptr) | |
~ProjectionsPlot () override | |
virtual QList< QAction * > | actionList () |
SessionItem * | currentItem () |
const SessionItem * | currentItem () const |
virtual void | setItem (SessionItem *item) |
Protected Member Functions | |
void | hideEvent (QHideEvent *) override |
void | onProjectionPropertyChanged (SessionItem *item, const QString &property) |
void | showEvent (QShowEvent *) override |
void | subscribeToItem () override |
void | unsubscribeFromItem () override |
Private Member Functions | |
void | clearProjection (SessionItem *item) |
Removes plot corresponding to given projection item. More... | |
void | clearProjections () |
Clears all graphs corresponding to projection items. More... | |
QCPGraph * | graphForItem (SessionItem *item) |
IntensityDataItem * | intensityItem () |
bool | isHorizontalType () |
Returns true, if widget is intended for horizontal projections. More... | |
void | onAxisPropertyChanged (const QString &axisName, const QString &propertyName) |
Updates zoom of projections in accordance with IntensityDataItem. More... | |
void | onIntensityItemPropertyChanged (const QString &propertyName) |
Updates projection appearance (line style, etc) More... | |
ProjectionContainerItem * | projectionContainerItem () |
QVector< SessionItem * > | projectionItems () |
void | replot () |
void | setGraphFromItem (QCPGraph *graph, SessionItem *item) |
Sets the data to graph from given projection iten. More... | |
void | setInterpolate (bool isInterpolated) |
void | setLogz (bool isLogz) |
void | unsubscribeFromChildren () |
void | updateAxesRange () |
Updates canva's axes to match current zoom level of IntensityDataItem. More... | |
void | updateAxesTitle () |
void | updateProjections () |
Runs through all projection items and generates missed plots. More... | |
void | updateProjectionsData () |
Creates cached 2D histogram for later projection calculations. More... | |
Private Attributes | |
bool | m_block_plot_update |
QCustomPlot * | m_customPlot |
std::unique_ptr< Datafield > | m_field |
QMap< SessionItem *, QCPGraph * > | m_item_to_graph |
SessionItemController * | m_itemController |
QString | m_projectionType |
ProjectionsPlot::ProjectionsPlot | ( | QString | projectionType, |
QWidget * | parent = nullptr |
||
) |
Definition at line 31 of file ProjectionsPlot.cpp.
References m_customPlot, GUI::Constants::plot_tick_label_size(), and GUI::View::RangeUtils::setDefaultMargins().
|
override |
Definition at line 52 of file ProjectionsPlot.cpp.
References unsubscribeFromChildren().
|
virtualinherited |
Reimplemented in IntensityDataProjectionsWidget, SpecularDataWidget, SpecularDataCanvas, FitComparisonWidget1D, FitComparisonWidget, IntensityDataWidget, IntensityDataCanvas, SpecularDataImportWidget, RealDataPresenter, and RealDataMaskWidget.
Definition at line 36 of file SessionItemWidget.cpp.
Referenced by ItemComboWidget::setPresentation().
|
private |
Removes plot corresponding to given projection item.
Definition at line 235 of file ProjectionsPlot.cpp.
References graphForItem(), m_block_plot_update, m_customPlot, m_item_to_graph, and replot().
Referenced by subscribeToItem().
|
private |
Clears all graphs corresponding to projection items.
Definition at line 221 of file ProjectionsPlot.cpp.
References m_block_plot_update, m_customPlot, m_item_to_graph, and replot().
Referenced by unsubscribeFromItem().
|
inherited |
Definition at line 41 of file SessionItemWidget.cpp.
Referenced by FitFlowWidget::fitSuiteItem(), RealDataMaskWidget::intensityDataItem(), IntensityDataCanvas::intensityDataItem(), IntensityDataWidget::intensityDataItem(), IntensityDataProjectionsWidget::intensityDataItem(), intensityItem(), ColorMap::intensityItem(), JobResultsPresenter::itemPresentation(), FitParameterWidget::jobItem(), ParameterTuningWidget::jobItem(), RunFitControlWidget::jobItem(), FitComparisonWidget::jobItem(), FitComparisonWidget1D::jobItem(), IntensityDataPropertyWidget::jobItem(), SpecularDataPropertyWidget::jobItem(), SpecularDataImportWidget::realDataItem(), ItemComboWidget::setPresentation(), JobResultsPresenter::setPresentation(), SpecularDataImportWidget::specularDataItem(), SpecularDataCanvas::specularDataItem(), SpecularDataWidget::specularDataItem(), SpecularPlot::specularItem(), ItemComboWidget::subscribeToItem(), unsubscribeFromChildren(), and Plot1D::viewItem().
|
inherited |
Definition at line 46 of file SessionItemWidget.cpp.
References SessionItemController::currentItem(), and SessionItemWidget::m_itemController.
|
private |
Definition at line 147 of file ProjectionsPlot.cpp.
References intensityItem(), m_customPlot, m_item_to_graph, m_projectionType, and SessionItem::modelType().
Referenced by clearProjection(), onProjectionPropertyChanged(), and updateProjections().
|
overrideprotectedinherited |
Definition at line 56 of file SessionItemWidget.cpp.
References SessionItemWidget::m_itemController, and SessionItemController::unsubscribe().
|
private |
Definition at line 128 of file ProjectionsPlot.cpp.
References SessionItemWidget::currentItem().
Referenced by graphForItem(), onAxisPropertyChanged(), onIntensityItemPropertyChanged(), projectionContainerItem(), subscribeToItem(), updateAxesRange(), updateAxesTitle(), and updateProjectionsData().
|
private |
Returns true, if widget is intended for horizontal projections.
Definition at line 316 of file ProjectionsPlot.cpp.
References m_projectionType, and HorizontalLineItem::M_TYPE.
Referenced by updateAxesRange(), and updateAxesTitle().
|
private |
Updates zoom of projections in accordance with IntensityDataItem.
Definition at line 258 of file ProjectionsPlot.cpp.
References intensityItem(), BasicAxisItem::isBoundsPropertiesName(), AmplitudeAxisItem::isLogScalePropertyName(), BasicAxisItem::isTitlePropertyName(), replot(), setLogz(), updateAxesRange(), and updateAxesTitle().
Referenced by subscribeToItem().
|
private |
Updates projection appearance (line style, etc)
Definition at line 248 of file ProjectionsPlot.cpp.
References intensityItem(), IntensityDataItem::isInterpolatedPropertyName(), replot(), and setInterpolate().
Referenced by subscribeToItem().
|
slot |
Definition at line 57 of file ProjectionsPlot.cpp.
References m_customPlot, and replot().
Referenced by ProjectionsWidget::onMarginsChanged().
|
protected |
Definition at line 114 of file ProjectionsPlot.cpp.
References graphForItem(), m_block_plot_update, replot(), and setGraphFromItem().
Referenced by subscribeToItem().
|
private |
Definition at line 135 of file ProjectionsPlot.cpp.
References intensityItem(), and IntensityDataItem::projectionContainerItem().
Referenced by projectionItems(), subscribeToItem(), and unsubscribeFromChildren().
|
private |
Definition at line 142 of file ProjectionsPlot.cpp.
References SessionItem::childrenOfType(), m_projectionType, and projectionContainerItem().
Referenced by updateProjections().
|
private |
Definition at line 309 of file ProjectionsPlot.cpp.
References m_customPlot.
Referenced by clearProjection(), clearProjections(), onAxisPropertyChanged(), onIntensityItemPropertyChanged(), onMarginsChanged(), onProjectionPropertyChanged(), and updateProjections().
|
private |
Sets the data to graph from given projection iten.
Definition at line 274 of file ProjectionsPlot.cpp.
References m_field, HorizontalLineItem::M_TYPE, and SessionItem::modelType().
Referenced by onProjectionPropertyChanged(), and updateProjections().
|
private |
Definition at line 298 of file ProjectionsPlot.cpp.
References m_item_to_graph.
Referenced by onIntensityItemPropertyChanged().
|
virtualinherited |
Reimplemented in SpecularPlotCanvas, SpecularDataImportWidget, SpecularDataWidget, IntensityDataWidget, JobResultsPresenter, ItemComboWidget, ProjectionsWidget, SpecularDataCanvas, IntensityDataCanvas, ColorMapCanvas, and Plot1DCanvas.
Definition at line 28 of file SessionItemWidget.cpp.
References SessionItemWidget::m_itemController, SessionItemController::setItem(), and SessionItemController::subscribe().
Referenced by MaskGraphicsProxy::setIntensityItem(), FitSessionWidget::setItem(), Plot1DCanvas::setItem(), ColorMapCanvas::setItem(), IntensityDataCanvas::setItem(), SpecularDataCanvas::setItem(), ProjectionsWidget::setItem(), ItemComboWidget::setItem(), IntensityDataWidget::setItem(), SpecularDataWidget::setItem(), SpecularDataImportWidget::setItem(), SpecularPlotCanvas::setItem(), ItemComboWidget::setPresentation(), FitComparisonWidget::subscribeToItem(), and FitComparisonWidget1D::subscribeToItem().
|
private |
Definition at line 304 of file ProjectionsPlot.cpp.
References m_customPlot, and GUI::View::RangeUtils::setLogz().
Referenced by onAxisPropertyChanged(), and updateProjectionsData().
|
overrideprotectedinherited |
Definition at line 51 of file SessionItemWidget.cpp.
References SessionItemWidget::m_itemController, and SessionItemController::subscribe().
|
overrideprotectedvirtual |
Reimplemented from SessionItemWidget.
Definition at line 64 of file ProjectionsPlot.cpp.
References clearProjection(), intensityItem(), SessionItem::itemName(), BasicAxisItem::M_TYPE, AmplitudeAxisItem::M_TYPE, SessionItem::mapper(), SessionItem::modelType(), GUI::RealSpace::Particles::name(), onAxisPropertyChanged(), onIntensityItemPropertyChanged(), onProjectionPropertyChanged(), projectionContainerItem(), ModelMapper::setOnAboutToRemoveChild(), ModelMapper::setOnChildPropertyChange(), ModelMapper::setOnChildrenChange(), ModelMapper::setOnPropertyChange(), ModelMapper::setOnValueChange(), updateProjections(), and updateProjectionsData().
|
private |
Definition at line 166 of file ProjectionsPlot.cpp.
References SessionItemWidget::currentItem(), SessionItem::mapper(), projectionContainerItem(), and ModelMapper::unsubscribe().
Referenced by ~ProjectionsPlot(), and unsubscribeFromItem().
|
overrideprotectedvirtual |
Reimplemented from SessionItemWidget.
Definition at line 108 of file ProjectionsPlot.cpp.
References clearProjections(), and unsubscribeFromChildren().
|
private |
Updates canva's axes to match current zoom level of IntensityDataItem.
Definition at line 201 of file ProjectionsPlot.cpp.
References intensityItem(), isHorizontalType(), GUI::View::RangeUtils::itemDataZoom(), GUI::View::RangeUtils::itemZoomX(), GUI::View::RangeUtils::itemZoomY(), and m_customPlot.
Referenced by onAxisPropertyChanged(), and updateProjectionsData().
|
private |
Definition at line 211 of file ProjectionsPlot.cpp.
References intensityItem(), isHorizontalType(), and m_customPlot.
Referenced by onAxisPropertyChanged(), and updateProjectionsData().
|
private |
Runs through all projection items and generates missed plots.
Definition at line 184 of file ProjectionsPlot.cpp.
References graphForItem(), m_block_plot_update, projectionItems(), replot(), and setGraphFromItem().
Referenced by subscribeToItem().
|
private |
Creates cached 2D histogram for later projection calculations.
Definition at line 174 of file ProjectionsPlot.cpp.
References intensityItem(), m_field, setLogz(), updateAxesRange(), and updateAxesTitle().
Referenced by subscribeToItem().
|
private |
Definition at line 75 of file ProjectionsPlot.h.
Referenced by clearProjection(), clearProjections(), onProjectionPropertyChanged(), and updateProjections().
|
private |
Definition at line 72 of file ProjectionsPlot.h.
Referenced by ProjectionsPlot(), clearProjection(), clearProjections(), graphForItem(), onMarginsChanged(), replot(), setLogz(), updateAxesRange(), and updateAxesTitle().
|
private |
Definition at line 73 of file ProjectionsPlot.h.
Referenced by setGraphFromItem(), and updateProjectionsData().
|
private |
Definition at line 74 of file ProjectionsPlot.h.
Referenced by clearProjection(), clearProjections(), graphForItem(), and setInterpolate().
|
privateinherited |
Definition at line 49 of file SessionItemWidget.h.
Referenced by SessionItemWidget::SessionItemWidget(), SessionItemWidget::currentItem(), SessionItemWidget::hideEvent(), SessionItemWidget::setItem(), and SessionItemWidget::showEvent().
|
private |
Definition at line 71 of file ProjectionsPlot.h.
Referenced by graphForItem(), isHorizontalType(), and projectionItems().