diff --git a/Doc/graph/projn-classes.gv b/Doc/graph/projn-classes.gv index 833142edd257444744a3ca27b3ce643239f026eb..efedc47a92b747af337abe14e181a491411d8a45 100644 --- a/Doc/graph/projn-classes.gv +++ b/Doc/graph/projn-classes.gv @@ -9,7 +9,7 @@ digraph maskClasses Plot2DWithProjectionFrame->ProjectionActions; Plot2DWithProjectionFrame->ProjectionToolbar; Plot2DWithProjectionFrame->ProjectionsEditorCanvas; - Plot2DWithProjectionFrame->ProjectionsWidget; + Plot2DWithProjectionFrame->ProjectedGraphsCanvas; Plot2DWithProjectionFrame->Scale2DEditor; ProjectionActions->MaskeditorListmodel; @@ -24,8 +24,8 @@ digraph maskClasses ProjectionsEditorCanvas->LineItem; ProjectionsEditorCanvas->Data2DItem; - ProjectionsWidget->ProjectionsPlot; - ProjectionsWidget->QTabWidget; + ProjectedGraphsCanvas->ProjectionsPlot; + ProjectedGraphsCanvas->QTabWidget; QTabWidget[style=filled fillcolor=beige]; MaskGraphicsView->QGraphicsView[arrowhead=onormal color=chocolate4]; diff --git a/GUI/View/Canvas/ProjectionsWidget.cpp b/GUI/View/Canvas/ProjectedGraphsCanvas.cpp similarity index 73% rename from GUI/View/Canvas/ProjectionsWidget.cpp rename to GUI/View/Canvas/ProjectedGraphsCanvas.cpp index dd3796a821cd9a4e5a57c30c35e4593936000e96..69adb48fefc54ab2d2afe6a63b949b30cf8b4385 100644 --- a/GUI/View/Canvas/ProjectionsWidget.cpp +++ b/GUI/View/Canvas/ProjectedGraphsCanvas.cpp @@ -2,8 +2,8 @@ // // BornAgain: simulate and fit reflection and scattering // -//! @file GUI/View/Canvas/ProjectionsWidget.cpp -//! @brief Implements class ProjectionsWidget. +//! @file GUI/View/Canvas/ProjectedGraphsCanvas.cpp +//! @brief Implements class ProjectedGraphsCanvas. //! //! @homepage http://www.bornagainproject.org //! @license GNU General Public License v3 or higher (see COPYING) @@ -12,7 +12,7 @@ // // ************************************************************************************************ -#include "GUI/View/Canvas/ProjectionsWidget.h" +#include "GUI/View/Canvas/ProjectedGraphsCanvas.h" #include "GUI/Model/Data/Data2DItem.h" #include "GUI/View/Plotter/ProjectionsPlot.h" #include <QVBoxLayout> @@ -24,7 +24,7 @@ const int vertical_projection_tab = 1; } // namespace -ProjectionsWidget::ProjectionsWidget(QWidget* parent) +ProjectedGraphsCanvas::ProjectedGraphsCanvas(QWidget* parent) : QWidget(parent) , m_xProjection(new ProjectionsPlot(Qt::Horizontal)) , m_yProjection(new ProjectionsPlot(Qt::Vertical)) @@ -43,19 +43,19 @@ ProjectionsWidget::ProjectionsWidget(QWidget* parent) setConnected(true); } -void ProjectionsWidget::setData2DItem(Data2DItem* data2DItem) +void ProjectedGraphsCanvas::setData2DItem(Data2DItem* data2DItem) { m_xProjection->setData2DItem(data2DItem); m_yProjection->setData2DItem(data2DItem); } -void ProjectionsWidget::disconnectItem() +void ProjectedGraphsCanvas::disconnectItem() { m_xProjection->disconnectItems(); m_yProjection->disconnectItems(); } -void ProjectionsWidget::onActivityChanged(MaskFlags::MaskMode mask_mode) +void ProjectedGraphsCanvas::onActivityChanged(MaskFlags::MaskMode mask_mode) { setConnected(false); @@ -67,13 +67,13 @@ void ProjectionsWidget::onActivityChanged(MaskFlags::MaskMode mask_mode) setConnected(true); } -void ProjectionsWidget::onMarginsChanged(double left, double right) +void ProjectedGraphsCanvas::onMarginsChanged(double left, double right) { m_xProjection->onMarginsChanged(left, right); m_yProjection->onMarginsChanged(left, right); } -void ProjectionsWidget::onTabChanged(int tab_index) +void ProjectedGraphsCanvas::onTabChanged(int tab_index) { if (tab_index == horizontal_projection_tab) emit changeActivityRequest(MaskFlags::HORIZONTAL_LINE_MODE); @@ -81,11 +81,12 @@ void ProjectionsWidget::onTabChanged(int tab_index) emit changeActivityRequest(MaskFlags::VERTICAL_LINE_MODE); } -void ProjectionsWidget::setConnected(bool isConnected) +void ProjectedGraphsCanvas::setConnected(bool isConnected) { if (isConnected) - connect(m_tabWidget, &QTabWidget::currentChanged, this, &ProjectionsWidget::onTabChanged); + connect(m_tabWidget, &QTabWidget::currentChanged, this, + &ProjectedGraphsCanvas::onTabChanged); else disconnect(m_tabWidget, &QTabWidget::currentChanged, this, - &ProjectionsWidget::onTabChanged); + &ProjectedGraphsCanvas::onTabChanged); } diff --git a/GUI/View/Canvas/ProjectionsWidget.h b/GUI/View/Canvas/ProjectedGraphsCanvas.h similarity index 76% rename from GUI/View/Canvas/ProjectionsWidget.h rename to GUI/View/Canvas/ProjectedGraphsCanvas.h index 74ea04e01788adf7a02c471af44611011e500b28..8fbe99e436eac0df3acd4b3dadaf23f0f74a37f3 100644 --- a/GUI/View/Canvas/ProjectionsWidget.h +++ b/GUI/View/Canvas/ProjectedGraphsCanvas.h @@ -2,8 +2,8 @@ // // BornAgain: simulate and fit reflection and scattering // -//! @file GUI/View/Canvas/ProjectionsWidget.h -//! @brief Defines class ProjectionsWidget. +//! @file GUI/View/Canvas/ProjectedGraphsCanvas.h +//! @brief Defines class ProjectedGraphsCanvas. //! //! @homepage http://www.bornagainproject.org //! @license GNU General Public License v3 or higher (see COPYING) @@ -12,8 +12,8 @@ // // ************************************************************************************************ -#ifndef BORNAGAIN_GUI_VIEW_CANVAS_PROJECTIONSWIDGET_H -#define BORNAGAIN_GUI_VIEW_CANVAS_PROJECTIONSWIDGET_H +#ifndef BORNAGAIN_GUI_VIEW_CANVAS_PROJECTEDGRAPHSCANVAS_H +#define BORNAGAIN_GUI_VIEW_CANVAS_PROJECTEDGRAPHSCANVAS_H #include "GUI/View/Scene/MaskFlags.h" #include <QTabWidget> @@ -23,10 +23,10 @@ class ProjectionsPlot; //! Holds tabs of vertical and horizontal projections, located at the bottom of ProjectionsEditor. -class ProjectionsWidget : public QWidget { +class ProjectedGraphsCanvas : public QWidget { Q_OBJECT public: - ProjectionsWidget(QWidget* parent = nullptr); + ProjectedGraphsCanvas(QWidget* parent = nullptr); void setData2DItem(Data2DItem* data2DItem); void disconnectItem(); @@ -49,4 +49,4 @@ private: QTabWidget* m_tabWidget; }; -#endif // BORNAGAIN_GUI_VIEW_CANVAS_PROJECTIONSWIDGET_H +#endif // BORNAGAIN_GUI_VIEW_CANVAS_PROJECTEDGRAPHSCANVAS_H diff --git a/GUI/View/Canvas/ProjectionsEditorCanvas.h b/GUI/View/Canvas/ProjectionsEditorCanvas.h index 1bf13fd8a79e94dec99b452b6bd7e335ce7162e4..09e493389d8601bb9a0ad79a730c3768df411d19 100644 --- a/GUI/View/Canvas/ProjectionsEditorCanvas.h +++ b/GUI/View/Canvas/ProjectionsEditorCanvas.h @@ -27,7 +27,8 @@ class MaskGraphicsView; class PlotStatusLabel; //! Holds a graphics scene to draw projections on top of ColorMap. Being a part -//! of ProjectionEditor, provides interaction logic between graphics scene and ProjectionsWidget. +//! of ProjectionEditor, provides interaction logic between graphics scene and +//! ProjectedGraphsCanvas. //! Particularly, it creates temporary ProjectionItem in projection container, when mouse //! is inside ColorMap viewport. diff --git a/GUI/View/Frame/Plot2DWithProjectionFrame.cpp b/GUI/View/Frame/Plot2DWithProjectionFrame.cpp index be4a987288536144f74a063e24bf4b387d28c732..45172c5f711283df8ebbffea3cd8c7bdac4f10ed 100644 --- a/GUI/View/Frame/Plot2DWithProjectionFrame.cpp +++ b/GUI/View/Frame/Plot2DWithProjectionFrame.cpp @@ -15,8 +15,8 @@ #include "GUI/View/Frame/Plot2DWithProjectionFrame.h" #include "Base/Util/Assert.h" #include "GUI/Model/Data/Data2DItem.h" +#include "GUI/View/Canvas/ProjectedGraphsCanvas.h" #include "GUI/View/Canvas/ProjectionsEditorCanvas.h" -#include "GUI/View/Canvas/ProjectionsWidget.h" #include "GUI/View/Setup/ProjectionActions.h" #include "GUI/View/Setup/ProjectionToolbar.h" #include "GUI/View/Setup/Scale2DEditor.h" @@ -27,7 +27,7 @@ Plot2DWithProjectionFrame::Plot2DWithProjectionFrame(QWidget* parent) : DataAccessWidget(parent) , m_actions(new ProjectionActions(this)) , m_projectionsCanvas(new ProjectionsEditorCanvas) - , m_projectionsWidget(new ProjectionsWidget) + , m_projectionsWidget(new ProjectedGraphsCanvas) , m_scaleEditor(new Scale2DEditor(this)) { auto* layout = new QHBoxLayout; @@ -60,23 +60,23 @@ Plot2DWithProjectionFrame::Plot2DWithProjectionFrame(QWidget* parent) &ProjectionsEditorCanvas::setProjectionsCanvasMode); connect(toolbar, &ProjectionToolbar::activityChanged, m_projectionsWidget, - &ProjectionsWidget::onActivityChanged); + &ProjectedGraphsCanvas::onActivityChanged); - connect(m_projectionsWidget, &ProjectionsWidget::changeActivityRequest, toolbar, + connect(m_projectionsWidget, &ProjectedGraphsCanvas::changeActivityRequest, toolbar, &ProjectionToolbar::onProjectionTabChange); connect(m_projectionsCanvas, &ProjectionsEditorCanvas::deleteSelectedRequest, m_actions, &ProjectionActions::onDeleteAction); connect(m_projectionsCanvas, &ProjectionsEditorCanvas::changeProjectionsTabRequest, - m_projectionsWidget, &ProjectionsWidget::onActivityChanged); + m_projectionsWidget, &ProjectedGraphsCanvas::onActivityChanged); // space bar push (request for zoom mode) connect(m_projectionsCanvas, &ProjectionsEditorCanvas::changeActivityRequest, toolbar, &ProjectionToolbar::onChangeActivityRequest); connect(m_projectionsCanvas, &ProjectionsEditorCanvas::marginsChanged, m_projectionsWidget, - &ProjectionsWidget::onMarginsChanged); + &ProjectedGraphsCanvas::onMarginsChanged); toolbar->onChangeActivityRequest(MaskFlags::HORIZONTAL_LINE_MODE); } diff --git a/GUI/View/Frame/Plot2DWithProjectionFrame.h b/GUI/View/Frame/Plot2DWithProjectionFrame.h index f037e074de702cb4141dbd104dbb7cb4f34430ad..091d8d8a18486a4a0895f6a76724256bf6ab78a1 100644 --- a/GUI/View/Frame/Plot2DWithProjectionFrame.h +++ b/GUI/View/Frame/Plot2DWithProjectionFrame.h @@ -19,7 +19,7 @@ class ProjectionActions; class ProjectionsEditorCanvas; -class ProjectionsWidget; +class ProjectedGraphsCanvas; class Scale2DEditor; //! Main widget to embed projections editor for Data2DItem. @@ -40,7 +40,7 @@ private: ProjectionActions* m_actions; ProjectionsEditorCanvas* m_projectionsCanvas; //! canvas with color map at the top - ProjectionsWidget* m_projectionsWidget; //! bottom widget to draw projections plot + ProjectedGraphsCanvas* m_projectionsWidget; //! bottom widget to draw projections plot Scale2DEditor* m_scaleEditor; //! panel at the right with properties }; diff --git a/GUI/View/Setup/ProjectionToolbar.h b/GUI/View/Setup/ProjectionToolbar.h index 2acfb7ed9b9416c4096beb806d5237b2a86b3a02..99bc9ecc11b43913a5fe6e2ee950a0b1334dd94b 100644 --- a/GUI/View/Setup/ProjectionToolbar.h +++ b/GUI/View/Setup/ProjectionToolbar.h @@ -22,7 +22,7 @@ class ProjectionActions; //! Toolbar with projections buttons (horizontal projections, vertical projections, select, zoom) -//! located at the right-hand side of ProjectionsEditor (part of JobProjectionsWidget). +//! located at the right-hand side of ProjectionsEditor (part of JobProjectedGraphsCanvas). class ProjectionToolbar : public QToolBar { Q_OBJECT