File indexing completed on 2025-02-23 03:35:05

0001 /*
0002     File                 : ReferenceLinePrivate.h
0003     Project              : LabPlot
0004     Description          : Reference line on the plot
0005     --------------------------------------------------------------------
0006     SPDX-FileCopyrightText: 2020 Alexander Semke <alexander.semke@web.de>
0007 
0008     SPDX-License-Identifier: GPL-2.0-or-later
0009 */
0010 
0011 #ifndef REFERENCELINEPRIVATE_H
0012 #define REFERENCELINEPRIVATE_H
0013 
0014 #include "backend/worksheet/WorksheetElementPrivate.h"
0015 
0016 class CartesianCoordinateSystem;
0017 
0018 class ReferenceLinePrivate : public WorksheetElementPrivate {
0019 public:
0020     explicit ReferenceLinePrivate(ReferenceLine*);
0021 
0022     void retransform() override;
0023     void recalcShapeAndBoundingRect() override;
0024     void updateOrientation();
0025 
0026     ReferenceLine::Orientation orientation{ReferenceLine::Orientation::Horizontal};
0027     double length{0.0}; // length of the line in graphic item's coordinates
0028     Line* line{nullptr};
0029 
0030     // reimplemented from QGraphicsItem
0031     void paint(QPainter*, const QStyleOptionGraphicsItem*, QWidget* widget = nullptr) override;
0032 
0033     ReferenceLine* const q;
0034 };
0035 
0036 #endif