File indexing completed on 2025-01-26 03:34:10

0001 /*
0002     File                 : CustomPointPrivate.h
0003     Project              : LabPlot
0004     Description          : Custom user-defined point on the plot
0005     --------------------------------------------------------------------
0006     SPDX-FileCopyrightText: 2015 Ankit Wagadre <wagadre.ankit@gmail.com>
0007     SPDX-FileCopyrightText: 2015 Alexander Semke <alexander.semke@web.de>
0008     SPDX-License-Identifier: GPL-2.0-or-later
0009 */
0010 
0011 #ifndef CUSTOMPOINTPRIVATE_H
0012 #define CUSTOMPOINTPRIVATE_H
0013 
0014 #include "backend/worksheet/WorksheetElementPrivate.h"
0015 
0016 class CustomPoint;
0017 class CartesianPlot;
0018 class CartesianCoordinateSystem;
0019 class Symbol;
0020 
0021 class CustomPointPrivate : public WorksheetElementPrivate {
0022 public:
0023     explicit CustomPointPrivate(CustomPoint*);
0024 
0025     void retransform() override;
0026     void recalcShapeAndBoundingRect() override;
0027     void updateData();
0028 
0029     QPointF positionScene; // position in scene coordinates
0030     Symbol* symbol{nullptr};
0031 
0032     // reimplemented from QGraphicsItem
0033     void paint(QPainter*, const QStyleOptionGraphicsItem*, QWidget* widget = nullptr) override;
0034 
0035     CustomPoint* const q;
0036 
0037 private:
0038     const CartesianPlot* plot();
0039     void mouseReleaseEvent(QGraphicsSceneMouseEvent*) override;
0040 };
0041 
0042 #endif