VisualizationSelectionZoneItem.h
68 lines
| 2.8 KiB
| text/x-c
|
CLexer
r1084 | #ifndef SCIQLOP_VISUALIZATIONSELECTIONZONEITEM_H | |||
#define SCIQLOP_VISUALIZATIONSELECTIONZONEITEM_H | ||||
#include <Common/spimpl.h> | ||||
#include <Data/SqpRange.h> | ||||
#include <Visualization/qcustomplot.h> | ||||
r1114 | class VisualizationGraphWidget; | |||
r1084 | class VisualizationSelectionZoneItem : public QCPItemRect { | |||
r1089 | ||||
r1084 | public: | |||
VisualizationSelectionZoneItem(QCustomPlot *plot); | ||||
virtual ~VisualizationSelectionZoneItem(); | ||||
r1114 | VisualizationGraphWidget *parentGraphWidget() const noexcept; | |||
r1084 | void setName(const QString &name); | |||
QString name() const; | ||||
SqpRange range() const; | ||||
void setRange(double tstart, double tend); | ||||
void setStart(double tstart); | ||||
void setEnd(double tend); | ||||
void setColor(const QColor &color); | ||||
void setEditionEnabled(bool value); | ||||
bool isEditionEnabled() const; | ||||
r1120 | /// Moves the item at the top of its QCPLayer. It will then receive the mouse events if multiple | |||
/// items are stacked on top of each others. | ||||
void moveToTop(); | ||||
r1084 | Qt::CursorShape curshorShapeForPosition(const QPoint &position) const; | |||
void setHovered(bool value); | ||||
r1116 | /// Sets the zones which should be moved or reisized together with this zone | |||
r1090 | void setAssociatedEditedZones(const QVector<VisualizationSelectionZoneItem *> &associatedZones); | |||
r1116 | /// Align the specified zones with this one, vertically with the left border | |||
bool alignZonesVerticallyOnLeft(const QVector<VisualizationSelectionZoneItem *> &zonesToAlign, | ||||
bool allowResize); | ||||
/// Align the specified zones with this one, vertically with the right border | ||||
bool alignZonesVerticallyOnRight(const QVector<VisualizationSelectionZoneItem *> &zonesToAlign, | ||||
bool allowResize); | ||||
/// Align the specified zones with this one, temporally with the left border | ||||
bool alignZonesTemporallyOnLeft(const QVector<VisualizationSelectionZoneItem *> &zonesToAlign, | ||||
bool allowResize); | ||||
/// Align the specified zones with this one, temporally with the right border | ||||
bool alignZonesTemporallyOnRight(const QVector<VisualizationSelectionZoneItem *> &zonesToAlign, | ||||
bool allowResize); | ||||
r1084 | protected: | |||
void mousePressEvent(QMouseEvent *event, const QVariant &details) override; | ||||
void mouseMoveEvent(QMouseEvent *event, const QPointF &startPos) override; | ||||
void mouseReleaseEvent(QMouseEvent *event, const QPointF &startPos) override; | ||||
r1090 | void resizeLeft(double pixelDiff); | |||
void resizeRight(double pixelDiff); | ||||
void move(double pixelDiff); | ||||
r1084 | private: | |||
class VisualizationSelectionZoneItemPrivate; | ||||
spimpl::unique_impl_ptr<VisualizationSelectionZoneItemPrivate> impl; | ||||
}; | ||||
#endif // SCIQLOP_VISUALIZATIONSELECTIONZONEITEM_H | ||||