28 #include <QtGui/QGridLayout>
29 #include <QtGui/QHBoxLayout>
30 #include <QtGui/QLabel>
31 #include <Qt3Support/Q3Accel>
43 setWindowTitle(
"Topological characteristics") ;
47 Q3Accel * Raccourci =
new Q3Accel(
this) ;
48 Raccourci -> insertItem(QKeySequence(Qt :: Key_Space) , 9) ;
49 Raccourci -> connectItem(9 ,
this , SLOT(close())) ;
51 QHBoxLayout * placement =
new QHBoxLayout(
this) ;
54 FGlobal =
new QGroupBox(
"Globals") ;
55 QGridLayout * global =
new QGridLayout(FGlobal) ;
57 global->addWidget(
new QLabel(
"darts:") , 1 , 0) ;
58 global->addWidget(
new QLabel(
"vertices:") , 2 , 0) ;
59 global->addWidget(
new QLabel(
"edges:") , 3 , 0);
60 global->addWidget(
new QLabel(
"faces:") , 4 , 0) ;
61 global->addWidget(
new QLabel(
"volumes:") , 5 , 0) ;
62 global->addWidget(
new QLabel(
"composants:") , 6 , 0) ;
64 for (
int i = 0 ; i < 6 ; i++)
66 FGlobalCells [i] =
new QLabel(
"") ;
67 global -> addWidget(FGlobalCells [ i ] , i + 1 , 1) ;
70 global -> addWidget(
new QLabel(
"0-borders:") , 2 , 2) ;
71 global -> addWidget(
new QLabel(
"1-borders:") , 3 , 2) ;
72 global -> addWidget(
new QLabel(
"2-borders:") , 4 , 2) ;
73 global -> addWidget(
new QLabel(
"3-borders:") , 5 , 2) ;
75 for (
int i = 0 ; i < 4 ; i++)
77 FGlobalBorders [i] =
new QLabel(
"") ;
78 global -> addWidget(FGlobalBorders [ i ] , i + 2 , 3) ;
82 FPointed =
new QGroupBox(
"Volume incident to 'last'") ;
83 QGridLayout * pointed =
new QGridLayout(FPointed) ;
85 pointed->addWidget(
new QLabel(
"darts:") , 1 , 0);
86 pointed->addWidget(
new QLabel(
"vertices:") , 2 , 0);
87 pointed->addWidget(
new QLabel(
"edges:") , 3 , 0);
88 pointed->addWidget(
new QLabel(
"faces:") , 4 , 0);
90 for (
int i = 0 ; i < 4 ; i++)
91 FPointedCells [i] =
new QLabel(
"") ;
93 for (
int i = 0 ; i < 4 ; i++)
94 pointed -> addWidget(FPointedCells [ i ] , i + 1 , 1) ;
97 pointed -> addWidget(
new QLabel(
"0-borders:") , 1 , 2) ;
98 pointed -> addWidget(
new QLabel(
"1-borders:") , 2 , 2) ;
99 pointed -> addWidget(
new QLabel(
"2-borders:") , 3 , 2) ;
101 for (
int i = 0 ; i < 3 ; i++)
102 FPointedBorders [i] =
new QLabel(
"") ;
104 for (
int i = 0 ; i < 3 ; i++)
105 pointed -> addWidget(FPointedBorders [ i ] , i + 1 , 3) ;
107 QWidget * WPar =
new QWidget ;
108 QGridLayout * par =
new QGridLayout(WPar) ;
111 addWidget(
new QLabel(
"Euler characteristic:"),1 , 0) ;
113 addWidget(
new QLabel(
"Orientability coefficient:"),2 , 0) ;
114 par -> addWidget(
new QLabel(
"Genus:") , 3 , 0) ;
116 FEulerLabel =
new QLabel(
"") ;
117 par -> addWidget(FEulerLabel , 1 , 1) ;
118 FOrientLabel =
new QLabel(
"") ;
119 par -> addWidget(FOrientLabel , 2 , 1) ;
120 FGenusLabel =
new QLabel(
"") ;
121 par -> addWidget(FGenusLabel , 3 , 1) ;
122 FNameLabel =
new QLabel(
"") ;
124 pointed -> addWidget(WPar);
125 pointed -> addWidget(FNameLabel);
128 placement -> addWidget(FGlobal) ;
129 placement -> addWidget(FPointed) ;
140 int nb[4], nb2WhenClosed;
142 int euler, orient, genus;
147 FParent -> getControler()
148 -> getMapGlobalCharacteristics(& nd,
149 & nc [ 0 ] , & nc [ 1 ] , & nc [ 2 ] ,
150 & nc [ 3 ] , & nc [ 4 ] , & nb [ 0 ] ,
151 & nb [ 1 ] , & nb [ 2 ] , & nb [ 3 ]) ;
153 sprintf(buffer,
"%d", nd) ;
154 FGlobalCells [ 0 ] -> setText(buffer) ;
156 for (
int i = 0 ; i < 4 ; ++i)
158 sprintf(buffer ,
"%d" , nc [ i ]) ;
159 FGlobalCells [ i+1 ] -> setText(buffer) ;
161 sprintf(buffer ,
"%d" , nb [ i ]) ;
162 FGlobalBorders [ i ] -> setText(buffer) ;
165 sprintf(buffer ,
"%d" , nc [ 4 ]) ;
166 FGlobalCells [ 5 ] -> setText(buffer) ;
172 FParent -> getControler()
173 -> getSurfaceCharacteristics(& name , & nd ,
174 & nc [ 0 ] , & nc [ 1 ] , & nc [ 2 ] ,
175 & nb [ 0 ] , & nb [ 1 ] , & nb [ 2 ] ,
177 & euler , & orient , & genus) ;
181 sprintf(buffer ,
"%d" , nd) ;
182 FPointedCells [ 0 ] -> setText(buffer) ;
184 for (
int i = 0 ; i < 3 ; ++i)
186 sprintf(buffer ,
"%d" , nc [ i ]) ;
187 FPointedCells [ i+1 ] -> setText(buffer) ;
189 sprintf(buffer ,
"%d" , nb [ i ]) ;
190 FPointedBorders [ i ] -> setText(buffer) ;
193 sprintf(buffer ,
"%d" , euler) ;
194 FEulerLabel -> setText(buffer) ;
196 sprintf(buffer ,
"%d" , orient) ;
197 FOrientLabel -> setText(buffer) ;
199 sprintf(buffer ,
"%d" , genus) ;
200 FGenusLabel -> setText(buffer) ;
202 FNameLabel->setText(QString::fromUtf8(name.c_str()));
206 FPointedCells [ 0 ] -> setText(
"") ;
208 for (
int i = 0 ; i < 3 ; ++i)
210 FPointedBorders [ i ] -> setText(
"") ;
211 FPointedCells [ i+1 ] -> setText(
"") ;
214 FEulerLabel -> setText(
"") ;
215 FOrientLabel -> setText(
"") ;
216 FGenusLabel -> setText(
"") ;
217 FNameLabel -> setText(
"") ;
220 FParent -> repaint() ;