]> Creatis software - clitk.git/blob - vv/vvInfoPanel.cxx
added the new headers
[clitk.git] / vv / vvInfoPanel.cxx
1 /*=========================================================================
2   Program:   vv                     http://www.creatis.insa-lyon.fr/rio/vv
3
4   Authors belong to: 
5   - University of LYON              http://www.universite-lyon.fr/
6   - Léon Bérard cancer center       http://oncora1.lyon.fnclcc.fr
7   - CREATIS CNRS laboratory         http://www.creatis.insa-lyon.fr
8
9   This software is distributed WITHOUT ANY WARRANTY; without even
10   the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
11   PURPOSE.  See the copyright notices for more information.
12
13   It is distributed under dual licence
14
15   - BSD        See included LICENSE.txt file
16   - CeCILL-B   http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
17 ======================================================================-====*/
18 #include <QtGui>
19 #include <Qt>
20
21 #include "vvInfoPanel.h"
22
23 void vvInfoPanel::setFileName(QString text)
24 {
25     if (text.size() > 30)
26         imageLabel->setText("..." + text.right(27));
27     else
28         imageLabel->setText(text);
29 }
30
31 void vvInfoPanel::setDimension(QString text)
32 {
33     dimensionLabel->setText(text);
34 }
35
36 void vvInfoPanel::setSizeMM(QString text)
37 {
38     sizeMMLabel->setText(text);
39 }
40
41 void vvInfoPanel::setNPixel(QString text)
42 {
43     nPixelLabel->setText(text);
44 }
45
46 void vvInfoPanel::setSizePixel(QString text)
47 {
48     sizePixelLabel->setText(text);
49 }
50
51 void vvInfoPanel::setOrigin(QString text)
52 {
53     originLabel->setText(text);
54 }
55
56 void vvInfoPanel::setSpacing(QString text)
57 {
58     spacingLabel->setText(text);
59 }
60
61 void vvInfoPanel::setCurrentInfo(int visibility, double x, double y, double z, double X, double Y, double Z, double value)
62 {
63     QString world = "";
64     QString mouse = "";
65     QString val = "";
66     if (visibility)
67     {
68         world += QString::number(x,'f',1) + " ";
69         world += QString::number(y,'f',1) + " ";
70         world += QString::number(z,'f',1) + " ";
71
72         mouse += QString::number(X,'f',1) + " ";
73         mouse += QString::number(Y,'f',1) + " ";
74         mouse += QString::number(Z,'f',1) + " ";
75
76         val += QString::number(value);
77     }
78     worldPosLabel->setText(world);
79     pixelPosLabel->setText(mouse);
80     valueLabel->setText(val);
81 }
82
83
84 void vvInfoPanel::setViews(int window, int view, int slice)
85 {
86     QString viewString;
87     switch (view)
88     {
89     case 0:
90     {
91         viewString = "Sagital,  ";
92         break;
93     }
94     case 1:
95     {
96         viewString = "Coronal, ";
97         break;
98     }
99     case 2:
100     {
101         viewString = "Axial,   ";
102         break;
103     }
104     }
105
106     QString text = viewString;
107     if (view != -1)
108     {
109         text += "current slice : ";
110         text += QString::number(slice);
111     }
112     else
113     {
114         text = "Disable";
115     }
116
117     switch (window)
118     {
119     case 0:
120     {
121         ULLabel->setText(text);
122         break;
123     }
124     case 1:
125     {
126         URLabel->setText(text);
127         break;
128     }
129     case 2:
130     {
131         DLLabel->setText(text);
132         break;
133     }
134     case 3:
135     {
136         DRLabel->setText(text);
137         break;
138     }
139     }
140 }