1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187
|
/**************************************************************************
* *
* Regina - A Normal Surface Theory Calculator *
* Computational Engine *
* *
* Copyright (c) 1999-2008, Ben Burton *
* For further details contact Ben Burton (bab@debian.org). *
* *
* This program is free software; you can redistribute it and/or *
* modify it under the terms of the GNU General Public License as *
* published by the Free Software Foundation; either version 2 of the *
* License, or (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, but *
* WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
* General Public License for more details. *
* *
* You should have received a copy of the GNU General Public *
* License along with this program; if not, write to the Free *
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, *
* MA 02110-1301, USA. *
* *
**************************************************************************/
/* end stub */
#include "algebra/nabeliangroup.h"
#include "manifold/nhandlebody.h"
#include "subcomplex/ntrisolidtorus.h"
#include "subcomplex/nlayeredchain.h"
#include "triangulation/ntetrahedron.h"
namespace regina {
NTriSolidTorus* NTriSolidTorus::clone() const {
NTriSolidTorus* ans = new NTriSolidTorus();
for (int i = 0; i < 3; i++) {
ans->tet[i] = tet[i];
ans->vertexRoles[i] = vertexRoles[i];
}
return ans;
}
bool NTriSolidTorus::isAnnulusSelfIdentified(int index, NPerm* roleMap) const {
int lower = (index + 1) % 3;
int upper = (index + 2) % 3;
if (tet[lower]->getAdjacentTetrahedron(vertexRoles[lower][2]) !=
tet[upper])
return false;
if (tet[lower]->getAdjacentFace(vertexRoles[lower][2]) !=
vertexRoles[upper][1])
return false;
// We have a self-identification.
if (roleMap)
*roleMap = vertexRoles[upper].inverse() *
tet[lower]->getAdjacentTetrahedronGluing(vertexRoles[lower][2]) *
vertexRoles[lower];
return true;
}
unsigned long NTriSolidTorus::areAnnuliLinkedMajor(int otherAnnulus) const {
int right = (otherAnnulus + 1) % 3;
int left = (otherAnnulus + 2) % 3;
NTetrahedron* adj = tet[right]->getAdjacentTetrahedron(
vertexRoles[right][1]);
if (adj != tet[left]->getAdjacentTetrahedron(vertexRoles[left][2]))
return 0;
if (adj == tet[0] || adj == tet[1] || adj == tet[2] || adj == 0)
return 0;
NPerm roles = tet[right]->getAdjacentTetrahedronGluing(
vertexRoles[right][1]) * vertexRoles[right] * NPerm(2, 3, 1, 0);
if (roles != tet[left]->getAdjacentTetrahedronGluing(
vertexRoles[left][2]) * vertexRoles[left] * NPerm(3, 2, 0, 1))
return 0;
// We've successfully identified the first tetrahedron of the
// layered chain.
NLayeredChain chain(adj, roles);
chain.extendMaximal();
if (chain.getTop() != tet[otherAnnulus])
return 0;
if (chain.getTopVertexRoles() != vertexRoles[otherAnnulus] *
NPerm(0, 1, 2, 3))
return 0;
// Success!
return chain.getIndex() - 1;
}
unsigned long NTriSolidTorus::areAnnuliLinkedAxis(int otherAnnulus) const {
int right = (otherAnnulus + 1) % 3;
int left = (otherAnnulus + 2) % 3;
NTetrahedron* adj = tet[right]->getAdjacentTetrahedron(
vertexRoles[right][1]);
if (adj != tet[otherAnnulus]->getAdjacentTetrahedron(
vertexRoles[otherAnnulus][2]))
return 0;
if (adj == tet[0] || adj == tet[1] || adj == tet[2] || adj == 0)
return 0;
NPerm roles = tet[right]->getAdjacentTetrahedronGluing(
vertexRoles[right][1]) * vertexRoles[right] * NPerm(2, 1, 0, 3);
if (roles != tet[otherAnnulus]->getAdjacentTetrahedronGluing(
vertexRoles[otherAnnulus][2]) * vertexRoles[otherAnnulus] *
NPerm(0, 3, 2, 1))
return 0;
// We've successfully identified the first tetrahedron of the
// layered chain.
NLayeredChain chain(adj, roles);
chain.extendMaximal();
NTetrahedron* top = chain.getTop();
NPerm topRoles(chain.getTopVertexRoles());
if (top->getAdjacentTetrahedron(topRoles[3]) != tet[left])
return 0;
if (top->getAdjacentTetrahedron(topRoles[0]) != tet[otherAnnulus])
return 0;
if (topRoles != tet[left]->getAdjacentTetrahedronGluing(
vertexRoles[left][2]) * vertexRoles[left] * NPerm(3, 0, 1, 2))
return 0;
if (topRoles != tet[otherAnnulus]->getAdjacentTetrahedronGluing(
vertexRoles[otherAnnulus][1]) * vertexRoles[otherAnnulus] *
NPerm(1, 2, 3, 0))
return 0;
// Success!
return chain.getIndex();
}
NTriSolidTorus* NTriSolidTorus::formsTriSolidTorus(NTetrahedron* tet,
NPerm useVertexRoles) {
NTriSolidTorus* ans = new NTriSolidTorus();
ans->tet[0] = tet;
ans->vertexRoles[0] = useVertexRoles;
// Find the adjacent tetrahedra.
ans->tet[1] = tet->getAdjacentTetrahedron(useVertexRoles[0]);
ans->tet[2] = tet->getAdjacentTetrahedron(useVertexRoles[3]);
// Check that we have three distinct tetrahedra.
if (ans->tet[1] == 0 || ans->tet[2] == 0 || ans->tet[1] == tet ||
ans->tet[2] == tet || ans->tet[1] == ans->tet[2]) {
delete ans;
return 0;
}
// Find the vertex roles for tetrahedra 1 and 2.
ans->vertexRoles[1] = tet->getAdjacentTetrahedronGluing(useVertexRoles[0])
* useVertexRoles * NPerm(1, 2, 3, 0);
ans->vertexRoles[2] = tet->getAdjacentTetrahedronGluing(useVertexRoles[3])
* useVertexRoles * NPerm(3, 0, 1, 2);
// Finally, check that tetrahedra 1 and 2 are glued together
// properly.
NPerm roles1 = ans->vertexRoles[1];
if (ans->tet[1]->getAdjacentTetrahedron(roles1[0]) != ans->tet[2]) {
delete ans;
return 0;
}
if (ans->tet[1]->getAdjacentTetrahedronGluing(roles1[0]) * roles1 *
NPerm(1, 2, 3, 0) != ans->vertexRoles[2]) {
delete ans;
return 0;
}
// We have the desired structure!
return ans;
}
NAbelianGroup* NTriSolidTorus::getHomologyH1() const {
NAbelianGroup* ans = new NAbelianGroup();
ans->addRank();
return ans;
}
NManifold* NTriSolidTorus::getManifold() const {
return new NHandlebody(1, true);
}
} // namespace regina
|