BornAgain
1.19.0
Simulate and fit neutron and x-ray scattering at grazing incidence
|
A customplot based widget to display projections of IntensityDataItem on X,Y axes. More...
Public Slots | |
void | onMarginsChanged (double left, double right) |
Public Member Functions | |
ProjectionsPlot (const QString &projectionType, QWidget *parent=0) | |
~ProjectionsPlot () | |
virtual QList< QAction * > | actionList () |
SessionItem * | currentItem () |
const SessionItem * | currentItem () const |
virtual void | setItem (SessionItem *item) |
Protected Member Functions | |
virtual void | hideEvent (QHideEvent *) |
void | onProjectionPropertyChanged (SessionItem *item, const QString &property) |
virtual void | showEvent (QShowEvent *) |
void | subscribeToItem () |
void | unsubscribeFromItem () |
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< Histogram2D > | m_hist2d |
QMap< SessionItem *, QCPGraph * > | m_item_to_graph |
SessionItemController * | m_itemController |
QString | m_projectionType |
A customplot based widget to display projections of IntensityDataItem on X,Y axes.
Definition at line 30 of file ProjectionsPlot.h.
ProjectionsPlot::ProjectionsPlot | ( | const QString & | projectionType, |
QWidget * | parent = 0 |
||
) |
Definition at line 26 of file ProjectionsPlot.cpp.
References m_customPlot, Constants::plot_tick_label_size(), and ColorMapUtils::setDefaultMargins().
ProjectionsPlot::~ProjectionsPlot | ( | ) |
Definition at line 46 of file ProjectionsPlot.cpp.
References unsubscribeFromChildren().
|
virtualinherited |
Reimplemented in SpecularDataCanvas, FitComparisonWidget1D, FitComparisonWidget, SpecularDataWidget, SpecularDataImportWidget, IntensityDataWidget, IntensityDataPropertyWidget, IntensityDataProjectionsWidget, IntensityDataCanvas, 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 232 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 218 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 RectangularDetectorEditor::detectorItem(), SphericalDetectorEditor::detectorItem(), FitFlowWidget::fitSuiteItem(), DistributionEditor::groupItem(), DepthProbeInstrumentEditor::instrumentItem(), EnvironmentEditor::instrumentItem(), GISASBeamEditor::instrumentItem(), GISASDetectorEditor::instrumentItem(), GISASInstrumentEditor::instrumentItem(), OffSpecularBeamEditor::instrumentItem(), OffSpecularInstrumentEditor::instrumentItem(), PolarizationAnalysisEditor::instrumentItem(), SpecularBeamEditor::instrumentItem(), SpecularInstrumentEditor::instrumentItem(), RealDataMaskWidget::intensityDataItem(), IntensityDataCanvas::intensityDataItem(), IntensityDataProjectionsWidget::intensityDataItem(), IntensityDataWidget::intensityDataItem(), intensityItem(), ColorMap::intensityItem(), DetectorPresenter::itemPresentation(), InstrumentPresenter::itemPresentation(), JobResultsPresenter::itemPresentation(), FitComparisonWidget::jobItem(), FitComparisonWidget1D::jobItem(), FitParameterWidget::jobItem(), RunFitControlWidget::jobItem(), JobPropertiesWidget::jobItem(), ParameterTuningWidget::jobItem(), SpecularDataImportWidget::realDataItem(), ItemComboWidget::setPresentation(), JobResultsPresenter::setPresentation(), SpecularDataCanvas::specularDataItem(), SpecularDataImportWidget::specularDataItem(), SpecularDataWidget::specularDataItem(), SpecularPlot::specularItem(), ItemComboWidget::subscribeToItem(), DistributionEditor::subscribeToItem(), GISASDetectorEditor::subscribeToItem(), PolarizationAnalysisEditor::subscribeToItem(), IntensityDataPropertyWidget::subscribeToItem(), JobPropertiesWidget::subscribeToItem(), ProjectionsPropertyPanel::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 144 of file ProjectionsPlot.cpp.
References intensityItem(), m_customPlot, m_item_to_graph, m_projectionType, and SessionItem::modelType().
Referenced by clearProjection(), onProjectionPropertyChanged(), and updateProjections().
|
protectedvirtualinherited |
Definition at line 56 of file SessionItemWidget.cpp.
References SessionItemWidget::m_itemController, and SessionItemController::unsubscribe().
|
private |
Definition at line 124 of file ProjectionsPlot.cpp.
References ASSERT, and 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 312 of file ProjectionsPlot.cpp.
References m_projectionType.
Referenced by updateAxesRange(), and updateAxesTitle().
|
private |
Updates zoom of projections in accordance with IntensityDataItem.
Definition at line 255 of file ProjectionsPlot.cpp.
References intensityItem(), AmplitudeAxisItem::P_IS_LOGSCALE, BasicAxisItem::P_MAX_DEG, BasicAxisItem::P_MIN_DEG, BasicAxisItem::P_TITLE, replot(), setLogz(), updateAxesRange(), and updateAxesTitle().
Referenced by subscribeToItem().
|
private |
Updates projection appearance (line style, etc)
Definition at line 245 of file ProjectionsPlot.cpp.
References intensityItem(), IntensityDataItem::P_IS_INTERPOLATED, replot(), and setInterpolate().
Referenced by subscribeToItem().
|
slot |
Definition at line 51 of file ProjectionsPlot.cpp.
References m_customPlot, and replot().
Referenced by ProjectionsWidget::onMarginsChanged().
|
protected |
Definition at line 107 of file ProjectionsPlot.cpp.
References graphForItem(), m_block_plot_update, VerticalLineItem::P_POSX, HorizontalLineItem::P_POSY, replot(), and setGraphFromItem().
Referenced by subscribeToItem().
|
private |
Definition at line 131 of file ProjectionsPlot.cpp.
References ASSERT, SessionItem::getItem(), intensityItem(), and IntensityDataItem::T_PROJECTIONS.
Referenced by projectionItems(), subscribeToItem(), and unsubscribeFromChildren().
|
private |
Definition at line 139 of file ProjectionsPlot.cpp.
References SessionItem::getChildrenOfType(), m_projectionType, and projectionContainerItem().
Referenced by updateProjections().
|
private |
Definition at line 305 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 271 of file ProjectionsPlot.cpp.
References GUIHelpers::fromStdVector(), SessionItem::getItemValue(), m_hist2d, SessionItem::modelType(), VerticalLineItem::P_POSX, and HorizontalLineItem::P_POSY.
Referenced by onProjectionPropertyChanged(), and updateProjections().
|
private |
Definition at line 294 of file ProjectionsPlot.cpp.
References m_item_to_graph.
Referenced by onIntensityItemPropertyChanged().
|
virtualinherited |
Reimplemented in SpecularPlotCanvas, SpecularDataImportWidget, SpecularDataWidget, IntensityDataWidget, SpecularDataCanvas, ProjectionsWidget, IntensityDataCanvas, ColorMapCanvas, and Plot1DCanvas.
Definition at line 28 of file SessionItemWidget.cpp.
References SessionItemWidget::m_itemController, SessionItemController::setItem(), and SessionItemController::subscribe().
Referenced by IntensityDataWidget::onFFTAction(), JobSelectorWidget::onSelectionChanged(), ProjectionsEditor::resetContext(), ProjectionsEditor::setContext(), MaskGraphicsProxy::setIntensityItem(), FitSessionWidget::setItem(), Plot1DCanvas::setItem(), InstrumentEditorWidget::setItem(), ColorMapCanvas::setItem(), IntensityDataCanvas::setItem(), ProjectionsWidget::setItem(), SpecularDataCanvas::setItem(), DistributionDialog::setItem(), IntensityDataWidget::setItem(), SpecularDataWidget::setItem(), SpecularDataImportWidget::setItem(), SpecularPlotCanvas::setItem(), ItemComboWidget::setPresentation(), GISASInstrumentEditor::subscribeToItem(), OffSpecularInstrumentEditor::subscribeToItem(), SpecularInstrumentEditor::subscribeToItem(), FitComparisonWidget::subscribeToItem(), FitComparisonWidget1D::subscribeToItem(), and GISASDetectorEditor::updateDetectorPresenter().
|
private |
Definition at line 300 of file ProjectionsPlot.cpp.
References m_customPlot, and ColorMapUtils::setLogz().
Referenced by onAxisPropertyChanged(), and updateProjectionsData().
|
protectedvirtualinherited |
Definition at line 51 of file SessionItemWidget.cpp.
References SessionItemWidget::m_itemController, and SessionItemController::subscribe().
|
protectedvirtual |
Reimplemented from SessionItemWidget.
Definition at line 58 of file ProjectionsPlot.cpp.
References clearProjection(), intensityItem(), SessionItem::itemName(), SessionItem::mapper(), SessionItem::modelType(), RealSpace::Particles::name(), onAxisPropertyChanged(), onIntensityItemPropertyChanged(), onProjectionPropertyChanged(), projectionContainerItem(), ModelMapper::setOnAboutToRemoveChild(), ModelMapper::setOnChildPropertyChange(), ModelMapper::setOnChildrenChange(), ModelMapper::setOnPropertyChange(), ModelMapper::setOnValueChange(), updateProjections(), and updateProjectionsData().
|
private |
Definition at line 163 of file ProjectionsPlot.cpp.
References SessionItemWidget::currentItem(), SessionItem::mapper(), projectionContainerItem(), and ModelMapper::unsubscribe().
Referenced by ~ProjectionsPlot(), and unsubscribeFromItem().
|
protectedvirtual |
Reimplemented from SessionItemWidget.
Definition at line 101 of file ProjectionsPlot.cpp.
References clearProjections(), and unsubscribeFromChildren().
|
private |
Updates canva's axes to match current zoom level of IntensityDataItem.
Definition at line 198 of file ProjectionsPlot.cpp.
References intensityItem(), isHorizontalType(), ColorMapUtils::itemDataZoom(), ColorMapUtils::itemZoomX(), ColorMapUtils::itemZoomY(), and m_customPlot.
Referenced by onAxisPropertyChanged(), and updateProjectionsData().
|
private |
Definition at line 208 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 181 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 171 of file ProjectionsPlot.cpp.
References intensityItem(), m_hist2d, 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().