-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtoolmovetrackmark.cpp
60 lines (48 loc) · 1.31 KB
/
toolmovetrackmark.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
#include "toolmovetrackmark.h"
#include "videoviewbase.h"
#include "mainwindow.h"
#include <iostream>
using namespace std;
ToolMoveTrackMark::ToolMoveTrackMark(VideoViewBase *parent)
: ToolImage(parent)
{
;
}
ToolMoveTrackMark::~ToolMoveTrackMark()
{
;
}
void ToolMoveTrackMark::mouseMove( QMouseEvent *mouseEvent)
{
mouseEvent->ignore();
// Extract sum image
//
QPointF pt = mView->mapToScene( QPoint(mouseEvent->x(), mouseEvent->y()) );
// show in current image
//
}
void ToolMoveTrackMark::mousePress( QMouseEvent *mouseEvent)
{
if (Qt::LeftButton == mouseEvent->button()) // left mouse button, add point and line
{ // add one point
// save point to list
QPointF pt = mView->mapToScene( QPoint(mouseEvent->x(), mouseEvent->y()) );
mBoundaryPts.append( pt );
int sub_wnd_width = 10;
float x = pt.x();
float y = pt.y();
int x1 = (x - sub_wnd_width)>=0 ? x-sub_wnd_width : -(x-sub_wnd_width);
int y1 = (y - sub_wnd_width)>=0 ? y-sub_wnd_width : -(y-sub_wnd_width);
// draw temporal point
//
/*
TrajectoryPoint *pointItem = new TrajectoryPoint( pt.x(), pt.y(), 1, 1 );
pointItem->setPen( QPen(Qt::red) );
mPointItems.append( pointItem );
mView->scene()->addItem( pointItem ); // show line */
}
}
void ToolMoveTrackMark::keyPress( QKeyEvent *keyEvent)
{
cout<<"I am here";
}