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