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

« back to all changes in this revision

Viewing changes to engine/triangulation/cover.cpp

  • Committer: Package Import Robot
  • Author(s): Ben Burton
  • Date: 2014-08-29 17:37:46 UTC
  • mfrom: (19.1.1 sid)
  • Revision ID: package-import@ubuntu.com-20140829173746-igmqc9b67y366a7u
Tags: 4.96-1
New upstream release.

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-2013, Ben Burton                                   *
 
7
 *  Copyright (c) 1999-2014, 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         *
38
38
namespace regina {
39
39
 
40
40
void NTriangulation::makeDoubleCover() {
41
 
    unsigned long sheetSize = tetrahedra.size();
 
41
    unsigned long sheetSize = tetrahedra_.size();
42
42
    if (sheetSize == 0)
43
43
        return;
44
44
 
48
48
    NTetrahedron** upper = new NTetrahedron*[sheetSize];
49
49
    unsigned long i;
50
50
    for (i = 0; i < sheetSize; i++)
51
 
        upper[i] = newTetrahedron(tetrahedra[i]->getDescription());
 
51
        upper[i] = newTetrahedron(tetrahedra_[i]->getDescription());
52
52
 
53
53
    // Reset each tetrahedron orientation.
54
 
    TetrahedronIterator tit = tetrahedra.begin();
 
54
    TetrahedronIterator tit = tetrahedra_.begin();
55
55
    for (i = 0; i < sheetSize; i++) {
56
 
        (*tit++)->tetOrientation = 0;
57
 
        upper[i]->tetOrientation = 0;
 
56
        (*tit++)->tetOrientation_ = 0;
 
57
        upper[i]->tetOrientation_ = 0;
58
58
    }
59
59
 
60
60
    // Run through the upper sheet and recreate the gluings as we
69
69
    int lowerAdjOrientation;
70
70
    NPerm4 gluing;
71
71
    for (i = 0; i < sheetSize; i++)
72
 
        if (upper[i]->tetOrientation == 0) {
 
72
        if (upper[i]->tetOrientation_ == 0) {
73
73
            // We've found a new component.
74
74
            // Completely recreate the gluings for this component.
75
 
            upper[i]->tetOrientation = 1;
76
 
            tetrahedra[i]->tetOrientation = -1;
 
75
            upper[i]->tetOrientation_ = 1;
 
76
            tetrahedra_[i]->tetOrientation_ = -1;
77
77
            tetQueue.push(i);
78
78
 
79
79
            while (! tetQueue.empty()) {
80
80
                upperTet = tetQueue.front();
81
81
                tetQueue.pop();
82
 
                lowerTet = tetrahedra[upperTet];
 
82
                lowerTet = tetrahedra_[upperTet];
83
83
 
84
84
                for (face = 0; face < 4; face++) {
85
85
                    lowerAdj = lowerTet->adjacentTetrahedron(face);
98
98
                    // adjacent tetrahedron in the lower sheet.
99
99
                    gluing = lowerTet->adjacentGluing(face);
100
100
                    lowerAdjOrientation = (gluing.sign() == 1 ?
101
 
                        -lowerTet->tetOrientation : lowerTet->tetOrientation);
 
101
                        -lowerTet->tetOrientation_ : lowerTet->tetOrientation_);
102
102
 
103
103
                    upperAdj = tetrahedronIndex(lowerAdj);
104
 
                    if (lowerAdj->tetOrientation == 0) {
 
104
                    if (lowerAdj->tetOrientation_ == 0) {
105
105
                        // We haven't seen the adjacent tetrahedron yet.
106
 
                        lowerAdj->tetOrientation = lowerAdjOrientation;
107
 
                        upper[upperAdj]->tetOrientation = -lowerAdjOrientation;
 
106
                        lowerAdj->tetOrientation_ = lowerAdjOrientation;
 
107
                        upper[upperAdj]->tetOrientation_ = -lowerAdjOrientation;
108
108
                        upper[upperTet]->joinTo(face, upper[upperAdj], gluing);
109
109
                        tetQueue.push(upperAdj);
110
 
                    } else if (lowerAdj->tetOrientation ==
 
110
                    } else if (lowerAdj->tetOrientation_ ==
111
111
                            lowerAdjOrientation) {
112
112
                        // The adjacent tetrahedron already has the
113
113
                        // correct orientation.