Newer
Older
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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
#include <QtGui>
#include <iostream>
#include <cstdlib>
#include "bsprofileview.h"
using namespace std;
BSProfileView::BSProfileView ()
{
// CAUTION : don't activate antialiasing here !!!
setBackgroundBrush (QBrush (Qt::white));
setScene (new QGraphicsScene (0, 0, 610, 610));
prof = new BSProfileItem ();
scene()->addItem (prof);
setWindowTitle (prof->itemTitle ());
resize (QSize (616, 616));
}
BSProfileView::~BSProfileView ()
{
scene()->removeItem (prof);
delete prof;
}
void BSProfileView::paint (QPainter *painter,
const QStyleOptionGraphicsItem *option,
QWidget *widget)
{
Q_UNUSED (option);
Q_UNUSED (widget);
Q_UNUSED (painter);
}
void BSProfileView::setImage (QImage *image, VMap *idata)
{
prof->setImage (image, idata);
}
void BSProfileView::buildScans (Pt2i p1, Pt2i p2)
{
prof->buildScans (p1, p2);
}
bool BSProfileView::processKeyEvent (QKeyEvent *event)
{
switch (event->key ())
{
case Qt::Key_W : // Width of correlation measure
prof->incCorrelWidth (event->modifiers () & Qt::ShiftModifier);
prof->update ();
break;
case Qt::Key_T : // Thickness of correlation measure
prof->incCorrelThick (event->modifiers () & Qt::ShiftModifier);
prof->update ();
break;
case Qt::Key_R : // Ratio of correlation measure
prof->incCorrelRatio (event->modifiers () & Qt::ShiftModifier);
prof->update ();
break;
case Qt::Key_I :
prof->toggleDisplay ((event->modifiers () & Qt::ShiftModifier) == 0);
setWindowTitle (prof->itemTitle ());
prof->update ();
break;
// viewport()->grab (
// QRect (QPoint (0, 0),
// QSize (prof->getWidth(), prof->getHeight()))
// ).toImage().save ("profiles.png");