~ubuntu-branches/ubuntu/vivid/regina-normal/vivid-proposed

« back to all changes in this revision

Viewing changes to kdeui/src/part/packettypes/ntrisnappea.h

  • Committer: Bazaar Package Importer
  • Author(s): Ben Burton
  • Date: 2006-10-29 22:25:06 UTC
  • mfrom: (3.1.7 edgy)
  • Revision ID: james.westby@ubuntu.com-20061029222506-1y63yl1k6pwhhpwq
Tags: 4.3.1-3
Removed www-browser as an alternative to konqueror in regina-normal-doc
recommendations, since the GUI needs konqueror specifically to open the
API docs from the help menu.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
 
 
2
/**************************************************************************
 
3
 *                                                                        *
 
4
 *  Regina - A Normal Surface Theory Calculator                           *
 
5
 *  KDE User Interface                                                    *
 
6
 *                                                                        *
 
7
 *  Copyright (c) 1999-2006, Ben Burton                                   *
 
8
 *  For further details contact Ben Burton (bab@debian.org).              *
 
9
 *                                                                        *
 
10
 *  This program is free software; you can redistribute it and/or         *
 
11
 *  modify it under the terms of the GNU General Public License as        *
 
12
 *  published by the Free Software Foundation; either version 2 of the    *
 
13
 *  License, or (at your option) any later version.                       *
 
14
 *                                                                        *
 
15
 *  This program is distributed in the hope that it will be useful, but   *
 
16
 *  WITHOUT ANY WARRANTY; without even the implied warranty of            *
 
17
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU     *
 
18
 *  General Public License for more details.                              *
 
19
 *                                                                        *
 
20
 *  You should have received a copy of the GNU General Public             *
 
21
 *  License along with this program; if not, write to the Free            *
 
22
 *  Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,       *
 
23
 *  MA 02110-1301, USA.                                                   *
 
24
 *                                                                        *
 
25
 **************************************************************************/
 
26
 
 
27
/* end stub */
 
28
 
 
29
/*! \file ntrisurfaces.h
 
30
 *  \brief Provides access to SnapPea calculations for triangulations.
 
31
 */
 
32
 
 
33
#ifndef __NTRISNAPPEA_H
 
34
#define __NTRISNAPPEA_H
 
35
 
 
36
#include "../packettabui.h"
 
37
 
 
38
class NoSnapPea;
 
39
class QLabel;
 
40
class QWidgetStack;
 
41
 
 
42
namespace regina {
 
43
    class NPacket;
 
44
    class NSnapPeaTriangulation;
 
45
    class NTriangulation;
 
46
};
 
47
 
 
48
/**
 
49
 * A triangulation page for viewing normal surface properties.
 
50
 */
 
51
class NTriSnapPeaUI : public QObject, public PacketViewerTab {
 
52
    Q_OBJECT
 
53
 
 
54
    private:
 
55
        /**
 
56
         * Packet details
 
57
         */
 
58
        regina::NTriangulation* reginaTri;
 
59
        regina::NSnapPeaTriangulation* snappeaTri;
 
60
 
 
61
        /**
 
62
         * Internal components
 
63
         */
 
64
        QWidget* ui;
 
65
        QWidgetStack* data;
 
66
        QWidget* dataValid;
 
67
        QWidget* dataNull;
 
68
        QLabel* solutionType;
 
69
        QLabel* solutionTypeLabel;
 
70
        QString solutionTypeExplnBase;
 
71
        QLabel* volume;
 
72
        NoSnapPea* unavailable;
 
73
 
 
74
        /**
 
75
         * Properties
 
76
         */
 
77
        bool allowClosed;
 
78
 
 
79
    public:
 
80
        /**
 
81
         * Constructor and destructor.
 
82
         */
 
83
        NTriSnapPeaUI(regina::NTriangulation* packet,
 
84
            PacketTabbedUI* useParentUI, bool newAllowClosed);
 
85
        ~NTriSnapPeaUI();
 
86
 
 
87
        /**
 
88
         * Update properties.
 
89
         */
 
90
        void setAllowClosed(bool newAllowClosed);
 
91
 
 
92
        /**
 
93
         * PacketViewerTab overrides.
 
94
         */
 
95
        regina::NPacket* getPacket();
 
96
        QWidget* getInterface();
 
97
        void refresh();
 
98
        void editingElsewhere();
 
99
 
 
100
    private:
 
101
        /**
 
102
         * These routines convert an NSnapPeaTriangulation::SolutionType
 
103
         * into various types of human-readable string.  They are declared
 
104
         * to take an int so that the calculation engine headers need not
 
105
         * be included.
 
106
         */
 
107
        static QString solutionTypeString(int solnType);
 
108
        static QString solutionTypeExplanation(int solnType);
 
109
};
 
110
 
 
111
inline void NTriSnapPeaUI::setAllowClosed(bool newAllowClosed) {
 
112
    allowClosed = newAllowClosed;
 
113
    refresh();
 
114
}
 
115
 
 
116
#endif