/usr/include/libwildmagic/Wm5TSManifoldMesh.h is in libwildmagic-dev 5.13-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
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 | // Geometric Tools, LLC
// Copyright (c) 1998-2014
// Distributed under the Boost Software License, Version 1.0.
// http://www.boost.org/LICENSE_1_0.txt
// http://www.geometrictools.com/License/Boost/LICENSE_1_0.txt
//
// File Version: 5.10.1 (2014/01/21)
#ifndef WM5TSMANIFOLDMESH_H
#define WM5TSMANIFOLDMESH_H
#include "Wm5TriangleKey.h"
#include "Wm5TetrahedronKey.h"
namespace Wm5
{
class WM5_MATHEMATICS_ITEM TSManifoldMesh
{
public:
// Triangle data types.
class Triangle;
typedef Triangle* (*TCreator)(int, int, int);
typedef std::map<UnorderedTriangleKey, Triangle*> TMap;
typedef TMap::iterator TMapIterator;
typedef TMap::const_iterator TMapCIterator;
// Tetrahedron data types.
class Tetrahedron;
typedef Tetrahedron* (*SCreator)(int, int, int, int);
typedef std::map<TetrahedronKey, Tetrahedron*> SMap;
typedef SMap::iterator SMapIterator;
typedef SMap::const_iterator SMapCIterator;
// Triangle object.
class WM5_MATHEMATICS_ITEM Triangle
{
public:
virtual ~Triangle();
Triangle(int v0, int v1, int v2);
// Vertices of the face.
int V[3];
// Tetrahedra sharing the face.
Tetrahedron* T[2];
};
// Tetrahedron object.
class WM5_MATHEMATICS_ITEM Tetrahedron
{
public:
virtual ~Tetrahedron();
Tetrahedron(int v0, int v1, int v2, int v3);
// Vertices, listed in an order so that each face vertices in
// counterclockwise order when viewed from outside the tetrahedron.
int V[4];
// Adjacent faces. T[i] points to the triangle face opposite V[i].
// T[0] points to face (V[1],V[2],V[3])
// T[1] points to face (V[0],V[3],V[2])
// T[2] points to face (V[0],V[1],V[3])
// T[3] points to face (V[0],V[2],V[1])
Triangle* T[4];
// Adjacent tetrahedra. S[i] points to the adjacent tetrahedron
// sharing face T[i].
Tetrahedron* S[4];
};
// Construction and destruction.
virtual ~TSManifoldMesh();
TSManifoldMesh(TCreator tCreator = 0, SCreator sCreator = 0);
// Member access.
const TMap& GetTriangles() const;
const SMap& GetTetrahedra() const;
// If <v0,v1,v2,v3> is not in the mesh, a Tetrahedron object is created
// and returned; otherwise, <v0,v1,v2,v3> is in the mesh and nullptr is
// returned. If the insertion leads to a nonmanifold mesh, the call
// fails with a null pointer returned.
Tetrahedron* Insert(int v0, int v1, int v2, int v3);
// If <v0,v1,v2,v3> is in the mesh, it is removed and 'true' is returned;
// otherwise, <v0,v1,v2,v3> is not in the mesh and 'false' is returned.
bool Remove(int v0, int v1, int v2, int v3);
// A manifold mesh is closed if each face is shared twice.
bool IsClosed() const;
// For debugging. The function returns 'true' iff the text file has been
// created and saved.
bool Print(const char* filename);
protected:
// The triangle data and default triangle creation.
static Triangle* CreateTriangle(int v0, int v1, int v2);
TCreator mTCreator;
TMap mTMap;
// The tetrahedron data and default tetrahedron creation.
static Tetrahedron* CreateTetrahedron(int v0, int v1, int v2, int v3);
SCreator mSCreator;
SMap mSMap;
};
}
#endif
|