]> Creatis software - clitk.git/blob - vv/vvInfoPanel.cxx
remove antique RCS headers
[clitk.git] / vv / vvInfoPanel.cxx
1 /*=========================================================================
2
3  Program:   vv
4  Language:  C++
5  Author :   Pierre Seroul (pierre.seroul@gmail.com)
6
7 Copyright (C) 2008
8 Léon Bérard cancer center http://oncora1.lyon.fnclcc.fr
9 CREATIS-LRMN http://www.creatis.insa-lyon.fr
10
11 This program is free software: you can redistribute it and/or modify
12 it under the terms of the GNU General Public License as published by
13 the Free Software Foundation, version 3 of the License.
14
15 This program is distributed in the hope that it will be useful,
16 but WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18 GNU General Public License for more details.
19
20 You should have received a copy of the GNU General Public License
21 along with this program.  If not, see <http://www.gnu.org/licenses/>.
22
23 =========================================================================*/
24 #include <QtGui>
25 #include <Qt>
26
27 #include "vvInfoPanel.h"
28
29 void vvInfoPanel::setFileName(QString text)
30 {
31     if (text.size() > 30)
32         imageLabel->setText("..." + text.right(27));
33     else
34         imageLabel->setText(text);
35 }
36
37 void vvInfoPanel::setDimension(QString text)
38 {
39     dimensionLabel->setText(text);
40 }
41
42 void vvInfoPanel::setSizeMM(QString text)
43 {
44     sizeMMLabel->setText(text);
45 }
46
47 void vvInfoPanel::setNPixel(QString text)
48 {
49     nPixelLabel->setText(text);
50 }
51
52 void vvInfoPanel::setSizePixel(QString text)
53 {
54     sizePixelLabel->setText(text);
55 }
56
57 void vvInfoPanel::setOrigin(QString text)
58 {
59     originLabel->setText(text);
60 }
61
62 void vvInfoPanel::setSpacing(QString text)
63 {
64     spacingLabel->setText(text);
65 }
66
67 void vvInfoPanel::setCurrentInfo(int visibility, double x, double y, double z, double X, double Y, double Z, double value)
68 {
69     QString world = "";
70     QString mouse = "";
71     QString val = "";
72     if (visibility)
73     {
74         world += QString::number(x,'f',1) + " ";
75         world += QString::number(y,'f',1) + " ";
76         world += QString::number(z,'f',1) + " ";
77
78         mouse += QString::number(X,'f',1) + " ";
79         mouse += QString::number(Y,'f',1) + " ";
80         mouse += QString::number(Z,'f',1) + " ";
81
82         val += QString::number(value);
83     }
84     worldPosLabel->setText(world);
85     pixelPosLabel->setText(mouse);
86     valueLabel->setText(val);
87 }
88
89
90 void vvInfoPanel::setViews(int window, int view, int slice)
91 {
92     QString viewString;
93     switch (view)
94     {
95     case 0:
96     {
97         viewString = "Sagital,  ";
98         break;
99     }
100     case 1:
101     {
102         viewString = "Coronal, ";
103         break;
104     }
105     case 2:
106     {
107         viewString = "Axial,   ";
108         break;
109     }
110     }
111
112     QString text = viewString;
113     if (view != -1)
114     {
115         text += "current slice : ";
116         text += QString::number(slice);
117     }
118     else
119     {
120         text = "Disable";
121     }
122
123     switch (window)
124     {
125     case 0:
126     {
127         ULLabel->setText(text);
128         break;
129     }
130     case 1:
131     {
132         URLabel->setText(text);
133         break;
134     }
135     case 2:
136     {
137         DLLabel->setText(text);
138         break;
139     }
140     case 3:
141     {
142         DRLabel->setText(text);
143         break;
144     }
145     }
146 }