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

0001 /*
0002     File                 : ReferenceRangePrivate.h
0003     Project              : LabPlot
0004     Description          : Reference range on the plot
0005     --------------------------------------------------------------------
0006     SPDX-FileCopyrightText: 2022-2023 Alexander Semke <alexander.semke@web.de>
0007 
0008     SPDX-License-Identifier: GPL-2.0-or-later
0009 */
0010 
0011 #ifndef REFERENCERANGEPRIVATE_H
0012 #define REFERENCERANGEPRIVATE_H
0013 
0014 #include "backend/worksheet/WorksheetElementPrivate.h"
0015 #include "backend/worksheet/plots/cartesian/ReferenceRange.h"
0016 
0017 class CartesianCoordinateSystem;
0018 
0019 class ReferenceRangePrivate : public WorksheetElementPrivate {
0020 public:
0021     explicit ReferenceRangePrivate(ReferenceRange*);
0022 
0023     void retransform() override;
0024     void recalcShapeAndBoundingRect() override;
0025     void updateOrientation();
0026 
0027     bool m_visible{true}; // point inside the plot (visible) or not
0028 
0029     ReferenceRange::Orientation orientation{ReferenceRange::Orientation::Horizontal};
0030     QPointF positionLogicalStart;
0031     QPointF positionLogicalEnd;
0032     QRectF rect;
0033 
0034     Line* line{nullptr};
0035     Background* background{nullptr};
0036 
0037     // reimplemented from QGraphicsItem
0038     void paint(QPainter*, const QStyleOptionGraphicsItem*, QWidget* widget = nullptr) override;
0039     void drawFilling(QPainter*) const;
0040     QPointF recalculateRect();
0041 
0042     ReferenceRange* const q;
0043 
0044 private:
0045     bool m_bottomClipped{false};
0046     bool m_topClipped{false};
0047     bool m_leftClipped{false};
0048     bool m_rightClipped{false};
0049 };
0050 
0051 #endif