]> Creatis software - clitk.git/blob - vv/vvInfoPanel.cxx
Debug RTStruct conversion with empty struc
[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   QFont font = transformationLabel->font();
33   font.setStyleHint(QFont::TypeWriter);
34   transformationLabel->setFont(font);
35 }
36 //------------------------------------------------------------------------------
37
38 //------------------------------------------------------------------------------
39 void vvInfoPanel::setTransformation(QString text)
40 {
41   transformationLabel->setText(text);
42 }
43
44 //------------------------------------------------------------------------------
45
46 void vvInfoPanel::setFileName(QString text)
47 {
48   if (text.size() > 30)
49     imageLabel->setText("..." + text.right(27));
50   else
51     imageLabel->setText(text);
52 }
53 //------------------------------------------------------------------------------
54
55 void vvInfoPanel::setImageCreationTime(QString text)
56 {
57   creationTimeLabel->setText(text);
58 }
59
60 //------------------------------------------------------------------------------
61 void vvInfoPanel::setDimension(QString text)
62 {
63   dimensionLabel->setText(text);
64 }
65 //------------------------------------------------------------------------------
66
67
68 //------------------------------------------------------------------------------
69 void vvInfoPanel::setSizeMM(QString text)
70 {
71   sizeMMLabel->setText(text);
72 }
73 //------------------------------------------------------------------------------
74
75
76 //------------------------------------------------------------------------------
77 void vvInfoPanel::setNPixel(QString text)
78 {
79   nPixelLabel->setText(text);
80 }
81 //------------------------------------------------------------------------------
82
83
84 //------------------------------------------------------------------------------
85 void vvInfoPanel::setSizePixel(QString text)
86 {
87   sizePixelLabel->setText(text);
88 }
89 //------------------------------------------------------------------------------
90
91
92 //------------------------------------------------------------------------------
93 void vvInfoPanel::setOrigin(QString text)
94 {
95   originLabel->setText(text);
96 }
97 //------------------------------------------------------------------------------
98
99
100 //------------------------------------------------------------------------------
101 void vvInfoPanel::setSpacing(QString text)
102 {
103   spacingLabel->setText(text);
104 }
105 //------------------------------------------------------------------------------
106
107
108 //------------------------------------------------------------------------------
109 void vvInfoPanel::setCurrentInfo(int visibility, double x, double y, double z, double X, double Y, double Z, double value)
110 {
111   QString world = "";
112   QString mouse = "";
113   QString val = "";
114   if (visibility) {
115     world += QString::number(x,'f',1) + " ";
116     world += QString::number(y,'f',1) + " ";
117     world += QString::number(z,'f',1) + " ";
118
119     mouse += QString::number(X,'f',1) + " ";
120     mouse += QString::number(Y,'f',1) + " ";
121     mouse += QString::number(Z,'f',1) + " ";
122
123     val += QString::number(value);
124   }
125   worldPosLabel->setText(world);
126   pixelPosLabel->setText(mouse);
127   valueLabel->setText(val);
128 }
129 //------------------------------------------------------------------------------
130
131
132 //------------------------------------------------------------------------------
133 void vvInfoPanel::setMemoryInMb(QString text)
134 {
135   memoryUsageLabel->setText("<font color=\"blue\">Memory usage :</font> "+text);
136 }
137 //------------------------------------------------------------------------------
138