forked from fuag15/volumetric_visualization_tool
-
Notifications
You must be signed in to change notification settings - Fork 0
/
IsoControlWindow.cpp
executable file
·84 lines (71 loc) · 2.27 KB
/
IsoControlWindow.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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
#include "IsoControlWindow.h"
IsoControlWindow::IsoControlWindow(QWidget * parent):QWidget(parent)
{
cmapper = new ColorMapper(this);
cmapbar = new ColorMapperBar(this);
cmapbar -> setLimit = 1;
current = 0;
hist = new HistogramWidget(this);
//QPushButton* button = new QPushButton("Send Color to Current Map");
cmapButton = new QPushButton("Delete Current Map");
QPushButton* zoomButton = new QPushButton("Toggle Hist Zoom");
connect(zoomButton, SIGNAL(clicked()), hist, SLOT(toggleZoom()));
//connect(button, SIGNAL(clicked()), this, SLOT(sendColor()));
connect(hist, SIGNAL(maxRangeGot(int)), this, SLOT(sendMaxRange(int)));
connect(hist, SIGNAL(upperBoundGot(float)), cmapbar, SLOT(setUpperBound(float)));
connect(hist, SIGNAL(lowerBoundGot(float)), cmapbar, SLOT(setLowerBound(float)));
QVBoxLayout *layout = new QVBoxLayout;
layout->addWidget(hist);
layout->addWidget(zoomButton);
layout->addWidget(cmapper);
layout->addWidget(cmapbar);
layout->addWidget(cmapButton);
//layout->addWidget(button);
layout->setStretch(2, 1);
layout->setStretch(0, 1);
layout->setStretch(3, 1);
setLayout(layout);
cmapButton -> hide();
resize(600, 800);
return;
}
void IsoControlWindow::setAlphaArray(float* array)
{
cmapper->setAlphaMap(array);
}
void IsoControlWindow::sendMaxRange(int value)
{
emit(maxRange(value));
emit(needUpdate());
}
void IsoControlWindow::fileOpened(float* fileData, int xDim, int yDim, int zDim, float maxValue)
{
hist->openFileHist(fileData, xDim, yDim, zDim, maxValue);
}
void IsoControlWindow::setSmap(ColorMap* smap)
{
smap = 0;
return;
}
void IsoControlWindow::setCmap(ColorMap* cmapr)
{
maplist = cmapr;
cmapper->setCmap(cmapr);
//cmapbar->setCmap(cmapr);
//connect(cmapr, SIGNAL(changed()), cmapbar, SLOT(updateGL()));
connect(cmapr, SIGNAL(changed()), cmapper, SLOT(updateGL()));
//connect(cmapButton, SIGNAL(clicked()), cmapbar, SLOT(removeCurrent()));
cmapButton -> show();
return;
}
void IsoControlWindow::setImap(ColorMap* cmapr)
{
maplist = cmapr;
//cmapper->setCmap(cmapr);
cmapbar->setCmap(cmapr);
connect(cmapr, SIGNAL(changed()), cmapbar, SLOT(updateGL()));
connect(cmapr, SIGNAL(changed()), cmapper, SLOT(updateGL()));
connect(cmapButton, SIGNAL(clicked()), cmapbar, SLOT(removeCurrent()));
cmapButton -> show();
return;
}