diff --git a/GUI/Model/Data/Data2DItem.h b/GUI/Model/Data/Data2DItem.h index f57cb491487799ed429bcae572ee4832cdcd65e7..6ddd915207a65e05a1e531a866925834cba3dadc 100644 --- a/GUI/Model/Data/Data2DItem.h +++ b/GUI/Model/Data/Data2DItem.h @@ -20,7 +20,7 @@ class AmplitudeAxisItem; class MaskContainerItem; class MaskContainerModel; -class MaskRoot; +class MaskObject; class ProjectionContainerItem; class QCPColorGradient; @@ -104,8 +104,8 @@ signals: void gradientChanged(); void interpolationChanged(bool isInterpol); void projectionCreated(); - void projectionPositionChanged(MaskRoot* projection); - void projectionGone(MaskRoot* projection); + void projectionPositionChanged(MaskObject* projection); + void projectionGone(MaskObject* projection); void alignRanges(); private: diff --git a/GUI/Model/Mask/MaskContainerItem.h b/GUI/Model/Mask/MaskContainerItem.h index 131cc0198e849f18366ed9dff8ac63e5d793aec5..1e5ea8ef5d407f064318893459c64ecc5142d25c 100644 --- a/GUI/Model/Mask/MaskContainerItem.h +++ b/GUI/Model/Mask/MaskContainerItem.h @@ -17,7 +17,7 @@ #include "GUI/Model/Descriptor/SelectionProperty.h" #include "GUI/Model/Mask/MaskItemCatalog.h" -#include "GUI/Model/Mask/MaskRoot.h" +#include "GUI/Model/Mask/MaskObject.h" #include <QModelIndex> class MaskContainerModel; @@ -27,7 +27,7 @@ class RegionOfInterestItem; //! Container holding various masks as children -class MaskContainerItem : public MaskRoot { +class MaskContainerItem : public MaskObject { public: MaskContainerItem(); ~MaskContainerItem(); diff --git a/GUI/Model/Mask/MaskContainerModel.cpp b/GUI/Model/Mask/MaskContainerModel.cpp index db4628b5fbc6b9f3164834497c9ebf6732e995c2..a78c60acb5acc7d60703272c8014f04488067abc 100644 --- a/GUI/Model/Mask/MaskContainerModel.cpp +++ b/GUI/Model/Mask/MaskContainerModel.cpp @@ -82,7 +82,7 @@ void MaskContainerModel::removeMask(MaskItem* item) removeMaskAt(row); } -QModelIndex MaskContainerModel::indexOfItem(const MaskRoot* item) const +QModelIndex MaskContainerModel::indexOfItem(const MaskObject* item) const { if (const auto* ii = dynamic_cast<const MaskItem*>(item)) { const int row = m_maskContItem->indexOfItem(ii); diff --git a/GUI/Model/Mask/MaskContainerModel.h b/GUI/Model/Mask/MaskContainerModel.h index a7f12aaf1175885dce25da93a624e3978a79e0e2..bd50687b4594edbe7d1cccc61696c8537aee2472 100644 --- a/GUI/Model/Mask/MaskContainerModel.h +++ b/GUI/Model/Mask/MaskContainerModel.h @@ -22,7 +22,7 @@ class MaskContainerItem; class MaskItem; -class MaskRoot; +class MaskObject; class ProjectionContainerItem; class RegionOfInterestItem; @@ -52,7 +52,7 @@ public: void moveMask(int from_row, int to_row); void removeMaskAt(int row); - QModelIndex indexOfItem(const MaskRoot* item) const; // TODO: change this to MaskItem* + QModelIndex indexOfItem(const MaskObject* item) const; // TODO: change this to MaskItem* MaskItem* itemForIndex(const QModelIndex& index) const; QItemSelectionModel* maskSelectionModel() { return m_selectionModel.get(); } diff --git a/GUI/Model/Mask/MaskItems.h b/GUI/Model/Mask/MaskItems.h index 8cb95708bcd544a18265a37a0ce72b85b0fc2481..497b2b1b00132e863c88d432cf62900622b2c5b8 100644 --- a/GUI/Model/Mask/MaskItems.h +++ b/GUI/Model/Mask/MaskItems.h @@ -17,13 +17,13 @@ #include "Base/Types/OwningVector.h" #include "GUI/Model/Descriptor/SelectionProperty.h" -#include "GUI/Model/Mask/MaskRoot.h" +#include "GUI/Model/Mask/MaskObject.h" class IShape2D; //! A base class for mask items that describe one specific shape. -class MaskItem : public MaskRoot { +class MaskItem : public MaskObject { public: ~MaskItem() override; @@ -85,7 +85,7 @@ public: std::unique_ptr<IShape2D> createShape() const override; }; -class PolygonPointItem : public MaskRoot { +class PolygonPointItem : public MaskObject { public: static constexpr auto M_TYPE{"PolygonPoint"}; diff --git a/GUI/Model/Mask/MaskRoot.cpp b/GUI/Model/Mask/MaskObject.cpp similarity index 74% rename from GUI/Model/Mask/MaskRoot.cpp rename to GUI/Model/Mask/MaskObject.cpp index b489f26feee8300b8eeee614e052d6fbf1bf5895..0ca46027c6dcc81b6ce1f4d06e4b1b159511d3a3 100644 --- a/GUI/Model/Mask/MaskRoot.cpp +++ b/GUI/Model/Mask/MaskObject.cpp @@ -2,8 +2,8 @@ // // BornAgain: simulate and fit reflection and scattering // -//! @file GUI/Model/Mask/MaskRoot.cpp -//! @brief Implements class MaskRoot. +//! @file GUI/Model/Mask/MaskObject.cpp +//! @brief Implements class MaskObject. //! //! @homepage http://www.bornagainproject.org //! @license GNU General Public License v3 or higher (see COPYING) @@ -12,11 +12,11 @@ // // ************************************************************************************************ -#include "GUI/Model/Mask/MaskRoot.h" +#include "GUI/Model/Mask/MaskObject.h" -MaskRoot::MaskRoot() = default; +MaskObject::MaskObject() = default; -MaskRoot::~MaskRoot() +MaskObject::~MaskObject() { emit maskToBeDestroyed(this); } diff --git a/GUI/Model/Mask/MaskRoot.h b/GUI/Model/Mask/MaskObject.h similarity index 59% rename from GUI/Model/Mask/MaskRoot.h rename to GUI/Model/Mask/MaskObject.h index 0b53fc5e106c6298673ad2c5016b321dee2741f2..a9d27b7f6d83a8c0709db71a7a42e47f3e8b9b16 100644 --- a/GUI/Model/Mask/MaskRoot.h +++ b/GUI/Model/Mask/MaskObject.h @@ -2,8 +2,8 @@ // // BornAgain: simulate and fit reflection and scattering // -//! @file GUI/Model/Mask/MaskRoot.h -//! @brief Defines class MaskRoot. +//! @file GUI/Model/Mask/MaskObject.h +//! @brief Defines class MaskObject. //! //! @homepage http://www.bornagainproject.org //! @license GNU General Public License v3 or higher (see COPYING) @@ -12,23 +12,23 @@ // // ************************************************************************************************ -#ifndef BORNAGAIN_GUI_MODEL_MASK_MASKROOT_H -#define BORNAGAIN_GUI_MODEL_MASK_MASKROOT_H +#ifndef BORNAGAIN_GUI_MODEL_MASK_MASKOBJECT_H +#define BORNAGAIN_GUI_MODEL_MASK_MASKOBJECT_H #include <QObject> //! QObject with signals used in masks -class MaskRoot : public QObject { +class MaskObject : public QObject { Q_OBJECT public: - explicit MaskRoot(); - virtual ~MaskRoot(); + explicit MaskObject(); + virtual ~MaskObject(); signals: - void maskGeometryChanged(MaskRoot* sender = nullptr); + void maskGeometryChanged(MaskObject* sender = nullptr); void maskVisibilityChanged(); - void maskToBeDestroyed(MaskRoot* sender = nullptr); + void maskToBeDestroyed(MaskObject* sender = nullptr); }; -#endif // BORNAGAIN_GUI_MODEL_MASK_MASKROOT_H +#endif // BORNAGAIN_GUI_MODEL_MASK_MASKOBJECT_H diff --git a/GUI/View/Canvas/ProjectionsEditorCanvas.cpp b/GUI/View/Canvas/ProjectionsEditorCanvas.cpp index c2bba349db2b604488c3ed0cb11f9cfa50fb45e8..aa52015862404fdf22add135eaea0c18e2bc765b 100644 --- a/GUI/View/Canvas/ProjectionsEditorCanvas.cpp +++ b/GUI/View/Canvas/ProjectionsEditorCanvas.cpp @@ -157,7 +157,7 @@ void ProjectionsEditorCanvas::onActivityChanged(MaskEditorFlags::Activity value) onLeavingColorMap(); } -void ProjectionsEditorCanvas::onLineItemMoved(MaskRoot* sender) +void ProjectionsEditorCanvas::onLineItemMoved(MaskObject* sender) { if (dynamic_cast<HorizontalLineItem*>(sender) && (m_currentActivity != MaskEditorFlags::VERTICAL_LINE_MODE)) diff --git a/GUI/View/Canvas/ProjectionsEditorCanvas.h b/GUI/View/Canvas/ProjectionsEditorCanvas.h index 83867f7fbb9d3d21b2a9f825ec72c79c2abca1c1..c1776e28ebe6707ff70f368644e52516d8ee6ff4 100644 --- a/GUI/View/Canvas/ProjectionsEditorCanvas.h +++ b/GUI/View/Canvas/ProjectionsEditorCanvas.h @@ -24,7 +24,7 @@ class Data2DItem; class MaskGraphicsScene; class MaskGraphicsView; class MaskItem; -class MaskRoot; +class MaskObject; class PlotStatusLabel; //! Holds a graphics scene to draw projections on top of ColorMap. Being a part @@ -56,7 +56,7 @@ public slots: void onActivityChanged(MaskEditorFlags::Activity value); private: - void onLineItemMoved(MaskRoot* sender); + void onLineItemMoved(MaskObject* sender); void setColorMap(ColorMap* colorMap); void setConnected(bool isConnected); diff --git a/GUI/View/Plotter/ProjectionsPlot.cpp b/GUI/View/Plotter/ProjectionsPlot.cpp index 869a4a40791c49a67a3337804034b780bdedbf34..302d2ce48124d5115ab127e443de03292b992526 100644 --- a/GUI/View/Plotter/ProjectionsPlot.cpp +++ b/GUI/View/Plotter/ProjectionsPlot.cpp @@ -139,7 +139,7 @@ bool ProjectionsPlot::isCorrectProjectionType(MaskItem* item) return dynamic_cast<VerticalLineItem*>(item); } -QCPGraph* ProjectionsPlot::graphForItem(MaskRoot* item) +QCPGraph* ProjectionsPlot::graphForItem(MaskObject* item) { if (!m_data2DItem) return nullptr; @@ -186,7 +186,7 @@ void ProjectionsPlot::updateProjections() replot(); } -void ProjectionsPlot::onProjectionPropertyChanged(MaskRoot* item) +void ProjectionsPlot::onProjectionPropertyChanged(MaskObject* item) { auto* projection = dynamic_cast<MaskItem*>(item); if (!projection) @@ -225,7 +225,7 @@ void ProjectionsPlot::updateAxesTitle() //! Removes plot corresponding to given projection item. -void ProjectionsPlot::clearProjection(MaskRoot* item) +void ProjectionsPlot::clearProjection(MaskObject* item) { if (auto* graph = graphForItem(item)) { m_plot->removePlottable(graph); diff --git a/GUI/View/Plotter/ProjectionsPlot.h b/GUI/View/Plotter/ProjectionsPlot.h index a02b27a02074269d37fd4fc7b990b62b3ae5a0a4..001144984fc0827ebe15b451ff78202310802309 100644 --- a/GUI/View/Plotter/ProjectionsPlot.h +++ b/GUI/View/Plotter/ProjectionsPlot.h @@ -22,7 +22,7 @@ class Data2DItem; class Datafield; class MaskItem; -class MaskRoot; +class MaskObject; class QCPGraph; class QCustomPlot; @@ -43,14 +43,14 @@ public slots: private: bool isCorrectProjectionType(MaskItem* item); - QCPGraph* graphForItem(MaskRoot* item); + QCPGraph* graphForItem(MaskObject* item); void updateProjectionsData(); void updateProjections(); - void onProjectionPropertyChanged(MaskRoot* item); + void onProjectionPropertyChanged(MaskObject* item); void updateAxesRange(); void updateAxesTitle(); - void clearProjection(MaskRoot* item); + void clearProjection(MaskObject* item); void clearAll(); void setGraphFromItem(QCPGraph* graph, MaskItem* item); @@ -63,7 +63,7 @@ private: Data2DItem* m_data2DItem = nullptr; const Qt::Orientation m_orientation; QCustomPlot* m_plot; - QMap<MaskRoot*, QCPGraph*> m_item_to_graph; + QMap<MaskObject*, QCPGraph*> m_item_to_graph; }; #endif // BORNAGAIN_GUI_VIEW_PLOTTER_PROJECTIONSPLOT_H diff --git a/GUI/View/Scene/MaskGraphicsScene.cpp b/GUI/View/Scene/MaskGraphicsScene.cpp index 0caac8928b34932914a6f18af60bcd6cab8b5b38..c578a2d32b7cf5cf295cb3d35a6d19fa29f155c3 100644 --- a/GUI/View/Scene/MaskGraphicsScene.cpp +++ b/GUI/View/Scene/MaskGraphicsScene.cpp @@ -399,7 +399,7 @@ void MaskGraphicsScene::updateViews() //! Creates a view for given item. -IShapeDisplay* MaskGraphicsScene::addViewForItem(MaskRoot* item) +IShapeDisplay* MaskGraphicsScene::addViewForItem(MaskObject* item) { ASSERT(item); subscribeMaskItem(item); @@ -416,7 +416,7 @@ IShapeDisplay* MaskGraphicsScene::addViewForItem(MaskRoot* item) //! Removes single view from scene. -void MaskGraphicsScene::removeItemViewFromScene(MaskRoot* item) +void MaskGraphicsScene::removeItemViewFromScene(MaskObject* item) { if (auto it = m_ItemToView.find(item); it != m_ItemToView.end()) { // at first, delete views for the points of the PolygonItem @@ -495,7 +495,7 @@ bool MaskGraphicsScene::isValidForRectangleShapeDrawing(QGraphicsSceneMouseEvent return false; if (m_activity == MaskEditorFlags::ROI_MODE) // only one ROI is allowed - for (MaskRoot* item : m_ItemToView.keys()) + for (MaskObject* item : m_ItemToView.keys()) if (dynamic_cast<RegionOfInterestItem*>(item)) return false; return true; @@ -537,7 +537,7 @@ bool MaskGraphicsScene::isValidForMaskAllDrawing(QGraphicsSceneMouseEvent*) cons if (m_activity != MaskEditorFlags::MASKALL_MODE) return false; - for (MaskRoot* item : m_ItemToView.keys()) + for (MaskObject* item : m_ItemToView.keys()) if (dynamic_cast<MaskAllItem*>(item)) return false; return true; @@ -739,16 +739,16 @@ void MaskGraphicsScene::processMaskAllItem(QGraphicsSceneMouseEvent* event) setDrawingInProgress(false); } -void MaskGraphicsScene::subscribeMaskItem(MaskRoot* item) +void MaskGraphicsScene::subscribeMaskItem(MaskObject* item) { if (!item) return; - connect(item, &MaskRoot::maskGeometryChanged, this, &MaskGraphicsScene::lineItemMoved, + connect(item, &MaskObject::maskGeometryChanged, this, &MaskGraphicsScene::lineItemMoved, Qt::UniqueConnection); - connect(item, &MaskRoot::maskGeometryChanged, this, &MaskGraphicsScene::onMaskMove, + connect(item, &MaskObject::maskGeometryChanged, this, &MaskGraphicsScene::onMaskMove, Qt::UniqueConnection); - connect(item, &MaskRoot::maskToBeDestroyed, this, &MaskGraphicsScene::lineItemDeleted, + connect(item, &MaskObject::maskToBeDestroyed, this, &MaskGraphicsScene::lineItemDeleted, Qt::UniqueConnection); } diff --git a/GUI/View/Scene/MaskGraphicsScene.h b/GUI/View/Scene/MaskGraphicsScene.h index 4babe322268de42da1850fa4c35e36156dbc324d..e149786ae8266c1bef8eb70387959c85067cde97 100644 --- a/GUI/View/Scene/MaskGraphicsScene.h +++ b/GUI/View/Scene/MaskGraphicsScene.h @@ -29,7 +29,7 @@ class MaskContainerModel; class MaskEditorAction; class MaskGraphicsProxy; class MaskItem; -class MaskRoot; +class MaskObject; class PolygonDisplay; class SceneAdaptor; @@ -53,8 +53,8 @@ public: signals: void itemContextMenuRequest(const QPoint& point); void lineItemProcessed(); - void lineItemMoved(MaskRoot* sender); - void lineItemDeleted(MaskRoot* sender); + void lineItemMoved(MaskObject* sender); + void lineItemDeleted(MaskObject* sender); public slots: void onActivityChanged(MaskEditorFlags::Activity value); @@ -80,8 +80,8 @@ private: void updateProxyWidget(); void updateViews(); - IShapeDisplay* addViewForItem(MaskRoot* item); - void removeItemViewFromScene(MaskRoot* item); + IShapeDisplay* addViewForItem(MaskObject* item); + void removeItemViewFromScene(MaskObject* item); void connectMaskContainer(MaskContainerModel* maskContainerModel); void disconnectMaskContainer(MaskContainerModel* maskContainerModel); @@ -105,7 +105,7 @@ private: void processVerticalLineItem(const QPointF& pos); void processHorizontalLineItem(const QPointF& pos); void processMaskAllItem(QGraphicsSceneMouseEvent* event); - void subscribeMaskItem(MaskRoot* item); + void subscribeMaskItem(MaskObject* item); void setZValues(); PolygonDisplay* currentPolygon() const; @@ -113,7 +113,7 @@ private: ColorMap* m_colorMap; MaskContainerModel* m_maskContainerModel = nullptr; QItemSelectionModel* m_selectionModel = nullptr; - QMap<MaskRoot*, IShapeDisplay*> m_ItemToView; + QMap<MaskObject*, IShapeDisplay*> m_ItemToView; MaskGraphicsProxy* m_proxy = nullptr; std::shared_ptr<SceneAdaptor> m_adaptor; bool m_block_selection = false; diff --git a/GUI/View/Scene/MaskViewFactory.cpp b/GUI/View/Scene/MaskViewFactory.cpp index 68d94e319242c5a95933fbc71164071b0665cd7a..fc5c6a28205ee8f9c4676419d161c0f29ba9bdfc 100644 --- a/GUI/View/Scene/MaskViewFactory.cpp +++ b/GUI/View/Scene/MaskViewFactory.cpp @@ -24,7 +24,7 @@ #include "GUI/View/Shape/PolygonDisplay.h" #include "GUI/View/Shape/PolygonPointDisplay.h" -IShapeDisplay* MaskViewFactory::createMaskView(MaskRoot* item) +IShapeDisplay* MaskViewFactory::createMaskView(MaskObject* item) { if (auto* mask = dynamic_cast<MaskContainerItem*>(item)) // includes ProjectionContainerItem diff --git a/GUI/View/Scene/MaskViewFactory.h b/GUI/View/Scene/MaskViewFactory.h index 264ba7f37ab6fe1cf6f14073d08ae59f5c730175..e49f4a6778b6fe39351a06dc90f69055097f090e 100644 --- a/GUI/View/Scene/MaskViewFactory.h +++ b/GUI/View/Scene/MaskViewFactory.h @@ -16,12 +16,12 @@ #define BORNAGAIN_GUI_VIEW_SCENE_MASKVIEWFACTORY_H class IShapeDisplay; -class MaskRoot; +class MaskObject; namespace MaskViewFactory { //! Factory to construct views out of MaskItems for MaskGraphicsScene -IShapeDisplay* createMaskView(MaskRoot* item); +IShapeDisplay* createMaskView(MaskObject* item); } // namespace MaskViewFactory diff --git a/GUI/View/Setup/ProjectionsSaver.cpp b/GUI/View/Setup/ProjectionsSaver.cpp index 6cfb05227ae8ff5c696b47261bc6d08cfaa06b5b..173473ae3baa792f74c23abfb022409246f0783e 100644 --- a/GUI/View/Setup/ProjectionsSaver.cpp +++ b/GUI/View/Setup/ProjectionsSaver.cpp @@ -43,13 +43,13 @@ QString to_double_str(double value) return QString("%1").arg(QString::fromStdString(str), -bin_centers_colwidth); } -bool vert_less_posx(MaskRoot* item1, MaskRoot* item2) +bool vert_less_posx(MaskObject* item1, MaskObject* item2) { return polymorphic_downcast<VerticalLineItem*>(item1)->posX() < polymorphic_downcast<VerticalLineItem*>(item2)->posX(); } -bool horiz_less_posy(MaskRoot* item1, MaskRoot* item2) +bool horiz_less_posy(MaskObject* item1, MaskObject* item2) { return polymorphic_downcast<HorizontalLineItem*>(item1)->posY() < polymorphic_downcast<HorizontalLineItem*>(item2)->posY(); diff --git a/GUI/View/Shape/AllMasksDisplay.cpp b/GUI/View/Shape/AllMasksDisplay.cpp index f0aeaa77d604f95574869adf555ffa0867bd192f..8e4a60212594ad227a6633dd670106f6adbdec3e 100644 --- a/GUI/View/Shape/AllMasksDisplay.cpp +++ b/GUI/View/Shape/AllMasksDisplay.cpp @@ -26,7 +26,7 @@ AllMasksDisplay::AllMasksDisplay(MaskAllItem* item) setFlag(QGraphicsItem::ItemIsSelectable); } -MaskRoot* AllMasksDisplay::parameterizedItem() const +MaskObject* AllMasksDisplay::parameterizedItem() const { return m_item; } diff --git a/GUI/View/Shape/AllMasksDisplay.h b/GUI/View/Shape/AllMasksDisplay.h index 977da2a6d9a51be9226e28d3f83d24da1675ea14..310cb064d1c80dcf181474657e98a4c26f4760ef 100644 --- a/GUI/View/Shape/AllMasksDisplay.h +++ b/GUI/View/Shape/AllMasksDisplay.h @@ -28,7 +28,7 @@ public: explicit AllMasksDisplay(MaskAllItem* item); - MaskRoot* parameterizedItem() const override; + MaskObject* parameterizedItem() const override; protected slots: void update_view() override; diff --git a/GUI/View/Shape/EllipseDisplay.cpp b/GUI/View/Shape/EllipseDisplay.cpp index 90c4fb7c49b8e10968858a8f199f21db92ae811c..bb6ef08d1af248b8873dd4ff1effb8496fb9e003 100644 --- a/GUI/View/Shape/EllipseDisplay.cpp +++ b/GUI/View/Shape/EllipseDisplay.cpp @@ -96,7 +96,7 @@ QPainterPath EllipseDisplay::shape() const return path; } -MaskRoot* EllipseDisplay::parameterizedItem() const +MaskObject* EllipseDisplay::parameterizedItem() const { return m_item; } diff --git a/GUI/View/Shape/EllipseDisplay.h b/GUI/View/Shape/EllipseDisplay.h index 574f9ff6037d7396ab962d01579785a08a7780ee..657bd509a50d27c6a900e02ecdac5101c00d40ef 100644 --- a/GUI/View/Shape/EllipseDisplay.h +++ b/GUI/View/Shape/EllipseDisplay.h @@ -29,7 +29,7 @@ public: explicit EllipseDisplay(EllipseItem* item); - MaskRoot* parameterizedItem() const override; + MaskObject* parameterizedItem() const override; private slots: void onChangedX() override; diff --git a/GUI/View/Shape/IShapeDisplay.cpp b/GUI/View/Shape/IShapeDisplay.cpp index 17662ec50cb663c0691109fe583b8345980bd1ba..9ee3245af431c30a79b74360c65ec83021ca2467 100644 --- a/GUI/View/Shape/IShapeDisplay.cpp +++ b/GUI/View/Shape/IShapeDisplay.cpp @@ -23,7 +23,7 @@ namespace { -bool itemMaskValue(const MaskRoot* item) +bool itemMaskValue(const MaskObject* item) { if (const auto* maskItem = dynamic_cast<const MaskItem*>(item)) return maskItem->maskValue(); @@ -32,7 +32,7 @@ bool itemMaskValue(const MaskRoot* item) } // namespace -IShapeDisplay::IShapeDisplay(MaskRoot* item) +IShapeDisplay::IShapeDisplay(MaskObject* item) : m_adaptor(nullptr) , m_block_on_property_change(false) { @@ -41,9 +41,9 @@ IShapeDisplay::IShapeDisplay(MaskRoot* item) connect(this, &IShapeDisplay::xChanged, this, &IShapeDisplay::onChangedX, Qt::UniqueConnection); connect(this, &IShapeDisplay::yChanged, this, &IShapeDisplay::onChangedY, Qt::UniqueConnection); - connect(item, &MaskRoot::maskGeometryChanged, this, &IShapeDisplay::onGeometryChange, + connect(item, &MaskObject::maskGeometryChanged, this, &IShapeDisplay::onGeometryChange, Qt::UniqueConnection); - connect(item, &MaskRoot::maskVisibilityChanged, this, &IShapeDisplay::onVisibilityChange, + connect(item, &MaskObject::maskVisibilityChanged, this, &IShapeDisplay::onVisibilityChange, Qt::UniqueConnection); } diff --git a/GUI/View/Shape/IShapeDisplay.h b/GUI/View/Shape/IShapeDisplay.h index 242d9bc2d8d66e3f5ab047750333212ccd94d596..05929fb32031e726f699c960def3f3cec4331002 100644 --- a/GUI/View/Shape/IShapeDisplay.h +++ b/GUI/View/Shape/IShapeDisplay.h @@ -19,7 +19,7 @@ #include <QGraphicsObject> #include <QPainter> -class MaskRoot; +class MaskObject; class SceneAdaptor; //! Main interface class for views representing MaskItems, Projections on graphics scene. @@ -31,7 +31,7 @@ public: QRectF boundingRect() const override; - virtual MaskRoot* parameterizedItem() const = 0; + virtual MaskObject* parameterizedItem() const = 0; void setSceneAdaptor(const SceneAdaptor* adaptor); @@ -45,7 +45,7 @@ protected slots: virtual void onPropertyChange() {} protected: - explicit IShapeDisplay(MaskRoot* item); + explicit IShapeDisplay(MaskObject* item); void paint(QPainter* painter, const QStyleOptionGraphicsItem*, QWidget*) override; diff --git a/GUI/View/Shape/LineDisplays.cpp b/GUI/View/Shape/LineDisplays.cpp index bf3f7cb8c895b535dfd071011a0ea427dee676cc..d3f7fb98154ae3793b18cca64429ede62072b38b 100644 --- a/GUI/View/Shape/LineDisplays.cpp +++ b/GUI/View/Shape/LineDisplays.cpp @@ -44,7 +44,7 @@ QPainterPath VerticalLineDisplay::shape() const return p; } -MaskRoot* VerticalLineDisplay::parameterizedItem() const +MaskObject* VerticalLineDisplay::parameterizedItem() const { return m_item; } @@ -122,7 +122,7 @@ QPainterPath HorizontalLineDisplay::shape() const return path; } -MaskRoot* HorizontalLineDisplay::parameterizedItem() const +MaskObject* HorizontalLineDisplay::parameterizedItem() const { return m_item; } diff --git a/GUI/View/Shape/LineDisplays.h b/GUI/View/Shape/LineDisplays.h index 3e25f2132b4c06e25d7d728299823472ba2fa7b3..74cf720d823a4343813b8da97d8e77b7366436d5 100644 --- a/GUI/View/Shape/LineDisplays.h +++ b/GUI/View/Shape/LineDisplays.h @@ -30,7 +30,7 @@ public: explicit VerticalLineDisplay(VerticalLineItem* item); QPainterPath shape() const override; - MaskRoot* parameterizedItem() const override; + MaskObject* parameterizedItem() const override; protected slots: void update_view() override; @@ -56,7 +56,7 @@ public: explicit HorizontalLineDisplay(HorizontalLineItem* item); QPainterPath shape() const override; - MaskRoot* parameterizedItem() const override; + MaskObject* parameterizedItem() const override; protected slots: void update_view() override; diff --git a/GUI/View/Shape/MaskContainerDisplay.cpp b/GUI/View/Shape/MaskContainerDisplay.cpp index a31c0a0688c197163342106d8b0d5901cb1a181c..f6ddcd58a8cbf1c6cbdd82a808e7d8a075cf10bf 100644 --- a/GUI/View/Shape/MaskContainerDisplay.cpp +++ b/GUI/View/Shape/MaskContainerDisplay.cpp @@ -28,7 +28,7 @@ MaskContainerDisplay::MaskContainerDisplay(MaskContainerItem* item) setFlag(QGraphicsItem::ItemClipsChildrenToShape, true); } -MaskRoot* MaskContainerDisplay::parameterizedItem() const +MaskObject* MaskContainerDisplay::parameterizedItem() const { return m_item; } diff --git a/GUI/View/Shape/MaskContainerDisplay.h b/GUI/View/Shape/MaskContainerDisplay.h index fa4a1f7ba7194a1342d96084bbf2540aed8c0366..3a939271dabdcd5d68876fb0bcb4ae998a4f9b7f 100644 --- a/GUI/View/Shape/MaskContainerDisplay.h +++ b/GUI/View/Shape/MaskContainerDisplay.h @@ -35,7 +35,7 @@ public: MaskContainerDisplay(MaskContainerItem* item); - MaskRoot* parameterizedItem() const override; + MaskObject* parameterizedItem() const override; private slots: void update_view() override; diff --git a/GUI/View/Shape/PolygonDisplay.cpp b/GUI/View/Shape/PolygonDisplay.cpp index 768da6fafbcfaeadf3b6e983585a712d19e8798d..4f8519f22d4cd5bfa944f3fba9f7e2707b30fccb 100644 --- a/GUI/View/Shape/PolygonDisplay.cpp +++ b/GUI/View/Shape/PolygonDisplay.cpp @@ -36,7 +36,7 @@ PolygonDisplay::PolygonDisplay(PolygonItem* item) m_item->maskVisibilityChanged(); } -MaskRoot* PolygonDisplay::parameterizedItem() const +MaskObject* PolygonDisplay::parameterizedItem() const { return m_item; } diff --git a/GUI/View/Shape/PolygonDisplay.h b/GUI/View/Shape/PolygonDisplay.h index cad2408bde9f159f1644386491ffdabcfa7bccf1..c64f16e50b943035fd9f443ba36ae5155cdf5a6d 100644 --- a/GUI/View/Shape/PolygonDisplay.h +++ b/GUI/View/Shape/PolygonDisplay.h @@ -29,7 +29,7 @@ public: explicit PolygonDisplay(PolygonItem* item); - MaskRoot* parameterizedItem() const override; + MaskObject* parameterizedItem() const override; void addView(IShapeDisplay* childView) override; bool isClosedPolygon(); diff --git a/GUI/View/Shape/PolygonPointDisplay.cpp b/GUI/View/Shape/PolygonPointDisplay.cpp index 5e8cf02ad1219539fea70053aee8c8584b8a890f..90cfdab35bf028017a6144d1164c54b78b6dbec0 100644 --- a/GUI/View/Shape/PolygonPointDisplay.cpp +++ b/GUI/View/Shape/PolygonPointDisplay.cpp @@ -32,7 +32,7 @@ QRectF PolygonPointDisplay::boundingRect() const return QRectF(-4, -4, 8, 8); } -MaskRoot* PolygonPointDisplay::parameterizedItem() const +MaskObject* PolygonPointDisplay::parameterizedItem() const { return m_item; } diff --git a/GUI/View/Shape/PolygonPointDisplay.h b/GUI/View/Shape/PolygonPointDisplay.h index eb2b452c82a807f92a92d20c90c59c36f6b6ad3c..dbc04402d510ba772e1afa796820dc5320518bab 100644 --- a/GUI/View/Shape/PolygonPointDisplay.h +++ b/GUI/View/Shape/PolygonPointDisplay.h @@ -30,7 +30,7 @@ public: QRectF boundingRect() const override; - MaskRoot* parameterizedItem() const override; + MaskObject* parameterizedItem() const override; void updateParameterizedItem(const QPointF& pos); diff --git a/GUI/View/Shape/RectangleBaseDisplay.cpp b/GUI/View/Shape/RectangleBaseDisplay.cpp index 0562154c55f493dd66c3d420a660b982808faf01..bcfe20eaec18079937e6ac231c2424dfe08b3d12 100644 --- a/GUI/View/Shape/RectangleBaseDisplay.cpp +++ b/GUI/View/Shape/RectangleBaseDisplay.cpp @@ -27,7 +27,7 @@ const QList<SizeHandleElement::EHandleLocation> points{ } // namespace -RectangleBaseDisplay::RectangleBaseDisplay(MaskRoot* item) +RectangleBaseDisplay::RectangleBaseDisplay(MaskObject* item) : IShapeDisplay(item) , m_activeHandleElement(nullptr) { diff --git a/GUI/View/Shape/RectangleBaseDisplay.h b/GUI/View/Shape/RectangleBaseDisplay.h index a819cd7e7ad5b1b3a449e658abea8e4e3fd017d9..aeea41d90f79d05b935fdc11a8a3e05c4dbfe71c 100644 --- a/GUI/View/Shape/RectangleBaseDisplay.h +++ b/GUI/View/Shape/RectangleBaseDisplay.h @@ -26,7 +26,7 @@ class RectangleBaseDisplay : public IShapeDisplay { public: int type() const override { return MaskType::RECTANGLEBASE; } - explicit RectangleBaseDisplay(MaskRoot* item); + explicit RectangleBaseDisplay(MaskObject* item); private slots: void onSizeHandleElementRequest(bool going_to_resize); diff --git a/GUI/View/Shape/RectangleDisplay.cpp b/GUI/View/Shape/RectangleDisplay.cpp index 9578de3175d8005742d04d69d28b375bb5067e87..75dfb454ce23fe8c970fcdfb435f02a0cf678b26 100644 --- a/GUI/View/Shape/RectangleDisplay.cpp +++ b/GUI/View/Shape/RectangleDisplay.cpp @@ -31,7 +31,7 @@ QPainterPath RectangleDisplay::shape() const return path; } -MaskRoot* RectangleDisplay::parameterizedItem() const +MaskObject* RectangleDisplay::parameterizedItem() const { return m_item; } diff --git a/GUI/View/Shape/RectangleDisplay.h b/GUI/View/Shape/RectangleDisplay.h index 806e9ea2820eb05b768d9818de204bca7b517b28..66a09f0fcae211e41e0e4ad463c4af99ca446a83 100644 --- a/GUI/View/Shape/RectangleDisplay.h +++ b/GUI/View/Shape/RectangleDisplay.h @@ -30,7 +30,7 @@ public: explicit RectangleDisplay(RectangleItem* item); QPainterPath shape() const override; - MaskRoot* parameterizedItem() const override; + MaskObject* parameterizedItem() const override; private slots: void onChangedX() override;