124
124
label->setWhatsThis(msg);
125
125
splitting->setWhatsThis(msg);
127
titleIrreducible = new QLabel(tr("Irreducible?"), ui);
128
grid->addWidget(titleIrreducible, 5, 1);
129
irreducible = new QLabel(ui);
130
grid->addWidget(irreducible, 5, 3);
131
msg = tr("<qt>Does this triangulation represent an "
132
"irreducible 3-manifold? A closed orientable 3-manifold is "
133
"<i>irreducible</i> if every embedded sphere bounds a ball.</qt>");
134
titleIrreducible->setWhatsThis(msg);
135
irreducible->setWhatsThis(msg);
137
titleHaken = new QLabel(tr("Haken?"), ui);
138
grid->addWidget(titleHaken, 6, 1);
139
haken = new QLabel(ui);
140
grid->addWidget(haken, 6, 3);
141
msg = tr("<qt>Does this triangulation represent a Haken 3-manifold? "
142
"A closed orientable irreducible 3-manifold is "
143
"<i>Haken</i> if it contains an embedded closed two-sided "
144
"incompressible surface.<p>"
145
"Hakenness testing is only available for irreducible "
146
"3-manifolds.</qt>");
147
titleHaken->setWhatsThis(msg);
148
haken->setWhatsThis(msg);
127
150
btnThreeSphere = new QPushButton(ReginaSupport::themeIcon("system-run"),
128
151
tr("Calculate"), ui);
129
152
btnThreeSphere->setToolTip(tr("Calculate whether this is a 3-sphere"));
154
177
btnSolidTorus->setToolTip(tr("Calculate whether this is a solid torus"));
155
178
btnSolidTorus->setWhatsThis(tr("<qt>Calculate whether this "
156
179
"is a triangulation of the solid torus (i.e., the unknot "
157
"complement). The triangulation may have real boundary faces, "
180
"complement). The triangulation may have real boundary triangles, "
158
181
"or it may be ideal (in which case I will assume that "
159
182
"any ideal vertices are truncated).<p>"
160
183
"<b>Warning:</b> This calculation is occasionally quite slow for "
187
210
grid->addWidget(btnSplitting, 4, 5);
188
211
connect(btnSplitting, SIGNAL(clicked()), this, SLOT(calculateSplitting()));
213
btnIrreducible = new QPushButton(ReginaSupport::themeIcon("system-run"),
214
tr("Calculate"), ui);
215
btnIrreducible->setToolTip(tr("Calculate whether this 3-manifold "
217
btnIrreducible->setWhatsThis(tr("<qt>Calculate whether this "
218
"triangulation represents an irreducible 3-manifold.<p>"
219
"<b>Warning:</b> This calculation can be quite slow for larger "
220
"triangulations (which is why irreducibility is not always "
221
"tested automatically).</qt>"));
222
grid->addWidget(btnIrreducible, 5, 5);
223
connect(btnIrreducible, SIGNAL(clicked()), this,
224
SLOT(calculateIrreducible()));
226
btnHaken = new QPushButton(ReginaSupport::themeIcon("system-run"),
227
tr("Calculate"), ui);
228
btnHaken->setToolTip(tr("Calculate whether this 3-manifold is Haken"));
229
btnHaken->setWhatsThis(tr("<qt>Calculate whether this "
230
"triangulation represents a Haken 3-manifold.<p>"
231
"Hakenness testing is only available for irreducible 3-manifolds.<p>"
232
"<b>Warning:</b> This calculation can be quite slow for larger "
233
"triangulations (which is why Hakenness is not always "
234
"tested automatically).</qt>"));
235
grid->addWidget(btnHaken, 6, 5);
236
connect(btnHaken, SIGNAL(clicked()), this, SLOT(calculateHaken()));
190
238
layout->addStretch(1);
192
240
QBoxLayout* mfdArea = new QHBoxLayout();
332
377
btnThreeBall->setEnabled(true);
335
// Use the same threshold adjustment as for 3-sphere recognition.
336
380
if (tri->knowsSolidTorus() ||
337
tri->getNumberOfTetrahedra() + THREE_SPHERE_AUTO_CALC_ADJUSTMENT
338
<= autoCalcThreshold) {
381
tri->getNumberOfTetrahedra() <= autoCalcThreshold) {
339
382
if (tri->isSolidTorus()) {
340
383
solidTorus->setText(tr("True"));
341
384
QPalette pal = solidTorus->palette();
357
400
btnSolidTorus->setEnabled(true);
403
if (tri->isOrientable() && tri->isClosed() && tri->isValid() &&
404
tri->isConnected()) {
405
titleIrreducible->setVisible(true);
406
irreducible->setVisible(true);
407
btnIrreducible->setVisible(true);
409
if (tri->knowsIrreducible() ||
410
tri->getNumberOfTetrahedra() <= autoCalcThreshold) {
411
if (tri->isIrreducible()) {
412
irreducible->setText(tr("True"));
413
QPalette pal = irreducible->palette();
414
pal.setColor(irreducible->foregroundRole(), Qt::darkGreen);
415
irreducible->setPalette(pal);
417
irreducible->setText(tr("False"));
418
QPalette pal = irreducible->palette();
419
pal.setColor(irreducible->foregroundRole(), Qt::darkRed);
420
irreducible->setPalette(pal);
422
btnIrreducible->setEnabled(false);
424
irreducible->setText(tr("Unknown"));
425
irreducible->setPalette(QPalette());
426
btnIrreducible->setEnabled(true);
429
titleIrreducible->setVisible(false);
430
irreducible->setVisible(false);
431
btnIrreducible->setVisible(false);
434
// Use the same threshold adjustment as for 3-sphere recognition.
435
if (tri->isOrientable() && tri->isClosed() && tri->isValid() &&
436
tri->isConnected()) {
437
titleHaken->setVisible(true);
438
haken->setVisible(true);
439
btnHaken->setVisible(true);
441
if (tri->knowsIrreducible() && ! tri->isIrreducible()) {
442
// We are not allowed to test Hakenness in this situation.
443
haken->setText(tr("N/A"));
444
QPalette pal = haken->palette();
445
pal.setColor(haken->foregroundRole(), Qt::darkYellow);
446
haken->setPalette(pal);
447
btnHaken->setEnabled(false);
448
} else if (tri->knowsHaken() ||
449
tri->getNumberOfTetrahedra() + HAKEN_AUTO_CALC_ADJUSTMENT
450
<= autoCalcThreshold) {
451
// This will not trigger new knowledge about irreducibility,
452
// since if the triangulation has few tetrahedra we would
453
// have just run an irreducibility test in the previous section.
454
if (tri->isHaken()) {
455
haken->setText(tr("True"));
456
QPalette pal = haken->palette();
457
pal.setColor(haken->foregroundRole(), Qt::darkGreen);
458
haken->setPalette(pal);
460
haken->setText(tr("False"));
461
QPalette pal = haken->palette();
462
pal.setColor(haken->foregroundRole(), Qt::darkRed);
463
haken->setPalette(pal);
465
btnHaken->setEnabled(false);
467
haken->setText(tr("Unknown"));
468
haken->setPalette(QPalette());
469
btnHaken->setEnabled(true);
472
titleHaken->setVisible(false);
473
haken->setVisible(false);
474
btnHaken->setVisible(false);
360
477
if (! name.empty()) {
361
478
manifold->setText(tr("Manifold: %1").arg(name.c_str()));
566
void NTriSurfacesUI::calculateIrreducible() {
567
PatienceDialog* dlg = PatienceDialog::warn(tr(
568
"Testing irreducibility can be quite slow\n"
569
"for larger triangulations.\n\n"
570
"Please be patient."), ui);
571
tri->isIrreducible();
577
void NTriSurfacesUI::calculateHaken() {
578
PatienceDialog* dlg = PatienceDialog::warn(tr(
579
"Hakenness testing can be quite slow\n"
580
"for larger triangulations.\n\n"
581
"Please be patient."), ui);