mirror of
https://github.com/subsurface/subsurface.git
synced 2024-11-28 05:00:20 +00:00
24c5b2e3c1
This code cleanup fixes the two issues that I raised on my last e-mail. hurrah. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
55 lines
No EOL
1.2 KiB
C++
55 lines
No EOL
1.2 KiB
C++
#ifndef RULERITEM_H
|
|
#define RULERITEM_H
|
|
|
|
#include <QObject>
|
|
#include <QGraphicsEllipseItem>
|
|
#include <QGraphicsObject>
|
|
#include "divecartesianaxis.h"
|
|
#include "display.h"
|
|
|
|
struct plot_data;
|
|
class RulerItem2;
|
|
|
|
class RulerNodeItem2 : public QObject, public QGraphicsEllipseItem {
|
|
Q_OBJECT
|
|
friend class RulerItem2;
|
|
|
|
public:
|
|
explicit RulerNodeItem2();
|
|
void setRuler(RulerItem2 *r);
|
|
void setPlotInfo(struct plot_info& info);
|
|
void recalculate();
|
|
|
|
protected:
|
|
QVariant itemChange(GraphicsItemChange change, const QVariant &value);
|
|
|
|
private:
|
|
struct plot_info pInfo;
|
|
struct plot_data *entry;
|
|
RulerItem2 *ruler;
|
|
DiveCartesianAxis *timeAxis;
|
|
DiveCartesianAxis *depthAxis;
|
|
};
|
|
|
|
class RulerItem2 : public QGraphicsLineItem {
|
|
public:
|
|
explicit RulerItem2();
|
|
void recalculate();
|
|
|
|
void setPlotInfo(struct plot_info pInfo);
|
|
RulerNodeItem2 *sourceNode() const;
|
|
RulerNodeItem2 *destNode() const;
|
|
void setAxis(DiveCartesianAxis *time, DiveCartesianAxis *depth);
|
|
|
|
private:
|
|
struct plot_info pInfo;
|
|
QPointF startPoint, endPoint;
|
|
RulerNodeItem2 *source, *dest;
|
|
QString text;
|
|
int height;
|
|
int paint_direction;
|
|
DiveCartesianAxis *timeAxis;
|
|
DiveCartesianAxis *depthAxis;
|
|
QGraphicsSimpleTextItem *textItem;
|
|
};
|
|
#endif |