]> Creatis software - clitk.git/blob - vv/vvInfoPanel.cxx
The absence of libstatgrab is now insensitive
[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://www.centreleonberard.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 #include "clitkMemoryUsage.h"
23 #include "clitkConfiguration.h"
24
25 //------------------------------------------------------------------------------
26 vvInfoPanel::vvInfoPanel(QWidget * parent):QWidget(parent)
27 {
28   setupUi(this);
29 #if CLITK_MEMORY_INFO==0
30   memoryUsageLabel->hide();
31 #endif
32 }
33 //------------------------------------------------------------------------------
34
35 //------------------------------------------------------------------------------
36 void vvInfoPanel::setTransformation(QString text)
37 {
38   transformationLabel->setText(text);
39 }
40
41 //------------------------------------------------------------------------------
42
43 void vvInfoPanel::setFileName(QString text)
44 {
45   if (text.size() > 30)
46     imageLabel->setText("..." + text.right(27));
47   else
48     imageLabel->setText(text);
49 }
50 //------------------------------------------------------------------------------
51
52
53 //------------------------------------------------------------------------------
54 void vvInfoPanel::setDimension(QString text)
55 {
56   dimensionLabel->setText(text);
57 }
58 //------------------------------------------------------------------------------
59
60
61 //------------------------------------------------------------------------------
62 void vvInfoPanel::setSizeMM(QString text)
63 {
64   sizeMMLabel->setText(text);
65 }
66 //------------------------------------------------------------------------------
67
68
69 //------------------------------------------------------------------------------
70 void vvInfoPanel::setNPixel(QString text)
71 {
72   nPixelLabel->setText(text);
73 }
74 //------------------------------------------------------------------------------
75
76
77 //------------------------------------------------------------------------------
78 void vvInfoPanel::setSizePixel(QString text)
79 {
80   sizePixelLabel->setText(text);
81 }
82 //------------------------------------------------------------------------------
83
84
85 //------------------------------------------------------------------------------
86 void vvInfoPanel::setOrigin(QString text)
87 {
88   originLabel->setText(text);
89 }
90 //------------------------------------------------------------------------------
91
92
93 //------------------------------------------------------------------------------
94 void vvInfoPanel::setSpacing(QString text)
95 {
96   spacingLabel->setText(text);
97 }
98 //------------------------------------------------------------------------------
99
100
101 //------------------------------------------------------------------------------
102 void vvInfoPanel::setCurrentInfo(int visibility, double x, double y, double z, double X, double Y, double Z, double value)
103 {
104   QString world = "";
105   QString mouse = "";
106   QString val = "";
107   if (visibility) {
108     world += QString::number(x,'f',1) + " ";
109     world += QString::number(y,'f',1) + " ";
110     world += QString::number(z,'f',1) + " ";
111
112     mouse += QString::number(X,'f',1) + " ";
113     mouse += QString::number(Y,'f',1) + " ";
114     mouse += QString::number(Z,'f',1) + " ";
115
116     val += QString::number(value);
117   }
118   worldPosLabel->setText(world);
119   pixelPosLabel->setText(mouse);
120   valueLabel->setText(val);
121 }
122 //------------------------------------------------------------------------------
123
124
125 //------------------------------------------------------------------------------
126 void vvInfoPanel::setViews(int window, int view, int slice)
127 {/*
128   QString viewString;
129   switch (view) {
130   case 0: {
131     viewString = "Sagital,  ";
132     break;
133   }
134   case 1: {
135     viewString = "Coronal, ";
136     break;
137   }
138   case 2: {
139     viewString = "Axial,   ";
140     break;
141   }
142   }
143
144   QString text = viewString;
145   if (view != -1) {
146     text += "current slice : ";
147     text += QString::number(slice);
148   } else {
149     text = "Disable";
150   }
151
152   switch (window) {
153   case 0: {
154     ULLabel->setText(text);
155     break;
156   }
157   case 1: {
158     URLabel->setText(text);
159     break;
160   }
161   case 2: {
162     DLLabel->setText(text);
163     break;
164   }
165   case 3: {
166     DRLabel->setText(text);
167     break;
168   }
169   }*/
170 }
171 //------------------------------------------------------------------------------
172
173
174 //------------------------------------------------------------------------------
175 void vvInfoPanel::setMemoryInMb(QString text)
176 {
177   memoryUsageLabel->setText("<font color=\"blue\">Memory usage :</font> "+text);
178 }
179 //------------------------------------------------------------------------------
180