File indexing completed on 2024-05-12 03:47:30
0001 /* 0002 File : Segment.h 0003 Project : LabPlot 0004 Description : Graphics-item for curve of Datapicker 0005 -------------------------------------------------------------------- 0006 SPDX-FileCopyrightText: 2015 Ankit Wagadre <wagadre.ankit@gmail.com> 0007 SPDX-License-Identifier: GPL-2.0-or-later 0008 */ 0009 0010 #ifndef SEGMENT_H 0011 #define SEGMENT_H 0012 0013 #include "backend/lib/macros.h" 0014 #include <QVector> 0015 0016 class QGraphicsItem; 0017 class QLine; 0018 0019 class SegmentPrivate; 0020 class DatapickerImage; 0021 0022 class Segment { 0023 public: 0024 explicit Segment(DatapickerImage*); 0025 0026 QVector<QLine*> path; 0027 int yLast{0}; 0028 int length{0}; 0029 0030 QGraphicsItem* graphicsItem() const; 0031 void setParentGraphicsItem(QGraphicsItem*); 0032 0033 bool isVisible() const; 0034 void setVisible(bool); 0035 void retransform(); 0036 0037 typedef SegmentPrivate Private; 0038 0039 private: 0040 Q_DECLARE_PRIVATE(Segment) 0041 DatapickerImage* m_image; 0042 0043 protected: 0044 SegmentPrivate* const d_ptr; 0045 }; 0046 0047 #endif