Allow a user to select a curve covered by visualization.

--HG--
branch : feature
This commit is contained in:
Roman Telezhynskyi 2017-01-13 17:03:15 +02:00
parent 59c9a0b400
commit 970762d0b3
2 changed files with 11 additions and 0 deletions

View File

@ -30,6 +30,8 @@
#include "../vwidgets/vsimplepoint.h" #include "../vwidgets/vsimplepoint.h"
#include "../vgeometry/vpointf.h" #include "../vgeometry/vpointf.h"
#include <QGraphicsSceneMouseEvent>
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
VisToolPiecePath::VisToolPiecePath(const VContainer *data, QGraphicsItem *parent) VisToolPiecePath::VisToolPiecePath(const VContainer *data, QGraphicsItem *parent)
: VisPath(data, parent), : VisPath(data, parent),
@ -80,6 +82,12 @@ void VisToolPiecePath::SetPath(const VPiecePath &path)
m_path = path; m_path = path;
} }
//---------------------------------------------------------------------------------------------------------------------
void VisToolPiecePath::mousePressEvent(QGraphicsSceneMouseEvent *event)
{
event->ignore();
}
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
VSimplePoint *VisToolPiecePath::GetPoint(quint32 i, const QColor &color) VSimplePoint *VisToolPiecePath::GetPoint(quint32 i, const QColor &color)
{ {

View File

@ -49,6 +49,9 @@ public:
virtual int type() const Q_DECL_OVERRIDE {return Type;} virtual int type() const Q_DECL_OVERRIDE {return Type;}
enum { Type = UserType + static_cast<int>(Vis::ToolPiecePath)}; enum { Type = UserType + static_cast<int>(Vis::ToolPiecePath)};
protected:
virtual void mousePressEvent( QGraphicsSceneMouseEvent * event ) Q_DECL_OVERRIDE;
private: private:
Q_DISABLE_COPY(VisToolPiecePath) Q_DISABLE_COPY(VisToolPiecePath)
QVector<VSimplePoint *> m_points; QVector<VSimplePoint *> m_points;