]> Creatis software - clitk.git/blob - vv/vvInfoPanel.cxx
removed headers
[clitk.git] / vv / vvInfoPanel.cxx
1 #include <QtGui>
2 #include <Qt>
3
4 #include "vvInfoPanel.h"
5
6 void vvInfoPanel::setFileName(QString text)
7 {
8     if (text.size() > 30)
9         imageLabel->setText("..." + text.right(27));
10     else
11         imageLabel->setText(text);
12 }
13
14 void vvInfoPanel::setDimension(QString text)
15 {
16     dimensionLabel->setText(text);
17 }
18
19 void vvInfoPanel::setSizeMM(QString text)
20 {
21     sizeMMLabel->setText(text);
22 }
23
24 void vvInfoPanel::setNPixel(QString text)
25 {
26     nPixelLabel->setText(text);
27 }
28
29 void vvInfoPanel::setSizePixel(QString text)
30 {
31     sizePixelLabel->setText(text);
32 }
33
34 void vvInfoPanel::setOrigin(QString text)
35 {
36     originLabel->setText(text);
37 }
38
39 void vvInfoPanel::setSpacing(QString text)
40 {
41     spacingLabel->setText(text);
42 }
43
44 void vvInfoPanel::setCurrentInfo(int visibility, double x, double y, double z, double X, double Y, double Z, double value)
45 {
46     QString world = "";
47     QString mouse = "";
48     QString val = "";
49     if (visibility)
50     {
51         world += QString::number(x,'f',1) + " ";
52         world += QString::number(y,'f',1) + " ";
53         world += QString::number(z,'f',1) + " ";
54
55         mouse += QString::number(X,'f',1) + " ";
56         mouse += QString::number(Y,'f',1) + " ";
57         mouse += QString::number(Z,'f',1) + " ";
58
59         val += QString::number(value);
60     }
61     worldPosLabel->setText(world);
62     pixelPosLabel->setText(mouse);
63     valueLabel->setText(val);
64 }
65
66
67 void vvInfoPanel::setViews(int window, int view, int slice)
68 {
69     QString viewString;
70     switch (view)
71     {
72     case 0:
73     {
74         viewString = "Sagital,  ";
75         break;
76     }
77     case 1:
78     {
79         viewString = "Coronal, ";
80         break;
81     }
82     case 2:
83     {
84         viewString = "Axial,   ";
85         break;
86     }
87     }
88
89     QString text = viewString;
90     if (view != -1)
91     {
92         text += "current slice : ";
93         text += QString::number(slice);
94     }
95     else
96     {
97         text = "Disable";
98     }
99
100     switch (window)
101     {
102     case 0:
103     {
104         ULLabel->setText(text);
105         break;
106     }
107     case 1:
108     {
109         URLabel->setText(text);
110         break;
111     }
112     case 2:
113     {
114         DLLabel->setText(text);
115         break;
116     }
117     case 3:
118     {
119         DRLabel->setText(text);
120         break;
121     }
122     }
123 }