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

« back to all changes in this revision

Viewing changes to engine/snappea/nsnappeatriangulation.cpp

  • Committer: Package Import Robot
  • Author(s): Ben Burton
  • Date: 2011-09-10 07:17:25 UTC
  • mfrom: (1.2.4 upstream)
  • Revision ID: package-import@ubuntu.com-20110910071725-97n90tywdq60w2cr
Tags: 4.90-1
* New upstream release!
* The user interface has been ported from KDE3 to KDE4 (closes: #556318).
  Re-enabled the GUI as a result.
* The build system has been ported from autotools to cmake.
* The new upstream release builds fine on amd64 (closes: #624882).
* Moved the users' handbook into regina-normal-doc.
* Upgraded several suggests/recommends.  Upgraded regina-normal-mpi to
  depend on mpi-default-bin, and regina-normal to depend on both graphviz
  and regina-normal-doc (which the GUI expends to be present).  Upgraded
  regina-normal to recommend gap.
* Bumped standards-version to 3.9.2.0 (no changes required).

Show diffs side-by-side

added added

removed removed

Lines of Context:
4
4
 *  Regina - A Normal Surface Theory Calculator                           *
5
5
 *  Computational Engine                                                  *
6
6
 *                                                                        *
7
 
 *  Copyright (c) 1999-2009, Ben Burton                                   *
 
7
 *  Copyright (c) 1999-2011, Ben Burton                                   *
8
8
 *  For further details contact Ben Burton (bab@debian.org).              *
9
9
 *                                                                        *
10
10
 *  This program is free software; you can redistribute it and/or         *
33
33
#include "snappea/kernel/triangulation.h"
34
34
#include "snappea/kernel/unix_file_io.h"
35
35
#include "triangulation/ntriangulation.h"
 
36
#include "utilities/nthread.h"
36
37
 
37
38
namespace regina {
38
39
 
 
40
namespace {
 
41
    /**
 
42
     * A mutex to protect kernelMessages.
 
43
     */
 
44
    static NMutex snapMutex;
 
45
}
 
46
 
39
47
NSnapPeaTriangulation::NSnapPeaTriangulation(const NSnapPeaTriangulation& tri) :
40
48
        ShareableObject() {
41
49
    if (tri.snappeaData)
74
82
 
75
83
void NSnapPeaTriangulation::saveAsSnapPea(const char* filename) const {
76
84
    if (snappeaData)
77
 
        save_triangulation(snappeaData, const_cast<char*>(filename));
 
85
        save_triangulation(snappeaData, filename);
78
86
}
79
87
 
80
88
void NSnapPeaTriangulation::writeTextShort(std::ostream& out) const {
163
171
    return ans;
164
172
}
165
173
 
 
174
bool NSnapPeaTriangulation::kernelMessagesEnabled() {
 
175
    NMutex::MutexLock ml(snapMutex);
 
176
    return kernelMessages;
 
177
}
 
178
 
 
179
void NSnapPeaTriangulation::enableKernelMessages(bool enabled) {
 
180
    NMutex::MutexLock ml(snapMutex);
 
181
    kernelMessages = enabled;
 
182
}
 
183
 
 
184
void NSnapPeaTriangulation::disableKernelMessages() {
 
185
    NMutex::MutexLock ml(snapMutex);
 
186
    kernelMessages = false;
 
187
}
 
188
 
166
189
} // namespace regina
167
190