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

« back to all changes in this revision

Viewing changes to engine/subcomplex/npluggedtorusbundle.cpp

  • Committer: Package Import Robot
  • Author(s): Ben Burton
  • Date: 2012-05-29 08:46:45 UTC
  • mfrom: (1.2.6)
  • Revision ID: package-import@ubuntu.com-20120529084645-ngrfs6rqtrwklrue
Tags: 4.93-1
New upstream release.

Show diffs side-by-side

added added

removed removed

Lines of Context:
56
56
}
57
57
 
58
58
NManifold* NPluggedTorusBundle::getManifold() const {
59
 
    NSFSpace* sfs = region_->createSFS(2, false);
 
59
    int nRegionBdries = 0;
 
60
 
 
61
    // How many boundary components does the saturated region have?
 
62
    // We know there are two boundary annuli, so we simply need to test
 
63
    // whether they are adjacent in the region boundary.
 
64
    unsigned long i;
 
65
    NSatBlock *b;
 
66
    for (i = 0; i < region_->numberOfBlocks(); ++i) {
 
67
        b = region_->block(i).block;
 
68
        if (b->nAnnuli() == 0)
 
69
            continue;
 
70
        if (b->nAnnuli() > 1) {
 
71
            nRegionBdries = 1;
 
72
            break;
 
73
        }
 
74
        NSatBlock* nextBlock;
 
75
        unsigned nextAnnulus;
 
76
        bool refVert, refHoriz;
 
77
        b->nextBoundaryAnnulus(0, nextBlock, nextAnnulus, refVert, refHoriz);
 
78
        nRegionBdries = (nextBlock == b ? 2 : 1);
 
79
    }
 
80
    if (nRegionBdries == 0) {
 
81
        // Should never reach this point.
 
82
        std::cerr << "ERROR: Could not find saturated region boundary."
 
83
            << std::endl;
 
84
    }
 
85
 
 
86
    NSFSpace* sfs = region_->createSFS(nRegionBdries, false);
60
87
    if (! sfs)
61
88
        return 0;
 
89
    if (nRegionBdries == 1) {
 
90
        // The region has one larger boundary, but we pinch it to create
 
91
        // two smaller boundaries.
 
92
        sfs->addPuncture();
 
93
    }
62
94
 
63
95
    sfs->reduce(false);
64
96