1
// Wild Magic Source Code
3
// http://www.geometrictools.com
4
// Copyright (c) 1998-2007
6
// This library is free software; you can redistribute it and/or modify it
7
// under the terms of the GNU Lesser General Public License as published by
8
// the Free Software Foundation; either version 2.1 of the License, or (at
9
// your option) any later version. The license is available for reading at
10
// either of the locations:
11
// http://www.gnu.org/copyleft/lgpl.html
12
// http://www.geometrictools.com/License/WildMagicLicense.pdf
13
// The license applies to versions 0 through 4 of Wild Magic.
15
// Version: 4.0.0 (2006/06/28)
17
#ifndef WM4VEMANIFOLDMESH_H
18
#define WM4VEMANIFOLDMESH_H
20
#include "Wm4FoundationLIB.h"
21
#include "Wm4System.h"
26
class WM4_FOUNDATION_ITEM VEManifoldMesh
32
typedef const Vertex* VCPtr;
33
typedef VPtr (*VCreator)(int);
34
typedef std::map<int,Vertex*> VMap;
35
typedef VMap::iterator VMapIterator;
36
typedef VMap::const_iterator VMapCIterator;
41
typedef const Edge* ECPtr;
42
typedef EPtr (*ECreator)(int,int);
43
typedef std::map<std::pair<int,int>,Edge*> EMap;
44
typedef EMap::iterator EMapIterator;
45
typedef EMap::const_iterator EMapCIterator;
48
class WM4_FOUNDATION_ITEM Vertex
59
class WM4_FOUNDATION_ITEM Edge
62
Edge (int iV0, int iV1);
65
// vertices, listed as a directed edge <V[0],V[1]>
69
// E[0] points to edge sharing V[0]
70
// E[1] points to edge sharing V[1]
75
// construction and destruction
76
VEManifoldMesh (VCreator oVCreator = 0, ECreator oECreator = 0);
77
virtual ~VEManifoldMesh ();
80
const VMap& GetVertices () const;
81
const EMap& GetEdges () const;
84
EPtr InsertEdge (int iV0, int iV1);
85
bool RemoveEdge (int iV0, int iV1);
87
// manifold mesh is closed if each vertex is shared twice
88
bool IsClosed () const;
90
void Print (const char* acFilename);
94
static VPtr CreateVertex (int iV0);
99
static EPtr CreateEdge (int iV0, int iV1);
100
ECreator m_oECreator;
104
#include "Wm4VEManifoldMesh.inl"